Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b14afc66d5 | |||
| e95b67b6db | |||
| 8e46c38008 | |||
| 62def44ebb | |||
| f53248cae1 | |||
| f4155e557a | |||
| 130d7ecb01 | |||
| 6fc416d759 | |||
| aa0156cdf2 | |||
| e86cf3c9f2 | |||
| f4c7805266 | |||
| 0511bbc17b | |||
| be1146c7df | |||
| 77ebd32956 | |||
| 781afd8954 | |||
| 53a06be734 | |||
| cc14b9e0ce |
21
CHANGELOG.md
21
CHANGELOG.md
@@ -6,6 +6,27 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
|
||||
## [0.4.1] - 2025.02.16
|
||||
### Fixed
|
||||
- nostr build issue
|
||||
- Linting
|
||||
|
||||
|
||||
## [0.4.0] - 2025.02.14
|
||||
### Changed
|
||||
- Images in the home feed now take up the full width of the card.
|
||||
- Clicking the image previously, would open the image in a new tab. Now, clicking the image opens the image in a lightbox view.
|
||||
|
||||
### Added
|
||||
- Clicking an image also now displays an in-app lightbox view of the image.
|
||||
- The lightbox view includes a download button for the image in mobile view.
|
||||
|
||||
|
||||
## [0.3.57] - 2025.02.11
|
||||
### Added
|
||||
- Automatic user creation in onboarding meetings
|
||||
|
||||
|
||||
## [0.3.55] - 2025.02.07
|
||||
### Added
|
||||
- End time for projects
|
||||
|
||||
15
package-lock.json
generated
15
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "TimeSafari",
|
||||
"version": "0.3.56-beta",
|
||||
"version": "0.4.1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "TimeSafari",
|
||||
"version": "0.3.56-beta",
|
||||
"version": "0.4.1",
|
||||
"dependencies": {
|
||||
"@capacitor/android": "^6.1.2",
|
||||
"@capacitor/cli": "^6.1.2",
|
||||
@@ -54,7 +54,7 @@
|
||||
"lru-cache": "^10.2.0",
|
||||
"luxon": "^3.4.4",
|
||||
"merkletreejs": "^0.3.11",
|
||||
"nostr-tools": "^2.7.2",
|
||||
"nostr-tools": "^2.10.4",
|
||||
"notiwind": "^2.0.2",
|
||||
"papaparse": "^5.4.1",
|
||||
"pina": "^0.20.2204228",
|
||||
@@ -18905,9 +18905,10 @@
|
||||
}
|
||||
},
|
||||
"node_modules/nostr-tools": {
|
||||
"version": "2.7.2",
|
||||
"resolved": "https://registry.npmjs.org/nostr-tools/-/nostr-tools-2.7.2.tgz",
|
||||
"integrity": "sha512-Bq3Ug0SZFtgtL1+0wCnAe8AJtI7yx/00/a2nUug9SkhfOwlKS92Tef12iCK9FdwXw+oFZWMtRnSwcLayQso+xA==",
|
||||
"version": "2.10.4",
|
||||
"resolved": "https://registry.npmjs.org/nostr-tools/-/nostr-tools-2.10.4.tgz",
|
||||
"integrity": "sha512-biU7sk+jxHgVASfobg2T5ttxOGGSt69wEVBC51sHHOEaKAAdzHBLV/I2l9Rf61UzClhliZwNouYhqIso4a3HYg==",
|
||||
"license": "Unlicense",
|
||||
"dependencies": {
|
||||
"@noble/ciphers": "^0.5.1",
|
||||
"@noble/curves": "1.2.0",
|
||||
@@ -18917,7 +18918,7 @@
|
||||
"@scure/bip39": "1.2.1"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"nostr-wasm": "v0.1.0"
|
||||
"nostr-wasm": "0.1.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": ">=5.0.0"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "TimeSafari",
|
||||
"version": "0.3.56-beta",
|
||||
"version": "0.4.1",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"serve": "vite preview",
|
||||
@@ -58,7 +58,7 @@
|
||||
"lru-cache": "^10.2.0",
|
||||
"luxon": "^3.4.4",
|
||||
"merkletreejs": "^0.3.11",
|
||||
"nostr-tools": "^2.7.2",
|
||||
"nostr-tools": "^2.10.4",
|
||||
"notiwind": "^2.0.2",
|
||||
"papaparse": "^5.4.1",
|
||||
"pina": "^0.20.2204228",
|
||||
|
||||
94
src/components/ImageViewer.vue
Normal file
94
src/components/ImageViewer.vue
Normal file
@@ -0,0 +1,94 @@
|
||||
<template>
|
||||
<Teleport to="body">
|
||||
<Transition name="fade">
|
||||
<div v-if="isOpen" class="fixed inset-0 z-50 flex flex-col bg-black/90">
|
||||
<!-- Header bar - fixed height to prevent overlap -->
|
||||
<div class="h-16 flex justify-between items-center px-4 bg-black">
|
||||
<button
|
||||
class="text-white text-2xl p-2 rounded-full hover:bg-white/10"
|
||||
@click="close"
|
||||
>
|
||||
<fa icon="xmark" />
|
||||
</button>
|
||||
|
||||
<!-- Mobile share button -->
|
||||
<button
|
||||
v-if="isMobile"
|
||||
class="text-white text-xl p-2 rounded-full hover:bg-white/10"
|
||||
@click="handleShare"
|
||||
>
|
||||
<fa icon="ellipsis" />
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Image container - fill remaining space -->
|
||||
<div class="flex-1 flex items-center justify-center p-2">
|
||||
<div class="w-full h-full flex items-center justify-center">
|
||||
<img
|
||||
:src="imageUrl"
|
||||
class="max-h-[calc(100vh-5rem)] w-full h-full object-contain"
|
||||
@click.stop
|
||||
alt="expanded shared content"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Transition>
|
||||
</Teleport>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Vue, Prop } from "vue-facing-decorator";
|
||||
import { UAParser } from "ua-parser-js";
|
||||
|
||||
@Component({ emits: ["update:isOpen"] })
|
||||
export default class ImageViewer extends Vue {
|
||||
@Prop() imageUrl!: string;
|
||||
@Prop() imageData!: Blob | null;
|
||||
@Prop() isOpen!: boolean;
|
||||
|
||||
userAgent = new UAParser();
|
||||
|
||||
get isMobile() {
|
||||
const os = this.userAgent.getOS().name;
|
||||
return os === "iOS" || os === "Android";
|
||||
}
|
||||
|
||||
close() {
|
||||
this.$emit("update:isOpen", false);
|
||||
}
|
||||
|
||||
async handleShare() {
|
||||
const os = this.userAgent.getOS().name;
|
||||
|
||||
try {
|
||||
if (os === "iOS" || os === "Android") {
|
||||
if (navigator.share) {
|
||||
// Always share the URL since it's more reliable across platforms
|
||||
await navigator.share({
|
||||
url: this.imageUrl,
|
||||
});
|
||||
} else {
|
||||
// Fallback for browsers without share API
|
||||
window.open(this.imageUrl, "_blank");
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.warn("Share failed, opening in new tab:", error);
|
||||
window.open(this.imageUrl, "_blank");
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.fade-enter-active,
|
||||
.fade-leave-active {
|
||||
transition: opacity 0.2s ease;
|
||||
}
|
||||
|
||||
.fade-enter-from,
|
||||
.fade-leave-to {
|
||||
opacity: 0;
|
||||
}
|
||||
</style>
|
||||
@@ -281,7 +281,7 @@
|
||||
/>
|
||||
</span>
|
||||
</span>
|
||||
<span class="col-span-10 justify-self-stretch">
|
||||
<span class="col-span-10 justify-self-stretch overflow-hidden">
|
||||
<!-- show giver and/or receiver profiles... which seemed like a good idea but actually adds clutter
|
||||
<span
|
||||
v-if="
|
||||
@@ -315,7 +315,7 @@
|
||||
/>
|
||||
</span>
|
||||
-->
|
||||
<span class="pl-2">
|
||||
<span class="pl-2 block break-words">
|
||||
{{ giveDescription(record) }}
|
||||
</span>
|
||||
<a @click="onClickLoadClaim(record.jwtId)">
|
||||
@@ -346,10 +346,18 @@
|
||||
</router-link>
|
||||
</span>
|
||||
</div>
|
||||
<div v-if="record.image" class="flex justify-center">
|
||||
<a :href="record.image" target="_blank">
|
||||
<img :src="record.image" class="h-48 mt-2 rounded-xl" />
|
||||
</a>
|
||||
<div v-if="record.image" class="w-full">
|
||||
<div
|
||||
class="cursor-pointer"
|
||||
@click="openImageViewer(record.image)"
|
||||
>
|
||||
<img
|
||||
:src="record.image"
|
||||
class="w-full aspect-[3/2] object-cover rounded-xl mt-2"
|
||||
alt="shared content"
|
||||
@load="cacheImageData($event, record.image)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -368,6 +376,12 @@
|
||||
</section>
|
||||
|
||||
<ChoiceButtonDialog ref="choiceButtonDialog" />
|
||||
|
||||
<ImageViewer
|
||||
:image-url="selectedImage"
|
||||
:image-data="selectedImageData"
|
||||
v-model:is-open="isImageViewerOpen"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
@@ -386,6 +400,7 @@ import QuickNav from "@/components/QuickNav.vue";
|
||||
import TopMessage from "@/components/TopMessage.vue";
|
||||
import UserNameDialog from "@/components/UserNameDialog.vue";
|
||||
import ChoiceButtonDialog from "@/components/ChoiceButtonDialog.vue";
|
||||
import ImageViewer from "@/components/ImageViewer.vue";
|
||||
import {
|
||||
AppString,
|
||||
NotificationIface,
|
||||
@@ -455,6 +470,7 @@ interface GiveRecordWithContactInfo extends GiveSummaryRecord {
|
||||
QuickNav,
|
||||
TopMessage,
|
||||
UserNameDialog,
|
||||
ImageViewer,
|
||||
},
|
||||
})
|
||||
export default class HomeView extends Vue {
|
||||
@@ -489,6 +505,10 @@ export default class HomeView extends Vue {
|
||||
}> = [];
|
||||
showShortcutBvc = false;
|
||||
userAgentInfo = new UAParser(); // see https://docs.uaparser.js.org/v2/api/ua-parser-js/get-os.html
|
||||
selectedImage = "";
|
||||
selectedImageData: Blob | null = null;
|
||||
isImageViewerOpen = false;
|
||||
imageCache: Map<string, Blob | null> = new Map();
|
||||
|
||||
async mounted() {
|
||||
try {
|
||||
@@ -970,5 +990,21 @@ export default class HomeView extends Vue {
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
async cacheImageData(event: Event, imageUrl: string) {
|
||||
try {
|
||||
// For images that might fail CORS, just store the URL
|
||||
// The Web Share API will handle sharing the URL appropriately
|
||||
this.imageCache.set(imageUrl, null);
|
||||
} catch (error) {
|
||||
console.warn("Failed to cache image:", error);
|
||||
}
|
||||
}
|
||||
|
||||
async openImageViewer(imageUrl: string) {
|
||||
this.selectedImageData = this.imageCache.get(imageUrl) ?? null;
|
||||
this.selectedImage = imageUrl;
|
||||
this.isImageViewerOpen = true;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -229,18 +229,10 @@
|
||||
import "leaflet/dist/leaflet.css";
|
||||
import { AxiosError, AxiosRequestHeaders } from "axios";
|
||||
import { DateTime } from "luxon";
|
||||
import { hexToBytes } from "@noble/hashes/utils";
|
||||
import { finalizeEvent, serializeEvent } from "nostr-tools";
|
||||
// these core imports could also be included as "import type ..."
|
||||
import {
|
||||
EventTemplate,
|
||||
UnsignedEvent,
|
||||
VerifiedEvent,
|
||||
} from "nostr-tools/lib/types/core";
|
||||
import {
|
||||
accountFromExtendedKey,
|
||||
extendedKeysFromSeedWords,
|
||||
} from "nostr-tools/nip06";
|
||||
import { finalizeEvent, serializeEvent } from "nostr-tools/pure";
|
||||
import { EventTemplate, UnsignedEvent, VerifiedEvent } from "nostr-tools/core";
|
||||
import * as nip06 from "nostr-tools/nip06";
|
||||
import { Component, Vue } from "vue-facing-decorator";
|
||||
import { LMap, LMarker, LTileLayer } from "@vue-leaflet/vue-leaflet";
|
||||
import { RouteLocationNormalizedLoaded, Router } from "vue-router";
|
||||
@@ -668,15 +660,15 @@ export default class NewEditProjectView extends Vue {
|
||||
// remove any trailing '
|
||||
const finalDerNumNoApostrophe = finalDerNum?.replace(/'/g, "");
|
||||
const accountNum = Number(finalDerNumNoApostrophe || 0);
|
||||
const extPubPri = extendedKeysFromSeedWords(
|
||||
const extPubPri = nip06.extendedKeysFromSeedWords(
|
||||
account?.mnemonic as string,
|
||||
"",
|
||||
accountNum,
|
||||
);
|
||||
const publicExtendedKey: string = extPubPri?.publicExtendedKey;
|
||||
const privateExtendedKey = extPubPri?.privateExtendedKey;
|
||||
const privateKey = accountFromExtendedKey(privateExtendedKey).privateKey;
|
||||
const privateBytes = hexToBytes(privateKey);
|
||||
const privateBytes: Uint8Array =
|
||||
nip06.accountFromExtendedKey(privateExtendedKey).privateKey;
|
||||
// No real content is necessary, we just want something signed,
|
||||
// so we might as well use nostr libs for nostr functions.
|
||||
// Besides: someday we may create real content that we can relay.
|
||||
@@ -710,7 +702,8 @@ export default class NewEditProjectView extends Vue {
|
||||
const endorserPartnerUrl = partnerServer + "/api/partner/link";
|
||||
const timeSafariUrl = window.location.origin + "/claim/" + jwtId;
|
||||
const content = this.fullClaim.name + " - see " + timeSafariUrl;
|
||||
const publicKeyHex = accountFromExtendedKey(publicExtendedKey).publicKey;
|
||||
const publicKeyHex =
|
||||
nip06.accountFromExtendedKey(publicExtendedKey).publicKey;
|
||||
const unsignedPayload: UnsignedEvent = {
|
||||
// why doesn't "...signedPayload" work?
|
||||
kind: signedPayload.kind,
|
||||
|
||||
Reference in New Issue
Block a user