@cosmicdrift/kumiko-samples 0.418.0 → 0.419.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/packages/bundled-features/package.json +6 -1
- package/packages/bundled-features/src/template-resolver/changes.json +38 -0
- package/packages/bundled-features/src/template-resolver/compile-document-body.ts +3 -8
- package/packages/bundled-features/src/template-resolver/compile-document-styles.ts +102 -0
- package/packages/bundled-features/src/template-resolver/document-frames.ts +25 -0
- package/packages/bundled-features/src/template-resolver/document-op-blocks.ts +568 -0
- package/packages/bundled-features/src/template-resolver/document-ops.ts +136 -126
- package/packages/bundled-features/src/template-resolver/document-print-only.ts +41 -0
- package/packages/bundled-features/src/template-resolver/document-sanitizer.ts +41 -19
- package/packages/bundled-features/src/template-resolver/feature.ts +15 -0
- package/packages/bundled-features/src/template-resolver/handlers/apply-layout.write.ts +137 -0
- package/packages/bundled-features/src/template-resolver/handlers/create-layout.write.ts +87 -0
- package/packages/bundled-features/src/template-resolver/handlers/document-base.ts +2 -2
- package/packages/bundled-features/src/template-resolver/handlers/document-blocks.query.ts +13 -8
- package/packages/bundled-features/src/template-resolver/handlers/document-region.ts +47 -0
- package/packages/bundled-features/src/template-resolver/handlers/failure-reason.ts +13 -0
- package/packages/bundled-features/src/template-resolver/handlers/import-bundle-system.write.ts +3 -0
- package/packages/bundled-features/src/template-resolver/handlers/layout-source.query.ts +17 -5
- package/packages/bundled-features/src/template-resolver/handlers/overview.query.ts +16 -4
- package/packages/bundled-features/src/template-resolver/handlers/patch-draft.write.ts +19 -6
- package/packages/bundled-features/src/template-resolver/handlers/publish-templates.write.ts +69 -0
- package/packages/bundled-features/src/template-resolver/handlers/set.write.ts +7 -0
- package/packages/bundled-features/src/template-resolver/handlers/template-write.ts +15 -3
- package/packages/bundled-features/src/template-resolver/handlers/tenant-settings.ts +122 -0
- package/packages/bundled-features/src/template-resolver/handlers/toggle-status.write.ts +25 -10
- package/packages/bundled-features/src/template-resolver/handlers/upsert-system.write.ts +7 -3
- package/packages/bundled-features/src/template-resolver/handlers/usage.query.ts +131 -18
- package/packages/bundled-features/src/template-resolver/handlers/validate.query.ts +10 -0
- package/packages/bundled-features/src/template-resolver/i18n.ts +3 -0
- package/packages/bundled-features/src/template-resolver/index.ts +29 -0
- package/packages/bundled-features/src/template-resolver/layout-regions.ts +54 -16
- package/packages/bundled-features/src/template-resolver/print-document.ts +3 -1
- package/packages/bundled-features/src/template-resolver/seeding.ts +4 -0
- package/packages/bundled-features/src/template-resolver/template-delivery-policy.ts +11 -1
- package/packages/bundled-features/src/template-resolver/template-edit-policy.ts +37 -1
- package/packages/bundled-features/src/template-resolver/template-meta.ts +25 -6
- package/packages/bundled-features/src/template-resolver/template-preview.ts +6 -7
- package/packages/bundled-features/src/template-resolver/template-validation.ts +10 -3
- package/packages/bundled-features/src/template-resolver/web/constants.ts +29 -0
- package/packages/bundled-features/src/template-resolver/web/document-blocks.ts +5 -0
- package/packages/bundled-features/src/template-resolver/web/document-editor-extensions.ts +34 -2
- package/packages/bundled-features/src/template-resolver/web/document-editor-fonts.ts +13 -0
- package/packages/bundled-features/src/template-resolver/web/document-fonts.ts +21 -0
- package/packages/bundled-features/src/template-resolver/web/document-frame-control.ts +428 -0
- package/packages/bundled-features/src/template-resolver/web/document-frame-node-view.tsx +207 -0
- package/packages/bundled-features/src/template-resolver/web/document-print-decorations.ts +196 -0
- package/packages/bundled-features/src/template-resolver/web/document-print-defaults.ts +59 -0
- package/packages/bundled-features/src/template-resolver/web/document-print-style.ts +246 -0
- package/packages/bundled-features/src/template-resolver/web/document-repeat-strip.ts +104 -0
- package/packages/bundled-features/src/template-resolver/web/document-schema.ts +29 -9
- package/packages/bundled-features/src/template-resolver/web/document-style-css.ts +107 -0
- package/packages/bundled-features/src/template-resolver/web/document-tiptap-bubble.tsx +24 -2
- package/packages/bundled-features/src/template-resolver/web/document-tiptap-content.tsx +66 -7
- package/packages/bundled-features/src/template-resolver/web/document-tiptap-context.ts +13 -1
- package/packages/bundled-features/src/template-resolver/web/document-tiptap-editor.tsx +24 -4
- package/packages/bundled-features/src/template-resolver/web/document-tiptap-helpers.ts +149 -4
- package/packages/bundled-features/src/template-resolver/web/document-tiptap-toolbar-groups.tsx +290 -10
- package/packages/bundled-features/src/template-resolver/web/document-tiptap-toolbar.tsx +90 -8
- package/packages/bundled-features/src/template-resolver/web/document-toolbar-blocks.ts +20 -0
- package/packages/bundled-features/src/template-resolver/web/fontsource-css.d.ts +2 -0
- package/packages/bundled-features/src/template-resolver/web/i18n.ts +28 -0
- package/packages/bundled-features/src/template-resolver/web/index.ts +34 -0
- package/packages/bundled-features/src/template-resolver/web/pdf-constants.ts +6 -0
- package/packages/bundled-features/src/template-resolver/web/qualified-names.ts +7 -0
- package/packages/bundled-features/src/template-resolver/web/use-document-tiptap-model.ts +74 -5
- package/packages/bundled-features/src/tenant/company-config.ts +48 -0
- package/packages/bundled-features/src/tenant/feature.ts +11 -0
- package/packages/bundled-features/src/tenant/i18n.ts +14 -0
- package/samples/apps/ui-walkthrough/src/app/auth-constants.ts +51 -0
- package/samples/apps/ui-walkthrough/src/app/seed-print-editor-tenants.ts +118 -0
- package/samples/apps/ui-walkthrough/src/app/seed-templates.ts +2 -0
- package/samples/apps/ui-walkthrough/src/app/server.ts +9 -1
- package/samples/apps/ui-walkthrough/src/app/template-seed-data.ts +27 -1
- package/samples/apps/ui-walkthrough/src/run-config.ts +1 -0
- package/samples/apps/use-all-bundled/feature-manifest.json +236 -0
- package/samples/recipes/pdf-letterhead/README.md +23 -0
- package/samples/recipes/pdf-letterhead/package.json +12 -0
- package/samples/recipes/pdf-letterhead/src/letterhead.ts +92 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-samples",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.419.0",
|
|
4
4
|
"description": "Source trees of the Kumiko sample recipes, sample apps and bundled features in repo layout, for tooling such as few-shot corpus builds.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-bundled-features",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.419.0",
|
|
4
4
|
"description": "Built-in features — tenant, user, auth, delivery. The stuff you'd rewrite anyway, already typed.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
|
|
@@ -183,6 +183,11 @@
|
|
|
183
183
|
"@cosmicdrift/kumiko-framework": "workspace:*",
|
|
184
184
|
"@cosmicdrift/kumiko-renderer": "workspace:*",
|
|
185
185
|
"@cosmicdrift/kumiko-types": "workspace:*",
|
|
186
|
+
"@fontsource/arimo": "^5.3.0",
|
|
187
|
+
"@fontsource/caladea": "^5.3.0",
|
|
188
|
+
"@fontsource/carlito": "^5.3.0",
|
|
189
|
+
"@fontsource/cousine": "^5.3.0",
|
|
190
|
+
"@fontsource/tinos": "^5.3.0",
|
|
186
191
|
"@mollie/api-client": "^4.6.0",
|
|
187
192
|
"@node-rs/argon2": "^2.2.2",
|
|
188
193
|
"@tiptap/core": "^3.32.2",
|
|
@@ -1,4 +1,42 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "0.419.0",
|
|
4
|
+
"type": "improvement",
|
|
5
|
+
"title": "Frames and text styles in PDF templates",
|
|
6
|
+
"detail": "A PDF body can hold positioned frames (address window at DIN 5008 form B or A, free text frame, as `div[data-frame]` with `data-x`, `data-y`, `data-width`, `data-height` in mm) and text styles (`span[data-text-style]` with font, size in pt and colour, plus line height and paragraph spacing on blocks). Both go through the sanitizer and compile to inline CSS. The font catalog is Arial, Times New Roman, Courier New, Calibri and Cambria; the puppeteer-service image needs the metric-compatible fonts (Carlito, Caladea) next to the Liberation ones, so rebuild it."
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"version": "0.419.0",
|
|
10
|
+
"type": "breaking",
|
|
11
|
+
"title": "signature and imprint are no longer placeholders, company* names are reserved",
|
|
12
|
+
"detail": "In `document-pdf` and `pdf-layout` templates, `signature` and `imprint` are no longer placeholders; a template that uses them fails on save and publish. The ten `company*` names (`companyAddress`, `companyPhone`, `companyEmail`, `companyWebsite`, `companyRegister`, `companyVatId`, `companyManagement`, `companyBank`, `companyIban`, `companyBic`) are now reserved, so a notification variable with such a name fails at boot.",
|
|
13
|
+
"migration": "Remove `signature` and `imprint` from PDF templates and layouts. Rename notification variables that collide with a reserved `company*` name."
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"version": "0.419.0",
|
|
17
|
+
"type": "improvement",
|
|
18
|
+
"title": "Header and footer use the layout font size",
|
|
19
|
+
"detail": "PDF header and footer take the layout's `fontSizePt` and fall back to 10.5pt, the size the editor always showed; before they printed at 9px. Paragraphs in header and footer no longer carry margins. Existing PDF layouts therefore change on the next render: a footer taller than the bottom margin minus 4mm reaches into the page body, so check multi-line footers."
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"version": "0.419.0",
|
|
23
|
+
"type": "improvement",
|
|
24
|
+
"title": "Default PDF layout per tenant, apply-layout and publish-templates",
|
|
25
|
+
"detail": "The tenant config key `template-resolver:config:default-pdf-layout-slug` picks the layout of PDF templates that name none. `template-resolver:write:apply-layout` sets it (mode `all`, no copies) or writes the layout into a tenant draft per chosen template (mode `selected`, text unchanged); `template-resolver:write:publish-templates` activates drafts together and reports per template what failed. The usage query lists the templates a layout serves, with `hasOwnLayout` for those that follow the default."
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"version": "0.419.0",
|
|
29
|
+
"type": "breaking",
|
|
30
|
+
"title": "Line grid, flush tables and the address window in PDF bodies",
|
|
31
|
+
"detail": "PDF bodies print at line height 1.2. Paragraphs, lists, headings and tables are spaced by one body line (`--doc-line`, font size times 1.2) instead of 6pt after a paragraph and browser heading margins; the last element in a cell, list item, frame or the document has no bottom margin. Tables are flush with the text margin: the outer cells lose their left and right padding unless the layout table style is `grid` or the header has a background. Address paragraphs start at the text margin, have no spacing between lines, and the sender line prints at 7pt and wraps instead of being cut off. Flow text below a frame that reserves space starts 8mm under it. In the editor, cells are top-aligned, header cells print like body text, and rules appear only where the layout table style prints them; an untouched layout shows the table style \"plain\", as the PDF always printed it; a dashed outline marks cells while editing. Frames snap to page margins and other frames while moving or resizing (hold Alt to move freely).",
|
|
32
|
+
"migration": "Render existing PDF templates once and check the page breaks. A template that relied on the 6pt paragraph gap sets the spacing per paragraph instead."
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"version": "0.419.0",
|
|
36
|
+
"type": "improvement",
|
|
37
|
+
"title": "patch-draft and create-layout let an agent rebuild PDF templates and layouts",
|
|
38
|
+
"detail": "patch-draft and document-blocks accept inline runs (bold, italic, underline, font, size, color), block formatting, lists, tables with a repeat row, address and text frames, a replaceBody op and a formatBlock op, all checked against the editor's print ranges and fonts. They also take kind pdf-layout with a region (header, signature or footer). The new create-layout handler creates an empty PDF layout draft under the slug tenant-layout-<name>; a tenant may edit, publish and use such layouts as soon as it may edit any PDF template, and system layouts may not take that prefix (reserved_layout_slug). patch-draft is now an agent proposal with risk low; its new refusals use the patch error codes print_style_not_allowed, invalid_table, too_many_blocks and others."
|
|
39
|
+
},
|
|
2
40
|
{
|
|
3
41
|
"version": "0.415.0",
|
|
4
42
|
"type": "fix",
|
|
@@ -2,6 +2,7 @@ import type { TemplateVariableDef, TemplateVariables } from "@cosmicdrift/kumiko
|
|
|
2
2
|
import { isOneOf } from "@cosmicdrift/kumiko-types/type-guards";
|
|
3
3
|
import type { Element as ScanElement } from "happy-dom";
|
|
4
4
|
import { isResourceImageContentType } from "../shared/index.ts";
|
|
5
|
+
import { appendStyle, applyDocumentPrintStyles } from "./compile-document-styles.ts";
|
|
5
6
|
import { rewriteStepsBlock } from "./compile-steps-block.ts";
|
|
6
7
|
import { conditionScopeElement, withParsedDocument } from "./document-sanitizer.ts";
|
|
7
8
|
import {
|
|
@@ -253,12 +254,6 @@ const MAIL_HEADING_STYLES: Readonly<Record<string, string>> = {
|
|
|
253
254
|
h3: "margin:20px 0 8px 0;font-size:17px;line-height:1.3;font-weight:600;color:#0B0D12",
|
|
254
255
|
};
|
|
255
256
|
|
|
256
|
-
// Appended after an existing style (data-align) so the alignment survives.
|
|
257
|
-
function appendStyle(element: ScanElement, style: string): void {
|
|
258
|
-
const existing = element.getAttribute("style");
|
|
259
|
-
element.setAttribute("style", existing === null ? style : `${existing};${style}`);
|
|
260
|
-
}
|
|
261
|
-
|
|
262
257
|
function collectUniqueValidAttributes(
|
|
263
258
|
html: string,
|
|
264
259
|
selector: string,
|
|
@@ -335,8 +330,7 @@ export function toResourceDataUri(contentType: string, bytes: Uint8Array): strin
|
|
|
335
330
|
function rewriteAlignment(element: ScanElement): void {
|
|
336
331
|
const align = element.getAttribute("data-align");
|
|
337
332
|
element.removeAttribute("data-align");
|
|
338
|
-
if (isOneOf(DOCUMENT_TEXT_ALIGNMENTS, align))
|
|
339
|
-
element.setAttribute("style", `text-align:${align}`);
|
|
333
|
+
if (isOneOf(DOCUMENT_TEXT_ALIGNMENTS, align)) appendStyle(element, `text-align:${align}`);
|
|
340
334
|
}
|
|
341
335
|
|
|
342
336
|
function rewriteResourceImage(
|
|
@@ -431,6 +425,7 @@ export function compileDocumentBodyToHandlebars(
|
|
|
431
425
|
const scrubbed = html.replaceAll(EXPRESSION_OPEN, "").replaceAll(EXPRESSION_CLOSE, "");
|
|
432
426
|
const compiled = withParsedDocument(scrubbed, (root) => {
|
|
433
427
|
stripScriptsAndActiveContent(root, options);
|
|
428
|
+
applyDocumentPrintStyles(root);
|
|
434
429
|
if (options.alignmentAsInlineStyle === true) applyAlignmentInlineStyles(root);
|
|
435
430
|
if (options.headingAsInlineStyle === true) applyHeadingInlineStyles(root);
|
|
436
431
|
if (options.tableAsInlineStyle === true) applyTableInlineStyles(root);
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import type { Element as ScanElement } from "happy-dom";
|
|
2
|
+
import {
|
|
3
|
+
readBlockStyleAttributes,
|
|
4
|
+
readCellBackground,
|
|
5
|
+
readColwidth,
|
|
6
|
+
readFrameAttributes,
|
|
7
|
+
readTextStyleAttributes,
|
|
8
|
+
} from "./web/document-print-style.ts";
|
|
9
|
+
import {
|
|
10
|
+
documentBlockStyleCss,
|
|
11
|
+
documentCellStyleCss,
|
|
12
|
+
documentFrameCss,
|
|
13
|
+
documentTextStyleCss,
|
|
14
|
+
} from "./web/document-style-css.ts";
|
|
15
|
+
|
|
16
|
+
// Appended after an existing style (data-align) so the alignment survives.
|
|
17
|
+
export function appendStyle(element: ScanElement, style: string): void {
|
|
18
|
+
if (style === "") return;
|
|
19
|
+
const existing = element.getAttribute("style");
|
|
20
|
+
element.setAttribute("style", existing === null ? style : `${existing};${style}`);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function addClass(element: ScanElement, className: string): void {
|
|
24
|
+
const existing = element.getAttribute("class");
|
|
25
|
+
element.setAttribute("class", existing === null ? className : `${existing} ${className}`);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function roundPercent(value: number): number {
|
|
29
|
+
return Math.round(value * 100) / 100;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Percentages sum to exactly 100 so the table keeps the full content width.
|
|
33
|
+
function columnPercentages(widths: readonly number[]): number[] {
|
|
34
|
+
const total = widths.reduce((sum, width) => sum + width, 0);
|
|
35
|
+
const percentages = widths.map((width) => roundPercent((width / total) * 100));
|
|
36
|
+
const last = percentages.length - 1;
|
|
37
|
+
const others = percentages.slice(0, last).reduce((sum, value) => sum + value, 0);
|
|
38
|
+
percentages[last] = roundPercent(100 - others);
|
|
39
|
+
return percentages;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function firstRowColumnWidths(table: ScanElement): number[] | null {
|
|
43
|
+
const firstRow = Array.from(table.querySelectorAll("tr")).find(
|
|
44
|
+
(row) => row.closest("table") === table,
|
|
45
|
+
);
|
|
46
|
+
if (firstRow === undefined) return null;
|
|
47
|
+
const widths: number[] = [];
|
|
48
|
+
for (const cell of Array.from(firstRow.children)) {
|
|
49
|
+
const colwidth = readColwidth(cell);
|
|
50
|
+
const span = Number(cell.getAttribute("colspan") ?? 1);
|
|
51
|
+
if (colwidth === null || colwidth.length !== span) return null;
|
|
52
|
+
widths.push(...colwidth);
|
|
53
|
+
}
|
|
54
|
+
return widths.length > 0 ? widths : null;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function insertColgroup(table: ScanElement, widths: readonly number[]): void {
|
|
58
|
+
const document = table.ownerDocument;
|
|
59
|
+
const colgroup = document.createElement("colgroup");
|
|
60
|
+
for (const percentage of columnPercentages(widths)) {
|
|
61
|
+
const col = document.createElement("col");
|
|
62
|
+
col.setAttribute("style", `width:${percentage}%`);
|
|
63
|
+
colgroup.append(col);
|
|
64
|
+
}
|
|
65
|
+
table.insertBefore(colgroup, table.firstChild);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function applyFrames(root: ScanElement): void {
|
|
69
|
+
for (const frame of Array.from(root.querySelectorAll("div[data-frame]"))) {
|
|
70
|
+
const box = readFrameAttributes(frame);
|
|
71
|
+
if (box === null) {
|
|
72
|
+
frame.replaceWith(...Array.from(frame.childNodes));
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
addClass(frame, "kumiko-frame");
|
|
76
|
+
appendStyle(frame, documentFrameCss(box));
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function applyTables(root: ScanElement): void {
|
|
81
|
+
for (const table of Array.from(root.querySelectorAll("table"))) {
|
|
82
|
+
if (table.getAttribute("data-borders") === "none") addClass(table, "kumiko-table-plain");
|
|
83
|
+
const widths = firstRowColumnWidths(table);
|
|
84
|
+
if (widths !== null) insertColgroup(table, widths);
|
|
85
|
+
}
|
|
86
|
+
for (const cell of Array.from(root.querySelectorAll("td, th"))) {
|
|
87
|
+
appendStyle(cell, documentCellStyleCss({ background: readCellBackground(cell) }));
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// Runs before the placeholder rewrites: a rich text block host copies its paragraph's
|
|
92
|
+
// attributes, so the style has to be on the paragraph by then.
|
|
93
|
+
export function applyDocumentPrintStyles(root: ScanElement): void {
|
|
94
|
+
applyFrames(root);
|
|
95
|
+
applyTables(root);
|
|
96
|
+
for (const span of Array.from(root.querySelectorAll("span[data-text-style]"))) {
|
|
97
|
+
appendStyle(span, documentTextStyleCss(readTextStyleAttributes(span)));
|
|
98
|
+
}
|
|
99
|
+
for (const block of Array.from(root.querySelectorAll("p, h1, h2, h3"))) {
|
|
100
|
+
appendStyle(block, documentBlockStyleCss(readBlockStyleAttributes(block)));
|
|
101
|
+
}
|
|
102
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Server-only (happy-dom). Frames are read from the stored body for page planning, and flattened
|
|
2
|
+
// for the editor preview, which shows the body outside a page where absolute coordinates mean nothing.
|
|
3
|
+
import { withParsedDocument } from "./document-sanitizer.ts";
|
|
4
|
+
import { type DocumentFrameAttributes, readFrameAttributes } from "./web/document-print-style.ts";
|
|
5
|
+
|
|
6
|
+
const PREVIEW_FRAME_STYLE =
|
|
7
|
+
"margin:8px 0;padding:6px;border:1px dashed #9ca3af;white-space:pre-line";
|
|
8
|
+
|
|
9
|
+
export function readTopLevelFrames(html: string): readonly DocumentFrameAttributes[] {
|
|
10
|
+
return withParsedDocument(html, (body) =>
|
|
11
|
+
Array.from(body.children).flatMap((child) => {
|
|
12
|
+
const frame = child.matches("div[data-frame]") ? readFrameAttributes(child) : null;
|
|
13
|
+
return frame === null ? [] : [frame];
|
|
14
|
+
}),
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function flattenFramesForPreview(compiledHtml: string): string {
|
|
19
|
+
return withParsedDocument(compiledHtml, (body) => {
|
|
20
|
+
for (const frame of Array.from(body.querySelectorAll("div.kumiko-frame"))) {
|
|
21
|
+
frame.setAttribute("style", PREVIEW_FRAME_STYLE);
|
|
22
|
+
}
|
|
23
|
+
return body.innerHTML;
|
|
24
|
+
});
|
|
25
|
+
}
|