@litfamily/litgravity 0.1.0 → 0.1.2
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/CHANGELOG.md +32 -0
- package/README.md +72 -17
- package/README_ko-KR.md +72 -17
- package/package.json +1 -1
- package/plugin/hooks/lib/lanes.mjs +65 -0
- package/plugin/hooks/lib/motion.mjs +34 -5
- package/plugin/hooks/lib/reentry.mjs +7 -0
- package/plugin/hooks/lib/rewind/brief.mjs +332 -0
- package/plugin/hooks/lib/rewind/collect.mjs +328 -0
- package/plugin/hooks/lib/rewind/gauge.mjs +55 -0
- package/plugin/hooks/lib/rewind/next-step.mjs +77 -0
- package/plugin/hooks/lib/rewind/redact.mjs +60 -0
- package/plugin/hooks/lib/rewind/transcripts.mjs +211 -0
- package/plugin/hooks/lib/routes.mjs +79 -5
- package/plugin/hooks/lib/workflow-stack.mjs +213 -0
- package/plugin/hooks/post-tool-use.mjs +37 -1
- package/plugin/hooks/pre-invocation.mjs +91 -2
- package/plugin/hooks/session-start.mjs +26 -3
- package/plugin/hooks/stop.mjs +22 -2
- package/plugin/hud/looks.mjs +29 -0
- package/plugin/hud/render.mjs +234 -12
- package/plugin/plugin.json +1 -1
- package/plugin/skills/frontend-ui-ux/SKILL.md +12 -1
- package/plugin/skills/frontend-ui-ux/kit/components.css +417 -0
- package/plugin/skills/frontend-ui-ux/kit/fonts.json +22 -0
- package/plugin/skills/frontend-ui-ux/kit/layouts/landing.html +164 -0
- package/plugin/skills/frontend-ui-ux/kit/layouts/settings.html +114 -0
- package/plugin/skills/frontend-ui-ux/kit/layouts/workspace.html +115 -0
- package/plugin/skills/frontend-ui-ux/kit/styles/computational-brutalism.json +227 -0
- package/plugin/skills/frontend-ui-ux/kit/styles/field-notes.json +205 -0
- package/plugin/skills/frontend-ui-ux/kit/styles/graphite.json +200 -0
- package/plugin/skills/frontend-ui-ux/kit/styles/meadow.json +199 -0
- package/plugin/skills/frontend-ui-ux/kit/styles/neo-brutalism.json +222 -0
- package/plugin/skills/frontend-ui-ux/kit/ui.js +226 -0
- package/plugin/skills/frontend-ui-ux/references/house-styles.md +234 -0
- package/plugin/skills/frontend-ui-ux/scripts/design-lock.mjs +400 -0
- package/plugin/skills/frontend-ui-ux/scripts/interface-probe-lock.mjs +196 -0
- package/plugin/skills/frontend-ui-ux/scripts/interface-probe-page.mjs +30 -9
- package/plugin/skills/frontend-ui-ux/scripts/interface-probe-rules.mjs +20 -8
- package/plugin/skills/frontend-ui-ux/scripts/interface-probe.mjs +42 -9
- package/plugin/skills/frontend-ui-ux/scripts/pixel-art.mjs +60 -0
- package/plugin/skills/lit-adhd/SKILL.md +157 -0
- package/plugin/skills/lit-adhd/references/card-examples.md +101 -0
- package/plugin/skills/lit-adhd/references/status-taxonomy.md +32 -0
- package/plugin/skills/lit-adhd/scripts/rewind.mjs +5 -0
- package/plugin/skills/lit-diagram-drawer/SKILL.md +5 -3
- package/plugin/skills/lit-diagram-drawer/references/drawing-rules.md +1 -1
- package/plugin/skills/lit-diagram-drawer/references/style-guide.md +21 -12
- package/plugin/skills/lit-diagram-drawer/references/type-architecture.md +3 -3
- package/plugin/skills/lit-diagram-drawer/references/type-dependency.md +1 -1
- package/plugin/skills/lit-diagram-drawer/references/type-tree.md +3 -3
- package/plugin/skills/lit-diagram-drawer/references/type-wardley.md +1 -1
- package/plugin/skills/lit-diagram-drawer/scripts/diagram-craft-rules.mjs +1 -2
- package/plugin/skills/lit-diagram-drawer/scripts/visual-quality.mjs +1 -2
- package/plugin/skills/lit-docx/SKILL.md +3 -3
- package/plugin/skills/lit-handoff/SKILL.md +1 -0
- package/plugin/skills/lit-hijack/SKILL.md +263 -0
- package/plugin/skills/lit-hijack/references/capture-and-provenance.md +100 -0
- package/plugin/skills/lit-hijack/references/clean-room-build.md +75 -0
- package/plugin/skills/lit-hijack/references/distil-and-licence.md +67 -0
- package/plugin/skills/lit-hijack/references/gap-and-port-design.md +100 -0
- package/plugin/skills/lit-hijack/references/parity-and-report.md +85 -0
- package/plugin/skills/lit-hijack/scripts/hijack.mjs +953 -0
- package/plugin/skills/lit-plan/SKILL.md +1 -1
- package/plugin/skills/lit-pptx/SKILL.md +8 -8
- package/plugin/skills/lit-pptx/fonts/jetbrains-mono/JetBrainsMono-Bold.ttf +0 -0
- package/plugin/skills/lit-pptx/fonts/jetbrains-mono/JetBrainsMono-Regular.ttf +0 -0
- package/plugin/skills/lit-pptx/fonts/jetbrains-mono/OFL.txt +93 -0
- package/plugin/skills/lit-pptx/fonts/provenance.json +32 -1
- package/plugin/skills/lit-pptx/references/agents/analyst.md +34 -56
- package/plugin/skills/lit-pptx/references/agents/antithesis.md +49 -67
- package/plugin/skills/lit-pptx/references/agents/architect.md +38 -51
- package/plugin/skills/lit-pptx/references/agents/critic.md +25 -41
- package/plugin/skills/lit-pptx/references/agents/synthesizer.md +37 -46
- package/plugin/skills/lit-pptx/references/agents/thesis.md +29 -49
- package/plugin/skills/lit-pptx/references/anti-slop-checklist.md +119 -145
- package/plugin/skills/lit-pptx/references/authoring-guide.md +187 -278
- package/plugin/skills/lit-pptx/references/consensus-protocol.md +99 -97
- package/plugin/skills/lit-pptx/references/data-display-cookbook.md +36 -137
- package/plugin/skills/lit-pptx/references/density-and-fill.md +147 -216
- package/plugin/skills/lit-pptx/references/design-system-azure.md +56 -85
- package/plugin/skills/lit-pptx/references/direction-step.md +134 -176
- package/plugin/skills/lit-pptx/references/examples/01-pitch-signal-ko.md +114 -115
- package/plugin/skills/lit-pptx/references/examples/02-pitch-studio-ko.md +66 -66
- package/plugin/skills/lit-pptx/references/examples/03-business-review-ledger-ko.md +63 -63
- package/plugin/skills/lit-pptx/references/examples/04-business-review-night-en.md +96 -96
- package/plugin/skills/lit-pptx/references/examples/05-research-talk-paper-en.md +81 -81
- package/plugin/skills/lit-pptx/references/examples/06-lecture-chalk-ko.md +103 -103
- package/plugin/skills/lit-pptx/references/examples/07-data-review-night-en.md +100 -98
- package/plugin/skills/lit-pptx/references/examples/08-image-led-atlas-ko.md +76 -76
- package/plugin/skills/lit-pptx/references/examples/09-briefing-gazette-ko.md +96 -96
- package/plugin/skills/lit-pptx/references/examples/10-status-update-ledger-ko.md +80 -80
- package/plugin/skills/lit-pptx/references/examples/11-portfolio-studio-en.md +72 -72
- package/plugin/skills/lit-pptx/references/examples/12-research-tutorial-chalk-en.md +95 -95
- package/plugin/skills/lit-pptx/references/examples/13-engineering-review-computational-brutalism-ko.md +173 -0
- package/plugin/skills/lit-pptx/references/examples/14-launch-pitch-neo-brutalism-ko.md +154 -0
- package/plugin/skills/lit-pptx/references/examples/15-design-lecture-bauhaus-ko.md +139 -0
- package/plugin/skills/lit-pptx/references/examples/16-community-programme-riso-ko.md +158 -0
- package/plugin/skills/lit-pptx/references/examples/17-public-data-briefing-newsroom-ko.md +179 -0
- package/plugin/skills/lit-pptx/references/interview-protocol.md +83 -102
- package/plugin/skills/lit-pptx/references/layout-families.md +161 -265
- package/plugin/skills/lit-pptx/references/stages/autopilot.md +30 -70
- package/plugin/skills/lit-pptx/references/stages/interview.md +36 -68
- package/plugin/skills/lit-pptx/references/stages/plan.md +26 -67
- package/plugin/skills/lit-pptx/references/title-treatments.md +93 -145
- package/plugin/skills/lit-pptx/references/tonalities/atlas.md +95 -108
- package/plugin/skills/lit-pptx/references/tonalities/bauhaus.md +140 -0
- package/plugin/skills/lit-pptx/references/tonalities/chalk.md +107 -122
- package/plugin/skills/lit-pptx/references/tonalities/computational-brutalism.md +150 -0
- package/plugin/skills/lit-pptx/references/tonalities/gazette.md +87 -111
- package/plugin/skills/lit-pptx/references/tonalities/ledger.md +96 -125
- package/plugin/skills/lit-pptx/references/tonalities/neo-brutalism.md +161 -0
- package/plugin/skills/lit-pptx/references/tonalities/newsroom.md +144 -0
- package/plugin/skills/lit-pptx/references/tonalities/night.md +104 -131
- package/plugin/skills/lit-pptx/references/tonalities/paper.md +114 -130
- package/plugin/skills/lit-pptx/references/tonalities/riso.md +137 -0
- package/plugin/skills/lit-pptx/references/tonalities/signal.md +96 -103
- package/plugin/skills/lit-pptx/references/tonalities/studio.md +81 -112
- package/plugin/skills/lit-pptx/scripts/compile-deck.js +4 -6
- package/plugin/skills/lit-pptx/scripts/craft_extras.py +135 -91
- package/plugin/skills/lit-pptx/scripts/deck_craft.py +1 -1
- package/plugin/skills/lit-pptx/scripts/embed_fonts.py +13 -1
- package/plugin/skills/lit-pptx/scripts/layout_inventory.py +1 -1
- package/plugin/skills/lit-pptx/scripts/learn_template.py +1 -1
- package/plugin/skills/lit-pptx/scripts/lib/grid-resolver.js +101 -110
- package/plugin/skills/lit-pptx/scripts/lib/layout-resolver.js +9 -15
- package/plugin/skills/lit-pptx/scripts/lib/render-pack.js +370 -563
- package/plugin/skills/lit-pptx/scripts/lib/slide-grid.js +104 -0
- package/plugin/skills/lit-pptx/scripts/lib/template-registry.js +57 -6
- package/plugin/skills/lit-pptx/scripts/qa_deck.py +6 -6
- package/plugin/skills/lit-pptx/scripts/render_pages.py +31 -0
- package/plugin/skills/lit-pptx/scripts/validate_pptx.py +1 -1
- package/plugin/skills/lit-pptx/specs/markdown-slide-spec-v1.md +167 -191
- package/plugin/skills/lit-pptx/specs/markdown-slide-spec-v2.md +117 -166
- package/plugin/skills/lit-pptx/specs/template-enrollment-contract.md +307 -330
- package/plugin/skills/lit-pptx/templates/tonalities/atlas/pack.yaml +1 -1
- package/plugin/skills/lit-pptx/templates/tonalities/bauhaus/pack.yaml +98 -0
- package/plugin/skills/lit-pptx/templates/tonalities/chalk/pack.yaml +1 -1
- package/plugin/skills/lit-pptx/templates/tonalities/computational-brutalism/pack.yaml +99 -0
- package/plugin/skills/lit-pptx/templates/tonalities/gazette/pack.yaml +1 -1
- package/plugin/skills/lit-pptx/templates/tonalities/ledger/pack.yaml +1 -1
- package/plugin/skills/lit-pptx/templates/tonalities/neo-brutalism/pack.yaml +107 -0
- package/plugin/skills/lit-pptx/templates/tonalities/newsroom/pack.yaml +99 -0
- package/plugin/skills/lit-pptx/templates/tonalities/night/pack.yaml +1 -1
- package/plugin/skills/lit-pptx/templates/tonalities/paper/pack.yaml +1 -1
- package/plugin/skills/lit-pptx/templates/tonalities/riso/pack.yaml +99 -0
- package/plugin/skills/lit-pptx/templates/tonalities/signal/pack.yaml +2 -2
- package/plugin/skills/lit-pptx/templates/tonalities/studio/pack.yaml +1 -1
- package/plugin/skills/lit-schematic/SKILL.md +114 -0
- package/plugin/skills/lit-schematic/examples/iso-heat-exchanger/build.mjs +38 -0
- package/plugin/skills/lit-schematic/examples/iso-heat-exchanger/scene.mjs +133 -0
- package/plugin/skills/lit-schematic/examples/journal-adsorption-rig/build.mjs +87 -0
- package/plugin/skills/lit-schematic/examples/pid-dosing-skid/build.mjs +85 -0
- package/plugin/skills/lit-schematic/references/cutaway-outputs.md +70 -0
- package/plugin/skills/lit-schematic/references/isometric-craft.md +101 -0
- package/plugin/skills/lit-schematic/references/journal-figures.md +72 -0
- package/plugin/skills/lit-schematic/references/kit-api.md +134 -0
- package/plugin/skills/lit-schematic/references/pfd-and-layout.md +53 -0
- package/plugin/skills/lit-schematic/references/pid-drafting.md +103 -0
- package/plugin/skills/lit-schematic/references/pid-symbols.md +163 -0
- package/plugin/skills/lit-schematic/references/verification.md +100 -0
- package/plugin/skills/lit-schematic/scripts/doctor.mjs +57 -0
- package/plugin/skills/lit-schematic/scripts/lib/figure.mjs +81 -0
- package/plugin/skills/lit-schematic/scripts/lib/fonts.mjs +27 -0
- package/plugin/skills/lit-schematic/scripts/lib/geom.mjs +113 -0
- package/plugin/skills/lit-schematic/scripts/lib/interactive.mjs +292 -0
- package/plugin/skills/lit-schematic/scripts/lib/isa.mjs +115 -0
- package/plugin/skills/lit-schematic/scripts/lib/iso.mjs +719 -0
- package/plugin/skills/lit-schematic/scripts/lib/legend-sheet.mjs +162 -0
- package/plugin/skills/lit-schematic/scripts/lib/pid.mjs +937 -0
- package/plugin/skills/lit-schematic/scripts/lib/png.mjs +132 -0
- package/plugin/skills/lit-schematic/scripts/lib/qa-core.mjs +658 -0
- package/plugin/skills/lit-schematic/scripts/lib/route.mjs +218 -0
- package/plugin/skills/lit-schematic/scripts/lib/sheet.mjs +890 -0
- package/plugin/skills/lit-schematic/scripts/lib/svg.mjs +82 -0
- package/plugin/skills/lit-schematic/scripts/lib/theme.mjs +115 -0
- package/plugin/skills/lit-schematic/scripts/motion.mjs +129 -0
- package/plugin/skills/lit-schematic/scripts/qa.mjs +92 -0
- package/plugin/skills/lit-schematic/scripts/render.mjs +233 -0
- package/plugin/skills/lit-schematic/scripts/scaffold.mjs +60 -0
- package/plugin/skills/lit-scientific-visualization/SKILL.md +17 -6
- package/plugin/skills/lit-typographic-motion/SKILL.md +58 -48
- package/plugin/skills/lit-typographic-motion/engine/THIRD_PARTY_NOTICES +13 -2
- package/plugin/skills/lit-typographic-motion/engine/blender/runner.py +218 -0
- package/plugin/skills/lit-typographic-motion/engine/core/presets.mjs +1 -1
- package/plugin/skills/lit-typographic-motion/engine/node/analysis.mjs +65 -1
- package/plugin/skills/lit-typographic-motion/engine/node/assets.mjs +298 -0
- package/plugin/skills/lit-typographic-motion/engine/node/blender.mjs +143 -0
- package/plugin/skills/lit-typographic-motion/engine/node/board.mjs +136 -0
- package/plugin/skills/lit-typographic-motion/engine/node/brief.mjs +7 -1
- package/plugin/skills/lit-typographic-motion/engine/node/chrome.mjs +9 -12
- package/plugin/skills/lit-typographic-motion/engine/node/cover-assets.mjs +5 -3
- package/plugin/skills/lit-typographic-motion/engine/node/cover-capture.mjs +7 -6
- package/plugin/skills/lit-typographic-motion/engine/node/cover-treatment.mjs +37 -4
- package/plugin/skills/lit-typographic-motion/engine/node/cover.mjs +19 -8
- package/plugin/skills/lit-typographic-motion/engine/node/done.mjs +45 -6
- package/plugin/skills/lit-typographic-motion/engine/node/frame-worker.mjs +7 -5
- package/plugin/skills/lit-typographic-motion/engine/node/gallery.mjs +121 -0
- package/plugin/skills/lit-typographic-motion/engine/node/host.mjs +34 -0
- package/plugin/skills/lit-typographic-motion/engine/node/house.mjs +44 -0
- package/plugin/skills/lit-typographic-motion/engine/node/look.mjs +34 -20
- package/plugin/skills/lit-typographic-motion/engine/node/pipeline.mjs +19 -9
- package/plugin/skills/lit-typographic-motion/engine/node/scaffold.mjs +210 -0
- package/plugin/skills/lit-typographic-motion/engine/node/score.mjs +639 -0
- package/plugin/skills/lit-typographic-motion/engine/node/sound-cli.mjs +21 -4
- package/plugin/skills/lit-typographic-motion/engine/node/sound.mjs +127 -29
- package/plugin/skills/lit-typographic-motion/engine/node/stage-capture.mjs +7 -6
- package/plugin/skills/lit-typographic-motion/engine/node/stage-gate.mjs +59 -5
- package/plugin/skills/lit-typographic-motion/engine/node/stage-qa.mjs +141 -9
- package/plugin/skills/lit-typographic-motion/engine/node/stage-serve.mjs +28 -5
- package/plugin/skills/lit-typographic-motion/engine/node/stage.mjs +82 -14
- package/plugin/skills/lit-typographic-motion/engine/node/styles.mjs +213 -0
- package/plugin/skills/lit-typographic-motion/engine/node/treatment.mjs +311 -10
- package/plugin/skills/lit-typographic-motion/engine/stage/cover-init.js +14 -2
- package/plugin/skills/lit-typographic-motion/engine/stage/init.js +11 -1
- package/plugin/skills/lit-typographic-motion/engine/stage/qa.js +6 -1
- package/plugin/skills/lit-typographic-motion/engine/stage/stage-kit.js +83 -0
- package/plugin/skills/lit-typographic-motion/engine/vendor/three/LICENSE +21 -0
- package/plugin/skills/lit-typographic-motion/engine/vendor/three/addons/environments/RoomEnvironment.js +144 -0
- package/plugin/skills/lit-typographic-motion/engine/vendor/three/addons/geometries/RoundedBoxGeometry.js +155 -0
- package/plugin/skills/lit-typographic-motion/engine/vendor/three/three.module.js +54571 -0
- package/plugin/skills/lit-typographic-motion/recipes/hero-3d/expected.json +69 -0
- package/plugin/skills/lit-typographic-motion/recipes/hero-3d/index.html +139 -0
- package/plugin/skills/lit-typographic-motion/recipes/orbit-loop/expected.json +6 -4
- package/plugin/skills/lit-typographic-motion/recipes/painted-light/expected.json +4 -2
- package/plugin/skills/lit-typographic-motion/recipes/weight-tide/expected.json +7 -5
- package/plugin/skills/lit-typographic-motion/references/cover.md +394 -443
- package/plugin/skills/lit-typographic-motion/references/craft-loop.md +57 -87
- package/plugin/skills/lit-typographic-motion/references/depth.md +122 -0
- package/plugin/skills/lit-typographic-motion/references/look.md +94 -129
- package/plugin/skills/lit-typographic-motion/references/runtime.md +58 -91
- package/plugin/skills/lit-typographic-motion/references/sound.md +130 -99
- package/plugin/skills/lit-typographic-motion/references/stage.md +190 -215
- package/plugin/skills/lit-typographic-motion/references/studio.md +245 -0
- package/plugin/skills/lit-typographic-motion/references/style-bibles.md +108 -97
- package/plugin/skills/lit-typographic-motion/references/treatment.md +191 -143
- package/plugin/skills/lit-typographic-motion/scripts/motion-doctor.mjs +17 -5
- package/plugin/skills/lit-typographic-motion/scripts/motion.mjs +47 -7
- package/plugin/skills/lit-typographic-motion/styles/paper.json +41 -0
- package/plugin/skills/lit-typographic-motion/styles/swiss-signal.json +41 -0
- package/plugin/skills/lit-typographic-motion/styles/terminalcore.json +42 -0
- package/plugin/skills/lit-typographic-motion/styles/tidal.json +41 -0
- package/plugin/skills/litresearch/SKILL.md +1 -0
- package/plugin/skills/readme-studio/SKILL.md +2 -0
- package/plugin/skills/readme-studio/templates/hyperframes-cover/package-lock.json +3 -3
- package/plugin/skills/readme-studio/templates/remotion-cover/package-lock.json +3 -3
- package/plugin/skills/review-work/SKILL.md +1 -1
- package/plugin/skills/start-work/SKILL.md +1 -1
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* slide-grid.js — where things sit on a slide, the same for every tonality.
|
|
5
|
+
*
|
|
6
|
+
* One column grid per canvas and one set of zones per slide kind. A tonality changes how a zone
|
|
7
|
+
* looks (face, weight, size, colour, rules, fills, ornaments), never where it is: every title,
|
|
8
|
+
* header, body and footer of a deck lands on the coordinates below whichever pack draws it, so two
|
|
9
|
+
* tonalities of one source differ in look and never in placement. The density dial sets type and
|
|
10
|
+
* spacing inside the zones; it no longer moves the margins. Values are points on the 960 x 540
|
|
11
|
+
* (16:9) or 720 x 540 (4:3) canvas; `emu()` gives the same box in EMU (12,700 per point).
|
|
12
|
+
*
|
|
13
|
+
* Content slides
|
|
14
|
+
* header the band over the title: grid marks, the slide index, a kicker label
|
|
15
|
+
* title the title frame of every treatment (top-rule, band, top-plain-large, kicker-numeral,
|
|
16
|
+
* side-rail, bottom-anchor); a treatment styles it and never moves it
|
|
17
|
+
* aside right of the title: the kicker numeral
|
|
18
|
+
* body everything the slide says, from the first block to the floor
|
|
19
|
+
* footer the sample-data tag and the source line's foot
|
|
20
|
+
* Display slides (statement, quote, section, closing statement)
|
|
21
|
+
* header the part number or kicker over the sentence
|
|
22
|
+
* title the sentence, centred in its frame
|
|
23
|
+
* support the line under it (the quote's speaker, what the part opens with)
|
|
24
|
+
* side the columns right of the sentence, bled to the page edge (a composition, a rail)
|
|
25
|
+
* Covers
|
|
26
|
+
* header the meta line (date, team, presenter)
|
|
27
|
+
* title the deck title, standing on the frame's foot
|
|
28
|
+
* subtitle the line under the title
|
|
29
|
+
* strip the headline figures or the parts, across the page above the footer
|
|
30
|
+
* side the columns right of the title, bled to the page edge (a field, a picture, a numeral)
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
const CANVAS = { "16:9": { W: 960, H: 540 }, "4:3": { W: 720, H: 540 } };
|
|
34
|
+
|
|
35
|
+
// Side margin, column width and gutter: 12 columns and 11 gutters that sum exactly to the width.
|
|
36
|
+
const COLUMNS = { "16:9": { margin: 24, col: 54, gutter: 24 }, "4:3": { margin: 24, col: 45, gutter: 12 } };
|
|
37
|
+
|
|
38
|
+
const FOOTER = { cols: [1, 12], y: 498, h: 18 };
|
|
39
|
+
|
|
40
|
+
const ZONES = {
|
|
41
|
+
content: {
|
|
42
|
+
header: { cols: [1, 12], y: 12, h: 18 },
|
|
43
|
+
title: { cols: [1, 10], y: 36, h: 72 },
|
|
44
|
+
aside: { cols: [11, 12], y: 36, h: 72 },
|
|
45
|
+
body: { cols: [1, 12], y: 120, h: 366 },
|
|
46
|
+
footer: FOOTER,
|
|
47
|
+
},
|
|
48
|
+
display: {
|
|
49
|
+
header: { cols: [1, 9], y: 84, h: 36 },
|
|
50
|
+
title: { cols: [1, 9], y: 132, h: 216 },
|
|
51
|
+
support: { cols: [1, 8], y: 372, h: 114 },
|
|
52
|
+
side: { cols: [10, 12], y: 0, h: 540, bleed: true },
|
|
53
|
+
footer: FOOTER,
|
|
54
|
+
},
|
|
55
|
+
cover: {
|
|
56
|
+
header: { cols: [1, 8], y: 36, h: 24 },
|
|
57
|
+
title: { cols: [1, 9], y: 144, h: 168 },
|
|
58
|
+
subtitle: { cols: [1, 8], y: 324, h: 72 },
|
|
59
|
+
strip: { cols: [1, 12], y: 414, h: 66 },
|
|
60
|
+
side: { cols: [10, 12], y: 0, h: 540, bleed: true },
|
|
61
|
+
footer: FOOTER,
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
function columns(canvas) {
|
|
66
|
+
const c = COLUMNS[canvas];
|
|
67
|
+
if (!c) throw new Error(`unknown canvas "${canvas}"; canvases: ${Object.keys(COLUMNS).join(", ")}`);
|
|
68
|
+
return c;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** Columns a…b (1-based, inclusive) as x and width in points. */
|
|
72
|
+
function span(canvas, a, b) {
|
|
73
|
+
const c = columns(canvas);
|
|
74
|
+
const pitch = c.col + c.gutter;
|
|
75
|
+
return { x: c.margin + pitch * (a - 1), w: pitch * (b - a + 1) - c.gutter };
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* One zone as a box in points. A bled zone starts half a gutter left of its first column and runs
|
|
80
|
+
* to the page's right edge, so what fills it meets the edge and keeps the gutter from the text.
|
|
81
|
+
*/
|
|
82
|
+
function zone(canvas, kind, name) {
|
|
83
|
+
const spec = (ZONES[kind] || {})[name];
|
|
84
|
+
if (!spec) throw new Error(`no ${name} zone on a ${kind} slide`);
|
|
85
|
+
const s = span(canvas, spec.cols[0], spec.cols[1]);
|
|
86
|
+
if (spec.bleed) {
|
|
87
|
+
const x = s.x - columns(canvas).gutter / 2;
|
|
88
|
+
return { x, y: spec.y, w: CANVAS[canvas].W - x, h: spec.h, a: spec.cols[0], b: spec.cols[1] };
|
|
89
|
+
}
|
|
90
|
+
return { x: s.x, y: spec.y, w: s.w, h: spec.h, a: spec.cols[0], b: spec.cols[1] };
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** Every zone of every slide kind on a canvas, in points. */
|
|
94
|
+
function zones(canvas) {
|
|
95
|
+
return Object.fromEntries(Object.entries(ZONES).map(([kind, set]) => [kind, Object.fromEntries(Object.keys(set).map((name) => [name, zone(canvas, kind, name)]))]));
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/** A box in points as EMU, the unit a .pptx file stores. */
|
|
99
|
+
function emu(box) {
|
|
100
|
+
const e = (v) => Math.round(v * 12700);
|
|
101
|
+
return { x: e(box.x), y: e(box.y), w: e(box.w), h: e(box.h) };
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
module.exports = { CANVAS, COLUMNS, ZONES, span, zone, zones, emu };
|
|
@@ -428,19 +428,29 @@ const FACES = {
|
|
|
428
428
|
"A2Z Medium": { font: "에이투지체 5 Medium", bold: false },
|
|
429
429
|
"A2Z Bold": { font: "에이투지체 7 Bold", bold: false },
|
|
430
430
|
"A2Z Black": { font: "에이투지체 9 Black", bold: false },
|
|
431
|
+
// A Latin-only face: Hangul and other East Asian text in its runs is set in Pretendard.
|
|
432
|
+
"JetBrains Mono Regular": { font: "JetBrains Mono", bold: false, ea: "Pretendard" },
|
|
433
|
+
"JetBrains Mono Bold": { font: "JetBrains Mono", bold: true, ea: "Pretendard" },
|
|
431
434
|
};
|
|
432
|
-
const DECORATIONS = ["accent-rule", "hairline-rule", "header-band", "rail-fill", "colour-field", "caption-band", "column-hairlines", "box-outline", "mark-underline", "numeral"];
|
|
435
|
+
const DECORATIONS = ["accent-rule", "hairline-rule", "header-band", "rail-fill", "colour-field", "caption-band", "column-hairlines", "box-outline", "mark-underline", "numeral", "grid-marks"];
|
|
433
436
|
const SLIDE_ROLES = ["content", "data", "data-takeaway", "sequence", "image", "statement", "reference", "definition"];
|
|
434
437
|
const FILL_POLICIES = ["distribute", "step-up", "anchor-visual", "change-family"];
|
|
435
438
|
// How a pack carries its display slides: the device on a type-led cover, around a statement,
|
|
436
439
|
// behind a big number and under a closing's next step (`display.index` adds the part index to
|
|
437
440
|
// section slides).
|
|
438
441
|
const DISPLAY_DEVICES = {
|
|
439
|
-
cover: ["plain", "drench", "plate", "rail", "band", "figures", "rules", "numeral"],
|
|
440
|
-
statement: ["open", "drench", "rules", "plate", "offset"],
|
|
442
|
+
cover: ["plain", "drench", "plate", "rail", "band", "figures", "rules", "numeral", "geometry"],
|
|
443
|
+
statement: ["open", "drench", "rules", "plate", "offset", "geometry"],
|
|
441
444
|
number: ["field", "tint", "outline"],
|
|
442
445
|
closing: ["band", "box", "rules"],
|
|
443
446
|
};
|
|
447
|
+
// Allowances a pack may claim from the gate, each a bounded value (see craft_extras.py). The accent
|
|
448
|
+
// limits only widen: four hue families pass every slide by default, so a pack may allow five or six.
|
|
449
|
+
const QA_ALLOWANCES = {
|
|
450
|
+
"accent-families": (v) => Number.isInteger(v) && v >= 5 && v <= 6,
|
|
451
|
+
"display-accent-families": (v) => Number.isInteger(v) && v >= 5 && v <= 6,
|
|
452
|
+
"offset-shadow": (v) => typeof v === "boolean",
|
|
453
|
+
};
|
|
444
454
|
// Contrast pairs every pack must meet (text pairs 4.5:1, large marks 3:1).
|
|
445
455
|
const CONTRAST_PAIRS = [["ink", "ground", 4.5], ["ink", "surface", 4.5], ["ink-muted", "ground", 4.5], ["ink-muted", "surface", 4.5],
|
|
446
456
|
["accent", "ground", 3.0], ["accent-deep", "accent-tint", 4.5], ["ink", "accent-tint", 4.5], ["on-field", "field", 4.5],
|
|
@@ -473,9 +483,12 @@ function validatePack(pack, file) {
|
|
|
473
483
|
for (const key of ["faces", "faces-a2z"]) {
|
|
474
484
|
if (key === "faces-a2z" && pack[key] == null) continue;
|
|
475
485
|
const faces = pack[key] || {};
|
|
486
|
+
// A Latin-only face may set the display roles; body text always stays in a Korean face.
|
|
476
487
|
for (const role of FACE_KEYS) {
|
|
477
|
-
|
|
488
|
+
const own = key === "faces-a2z" || /^Pretendard /u.test(faces[role]) || (role !== "body" && FACES[faces[role]] && FACES[faces[role]].ea);
|
|
489
|
+
need(FACES[faces[role]] && own, `${key}.${role} must name a bundled face${key === "faces-a2z" ? "" : role === "body" ? " (Pretendard Regular or Bold)" : " (Pretendard Regular or Bold, or JetBrains Mono Regular or Bold)"}`);
|
|
478
490
|
}
|
|
491
|
+
need(!(FACES[faces.body] && FACES[faces.body].ea), `${key}.body must be a face that sets Hangul`);
|
|
479
492
|
const distinct = new Set(FACE_KEYS.map((r) => faces[r]));
|
|
480
493
|
need(distinct.size <= 3, `${key} uses ${distinct.size} faces; at most 3`);
|
|
481
494
|
need(new Set([...distinct].map((f) => String(f).split(" ")[0])).size <= 2, `${key} mixes more than two families`);
|
|
@@ -497,10 +510,32 @@ function validatePack(pack, file) {
|
|
|
497
510
|
}
|
|
498
511
|
need(["presented", "reading"].includes(pack.ramp), "ramp must be presented or reading");
|
|
499
512
|
need(typeof pack.hero === "boolean", "hero must be true or false");
|
|
513
|
+
// A report pack reads at its density step; a bold pack (a pitch, a launch, a campaign) may set presented type.
|
|
514
|
+
// Any pack may take the hero step on its cover and statements. Either way the words stay in the slide grid's
|
|
515
|
+
// zones: the register and the hero step change size, never place.
|
|
516
|
+
const register = pack.register == null ? "report" : pack.register;
|
|
517
|
+
need(["report", "bold"].includes(register), "register must be report or bold");
|
|
518
|
+
need(register === "bold" || pack.ramp === "reading", "presented type needs register: bold; a report pack keeps ramp: reading");
|
|
500
519
|
need(Number.isInteger(pack.density) && pack.density >= 1 && pack.density <= 10, "density must be an integer 1-10");
|
|
501
520
|
need(Number.isInteger(pack.variance) && pack.variance >= 4 && pack.variance <= 10, "variance must be an integer 4-10");
|
|
502
521
|
need(pack.radius === 0 || pack.radius === 6, "radius must be 0 or 6");
|
|
503
522
|
need(["border", "fill", "fill+border"].includes(pack.edge), "edge must be border, fill or fill+border");
|
|
523
|
+
// A heavier border and a hard offset shadow (zero blur) under surfaces; the shadow needs the border.
|
|
524
|
+
const weight = pack["edge-weight"];
|
|
525
|
+
need(weight == null || (typeof weight === "number" && weight >= 0.5 && weight <= 4), "edge-weight must be 0.5-4 pt");
|
|
526
|
+
const shadow = pack.shadow;
|
|
527
|
+
if (shadow != null) {
|
|
528
|
+
need(typeof shadow === "object" && typeof shadow.offset === "number" && shadow.offset >= 3 && shadow.offset <= 10, "shadow.offset must be 3-10 pt");
|
|
529
|
+
need(shadow && PALETTE_ROLES.includes(shadow.colour), "shadow.colour must name a palette role");
|
|
530
|
+
need(pack.edge !== "fill", "a shadow needs a bordered edge (border or fill+border)");
|
|
531
|
+
}
|
|
532
|
+
need(pack["edge-colour"] == null || PALETTE_ROLES.includes(pack["edge-colour"]), "edge-colour must name a palette role");
|
|
533
|
+
// What the gate allows this pack beyond the default craft floor (read by craft_extras.py).
|
|
534
|
+
const qa = pack.qa || {};
|
|
535
|
+
need(typeof qa === "object" && !Array.isArray(qa), "qa must be a map");
|
|
536
|
+
for (const k of Object.keys(qa)) need(QA_ALLOWANCES[k], `unknown qa allowance "${k}" (known: ${Object.keys(QA_ALLOWANCES).join(", ")})`);
|
|
537
|
+
for (const [k, ok] of Object.entries(QA_ALLOWANCES)) if (qa[k] != null) need(ok(qa[k]), `qa.${k} is out of range`);
|
|
538
|
+
need(!qa["offset-shadow"] || shadow != null, "qa.offset-shadow needs a shadow");
|
|
504
539
|
const treatments = isList(pack.treatments) ? pack.treatments : [];
|
|
505
540
|
need(treatments.length >= 3 && treatments.length <= 5, "treatments must list 3-5 title treatments");
|
|
506
541
|
for (const t of treatments) need(grid.TREATMENTS.includes(t), `unknown treatment "${t}" (known: ${grid.TREATMENTS.join(", ")})`);
|
|
@@ -514,6 +549,10 @@ function validatePack(pack, file) {
|
|
|
514
549
|
need(treatments.includes(t) && grid.FAMILIES[f] && grid.FAMILIES[f].allow.includes(t), `structure.${f} must be a treatment of the pack that the family allows`);
|
|
515
550
|
}
|
|
516
551
|
for (const d of pack.decoration || []) need(DECORATIONS.includes(d), `unknown decoration "${d}"`);
|
|
552
|
+
// Grid marks sit in the top margin on the ground: a band or a filled rail there would cover them.
|
|
553
|
+
if ((pack.decoration || []).includes("grid-marks")) {
|
|
554
|
+
need(!treatments.includes("band") && !(pack.decoration || []).includes("rail-fill"), "grid-marks needs the top margin on the ground (no band treatment, no rail-fill)");
|
|
555
|
+
}
|
|
517
556
|
need(pack.rail == null || ["surface", "field"].includes(pack.rail), "rail must be surface or field");
|
|
518
557
|
const display = pack.display || {};
|
|
519
558
|
need(typeof display === "object" && !Array.isArray(display), "display must be a map");
|
|
@@ -634,12 +673,22 @@ function loadTonality(id, options = {}) {
|
|
|
634
673
|
if (!pack.canvas.includes(canvas)) {
|
|
635
674
|
throw new Error(`Tonality "${pack.id}" supports ${pack.canvas.join(", ")}, not canvas ${canvas}`);
|
|
636
675
|
}
|
|
637
|
-
|
|
638
|
-
const
|
|
676
|
+
// Only a bold register sets presented type; a report pack reads at its density step.
|
|
677
|
+
const tok = grid.densityTokens(density, pack.register === "bold" ? pack.ramp : "reading");
|
|
678
|
+
const g = grid.makeGrid(canvas);
|
|
639
679
|
// Pretendard by default; the A2Z map only when the source asks for it (`faces: a2z`).
|
|
640
680
|
const wantsA2z = String(options.faces || "").toLowerCase() === "a2z" && pack["faces-a2z"];
|
|
641
681
|
const faceMap = wantsA2z ? pack["faces-a2z"] : pack.faces;
|
|
642
682
|
const faces = Object.fromEntries(FACE_KEYS.map((role) => [role, FACES[faceMap[role]]]));
|
|
683
|
+
// The deck may add decoration kinds to the pack's own list and turn the hero step off (`hero: false`,
|
|
684
|
+
// the calm opt-out); both arrive as front-matter strings.
|
|
685
|
+
const extra = String(options.decoration || "").split(",").map((d) => d.trim()).filter(Boolean);
|
|
686
|
+
for (const d of extra) if (!DECORATIONS.includes(d)) throw new Error(`decoration "${d}" is not a known kind (${DECORATIONS.join(", ")})`);
|
|
687
|
+
const decoration = [...new Set([...(pack.decoration || []), ...extra])];
|
|
688
|
+
if (decoration.includes("grid-marks") && (pack.treatments.includes("band") || decoration.includes("rail-fill"))) {
|
|
689
|
+
throw new Error(`grid-marks needs the top margin on the ground (no band treatment, no rail-fill); tonality "${pack.id}" has one`);
|
|
690
|
+
}
|
|
691
|
+
const hero = String(options.hero).toLowerCase() === "false" || options.hero === false ? false : pack.hero;
|
|
643
692
|
const P = pack.palette;
|
|
644
693
|
const template = {
|
|
645
694
|
name: pack.name,
|
|
@@ -662,6 +711,8 @@ function loadTonality(id, options = {}) {
|
|
|
662
711
|
capabilities: { font_roles: {} },
|
|
663
712
|
pack: {
|
|
664
713
|
...pack,
|
|
714
|
+
decoration,
|
|
715
|
+
hero,
|
|
665
716
|
legacy: false,
|
|
666
717
|
capabilities: [],
|
|
667
718
|
faces,
|
|
@@ -14,11 +14,11 @@ exits non-zero if ANY real defect is found:
|
|
|
14
14
|
foreign-language source lines on a Korean deck)
|
|
15
15
|
6. Craft floor — craft_extras.py (OF-101..OF-109 per slide; OF-110..OF-113
|
|
16
16
|
over the deck: title-treatment count, composition variety,
|
|
17
|
-
empty bottom band, one
|
|
17
|
+
empty bottom band, one shared title frame; OF-114
|
|
18
18
|
titles and the cover subtitle as labels, not sentences;
|
|
19
19
|
OF-115 no empty region; OF-117 no light figure card on a
|
|
20
20
|
dark ground; OF-116 with --sibling: another tonality of
|
|
21
|
-
the same source
|
|
21
|
+
the same source sets titles and body in the same places)
|
|
22
22
|
|
|
23
23
|
No LibreOffice / rendering engine required: everything is read from the OOXML
|
|
24
24
|
via python-pptx. (A renderer is only ever needed for the *visual* pass, which
|
|
@@ -31,7 +31,7 @@ import os as _os
|
|
|
31
31
|
import sys as _sys
|
|
32
32
|
|
|
33
33
|
_sys.dont_write_bytecode = True # the installed skill directory stays read-only
|
|
34
|
-
_sys.path.insert(0, _os.path.dirname(_os.path.abspath(__file__)))
|
|
34
|
+
_sys.path.insert(0, _os.path.join(_os.path.dirname(_os.path.abspath(__file__)), "..", "..", "..", "lib"))
|
|
35
35
|
from office_runtime_bootstrap import ensure_runtime # noqa: E402
|
|
36
36
|
|
|
37
37
|
ensure_runtime(["pptx"])
|
|
@@ -691,14 +691,14 @@ def run_validate(pptx: Path) -> dict[str, Any]:
|
|
|
691
691
|
def qa(pptx: Path, sibling: Path | None = None) -> dict[str, Any]:
|
|
692
692
|
from ooxml_integrity import check_package
|
|
693
693
|
from deck_craft import analyse as analyse_craft
|
|
694
|
-
from craft_extras import analyse as analyse_extras,
|
|
694
|
+
from craft_extras import analyse as analyse_extras, compare_placement
|
|
695
695
|
|
|
696
696
|
integrity = check_package(pptx)
|
|
697
697
|
craft = analyse_craft(pptx)
|
|
698
698
|
extras = analyse_extras(pptx)
|
|
699
|
-
# Another tonality of the same source, when given: the two must
|
|
699
|
+
# Another tonality of the same source, when given: the two must place titles and body alike (OF-116).
|
|
700
700
|
if sibling is not None:
|
|
701
|
-
extras["findings"] +=
|
|
701
|
+
extras["findings"] += compare_placement(pptx, sibling)
|
|
702
702
|
validate_report = run_validate(pptx)
|
|
703
703
|
inv_summary = summarize_inventory(load_inventory_issues(pptx))
|
|
704
704
|
contrast = check_contrast(pptx)
|
|
@@ -22,6 +22,7 @@ import shutil
|
|
|
22
22
|
import subprocess
|
|
23
23
|
import sys
|
|
24
24
|
import tempfile
|
|
25
|
+
import zipfile
|
|
25
26
|
from pathlib import Path
|
|
26
27
|
|
|
27
28
|
|
|
@@ -35,6 +36,35 @@ def _windows_soffice() -> str | None:
|
|
|
35
36
|
return None
|
|
36
37
|
|
|
37
38
|
|
|
39
|
+
def profile_fonts(source: Path, profile: Path) -> list[Path]:
|
|
40
|
+
"""LibreOffice ignores fonts embedded in a .pptx, so copy each embedded part into the private
|
|
41
|
+
profile's font folder before converting. OpenType and TrueType parts are kept; any other part
|
|
42
|
+
(EOT, obfuscated) is skipped."""
|
|
43
|
+
if source.suffix.lower() != ".pptx":
|
|
44
|
+
return []
|
|
45
|
+
target = profile / "user" / "fonts"
|
|
46
|
+
written = []
|
|
47
|
+
try:
|
|
48
|
+
with zipfile.ZipFile(source) as package:
|
|
49
|
+
for name in package.namelist():
|
|
50
|
+
if not (name.startswith("ppt/fonts/") and name.endswith(".fntdata")):
|
|
51
|
+
continue
|
|
52
|
+
data = package.read(name)
|
|
53
|
+
if data[:4] == b"OTTO":
|
|
54
|
+
ext = ".otf"
|
|
55
|
+
elif data[:4] in (b"\x00\x01\x00\x00", b"true"):
|
|
56
|
+
ext = ".ttf"
|
|
57
|
+
else:
|
|
58
|
+
continue
|
|
59
|
+
target.mkdir(parents=True, exist_ok=True)
|
|
60
|
+
path = target / f"{Path(name).stem}{ext}"
|
|
61
|
+
path.write_bytes(data)
|
|
62
|
+
written.append(path)
|
|
63
|
+
except zipfile.BadZipFile:
|
|
64
|
+
return []
|
|
65
|
+
return written
|
|
66
|
+
|
|
67
|
+
|
|
38
68
|
def to_pdf(source: Path, out_dir: Path) -> tuple[Path | None, str]:
|
|
39
69
|
if source.suffix.lower() == ".pdf":
|
|
40
70
|
return source, "input is already PDF"
|
|
@@ -42,6 +72,7 @@ def to_pdf(source: Path, out_dir: Path) -> tuple[Path | None, str]:
|
|
|
42
72
|
if not soffice:
|
|
43
73
|
return None, "LibreOffice (soffice) is not on PATH"
|
|
44
74
|
with tempfile.TemporaryDirectory(prefix="litgravity-soffice-") as profile:
|
|
75
|
+
profile_fonts(source, Path(profile))
|
|
45
76
|
result = subprocess.run(
|
|
46
77
|
[
|
|
47
78
|
soffice,
|
|
@@ -12,7 +12,7 @@ import os as _os
|
|
|
12
12
|
import sys as _sys
|
|
13
13
|
|
|
14
14
|
_sys.dont_write_bytecode = True # the installed skill directory stays read-only
|
|
15
|
-
_sys.path.insert(0, _os.path.dirname(_os.path.abspath(__file__)))
|
|
15
|
+
_sys.path.insert(0, _os.path.join(_os.path.dirname(_os.path.abspath(__file__)), "..", "..", "..", "lib"))
|
|
16
16
|
from office_runtime_bootstrap import ensure_runtime # noqa: E402
|
|
17
17
|
|
|
18
18
|
ensure_runtime(["pptx"])
|