feat(export-options): Google Sheets 템플릿 모드 옵션(UI+extras) 추가
This commit is contained in:
@@ -9,6 +9,7 @@ export type ExtrasOverrides = {
|
||||
display: string
|
||||
theme_color: string
|
||||
}>
|
||||
sheetsMode?: 'auto' | 'include' | 'exclude'
|
||||
}
|
||||
|
||||
function toBytes(s: string): Uint8Array {
|
||||
@@ -42,10 +43,12 @@ export function buildExtrasForPage(page: Page, overrides?: ExtrasOverrides): Rec
|
||||
const manifestJson = JSON.stringify(manifestMerged, null, 2)
|
||||
out['site.webmanifest'] = toBytes(manifestJson)
|
||||
|
||||
// Google Sheets 템플릿: actionUrl 미지정 시 포함
|
||||
// Google Sheets 템플릿: 기본 auto. overrides.sheetsMode로 강제 포함/제외 가능
|
||||
const mode = overrides?.sheetsMode ?? 'auto'
|
||||
const action = page.form?.actionUrl?.trim()
|
||||
const hasAction = !!(action && action.length > 0)
|
||||
if (!hasAction) {
|
||||
const shouldInclude = mode === 'include' || (mode === 'auto' && !hasAction)
|
||||
if (shouldInclude) {
|
||||
const code = `/**
|
||||
* Google Apps Script Web App for form submissions
|
||||
* - Deploy as Web App and set URL as form action if needed.
|
||||
|
||||
Reference in New Issue
Block a user