PDF Markings #114

Merged
eugene merged 33 commits from issue-99 into staging 2024-08-06 10:02:04 +00:00
5 changed files with 0 additions and 81 deletions
Showing only changes of commit fff22dce8c - Show all commits

View File

@ -59,8 +59,6 @@
.drawingRectangle {
position: absolute;
border: 1px solid #01aaad;
//width: 40px;
//height: 40px;
z-index: 50;
background-color: #01aaad4b;
cursor: pointer;

View File

@ -526,8 +526,6 @@ export const CreatePage = () => {
title
}
console.log('content: ', content)
setLoadingSpinnerDesc('Signing nostr event for create signature')
const createSignature = await signEventForMetaFile(

View File

@ -319,8 +319,6 @@ export const SignPage = () => {
}
}
console.log('processed files: ', files);
setFiles(files)
setCurrentFileHashes(fileHashes)
}
@ -455,8 +453,6 @@ export const SignPage = () => {
}
}
console.log('processed files: ', files);
setFiles(files)
setCurrentFileHashes(fileHashes)
@ -540,42 +536,6 @@ export const SignPage = () => {
return currentUserMarks.map(( { mark }: CurrentUserMark) => mark);
}
// const handleMarkClick = (id: number) => {
// const nextMark = currentUserMarks.find(mark => mark.mark.id === id)
// setCurrentUserMark(nextMark!)
// setCurrentMarkValue(nextMark?.mark.value || "")
// }
// const getMarkConfigPerUser = (markConfig: MarkConfig) => {
// if (!usersPubkey) return;
// return markConfig[hexToNpub(usersPubkey)];
// }
// const handleChange = (event: any) => setCurrentMarkValue(event.target.value);
//
// const handleSubmit = (event: any) => {
// event.preventDefault();
// if (!currentMarkValue || !currentUserMark) return;
//
// const curMark: Mark = {
// ...currentUserMark.mark,
// value: currentMarkValue
// };
//
// const updatedMarks: Mark[] = updateMarks(marks, curMark)
//
// setMarks(updatedMarks)
// setCurrentMarkValue("")
//
// // do the similar thing to the thing above
// const metaMarks = filterMarksByPubkey(updatedMarks, usersPubkey!)
// const signedMarks = extractMarksFromSignedMeta(meta!)
// const currentUserMarks = getCurrentUserMarks(metaMarks, signedMarks)
// setCurrentUserMarks(currentUserMarks)
// setCurrentUserMark(findNextCurrentUserMark(currentUserMarks) || null)
// setIsReadyToSign(isCurrentUserMarksComplete(currentUserMarks))
// }
// Update the meta signatures
const updateMetaSignatures = (meta: Meta, signedEvent: SignedEvent): Meta => {
const metaCopy = _.cloneDeep(meta)
@ -970,30 +930,4 @@ export const SignPage = () => {
setCurrentUserMarks={setCurrentUserMarks}
setUpdatedMarks={setUpdatedMarks}
/>
// return (
// <>
// <Box className={styles.container}>
// {
// marks.length > 0 && (
// <PdfView
// files={files}
// marks={marks}
// fileHashes={currentFileHashes}
// handleMarkClick={handleMarkClick}
// currentMarkValue={currentMarkValue}
// currentUserMark={currentUserMark}
// />)}
// {
// currentUserMark !== null && (
// <MarkFormField
// handleSubmit={handleSubmit}
// handleChange={handleChange}
// currentMark={currentUserMark}
// currentMarkValue={currentMarkValue}
// />
// )}
// </Box>
// </>
// )
}

View File

@ -380,10 +380,6 @@ export const VerifyPage = () => {
}
const handleExport = async () => {
// const proverbialUrls = await addMarksV2(Object.values(files)[0].file, meta!)
// await convertToFinalPdf(proverbialUrls)
if (Object.entries(files).length === 0 ||!meta ||!usersPubkey) return;
const usersNpub = hexToNpub(usersPubkey)

View File

@ -1,12 +1,5 @@
import { MarkType } from "./drawing";
// export interface Mark {
// /**
// * @key png (pdf page) file hash
// */
// [key: string]: MarkConfigDetails[]
// }
export interface CurrentUserMark {
mark: Mark
isLast: boolean