refactor: consolidate CodeMirror editors into unified AE_Comp_Editor_CodeMirror component
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
RefreshCcw, Globe, Copy
|
||||
} from '@lucide/svelte';
|
||||
import { ae_loc, ae_api } from '$lib/stores/ae_stores';
|
||||
import E_app_codemirror_v5 from '$lib/app_components/e_app_codemirror_v5.svelte';
|
||||
import AE_Comp_Editor_CodeMirror from '$lib/elements/AE_Comp_Editor_CodeMirror.svelte';
|
||||
|
||||
interface Props {
|
||||
// Core Props
|
||||
@@ -190,13 +190,12 @@
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<E_app_codemirror_v5
|
||||
editable={true}
|
||||
<AE_Comp_Editor_CodeMirror
|
||||
content={tmp_summary}
|
||||
bind:new_content={tmp_summary}
|
||||
bind:theme_mode={$ae_loc.theme_mode}
|
||||
theme_mode={$ae_loc.theme_mode}
|
||||
placeholder="AI Result will appear here..."
|
||||
class="p-2 border rounded-lg h-96 shadow-inner bg-surface-500/5"
|
||||
class_li="p-2 border rounded-lg h-96 shadow-inner bg-surface-500/5"
|
||||
/>
|
||||
</div>
|
||||
{:else}
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
* GENERIC Aether Object Flags & Visibility Toggles
|
||||
* Manages: alert, private, public, personal, professional, template
|
||||
*/
|
||||
import {
|
||||
Siren, MessageSquareWarning, Fingerprint,
|
||||
import {
|
||||
Siren, MessageSquareWarning, Fingerprint,
|
||||
Globe, BookHeart, BriefcaseBusiness, NotepadTextDashed,
|
||||
Settings
|
||||
} from '@lucide/svelte';
|
||||
@@ -13,35 +13,35 @@
|
||||
|
||||
interface Props {
|
||||
// The object containing the flags (bindable)
|
||||
obj: any;
|
||||
|
||||
obj: any;
|
||||
|
||||
// Visibility configuration (optional overrides)
|
||||
showLabels?: boolean;
|
||||
hideAlert?: boolean;
|
||||
hidePrivate?: boolean;
|
||||
hidePublic?: boolean;
|
||||
hidePersonal?: boolean;
|
||||
hideProfessional?: boolean;
|
||||
hideTemplate?: boolean;
|
||||
|
||||
show_labels?: boolean;
|
||||
hide_alert?: boolean;
|
||||
hide_private?: boolean;
|
||||
hide_public?: boolean;
|
||||
hide_personal?: boolean;
|
||||
hide_professional?: boolean;
|
||||
hide_template?: boolean;
|
||||
|
||||
// Callbacks
|
||||
onToggle?: (prop: string, newValue: boolean) => void;
|
||||
|
||||
on_toggle?: (prop: string, newValue: boolean) => void;
|
||||
|
||||
// Styling
|
||||
containerClass?: string;
|
||||
container_class?: string;
|
||||
}
|
||||
|
||||
let {
|
||||
let {
|
||||
obj = $bindable(),
|
||||
showLabels = true,
|
||||
hideAlert = false,
|
||||
hidePrivate = false,
|
||||
hidePublic = false,
|
||||
hidePersonal = false,
|
||||
hideProfessional = false,
|
||||
hideTemplate = false,
|
||||
onToggle,
|
||||
containerClass = "flex flex-row flex-wrap gap-1 items-center justify-evenly py-2 border-y border-surface-500/10"
|
||||
show_labels = true,
|
||||
hide_alert: hide_alert = false,
|
||||
hide_private: hide_private = false,
|
||||
hide_public: hide_public = false,
|
||||
hide_personal: hide_personal = false,
|
||||
hide_professional: hide_professional = false,
|
||||
hide_template: hide_template = false,
|
||||
on_toggle: onToggle,
|
||||
container_class = "flex flex-row flex-wrap gap-1 items-center justify-evenly py-2 border-y border-surface-500/10"
|
||||
}: Props = $props();
|
||||
|
||||
function handle_toggle(prop: string) {
|
||||
@@ -50,15 +50,15 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class={containerClass}>
|
||||
{#if showLabels}
|
||||
<div class={container_class}>
|
||||
{#if show_labels}
|
||||
<span class="text-xs text-surface-500 flex items-center gap-1 uppercase font-bold tracking-wider mr-2">
|
||||
<Settings size="1.1em" /> Flags:
|
||||
</span>
|
||||
{/if}
|
||||
|
||||
<!-- Alert Status -->
|
||||
{#if !hideAlert}
|
||||
{#if !hide_alert}
|
||||
<button
|
||||
type="button"
|
||||
onclick={() => handle_toggle('alert')}
|
||||
@@ -70,7 +70,7 @@
|
||||
{/if}
|
||||
|
||||
<!-- Private / E2EE -->
|
||||
{#if !hidePrivate}
|
||||
{#if !hide_private}
|
||||
<button
|
||||
type="button"
|
||||
onclick={() => handle_toggle('private')}
|
||||
@@ -82,7 +82,7 @@
|
||||
{/if}
|
||||
|
||||
<!-- Public Visibility -->
|
||||
{#if !hidePublic}
|
||||
{#if !hide_public}
|
||||
<button
|
||||
type="button"
|
||||
onclick={() => handle_toggle('public')}
|
||||
@@ -94,7 +94,7 @@
|
||||
{/if}
|
||||
|
||||
<!-- Personal Scope -->
|
||||
{#if !hidePersonal}
|
||||
{#if !hide_personal}
|
||||
<button
|
||||
type="button"
|
||||
onclick={() => handle_toggle('personal')}
|
||||
@@ -106,7 +106,7 @@
|
||||
{/if}
|
||||
|
||||
<!-- Professional Scope -->
|
||||
{#if !hideProfessional}
|
||||
{#if !hide_professional}
|
||||
<button
|
||||
type="button"
|
||||
onclick={() => handle_toggle('professional')}
|
||||
@@ -118,7 +118,7 @@
|
||||
{/if}
|
||||
|
||||
<!-- Template Status -->
|
||||
{#if !hideTemplate && $ae_loc.edit_mode}
|
||||
{#if !hide_template && $ae_loc.edit_mode}
|
||||
<button
|
||||
type="button"
|
||||
onclick={() => handle_toggle('template')}
|
||||
Reference in New Issue
Block a user