feat: add HTML import functionality for certificate designer

- Implemented `html-import.ts` to parse Handlebars/HTML certificates into canvas blocks.
- Introduced `htmlToPlacements` function to convert parsed HTML into structured placements.
- Added inline style parsing and unit conversion for various CSS lengths.
- Created test suite in `html-import.spec.ts` to validate the import logic and edge cases.
- Ensured compatibility with existing template field placements and background image handling.
This commit is contained in:
nati
2026-09-08 08:29:10 +00:00
parent 41067fb07f
commit 0c895c14a1
11 changed files with 1218 additions and 311 deletions

View File

@@ -805,18 +805,29 @@ export interface Department {
export type RankCertificateCategory = "COC" | "COP";
/**
* Which STCW ship-size/power limitation a CoC rank row is issued under —
* every CoC rank exists twice, once per tier, plus a third untiered row kept
* only so licences issued before the tier split still resolve to a catalogue
* entry. `null` for a CoP rank (no such limitation applies) and for that
* untiered legacy CoC row — never for a rank meant to be offered as a new
* choice going forward.
*/
export type RankTier = "ABOVE" | "BELOW";
/** One rung of a CoC/CoP ladder for a department. */
export interface Rank {
id: string;
departmentId: string;
certificateCategory: RankCertificateCategory;
/** Value stored on License.rank / Certification.rankKey, e.g. "CHIEF_MATE". */
/** Value stored on License.rank / Certification.rankKey, e.g. "CHIEF_MATE_ABOVE". */
key: string;
name: Bilingual;
/** Rung position within its department+category ladder. 0 is the entry rank. */
ladderOrder: number;
sortOrder: number;
isActive: boolean;
tier: RankTier | null;
}
export interface LicenseTemplate {