+ {editor?.state.doc.textBetween(
+ editor.state.selection.from,
+ editor.state.selection.to,
+ " ",
+ ) || "error! no text selected"}
+
+
+
+ Note: you need to select text in the editor before you try and apply a gradient.
+
+
+
+
+
+
+
+ {:else}
+
+
Your top 10 most recent gradients are shown below:
+
+
+ {#each recentGradients.slice().reverse() ?? [] as gradient}
+
+
+
+
+ {#each gradient ?? [] as step}
+
+ {/each}
+
+
- {/if}
-
- {/each}
+ class="btn"
+ onclick={async () => {
+ // im 90% sure this solution is slow as hell and probably unstable too, but i hate this so much i dont care
+ gradientSteps = gradient.map((color, i) => ({ id: Date.now() - i, color }));
+ recentsPageOpen = false;
+ await tick();
+ opened();
+ }}>Use
+
+ {/each}
+
+
-
-
Preview
-
- {editor?.state.doc.textBetween(
- editor.state.selection.from,
- editor.state.selection.to,
- " ",
- ) || "error! no text selected"}
-
-
-
- Note: you need to select text in the editor before you try and apply a gradient.
-