chore: sync local workspace changes
This commit is contained in:
@@ -32,7 +32,13 @@ import { StockAlertFilterPane, StockAlertGridPane, StockAlertLayoutProvider } fr
|
||||
import { resolveSampleEntries, type LoadedSampleEntry } from '../../samples/registry';
|
||||
import { deleteLayout, listSavedLayouts, saveLayout, type LayoutAxis as StoredLayoutAxis, type SavedLayoutRecord, type SizeUnit as StoredSizeUnit } from './layoutStorage';
|
||||
import { resolvePreferredLayoutCodexChatType } from './layoutCodexChatType';
|
||||
import { LayoutPreviewBaseInputPane, LayoutPreviewEmptyPane, LayoutPreviewSelectPane, LayoutPreviewTextMemoPane } from './LayoutPreviewWidgets';
|
||||
import {
|
||||
LayoutPreviewActionPane,
|
||||
LayoutPreviewBaseInputPane,
|
||||
LayoutPreviewEmptyPane,
|
||||
LayoutPreviewSelectPane,
|
||||
LayoutPreviewTextMemoPane,
|
||||
} from './LayoutPreviewWidgets';
|
||||
import {
|
||||
resolveLayoutPreviewBindingKind,
|
||||
useLayoutPreviewRuntime,
|
||||
@@ -1806,6 +1812,7 @@ export function LayoutPlaygroundView({
|
||||
hideInteractionOverlays?: boolean;
|
||||
scopeKey?: string;
|
||||
paneSizingMeta?: LayoutPaneSizingMeta | null;
|
||||
onPreviewActionClick?: () => void;
|
||||
},
|
||||
): React.ReactNode => {
|
||||
const selectedId = options?.selectedId ?? selectedLeafId;
|
||||
@@ -1846,6 +1853,8 @@ export function LayoutPlaygroundView({
|
||||
previewBindingKind === 'select-input' ? resolveSelectPreviewOptions(sourceInteractions) : DEFAULT_COMBO_VALUE_OPTIONS;
|
||||
const shouldFillBaseInputPane =
|
||||
previewBindingKind === 'base-input' && sourceInteractions.some((rule) => rule.title.trim() === '100%가득채움');
|
||||
const memoPaneTitle =
|
||||
previewMode && node.label.trim() && !/^section\s*\d+$/iu.test(node.label.trim()) ? node.label.trim() : '기능설명 본문';
|
||||
const customPreviewBody = isStockAlertLayout
|
||||
? node.componentBinding?.optionId === 'component:select-input:select-input-base'
|
||||
? <StockAlertFilterPane />
|
||||
@@ -1874,6 +1883,8 @@ export function LayoutPlaygroundView({
|
||||
/>
|
||||
) : previewBindingKind === 'text-memo-widget' ? (
|
||||
<LayoutPreviewTextMemoPane
|
||||
skin="flat"
|
||||
title={memoPaneTitle}
|
||||
state={layoutPreviewRuntime.memoStates[scopedLeafId] ?? {
|
||||
draftBody: '',
|
||||
selectedId: null,
|
||||
@@ -1903,6 +1914,11 @@ export function LayoutPlaygroundView({
|
||||
layoutPreviewRuntime.setMemoDraftBody(scopedLeafId, nextValue);
|
||||
}}
|
||||
/>
|
||||
) : previewBindingKind === 'action-button' ? (
|
||||
<LayoutPreviewActionPane
|
||||
label="Codex 실행"
|
||||
onClick={options?.onPreviewActionClick}
|
||||
/>
|
||||
) : previewBindingKind === 'select-input' ? (
|
||||
<LayoutPreviewSelectPane
|
||||
state={layoutPreviewRuntime.selectStates[scopedLeafId] ?? {
|
||||
@@ -2272,6 +2288,18 @@ export function LayoutPlaygroundView({
|
||||
[selectedSavedLayoutPayload],
|
||||
);
|
||||
const savedLayoutRecordMap = useMemo(() => new Map(savedLayouts.map((record) => [record.id, record])), [savedLayouts]);
|
||||
const selectedSavedLayoutPrompt = useMemo(
|
||||
() =>
|
||||
selectedSavedLayoutRecord
|
||||
? buildCodexRequestText({
|
||||
layoutName: selectedSavedLayoutRecord.name,
|
||||
rules: selectedSavedLayoutPayload?.interactions ?? [],
|
||||
leafMap: selectedSavedInteractionLeafMap,
|
||||
root: selectedSavedLayoutPayload?.root ?? null,
|
||||
})
|
||||
: '',
|
||||
[selectedSavedInteractionLeafMap, selectedSavedLayoutPayload, selectedSavedLayoutRecord],
|
||||
);
|
||||
const currentInteractionPrompt = useMemo(
|
||||
() =>
|
||||
buildCodexRequestText({
|
||||
@@ -2335,6 +2363,9 @@ export function LayoutPlaygroundView({
|
||||
interactionLeafMap: selectedSavedInteractionLeafMap,
|
||||
hideInteractionOverlays: true,
|
||||
scopeKey: selectedSavedLayoutRecord.id,
|
||||
onPreviewActionClick: () => {
|
||||
void openCodexLiveForPrompt(selectedSavedLayoutPrompt);
|
||||
},
|
||||
})}
|
||||
</LayoutSamplePreview>
|
||||
</StockAlertLayoutProvider>
|
||||
@@ -2441,6 +2472,16 @@ export function LayoutPlaygroundView({
|
||||
interactionLeafMap: savedLeafMap,
|
||||
hideInteractionOverlays: true,
|
||||
scopeKey: record.id,
|
||||
onPreviewActionClick: () => {
|
||||
void openCodexLiveForPrompt(
|
||||
buildCodexRequestText({
|
||||
layoutName: record.name,
|
||||
rules: savedPayload.interactions,
|
||||
leafMap: savedLeafMap,
|
||||
root: savedPayload.root,
|
||||
}),
|
||||
);
|
||||
},
|
||||
})}
|
||||
</LayoutSamplePreview>
|
||||
</StockAlertLayoutProvider>
|
||||
@@ -2951,6 +2992,9 @@ export function LayoutPlaygroundView({
|
||||
activeInteractionIds: [],
|
||||
hideInteractionOverlays: true,
|
||||
scopeKey: 'editor',
|
||||
onPreviewActionClick: () => {
|
||||
void openCodexLiveForPrompt(currentInteractionPrompt);
|
||||
},
|
||||
})}
|
||||
</LayoutSamplePreview>
|
||||
) : (
|
||||
|
||||
Reference in New Issue
Block a user