@thanh01.pmt/presentation-kit 0.3.5 → 0.3.6
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/dist/ai/index.cjs +8 -8
- package/dist/ai/index.js +1 -1
- package/dist/{chunk-LDWFQE4C.cjs → chunk-JRPN5PMM.cjs} +11 -8
- package/dist/chunk-JRPN5PMM.cjs.map +1 -0
- package/dist/{chunk-4JRWOBKO.cjs → chunk-OALGKQ73.cjs} +4 -4
- package/dist/{chunk-4JRWOBKO.cjs.map → chunk-OALGKQ73.cjs.map} +1 -1
- package/dist/{chunk-754Q7SHQ.js → chunk-QP7WKYFF.js} +11 -8
- package/dist/chunk-QP7WKYFF.js.map +1 -0
- package/dist/{chunk-IWJA7J7Y.js → chunk-VGB2SDTQ.js} +3 -3
- package/dist/{chunk-IWJA7J7Y.js.map → chunk-VGB2SDTQ.js.map} +1 -1
- package/dist/index.cjs +48 -48
- package/dist/index.d.cts +21 -7
- package/dist/index.d.ts +21 -7
- package/dist/index.js +3 -3
- package/dist/node/index.cjs +2 -2
- package/dist/node/index.js +1 -1
- package/dist/react/index.cjs +13 -13
- package/dist/react/index.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-754Q7SHQ.js.map +0 -1
- package/dist/chunk-LDWFQE4C.cjs.map +0 -1
package/dist/ai/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunk3Q4RMZVQ_cjs = require('../chunk-3Q4RMZVQ.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunkJRPN5PMM_cjs = require('../chunk-JRPN5PMM.cjs');
|
|
5
5
|
var chunkEAPUC5BA_cjs = require('../chunk-EAPUC5BA.cjs');
|
|
6
6
|
var zod = require('zod');
|
|
7
7
|
|
|
@@ -471,20 +471,20 @@ function validateHtmlSlideDeck(deck, strict = false) {
|
|
|
471
471
|
slides.forEach((slide, idx) => {
|
|
472
472
|
const slideNumber = idx + 1;
|
|
473
473
|
const layoutId = slide.layoutId;
|
|
474
|
-
const preset =
|
|
474
|
+
const preset = chunkJRPN5PMM_cjs.HTML_SLIDE_PRESETS[layoutId];
|
|
475
475
|
if (!preset) {
|
|
476
476
|
issues.push({
|
|
477
477
|
slideIndex: slideNumber,
|
|
478
478
|
severity: "error",
|
|
479
479
|
rule: "INVALID_LAYOUT_PRESET",
|
|
480
|
-
message: `Unknown layoutId "${slide.layoutId}". Available presets: ${Object.keys(
|
|
480
|
+
message: `Unknown layoutId "${slide.layoutId}". Available presets: ${Object.keys(chunkJRPN5PMM_cjs.HTML_SLIDE_PRESETS).join(", ")}`
|
|
481
481
|
});
|
|
482
482
|
return;
|
|
483
483
|
}
|
|
484
484
|
if (preset.category === "cover" && idx === 0) hasCover = true;
|
|
485
485
|
if (preset.id === "checkpoint-quiz") hasQuiz = true;
|
|
486
486
|
if (preset.id === "summary-takeaways") hasSummary = true;
|
|
487
|
-
const slots =
|
|
487
|
+
const slots = chunkJRPN5PMM_cjs.normalizeSlideSlots(slide);
|
|
488
488
|
for (const slotDef of preset.slots) {
|
|
489
489
|
if (slotDef.required) {
|
|
490
490
|
const val = slots[slotDef.name];
|
|
@@ -775,7 +775,7 @@ var createHtmlSlideSchema = zod.z.object({
|
|
|
775
775
|
// src/ai/html/tools.ts
|
|
776
776
|
function handleListHtmlSlidePresets(input) {
|
|
777
777
|
const category = input.category || "all";
|
|
778
|
-
const presets = Object.values(
|
|
778
|
+
const presets = Object.values(chunkJRPN5PMM_cjs.HTML_SLIDE_PRESETS).filter((p) => category === "all" || p.category === category).map((p) => ({
|
|
779
779
|
id: p.id,
|
|
780
780
|
name: p.name,
|
|
781
781
|
category: p.category,
|
|
@@ -791,12 +791,12 @@ function handleListHtmlSlidePresets(input) {
|
|
|
791
791
|
return {
|
|
792
792
|
success: true,
|
|
793
793
|
presets,
|
|
794
|
-
availableThemes: Object.keys(
|
|
794
|
+
availableThemes: Object.keys(chunkJRPN5PMM_cjs.HTML_THEMES)
|
|
795
795
|
};
|
|
796
796
|
}
|
|
797
797
|
function handleGenerateHtmlDeck(input) {
|
|
798
798
|
try {
|
|
799
|
-
const result =
|
|
799
|
+
const result = chunkJRPN5PMM_cjs.compileHtmlDeck(input);
|
|
800
800
|
return {
|
|
801
801
|
success: true,
|
|
802
802
|
title: result.title,
|
|
@@ -812,7 +812,7 @@ function handleGenerateHtmlDeck(input) {
|
|
|
812
812
|
}
|
|
813
813
|
}
|
|
814
814
|
function handleCreateHtmlSlide(input) {
|
|
815
|
-
const preset =
|
|
815
|
+
const preset = chunkJRPN5PMM_cjs.HTML_SLIDE_PRESETS[input.layoutId];
|
|
816
816
|
if (!preset) {
|
|
817
817
|
return {
|
|
818
818
|
success: false,
|
package/dist/ai/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SLIDE_LAYOUT_PRESETS, getSlideLayoutPresetsByCategory, getSlideLayoutPresetById, serializeLayoutToComment, updateSlideLayoutInMarkdown, splitMarkdownSlides } from '../chunk-V6X7D44H.js';
|
|
2
|
-
import { HTML_SLIDE_PRESETS, normalizeSlideSlots, HTML_THEMES, compileHtmlDeck } from '../chunk-
|
|
2
|
+
import { HTML_SLIDE_PRESETS, normalizeSlideSlots, HTML_THEMES, compileHtmlDeck } from '../chunk-QP7WKYFF.js';
|
|
3
3
|
export { FRONTEND_SLIDES_CORE_RULES, SLIDE_HTML_PROMPT_CONTRACT, STYLE_PRESETS, TEMPLATES_CATALOG, VIEWPORT_BASE_CSS, frontendSlidesTools, getFrontendSlidesSkillPrompt, getSlideStylePresetSchema, getStylePreset, getStylePresetById, getTemplatesCatalog, querySlideTemplatesSchema, searchTemplates } from '../chunk-WNPKREEW.js';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
|
|
@@ -3050,7 +3050,8 @@ function validateBespokeSlideHtml(raw, contract = {}) {
|
|
|
3050
3050
|
const minChars = contract.minChars ?? 120;
|
|
3051
3051
|
const issues = [];
|
|
3052
3052
|
const html = String(raw ?? "").trim();
|
|
3053
|
-
if (!html)
|
|
3053
|
+
if (!html)
|
|
3054
|
+
return { valid: false, issues: ["slide html is empty"], hardIssues: ["slide html is empty"], compositionIssues: [] };
|
|
3054
3055
|
if (html.length > maxChars) issues.push(`slide html exceeds ${maxChars} chars (${html.length})`);
|
|
3055
3056
|
if (html.replace(/<[^>]*>/g, "").replace(/\s+/g, "").length < minChars) {
|
|
3056
3057
|
issues.push("slide has too little text content to teach anything");
|
|
@@ -3106,11 +3107,13 @@ function validateBespokeSlideHtml(raw, contract = {}) {
|
|
|
3106
3107
|
);
|
|
3107
3108
|
break;
|
|
3108
3109
|
}
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3110
|
+
const hardIssues = issues.filter((i) => !isCompositionLint(i));
|
|
3111
|
+
const compositionIssues = issues.filter(isCompositionLint);
|
|
3112
|
+
const compositionOnly = compositionIssues.length > 0 && hardIssues.length === 0;
|
|
3113
|
+
if (contract.waiveCompositionLints) {
|
|
3114
|
+
return { valid: hardIssues.length === 0, issues: hardIssues, hardIssues, compositionIssues, compositionOnly };
|
|
3115
|
+
}
|
|
3116
|
+
return { valid: issues.length === 0, issues, hardIssues, compositionIssues, compositionOnly };
|
|
3114
3117
|
}
|
|
3115
3118
|
function elementInner(html, cls) {
|
|
3116
3119
|
const rootOpen = new RegExp(`<([a-z]+)[^>]*class="[^"]*\\b${cls}\\b[^"]*"[^>]*>`, "i").exec(html);
|
|
@@ -3293,5 +3296,5 @@ exports.normalizeSlideSlots = normalizeSlideSlots;
|
|
|
3293
3296
|
exports.resolveHtmlTheme = resolveHtmlTheme;
|
|
3294
3297
|
exports.sanitizeSlideHtml = sanitizeSlideHtml;
|
|
3295
3298
|
exports.validateBespokeSlideHtml = validateBespokeSlideHtml;
|
|
3296
|
-
//# sourceMappingURL=chunk-
|
|
3297
|
-
//# sourceMappingURL=chunk-
|
|
3299
|
+
//# sourceMappingURL=chunk-JRPN5PMM.cjs.map
|
|
3300
|
+
//# sourceMappingURL=chunk-JRPN5PMM.cjs.map
|