BIG BIG BIG BIG BIG UPDATES
Co-authored-by: Copilot <[email protected]>
This commit is contained in:
co-authored by
Copilot
Unverified
parent
46f7cd6a5f
commit
93ba8e9ac2
@@ -0,0 +1,79 @@
|
||||
<script setup lang="ts">
|
||||
import { useControlPlaneContext } from "../composables/useControlPlane";
|
||||
|
||||
const plane = useControlPlaneContext();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section class="panel stack-panel tool-panel">
|
||||
<div class="panel-title">
|
||||
<div>
|
||||
<p class="eyebrow">Templates</p>
|
||||
<h2>Examples</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="inline-grid">
|
||||
<input
|
||||
v-model="plane.customExampleName"
|
||||
placeholder="Save current code as..."
|
||||
/>
|
||||
<button @click="plane.saveCurrentAsExample">Save</button>
|
||||
</div>
|
||||
|
||||
<div class="example-shell">
|
||||
<div class="example-browser">
|
||||
<input v-model="plane.exampleSearch" placeholder="Search examples" />
|
||||
|
||||
<div class="example-index">
|
||||
<button
|
||||
v-for="example in plane.filteredExamples"
|
||||
:key="example.id"
|
||||
class="example-entry"
|
||||
:class="{ selected: plane.selectedExample?.id === example.id }"
|
||||
@click="plane.selectExample(example.id)"
|
||||
>
|
||||
<strong>{{ example.name }}</strong>
|
||||
<small>{{ example.category }}</small>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<article v-if="plane.selectedExample" class="example-preview">
|
||||
<div class="option-doc-head">
|
||||
<div>
|
||||
<p class="eyebrow">Selected</p>
|
||||
<h3>{{ plane.selectedExample.name }}</h3>
|
||||
</div>
|
||||
<div class="template-meta">
|
||||
<span class="type-chip">{{ plane.selectedExample.category }}</span>
|
||||
<span class="type-chip">
|
||||
{{ plane.selectedExample.built_in ? "built-in" : "custom" }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p class="doc-copy">{{ plane.selectedExample.description }}</p>
|
||||
|
||||
<div class="doc-actions">
|
||||
<button @click="plane.applyExample(plane.selectedExample)">Use template</button>
|
||||
<a
|
||||
v-if="plane.selectedExample.source_url"
|
||||
:href="plane.selectedExample.source_url"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
Source
|
||||
</a>
|
||||
<button
|
||||
v-if="!plane.selectedExample.built_in"
|
||||
class="ghost"
|
||||
@click="plane.removeExample(plane.selectedExample.id)"
|
||||
>
|
||||
Delete
|
||||
</button>
|
||||
</div>
|
||||
</article>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
Reference in New Issue
Block a user