Compare commits
7 Commits
72b9dcddc1
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
015faf9cf4 | ||
|
|
4cc2add220 | ||
|
|
fa851bc5b1 | ||
|
|
3bdfa9e657 | ||
|
|
7d344729c3 | ||
|
|
3dd032e238 | ||
|
|
4050afe93f |
3
.gitignore
vendored
@@ -2,8 +2,7 @@ node_modules
|
||||
*.build.js
|
||||
*.zip
|
||||
*.xpi
|
||||
/extension/releases/*.zip
|
||||
/extension/releases/*.xpi
|
||||
/extension/releases/*/*
|
||||
/extension/output/*.js
|
||||
/extension/output/*.html
|
||||
/extension/output/*.css
|
||||
|
||||
@@ -1,692 +0,0 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 56;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
31677A162B15715C00E466BD /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31677A152B15715C00E466BD /* AppDelegate.swift */; };
|
||||
31677A192B15715C00E466BD /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 31677A172B15715C00E466BD /* Main.storyboard */; };
|
||||
31677A2B2B15715C00E466BD /* Nostr Connect Extension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 31677A2A2B15715C00E466BD /* Nostr Connect Extension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
|
||||
31677A322B15715C00E466BD /* Main.html in Resources */ = {isa = PBXBuildFile; fileRef = 316779F42B15715B00E466BD /* Main.html */; };
|
||||
31677A342B15715C00E466BD /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 316779F62B15715B00E466BD /* Icon.png */; };
|
||||
31677A362B15715C00E466BD /* Style.css in Resources */ = {isa = PBXBuildFile; fileRef = 316779F72B15715B00E466BD /* Style.css */; };
|
||||
31677A382B15715C00E466BD /* Script.js in Resources */ = {isa = PBXBuildFile; fileRef = 316779F82B15715B00E466BD /* Script.js */; };
|
||||
31677A3A2B15715C00E466BD /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 316779F92B15715B00E466BD /* ViewController.swift */; };
|
||||
31677A3C2B15715C00E466BD /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 316779FA2B15715C00E466BD /* Assets.xcassets */; };
|
||||
31677A3E2B15715C00E466BD /* SafariWebExtensionHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 316779FC2B15715C00E466BD /* SafariWebExtensionHandler.swift */; };
|
||||
31677A5D2B15715C00E466BD /* popup.html in Resources */ = {isa = PBXBuildFile; fileRef = 31677A502B15715C00E466BD /* popup.html */; };
|
||||
31677A5E2B15715C00E466BD /* nostr-provider.js in Resources */ = {isa = PBXBuildFile; fileRef = 31677A512B15715C00E466BD /* nostr-provider.js */; };
|
||||
31677A5F2B15715C00E466BD /* options.build.js in Resources */ = {isa = PBXBuildFile; fileRef = 31677A522B15715C00E466BD /* options.build.js */; };
|
||||
31677A602B15715C00E466BD /* background.build.js in Resources */ = {isa = PBXBuildFile; fileRef = 31677A532B15715C00E466BD /* background.build.js */; };
|
||||
31677A612B15715C00E466BD /* content-script.build.js in Resources */ = {isa = PBXBuildFile; fileRef = 31677A542B15715C00E466BD /* content-script.build.js */; };
|
||||
31677A622B15715C00E466BD /* icons in Resources */ = {isa = PBXBuildFile; fileRef = 31677A552B15715C00E466BD /* icons */; };
|
||||
31677A632B15715C00E466BD /* prompt.html in Resources */ = {isa = PBXBuildFile; fileRef = 31677A562B15715C00E466BD /* prompt.html */; };
|
||||
31677A642B15715C00E466BD /* style.css in Resources */ = {isa = PBXBuildFile; fileRef = 31677A572B15715C00E466BD /* style.css */; };
|
||||
31677A652B15715C00E466BD /* manifest.json in Resources */ = {isa = PBXBuildFile; fileRef = 31677A582B15715C00E466BD /* manifest.json */; };
|
||||
31677A662B15715C00E466BD /* prompt.build.js in Resources */ = {isa = PBXBuildFile; fileRef = 31677A592B15715C00E466BD /* prompt.build.js */; };
|
||||
31677A672B15715C00E466BD /* options.html in Resources */ = {isa = PBXBuildFile; fileRef = 31677A5A2B15715C00E466BD /* options.html */; };
|
||||
31677A682B15715C00E466BD /* common.js in Resources */ = {isa = PBXBuildFile; fileRef = 31677A5B2B15715C00E466BD /* common.js */; };
|
||||
31677A692B15715C00E466BD /* popup.build.js in Resources */ = {isa = PBXBuildFile; fileRef = 31677A5C2B15715C00E466BD /* popup.build.js */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
31677A2C2B15715C00E466BD /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 316779EE2B15715B00E466BD /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 31677A292B15715C00E466BD;
|
||||
remoteInfo = "Nostr Connect Extension (macOS)";
|
||||
};
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
31677A4B2B15715C00E466BD /* Embed Foundation Extensions */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 13;
|
||||
files = (
|
||||
31677A2B2B15715C00E466BD /* Nostr Connect Extension.appex in Embed Foundation Extensions */,
|
||||
);
|
||||
name = "Embed Foundation Extensions";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
316779F52B15715B00E466BD /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.html; name = Base; path = ../Base.lproj/Main.html; sourceTree = "<group>"; };
|
||||
316779F62B15715B00E466BD /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Icon.png; sourceTree = "<group>"; };
|
||||
316779F72B15715B00E466BD /* Style.css */ = {isa = PBXFileReference; lastKnownFileType = text.css; path = Style.css; sourceTree = "<group>"; };
|
||||
316779F82B15715B00E466BD /* Script.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = Script.js; sourceTree = "<group>"; };
|
||||
316779F92B15715B00E466BD /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
|
||||
316779FA2B15715C00E466BD /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
316779FC2B15715C00E466BD /* SafariWebExtensionHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SafariWebExtensionHandler.swift; sourceTree = "<group>"; };
|
||||
31677A042B15715C00E466BD /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
31677A062B15715C00E466BD /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
|
||||
31677A092B15715C00E466BD /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
31677A0C2B15715C00E466BD /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
|
||||
31677A0E2B15715C00E466BD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
31677A132B15715C00E466BD /* Nostr Connect.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Nostr Connect.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
31677A152B15715C00E466BD /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
31677A182B15715C00E466BD /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
|
||||
31677A1A2B15715C00E466BD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
31677A1B2B15715C00E466BD /* Nostr Connect.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "Nostr Connect.entitlements"; sourceTree = "<group>"; };
|
||||
31677A252B15715C00E466BD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
31677A2A2B15715C00E466BD /* Nostr Connect Extension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "Nostr Connect Extension.appex"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
31677A2F2B15715C00E466BD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
31677A302B15715C00E466BD /* Nostr Connect.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "Nostr Connect.entitlements"; sourceTree = "<group>"; };
|
||||
31677A502B15715C00E466BD /* popup.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; name = popup.html; path = ../../extension/output/popup.html; sourceTree = "<group>"; };
|
||||
31677A512B15715C00E466BD /* nostr-provider.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; name = "nostr-provider.js"; path = "../../extension/output/nostr-provider.js"; sourceTree = "<group>"; };
|
||||
31677A522B15715C00E466BD /* options.build.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; name = options.build.js; path = ../../extension/output/options.build.js; sourceTree = "<group>"; };
|
||||
31677A532B15715C00E466BD /* background.build.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; name = background.build.js; path = ../../extension/output/background.build.js; sourceTree = "<group>"; };
|
||||
31677A542B15715C00E466BD /* content-script.build.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; name = "content-script.build.js"; path = "../../extension/output/content-script.build.js"; sourceTree = "<group>"; };
|
||||
31677A552B15715C00E466BD /* icons */ = {isa = PBXFileReference; lastKnownFileType = folder; name = icons; path = ../../extension/output/icons; sourceTree = "<group>"; };
|
||||
31677A562B15715C00E466BD /* prompt.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; name = prompt.html; path = ../../extension/output/prompt.html; sourceTree = "<group>"; };
|
||||
31677A572B15715C00E466BD /* style.css */ = {isa = PBXFileReference; lastKnownFileType = text.css; name = style.css; path = ../../extension/output/style.css; sourceTree = "<group>"; };
|
||||
31677A582B15715C00E466BD /* manifest.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; name = manifest.json; path = ../../extension/output/manifest.json; sourceTree = "<group>"; };
|
||||
31677A592B15715C00E466BD /* prompt.build.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; name = prompt.build.js; path = ../../extension/output/prompt.build.js; sourceTree = "<group>"; };
|
||||
31677A5A2B15715C00E466BD /* options.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; name = options.html; path = ../../extension/output/options.html; sourceTree = "<group>"; };
|
||||
31677A5B2B15715C00E466BD /* common.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; name = common.js; path = ../../extension/output/common.js; sourceTree = "<group>"; };
|
||||
31677A5C2B15715C00E466BD /* popup.build.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; name = popup.build.js; path = ../../extension/output/popup.build.js; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
31677A102B15715C00E466BD /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
31677A272B15715C00E466BD /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
316779ED2B15715B00E466BD = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
316779F22B15715B00E466BD /* Shared (App) */,
|
||||
316779FB2B15715C00E466BD /* Shared (Extension) */,
|
||||
31677A032B15715C00E466BD /* iOS (App) */,
|
||||
31677A142B15715C00E466BD /* macOS (App) */,
|
||||
31677A242B15715C00E466BD /* iOS (Extension) */,
|
||||
31677A2E2B15715C00E466BD /* macOS (Extension) */,
|
||||
31677A022B15715C00E466BD /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
316779F22B15715B00E466BD /* Shared (App) */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
316779F92B15715B00E466BD /* ViewController.swift */,
|
||||
316779FA2B15715C00E466BD /* Assets.xcassets */,
|
||||
316779F32B15715B00E466BD /* Resources */,
|
||||
);
|
||||
path = "Shared (App)";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
316779F32B15715B00E466BD /* Resources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
316779F42B15715B00E466BD /* Main.html */,
|
||||
316779F62B15715B00E466BD /* Icon.png */,
|
||||
316779F72B15715B00E466BD /* Style.css */,
|
||||
316779F82B15715B00E466BD /* Script.js */,
|
||||
);
|
||||
path = Resources;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
316779FB2B15715C00E466BD /* Shared (Extension) */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
31677A4F2B15715C00E466BD /* Resources */,
|
||||
316779FC2B15715C00E466BD /* SafariWebExtensionHandler.swift */,
|
||||
);
|
||||
path = "Shared (Extension)";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
31677A022B15715C00E466BD /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
31677A132B15715C00E466BD /* Nostr Connect.app */,
|
||||
31677A2A2B15715C00E466BD /* Nostr Connect Extension.appex */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
31677A032B15715C00E466BD /* iOS (App) */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
31677A042B15715C00E466BD /* AppDelegate.swift */,
|
||||
31677A062B15715C00E466BD /* SceneDelegate.swift */,
|
||||
31677A082B15715C00E466BD /* LaunchScreen.storyboard */,
|
||||
31677A0B2B15715C00E466BD /* Main.storyboard */,
|
||||
31677A0E2B15715C00E466BD /* Info.plist */,
|
||||
);
|
||||
path = "iOS (App)";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
31677A142B15715C00E466BD /* macOS (App) */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
31677A152B15715C00E466BD /* AppDelegate.swift */,
|
||||
31677A172B15715C00E466BD /* Main.storyboard */,
|
||||
31677A1A2B15715C00E466BD /* Info.plist */,
|
||||
31677A1B2B15715C00E466BD /* Nostr Connect.entitlements */,
|
||||
);
|
||||
path = "macOS (App)";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
31677A242B15715C00E466BD /* iOS (Extension) */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
31677A252B15715C00E466BD /* Info.plist */,
|
||||
);
|
||||
path = "iOS (Extension)";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
31677A2E2B15715C00E466BD /* macOS (Extension) */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
31677A2F2B15715C00E466BD /* Info.plist */,
|
||||
31677A302B15715C00E466BD /* Nostr Connect.entitlements */,
|
||||
);
|
||||
path = "macOS (Extension)";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
31677A4F2B15715C00E466BD /* Resources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
31677A502B15715C00E466BD /* popup.html */,
|
||||
31677A512B15715C00E466BD /* nostr-provider.js */,
|
||||
31677A522B15715C00E466BD /* options.build.js */,
|
||||
31677A532B15715C00E466BD /* background.build.js */,
|
||||
31677A542B15715C00E466BD /* content-script.build.js */,
|
||||
31677A552B15715C00E466BD /* icons */,
|
||||
31677A562B15715C00E466BD /* prompt.html */,
|
||||
31677A572B15715C00E466BD /* style.css */,
|
||||
31677A582B15715C00E466BD /* manifest.json */,
|
||||
31677A592B15715C00E466BD /* prompt.build.js */,
|
||||
31677A5A2B15715C00E466BD /* options.html */,
|
||||
31677A5B2B15715C00E466BD /* common.js */,
|
||||
31677A5C2B15715C00E466BD /* popup.build.js */,
|
||||
);
|
||||
name = Resources;
|
||||
path = "Shared (Extension)";
|
||||
sourceTree = SOURCE_ROOT;
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
31677A122B15715C00E466BD /* Nostr Connect (macOS) */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 31677A4C2B15715C00E466BD /* Build configuration list for PBXNativeTarget "Nostr Connect (macOS)" */;
|
||||
buildPhases = (
|
||||
31677A0F2B15715C00E466BD /* Sources */,
|
||||
31677A102B15715C00E466BD /* Frameworks */,
|
||||
31677A112B15715C00E466BD /* Resources */,
|
||||
31677A4B2B15715C00E466BD /* Embed Foundation Extensions */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
31677A2D2B15715C00E466BD /* PBXTargetDependency */,
|
||||
);
|
||||
name = "Nostr Connect (macOS)";
|
||||
productName = "Nostr Connect (macOS)";
|
||||
productReference = 31677A132B15715C00E466BD /* Nostr Connect.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
31677A292B15715C00E466BD /* Nostr Connect Extension (macOS) */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 31677A482B15715C00E466BD /* Build configuration list for PBXNativeTarget "Nostr Connect Extension (macOS)" */;
|
||||
buildPhases = (
|
||||
31677A262B15715C00E466BD /* Sources */,
|
||||
31677A272B15715C00E466BD /* Frameworks */,
|
||||
31677A282B15715C00E466BD /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = "Nostr Connect Extension (macOS)";
|
||||
productName = "Nostr Connect Extension (macOS)";
|
||||
productReference = 31677A2A2B15715C00E466BD /* Nostr Connect Extension.appex */;
|
||||
productType = "com.apple.product-type.app-extension";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
316779EE2B15715B00E466BD /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
BuildIndependentTargetsInParallel = 1;
|
||||
LastSwiftUpdateCheck = 1500;
|
||||
LastUpgradeCheck = 1500;
|
||||
TargetAttributes = {
|
||||
31677A122B15715C00E466BD = {
|
||||
CreatedOnToolsVersion = 15.0;
|
||||
};
|
||||
31677A292B15715C00E466BD = {
|
||||
CreatedOnToolsVersion = 15.0;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 316779F12B15715B00E466BD /* Build configuration list for PBXProject "Nostr Connect" */;
|
||||
compatibilityVersion = "Xcode 14.0";
|
||||
developmentRegion = en;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
Base,
|
||||
);
|
||||
mainGroup = 316779ED2B15715B00E466BD;
|
||||
productRefGroup = 31677A022B15715C00E466BD /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
31677A122B15715C00E466BD /* Nostr Connect (macOS) */,
|
||||
31677A292B15715C00E466BD /* Nostr Connect Extension (macOS) */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
31677A112B15715C00E466BD /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
31677A342B15715C00E466BD /* Icon.png in Resources */,
|
||||
31677A362B15715C00E466BD /* Style.css in Resources */,
|
||||
31677A192B15715C00E466BD /* Main.storyboard in Resources */,
|
||||
31677A382B15715C00E466BD /* Script.js in Resources */,
|
||||
31677A3C2B15715C00E466BD /* Assets.xcassets in Resources */,
|
||||
31677A322B15715C00E466BD /* Main.html in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
31677A282B15715C00E466BD /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
31677A602B15715C00E466BD /* background.build.js in Resources */,
|
||||
31677A642B15715C00E466BD /* style.css in Resources */,
|
||||
31677A632B15715C00E466BD /* prompt.html in Resources */,
|
||||
31677A5F2B15715C00E466BD /* options.build.js in Resources */,
|
||||
31677A672B15715C00E466BD /* options.html in Resources */,
|
||||
31677A662B15715C00E466BD /* prompt.build.js in Resources */,
|
||||
31677A652B15715C00E466BD /* manifest.json in Resources */,
|
||||
31677A5E2B15715C00E466BD /* nostr-provider.js in Resources */,
|
||||
31677A622B15715C00E466BD /* icons in Resources */,
|
||||
31677A692B15715C00E466BD /* popup.build.js in Resources */,
|
||||
31677A682B15715C00E466BD /* common.js in Resources */,
|
||||
31677A612B15715C00E466BD /* content-script.build.js in Resources */,
|
||||
31677A5D2B15715C00E466BD /* popup.html in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
31677A0F2B15715C00E466BD /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
31677A3A2B15715C00E466BD /* ViewController.swift in Sources */,
|
||||
31677A162B15715C00E466BD /* AppDelegate.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
31677A262B15715C00E466BD /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
31677A3E2B15715C00E466BD /* SafariWebExtensionHandler.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
31677A2D2B15715C00E466BD /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 31677A292B15715C00E466BD /* Nostr Connect Extension (macOS) */;
|
||||
targetProxy = 31677A2C2B15715C00E466BD /* PBXContainerItemProxy */;
|
||||
};
|
||||
/* End PBXTargetDependency section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
316779F42B15715B00E466BD /* Main.html */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
316779F52B15715B00E466BD /* Base */,
|
||||
);
|
||||
name = Main.html;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
31677A082B15715C00E466BD /* LaunchScreen.storyboard */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
31677A092B15715C00E466BD /* Base */,
|
||||
);
|
||||
name = LaunchScreen.storyboard;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
31677A0B2B15715C00E466BD /* Main.storyboard */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
31677A0C2B15715C00E466BD /* Base */,
|
||||
);
|
||||
name = Main.storyboard;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
31677A172B15715C00E466BD /* Main.storyboard */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
31677A182B15715C00E466BD /* Base */,
|
||||
);
|
||||
name = Main.storyboard;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
31677A3F2B15715C00E466BD /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
ENABLE_USER_SCRIPT_SANDBOXING = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu17;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
|
||||
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||
MTL_FAST_MATH = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
31677A402B15715C00E466BD /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_USER_SCRIPT_SANDBOXING = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu17;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
MTL_FAST_MATH = YES;
|
||||
SWIFT_COMPILATION_MODE = wholemodule;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
31677A492B15715C00E466BD /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CODE_SIGN_ENTITLEMENTS = "macOS (Extension)/Nostr Connect.entitlements";
|
||||
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEVELOPMENT_TEAM = V757GRTBDF;
|
||||
ENABLE_HARDENED_RUNTIME = YES;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
INFOPLIST_FILE = "macOS (Extension)/Info.plist";
|
||||
INFOPLIST_KEY_CFBundleDisplayName = "Nostr Connect Extension";
|
||||
INFOPLIST_KEY_NSHumanReadableCopyright = "";
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/../Frameworks",
|
||||
"@executable_path/../../../../Frameworks",
|
||||
);
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.14;
|
||||
MARKETING_VERSION = 1.0;
|
||||
OTHER_LDFLAGS = (
|
||||
"-framework",
|
||||
SafariServices,
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.github.Nostr-Connect.Extension";
|
||||
PRODUCT_NAME = "Nostr Connect Extension";
|
||||
SDKROOT = macosx;
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_EMIT_LOC_STRINGS = YES;
|
||||
SWIFT_VERSION = 5.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
31677A4A2B15715C00E466BD /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CODE_SIGN_ENTITLEMENTS = "macOS (Extension)/Nostr Connect.entitlements";
|
||||
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEVELOPMENT_TEAM = V757GRTBDF;
|
||||
ENABLE_HARDENED_RUNTIME = YES;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
INFOPLIST_FILE = "macOS (Extension)/Info.plist";
|
||||
INFOPLIST_KEY_CFBundleDisplayName = "Nostr Connect Extension";
|
||||
INFOPLIST_KEY_NSHumanReadableCopyright = "";
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/../Frameworks",
|
||||
"@executable_path/../../../../Frameworks",
|
||||
);
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.14;
|
||||
MARKETING_VERSION = 1.0;
|
||||
OTHER_LDFLAGS = (
|
||||
"-framework",
|
||||
SafariServices,
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.github.Nostr-Connect.Extension";
|
||||
PRODUCT_NAME = "Nostr Connect Extension";
|
||||
SDKROOT = macosx;
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_EMIT_LOC_STRINGS = YES;
|
||||
SWIFT_VERSION = 5.0;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
31677A4D2B15715C00E466BD /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||
CODE_SIGN_ENTITLEMENTS = "macOS (App)/Nostr Connect.entitlements";
|
||||
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEVELOPMENT_TEAM = V757GRTBDF;
|
||||
ENABLE_HARDENED_RUNTIME = YES;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
INFOPLIST_FILE = "macOS (App)/Info.plist";
|
||||
INFOPLIST_KEY_CFBundleDisplayName = "Nostr Connect";
|
||||
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.developer-tools";
|
||||
INFOPLIST_KEY_NSMainStoryboardFile = Main;
|
||||
INFOPLIST_KEY_NSPrincipalClass = NSApplication;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/../Frameworks",
|
||||
);
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.14;
|
||||
MARKETING_VERSION = 1.0;
|
||||
OTHER_LDFLAGS = (
|
||||
"-framework",
|
||||
SafariServices,
|
||||
"-framework",
|
||||
WebKit,
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.github.Nostr-Connect";
|
||||
PRODUCT_NAME = "Nostr Connect";
|
||||
SDKROOT = macosx;
|
||||
SWIFT_EMIT_LOC_STRINGS = YES;
|
||||
SWIFT_VERSION = 5.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
31677A4E2B15715C00E466BD /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||
CODE_SIGN_ENTITLEMENTS = "macOS (App)/Nostr Connect.entitlements";
|
||||
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEVELOPMENT_TEAM = V757GRTBDF;
|
||||
ENABLE_HARDENED_RUNTIME = YES;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
INFOPLIST_FILE = "macOS (App)/Info.plist";
|
||||
INFOPLIST_KEY_CFBundleDisplayName = "Nostr Connect";
|
||||
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.developer-tools";
|
||||
INFOPLIST_KEY_NSMainStoryboardFile = Main;
|
||||
INFOPLIST_KEY_NSPrincipalClass = NSApplication;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/../Frameworks",
|
||||
);
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.14;
|
||||
MARKETING_VERSION = 1.0;
|
||||
OTHER_LDFLAGS = (
|
||||
"-framework",
|
||||
SafariServices,
|
||||
"-framework",
|
||||
WebKit,
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.github.Nostr-Connect";
|
||||
PRODUCT_NAME = "Nostr Connect";
|
||||
SDKROOT = macosx;
|
||||
SWIFT_EMIT_LOC_STRINGS = YES;
|
||||
SWIFT_VERSION = 5.0;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
316779F12B15715B00E466BD /* Build configuration list for PBXProject "Nostr Connect" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
31677A3F2B15715C00E466BD /* Debug */,
|
||||
31677A402B15715C00E466BD /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
31677A482B15715C00E466BD /* Build configuration list for PBXNativeTarget "Nostr Connect Extension (macOS)" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
31677A492B15715C00E466BD /* Debug */,
|
||||
31677A4A2B15715C00E466BD /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
31677A4C2B15715C00E466BD /* Build configuration list for PBXNativeTarget "Nostr Connect (macOS)" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
31677A4D2B15715C00E466BD /* Debug */,
|
||||
31677A4E2B15715C00E466BD /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 316779EE2B15715B00E466BD /* Project object */;
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1,19 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>SchemeUserState</key>
|
||||
<dict>
|
||||
<key>Nostr Connect (iOS).xcscheme_^#shared#^_</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>0</integer>
|
||||
</dict>
|
||||
<key>Nostr Connect (macOS).xcscheme_^#shared#^_</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>1</integer>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"colors" : [
|
||||
{
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"size" : "1024x1024",
|
||||
"idiom" : "universal",
|
||||
"filename" : "universal-icon-1024@1x.png",
|
||||
"platform" : "ios"
|
||||
},
|
||||
{
|
||||
"size" : "16x16",
|
||||
"idiom" : "mac",
|
||||
"filename" : "mac-icon-16@1x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "16x16",
|
||||
"idiom" : "mac",
|
||||
"filename" : "mac-icon-16@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "32x32",
|
||||
"idiom" : "mac",
|
||||
"filename" : "mac-icon-32@1x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "32x32",
|
||||
"idiom" : "mac",
|
||||
"filename" : "mac-icon-32@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "128x128",
|
||||
"idiom" : "mac",
|
||||
"filename" : "mac-icon-128@1x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "128x128",
|
||||
"idiom" : "mac",
|
||||
"filename" : "mac-icon-128@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "256x256",
|
||||
"idiom" : "mac",
|
||||
"filename" : "mac-icon-256@1x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "256x256",
|
||||
"idiom" : "mac",
|
||||
"filename" : "mac-icon-256@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "512x512",
|
||||
"idiom" : "mac",
|
||||
"filename" : "mac-icon-512@1x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "512x512",
|
||||
"idiom" : "mac",
|
||||
"filename" : "mac-icon-512@2x.png",
|
||||
"scale" : "2x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 766 B |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 106 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 106 KiB |
|
Before Width: | Height: | Size: 283 KiB |
|
Before Width: | Height: | Size: 233 KiB |
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x",
|
||||
"filename" : "icon128.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 15 KiB |
@@ -1,20 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Security-Policy" content="default-src 'self'">
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
|
||||
|
||||
<link rel="stylesheet" href="../Style.css">
|
||||
<script src="../Script.js" defer></script>
|
||||
</head>
|
||||
<body>
|
||||
<img src="../Icon.png" width="128" height="128" alt="Nostr Connect Icon">
|
||||
<p class="platform-ios">You can turn on Nostr Connect’s Safari extension in Settings.</p>
|
||||
<p class="platform-mac state-unknown">You can turn on Nostr Connect’s extension in Safari Extensions preferences.</p>
|
||||
<p class="platform-mac state-on">Nostr Connect’s extension is currently on. You can turn it off in Safari Extensions preferences.</p>
|
||||
<p class="platform-mac state-off">Nostr Connect’s extension is currently off. You can turn it on in Safari Extensions preferences.</p>
|
||||
<button class="platform-mac open-preferences">Quit and Open Safari Extensions Preferences…</button>
|
||||
</body>
|
||||
</html>
|
||||
|
Before Width: | Height: | Size: 15 KiB |
@@ -1,24 +0,0 @@
|
||||
function show(platform, enabled, useSettingsInsteadOfPreferences) {
|
||||
document.body.classList.add(`platform-${platform}`);
|
||||
|
||||
if (useSettingsInsteadOfPreferences) {
|
||||
document.getElementsByClassName('platform-mac state-on')[0].innerText = "Nostr Connect’s extension is currently on. You can turn it off in the Extensions section of Safari Settings.";
|
||||
document.getElementsByClassName('platform-mac state-off')[0].innerText = "Nostr Connect’s extension is currently off. You can turn it on in the Extensions section of Safari Settings.";
|
||||
document.getElementsByClassName('platform-mac state-unknown')[0].innerText = "You can turn on Nostr Connect’s extension in the Extensions section of Safari Settings.";
|
||||
document.getElementsByClassName('platform-mac open-preferences')[0].innerText = "Quit and Open Safari Settings…";
|
||||
}
|
||||
|
||||
if (typeof enabled === "boolean") {
|
||||
document.body.classList.toggle(`state-on`, enabled);
|
||||
document.body.classList.toggle(`state-off`, !enabled);
|
||||
} else {
|
||||
document.body.classList.remove(`state-on`);
|
||||
document.body.classList.remove(`state-off`);
|
||||
}
|
||||
}
|
||||
|
||||
function openPreferences() {
|
||||
webkit.messageHandlers.controller.postMessage("open-preferences");
|
||||
}
|
||||
|
||||
document.querySelector("button.open-preferences").addEventListener("click", openPreferences);
|
||||
@@ -1,61 +0,0 @@
|
||||
* {
|
||||
-webkit-user-select: none;
|
||||
-webkit-user-drag: none;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
:root {
|
||||
color-scheme: light dark;
|
||||
|
||||
--spacing: 20px;
|
||||
}
|
||||
|
||||
html {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
|
||||
gap: var(--spacing);
|
||||
margin: 0 calc(var(--spacing) * 2);
|
||||
height: 100%;
|
||||
|
||||
font: -apple-system-short-body;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
body:not(.platform-mac, .platform-ios) :is(.platform-mac, .platform-ios) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
body.platform-ios .platform-mac {
|
||||
display: none;
|
||||
}
|
||||
|
||||
body.platform-mac .platform-ios {
|
||||
display: none;
|
||||
}
|
||||
|
||||
body.platform-ios .platform-mac {
|
||||
display: none;
|
||||
}
|
||||
|
||||
body:not(.state-on, .state-off) :is(.state-on, .state-off) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
body.state-on :is(.state-off, .state-unknown) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
body.state-off :is(.state-on, .state-unknown) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
button {
|
||||
font-size: 1em;
|
||||
}
|
||||
@@ -1,81 +0,0 @@
|
||||
//
|
||||
// ViewController.swift
|
||||
// Shared (App)
|
||||
//
|
||||
// Created by Phong on 28/11/2023.
|
||||
//
|
||||
|
||||
import WebKit
|
||||
|
||||
#if os(iOS)
|
||||
import UIKit
|
||||
typealias PlatformViewController = UIViewController
|
||||
#elseif os(macOS)
|
||||
import Cocoa
|
||||
import SafariServices
|
||||
typealias PlatformViewController = NSViewController
|
||||
#endif
|
||||
|
||||
let extensionBundleIdentifier = "com.github.Nostr-Connect.Extension"
|
||||
|
||||
class ViewController: PlatformViewController, WKNavigationDelegate, WKScriptMessageHandler {
|
||||
|
||||
@IBOutlet var webView: WKWebView!
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
self.webView.navigationDelegate = self
|
||||
|
||||
#if os(iOS)
|
||||
self.webView.scrollView.isScrollEnabled = false
|
||||
#endif
|
||||
|
||||
self.webView.configuration.userContentController.add(self, name: "controller")
|
||||
|
||||
self.webView.loadFileURL(Bundle.main.url(forResource: "Main", withExtension: "html")!, allowingReadAccessTo: Bundle.main.resourceURL!)
|
||||
}
|
||||
|
||||
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
|
||||
#if os(iOS)
|
||||
webView.evaluateJavaScript("show('ios')")
|
||||
#elseif os(macOS)
|
||||
webView.evaluateJavaScript("show('mac')")
|
||||
|
||||
SFSafariExtensionManager.getStateOfSafariExtension(withIdentifier: extensionBundleIdentifier) { (state, error) in
|
||||
guard let state = state, error == nil else {
|
||||
// Insert code to inform the user that something went wrong.
|
||||
return
|
||||
}
|
||||
|
||||
DispatchQueue.main.async {
|
||||
if #available(macOS 13, *) {
|
||||
webView.evaluateJavaScript("show('mac', \(state.isEnabled), true)")
|
||||
} else {
|
||||
webView.evaluateJavaScript("show('mac', \(state.isEnabled), false)")
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) {
|
||||
#if os(macOS)
|
||||
if (message.body as! String != "open-preferences") {
|
||||
return
|
||||
}
|
||||
|
||||
SFSafariApplication.showPreferencesForExtension(withIdentifier: extensionBundleIdentifier) { error in
|
||||
guard error == nil else {
|
||||
// Insert code to inform the user that something went wrong.
|
||||
return
|
||||
}
|
||||
|
||||
DispatchQueue.main.async {
|
||||
NSApp.terminate(self)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
//
|
||||
// SafariWebExtensionHandler.swift
|
||||
// Shared (Extension)
|
||||
//
|
||||
// Created by Phong on 28/11/2023.
|
||||
//
|
||||
|
||||
import SafariServices
|
||||
import os.log
|
||||
|
||||
class SafariWebExtensionHandler: NSObject, NSExtensionRequestHandling {
|
||||
|
||||
func beginRequest(with context: NSExtensionContext) {
|
||||
let request = context.inputItems.first as? NSExtensionItem
|
||||
|
||||
let profile: UUID?
|
||||
if #available(iOS 17.0, macOS 14.0, *) {
|
||||
profile = request?.userInfo?[SFExtensionProfileKey] as? UUID
|
||||
} else {
|
||||
profile = request?.userInfo?["profile"] as? UUID
|
||||
}
|
||||
|
||||
let message: Any?
|
||||
if #available(iOS 17.0, macOS 14.0, *) {
|
||||
message = request?.userInfo?[SFExtensionMessageKey]
|
||||
} else {
|
||||
message = request?.userInfo?["message"]
|
||||
}
|
||||
|
||||
os_log(.default, "Received message from browser.runtime.sendNativeMessage: %@ (profile: %@)", String(describing: message), profile?.uuidString ?? "none")
|
||||
|
||||
let response = NSExtensionItem()
|
||||
response.userInfo = [ SFExtensionMessageKey: [ "echo": message ] ]
|
||||
|
||||
context.completeRequest(returningItems: [ response ], completionHandler: nil)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
//
|
||||
// AppDelegate.swift
|
||||
// iOS (App)
|
||||
//
|
||||
// Created by Phong on 28/11/2023.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
@main
|
||||
class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
|
||||
var window: UIWindow?
|
||||
|
||||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
|
||||
// Override point for customization after application launch.
|
||||
return true
|
||||
}
|
||||
|
||||
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
|
||||
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="19085" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19082"/>
|
||||
<capability name="Image references" minToolsVersion="12.0"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="EHf-IW-A2E">
|
||||
<objects>
|
||||
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
|
||||
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
|
||||
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="6HG-Um-bch">
|
||||
<rect key="frame" x="142" y="385" width="128" height="128"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
|
||||
<imageReference key="image" image="LargeIcon"/>
|
||||
</imageView>
|
||||
</subviews>
|
||||
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
|
||||
<color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="53" y="375"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
<resources>
|
||||
<image name="LargeIcon" width="128" height="128"/>
|
||||
</resources>
|
||||
</document>
|
||||
@@ -1,38 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="18122" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
|
||||
<device id="retina6_1" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="18093"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="tne-QT-ifu">
|
||||
<objects>
|
||||
<viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
|
||||
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<wkWebView contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="RDB-ib-igF">
|
||||
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<wkWebViewConfiguration key="configuration">
|
||||
<audiovisualMediaTypes key="mediaTypesRequiringUserActionForPlayback" none="YES"/>
|
||||
<wkPreferences key="preferences"/>
|
||||
</wkWebViewConfiguration>
|
||||
</wkWebView>
|
||||
</subviews>
|
||||
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
|
||||
</view>
|
||||
<connections>
|
||||
<outlet property="webView" destination="RDB-ib-igF" id="avx-RC-qRB"/>
|
||||
</connections>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="53" y="375"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
||||
@@ -1,27 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>SFSafariWebExtensionConverterVersion</key>
|
||||
<string>15.0</string>
|
||||
<key>UIApplicationSceneManifest</key>
|
||||
<dict>
|
||||
<key>UIApplicationSupportsMultipleScenes</key>
|
||||
<false/>
|
||||
<key>UISceneConfigurations</key>
|
||||
<dict>
|
||||
<key>UIWindowSceneSessionRoleApplication</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>UISceneConfigurationName</key>
|
||||
<string>Default Configuration</string>
|
||||
<key>UISceneDelegateClassName</key>
|
||||
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
|
||||
<key>UISceneStoryboardFile</key>
|
||||
<string>Main</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1,18 +0,0 @@
|
||||
//
|
||||
// SceneDelegate.swift
|
||||
// iOS (App)
|
||||
//
|
||||
// Created by Phong on 28/11/2023.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
|
||||
|
||||
var window: UIWindow?
|
||||
|
||||
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
|
||||
guard let _ = (scene as? UIWindowScene) else { return }
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>NSExtension</key>
|
||||
<dict>
|
||||
<key>NSExtensionPointIdentifier</key>
|
||||
<string>com.apple.Safari.web-extension</string>
|
||||
<key>NSExtensionPrincipalClass</key>
|
||||
<string>$(PRODUCT_MODULE_NAME).SafariWebExtensionHandler</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1,21 +0,0 @@
|
||||
//
|
||||
// AppDelegate.swift
|
||||
// macOS (App)
|
||||
//
|
||||
// Created by Phong on 28/11/2023.
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
|
||||
@main
|
||||
class AppDelegate: NSObject, NSApplicationDelegate {
|
||||
|
||||
func applicationDidFinishLaunching(_ notification: Notification) {
|
||||
// Override point for customization after application launch.
|
||||
}
|
||||
|
||||
func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
|
||||
return true
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,124 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="19085" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="B8D-0N-5wS">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="19085"/>
|
||||
<plugIn identifier="com.apple.WebKit2IBPlugin" version="19085"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--Application-->
|
||||
<scene sceneID="JPo-4y-FX3">
|
||||
<objects>
|
||||
<application id="hnw-xV-0zn" sceneMemberID="viewController">
|
||||
<menu key="mainMenu" title="Main Menu" systemMenu="main" id="AYu-sK-qS6">
|
||||
<items>
|
||||
<menuItem title="Nostr Connect" id="1Xt-HY-uBw">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Nostr Connect" systemMenu="apple" id="uQy-DD-JDr">
|
||||
<items>
|
||||
<menuItem title="About Nostr Connect" id="5kV-Vb-QxS">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="orderFrontStandardAboutPanel:" target="Ady-hI-5gd" id="Exp-CZ-Vem"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="VOq-y0-SEH"/>
|
||||
<menuItem title="Hide Nostr Connect" keyEquivalent="h" id="Olw-nP-bQN">
|
||||
<connections>
|
||||
<action selector="hide:" target="Ady-hI-5gd" id="PnN-Uc-m68"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Hide Others" keyEquivalent="h" id="Vdr-fp-XzO">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="hideOtherApplications:" target="Ady-hI-5gd" id="VT4-aY-XCT"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Show All" id="Kd2-mp-pUS">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="unhideAllApplications:" target="Ady-hI-5gd" id="Dhg-Le-xox"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="kCx-OE-vgT"/>
|
||||
<menuItem title="Quit Nostr Connect" keyEquivalent="q" id="4sb-4s-VLi">
|
||||
<connections>
|
||||
<action selector="terminate:" target="Ady-hI-5gd" id="Te7-pn-YzF"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Help" id="wpr-3q-Mcd">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Help" systemMenu="help" id="F2S-fz-NVQ">
|
||||
<items>
|
||||
<menuItem title="Nostr Connect Help" keyEquivalent="?" id="FKE-Sm-Kum">
|
||||
<connections>
|
||||
<action selector="showHelp:" target="Ady-hI-5gd" id="y7X-2Q-9no"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="Voe-Tx-rLC" id="PrD-fu-P6m"/>
|
||||
</connections>
|
||||
</application>
|
||||
<customObject id="Voe-Tx-rLC" customClass="AppDelegate" customModuleProvider="target"/>
|
||||
<customObject id="YLy-65-1bz" customClass="NSFontManager"/>
|
||||
<customObject id="Ady-hI-5gd" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="76" y="-134"/>
|
||||
</scene>
|
||||
<!--Window Controller-->
|
||||
<scene sceneID="R2V-B0-nI4">
|
||||
<objects>
|
||||
<windowController showSeguePresentationStyle="single" id="B8D-0N-5wS" sceneMemberID="viewController">
|
||||
<window key="window" title="Nostr Connect" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" restorable="NO" releasedWhenClosed="NO" animationBehavior="default" id="IQv-IB-iLA">
|
||||
<windowStyleMask key="styleMask" titled="YES" closable="YES"/>
|
||||
<windowCollectionBehavior key="collectionBehavior" fullScreenNone="YES"/>
|
||||
<rect key="contentRect" x="196" y="240" width="425" height="325"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1680" height="1027"/>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="B8D-0N-5wS" id="98r-iN-zZc"/>
|
||||
</connections>
|
||||
</window>
|
||||
<connections>
|
||||
<segue destination="XfG-lQ-9wD" kind="relationship" relationship="window.shadowedContentViewController" id="cq2-FE-JQM"/>
|
||||
</connections>
|
||||
</windowController>
|
||||
<customObject id="Oky-zY-oP4" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="75" y="250"/>
|
||||
</scene>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="hIz-AP-VOD">
|
||||
<objects>
|
||||
<viewController id="XfG-lQ-9wD" customClass="ViewController" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<view key="view" id="m2S-Jp-Qdl">
|
||||
<rect key="frame" x="0.0" y="0.0" width="425" height="325"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<wkWebView wantsLayer="YES" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="eOr-cG-IQY">
|
||||
<rect key="frame" x="0.0" y="0.0" width="425" height="325"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<wkWebViewConfiguration key="configuration">
|
||||
<audiovisualMediaTypes key="mediaTypesRequiringUserActionForPlayback" none="YES"/>
|
||||
<wkPreferences key="preferences"/>
|
||||
</wkWebViewConfiguration>
|
||||
</wkWebView>
|
||||
</subviews>
|
||||
</view>
|
||||
<connections>
|
||||
<outlet property="webView" destination="eOr-cG-IQY" id="GFe-mU-dBY"/>
|
||||
</connections>
|
||||
</viewController>
|
||||
<customObject id="rPt-NT-nkU" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="75" y="655"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
||||
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>SFSafariWebExtensionConverterVersion</key>
|
||||
<string>15.0</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>com.apple.security.app-sandbox</key>
|
||||
<true/>
|
||||
<key>com.apple.security.files.user-selected.read-only</key>
|
||||
<true/>
|
||||
<key>com.apple.security.network.client</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>NSExtension</key>
|
||||
<dict>
|
||||
<key>NSExtensionPointIdentifier</key>
|
||||
<string>com.apple.Safari.web-extension</string>
|
||||
<key>NSExtensionPrincipalClass</key>
|
||||
<string>$(PRODUCT_MODULE_NAME).SafariWebExtensionHandler</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>com.apple.security.app-sandbox</key>
|
||||
<true/>
|
||||
<key>com.apple.security.files.user-selected.read-only</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
58
README.md
@@ -1,51 +1,45 @@
|
||||
# nos2x
|
||||
# Nostr Signer (formerly Nostr Connect)
|
||||
|
||||
### notes and other stuff signed by an extension
|
||||
A Nostr Signer Extension - sign [nostr](https://github.com/nostr-protocol/nostr) events on web-apps without giving them your keys. Forked from [nos2x](https://github.com/fiatjaf/nos2x) with a fancy UI, crafted by Karnage.
|
||||
|
||||
## Nostr Signer Extension
|
||||
## Features
|
||||
|
||||
Use this to sign [Nostr](https://github.com/nostr-protocol/nostr) events on web-apps without having to give them your keys.
|
||||
|
||||
It implements [NIP-07](https://github.com/nostr-protocol/nips/blob/master/07.md), i.e. provides a `window.nostr` object which has the following methods:
|
||||
Implements [NIP-07](https://github.com/nostr-protocol/nips/blob/master/07.md) and more:
|
||||
|
||||
```
|
||||
async window.nostr.getPublicKey(): string // returns your public key as hex
|
||||
async window.nostr.signEvent(event): Event // returns the full event object signed
|
||||
async window.nostr.getRelays(): { [url: string]: RelayPolicy } // returns a map of relays
|
||||
async window.nostr.nip04.encrypt(pubkey, plaintext): string // returns ciphertext+iv as specified in nip04
|
||||
async window.nostr.nip04.decrypt(pubkey, ciphertext): string // takes ciphertext+iv as specified in nip04
|
||||
async window.nostr.nip04.encrypt(pubkey, plaintext): string // NIP-04 encryption
|
||||
async window.nostr.nip04.decrypt(pubkey, ciphertext): string // NIP-04 decryption
|
||||
async window.nostr.nip44.encrypt(pubkey, plaintext): string // NIP-44 encryption
|
||||
async window.nostr.nip44.decrypt(pubkey, ciphertext): string // NIP-44 decryption
|
||||
```
|
||||
|
||||
This extension is Chromium-only. For a maintained Firefox fork, see [nos2x-fox](https://diegogurpegui.com/nos2x-fox/).
|
||||
|
||||
## Demo Video
|
||||
|
||||
https://user-images.githubusercontent.com/1653275/149637382-65d50a85-fe30-4259-b7de-99c88b089b53.mp4
|
||||
|
||||
## Install
|
||||
|
||||
- [Chrome Extension](https://chrome.google.com/webstore/detail/nos2x/kpgefcfmnafjgpblomihpgmejjdanjjp)
|
||||
|
||||
## Develop
|
||||
|
||||
To run the plugin from this code:
|
||||
|
||||
```
|
||||
git clone https://github.com/fiatjaf/nos2x
|
||||
cd nos2x
|
||||
yarn
|
||||
yarn run build
|
||||
```bash
|
||||
git clone https://git.reya.su/reya/nostr-connect
|
||||
cd nostr-connect
|
||||
bun install
|
||||
bun run build
|
||||
```
|
||||
|
||||
then
|
||||
Then:
|
||||
|
||||
1. go to `chrome://extensions`;
|
||||
2. ensure "developer mode" is enabled on the top right;
|
||||
3. click on "Load unpackaged";
|
||||
4. select the `extension/` folder of this repository.
|
||||
1. Go to `chrome://extensions`
|
||||
2. Enable "developer mode"
|
||||
3. Click "Load unpackaged"
|
||||
4. Select the `extension/output/` folder
|
||||
|
||||
---
|
||||
## Commands
|
||||
|
||||
LICENSE: public domain.
|
||||
|
||||
Icon made by <a href="https://www.freepik.com" title="Freepik">Freepik</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a>.
|
||||
```bash
|
||||
bun run dev # Development mode
|
||||
bun run build # Production build
|
||||
bun run lint # Lint code
|
||||
bun run test # Run tests
|
||||
bun run package:chrome # Package for Chrome
|
||||
```
|
||||
|
||||
85
biome.json
@@ -1,55 +1,38 @@
|
||||
{
|
||||
"$schema": "https://biomejs.dev/schemas/2.4.10/schema.json",
|
||||
"vcs": {
|
||||
"enabled": true,
|
||||
"clientKind": "git",
|
||||
"useIgnoreFile": true
|
||||
},
|
||||
"files": {
|
||||
"ignoreUnknown": true,
|
||||
"ignore": [
|
||||
"extension/output/**",
|
||||
"extension/**/*.test.js",
|
||||
"extension/test-utils.js",
|
||||
"extension/style.css"
|
||||
]
|
||||
},
|
||||
"formatter": {
|
||||
"enabled": true,
|
||||
"indentStyle": "space",
|
||||
"indentWidth": 2,
|
||||
"lineWidth": 80
|
||||
},
|
||||
"linter": {
|
||||
"enabled": true,
|
||||
"rules": {
|
||||
"recommended": true,
|
||||
"correctness": {
|
||||
"noUnusedVariables": "warn"
|
||||
},
|
||||
"style": {
|
||||
"noNonNullAssertion": "off"
|
||||
},
|
||||
"a11y": {
|
||||
"recommended": true
|
||||
},
|
||||
"complexity": {
|
||||
"recommended": true
|
||||
},
|
||||
"suspicious": {
|
||||
"recommended": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"javascript": {
|
||||
"formatter": {
|
||||
"quoteStyle": "single",
|
||||
"semicolons": "asNeeded",
|
||||
"trailingCommas": "none",
|
||||
"arrowParentheses": "always"
|
||||
}
|
||||
}
|
||||
}
|
||||
"$schema": "https://biomejs.dev/schemas/2.4.10/schema.json",
|
||||
"vcs": {
|
||||
"enabled": true,
|
||||
"clientKind": "git",
|
||||
"useIgnoreFile": true
|
||||
},
|
||||
"files": {
|
||||
"ignoreUnknown": true
|
||||
},
|
||||
"formatter": {
|
||||
"enabled": true,
|
||||
"indentStyle": "space",
|
||||
"indentWidth": 2,
|
||||
"lineWidth": 80
|
||||
},
|
||||
"linter": {
|
||||
"enabled": true,
|
||||
"rules": {
|
||||
"recommended": true,
|
||||
"correctness": {
|
||||
"noUnusedVariables": "warn"
|
||||
},
|
||||
"style": {
|
||||
"noNonNullAssertion": "off"
|
||||
},
|
||||
"a11y": {
|
||||
"recommended": true
|
||||
},
|
||||
"complexity": {
|
||||
"recommended": true
|
||||
},
|
||||
"suspicious": {
|
||||
"recommended": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"javascript": {
|
||||
|
||||
62
build.js
@@ -1,25 +1,27 @@
|
||||
#!/usr/bin/env node
|
||||
const {copy} = require('esbuild-plugin-copy')
|
||||
const esbuild = require('esbuild')
|
||||
const { copy } = require("esbuild-plugin-copy");
|
||||
const esbuild = require("esbuild");
|
||||
|
||||
const isProd = process.argv.indexOf('prod') !== -1
|
||||
const isFirefox = process.argv.indexOf('firefox') !== -1
|
||||
const isProd = process.argv.indexOf("prod") !== -1;
|
||||
const isFirefox = process.argv.indexOf("firefox") !== -1;
|
||||
|
||||
esbuild
|
||||
.build({
|
||||
bundle: true,
|
||||
entryPoints: {
|
||||
'popup.build': './extension/popup.jsx',
|
||||
'prompt.build': './extension/prompt.jsx',
|
||||
'options.build': './extension/options.jsx',
|
||||
'background.build': './extension/background.js',
|
||||
'content-script.build': './extension/content-script.js'
|
||||
"popup.build": "./extension/popup.jsx",
|
||||
"prompt.build": "./extension/prompt.jsx",
|
||||
"options.build": "./extension/options.jsx",
|
||||
"background.build": "./extension/background.js",
|
||||
"content-script.build": "./extension/content-script.js",
|
||||
},
|
||||
outdir: './extension/output',
|
||||
sourcemap: isProd ? false : 'inline',
|
||||
outdir: "./extension/output",
|
||||
sourcemap: isProd ? false : "inline",
|
||||
jsx: "automatic",
|
||||
jsxImportSource: "react",
|
||||
define: {
|
||||
window: 'self',
|
||||
global: 'self'
|
||||
window: "self",
|
||||
global: "self",
|
||||
},
|
||||
plugins: [
|
||||
copy({
|
||||
@@ -27,30 +29,30 @@ esbuild
|
||||
{
|
||||
from: [
|
||||
isFirefox
|
||||
? './extension/firefox/manifest.json'
|
||||
: './extension/chrome/manifest.json'
|
||||
? "./extension/firefox/manifest.json"
|
||||
: "./extension/chrome/manifest.json",
|
||||
],
|
||||
to: ['./']
|
||||
to: ["./"],
|
||||
},
|
||||
{
|
||||
from: ['./extension/*.html'],
|
||||
to: ['./']
|
||||
from: ["./extension/*.html"],
|
||||
to: ["./"],
|
||||
},
|
||||
{
|
||||
from: ['./extension/common.js'],
|
||||
to: ['./']
|
||||
from: ["./extension/common.js"],
|
||||
to: ["./"],
|
||||
},
|
||||
{
|
||||
from: ['./extension/nostr-provider.js'],
|
||||
to: ['./']
|
||||
from: ["./extension/nostr-provider.js"],
|
||||
to: ["./"],
|
||||
},
|
||||
{
|
||||
from: ['./extension/icons/*'],
|
||||
to: ['./icons']
|
||||
}
|
||||
]
|
||||
})
|
||||
]
|
||||
from: ["./extension/icons/*"],
|
||||
to: ["./icons"],
|
||||
},
|
||||
],
|
||||
}),
|
||||
],
|
||||
})
|
||||
.then(() => console.log('Build success.'))
|
||||
.catch(err => console.error('Build error.', err))
|
||||
.then(() => console.log("Build success."))
|
||||
.catch((err) => console.error("Build error.", err));
|
||||
|
||||
@@ -1,273 +1,273 @@
|
||||
import browser from "webextension-polyfill";
|
||||
import browser from 'webextension-polyfill'
|
||||
import {
|
||||
validateEvent,
|
||||
finalizeEvent,
|
||||
getEventHash,
|
||||
getPublicKey,
|
||||
nip19,
|
||||
utils,
|
||||
} from "nostr-tools";
|
||||
import { nip04 } from "nostr-tools";
|
||||
import * as nip44 from "nostr-tools/nip44";
|
||||
import { Mutex } from "async-mutex";
|
||||
import { LRUCache } from "./utils";
|
||||
utils
|
||||
} from 'nostr-tools'
|
||||
import { nip04 } from 'nostr-tools'
|
||||
import * as nip44 from 'nostr-tools/nip44'
|
||||
import { Mutex } from 'async-mutex'
|
||||
import { LRUCache } from './utils'
|
||||
|
||||
const { hexToBytes } = utils;
|
||||
const { hexToBytes } = utils
|
||||
|
||||
import {
|
||||
NO_PERMISSIONS_REQUIRED,
|
||||
getPermissionStatus,
|
||||
updatePermission,
|
||||
showNotification,
|
||||
getPosition,
|
||||
} from "./common";
|
||||
getPosition
|
||||
} from './common'
|
||||
|
||||
const { encrypt, decrypt } = nip04;
|
||||
const { encrypt, decrypt } = nip04
|
||||
|
||||
let openPrompt = null;
|
||||
const promptMutex = new Mutex();
|
||||
let releasePromptMutex = () => {};
|
||||
const secretsCache = new LRUCache(100);
|
||||
const previousSk = null;
|
||||
let openPrompt = null
|
||||
const promptMutex = new Mutex()
|
||||
let releasePromptMutex = () => {}
|
||||
const secretsCache = new LRUCache(100)
|
||||
const previousSk = null
|
||||
|
||||
function getSharedSecret(sk, peer) {
|
||||
if (previousSk !== sk) {
|
||||
secretsCache.clear();
|
||||
secretsCache.clear()
|
||||
}
|
||||
|
||||
let key = secretsCache.get(peer);
|
||||
let key = secretsCache.get(peer)
|
||||
|
||||
if (!key) {
|
||||
key = nip44.v2.utils.getConversationKey(sk, peer);
|
||||
secretsCache.set(peer, key);
|
||||
key = nip44.v2.utils.getConversationKey(sk, peer)
|
||||
secretsCache.set(peer, key)
|
||||
}
|
||||
|
||||
return key;
|
||||
return key
|
||||
}
|
||||
|
||||
const width = 440;
|
||||
const height = 420;
|
||||
const width = 440
|
||||
const height = 420
|
||||
|
||||
browser.runtime.onInstalled.addListener((_, __, reason) => {
|
||||
if (reason === "install") browser.runtime.openOptionsPage();
|
||||
});
|
||||
if (reason === 'install') browser.runtime.openOptionsPage()
|
||||
})
|
||||
|
||||
browser.runtime.onMessage.addListener(async (req, sender) => {
|
||||
const { prompt } = req;
|
||||
const { prompt } = req
|
||||
|
||||
if (prompt) {
|
||||
handlePromptMessage(req, sender);
|
||||
handlePromptMessage(req, sender)
|
||||
} else {
|
||||
return handleContentScriptMessage(req);
|
||||
return handleContentScriptMessage(req)
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
browser.runtime.onMessageExternal.addListener(
|
||||
async ({ type, params }, sender) => {
|
||||
const extensionId = new URL(sender.url).host;
|
||||
return handleContentScriptMessage({ type, params, host: extensionId });
|
||||
const extensionId = new URL(sender.url).host
|
||||
return handleContentScriptMessage({ type, params, host: extensionId })
|
||||
}
|
||||
);
|
||||
)
|
||||
|
||||
browser.windows.onRemoved.addListener((_windowId) => {
|
||||
if (openPrompt) {
|
||||
// calling this with a simple "no" response will not store anything, so it's fine
|
||||
// it will just return a failure
|
||||
handlePromptMessage({ accept: false }, null);
|
||||
handlePromptMessage({ accept: false }, null)
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
async function handleContentScriptMessage({ type, params, host }) {
|
||||
if (NO_PERMISSIONS_REQUIRED[type]) {
|
||||
switch (type) {
|
||||
case "peekPublicKey": {
|
||||
const allowed = await getPermissionStatus(host, "getPublicKey");
|
||||
if (allowed === true) return performOperation("getPublicKey", params);
|
||||
return "";
|
||||
case 'peekPublicKey': {
|
||||
const allowed = await getPermissionStatus(host, 'getPublicKey')
|
||||
if (allowed === true) return performOperation('getPublicKey', params)
|
||||
return ''
|
||||
}
|
||||
case "replaceURL": {
|
||||
case 'replaceURL': {
|
||||
const { protocol_handler: ph } = await browser.storage.local.get([
|
||||
"protocol_handler",
|
||||
]);
|
||||
if (!ph) return false;
|
||||
'protocol_handler'
|
||||
])
|
||||
if (!ph) return false
|
||||
|
||||
const { url } = params;
|
||||
const raw = url.split("nostr:")[1];
|
||||
const { type, data } = nip19.decode(raw);
|
||||
const { url } = params
|
||||
const raw = url.split('nostr:')[1]
|
||||
const { type, data } = nip19.decode(raw)
|
||||
const replacements = {
|
||||
raw,
|
||||
hrp: type,
|
||||
hex:
|
||||
type === "npub" || type === "note"
|
||||
type === 'npub' || type === 'note'
|
||||
? data
|
||||
: type === "nprofile"
|
||||
? data.pubkey
|
||||
: type === "nevent"
|
||||
? data.id
|
||||
: null,
|
||||
p_or_e: { npub: "p", note: "e", nprofile: "p", nevent: "e" }[type],
|
||||
u_or_n: { npub: "u", note: "n", nprofile: "u", nevent: "n" }[type],
|
||||
relay0: type === "nprofile" ? data.relays[0] : null,
|
||||
relay1: type === "nprofile" ? data.relays[1] : null,
|
||||
relay2: type === "nprofile" ? data.relays[2] : null,
|
||||
};
|
||||
let result = ph;
|
||||
: type === 'nprofile'
|
||||
? data.pubkey
|
||||
: type === 'nevent'
|
||||
? data.id
|
||||
: null,
|
||||
p_or_e: { npub: 'p', note: 'e', nprofile: 'p', nevent: 'e' }[type],
|
||||
u_or_n: { npub: 'u', note: 'n', nprofile: 'u', nevent: 'n' }[type],
|
||||
relay0: type === 'nprofile' ? data.relays[0] : null,
|
||||
relay1: type === 'nprofile' ? data.relays[1] : null,
|
||||
relay2: type === 'nprofile' ? data.relays[2] : null
|
||||
}
|
||||
let result = ph
|
||||
Object.entries(replacements).forEach(([pattern, value]) => {
|
||||
result = result.replace(new RegExp(`{ *${pattern} *}`, "g"), value);
|
||||
});
|
||||
result = result.replace(new RegExp(`{ *${pattern} *}`, 'g'), value)
|
||||
})
|
||||
|
||||
return result;
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
return
|
||||
} else {
|
||||
// acquire mutex here before reading policies
|
||||
releasePromptMutex = await promptMutex.acquire();
|
||||
releasePromptMutex = await promptMutex.acquire()
|
||||
|
||||
const allowed = await getPermissionStatus(
|
||||
host,
|
||||
type,
|
||||
type === "signEvent" ? params.event : undefined
|
||||
);
|
||||
type === 'signEvent' ? params.event : undefined
|
||||
)
|
||||
|
||||
if (allowed === true) {
|
||||
// authorized, proceed
|
||||
releasePromptMutex();
|
||||
showNotification(host, allowed, type, params);
|
||||
releasePromptMutex()
|
||||
showNotification(host, allowed, type, params)
|
||||
} else if (allowed === false) {
|
||||
// denied, just refuse immediately
|
||||
releasePromptMutex();
|
||||
showNotification(host, allowed, type, params);
|
||||
releasePromptMutex()
|
||||
showNotification(host, allowed, type, params)
|
||||
return {
|
||||
error: "denied",
|
||||
};
|
||||
error: 'denied'
|
||||
}
|
||||
} else {
|
||||
// ask for authorization
|
||||
try {
|
||||
const id = Math.random().toString().slice(4);
|
||||
const id = Math.random().toString().slice(4)
|
||||
const qs = new URLSearchParams({
|
||||
host,
|
||||
id,
|
||||
params: JSON.stringify(params),
|
||||
type,
|
||||
});
|
||||
type
|
||||
})
|
||||
|
||||
// prompt will be resolved with true or false
|
||||
const accept = await new Promise((resolve, reject) => {
|
||||
openPrompt = { resolve, reject };
|
||||
openPrompt = { resolve, reject }
|
||||
const url = `${browser.runtime.getURL(
|
||||
"prompt.html"
|
||||
)}?${qs.toString()}`;
|
||||
'prompt.html'
|
||||
)}?${qs.toString()}`
|
||||
|
||||
// center prompt
|
||||
const { top, left } = getPosition(width, height);
|
||||
const { top, left } = getPosition(width, height)
|
||||
|
||||
if (browser.windows) {
|
||||
browser.windows.create({
|
||||
url,
|
||||
type: "popup",
|
||||
type: 'popup',
|
||||
width: width,
|
||||
height: height,
|
||||
top: top,
|
||||
left: left,
|
||||
});
|
||||
left: left
|
||||
})
|
||||
} else {
|
||||
browser.tabs.create({
|
||||
url,
|
||||
active: true,
|
||||
});
|
||||
active: true
|
||||
})
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
// denied, stop here
|
||||
if (!accept) return { error: { message: "denied" } };
|
||||
if (!accept) return { error: { message: 'denied' } }
|
||||
} catch (err) {
|
||||
// errored, stop here
|
||||
releasePromptMutex();
|
||||
releasePromptMutex()
|
||||
return {
|
||||
error: { message: err.message, stack: err.stack },
|
||||
};
|
||||
error: { message: err.message, stack: err.stack }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// if we're here this means it was accepted
|
||||
const results = await browser.storage.local.get("private_key");
|
||||
const results = await browser.storage.local.get('private_key')
|
||||
if (!results?.private_key) {
|
||||
return { error: "no private key found" };
|
||||
return { error: 'no private key found' }
|
||||
}
|
||||
|
||||
const sk = results.private_key;
|
||||
const sk = results.private_key
|
||||
|
||||
try {
|
||||
switch (type) {
|
||||
case "getPublicKey": {
|
||||
return getPublicKey(hexToBytes(sk));
|
||||
case 'getPublicKey': {
|
||||
return getPublicKey(hexToBytes(sk))
|
||||
}
|
||||
case "getRelays": {
|
||||
const results = await browser.storage.local.get("relays");
|
||||
return results.relays || {};
|
||||
case 'getRelays': {
|
||||
const results = await browser.storage.local.get('relays')
|
||||
return results.relays || {}
|
||||
}
|
||||
case "signEvent": {
|
||||
const { event } = params;
|
||||
case 'signEvent': {
|
||||
const { event } = params
|
||||
|
||||
if (!event.pubkey) event.pubkey = getPublicKey(hexToBytes(sk));
|
||||
if (!event.id) event.id = getEventHash(event);
|
||||
if (!event.pubkey) event.pubkey = getPublicKey(hexToBytes(sk))
|
||||
if (!event.id) event.id = getEventHash(event)
|
||||
if (!validateEvent(event))
|
||||
return { error: { message: "invalid event" } };
|
||||
return { error: { message: 'invalid event' } }
|
||||
|
||||
const signedEvent = finalizeEvent(event, hexToBytes(sk));
|
||||
return signedEvent;
|
||||
const signedEvent = finalizeEvent(event, hexToBytes(sk))
|
||||
return signedEvent
|
||||
}
|
||||
case "nip04.encrypt": {
|
||||
const { peer, plaintext } = params;
|
||||
return encrypt(sk, peer, plaintext);
|
||||
case 'nip04.encrypt': {
|
||||
const { peer, plaintext } = params
|
||||
return encrypt(sk, peer, plaintext)
|
||||
}
|
||||
case "nip04.decrypt": {
|
||||
const { peer, ciphertext } = params;
|
||||
return decrypt(sk, peer, ciphertext);
|
||||
case 'nip04.decrypt': {
|
||||
const { peer, ciphertext } = params
|
||||
return decrypt(sk, peer, ciphertext)
|
||||
}
|
||||
case "nip44.encrypt": {
|
||||
const { peer, plaintext } = params;
|
||||
const key = getSharedSecret(sk, peer);
|
||||
case 'nip44.encrypt': {
|
||||
const { peer, plaintext } = params
|
||||
const key = getSharedSecret(sk, peer)
|
||||
|
||||
return nip44.v2.encrypt(plaintext, key);
|
||||
return nip44.v2.encrypt(plaintext, key)
|
||||
}
|
||||
case "nip44.decrypt": {
|
||||
const { peer, ciphertext } = params;
|
||||
const key = getSharedSecret(sk, peer);
|
||||
case 'nip44.decrypt': {
|
||||
const { peer, ciphertext } = params
|
||||
const key = getSharedSecret(sk, peer)
|
||||
|
||||
return nip44.v2.decrypt(ciphertext, key);
|
||||
return nip44.v2.decrypt(ciphertext, key)
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
return { error: { message: error.message, stack: error.stack } };
|
||||
return { error: { message: error.message, stack: error.stack } }
|
||||
}
|
||||
}
|
||||
|
||||
async function handlePromptMessage({ host, type, accept, conditions }, sender) {
|
||||
// return response
|
||||
openPrompt?.resolve?.(accept);
|
||||
openPrompt?.resolve?.(accept)
|
||||
|
||||
// update policies
|
||||
if (conditions) {
|
||||
await updatePermission(host, type, accept, conditions);
|
||||
await updatePermission(host, type, accept, conditions)
|
||||
}
|
||||
|
||||
// cleanup this
|
||||
openPrompt = null;
|
||||
openPrompt = null
|
||||
|
||||
// release mutex here after updating policies
|
||||
releasePromptMutex();
|
||||
releasePromptMutex()
|
||||
|
||||
// close prompt
|
||||
if (sender) {
|
||||
if (browser.windows) {
|
||||
browser.windows.remove(sender.tab.windowId);
|
||||
browser.windows.remove(sender.tab.windowId)
|
||||
} else {
|
||||
// Android Firefox
|
||||
browser.tabs.remove(sender.tab.id);
|
||||
browser.tabs.remove(sender.tab.id)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"name": "Nostr Connect",
|
||||
"name": "Nostr Signer (formerly Nostr Connect)",
|
||||
"description": "Nostr Signer Extension",
|
||||
"version": "0.1.2",
|
||||
"homepage_url": "https://github.com/reyamir/nostr-connect",
|
||||
"version": "1.0.0",
|
||||
"homepage_url": "https://git.reya.su/reya/nostr-connect",
|
||||
"manifest_version": 3,
|
||||
"icons": {
|
||||
"16": "icons/icon16.png",
|
||||
@@ -15,7 +15,7 @@
|
||||
"service_worker": "background.build.js"
|
||||
},
|
||||
"action": {
|
||||
"default_title": "Nostr Connect",
|
||||
"default_title": "Nostr Signer",
|
||||
"default_popup": "popup.html"
|
||||
},
|
||||
"content_scripts": [
|
||||
@@ -25,7 +25,7 @@
|
||||
"all_frames": true
|
||||
}
|
||||
],
|
||||
"permissions": ["storage"],
|
||||
"permissions": ["storage", "activeTab", "windows"],
|
||||
"optional_permissions": ["notifications"],
|
||||
"web_accessible_resources": [
|
||||
{
|
||||
|
||||
@@ -1,125 +1,125 @@
|
||||
import browser from "webextension-polyfill";
|
||||
import browser from 'webextension-polyfill'
|
||||
|
||||
export const NO_PERMISSIONS_REQUIRED = {
|
||||
replaceURL: true,
|
||||
peekPublicKey: true,
|
||||
};
|
||||
peekPublicKey: true
|
||||
}
|
||||
|
||||
export const PERMISSION_NAMES = Object.fromEntries([
|
||||
["getPublicKey", "read your public key"],
|
||||
["signEvent", "sign events using your private key"],
|
||||
["nip04.encrypt", "encrypt messages to peers"],
|
||||
["nip04.decrypt", "decrypt messages from peers"],
|
||||
["nip44.encrypt", "encrypt messages to peers"],
|
||||
["nip44.decrypt", "decrypt messages from peers"],
|
||||
]);
|
||||
['getPublicKey', 'read your public key'],
|
||||
['signEvent', 'sign events using your private key'],
|
||||
['nip04.encrypt', 'encrypt messages to peers'],
|
||||
['nip04.decrypt', 'decrypt messages from peers'],
|
||||
['nip44.encrypt', 'encrypt messages to peers'],
|
||||
['nip44.decrypt', 'decrypt messages from peers']
|
||||
])
|
||||
|
||||
function matchConditions(conditions, event) {
|
||||
if (conditions?.kinds) {
|
||||
if (event.kind in conditions.kinds) return true;
|
||||
else return false;
|
||||
if (event.kind in conditions.kinds) return true
|
||||
else return false
|
||||
}
|
||||
|
||||
return true;
|
||||
return true
|
||||
}
|
||||
|
||||
export async function getPermissionStatus(host, type, event) {
|
||||
const { policies } = await browser.storage.local.get("policies");
|
||||
const { policies } = await browser.storage.local.get('policies')
|
||||
|
||||
const answers = [true, false];
|
||||
const answers = [true, false]
|
||||
for (let i = 0; i < answers.length; i++) {
|
||||
const accept = answers[i];
|
||||
const { conditions } = policies?.[host]?.[accept]?.[type] || {};
|
||||
const accept = answers[i]
|
||||
const { conditions } = policies?.[host]?.[accept]?.[type] || {}
|
||||
|
||||
if (conditions) {
|
||||
if (type === "signEvent") {
|
||||
if (type === 'signEvent') {
|
||||
if (matchConditions(conditions, event)) {
|
||||
return accept; // may be true or false
|
||||
return accept // may be true or false
|
||||
} else {
|
||||
}
|
||||
} else {
|
||||
return accept; // may be true or false
|
||||
return accept // may be true or false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return undefined;
|
||||
return undefined
|
||||
}
|
||||
|
||||
export async function updatePermission(host, type, accept, conditions) {
|
||||
const { policies = {} } = await browser.storage.local.get("policies");
|
||||
const { policies = {} } = await browser.storage.local.get('policies')
|
||||
|
||||
// if the new conditions is "match everything", override the previous
|
||||
if (Object.keys(conditions).length === 0) {
|
||||
conditions = {};
|
||||
conditions = {}
|
||||
} else {
|
||||
// if we already had a policy for this, merge the conditions
|
||||
const existingConditions = policies[host]?.[accept]?.[type]?.conditions;
|
||||
const existingConditions = policies[host]?.[accept]?.[type]?.conditions
|
||||
if (existingConditions) {
|
||||
if (existingConditions.kinds && conditions.kinds) {
|
||||
Object.keys(existingConditions.kinds).forEach((kind) => {
|
||||
conditions.kinds[kind] = true;
|
||||
});
|
||||
conditions.kinds[kind] = true
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// if we have a reverse policy (accept / reject) that is exactly equal to this, remove it
|
||||
const other = !accept;
|
||||
const reverse = policies?.[host]?.[other]?.[type];
|
||||
const other = !accept
|
||||
const reverse = policies?.[host]?.[other]?.[type]
|
||||
if (
|
||||
reverse &&
|
||||
JSON.stringify(reverse.conditions) === JSON.stringify(conditions)
|
||||
) {
|
||||
delete policies[host][other][type];
|
||||
delete policies[host][other][type]
|
||||
}
|
||||
|
||||
// insert our new policy
|
||||
policies[host] = policies[host] || {};
|
||||
policies[host][accept] = policies[host][accept] || {};
|
||||
policies[host] = policies[host] || {}
|
||||
policies[host][accept] = policies[host][accept] || {}
|
||||
policies[host][accept][type] = {
|
||||
conditions, // filter that must match the event (in case of signEvent)
|
||||
created_at: Math.round(Date.now() / 1000),
|
||||
};
|
||||
created_at: Math.round(Date.now() / 1000)
|
||||
}
|
||||
|
||||
browser.storage.local.set({ policies });
|
||||
browser.storage.local.set({ policies })
|
||||
}
|
||||
|
||||
export async function removePermissions(host, accept, type) {
|
||||
const { policies = {} } = await browser.storage.local.get("policies");
|
||||
delete policies[host]?.[accept]?.[type];
|
||||
browser.storage.local.set({ policies });
|
||||
const { policies = {} } = await browser.storage.local.get('policies')
|
||||
delete policies[host]?.[accept]?.[type]
|
||||
browser.storage.local.set({ policies })
|
||||
}
|
||||
|
||||
export async function showNotification(host, answer, type, params) {
|
||||
const { notifications } = await browser.storage.local.get("notifications");
|
||||
const { notifications } = await browser.storage.local.get('notifications')
|
||||
if (notifications) {
|
||||
const action = answer ? "allowed" : "denied";
|
||||
const action = answer ? 'allowed' : 'denied'
|
||||
browser.notifications.create(undefined, {
|
||||
type: "basic",
|
||||
type: 'basic',
|
||||
title: `${type} ${action} for ${host}`,
|
||||
message: JSON.stringify(
|
||||
params?.event
|
||||
? {
|
||||
kind: params.event.kind,
|
||||
content: params.event.content,
|
||||
tags: params.event.tags,
|
||||
tags: params.event.tags
|
||||
}
|
||||
: params,
|
||||
null,
|
||||
2
|
||||
),
|
||||
iconUrl: "icons/48x48.png",
|
||||
});
|
||||
iconUrl: 'icons/48x48.png'
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export async function getPosition(width, height) {
|
||||
let left = 0;
|
||||
let top = 0;
|
||||
let left = 0
|
||||
let top = 0
|
||||
|
||||
try {
|
||||
const lastFocused = await browser.windows.getLastFocused();
|
||||
const lastFocused = await browser.windows.getLastFocused()
|
||||
|
||||
if (
|
||||
lastFocused &&
|
||||
@@ -128,17 +128,17 @@ export async function getPosition(width, height) {
|
||||
lastFocused.width !== undefined &&
|
||||
lastFocused.height !== undefined
|
||||
) {
|
||||
top = Math.round(lastFocused.top + (lastFocused.height - height) / 2);
|
||||
left = Math.round(lastFocused.left + (lastFocused.width - width) / 2);
|
||||
top = Math.round(lastFocused.top + (lastFocused.height - height) / 2)
|
||||
left = Math.round(lastFocused.left + (lastFocused.width - width) / 2)
|
||||
} else {
|
||||
console.error("Last focused window properties are undefined.");
|
||||
console.error('Last focused window properties are undefined.')
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error getting window position:", error);
|
||||
console.error('Error getting window position:', error)
|
||||
}
|
||||
|
||||
return {
|
||||
top,
|
||||
left,
|
||||
};
|
||||
left
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,36 +1,36 @@
|
||||
import browser from "webextension-polyfill";
|
||||
import browser from 'webextension-polyfill'
|
||||
|
||||
const EXTENSION = "nostrconnect";
|
||||
const EXTENSION = 'nostrconnect'
|
||||
|
||||
// inject the script that will provide window.nostr
|
||||
const script = document.createElement("script");
|
||||
script.setAttribute("async", "false");
|
||||
script.setAttribute("type", "text/javascript");
|
||||
script.setAttribute("src", browser.runtime.getURL("nostr-provider.js"));
|
||||
document.head.appendChild(script);
|
||||
const script = document.createElement('script')
|
||||
script.setAttribute('async', 'false')
|
||||
script.setAttribute('type', 'text/javascript')
|
||||
script.setAttribute('src', browser.runtime.getURL('nostr-provider.js'))
|
||||
document.head.appendChild(script)
|
||||
|
||||
// listen for messages from that script
|
||||
window.addEventListener("message", async (message) => {
|
||||
if (message.source !== window) return;
|
||||
if (!message.data) return;
|
||||
if (!message.data.params) return;
|
||||
if (message.data.ext !== EXTENSION) return;
|
||||
window.addEventListener('message', async (message) => {
|
||||
if (message.source !== window) return
|
||||
if (!message.data) return
|
||||
if (!message.data.params) return
|
||||
if (message.data.ext !== EXTENSION) return
|
||||
|
||||
// pass on to background
|
||||
var response;
|
||||
var response
|
||||
try {
|
||||
response = await browser.runtime.sendMessage({
|
||||
type: message.data.type,
|
||||
params: message.data.params,
|
||||
host: location.host,
|
||||
});
|
||||
host: location.host
|
||||
})
|
||||
} catch (error) {
|
||||
response = { error };
|
||||
response = { error }
|
||||
}
|
||||
|
||||
// return response
|
||||
window.postMessage(
|
||||
{ id: message.data.id, ext: EXTENSION, response },
|
||||
message.origin
|
||||
);
|
||||
});
|
||||
)
|
||||
})
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
{
|
||||
"name": "Nostr Connect",
|
||||
"name": "Nostr Signer (formerly Nostr Connect)",
|
||||
"description": "Nostr Signer Extension",
|
||||
"version": "0.1.2",
|
||||
"homepage_url": "https://github.com/reyamir/nostr-connect",
|
||||
"version": "1.0.0",
|
||||
"homepage_url": "https://git.reya.su/reya/nostr-connect",
|
||||
"manifest_version": 2,
|
||||
"browser_specific_settings": {
|
||||
"gecko": {
|
||||
"id": "{e665d138-0e5b-4b7a-ab91-7af834eda7a2}"
|
||||
"data_collection_permissions": {
|
||||
"required": ["none"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"icons": {
|
||||
@@ -20,7 +22,7 @@
|
||||
"scripts": ["background.build.js"]
|
||||
},
|
||||
"browser_action": {
|
||||
"default_title": "Nostr Connect",
|
||||
"default_title": "Nostr Signer",
|
||||
"default_popup": "popup.html"
|
||||
},
|
||||
"content_scripts": [
|
||||
@@ -29,7 +31,7 @@
|
||||
"js": ["content-script.build.js"]
|
||||
}
|
||||
],
|
||||
"permissions": ["storage"],
|
||||
"permissions": ["storage", "activeTab", "windows"],
|
||||
"optional_permissions": ["notifications"],
|
||||
"web_accessible_resources": ["nostr-provider.js"]
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ export function LogoIcon() {
|
||||
height="56"
|
||||
fill="none"
|
||||
viewBox="0 0 56 56"
|
||||
aria-label="Nostr Connect logo"
|
||||
aria-label="Nostr Signer logo"
|
||||
>
|
||||
<rect width="56" height="56" fill="#EEECFD" rx="16"></rect>
|
||||
<rect
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Nostr Connect</title>
|
||||
<title>Nostr Signer</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<link href="/style.css" rel="stylesheet" />
|
||||
</head>
|
||||
|
||||
@@ -1,27 +1,28 @@
|
||||
import browser from 'webextension-polyfill'
|
||||
import { useState, useCallback, useEffect } from 'react'
|
||||
import { render } from 'react-dom'
|
||||
import { generateSecretKey, nip19, utils } from 'nostr-tools'
|
||||
import { generateSecretKey, 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'
|
||||
import { hexToBytes, bytesToHex } from 'nostr-tools/utils'
|
||||
|
||||
function Options() {
|
||||
const [privKey, setPrivKey] = useState('')
|
||||
const [relays, setRelays] = useState([])
|
||||
const [newRelayURL, setNewRelayURL] = useState('')
|
||||
const [policies, setPermissions] = useState([])
|
||||
const [protocolHandler, setProtocolHandler] = useState(
|
||||
'https://njump.me/{raw}'
|
||||
)
|
||||
const [hidingPrivateKey, hidePrivateKey] = useState(true)
|
||||
const [showNotifications, setNotifications] = useState(false)
|
||||
const [messages, setMessages] = useState([])
|
||||
const [handleNostrLinks, setHandleNostrLinks] = useState(false)
|
||||
const [showProtocolHandlerHelp, setShowProtocolHandlerHelp] = useState(false)
|
||||
const [unsavedChanges, setUnsavedChanges] = useState([])
|
||||
const [protocolHandler, setProtocolHandler] = useState(
|
||||
'https://njump.me/{raw}'
|
||||
)
|
||||
|
||||
const showMessage = useCallback((msg) => {
|
||||
messages.push(msg)
|
||||
@@ -55,8 +56,11 @@ function Options() {
|
||||
.get(['private_key', 'relays', 'protocol_handler', 'notifications'])
|
||||
.then((results) => {
|
||||
if (results.private_key) {
|
||||
setPrivKey(nip19.nsecEncode(results.private_key))
|
||||
const pkey = results.private_key
|
||||
const nsec = nip19.nsecEncode(hexToBytes(pkey))
|
||||
setPrivKey(nsec)
|
||||
}
|
||||
|
||||
if (results.relays) {
|
||||
const relaysList = []
|
||||
for (const url in results.relays) {
|
||||
@@ -67,11 +71,13 @@ function Options() {
|
||||
}
|
||||
setRelays(relaysList)
|
||||
}
|
||||
|
||||
if (results.protocol_handler) {
|
||||
setProtocolHandler(results.protocol_handler)
|
||||
setHandleNostrLinks(true)
|
||||
setShowProtocolHandlerHelp(false)
|
||||
}
|
||||
|
||||
if (results.notifications) {
|
||||
setNotifications(true)
|
||||
}
|
||||
@@ -88,7 +94,7 @@ function Options() {
|
||||
<div className="flex items-center gap-4">
|
||||
<LogoIcon />
|
||||
<div>
|
||||
<h1 className="text-lg font-semibold">Nostr Connect</h1>
|
||||
<h1 className="text-lg font-semibold">Nostr Signer</h1>
|
||||
<p className="text-sm text-muted font-medium">Nostr signer</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -518,8 +524,7 @@ examples:
|
||||
}
|
||||
|
||||
async function generate() {
|
||||
const sk = generateSecretKey()
|
||||
setPrivKey(nip19.nsecEncode(utils.bytesToHex(sk)))
|
||||
setPrivKey(nip19.nsecEncode(generateSecretKey()))
|
||||
addUnsavedChanges('private_key')
|
||||
}
|
||||
|
||||
@@ -533,23 +538,21 @@ examples:
|
||||
|
||||
try {
|
||||
const { type, data } = nip19.decode(privKey)
|
||||
if (type === 'nsec') hexOrEmptyKey = data
|
||||
} catch (_) {}
|
||||
if (type === 'nsec') hexOrEmptyKey = bytesToHex(data)
|
||||
} catch (_) {
|
||||
showMessage('Invalid private key format.')
|
||||
return
|
||||
}
|
||||
|
||||
await browser.storage.local.set({
|
||||
private_key: hexOrEmptyKey
|
||||
})
|
||||
|
||||
if (hexOrEmptyKey !== '') {
|
||||
setPrivKey(nip19.nsecEncode(hexOrEmptyKey))
|
||||
}
|
||||
|
||||
showMessage('saved private key!')
|
||||
showMessage('Private Key has been saved.')
|
||||
}
|
||||
|
||||
function isKeyValid() {
|
||||
if (privKey === '') return true
|
||||
if (privKey.match(/^[a-f0-9]{64}$/)) return true
|
||||
try {
|
||||
if (nip19.decode(privKey).type === 'nsec') return true
|
||||
} catch (_) {}
|
||||
|
||||
@@ -1,125 +1,125 @@
|
||||
import browser from "webextension-polyfill";
|
||||
import browser from 'webextension-polyfill'
|
||||
|
||||
export const NO_PERMISSIONS_REQUIRED = {
|
||||
replaceURL: true,
|
||||
peekPublicKey: true,
|
||||
};
|
||||
peekPublicKey: true
|
||||
}
|
||||
|
||||
export const PERMISSION_NAMES = Object.fromEntries([
|
||||
["getPublicKey", "read your public key"],
|
||||
["signEvent", "sign events using your private key"],
|
||||
["nip04.encrypt", "encrypt messages to peers"],
|
||||
["nip04.decrypt", "decrypt messages from peers"],
|
||||
["nip44.encrypt", "encrypt messages to peers"],
|
||||
["nip44.decrypt", "decrypt messages from peers"],
|
||||
]);
|
||||
['getPublicKey', 'read your public key'],
|
||||
['signEvent', 'sign events using your private key'],
|
||||
['nip04.encrypt', 'encrypt messages to peers'],
|
||||
['nip04.decrypt', 'decrypt messages from peers'],
|
||||
['nip44.encrypt', 'encrypt messages to peers'],
|
||||
['nip44.decrypt', 'decrypt messages from peers']
|
||||
])
|
||||
|
||||
function matchConditions(conditions, event) {
|
||||
if (conditions?.kinds) {
|
||||
if (event.kind in conditions.kinds) return true;
|
||||
else return false;
|
||||
if (event.kind in conditions.kinds) return true
|
||||
else return false
|
||||
}
|
||||
|
||||
return true;
|
||||
return true
|
||||
}
|
||||
|
||||
export async function getPermissionStatus(host, type, event) {
|
||||
const { policies } = await browser.storage.local.get("policies");
|
||||
const { policies } = await browser.storage.local.get('policies')
|
||||
|
||||
const answers = [true, false];
|
||||
const answers = [true, false]
|
||||
for (let i = 0; i < answers.length; i++) {
|
||||
const accept = answers[i];
|
||||
const { conditions } = policies?.[host]?.[accept]?.[type] || {};
|
||||
const accept = answers[i]
|
||||
const { conditions } = policies?.[host]?.[accept]?.[type] || {}
|
||||
|
||||
if (conditions) {
|
||||
if (type === "signEvent") {
|
||||
if (type === 'signEvent') {
|
||||
if (matchConditions(conditions, event)) {
|
||||
return accept; // may be true or false
|
||||
return accept // may be true or false
|
||||
} else {
|
||||
}
|
||||
} else {
|
||||
return accept; // may be true or false
|
||||
return accept // may be true or false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return undefined;
|
||||
return undefined
|
||||
}
|
||||
|
||||
export async function updatePermission(host, type, accept, conditions) {
|
||||
const { policies = {} } = await browser.storage.local.get("policies");
|
||||
const { policies = {} } = await browser.storage.local.get('policies')
|
||||
|
||||
// if the new conditions is "match everything", override the previous
|
||||
if (Object.keys(conditions).length === 0) {
|
||||
conditions = {};
|
||||
conditions = {}
|
||||
} else {
|
||||
// if we already had a policy for this, merge the conditions
|
||||
const existingConditions = policies[host]?.[accept]?.[type]?.conditions;
|
||||
const existingConditions = policies[host]?.[accept]?.[type]?.conditions
|
||||
if (existingConditions) {
|
||||
if (existingConditions.kinds && conditions.kinds) {
|
||||
Object.keys(existingConditions.kinds).forEach((kind) => {
|
||||
conditions.kinds[kind] = true;
|
||||
});
|
||||
conditions.kinds[kind] = true
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// if we have a reverse policy (accept / reject) that is exactly equal to this, remove it
|
||||
const other = !accept;
|
||||
const reverse = policies?.[host]?.[other]?.[type];
|
||||
const other = !accept
|
||||
const reverse = policies?.[host]?.[other]?.[type]
|
||||
if (
|
||||
reverse &&
|
||||
JSON.stringify(reverse.conditions) === JSON.stringify(conditions)
|
||||
) {
|
||||
delete policies[host][other][type];
|
||||
delete policies[host][other][type]
|
||||
}
|
||||
|
||||
// insert our new policy
|
||||
policies[host] = policies[host] || {};
|
||||
policies[host][accept] = policies[host][accept] || {};
|
||||
policies[host] = policies[host] || {}
|
||||
policies[host][accept] = policies[host][accept] || {}
|
||||
policies[host][accept][type] = {
|
||||
conditions, // filter that must match the event (in case of signEvent)
|
||||
created_at: Math.round(Date.now() / 1000),
|
||||
};
|
||||
created_at: Math.round(Date.now() / 1000)
|
||||
}
|
||||
|
||||
browser.storage.local.set({ policies });
|
||||
browser.storage.local.set({ policies })
|
||||
}
|
||||
|
||||
export async function removePermissions(host, accept, type) {
|
||||
const { policies = {} } = await browser.storage.local.get("policies");
|
||||
delete policies[host]?.[accept]?.[type];
|
||||
browser.storage.local.set({ policies });
|
||||
const { policies = {} } = await browser.storage.local.get('policies')
|
||||
delete policies[host]?.[accept]?.[type]
|
||||
browser.storage.local.set({ policies })
|
||||
}
|
||||
|
||||
export async function showNotification(host, answer, type, params) {
|
||||
const { notifications } = await browser.storage.local.get("notifications");
|
||||
const { notifications } = await browser.storage.local.get('notifications')
|
||||
if (notifications) {
|
||||
const action = answer ? "allowed" : "denied";
|
||||
const action = answer ? 'allowed' : 'denied'
|
||||
browser.notifications.create(undefined, {
|
||||
type: "basic",
|
||||
type: 'basic',
|
||||
title: `${type} ${action} for ${host}`,
|
||||
message: JSON.stringify(
|
||||
params?.event
|
||||
? {
|
||||
kind: params.event.kind,
|
||||
content: params.event.content,
|
||||
tags: params.event.tags,
|
||||
tags: params.event.tags
|
||||
}
|
||||
: params,
|
||||
null,
|
||||
2
|
||||
),
|
||||
iconUrl: "icons/48x48.png",
|
||||
});
|
||||
iconUrl: 'icons/48x48.png'
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export async function getPosition(width, height) {
|
||||
let left = 0;
|
||||
let top = 0;
|
||||
let left = 0
|
||||
let top = 0
|
||||
|
||||
try {
|
||||
const lastFocused = await browser.windows.getLastFocused();
|
||||
const lastFocused = await browser.windows.getLastFocused()
|
||||
|
||||
if (
|
||||
lastFocused &&
|
||||
@@ -128,17 +128,17 @@ export async function getPosition(width, height) {
|
||||
lastFocused.width !== undefined &&
|
||||
lastFocused.height !== undefined
|
||||
) {
|
||||
top = Math.round(lastFocused.top + (lastFocused.height - height) / 2);
|
||||
left = Math.round(lastFocused.left + (lastFocused.width - width) / 2);
|
||||
top = Math.round(lastFocused.top + (lastFocused.height - height) / 2)
|
||||
left = Math.round(lastFocused.left + (lastFocused.width - width) / 2)
|
||||
} else {
|
||||
console.error("Last focused window properties are undefined.");
|
||||
console.error('Last focused window properties are undefined.')
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error getting window position:", error);
|
||||
console.error('Error getting window position:', error)
|
||||
}
|
||||
|
||||
return {
|
||||
top,
|
||||
left,
|
||||
};
|
||||
left
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"name": "Nostr Connect",
|
||||
"name": "Nostr Signer (formerly Nostr Connect)",
|
||||
"description": "Nostr Signer Extension",
|
||||
"version": "0.1.2",
|
||||
"homepage_url": "https://github.com/reyamir/nostr-connect",
|
||||
"version": "1.0.0",
|
||||
"homepage_url": "https://git.reya.su/reya/nostr-connect",
|
||||
"manifest_version": 3,
|
||||
"icons": {
|
||||
"16": "icons/icon16.png",
|
||||
@@ -15,7 +15,7 @@
|
||||
"service_worker": "background.build.js"
|
||||
},
|
||||
"action": {
|
||||
"default_title": "Nostr Connect",
|
||||
"default_title": "Nostr Signer",
|
||||
"default_popup": "popup.html"
|
||||
},
|
||||
"content_scripts": [
|
||||
@@ -25,7 +25,7 @@
|
||||
"all_frames": true
|
||||
}
|
||||
],
|
||||
"permissions": ["storage"],
|
||||
"permissions": ["storage", "activeTab", "windows"],
|
||||
"optional_permissions": ["notifications"],
|
||||
"web_accessible_resources": [
|
||||
{
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Nostr Connect</title>
|
||||
<title>Nostr Signer</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<link href="/style.css" rel="stylesheet" />
|
||||
</head>
|
||||
|
||||
@@ -3470,11 +3470,11 @@
|
||||
if (true) {
|
||||
(function() {
|
||||
"use strict";
|
||||
var React15 = require_react();
|
||||
var React14 = require_react();
|
||||
var _assign = require_object_assign();
|
||||
var Scheduler = require_scheduler();
|
||||
var tracing = require_tracing();
|
||||
var ReactSharedInternals = React15.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
||||
var ReactSharedInternals = React14.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
||||
function warn(format) {
|
||||
{
|
||||
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
||||
@@ -3506,7 +3506,7 @@
|
||||
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
||||
}
|
||||
}
|
||||
if (!React15) {
|
||||
if (!React14) {
|
||||
{
|
||||
throw Error("ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM.");
|
||||
}
|
||||
@@ -4842,7 +4842,7 @@
|
||||
var didWarnInvalidChild = false;
|
||||
function flattenChildren(children) {
|
||||
var content = "";
|
||||
React15.Children.forEach(children, function(child) {
|
||||
React14.Children.forEach(children, function(child) {
|
||||
if (child == null) {
|
||||
return;
|
||||
}
|
||||
@@ -4853,7 +4853,7 @@
|
||||
function validateProps(element, props) {
|
||||
{
|
||||
if (typeof props.children === "object" && props.children !== null) {
|
||||
React15.Children.forEach(props.children, function(child) {
|
||||
React14.Children.forEach(props.children, function(child) {
|
||||
if (child == null) {
|
||||
return;
|
||||
}
|
||||
@@ -12056,7 +12056,7 @@
|
||||
}
|
||||
var fakeInternalInstance = {};
|
||||
var isArray = Array.isArray;
|
||||
var emptyRefsObject = new React15.Component().refs;
|
||||
var emptyRefsObject = new React14.Component().refs;
|
||||
var didWarnAboutStateAssignmentForComponent;
|
||||
var didWarnAboutUninitializedState;
|
||||
var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate;
|
||||
@@ -23442,7 +23442,7 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
if (true) {
|
||||
(function() {
|
||||
"use strict";
|
||||
var React15 = require_react();
|
||||
var React14 = require_react();
|
||||
var _assign = require_object_assign();
|
||||
var REACT_ELEMENT_TYPE = 60103;
|
||||
var REACT_PORTAL_TYPE = 60106;
|
||||
@@ -23499,7 +23499,7 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
var ReactSharedInternals = React15.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
||||
var ReactSharedInternals = React14.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
||||
function error(format) {
|
||||
{
|
||||
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
||||
@@ -24269,10 +24269,10 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
return jsxWithValidation(type, props, key, false);
|
||||
}
|
||||
}
|
||||
var jsx8 = jsxWithValidationDynamic;
|
||||
var jsxs = jsxWithValidationStatic;
|
||||
exports.jsx = jsx8;
|
||||
exports.jsxs = jsxs;
|
||||
var jsx10 = jsxWithValidationDynamic;
|
||||
var jsxs3 = jsxWithValidationStatic;
|
||||
exports.jsx = jsx10;
|
||||
exports.jsxs = jsxs3;
|
||||
})();
|
||||
}
|
||||
}
|
||||
@@ -30397,24 +30397,29 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
var import_react_qr_code = __toESM(require_lib());
|
||||
|
||||
// extension/icons.jsx
|
||||
var import_jsx_runtime = __toESM(require_jsx_runtime());
|
||||
function SettingsIcon(props) {
|
||||
return /* @__PURE__ */ React.createElement("svg", {
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", {
|
||||
xmlns: "http://www.w3.org/2000/svg",
|
||||
fill: "none",
|
||||
viewBox: "0 0 24 24",
|
||||
strokeWidth: 1.5,
|
||||
stroke: "currentColor",
|
||||
"aria-label": "Settings",
|
||||
...props
|
||||
}, /* @__PURE__ */ React.createElement("path", {
|
||||
strokeLinecap: "round",
|
||||
strokeLinejoin: "round",
|
||||
d: "M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.324.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 011.37.49l1.296 2.247a1.125 1.125 0 01-.26 1.431l-1.003.827c-.293.24-.438.613-.431.992a6.759 6.759 0 010 .255c-.007.378.138.75.43.99l1.005.828c.424.35.534.954.26 1.43l-1.298 2.247a1.125 1.125 0 01-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.57 6.57 0 01-.22.128c-.331.183-.581.495-.644.869l-.213 1.28c-.09.543-.56.941-1.11.941h-2.594c-.55 0-1.02-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 01-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 01-1.369-.49l-1.297-2.247a1.125 1.125 0 01.26-1.431l1.004-.827c.292-.24.437-.613.43-.992a6.932 6.932 0 010-.255c.007-.378-.138-.75-.43-.99l-1.004-.828a1.125 1.125 0 01-.26-1.43l1.297-2.247a1.125 1.125 0 011.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.087.22-.128.332-.183.582-.495.644-.869l.214-1.281z"
|
||||
}), /* @__PURE__ */ React.createElement("path", {
|
||||
strokeLinecap: "round",
|
||||
strokeLinejoin: "round",
|
||||
d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z"
|
||||
}));
|
||||
...props,
|
||||
children: [
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", {
|
||||
strokeLinecap: "round",
|
||||
strokeLinejoin: "round",
|
||||
d: "M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.324.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 011.37.49l1.296 2.247a1.125 1.125 0 01-.26 1.431l-1.003.827c-.293.24-.438.613-.431.992a6.759 6.759 0 010 .255c-.007.378.138.75.43.99l1.005.828c.424.35.534.954.26 1.43l-1.298 2.247a1.125 1.125 0 01-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.57 6.57 0 01-.22.128c-.331.183-.581.495-.644.869l-.213 1.28c-.09.543-.56.941-1.11.941h-2.594c-.55 0-1.02-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 01-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 01-1.369-.49l-1.297-2.247a1.125 1.125 0 01.26-1.431l1.004-.827c.292-.24.437-.613.43-.992a6.932 6.932 0 010-.255c.007-.378-.138-.75-.43-.99l-1.004-.828a1.125 1.125 0 01-.26-1.43l1.297-2.247a1.125 1.125 0 011.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.087.22-.128.332-.183.582-.495.644-.869l.214-1.281z"
|
||||
}),
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", {
|
||||
strokeLinecap: "round",
|
||||
strokeLinejoin: "round",
|
||||
d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z"
|
||||
})
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
// node_modules/.pnpm/minidenticons@4.2.1/node_modules/minidenticons/minidenticons.js
|
||||
@@ -30458,7 +30463,7 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
);
|
||||
|
||||
// node_modules/.pnpm/@radix-ui+react-tabs@1.1.13_@types+react-dom@19.0.2_@types+react@19.0.2__@types+react@1_07a8406c49e3b49a1525c388b85a0cee/node_modules/@radix-ui/react-tabs/dist/index.mjs
|
||||
var React14 = __toESM(require_react(), 1);
|
||||
var React13 = __toESM(require_react(), 1);
|
||||
|
||||
// node_modules/.pnpm/@radix-ui+primitive@1.1.3/node_modules/@radix-ui/primitive/dist/index.mjs
|
||||
var canUseDOM = !!(typeof self !== "undefined" && self.document && self.document.createElement);
|
||||
@@ -30472,24 +30477,24 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
}
|
||||
|
||||
// node_modules/.pnpm/@radix-ui+react-context@1.1.2_@types+react@19.0.2_react@17.0.2/node_modules/@radix-ui/react-context/dist/index.mjs
|
||||
var React2 = __toESM(require_react(), 1);
|
||||
var React = __toESM(require_react(), 1);
|
||||
var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
|
||||
function createContextScope(scopeName, createContextScopeDeps = []) {
|
||||
let defaultContexts = [];
|
||||
function createContext3(rootComponentName, defaultContext) {
|
||||
const BaseContext = React2.createContext(defaultContext);
|
||||
const BaseContext = React.createContext(defaultContext);
|
||||
const index = defaultContexts.length;
|
||||
defaultContexts = [...defaultContexts, defaultContext];
|
||||
const Provider = (props) => {
|
||||
const { scope, children, ...context } = props;
|
||||
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
||||
const value = React2.useMemo(() => context, Object.values(context));
|
||||
const value = React.useMemo(() => context, Object.values(context));
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Context.Provider, { value, children });
|
||||
};
|
||||
Provider.displayName = rootComponentName + "Provider";
|
||||
function useContext22(consumerName, scope) {
|
||||
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
||||
const context = React2.useContext(Context);
|
||||
const context = React.useContext(Context);
|
||||
if (context)
|
||||
return context;
|
||||
if (defaultContext !== void 0)
|
||||
@@ -30500,11 +30505,11 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
}
|
||||
const createScope = () => {
|
||||
const scopeContexts = defaultContexts.map((defaultContext) => {
|
||||
return React2.createContext(defaultContext);
|
||||
return React.createContext(defaultContext);
|
||||
});
|
||||
return function useScope(scope) {
|
||||
const contexts = scope?.[scopeName] || scopeContexts;
|
||||
return React2.useMemo(
|
||||
return React.useMemo(
|
||||
() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
|
||||
[scope, contexts]
|
||||
);
|
||||
@@ -30528,7 +30533,7 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
const currentScope = scopeProps[`__scope${scopeName}`];
|
||||
return { ...nextScopes2, ...currentScope };
|
||||
}, {});
|
||||
return React2.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
||||
return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
||||
};
|
||||
};
|
||||
createScope.scopeName = baseScope.scopeName;
|
||||
@@ -30536,13 +30541,13 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
}
|
||||
|
||||
// node_modules/.pnpm/@radix-ui+react-roving-focus@1.1.11_@types+react-dom@19.0.2_@types+react@19.0.2__@types_04f6d74bc65ad693200463421fbc77b6/node_modules/@radix-ui/react-roving-focus/dist/index.mjs
|
||||
var React12 = __toESM(require_react(), 1);
|
||||
var React11 = __toESM(require_react(), 1);
|
||||
|
||||
// node_modules/.pnpm/@radix-ui+react-collection@1.1.7_@types+react-dom@19.0.2_@types+react@19.0.2__@types+re_a0241bee01f1f2b3ebba2085e3e5e66a/node_modules/@radix-ui/react-collection/dist/index.mjs
|
||||
var import_react = __toESM(require_react(), 1);
|
||||
|
||||
// node_modules/.pnpm/@radix-ui+react-compose-refs@1.1.2_@types+react@19.0.2_react@17.0.2/node_modules/@radix-ui/react-compose-refs/dist/index.mjs
|
||||
var React3 = __toESM(require_react(), 1);
|
||||
var React2 = __toESM(require_react(), 1);
|
||||
function setRef(ref, value) {
|
||||
if (typeof ref === "function") {
|
||||
return ref(value);
|
||||
@@ -30575,30 +30580,30 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
};
|
||||
}
|
||||
function useComposedRefs(...refs) {
|
||||
return React3.useCallback(composeRefs(...refs), refs);
|
||||
return React2.useCallback(composeRefs(...refs), refs);
|
||||
}
|
||||
|
||||
// node_modules/.pnpm/@radix-ui+react-slot@1.2.3_@types+react@19.0.2_react@17.0.2/node_modules/@radix-ui/react-slot/dist/index.mjs
|
||||
var React4 = __toESM(require_react(), 1);
|
||||
var React3 = __toESM(require_react(), 1);
|
||||
var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
|
||||
function createSlot(ownerName) {
|
||||
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
||||
const Slot2 = React4.forwardRef((props, forwardedRef) => {
|
||||
const Slot2 = React3.forwardRef((props, forwardedRef) => {
|
||||
const { children, ...slotProps } = props;
|
||||
const childrenArray = React4.Children.toArray(children);
|
||||
const childrenArray = React3.Children.toArray(children);
|
||||
const slottable = childrenArray.find(isSlottable);
|
||||
if (slottable) {
|
||||
const newElement = slottable.props.children;
|
||||
const newChildren = childrenArray.map((child) => {
|
||||
if (child === slottable) {
|
||||
if (React4.Children.count(newElement) > 1)
|
||||
return React4.Children.only(null);
|
||||
return React4.isValidElement(newElement) ? newElement.props.children : null;
|
||||
if (React3.Children.count(newElement) > 1)
|
||||
return React3.Children.only(null);
|
||||
return React3.isValidElement(newElement) ? newElement.props.children : null;
|
||||
} else {
|
||||
return child;
|
||||
}
|
||||
});
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children: React4.isValidElement(newElement) ? React4.cloneElement(newElement, void 0, newChildren) : null });
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children: React3.isValidElement(newElement) ? React3.cloneElement(newElement, void 0, newChildren) : null });
|
||||
}
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
||||
});
|
||||
@@ -30606,24 +30611,24 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
return Slot2;
|
||||
}
|
||||
function createSlotClone(ownerName) {
|
||||
const SlotClone = React4.forwardRef((props, forwardedRef) => {
|
||||
const SlotClone = React3.forwardRef((props, forwardedRef) => {
|
||||
const { children, ...slotProps } = props;
|
||||
if (React4.isValidElement(children)) {
|
||||
if (React3.isValidElement(children)) {
|
||||
const childrenRef = getElementRef(children);
|
||||
const props2 = mergeProps(slotProps, children.props);
|
||||
if (children.type !== React4.Fragment) {
|
||||
if (children.type !== React3.Fragment) {
|
||||
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
||||
}
|
||||
return React4.cloneElement(children, props2);
|
||||
return React3.cloneElement(children, props2);
|
||||
}
|
||||
return React4.Children.count(children) > 1 ? React4.Children.only(null) : null;
|
||||
return React3.Children.count(children) > 1 ? React3.Children.only(null) : null;
|
||||
});
|
||||
SlotClone.displayName = `${ownerName}.SlotClone`;
|
||||
return SlotClone;
|
||||
}
|
||||
var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
|
||||
function isSlottable(child) {
|
||||
return React4.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
||||
return React3.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
||||
}
|
||||
function mergeProps(slotProps, childProps) {
|
||||
const overrideProps = { ...childProps };
|
||||
@@ -30733,18 +30738,18 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
}
|
||||
|
||||
// node_modules/.pnpm/@radix-ui+react-id@1.1.1_@types+react@19.0.2_react@17.0.2/node_modules/@radix-ui/react-id/dist/index.mjs
|
||||
var React7 = __toESM(require_react(), 1);
|
||||
var React6 = __toESM(require_react(), 1);
|
||||
|
||||
// node_modules/.pnpm/@radix-ui+react-use-layout-effect@1.1.1_@types+react@19.0.2_react@17.0.2/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
|
||||
var React6 = __toESM(require_react(), 1);
|
||||
var useLayoutEffect2 = globalThis?.document ? React6.useLayoutEffect : () => {
|
||||
var React5 = __toESM(require_react(), 1);
|
||||
var useLayoutEffect2 = globalThis?.document ? React5.useLayoutEffect : () => {
|
||||
};
|
||||
|
||||
// node_modules/.pnpm/@radix-ui+react-id@1.1.1_@types+react@19.0.2_react@17.0.2/node_modules/@radix-ui/react-id/dist/index.mjs
|
||||
var useReactId = React7[" useId ".trim().toString()] || (() => void 0);
|
||||
var useReactId = React6[" useId ".trim().toString()] || (() => void 0);
|
||||
var count = 0;
|
||||
function useId(deterministicId) {
|
||||
const [id, setId] = React7.useState(useReactId());
|
||||
const [id, setId] = React6.useState(useReactId());
|
||||
useLayoutEffect2(() => {
|
||||
if (!deterministicId)
|
||||
setId((reactId) => reactId ?? String(count++));
|
||||
@@ -30753,7 +30758,7 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
}
|
||||
|
||||
// node_modules/.pnpm/@radix-ui+react-primitive@2.1.3_@types+react-dom@19.0.2_@types+react@19.0.2__@types+rea_4d2f7b7fa17f2c71e22e7a2adbe76a73/node_modules/@radix-ui/react-primitive/dist/index.mjs
|
||||
var React8 = __toESM(require_react(), 1);
|
||||
var React7 = __toESM(require_react(), 1);
|
||||
var ReactDOM = __toESM(require_react_dom(), 1);
|
||||
var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1);
|
||||
var NODES = [
|
||||
@@ -30777,7 +30782,7 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
];
|
||||
var Primitive = NODES.reduce((primitive, node) => {
|
||||
const Slot = createSlot(`Primitive.${node}`);
|
||||
const Node2 = React8.forwardRef((props, forwardedRef) => {
|
||||
const Node2 = React7.forwardRef((props, forwardedRef) => {
|
||||
const { asChild, ...primitiveProps } = props;
|
||||
const Comp = asChild ? Slot : node;
|
||||
if (typeof self !== "undefined") {
|
||||
@@ -30790,19 +30795,19 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
}, {});
|
||||
|
||||
// node_modules/.pnpm/@radix-ui+react-use-callback-ref@1.1.1_@types+react@19.0.2_react@17.0.2/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs
|
||||
var React9 = __toESM(require_react(), 1);
|
||||
var React8 = __toESM(require_react(), 1);
|
||||
function useCallbackRef(callback) {
|
||||
const callbackRef = React9.useRef(callback);
|
||||
React9.useEffect(() => {
|
||||
const callbackRef = React8.useRef(callback);
|
||||
React8.useEffect(() => {
|
||||
callbackRef.current = callback;
|
||||
});
|
||||
return React9.useMemo(() => (...args) => callbackRef.current?.(...args), []);
|
||||
return React8.useMemo(() => (...args) => callbackRef.current?.(...args), []);
|
||||
}
|
||||
|
||||
// node_modules/.pnpm/@radix-ui+react-use-controllable-state@1.2.2_@types+react@19.0.2_react@17.0.2/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
|
||||
var React10 = __toESM(require_react(), 1);
|
||||
var React9 = __toESM(require_react(), 1);
|
||||
var React23 = __toESM(require_react(), 1);
|
||||
var useInsertionEffect = React10[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
|
||||
var useInsertionEffect = React9[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
|
||||
function useControllableState({
|
||||
prop,
|
||||
defaultProp,
|
||||
@@ -30817,8 +30822,8 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
const isControlled = prop !== void 0;
|
||||
const value = isControlled ? prop : uncontrolledProp;
|
||||
if (true) {
|
||||
const isControlledRef = React10.useRef(prop !== void 0);
|
||||
React10.useEffect(() => {
|
||||
const isControlledRef = React9.useRef(prop !== void 0);
|
||||
React9.useEffect(() => {
|
||||
const wasControlled = isControlledRef.current;
|
||||
if (wasControlled !== isControlled) {
|
||||
const from = wasControlled ? "controlled" : "uncontrolled";
|
||||
@@ -30830,7 +30835,7 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
isControlledRef.current = isControlled;
|
||||
}, [isControlled, caller]);
|
||||
}
|
||||
const setValue = React10.useCallback(
|
||||
const setValue = React9.useCallback(
|
||||
(nextValue) => {
|
||||
if (isControlled) {
|
||||
const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
|
||||
@@ -30849,13 +30854,13 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
defaultProp,
|
||||
onChange
|
||||
}) {
|
||||
const [value, setValue] = React10.useState(defaultProp);
|
||||
const prevValueRef = React10.useRef(value);
|
||||
const onChangeRef = React10.useRef(onChange);
|
||||
const [value, setValue] = React9.useState(defaultProp);
|
||||
const prevValueRef = React9.useRef(value);
|
||||
const onChangeRef = React9.useRef(onChange);
|
||||
useInsertionEffect(() => {
|
||||
onChangeRef.current = onChange;
|
||||
}, [onChange]);
|
||||
React10.useEffect(() => {
|
||||
React9.useEffect(() => {
|
||||
if (prevValueRef.current !== value) {
|
||||
onChangeRef.current?.(value);
|
||||
prevValueRef.current = value;
|
||||
@@ -30869,11 +30874,11 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
var SYNC_STATE = Symbol("RADIX:SYNC_STATE");
|
||||
|
||||
// node_modules/.pnpm/@radix-ui+react-direction@1.1.1_@types+react@19.0.2_react@17.0.2/node_modules/@radix-ui/react-direction/dist/index.mjs
|
||||
var React11 = __toESM(require_react(), 1);
|
||||
var React10 = __toESM(require_react(), 1);
|
||||
var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1);
|
||||
var DirectionContext = React11.createContext(void 0);
|
||||
var DirectionContext = React10.createContext(void 0);
|
||||
function useDirection(localDir) {
|
||||
const globalDir = React11.useContext(DirectionContext);
|
||||
const globalDir = React10.useContext(DirectionContext);
|
||||
return localDir || globalDir || "ltr";
|
||||
}
|
||||
|
||||
@@ -30889,13 +30894,13 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
[createCollectionScope]
|
||||
);
|
||||
var [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME);
|
||||
var RovingFocusGroup = React12.forwardRef(
|
||||
var RovingFocusGroup = React11.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Collection.Provider, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Collection.Slot, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(RovingFocusGroupImpl, { ...props, ref: forwardedRef }) }) });
|
||||
}
|
||||
);
|
||||
RovingFocusGroup.displayName = GROUP_NAME;
|
||||
var RovingFocusGroupImpl = React12.forwardRef((props, forwardedRef) => {
|
||||
var RovingFocusGroupImpl = React11.forwardRef((props, forwardedRef) => {
|
||||
const {
|
||||
__scopeRovingFocusGroup,
|
||||
orientation,
|
||||
@@ -30908,7 +30913,7 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
preventScrollOnEntryFocus = false,
|
||||
...groupProps
|
||||
} = props;
|
||||
const ref = React12.useRef(null);
|
||||
const ref = React11.useRef(null);
|
||||
const composedRefs = useComposedRefs(forwardedRef, ref);
|
||||
const direction = useDirection(dir);
|
||||
const [currentTabStopId, setCurrentTabStopId] = useControllableState({
|
||||
@@ -30917,12 +30922,12 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
onChange: onCurrentTabStopIdChange,
|
||||
caller: GROUP_NAME
|
||||
});
|
||||
const [isTabbingBackOut, setIsTabbingBackOut] = React12.useState(false);
|
||||
const [isTabbingBackOut, setIsTabbingBackOut] = React11.useState(false);
|
||||
const handleEntryFocus = useCallbackRef(onEntryFocus);
|
||||
const getItems = useCollection(__scopeRovingFocusGroup);
|
||||
const isClickFocusRef = React12.useRef(false);
|
||||
const [focusableItemsCount, setFocusableItemsCount] = React12.useState(0);
|
||||
React12.useEffect(() => {
|
||||
const isClickFocusRef = React11.useRef(false);
|
||||
const [focusableItemsCount, setFocusableItemsCount] = React11.useState(0);
|
||||
React11.useEffect(() => {
|
||||
const node = ref.current;
|
||||
if (node) {
|
||||
node.addEventListener(ENTRY_FOCUS, handleEntryFocus);
|
||||
@@ -30937,16 +30942,16 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
dir: direction,
|
||||
loop,
|
||||
currentTabStopId,
|
||||
onItemFocus: React12.useCallback(
|
||||
onItemFocus: React11.useCallback(
|
||||
(tabStopId) => setCurrentTabStopId(tabStopId),
|
||||
[setCurrentTabStopId]
|
||||
),
|
||||
onItemShiftTab: React12.useCallback(() => setIsTabbingBackOut(true), []),
|
||||
onFocusableItemAdd: React12.useCallback(
|
||||
onItemShiftTab: React11.useCallback(() => setIsTabbingBackOut(true), []),
|
||||
onFocusableItemAdd: React11.useCallback(
|
||||
() => setFocusableItemsCount((prevCount) => prevCount + 1),
|
||||
[]
|
||||
),
|
||||
onFocusableItemRemove: React12.useCallback(
|
||||
onFocusableItemRemove: React11.useCallback(
|
||||
() => setFocusableItemsCount((prevCount) => prevCount - 1),
|
||||
[]
|
||||
),
|
||||
@@ -30986,7 +30991,7 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
);
|
||||
});
|
||||
var ITEM_NAME = "RovingFocusGroupItem";
|
||||
var RovingFocusGroupItem = React12.forwardRef(
|
||||
var RovingFocusGroupItem = React11.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const {
|
||||
__scopeRovingFocusGroup,
|
||||
@@ -31002,7 +31007,7 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
const isCurrentTabStop = context.currentTabStopId === id;
|
||||
const getItems = useCollection(__scopeRovingFocusGroup);
|
||||
const { onFocusableItemAdd, onFocusableItemRemove, currentTabStopId } = context;
|
||||
React12.useEffect(() => {
|
||||
React11.useEffect(() => {
|
||||
if (focusable) {
|
||||
onFocusableItemAdd();
|
||||
return () => onFocusableItemRemove();
|
||||
@@ -31103,10 +31108,10 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
|
||||
// node_modules/.pnpm/@radix-ui+react-presence@1.1.5_@types+react-dom@19.0.2_@types+react@19.0.2__@types+reac_100e8a92f6fdf86fd4a0d9e34245f26e/node_modules/@radix-ui/react-presence/dist/index.mjs
|
||||
var React24 = __toESM(require_react(), 1);
|
||||
var React13 = __toESM(require_react(), 1);
|
||||
var React12 = __toESM(require_react(), 1);
|
||||
"use client";
|
||||
function useStateMachine(initialState, machine) {
|
||||
return React13.useReducer((state, event) => {
|
||||
return React12.useReducer((state, event) => {
|
||||
const nextState = machine[state][event];
|
||||
return nextState ?? state;
|
||||
}, initialState);
|
||||
@@ -31237,7 +31242,7 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
]);
|
||||
var useRovingFocusGroupScope = createRovingFocusGroupScope();
|
||||
var [TabsProvider, useTabsContext] = createTabsContext(TABS_NAME);
|
||||
var Tabs = React14.forwardRef(
|
||||
var Tabs = React13.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const {
|
||||
__scopeTabs,
|
||||
@@ -31281,7 +31286,7 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
);
|
||||
Tabs.displayName = TABS_NAME;
|
||||
var TAB_LIST_NAME = "TabsList";
|
||||
var TabsList = React14.forwardRef(
|
||||
var TabsList = React13.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const { __scopeTabs, loop = true, ...listProps } = props;
|
||||
const context = useTabsContext(TAB_LIST_NAME, __scopeTabs);
|
||||
@@ -31309,7 +31314,7 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
);
|
||||
TabsList.displayName = TAB_LIST_NAME;
|
||||
var TRIGGER_NAME = "TabsTrigger";
|
||||
var TabsTrigger = React14.forwardRef(
|
||||
var TabsTrigger = React13.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const { __scopeTabs, value, disabled = false, ...triggerProps } = props;
|
||||
const context = useTabsContext(TRIGGER_NAME, __scopeTabs);
|
||||
@@ -31362,15 +31367,15 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
);
|
||||
TabsTrigger.displayName = TRIGGER_NAME;
|
||||
var CONTENT_NAME = "TabsContent";
|
||||
var TabsContent = React14.forwardRef(
|
||||
var TabsContent = React13.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const { __scopeTabs, value, forceMount, children, ...contentProps } = props;
|
||||
const context = useTabsContext(CONTENT_NAME, __scopeTabs);
|
||||
const triggerId = makeTriggerId(context.baseId, value);
|
||||
const contentId = makeContentId(context.baseId, value);
|
||||
const isSelected = value === context.value;
|
||||
const isMountAnimationPreventedRef = React14.useRef(isSelected);
|
||||
React14.useEffect(() => {
|
||||
const isMountAnimationPreventedRef = React13.useRef(isSelected);
|
||||
React13.useEffect(() => {
|
||||
const rAF = requestAnimationFrame(() => isMountAnimationPreventedRef.current = false);
|
||||
return () => cancelAnimationFrame(rAF);
|
||||
}, []);
|
||||
@@ -31407,7 +31412,12 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
var Trigger = TabsTrigger;
|
||||
var Content = TabsContent;
|
||||
|
||||
// node_modules/.pnpm/nostr-tools@2.23.3/node_modules/nostr-tools/lib/esm/utils.js
|
||||
var utf8Decoder2 = new TextDecoder("utf-8");
|
||||
var utf8Encoder2 = new TextEncoder();
|
||||
|
||||
// extension/popup.jsx
|
||||
var import_jsx_runtime = __toESM(require_jsx_runtime());
|
||||
function Popup() {
|
||||
const [keys, setKeys] = (0, import_react3.useState)(null);
|
||||
const avatarURI = (0, import_react3.useMemo)(
|
||||
@@ -31422,9 +31432,9 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
(0, import_react3.useEffect)(() => {
|
||||
import_webextension_polyfill.default.storage.local.get(["private_key", "relays"]).then((results) => {
|
||||
if (results.private_key) {
|
||||
const hexKey = getPublicKey(results.private_key);
|
||||
const npubKey = nip19_exports.npubEncode(hexKey);
|
||||
setKeys({ npub: npubKey, hex: hexKey });
|
||||
const hexKey = getPublicKey(hexToBytes(results.private_key));
|
||||
const npub = nip19_exports.npubEncode(hexKey);
|
||||
setKeys({ npub, hex: hexKey });
|
||||
if (results.relays) {
|
||||
const relaysList = [];
|
||||
for (const url in results.relays) {
|
||||
@@ -31447,105 +31457,170 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
}
|
||||
});
|
||||
}, []);
|
||||
return /* @__PURE__ */ React.createElement("div", {
|
||||
className: "w-[320px] p-6"
|
||||
}, !keys ? /* @__PURE__ */ React.createElement("div", {
|
||||
className: "flex items-center justify-between gap-6"
|
||||
}, /* @__PURE__ */ React.createElement("div", {
|
||||
className: "flex-1 flex items-center justify-between"
|
||||
}, /* @__PURE__ */ React.createElement("p", {
|
||||
className: "text-sm font-medium"
|
||||
}, "Click here to enter or create", /* @__PURE__ */ React.createElement("br", null), "your first identity"), /* @__PURE__ */ React.createElement("svg", {
|
||||
xmlns: "http://www.w3.org/2000/svg",
|
||||
fill: "none",
|
||||
viewBox: "0 0 24 24",
|
||||
strokeWidth: 1.5,
|
||||
stroke: "currentColor",
|
||||
className: "w-6 h-6",
|
||||
"aria-hidden": "true"
|
||||
}, /* @__PURE__ */ React.createElement("path", {
|
||||
strokeLinecap: "round",
|
||||
strokeLinejoin: "round",
|
||||
d: "M13.5 4.5L21 12m0 0l-7.5 7.5M21 12H3"
|
||||
}))), /* @__PURE__ */ React.createElement("button", {
|
||||
type: "button",
|
||||
onClick: () => gotoSettings(),
|
||||
className: "w-9 h-9 shrink-0 border border-primary shadow-sm rounded-xl inline-flex items-center justify-center"
|
||||
}, /* @__PURE__ */ React.createElement(SettingsIcon, {
|
||||
className: "w-5 h-5 text-muted"
|
||||
}))) : /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", {
|
||||
className: "mb-2 flex items-center justify-between"
|
||||
}, /* @__PURE__ */ React.createElement("div", {
|
||||
className: "flex items-center gap-2"
|
||||
}, avatarURI ? /* @__PURE__ */ React.createElement("img", {
|
||||
src: avatarURI,
|
||||
className: "w-9 h-9 rounded-full bg-muted",
|
||||
alt: "Avatar"
|
||||
}) : /* @__PURE__ */ React.createElement("div", {
|
||||
className: "w-9 h-9 rounded-full bg-muted"
|
||||
}), /* @__PURE__ */ React.createElement("p", {
|
||||
className: "font-semibold"
|
||||
}, "Account")), /* @__PURE__ */ React.createElement("button", {
|
||||
type: "button",
|
||||
onClick: () => gotoSettings(),
|
||||
className: "w-9 h-9 shrink-0 border border-primary shadow-sm rounded-xl inline-flex items-center justify-center"
|
||||
}, /* @__PURE__ */ React.createElement(SettingsIcon, {
|
||||
className: "w-5 h-5 text-muted"
|
||||
}))), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(Root2, {
|
||||
defaultValue: "npub"
|
||||
}, /* @__PURE__ */ React.createElement(List, {
|
||||
className: "w-full border-b border-primary h-10 flex items-center"
|
||||
}, /* @__PURE__ */ React.createElement(Trigger, {
|
||||
value: "npub",
|
||||
className: "font-medium flex-1 flex items-center justify-center text-muted h-10 data-[state=active]:text-primary data-[state=active]:border-b data-[state=active]:border-secondary"
|
||||
}, "npub"), /* @__PURE__ */ React.createElement(Trigger, {
|
||||
value: "hex",
|
||||
className: "font-medium flex-1 flex items-center justify-center text-muted h-10 data-[state=active]:text-primary data-[state=active]:border-b data-[state=active]:border-secondary"
|
||||
}, "hex"), keys.nprofile ? /* @__PURE__ */ React.createElement(Trigger, {
|
||||
value: "nprofile",
|
||||
className: "font-medium flex-1 flex items-center justify-center text-muted h-10 data-[state=active]:text-primary data-[state=active]:border-b data-[state=active]:border-secondary"
|
||||
}, "nprofile") : null), /* @__PURE__ */ React.createElement(Content, {
|
||||
value: "npub"
|
||||
}, /* @__PURE__ */ React.createElement("div", {
|
||||
className: "my-4"
|
||||
}, /* @__PURE__ */ React.createElement("textarea", {
|
||||
value: keys.npub,
|
||||
readOnly: true,
|
||||
className: "w-full h-20 resize-none p-3 bg-muted rounded-xl"
|
||||
})), /* @__PURE__ */ React.createElement("div", {
|
||||
className: "w-full rounded-xl border border-primary p-4 flex items-center justify-center"
|
||||
}, /* @__PURE__ */ React.createElement(import_react_qr_code.default, {
|
||||
size: 128,
|
||||
value: keys.npub
|
||||
}))), /* @__PURE__ */ React.createElement(Content, {
|
||||
value: "hex"
|
||||
}, /* @__PURE__ */ React.createElement("div", {
|
||||
className: "my-4"
|
||||
}, /* @__PURE__ */ React.createElement("textarea", {
|
||||
value: keys.hex,
|
||||
readOnly: true,
|
||||
className: "w-full h-20 resize-none p-3 bg-muted rounded-xl"
|
||||
})), /* @__PURE__ */ React.createElement("div", {
|
||||
className: "w-full rounded-xl border border-primary p-4 flex items-center justify-center"
|
||||
}, /* @__PURE__ */ React.createElement(import_react_qr_code.default, {
|
||||
size: 128,
|
||||
value: keys.hex
|
||||
}))), keys.nprofile ? /* @__PURE__ */ React.createElement(Content, {
|
||||
value: "nprofile"
|
||||
}, /* @__PURE__ */ React.createElement("div", {
|
||||
className: "my-4"
|
||||
}, /* @__PURE__ */ React.createElement("textarea", {
|
||||
value: keys.nprofile,
|
||||
readOnly: true,
|
||||
className: "w-full h-20 resize-none p-3 bg-muted rounded-xl"
|
||||
})), /* @__PURE__ */ React.createElement("div", {
|
||||
className: "w-full rounded-xl border border-primary p-4 flex items-center justify-center"
|
||||
}, /* @__PURE__ */ React.createElement(import_react_qr_code.default, {
|
||||
size: 128,
|
||||
value: keys.nprofile
|
||||
}))) : null))));
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
||||
className: "w-[320px] p-6",
|
||||
children: !keys ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
||||
className: "flex items-center justify-between gap-6",
|
||||
children: [
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
||||
className: "flex-1 flex items-center justify-between",
|
||||
children: [
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", {
|
||||
className: "text-sm font-medium",
|
||||
children: [
|
||||
"Click here to enter or create",
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("br", {}),
|
||||
"your first identity"
|
||||
]
|
||||
}),
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", {
|
||||
xmlns: "http://www.w3.org/2000/svg",
|
||||
fill: "none",
|
||||
viewBox: "0 0 24 24",
|
||||
strokeWidth: 1.5,
|
||||
stroke: "currentColor",
|
||||
className: "w-6 h-6",
|
||||
"aria-hidden": "true",
|
||||
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", {
|
||||
strokeLinecap: "round",
|
||||
strokeLinejoin: "round",
|
||||
d: "M13.5 4.5L21 12m0 0l-7.5 7.5M21 12H3"
|
||||
})
|
||||
})
|
||||
]
|
||||
}),
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
|
||||
type: "button",
|
||||
onClick: () => gotoSettings(),
|
||||
className: "w-9 h-9 shrink-0 border border-primary shadow-sm rounded-xl inline-flex items-center justify-center",
|
||||
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SettingsIcon, {
|
||||
className: "w-5 h-5 text-muted"
|
||||
})
|
||||
})
|
||||
]
|
||||
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
||||
children: [
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
||||
className: "mb-2 flex items-center justify-between",
|
||||
children: [
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
||||
className: "flex items-center gap-2",
|
||||
children: [
|
||||
avatarURI ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
|
||||
src: avatarURI,
|
||||
className: "w-9 h-9 rounded-full bg-muted",
|
||||
alt: "Avatar"
|
||||
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
||||
className: "w-9 h-9 rounded-full bg-muted"
|
||||
}),
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
|
||||
className: "font-semibold",
|
||||
children: "Account"
|
||||
})
|
||||
]
|
||||
}),
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
|
||||
type: "button",
|
||||
onClick: () => gotoSettings(),
|
||||
className: "w-9 h-9 shrink-0 border border-primary shadow-sm rounded-xl inline-flex items-center justify-center",
|
||||
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SettingsIcon, {
|
||||
className: "w-5 h-5 text-muted"
|
||||
})
|
||||
})
|
||||
]
|
||||
}),
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
||||
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Root2, {
|
||||
defaultValue: "npub",
|
||||
children: [
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(List, {
|
||||
className: "w-full border-b border-primary h-10 flex items-center",
|
||||
children: [
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Trigger, {
|
||||
value: "npub",
|
||||
className: "font-medium flex-1 flex items-center justify-center text-muted h-10 data-[state=active]:text-primary data-[state=active]:border-b data-[state=active]:border-secondary",
|
||||
children: "npub"
|
||||
}),
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Trigger, {
|
||||
value: "hex",
|
||||
className: "font-medium flex-1 flex items-center justify-center text-muted h-10 data-[state=active]:text-primary data-[state=active]:border-b data-[state=active]:border-secondary",
|
||||
children: "hex"
|
||||
}),
|
||||
keys.nprofile ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Trigger, {
|
||||
value: "nprofile",
|
||||
className: "font-medium flex-1 flex items-center justify-center text-muted h-10 data-[state=active]:text-primary data-[state=active]:border-b data-[state=active]:border-secondary",
|
||||
children: "nprofile"
|
||||
}) : null
|
||||
]
|
||||
}),
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Content, {
|
||||
value: "npub",
|
||||
children: [
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
||||
className: "my-4",
|
||||
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("textarea", {
|
||||
value: keys.npub,
|
||||
readOnly: true,
|
||||
className: "w-full h-20 resize-none p-3 bg-muted rounded-xl"
|
||||
})
|
||||
}),
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
||||
className: "w-full rounded-xl border border-primary p-4 flex items-center justify-center",
|
||||
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_qr_code.default, {
|
||||
size: 128,
|
||||
value: keys.npub
|
||||
})
|
||||
})
|
||||
]
|
||||
}),
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Content, {
|
||||
value: "hex",
|
||||
children: [
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
||||
className: "my-4",
|
||||
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("textarea", {
|
||||
value: keys.hex,
|
||||
readOnly: true,
|
||||
className: "w-full h-20 resize-none p-3 bg-muted rounded-xl"
|
||||
})
|
||||
}),
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
||||
className: "w-full rounded-xl border border-primary p-4 flex items-center justify-center",
|
||||
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_qr_code.default, {
|
||||
size: 128,
|
||||
value: keys.hex
|
||||
})
|
||||
})
|
||||
]
|
||||
}),
|
||||
keys.nprofile ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Content, {
|
||||
value: "nprofile",
|
||||
children: [
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
||||
className: "my-4",
|
||||
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("textarea", {
|
||||
value: keys.nprofile,
|
||||
readOnly: true,
|
||||
className: "w-full h-20 resize-none p-3 bg-muted rounded-xl"
|
||||
})
|
||||
}),
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
||||
className: "w-full rounded-xl border border-primary p-4 flex items-center justify-center",
|
||||
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_qr_code.default, {
|
||||
size: 128,
|
||||
value: keys.nprofile
|
||||
})
|
||||
})
|
||||
]
|
||||
}) : null
|
||||
]
|
||||
})
|
||||
})
|
||||
]
|
||||
})
|
||||
});
|
||||
}
|
||||
(0, import_react_dom.render)(/* @__PURE__ */ React.createElement(Popup, null), document.getElementById("main"));
|
||||
(0, import_react_dom.render)(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Popup, {}), document.getElementById("main"));
|
||||
})();
|
||||
/*
|
||||
object-assign
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Nostr Connect</title>
|
||||
<title>Nostr Signer</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<link href="/style.css" rel="stylesheet" />
|
||||
</head>
|
||||
|
||||
@@ -3443,11 +3443,11 @@
|
||||
if (true) {
|
||||
(function() {
|
||||
"use strict";
|
||||
var React12 = require_react();
|
||||
var React11 = require_react();
|
||||
var _assign = require_object_assign();
|
||||
var Scheduler = require_scheduler();
|
||||
var tracing = require_tracing();
|
||||
var ReactSharedInternals = React12.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
||||
var ReactSharedInternals = React11.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
||||
function warn(format) {
|
||||
{
|
||||
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
||||
@@ -3479,7 +3479,7 @@
|
||||
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
||||
}
|
||||
}
|
||||
if (!React12) {
|
||||
if (!React11) {
|
||||
{
|
||||
throw Error("ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM.");
|
||||
}
|
||||
@@ -4815,7 +4815,7 @@
|
||||
var didWarnInvalidChild = false;
|
||||
function flattenChildren(children) {
|
||||
var content = "";
|
||||
React12.Children.forEach(children, function(child) {
|
||||
React11.Children.forEach(children, function(child) {
|
||||
if (child == null) {
|
||||
return;
|
||||
}
|
||||
@@ -4826,7 +4826,7 @@
|
||||
function validateProps(element, props) {
|
||||
{
|
||||
if (typeof props.children === "object" && props.children !== null) {
|
||||
React12.Children.forEach(props.children, function(child) {
|
||||
React11.Children.forEach(props.children, function(child) {
|
||||
if (child == null) {
|
||||
return;
|
||||
}
|
||||
@@ -12029,7 +12029,7 @@
|
||||
}
|
||||
var fakeInternalInstance = {};
|
||||
var isArray = Array.isArray;
|
||||
var emptyRefsObject = new React12.Component().refs;
|
||||
var emptyRefsObject = new React11.Component().refs;
|
||||
var didWarnAboutStateAssignmentForComponent;
|
||||
var didWarnAboutUninitializedState;
|
||||
var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate;
|
||||
@@ -21632,7 +21632,7 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
if (true) {
|
||||
(function() {
|
||||
"use strict";
|
||||
var React12 = require_react();
|
||||
var React11 = require_react();
|
||||
var _assign = require_object_assign();
|
||||
var REACT_ELEMENT_TYPE = 60103;
|
||||
var REACT_PORTAL_TYPE = 60106;
|
||||
@@ -21689,7 +21689,7 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
var ReactSharedInternals = React12.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
||||
var ReactSharedInternals = React11.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
||||
function error(format) {
|
||||
{
|
||||
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
||||
@@ -22459,10 +22459,10 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
return jsxWithValidation(type, props, key, false);
|
||||
}
|
||||
}
|
||||
var jsx5 = jsxWithValidationDynamic;
|
||||
var jsxs2 = jsxWithValidationStatic;
|
||||
exports.jsx = jsx5;
|
||||
exports.jsxs = jsxs2;
|
||||
var jsx7 = jsxWithValidationDynamic;
|
||||
var jsxs4 = jsxWithValidationStatic;
|
||||
exports.jsx = jsx7;
|
||||
exports.jsxs = jsxs4;
|
||||
})();
|
||||
}
|
||||
}
|
||||
@@ -22497,73 +22497,93 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
]);
|
||||
|
||||
// extension/icons.jsx
|
||||
var import_jsx_runtime = __toESM(require_jsx_runtime());
|
||||
function LogoIcon() {
|
||||
return /* @__PURE__ */ React.createElement("svg", {
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", {
|
||||
xmlns: "http://www.w3.org/2000/svg",
|
||||
width: "56",
|
||||
height: "56",
|
||||
fill: "none",
|
||||
viewBox: "0 0 56 56",
|
||||
"aria-label": "Nostr Connect logo"
|
||||
}, /* @__PURE__ */ React.createElement("rect", {
|
||||
width: "56",
|
||||
height: "56",
|
||||
fill: "#EEECFD",
|
||||
rx: "16"
|
||||
}), /* @__PURE__ */ React.createElement("rect", {
|
||||
width: "55",
|
||||
height: "55",
|
||||
x: "0.5",
|
||||
y: "0.5",
|
||||
stroke: "#5A41F4",
|
||||
strokeOpacity: "0.25",
|
||||
rx: "15.5"
|
||||
}), /* @__PURE__ */ React.createElement("rect", {
|
||||
width: "39",
|
||||
height: "39",
|
||||
x: "8.5",
|
||||
y: "8.5",
|
||||
fill: "url(#paint0_linear_24_2379)",
|
||||
rx: "19.5"
|
||||
}), /* @__PURE__ */ React.createElement("rect", {
|
||||
width: "39",
|
||||
height: "39",
|
||||
x: "8.5",
|
||||
y: "8.5",
|
||||
stroke: "#6149F6",
|
||||
rx: "19.5"
|
||||
}), /* @__PURE__ */ React.createElement("g", {
|
||||
fill: "#fff",
|
||||
stroke: "#6149F6",
|
||||
clipPath: "url(#clip0_24_2379)"
|
||||
}, /* @__PURE__ */ React.createElement("path", {
|
||||
d: "M23.78 20.634l.408-.235-.21-.422a4.432 4.432 0 01-.458-1.797l-.031-.78-.696.355A11.533 11.533 0 0016.5 27.998h0V28c.002.87.103 1.738.302 2.585a3.525 3.525 0 102.843-1.058A8.377 8.377 0 0119.5 28a8.523 8.523 0 014.28-7.366zM36.5 28.023v.468l.467.03c.621.042 1.227.212 1.778.5l.687.36.044-.774.005-.075c.01-.166.02-.349.02-.532v-.001a11.524 11.524 0 00-8.142-10.99 3.526 3.526 0 10-.501 2.989A8.524 8.524 0 0136.5 28s0 0 0 0v.022zM33.185 32.622a3.49 3.49 0 00.311 1.844 8.442 8.442 0 01-9.766.877l-.407-.239-.262.392c-.343.514-.79.95-1.311 1.282l-.652.414.645.425a11.39 11.39 0 0014.092-1.23c.264.069.536.107.81.113h.01a3.5 3.5 0 002.803-5.6h.556l-1.603-.932a3.49 3.49 0 00-5.226 2.654z"
|
||||
})), /* @__PURE__ */ React.createElement("defs", null, /* @__PURE__ */ React.createElement("linearGradient", {
|
||||
id: "paint0_linear_24_2379",
|
||||
x1: "28",
|
||||
x2: "28",
|
||||
y1: "8",
|
||||
y2: "48",
|
||||
gradientUnits: "userSpaceOnUse"
|
||||
}, /* @__PURE__ */ React.createElement("stop", {
|
||||
stopColor: "#8E7CFF"
|
||||
}), /* @__PURE__ */ React.createElement("stop", {
|
||||
offset: "1",
|
||||
stopColor: "#5A41F4"
|
||||
})), /* @__PURE__ */ React.createElement("clipPath", {
|
||||
id: "clip0_24_2379"
|
||||
}, /* @__PURE__ */ React.createElement("path", {
|
||||
fill: "#fff",
|
||||
d: "M0 0H24V24H0z",
|
||||
transform: "translate(16 15)"
|
||||
}))));
|
||||
"aria-label": "Nostr Signer logo",
|
||||
children: [
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", {
|
||||
width: "56",
|
||||
height: "56",
|
||||
fill: "#EEECFD",
|
||||
rx: "16"
|
||||
}),
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", {
|
||||
width: "55",
|
||||
height: "55",
|
||||
x: "0.5",
|
||||
y: "0.5",
|
||||
stroke: "#5A41F4",
|
||||
strokeOpacity: "0.25",
|
||||
rx: "15.5"
|
||||
}),
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", {
|
||||
width: "39",
|
||||
height: "39",
|
||||
x: "8.5",
|
||||
y: "8.5",
|
||||
fill: "url(#paint0_linear_24_2379)",
|
||||
rx: "19.5"
|
||||
}),
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", {
|
||||
width: "39",
|
||||
height: "39",
|
||||
x: "8.5",
|
||||
y: "8.5",
|
||||
stroke: "#6149F6",
|
||||
rx: "19.5"
|
||||
}),
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("g", {
|
||||
fill: "#fff",
|
||||
stroke: "#6149F6",
|
||||
clipPath: "url(#clip0_24_2379)",
|
||||
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", {
|
||||
d: "M23.78 20.634l.408-.235-.21-.422a4.432 4.432 0 01-.458-1.797l-.031-.78-.696.355A11.533 11.533 0 0016.5 27.998h0V28c.002.87.103 1.738.302 2.585a3.525 3.525 0 102.843-1.058A8.377 8.377 0 0119.5 28a8.523 8.523 0 014.28-7.366zM36.5 28.023v.468l.467.03c.621.042 1.227.212 1.778.5l.687.36.044-.774.005-.075c.01-.166.02-.349.02-.532v-.001a11.524 11.524 0 00-8.142-10.99 3.526 3.526 0 10-.501 2.989A8.524 8.524 0 0136.5 28s0 0 0 0v.022zM33.185 32.622a3.49 3.49 0 00.311 1.844 8.442 8.442 0 01-9.766.877l-.407-.239-.262.392c-.343.514-.79.95-1.311 1.282l-.652.414.645.425a11.39 11.39 0 0014.092-1.23c.264.069.536.107.81.113h.01a3.5 3.5 0 002.803-5.6h.556l-1.603-.932a3.49 3.49 0 00-5.226 2.654z"
|
||||
})
|
||||
}),
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("defs", {
|
||||
children: [
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("linearGradient", {
|
||||
id: "paint0_linear_24_2379",
|
||||
x1: "28",
|
||||
x2: "28",
|
||||
y1: "8",
|
||||
y2: "48",
|
||||
gradientUnits: "userSpaceOnUse",
|
||||
children: [
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("stop", {
|
||||
stopColor: "#8E7CFF"
|
||||
}),
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("stop", {
|
||||
offset: "1",
|
||||
stopColor: "#5A41F4"
|
||||
})
|
||||
]
|
||||
}),
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("clipPath", {
|
||||
id: "clip0_24_2379",
|
||||
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", {
|
||||
fill: "#fff",
|
||||
d: "M0 0H24V24H0z",
|
||||
transform: "translate(16 15)"
|
||||
})
|
||||
})
|
||||
]
|
||||
})
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
// node_modules/.pnpm/@radix-ui+react-checkbox@1.3.3_@types+react-dom@19.0.2_@types+react@19.0.2__@types+reac_d96e45962cc5ba292a62810b70da3303/node_modules/@radix-ui/react-checkbox/dist/index.mjs
|
||||
var React11 = __toESM(require_react(), 1);
|
||||
var React10 = __toESM(require_react(), 1);
|
||||
|
||||
// node_modules/.pnpm/@radix-ui+react-compose-refs@1.1.2_@types+react@19.0.2_react@17.0.2/node_modules/@radix-ui/react-compose-refs/dist/index.mjs
|
||||
var React2 = __toESM(require_react(), 1);
|
||||
var React = __toESM(require_react(), 1);
|
||||
function setRef(ref, value) {
|
||||
if (typeof ref === "function") {
|
||||
return ref(value);
|
||||
@@ -22596,28 +22616,28 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
};
|
||||
}
|
||||
function useComposedRefs(...refs) {
|
||||
return React2.useCallback(composeRefs(...refs), refs);
|
||||
return React.useCallback(composeRefs(...refs), refs);
|
||||
}
|
||||
|
||||
// node_modules/.pnpm/@radix-ui+react-context@1.1.2_@types+react@19.0.2_react@17.0.2/node_modules/@radix-ui/react-context/dist/index.mjs
|
||||
var React3 = __toESM(require_react(), 1);
|
||||
var React2 = __toESM(require_react(), 1);
|
||||
var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
|
||||
function createContextScope(scopeName, createContextScopeDeps = []) {
|
||||
let defaultContexts = [];
|
||||
function createContext3(rootComponentName, defaultContext) {
|
||||
const BaseContext = React3.createContext(defaultContext);
|
||||
const BaseContext = React2.createContext(defaultContext);
|
||||
const index = defaultContexts.length;
|
||||
defaultContexts = [...defaultContexts, defaultContext];
|
||||
const Provider = (props) => {
|
||||
const { scope, children, ...context } = props;
|
||||
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
||||
const value = React3.useMemo(() => context, Object.values(context));
|
||||
const value = React2.useMemo(() => context, Object.values(context));
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Context.Provider, { value, children });
|
||||
};
|
||||
Provider.displayName = rootComponentName + "Provider";
|
||||
function useContext2(consumerName, scope) {
|
||||
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
||||
const context = React3.useContext(Context);
|
||||
const context = React2.useContext(Context);
|
||||
if (context)
|
||||
return context;
|
||||
if (defaultContext !== void 0)
|
||||
@@ -22628,11 +22648,11 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
}
|
||||
const createScope = () => {
|
||||
const scopeContexts = defaultContexts.map((defaultContext) => {
|
||||
return React3.createContext(defaultContext);
|
||||
return React2.createContext(defaultContext);
|
||||
});
|
||||
return function useScope(scope) {
|
||||
const contexts = scope?.[scopeName] || scopeContexts;
|
||||
return React3.useMemo(
|
||||
return React2.useMemo(
|
||||
() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
|
||||
[scope, contexts]
|
||||
);
|
||||
@@ -22656,7 +22676,7 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
const currentScope = scopeProps[`__scope${scopeName}`];
|
||||
return { ...nextScopes2, ...currentScope };
|
||||
}, {});
|
||||
return React3.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
||||
return React2.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
||||
};
|
||||
};
|
||||
createScope.scopeName = baseScope.scopeName;
|
||||
@@ -22675,16 +22695,16 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
}
|
||||
|
||||
// node_modules/.pnpm/@radix-ui+react-use-controllable-state@1.2.2_@types+react@19.0.2_react@17.0.2/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
|
||||
var React5 = __toESM(require_react(), 1);
|
||||
var React4 = __toESM(require_react(), 1);
|
||||
|
||||
// node_modules/.pnpm/@radix-ui+react-use-layout-effect@1.1.1_@types+react@19.0.2_react@17.0.2/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
|
||||
var React4 = __toESM(require_react(), 1);
|
||||
var useLayoutEffect2 = globalThis?.document ? React4.useLayoutEffect : () => {
|
||||
var React3 = __toESM(require_react(), 1);
|
||||
var useLayoutEffect2 = globalThis?.document ? React3.useLayoutEffect : () => {
|
||||
};
|
||||
|
||||
// node_modules/.pnpm/@radix-ui+react-use-controllable-state@1.2.2_@types+react@19.0.2_react@17.0.2/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
|
||||
var React22 = __toESM(require_react(), 1);
|
||||
var useInsertionEffect = React5[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
|
||||
var useInsertionEffect = React4[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
|
||||
function useControllableState({
|
||||
prop,
|
||||
defaultProp,
|
||||
@@ -22699,8 +22719,8 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
const isControlled = prop !== void 0;
|
||||
const value = isControlled ? prop : uncontrolledProp;
|
||||
if (true) {
|
||||
const isControlledRef = React5.useRef(prop !== void 0);
|
||||
React5.useEffect(() => {
|
||||
const isControlledRef = React4.useRef(prop !== void 0);
|
||||
React4.useEffect(() => {
|
||||
const wasControlled = isControlledRef.current;
|
||||
if (wasControlled !== isControlled) {
|
||||
const from = wasControlled ? "controlled" : "uncontrolled";
|
||||
@@ -22712,7 +22732,7 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
isControlledRef.current = isControlled;
|
||||
}, [isControlled, caller]);
|
||||
}
|
||||
const setValue = React5.useCallback(
|
||||
const setValue = React4.useCallback(
|
||||
(nextValue) => {
|
||||
if (isControlled) {
|
||||
const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
|
||||
@@ -22731,13 +22751,13 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
defaultProp,
|
||||
onChange
|
||||
}) {
|
||||
const [value, setValue] = React5.useState(defaultProp);
|
||||
const prevValueRef = React5.useRef(value);
|
||||
const onChangeRef = React5.useRef(onChange);
|
||||
const [value, setValue] = React4.useState(defaultProp);
|
||||
const prevValueRef = React4.useRef(value);
|
||||
const onChangeRef = React4.useRef(onChange);
|
||||
useInsertionEffect(() => {
|
||||
onChangeRef.current = onChange;
|
||||
}, [onChange]);
|
||||
React5.useEffect(() => {
|
||||
React4.useEffect(() => {
|
||||
if (prevValueRef.current !== value) {
|
||||
onChangeRef.current?.(value);
|
||||
prevValueRef.current = value;
|
||||
@@ -22751,10 +22771,10 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
var SYNC_STATE = Symbol("RADIX:SYNC_STATE");
|
||||
|
||||
// node_modules/.pnpm/@radix-ui+react-use-previous@1.1.1_@types+react@19.0.2_react@17.0.2/node_modules/@radix-ui/react-use-previous/dist/index.mjs
|
||||
var React6 = __toESM(require_react(), 1);
|
||||
var React5 = __toESM(require_react(), 1);
|
||||
function usePrevious(value) {
|
||||
const ref = React6.useRef({ value, previous: value });
|
||||
return React6.useMemo(() => {
|
||||
const ref = React5.useRef({ value, previous: value });
|
||||
return React5.useMemo(() => {
|
||||
if (ref.current.value !== value) {
|
||||
ref.current.previous = ref.current.value;
|
||||
ref.current.value = value;
|
||||
@@ -22764,9 +22784,9 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
}
|
||||
|
||||
// node_modules/.pnpm/@radix-ui+react-use-size@1.1.1_@types+react@19.0.2_react@17.0.2/node_modules/@radix-ui/react-use-size/dist/index.mjs
|
||||
var React7 = __toESM(require_react(), 1);
|
||||
var React6 = __toESM(require_react(), 1);
|
||||
function useSize(element) {
|
||||
const [size, setSize] = React7.useState(void 0);
|
||||
const [size, setSize] = React6.useState(void 0);
|
||||
useLayoutEffect2(() => {
|
||||
if (element) {
|
||||
setSize({ width: element.offsetWidth, height: element.offsetHeight });
|
||||
@@ -22802,10 +22822,10 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
|
||||
// node_modules/.pnpm/@radix-ui+react-presence@1.1.5_@types+react-dom@19.0.2_@types+react@19.0.2__@types+reac_100e8a92f6fdf86fd4a0d9e34245f26e/node_modules/@radix-ui/react-presence/dist/index.mjs
|
||||
var React23 = __toESM(require_react(), 1);
|
||||
var React8 = __toESM(require_react(), 1);
|
||||
var React7 = __toESM(require_react(), 1);
|
||||
"use client";
|
||||
function useStateMachine(initialState, machine) {
|
||||
return React8.useReducer((state, event) => {
|
||||
return React7.useReducer((state, event) => {
|
||||
const nextState = machine[state][event];
|
||||
return nextState ?? state;
|
||||
}, initialState);
|
||||
@@ -22928,30 +22948,30 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
}
|
||||
|
||||
// node_modules/.pnpm/@radix-ui+react-primitive@2.1.3_@types+react-dom@19.0.2_@types+react@19.0.2__@types+rea_4d2f7b7fa17f2c71e22e7a2adbe76a73/node_modules/@radix-ui/react-primitive/dist/index.mjs
|
||||
var React10 = __toESM(require_react(), 1);
|
||||
var React9 = __toESM(require_react(), 1);
|
||||
var ReactDOM = __toESM(require_react_dom(), 1);
|
||||
|
||||
// node_modules/.pnpm/@radix-ui+react-slot@1.2.3_@types+react@19.0.2_react@17.0.2/node_modules/@radix-ui/react-slot/dist/index.mjs
|
||||
var React9 = __toESM(require_react(), 1);
|
||||
var React8 = __toESM(require_react(), 1);
|
||||
var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
|
||||
function createSlot(ownerName) {
|
||||
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
||||
const Slot2 = React9.forwardRef((props, forwardedRef) => {
|
||||
const Slot2 = React8.forwardRef((props, forwardedRef) => {
|
||||
const { children, ...slotProps } = props;
|
||||
const childrenArray = React9.Children.toArray(children);
|
||||
const childrenArray = React8.Children.toArray(children);
|
||||
const slottable = childrenArray.find(isSlottable);
|
||||
if (slottable) {
|
||||
const newElement = slottable.props.children;
|
||||
const newChildren = childrenArray.map((child) => {
|
||||
if (child === slottable) {
|
||||
if (React9.Children.count(newElement) > 1)
|
||||
return React9.Children.only(null);
|
||||
return React9.isValidElement(newElement) ? newElement.props.children : null;
|
||||
if (React8.Children.count(newElement) > 1)
|
||||
return React8.Children.only(null);
|
||||
return React8.isValidElement(newElement) ? newElement.props.children : null;
|
||||
} else {
|
||||
return child;
|
||||
}
|
||||
});
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children: React9.isValidElement(newElement) ? React9.cloneElement(newElement, void 0, newChildren) : null });
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children: React8.isValidElement(newElement) ? React8.cloneElement(newElement, void 0, newChildren) : null });
|
||||
}
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
||||
});
|
||||
@@ -22959,24 +22979,24 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
return Slot2;
|
||||
}
|
||||
function createSlotClone(ownerName) {
|
||||
const SlotClone = React9.forwardRef((props, forwardedRef) => {
|
||||
const SlotClone = React8.forwardRef((props, forwardedRef) => {
|
||||
const { children, ...slotProps } = props;
|
||||
if (React9.isValidElement(children)) {
|
||||
if (React8.isValidElement(children)) {
|
||||
const childrenRef = getElementRef2(children);
|
||||
const props2 = mergeProps(slotProps, children.props);
|
||||
if (children.type !== React9.Fragment) {
|
||||
if (children.type !== React8.Fragment) {
|
||||
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
||||
}
|
||||
return React9.cloneElement(children, props2);
|
||||
return React8.cloneElement(children, props2);
|
||||
}
|
||||
return React9.Children.count(children) > 1 ? React9.Children.only(null) : null;
|
||||
return React8.Children.count(children) > 1 ? React8.Children.only(null) : null;
|
||||
});
|
||||
SlotClone.displayName = `${ownerName}.SlotClone`;
|
||||
return SlotClone;
|
||||
}
|
||||
var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
|
||||
function isSlottable(child) {
|
||||
return React9.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
||||
return React8.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
||||
}
|
||||
function mergeProps(slotProps, childProps) {
|
||||
const overrideProps = { ...childProps };
|
||||
@@ -23039,7 +23059,7 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
];
|
||||
var Primitive = NODES.reduce((primitive, node) => {
|
||||
const Slot = createSlot(`Primitive.${node}`);
|
||||
const Node = React10.forwardRef((props, forwardedRef) => {
|
||||
const Node = React9.forwardRef((props, forwardedRef) => {
|
||||
const { asChild, ...primitiveProps } = props;
|
||||
const Comp = asChild ? Slot : node;
|
||||
if (typeof self !== "undefined") {
|
||||
@@ -23077,9 +23097,9 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
onChange: onCheckedChange,
|
||||
caller: CHECKBOX_NAME
|
||||
});
|
||||
const [control, setControl] = React11.useState(null);
|
||||
const [bubbleInput, setBubbleInput] = React11.useState(null);
|
||||
const hasConsumerStoppedPropagationRef = React11.useRef(false);
|
||||
const [control, setControl] = React10.useState(null);
|
||||
const [bubbleInput, setBubbleInput] = React10.useState(null);
|
||||
const hasConsumerStoppedPropagationRef = React10.useRef(false);
|
||||
const isFormControl = control ? !!form || !!control.closest("form") : true;
|
||||
const context = {
|
||||
checked,
|
||||
@@ -23107,7 +23127,7 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
);
|
||||
}
|
||||
var TRIGGER_NAME = "CheckboxTrigger";
|
||||
var CheckboxTrigger = React11.forwardRef(
|
||||
var CheckboxTrigger = React10.forwardRef(
|
||||
({ __scopeCheckbox, onKeyDown, onClick, ...checkboxProps }, forwardedRef) => {
|
||||
const {
|
||||
control,
|
||||
@@ -23122,8 +23142,8 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
bubbleInput
|
||||
} = useCheckboxContext(TRIGGER_NAME, __scopeCheckbox);
|
||||
const composedRefs = useComposedRefs(forwardedRef, setControl);
|
||||
const initialCheckedStateRef = React11.useRef(checked);
|
||||
React11.useEffect(() => {
|
||||
const initialCheckedStateRef = React10.useRef(checked);
|
||||
React10.useEffect(() => {
|
||||
const form = control?.form;
|
||||
if (form) {
|
||||
const reset = () => setChecked(initialCheckedStateRef.current);
|
||||
@@ -23161,7 +23181,7 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
}
|
||||
);
|
||||
CheckboxTrigger.displayName = TRIGGER_NAME;
|
||||
var Checkbox = React11.forwardRef(
|
||||
var Checkbox = React10.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const {
|
||||
__scopeCheckbox,
|
||||
@@ -23209,7 +23229,7 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
);
|
||||
Checkbox.displayName = CHECKBOX_NAME;
|
||||
var INDICATOR_NAME = "CheckboxIndicator";
|
||||
var CheckboxIndicator = React11.forwardRef(
|
||||
var CheckboxIndicator = React10.forwardRef(
|
||||
(props, forwardedRef) => {
|
||||
const { __scopeCheckbox, forceMount, ...indicatorProps } = props;
|
||||
const context = useCheckboxContext(INDICATOR_NAME, __scopeCheckbox);
|
||||
@@ -23233,7 +23253,7 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
);
|
||||
CheckboxIndicator.displayName = INDICATOR_NAME;
|
||||
var BUBBLE_INPUT_NAME = "CheckboxBubbleInput";
|
||||
var CheckboxBubbleInput = React11.forwardRef(
|
||||
var CheckboxBubbleInput = React10.forwardRef(
|
||||
({ __scopeCheckbox, ...props }, forwardedRef) => {
|
||||
const {
|
||||
control,
|
||||
@@ -23251,7 +23271,7 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
const composedRefs = useComposedRefs(forwardedRef, setBubbleInput);
|
||||
const prevChecked = usePrevious(checked);
|
||||
const controlSize = useSize(control);
|
||||
React11.useEffect(() => {
|
||||
React10.useEffect(() => {
|
||||
const input = bubbleInput;
|
||||
if (!input)
|
||||
return;
|
||||
@@ -23269,7 +23289,7 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
input.dispatchEvent(event);
|
||||
}
|
||||
}, [bubbleInput, prevChecked, checked, hasConsumerStoppedPropagationRef]);
|
||||
const defaultCheckedRef = React11.useRef(isIndeterminate(checked) ? false : checked);
|
||||
const defaultCheckedRef = React10.useRef(isIndeterminate(checked) ? false : checked);
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
||||
Primitive.input,
|
||||
{
|
||||
@@ -23309,6 +23329,7 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
}
|
||||
|
||||
// extension/prompt.jsx
|
||||
var import_jsx_runtime = __toESM(require_jsx_runtime());
|
||||
function Prompt() {
|
||||
const [isRemember, setIsRemember] = (0, import_react.useState)(false);
|
||||
const qs = new URLSearchParams(location.search);
|
||||
@@ -23339,58 +23360,107 @@ For more info, visit https://reactjs.org/link/mock-scheduler`);
|
||||
});
|
||||
};
|
||||
}
|
||||
return /* @__PURE__ */ React.createElement("div", {
|
||||
className: "w-screen h-screen flex flex-col items-center justify-center"
|
||||
}, /* @__PURE__ */ React.createElement("div", {
|
||||
className: "p-8 shadow-primary border border-primary rounded-2xl max-w-xl mx-auto flex flex-col gap-5"
|
||||
}, /* @__PURE__ */ React.createElement("div", {
|
||||
className: "flex flex-col items-center gap-5"
|
||||
}, /* @__PURE__ */ React.createElement(LogoIcon, null), /* @__PURE__ */ React.createElement("div", {
|
||||
className: "flex flex-col items-center text-center"
|
||||
}, /* @__PURE__ */ React.createElement("h1", {
|
||||
className: "font-semibold text-lg"
|
||||
}, host), /* @__PURE__ */ React.createElement("p", null, "is requesting your permission to ", /* @__PURE__ */ React.createElement("b", null, PERMISSION_NAMES[type])))), params && /* @__PURE__ */ React.createElement("div", {
|
||||
className: "flex flex-col gap-1"
|
||||
}, /* @__PURE__ */ React.createElement("p", null, "Now acting on"), /* @__PURE__ */ React.createElement("pre", {
|
||||
className: "bg-muted px-2 rounded-xl overflow-scroll"
|
||||
}, /* @__PURE__ */ React.createElement("code", null, JSON.stringify(event || params, null, 2)))), /* @__PURE__ */ React.createElement("div", {
|
||||
className: "flex flex-col gap-4"
|
||||
}, /* @__PURE__ */ React.createElement("div", {
|
||||
className: "flex items-center justify-center gap-2"
|
||||
}, /* @__PURE__ */ React.createElement(Checkbox, {
|
||||
id: "remember",
|
||||
className: "flex h-6 w-6 appearance-none items-center justify-center rounded-lg bg-white outline-none border border-primary data-[state=checked]:bg-primary data-[state=checked]:border-secondary",
|
||||
onCheckedChange: setIsRemember
|
||||
}, /* @__PURE__ */ React.createElement(CheckboxIndicator, {
|
||||
className: "text-white"
|
||||
}, /* @__PURE__ */ React.createElement("svg", {
|
||||
xmlns: "http://www.w3.org/2000/svg",
|
||||
fill: "none",
|
||||
viewBox: "0 0 24 24",
|
||||
strokeWidth: 1.5,
|
||||
stroke: "currentColor",
|
||||
className: "w-4 h-4",
|
||||
"aria-hidden": "true"
|
||||
}, /* @__PURE__ */ React.createElement("path", {
|
||||
strokeLinecap: "round",
|
||||
strokeLinejoin: "round",
|
||||
d: "M4.5 12.75l6 6 9-13.5"
|
||||
})))), /* @__PURE__ */ React.createElement("label", {
|
||||
htmlFor: "remember",
|
||||
className: "text-muted"
|
||||
}, "Remember my preference forever")), /* @__PURE__ */ React.createElement("div", {
|
||||
className: "flex gap-3"
|
||||
}, /* @__PURE__ */ React.createElement("button", {
|
||||
type: "button",
|
||||
onClick: authorizeHandler(false),
|
||||
className: "flex-1 h-10 rounded-lg shadow-sm border border-primary inline-flex items-center justify-center font-semibold"
|
||||
}, "Reject"), /* @__PURE__ */ React.createElement("button", {
|
||||
type: "button",
|
||||
onClick: authorizeHandler(true),
|
||||
className: "flex-1 h-10 rounded-lg shadow-sm border border-secondary bg-primary text-white inline-flex items-center justify-center font-semibold"
|
||||
}, "Authorize")))));
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
||||
className: "w-screen h-screen flex flex-col items-center justify-center",
|
||||
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
||||
className: "p-8 shadow-primary border border-primary rounded-2xl max-w-xl mx-auto flex flex-col gap-5",
|
||||
children: [
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
||||
className: "flex flex-col items-center gap-5",
|
||||
children: [
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(LogoIcon, {}),
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
||||
className: "flex flex-col items-center text-center",
|
||||
children: [
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", {
|
||||
className: "font-semibold text-lg",
|
||||
children: host
|
||||
}),
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", {
|
||||
children: [
|
||||
"is requesting your permission to ",
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("b", {
|
||||
children: PERMISSION_NAMES[type]
|
||||
})
|
||||
]
|
||||
})
|
||||
]
|
||||
})
|
||||
]
|
||||
}),
|
||||
params && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
||||
className: "flex flex-col gap-1",
|
||||
children: [
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
|
||||
children: "Now acting on"
|
||||
}),
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("pre", {
|
||||
className: "bg-muted px-2 rounded-xl overflow-scroll",
|
||||
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", {
|
||||
children: JSON.stringify(event || params, null, 2)
|
||||
})
|
||||
})
|
||||
]
|
||||
}),
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
||||
className: "flex flex-col gap-4",
|
||||
children: [
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
||||
className: "flex items-center justify-center gap-2",
|
||||
children: [
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Checkbox, {
|
||||
id: "remember",
|
||||
className: "flex h-6 w-6 appearance-none items-center justify-center rounded-lg bg-white outline-none border border-primary data-[state=checked]:bg-primary data-[state=checked]:border-secondary",
|
||||
onCheckedChange: setIsRemember,
|
||||
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CheckboxIndicator, {
|
||||
className: "text-white",
|
||||
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", {
|
||||
xmlns: "http://www.w3.org/2000/svg",
|
||||
fill: "none",
|
||||
viewBox: "0 0 24 24",
|
||||
strokeWidth: 1.5,
|
||||
stroke: "currentColor",
|
||||
className: "w-4 h-4",
|
||||
"aria-hidden": "true",
|
||||
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", {
|
||||
strokeLinecap: "round",
|
||||
strokeLinejoin: "round",
|
||||
d: "M4.5 12.75l6 6 9-13.5"
|
||||
})
|
||||
})
|
||||
})
|
||||
}),
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", {
|
||||
htmlFor: "remember",
|
||||
className: "text-muted",
|
||||
children: "Remember my preference forever"
|
||||
})
|
||||
]
|
||||
}),
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
||||
className: "flex gap-3",
|
||||
children: [
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
|
||||
type: "button",
|
||||
onClick: authorizeHandler(false),
|
||||
className: "flex-1 h-10 rounded-lg shadow-sm border border-primary inline-flex items-center justify-center font-semibold",
|
||||
children: "Reject"
|
||||
}),
|
||||
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
|
||||
type: "button",
|
||||
onClick: authorizeHandler(true),
|
||||
className: "flex-1 h-10 rounded-lg shadow-sm border border-secondary bg-primary text-white inline-flex items-center justify-center font-semibold",
|
||||
children: "Authorize"
|
||||
})
|
||||
]
|
||||
})
|
||||
]
|
||||
})
|
||||
]
|
||||
})
|
||||
});
|
||||
}
|
||||
(0, import_react_dom.render)(/* @__PURE__ */ React.createElement(Prompt, null), document.getElementById("main"));
|
||||
(0, import_react_dom.render)(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Prompt, {}), document.getElementById("main"));
|
||||
})();
|
||||
/*
|
||||
object-assign
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Nostr Connect</title>
|
||||
<title>Nostr Signer</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<link href="/style.css" rel="stylesheet" />
|
||||
</head>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Nostr Connect</title>
|
||||
<title>Nostr Signer</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<link href="/style.css" rel="stylesheet" />
|
||||
</head>
|
||||
|
||||
@@ -6,6 +6,7 @@ import QRCode from 'react-qr-code'
|
||||
import { SettingsIcon } from './icons'
|
||||
import { minidenticon } from 'minidenticons'
|
||||
import * as Tabs from '@radix-ui/react-tabs'
|
||||
import { hexToBytes } from 'nostr-tools/utils'
|
||||
|
||||
function Popup() {
|
||||
const [keys, setKeys] = useState(null)
|
||||
@@ -27,19 +28,21 @@ function Popup() {
|
||||
useEffect(() => {
|
||||
browser.storage.local.get(['private_key', 'relays']).then((results) => {
|
||||
if (results.private_key) {
|
||||
const hexKey = getPublicKey(results.private_key)
|
||||
const npubKey = nip19.npubEncode(hexKey)
|
||||
const hexKey = getPublicKey(hexToBytes(results.private_key))
|
||||
const npub = nip19.npubEncode(hexKey)
|
||||
|
||||
setKeys({ npub: npubKey, hex: hexKey })
|
||||
setKeys({ npub: npub, hex: hexKey })
|
||||
|
||||
if (results.relays) {
|
||||
const relaysList = []
|
||||
|
||||
for (const url in results.relays) {
|
||||
if (results.relays[url].write) {
|
||||
relaysList.push(url)
|
||||
if (relaysList.length >= 3) break
|
||||
}
|
||||
}
|
||||
|
||||
if (relaysList.length) {
|
||||
const nprofileKey = nip19.nprofileEncode({
|
||||
pubkey: hexKey,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Nostr Connect</title>
|
||||
<title>Nostr Signer</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<link href="/style.css" rel="stylesheet" />
|
||||
</head>
|
||||
|
||||
@@ -1,38 +1,38 @@
|
||||
export class LRUCache {
|
||||
constructor(maxSize) {
|
||||
this.maxSize = maxSize;
|
||||
this.map = new Map();
|
||||
this.keys = [];
|
||||
this.maxSize = maxSize
|
||||
this.map = new Map()
|
||||
this.keys = []
|
||||
}
|
||||
|
||||
clear() {
|
||||
this.map.clear();
|
||||
this.map.clear()
|
||||
}
|
||||
|
||||
has(k) {
|
||||
return this.map.has(k);
|
||||
return this.map.has(k)
|
||||
}
|
||||
|
||||
get(k) {
|
||||
const v = this.map.get(k);
|
||||
const v = this.map.get(k)
|
||||
|
||||
if (v !== undefined) {
|
||||
this.keys.push(k);
|
||||
this.keys.push(k)
|
||||
|
||||
if (this.keys.length > this.maxSize * 2) {
|
||||
this.keys.splice(-this.maxSize);
|
||||
this.keys.splice(-this.maxSize)
|
||||
}
|
||||
}
|
||||
|
||||
return v;
|
||||
return v
|
||||
}
|
||||
|
||||
set(k, v) {
|
||||
this.map.set(k, v);
|
||||
this.keys.push(k);
|
||||
this.map.set(k, v)
|
||||
this.keys.push(k)
|
||||
|
||||
if (this.map.size > this.maxSize) {
|
||||
this.map.delete(this.keys.shift());
|
||||
this.map.delete(this.keys.shift())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
10
privacy-policy.md
Normal file
@@ -0,0 +1,10 @@
|
||||
Privacy Policy
|
||||
==============
|
||||
|
||||
**Nostr Signer** doesn't collect any personal data, doesn't track websites you visit, doesn't collect any form of usage analytics, doesn't sends any information to any service over the internet -- in fact, it doesn't even have a server anywhere, it's just an extension installed in your computer.
|
||||
|
||||
The only places **Nostr Signer** sends information to are the URL endpoints you define in the settings page for the extension, the URLs that identify the Lightning nodes you want to talk to, which **Nostr Signer** assumes are under your control or under the control of a third-party you trust.
|
||||
|
||||
**Nostr Signer** stores only the information you explicitly write in the settings page: _node URL_, _username_ and _password_ (where applicable). That information, however, is only stored in your own browser, using the _local_ storage mode, not the _synced_ storage mode that saves data to a browser-determined sync server. So if the guarantees offered by the browser itself hold true _that information never leaves your browser_.
|
||||
|
||||
For more information on the browser guarantees on which **Nostr Signer** depends, please read Firefox's [Privacy Policy](https://www.mozilla.org/en-US/privacy/websites/) and [Terms of Service](https://www.mozilla.org/en-US/about/legal/terms/mozilla/) and Google Chrome [Privacy Policy](https://policies.google.com/privacy) and [Terms of Service](https://ssl.gstatic.com/chrome/webstore/intl/en-US/gallery_tos.html).
|
||||