feat(export-options): Google Sheets 템플릿 모드 옵션(UI+extras) 추가
This commit is contained in:
@@ -8,6 +8,7 @@ import { AssetManager } from '@/lib/assets/assetManager'
|
||||
import { buildZip } from '@/lib/exporter/zip'
|
||||
import { buildExtrasForPage } from '@/lib/exporter/extras'
|
||||
import { buildAssetsMetadata } from '@/lib/exporter/assets.meta'
|
||||
import { buildAssetsIndex } from '@/lib/exporter/assets.index'
|
||||
import type { Section } from '@/lib/state/store'
|
||||
import { createFormStore, type FormState } from '@/lib/state/formStore'
|
||||
import FormBuilderPanel from '@/components/FormBuilderPanel'
|
||||
@@ -56,6 +57,7 @@ export default function BuilderClientPage() {
|
||||
const [manifestDisplay, setManifestDisplay] = useState<string>('')
|
||||
const [manifestThemeColor, setManifestThemeColor] = useState<string>('')
|
||||
const [robotsDisallow, setRobotsDisallow] = useState<string>('')
|
||||
const [sheetsMode, setSheetsMode] = useState<'auto' | 'include' | 'exclude'>('auto')
|
||||
const [viewport, setViewport] = useState<'desktop' | 'mobile'>(() => {
|
||||
if (typeof window !== 'undefined') {
|
||||
try {
|
||||
@@ -238,14 +240,14 @@ export default function BuilderClientPage() {
|
||||
const disallowLines = lines.map((l) => (l.startsWith('Disallow:') ? l : `Disallow: ${l}`))
|
||||
return `User-agent: *\n${disallowLines.join('\n')}`
|
||||
})()
|
||||
const baseExtras = buildExtrasForPage(valid, { robotsText: robotsTextOverride, manifest: manifestOverride })
|
||||
const baseExtras = buildExtrasForPage(valid, { robotsText: robotsTextOverride, manifest: manifestOverride, sheetsMode })
|
||||
const extras: Record<string, Uint8Array> = {
|
||||
...baseExtras,
|
||||
...(am ? { 'assets.json': buildAssetsMetadata(am) } : {}),
|
||||
...(am ? { 'assets.json': buildAssetsMetadata(am), 'assets.index.json': buildAssetsIndex(am) } : {}),
|
||||
}
|
||||
const zipBytes = await buildZip({ html: exported.html, css: exported.css, js: exported.js, assets, extras })
|
||||
download('landing.zip', zipBytes)
|
||||
}, [pageData, am, manifestName, manifestShortName, manifestStartUrl, manifestDisplay, manifestThemeColor, robotsDisallow])
|
||||
}, [pageData, am, manifestName, manifestShortName, manifestStartUrl, manifestDisplay, manifestThemeColor, robotsDisallow, sheetsMode])
|
||||
|
||||
return (
|
||||
<div className="p-6 space-y-6">
|
||||
@@ -381,6 +383,20 @@ export default function BuilderClientPage() {
|
||||
placeholder="/private\n/tmp"
|
||||
/>
|
||||
</label>
|
||||
<label className="block" htmlFor="ins-sheets-mode">
|
||||
<span className="sr-only">Google Sheets Template Mode</span>
|
||||
<select
|
||||
id="ins-sheets-mode"
|
||||
aria-label="Google Sheets Template Mode"
|
||||
className="border rounded px-3 py-2 w-full"
|
||||
value={sheetsMode}
|
||||
onChange={(e) => setSheetsMode(e.target.value as 'auto'|'include'|'exclude')}
|
||||
>
|
||||
<option value="auto">Sheets Template: Auto</option>
|
||||
<option value="include">Sheets Template: Include</option>
|
||||
<option value="exclude">Sheets Template: Exclude</option>
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user