feat: complete TASK-WP5-03 asset allowlist
Dada P0-A isolated Windows CI / validate-and-package (push) Failing after 1m5s

This commit is contained in:
suyx
2026-08-03 18:24:16 +08:00
parent 609c71a3f7
commit 4d1ec8ba7e
27 changed files with 1078 additions and 74 deletions
+9 -2
View File
@@ -1,4 +1,5 @@
import type { CanvasState } from "@dada/shared-contracts";
import { P0A_DYNAMIC_STICKER_IDS } from "@dada/template-registry";
import { DYNAMIC_RESOURCE_VERSION } from "./dynamic-render-models.js";
import type { CanvasElementIdentity } from "./editor-elements.js";
@@ -6,7 +7,7 @@ import type { CanvasElementIdentity } from "./editor-elements.js";
type CanvasElement = CanvasState["elements"][number];
export type DynamicCategory = "identity" | "location" | "other" | "time";
export type DynamicTemplateId = "DYN001" | "DYN002" | "DYN003" | "DYN004" | "DYN007" | "DYN008" | "DYN011" | "DYN012" | "DYN015" | "DYN016";
export type DynamicTemplateId = typeof P0A_DYNAMIC_STICKER_IDS[number];
export interface DynamicStickerDefinition {
category: DynamicCategory;
@@ -44,7 +45,7 @@ export function dyn012DisplayParts(element: CanvasElement) {
} as const;
}
export const P0A_DYNAMIC_STICKERS: readonly DynamicStickerDefinition[] = [
const dynamicDefinitions: readonly DynamicStickerDefinition[] = [
{ category: "location", displayName: "地点标题", requiresLocationConsent: false, templateId: "DYN001" },
{ category: "location", displayName: "英文地点", requiresLocationConsent: false, templateId: "DYN002" },
{ category: "location", displayName: "城市地点", requiresLocationConsent: false, templateId: "DYN003" },
@@ -57,6 +58,12 @@ export const P0A_DYNAMIC_STICKERS: readonly DynamicStickerDefinition[] = [
{ category: "identity", displayName: "社交 ID", requiresLocationConsent: false, templateId: "DYN016" },
] as const;
export const P0A_DYNAMIC_STICKERS: readonly DynamicStickerDefinition[] = P0A_DYNAMIC_STICKER_IDS.map((templateId) => {
const definition = dynamicDefinitions.find((item) => item.templateId === templateId);
if (!definition) throw new Error(`missing dynamic sticker definition ${templateId}`);
return definition;
});
function twoDigits(value: number) {
return String(value).padStart(2, "0");
}