|
13 | 13 | } = $props(); |
14 | 14 |
|
15 | 15 | let exportAsJSON = $state(false); |
16 | | -
|
17 | | - function exportThing(exportAsJSON: boolean) { |
18 | | - if (!exportAsJSON) { |
19 | | - return convert( |
20 | | - editor.getJSON(), |
21 | | - "item_lore", |
22 | | - outputVersion, |
23 | | - shouldOptimise, |
24 | | - ); |
25 | | - } |
26 | | - return translateJSON(editor.getJSON(), { |
27 | | - exportType: "item_lore", |
28 | | - exportVersion: outputVersion, |
29 | | - optimise: shouldOptimise, |
30 | | - }); |
31 | | - } |
32 | 16 | </script> |
33 | 17 |
|
34 | 18 | <Modal title="More output formats" bind:this={outputDialog} big key="E"> |
|
122 | 106 | >{editor ? translateMOTD(editor.getJSON()) : "Loading..."} |
123 | 107 | </code> |
124 | 108 | </div> |
125 | | - |
126 | | - <!-- <p class="mt-2">As JSON:</p> |
127 | | - <div class="flex items-start space-x-3 rounded-lg bg-zinc-950 p-3"> |
128 | | - <button |
129 | | - class="rounded-md p-1 text-lg font-medium hover:bg-zinc-900 active:bg-white/10" |
130 | | - onclick={() => { |
131 | | - navigator.clipboard.writeText( |
132 | | - translateJSON(editor.getJSON(), { |
133 | | - exportType: "standard", |
134 | | - exportVersion: outputVersion, |
135 | | - indent, |
136 | | - indentSize, |
137 | | - optimise: shouldOptimise, |
138 | | - }), |
139 | | - ); |
140 | | - recentlyCopied = true; |
141 | | - setTimeout(() => (recentlyCopied = false), 2000); |
142 | | - }}> |
143 | | - <IconCopy /> |
144 | | - </button> |
145 | | - <code class="inline-block max-h-56 w-full overflow-auto" |
146 | | - ><pre>{editor |
147 | | - ? translateJSON(editor.getJSON(), { |
148 | | - exportType: "standard", |
149 | | - exportVersion: outputVersion, |
150 | | - indent, |
151 | | - indentSize, |
152 | | - optimise: shouldOptimise, |
153 | | - }) |
154 | | - : "Loading..."}</pre> |
155 | | - </code> |
156 | | - </div> |
157 | | -
|
158 | | - <div class="mt-2 flex items-center gap-2"> |
159 | | - <p>Indent?</p> |
160 | | - <button |
161 | | - class="flex aspect-square size-8 flex-col items-center rounded-md bg-zinc-900" |
162 | | - onclick={() => (indent = !indent)}> |
163 | | - {#if indent} |
164 | | - <IconTick class="m-auto text-lg" /> |
165 | | - {/if} |
166 | | - </button> |
167 | | - </div> |
168 | | - {#if indent} |
169 | | - <label for="indentSize" class="mt-2">Indent Size:</label> |
170 | | - <input |
171 | | - type="number" |
172 | | - id="indentSize" |
173 | | - max="8" |
174 | | - min="1" |
175 | | - bind:value={indentSize} |
176 | | - class="w-fit rounded-md bg-zinc-900 p-2" /> |
177 | | - {/if} --> |
178 | 109 | </div> |
179 | 110 | </Modal> |
0 commit comments