import * as vscode from "vscode"; import { TaskScope } from "@/model/taskLocation"; import { TASK_SCOPE_LABELS } from "@/ui/taskLabels"; const NONCE_LENGTH = 32; /** Kanban board document (columns + HTML5 drag-and-drop). */ export function getTaskKanbanHtml( webview: vscode.Webview, nonce: string, ): string { const csp = [ "default-src 'none'", `style-src ${webview.cspSource} 'unsafe-inline'`, `script-src 'nonce-${nonce}'`, ].join("; "); const scopeProject = JSON.stringify(TaskScope.PROJECT); const scopeGlobal = JSON.stringify(TaskScope.GLOBAL); const labelProject = JSON.stringify(TASK_SCOPE_LABELS[TaskScope.PROJECT]); const labelGlobal = JSON.stringify(TASK_SCOPE_LABELS[TaskScope.GLOBAL]); return ` Kanban

Kanban

`; } export function createKanbanNonce(): string { const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; let result = ""; for (let i = 0; i < NONCE_LENGTH; i += 1) { result += alphabet.charAt(Math.floor(Math.random() * alphabet.length)); } return result; }