From c7e9554cb8b5cb4781d848b32a252b121b46ba3d Mon Sep 17 00:00:00 2001 From: arkohut <39525455+arkohut@users.noreply.github.com> Date: Thu, 31 Oct 2024 14:02:34 +0800 Subject: [PATCH] feat(web): allow hide info details --- web/src/lib/Figure.svelte | 318 ++++++++++++++++++++++++-------------- 1 file changed, 201 insertions(+), 117 deletions(-) diff --git a/web/src/lib/Figure.svelte b/web/src/lib/Figure.svelte index b352d4a..9750a61 100644 --- a/web/src/lib/Figure.svelte +++ b/web/src/lib/Figure.svelte @@ -1,12 +1,22 @@ -
+
- -
- - - -
-
- -
-
-
- -

{title}

-
-
-
- - - - {library_id} - - - - - {folder_id} - - - - - {id} - - - - - {new Date(created_at).toLocaleString()} - - - -
- - {filepath} - -
-
-
- - {title} - -
+
+ +
+ +
- - - - {#if tags.length > 0} -
-
TAGS
-
- {#each tags as tag} - {tag} + +
+ +
+
+
+
+
+ +

{title}

+
+
+ {#if showDetails} + + {/if} +
+
+
+ + {#if showDetails} +
+ + + + {library_id} + + + + + {folder_id} + + + + + {id} + + + + + {new Date(created_at).toLocaleString()} + + + +
+ + {filepath} + +
+
+ {/if} + +
+ + {title} + + {#if !showDetails} + + {/if} +
+ + {#if !showDetails} +
+ + + {new Date(created_at).toLocaleString()} + +
+ {/if} +
+ + {#if showDetails} + + {#if tags.length > 0} +
+
TAGS
+
+ {#each tags as tag} + {tag} + {/each} +
+
+ {/if} +
METADATA
+
+ {#each sortedMetadataEntries as entry} +
+ + {entry.key} + + + {#if typeof entry.value === 'object'} + {#if isValidOCRDataStructure(entry.value)} + + {:else} +
{JSON.stringify(
+													entry.value,
+													null,
+													2
+												)}
+ {/if} + {:else} + +
+ {@html marked(entry.value)} +
+ {/if} + ({entry.source}) +
{/each}
-
+ {/if} -
METADATA
-
- {#each sortedMetadataEntries as entry} -
- - {entry.key} - - - {#if typeof entry.value === 'object'} - {#if isValidOCRDataStructure(entry.value)} - - {:else} -
{JSON.stringify(
-											entry.value,
-											null,
-											2
-										)}
- {/if} - {:else} - -
- {@html marked(entry.value)} -
- {/if} - ({entry.source}) -
- {/each} -
- -
-
- +
+ +
+ +