diff --git a/src/App.svelte b/src/App.svelte index c95d4f3..c73de26 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -1,144 +1,119 @@ +
+ +
+ +

+ + +

+ - -

- Search: -

- -
- -
- - - - - - - -

- - -

- - diff --git a/src/JSONEditor.svelte b/src/JSONEditor.svelte new file mode 100644 index 0000000..3377ebf --- /dev/null +++ b/src/JSONEditor.svelte @@ -0,0 +1,92 @@ + + +
+ + +
+ + diff --git a/src/JSONNode.svelte b/src/JSONNode.svelte index ab72fe5..40ef2c6 100644 --- a/src/JSONNode.svelte +++ b/src/JSONNode.svelte @@ -128,6 +128,128 @@ } +
+ {#if type === 'array'} +
+ + {#if typeof key === 'string'} +
+ {escapedKey} +
+
:
+ {/if} + {#if expanded} +
[
+ {:else} +
[
+ +
]
+ {/if} +
+ {#if expanded} +
+ {#each items as item, index (index)} + + {/each} + {#if limited} +
+ (showing {limit} of {value.length} items ) +
+ {/if} +
+ + {/if} + {:else if type === 'object'} +
+ + {#if typeof key === 'string'} +
+ {escapedKey} +
+ : + {/if} + {#if expanded} + { + {:else} + { + + } + {/if} +
+ {#if expanded} +
+ {#each props as prop (prop.id)} + + {/each} +
+ + {/if} + {:else} +
+ {#if typeof key === 'string'} +
+ {escapedKey} +
+ : + {/if} +
+ {escapedValue} +
+
+ {/if} +
+ - -
- {#if type === 'array'} -
- - {#if typeof key === 'string'} -
- {escapedKey} -
-
:
- {/if} - {#if expanded} -
[
- {:else} -
[
- -
]
- {/if} -
- {#if expanded} -
- {#each items as item, index (index)} - - {/each} - {#if limited} -
- (showing {limit} of {value.length} items ) -
- {/if} -
- - {/if} - {:else if type === 'object'} -
- - {#if typeof key === 'string'} -
- {escapedKey} -
- : - {/if} - {#if expanded} - { - {:else} - { - - } - {/if} -
- {#if expanded} -
- {#each props as prop (prop.id)} - - {/each} -
- - {/if} - {:else} -
- {#if typeof key === 'string'} -
- {escapedKey} -
- : - {/if} -
- {escapedValue} -
-
- {/if} -
\ No newline at end of file diff --git a/src/styles.scss b/src/styles.scss index c8030c0..58bece7 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -29,4 +29,6 @@ $input-padding: 5px; $line-height: 18px; $indentation-width: 18px; -$input-padding: 5px; \ No newline at end of file +$input-padding: 5px; + +$menu-padding: 5px;