@thanh01.pmt/presentation-kit 0.2.17 → 0.2.18

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/index.d.cts CHANGED
@@ -3,7 +3,7 @@ import { h as SlideEngineConfig, i as SlideEngine, T as ThemeTokens, M as Mermai
3
3
  export { B as BuiltInTheme, g as HtmlSlideSlotData, m as HtmlSlotDefinition, L as LayoutBoxConfig, c as SlideRenderAsyncResult, a as SlideRenderOptions, b as SlideRenderResult, d as SlideTheme } from './types-C3d04zzP.cjs';
4
4
  import { Highlighter } from 'shiki';
5
5
  export { a as SLIDE_LAYOUT_PRESETS, S as SlideLayoutCategory, c as SlideLayoutPreset, g as getSlideLayoutPresetById, b as getSlideLayoutPresetsByCategory } from './presets-BYvgAAkJ.cjs';
6
- export { FRONTEND_SLIDES_CORE_RULES, FrontendSlidesSkillOptions, STYLE_PRESETS, StylePresetItem, TEMPLATES_CATALOG, TemplateCatalogItem, VIEWPORT_BASE_CSS, frontendSlidesTools, getFrontendSlidesSkillPrompt, getSlideStylePresetSchema, getStylePreset, getTemplatesCatalog, querySlideTemplatesSchema, searchTemplates } from './skills/index.cjs';
6
+ export { FRONTEND_SLIDES_CORE_RULES, FrontendSlidesSkillOptions, STYLE_PRESETS, StylePresetItem, TEMPLATES_CATALOG, TemplateCatalogItem, VIEWPORT_BASE_CSS, frontendSlidesTools, getFrontendSlidesSkillPrompt, getSlideStylePresetSchema, getStylePreset, getStylePresetById, getTemplatesCatalog, querySlideTemplatesSchema, searchTemplates } from './skills/index.cjs';
7
7
  import 'zod';
8
8
 
9
9
  /**
@@ -181,7 +181,22 @@ interface GenerateHtmlShellOptions {
181
181
  declare function generateHtmlShell(options: GenerateHtmlShellOptions): string;
182
182
 
183
183
  declare function compileHtmlDeck(deckData: HtmlDeckData, options?: HtmlCompileOptions): CompiledHtmlDeckResult;
184
+ /**
185
+ * Highlights every `<pre ...><code class="language-xxx">` block in a compiled
186
+ * HTML deck with Shiki (vitesse-dark for dark themes, vitesse-light for light).
187
+ * Falls back to the input HTML unchanged when Shiki fails to load or a language
188
+ * is unsupported — the deck must never break because of highlighting.
189
+ */
190
+ declare function highlightDeckCodeBlocks(html: string, scheme?: 'light' | 'dark'): Promise<string>;
191
+ /**
192
+ * Async compiler variant: identical to {@link compileHtmlDeck} but applies
193
+ * Shiki syntax highlighting to all code blocks (plan Task 4.2).
194
+ * Falls back gracefully to non-highlighted output when Shiki is unavailable.
195
+ */
196
+ declare function compileHtmlDeckAsync(deckData: HtmlDeckData, options?: HtmlCompileOptions & {
197
+ highlight?: boolean;
198
+ }): Promise<CompiledHtmlDeckResult>;
184
199
 
185
200
  declare function normalizeSlideSlots(slide: any): Record<string, any>;
186
201
 
187
- export { CompiledHtmlDeckResult, type GenerateHtmlShellOptions, HTML_SLIDE_PRESETS, HTML_THEMES, HtmlCompileOptions, HtmlDeckData, HtmlDeckTheme, HtmlLayoutPresetId, HtmlSlidePreset, HtmlThemeName, MermaidBlock, type PptxExportOptions, SlideEngine, SlideEngineConfig, SlideLayoutData, ThemeTokens, cleanHexColor, compileHtmlDeck, convertMarkdownToPptx, convertTextArrows, createEngine, darkThemeTokens, detectMermaidBlocks, extractLayoutsAndNotes, extractMarpSource, filterPresenterNotes, generateHtmlShell, generateLayoutCss, generateScopedCss as generateScopedCssFromTokens, getHighlighter, highlightCodeBlocks, isLayoutComment, lightThemeTokens, navyThemeTokens, normalizeSlideSlots, parseFontSizeToPt, parseLayoutFromComment, removeSlideElementFromMarkdown, renderMermaidDiagrams, resolveHtmlTheme, sanitizeMermaidCode, serializeLayoutToComment, splitMarkdownSlides, updateSlideLayoutInMarkdown, updateSlideTextInMarkdown };
202
+ export { CompiledHtmlDeckResult, type GenerateHtmlShellOptions, HTML_SLIDE_PRESETS, HTML_THEMES, HtmlCompileOptions, HtmlDeckData, HtmlDeckTheme, HtmlLayoutPresetId, HtmlSlidePreset, HtmlThemeName, MermaidBlock, type PptxExportOptions, SlideEngine, SlideEngineConfig, SlideLayoutData, ThemeTokens, cleanHexColor, compileHtmlDeck, compileHtmlDeckAsync, convertMarkdownToPptx, convertTextArrows, createEngine, darkThemeTokens, detectMermaidBlocks, extractLayoutsAndNotes, extractMarpSource, filterPresenterNotes, generateHtmlShell, generateLayoutCss, generateScopedCss as generateScopedCssFromTokens, getHighlighter, highlightCodeBlocks, highlightDeckCodeBlocks, isLayoutComment, lightThemeTokens, navyThemeTokens, normalizeSlideSlots, parseFontSizeToPt, parseLayoutFromComment, removeSlideElementFromMarkdown, renderMermaidDiagrams, resolveHtmlTheme, sanitizeMermaidCode, serializeLayoutToComment, splitMarkdownSlides, updateSlideLayoutInMarkdown, updateSlideTextInMarkdown };
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import { h as SlideEngineConfig, i as SlideEngine, T as ThemeTokens, M as Mermai
3
3
  export { B as BuiltInTheme, g as HtmlSlideSlotData, m as HtmlSlotDefinition, L as LayoutBoxConfig, c as SlideRenderAsyncResult, a as SlideRenderOptions, b as SlideRenderResult, d as SlideTheme } from './types-C3d04zzP.js';
4
4
  import { Highlighter } from 'shiki';
5
5
  export { a as SLIDE_LAYOUT_PRESETS, S as SlideLayoutCategory, c as SlideLayoutPreset, g as getSlideLayoutPresetById, b as getSlideLayoutPresetsByCategory } from './presets-D_hfPJX9.js';
6
- export { FRONTEND_SLIDES_CORE_RULES, FrontendSlidesSkillOptions, STYLE_PRESETS, StylePresetItem, TEMPLATES_CATALOG, TemplateCatalogItem, VIEWPORT_BASE_CSS, frontendSlidesTools, getFrontendSlidesSkillPrompt, getSlideStylePresetSchema, getStylePreset, getTemplatesCatalog, querySlideTemplatesSchema, searchTemplates } from './skills/index.js';
6
+ export { FRONTEND_SLIDES_CORE_RULES, FrontendSlidesSkillOptions, STYLE_PRESETS, StylePresetItem, TEMPLATES_CATALOG, TemplateCatalogItem, VIEWPORT_BASE_CSS, frontendSlidesTools, getFrontendSlidesSkillPrompt, getSlideStylePresetSchema, getStylePreset, getStylePresetById, getTemplatesCatalog, querySlideTemplatesSchema, searchTemplates } from './skills/index.js';
7
7
  import 'zod';
8
8
 
9
9
  /**
@@ -181,7 +181,22 @@ interface GenerateHtmlShellOptions {
181
181
  declare function generateHtmlShell(options: GenerateHtmlShellOptions): string;
182
182
 
183
183
  declare function compileHtmlDeck(deckData: HtmlDeckData, options?: HtmlCompileOptions): CompiledHtmlDeckResult;
184
+ /**
185
+ * Highlights every `<pre ...><code class="language-xxx">` block in a compiled
186
+ * HTML deck with Shiki (vitesse-dark for dark themes, vitesse-light for light).
187
+ * Falls back to the input HTML unchanged when Shiki fails to load or a language
188
+ * is unsupported — the deck must never break because of highlighting.
189
+ */
190
+ declare function highlightDeckCodeBlocks(html: string, scheme?: 'light' | 'dark'): Promise<string>;
191
+ /**
192
+ * Async compiler variant: identical to {@link compileHtmlDeck} but applies
193
+ * Shiki syntax highlighting to all code blocks (plan Task 4.2).
194
+ * Falls back gracefully to non-highlighted output when Shiki is unavailable.
195
+ */
196
+ declare function compileHtmlDeckAsync(deckData: HtmlDeckData, options?: HtmlCompileOptions & {
197
+ highlight?: boolean;
198
+ }): Promise<CompiledHtmlDeckResult>;
184
199
 
185
200
  declare function normalizeSlideSlots(slide: any): Record<string, any>;
186
201
 
187
- export { CompiledHtmlDeckResult, type GenerateHtmlShellOptions, HTML_SLIDE_PRESETS, HTML_THEMES, HtmlCompileOptions, HtmlDeckData, HtmlDeckTheme, HtmlLayoutPresetId, HtmlSlidePreset, HtmlThemeName, MermaidBlock, type PptxExportOptions, SlideEngine, SlideEngineConfig, SlideLayoutData, ThemeTokens, cleanHexColor, compileHtmlDeck, convertMarkdownToPptx, convertTextArrows, createEngine, darkThemeTokens, detectMermaidBlocks, extractLayoutsAndNotes, extractMarpSource, filterPresenterNotes, generateHtmlShell, generateLayoutCss, generateScopedCss as generateScopedCssFromTokens, getHighlighter, highlightCodeBlocks, isLayoutComment, lightThemeTokens, navyThemeTokens, normalizeSlideSlots, parseFontSizeToPt, parseLayoutFromComment, removeSlideElementFromMarkdown, renderMermaidDiagrams, resolveHtmlTheme, sanitizeMermaidCode, serializeLayoutToComment, splitMarkdownSlides, updateSlideLayoutInMarkdown, updateSlideTextInMarkdown };
202
+ export { CompiledHtmlDeckResult, type GenerateHtmlShellOptions, HTML_SLIDE_PRESETS, HTML_THEMES, HtmlCompileOptions, HtmlDeckData, HtmlDeckTheme, HtmlLayoutPresetId, HtmlSlidePreset, HtmlThemeName, MermaidBlock, type PptxExportOptions, SlideEngine, SlideEngineConfig, SlideLayoutData, ThemeTokens, cleanHexColor, compileHtmlDeck, compileHtmlDeckAsync, convertMarkdownToPptx, convertTextArrows, createEngine, darkThemeTokens, detectMermaidBlocks, extractLayoutsAndNotes, extractMarpSource, filterPresenterNotes, generateHtmlShell, generateLayoutCss, generateScopedCss as generateScopedCssFromTokens, getHighlighter, highlightCodeBlocks, highlightDeckCodeBlocks, isLayoutComment, lightThemeTokens, navyThemeTokens, normalizeSlideSlots, parseFontSizeToPt, parseLayoutFromComment, removeSlideElementFromMarkdown, renderMermaidDiagrams, resolveHtmlTheme, sanitizeMermaidCode, serializeLayoutToComment, splitMarkdownSlides, updateSlideLayoutInMarkdown, updateSlideTextInMarkdown };
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
- export { FRONTEND_SLIDES_CORE_RULES, STYLE_PRESETS, TEMPLATES_CATALOG, VIEWPORT_BASE_CSS, frontendSlidesTools, getFrontendSlidesSkillPrompt, getSlideStylePresetSchema, getStylePreset, getTemplatesCatalog, querySlideTemplatesSchema, searchTemplates } from './chunk-BHJXQCVE.js';
2
- import { resolveTheme, generateScopedCss2, renderSlideAsync, renderSlide } from './chunk-NYLDRVHZ.js';
3
- export { convertTextArrows, countSlides, darkThemeTokens, defineTheme, detectMermaidBlocks, extractLayoutsAndNotes, extractMarpSource, extractMaxClicks, filterPresenterNotes, generateClickCss, generateLayoutCss, generateScopedCss2 as generateScopedCss, generateScopedCss as generateScopedCssFromTokens, getHighlighter, getThemeTokens, highlightCodeBlocks, isLayoutComment, lightThemeTokens, navyThemeTokens, parseLayoutFromComment, postprocessClicks, preprocessClicks, renderMarp, renderMermaidDiagrams, renderSlide, renderSlideAsync, resolveTheme, sanitizeMermaidCode } from './chunk-NYLDRVHZ.js';
4
- import { splitMarkdownSlides } from './chunk-7QHDWDSB.js';
5
- export { HTML_SLIDE_PRESETS, HTML_THEMES, SLIDE_LAYOUT_PRESETS, compileHtmlDeck, generateHtmlShell, getSlideLayoutPresetById, getSlideLayoutPresetsByCategory, normalizeSlideSlots, removeSlideElementFromMarkdown, resolveHtmlTheme, serializeLayoutToComment, splitMarkdownSlides, updateSlideLayoutInMarkdown, updateSlideTextInMarkdown } from './chunk-7QHDWDSB.js';
1
+ import { resolveTheme, generateScopedCss2, renderSlideAsync, renderSlide } from './chunk-DDOUFYLK.js';
2
+ export { convertTextArrows, countSlides, darkThemeTokens, defineTheme, detectMermaidBlocks, extractLayoutsAndNotes, extractMarpSource, extractMaxClicks, filterPresenterNotes, generateClickCss, generateLayoutCss, generateScopedCss2 as generateScopedCss, generateScopedCss as generateScopedCssFromTokens, getThemeTokens, isLayoutComment, lightThemeTokens, navyThemeTokens, parseLayoutFromComment, postprocessClicks, preprocessClicks, renderMarp, renderMermaidDiagrams, renderSlide, renderSlideAsync, resolveTheme, sanitizeMermaidCode } from './chunk-DDOUFYLK.js';
3
+ import { splitMarkdownSlides } from './chunk-JJQDQIRG.js';
4
+ export { HTML_SLIDE_PRESETS, HTML_THEMES, SLIDE_LAYOUT_PRESETS, compileHtmlDeck, compileHtmlDeckAsync, generateHtmlShell, getHighlighter, getSlideLayoutPresetById, getSlideLayoutPresetsByCategory, highlightCodeBlocks, highlightDeckCodeBlocks, normalizeSlideSlots, removeSlideElementFromMarkdown, resolveHtmlTheme, serializeLayoutToComment, splitMarkdownSlides, updateSlideLayoutInMarkdown, updateSlideTextInMarkdown } from './chunk-JJQDQIRG.js';
5
+ export { FRONTEND_SLIDES_CORE_RULES, STYLE_PRESETS, TEMPLATES_CATALOG, VIEWPORT_BASE_CSS, frontendSlidesTools, getFrontendSlidesSkillPrompt, getSlideStylePresetSchema, getStylePreset, getStylePresetById, getTemplatesCatalog, querySlideTemplatesSchema, searchTemplates } from './chunk-VRXEXUHR.js';
6
6
 
7
7
  // src/engine.ts
8
8
  function createEngine(config = {}) {
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunkTGI6YSZP_cjs = require('../chunk-TGI6YSZP.cjs');
4
- var chunkJNTRKKJX_cjs = require('../chunk-JNTRKKJX.cjs');
3
+ var chunkDIHFQ5LF_cjs = require('../chunk-DIHFQ5LF.cjs');
4
+ var chunkSFBEDDGU_cjs = require('../chunk-SFBEDDGU.cjs');
5
5
  var React2 = require('react');
6
6
  var jsxRuntime = require('react/jsx-runtime');
7
7
 
@@ -25,7 +25,7 @@ function useSlideState(options) {
25
25
  const result = React2.useMemo(() => {
26
26
  if (!markdown || !markdown.trim()) return null;
27
27
  renderCountRef.current++;
28
- return chunkTGI6YSZP_cjs.renderSlide(markdown, {
28
+ return chunkDIHFQ5LF_cjs.renderSlide(markdown, {
29
29
  theme,
30
30
  enableMermaid: true,
31
31
  enableClicks,
@@ -914,7 +914,7 @@ function SlideDesignOverlay({
914
914
  "select",
915
915
  {
916
916
  onChange: (e) => {
917
- const preset = chunkJNTRKKJX_cjs.SLIDE_LAYOUT_PRESETS.find((p) => p.id === e.target.value);
917
+ const preset = chunkSFBEDDGU_cjs.SLIDE_LAYOUT_PRESETS.find((p) => p.id === e.target.value);
918
918
  if (preset) {
919
919
  const clonedBoxes = JSON.parse(JSON.stringify(preset.layout.boxes));
920
920
  setBoxes(clonedBoxes);
@@ -934,7 +934,7 @@ function SlideDesignOverlay({
934
934
  title: "\xC1p d\u1EE5ng m\u1EABu b\u1ED1 c\u1EE5c c\xF3 s\u1EB5n",
935
935
  children: [
936
936
  /* @__PURE__ */ jsxRuntime.jsx("option", { value: "", disabled: true, style: { backgroundColor: isLight ? "#ffffff" : "#1e1f29", color: subtextColor }, children: "M\u1EABu b\u1ED1 c\u1EE5c (Presets)..." }),
937
- chunkJNTRKKJX_cjs.SLIDE_LAYOUT_PRESETS.map((p) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: p.id, style: { backgroundColor: isLight ? "#ffffff" : "#1e1f29", color: isLight ? "#0f172a" : "#f8fafc" }, children: p.name }, p.id))
937
+ chunkSFBEDDGU_cjs.SLIDE_LAYOUT_PRESETS.map((p) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: p.id, style: { backgroundColor: isLight ? "#ffffff" : "#1e1f29", color: isLight ? "#0f172a" : "#f8fafc" }, children: p.name }, p.id))
938
938
  ]
939
939
  }
940
940
  ),
@@ -1337,7 +1337,7 @@ function SlideViewer({
1337
1337
  containers.forEach((container) => {
1338
1338
  if (container instanceof HTMLElement) {
1339
1339
  const themeName2 = typeof theme === "string" ? theme : "dark";
1340
- chunkTGI6YSZP_cjs.renderMermaidDiagrams(container, themeName2).catch(() => {
1340
+ chunkDIHFQ5LF_cjs.renderMermaidDiagrams(container, themeName2).catch(() => {
1341
1341
  });
1342
1342
  }
1343
1343
  });
@@ -1567,7 +1567,7 @@ function SlideViewer({
1567
1567
  onSave: (layout) => {
1568
1568
  setLiveLayout(layout);
1569
1569
  if (onSaveMarkdown) {
1570
- const updated = chunkJNTRKKJX_cjs.updateSlideLayoutInMarkdown(markdown, currentIndex, layout);
1570
+ const updated = chunkSFBEDDGU_cjs.updateSlideLayoutInMarkdown(markdown, currentIndex, layout);
1571
1571
  onSaveMarkdown(updated);
1572
1572
  }
1573
1573
  },
@@ -1621,7 +1621,7 @@ var HtmlSlideViewer = ({
1621
1621
  const fullHtml = React2.useMemo(() => {
1622
1622
  if (initialHtml) return initialHtml;
1623
1623
  if (deckData) {
1624
- return chunkJNTRKKJX_cjs.compileHtmlDeck(deckData).html;
1624
+ return chunkSFBEDDGU_cjs.compileHtmlDeck(deckData).html;
1625
1625
  }
1626
1626
  return "";
1627
1627
  }, [initialHtml, deckData]);
@@ -1777,35 +1777,35 @@ var HtmlSlideViewer = ({
1777
1777
 
1778
1778
  Object.defineProperty(exports, "defineTheme", {
1779
1779
  enumerable: true,
1780
- get: function () { return chunkTGI6YSZP_cjs.defineTheme; }
1780
+ get: function () { return chunkDIHFQ5LF_cjs.defineTheme; }
1781
1781
  });
1782
1782
  Object.defineProperty(exports, "extractMaxClicks", {
1783
1783
  enumerable: true,
1784
- get: function () { return chunkTGI6YSZP_cjs.extractMaxClicks; }
1784
+ get: function () { return chunkDIHFQ5LF_cjs.extractMaxClicks; }
1785
1785
  });
1786
1786
  Object.defineProperty(exports, "generateClickCss", {
1787
1787
  enumerable: true,
1788
- get: function () { return chunkTGI6YSZP_cjs.generateClickCss; }
1788
+ get: function () { return chunkDIHFQ5LF_cjs.generateClickCss; }
1789
1789
  });
1790
1790
  Object.defineProperty(exports, "postprocessClicks", {
1791
1791
  enumerable: true,
1792
- get: function () { return chunkTGI6YSZP_cjs.postprocessClicks; }
1792
+ get: function () { return chunkDIHFQ5LF_cjs.postprocessClicks; }
1793
1793
  });
1794
1794
  Object.defineProperty(exports, "preprocessClicks", {
1795
1795
  enumerable: true,
1796
- get: function () { return chunkTGI6YSZP_cjs.preprocessClicks; }
1796
+ get: function () { return chunkDIHFQ5LF_cjs.preprocessClicks; }
1797
1797
  });
1798
1798
  Object.defineProperty(exports, "renderSlide", {
1799
1799
  enumerable: true,
1800
- get: function () { return chunkTGI6YSZP_cjs.renderSlide; }
1800
+ get: function () { return chunkDIHFQ5LF_cjs.renderSlide; }
1801
1801
  });
1802
1802
  Object.defineProperty(exports, "renderSlideAsync", {
1803
1803
  enumerable: true,
1804
- get: function () { return chunkTGI6YSZP_cjs.renderSlideAsync; }
1804
+ get: function () { return chunkDIHFQ5LF_cjs.renderSlideAsync; }
1805
1805
  });
1806
1806
  Object.defineProperty(exports, "resolveTheme", {
1807
1807
  enumerable: true,
1808
- get: function () { return chunkTGI6YSZP_cjs.resolveTheme; }
1808
+ get: function () { return chunkDIHFQ5LF_cjs.resolveTheme; }
1809
1809
  });
1810
1810
  exports.DeckView = DeckView;
1811
1811
  exports.HtmlSlideViewer = HtmlSlideViewer;
@@ -1,6 +1,6 @@
1
- import { renderSlide, renderMermaidDiagrams } from '../chunk-NYLDRVHZ.js';
2
- export { defineTheme, extractMaxClicks, generateClickCss, postprocessClicks, preprocessClicks, renderSlide, renderSlideAsync, resolveTheme } from '../chunk-NYLDRVHZ.js';
3
- import { SLIDE_LAYOUT_PRESETS, updateSlideLayoutInMarkdown, compileHtmlDeck } from '../chunk-7QHDWDSB.js';
1
+ import { renderSlide, renderMermaidDiagrams } from '../chunk-DDOUFYLK.js';
2
+ export { defineTheme, extractMaxClicks, generateClickCss, postprocessClicks, preprocessClicks, renderSlide, renderSlideAsync, resolveTheme } from '../chunk-DDOUFYLK.js';
3
+ import { SLIDE_LAYOUT_PRESETS, updateSlideLayoutInMarkdown, compileHtmlDeck } from '../chunk-JJQDQIRG.js';
4
4
  import React2, { useState, useRef, useMemo, useEffect, useCallback } from 'react';
5
5
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
6
6
 
@@ -1,52 +1,56 @@
1
1
  'use strict';
2
2
 
3
- var chunk6R6L6KSC_cjs = require('../chunk-6R6L6KSC.cjs');
3
+ var chunkHSVXH7DD_cjs = require('../chunk-HSVXH7DD.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "FRONTEND_SLIDES_CORE_RULES", {
8
8
  enumerable: true,
9
- get: function () { return chunk6R6L6KSC_cjs.FRONTEND_SLIDES_CORE_RULES; }
9
+ get: function () { return chunkHSVXH7DD_cjs.FRONTEND_SLIDES_CORE_RULES; }
10
10
  });
11
11
  Object.defineProperty(exports, "STYLE_PRESETS", {
12
12
  enumerable: true,
13
- get: function () { return chunk6R6L6KSC_cjs.STYLE_PRESETS; }
13
+ get: function () { return chunkHSVXH7DD_cjs.STYLE_PRESETS; }
14
14
  });
15
15
  Object.defineProperty(exports, "TEMPLATES_CATALOG", {
16
16
  enumerable: true,
17
- get: function () { return chunk6R6L6KSC_cjs.TEMPLATES_CATALOG; }
17
+ get: function () { return chunkHSVXH7DD_cjs.TEMPLATES_CATALOG; }
18
18
  });
19
19
  Object.defineProperty(exports, "VIEWPORT_BASE_CSS", {
20
20
  enumerable: true,
21
- get: function () { return chunk6R6L6KSC_cjs.VIEWPORT_BASE_CSS; }
21
+ get: function () { return chunkHSVXH7DD_cjs.VIEWPORT_BASE_CSS; }
22
22
  });
23
23
  Object.defineProperty(exports, "frontendSlidesTools", {
24
24
  enumerable: true,
25
- get: function () { return chunk6R6L6KSC_cjs.frontendSlidesTools; }
25
+ get: function () { return chunkHSVXH7DD_cjs.frontendSlidesTools; }
26
26
  });
27
27
  Object.defineProperty(exports, "getFrontendSlidesSkillPrompt", {
28
28
  enumerable: true,
29
- get: function () { return chunk6R6L6KSC_cjs.getFrontendSlidesSkillPrompt; }
29
+ get: function () { return chunkHSVXH7DD_cjs.getFrontendSlidesSkillPrompt; }
30
30
  });
31
31
  Object.defineProperty(exports, "getSlideStylePresetSchema", {
32
32
  enumerable: true,
33
- get: function () { return chunk6R6L6KSC_cjs.getSlideStylePresetSchema; }
33
+ get: function () { return chunkHSVXH7DD_cjs.getSlideStylePresetSchema; }
34
34
  });
35
35
  Object.defineProperty(exports, "getStylePreset", {
36
36
  enumerable: true,
37
- get: function () { return chunk6R6L6KSC_cjs.getStylePreset; }
37
+ get: function () { return chunkHSVXH7DD_cjs.getStylePreset; }
38
+ });
39
+ Object.defineProperty(exports, "getStylePresetById", {
40
+ enumerable: true,
41
+ get: function () { return chunkHSVXH7DD_cjs.getStylePresetById; }
38
42
  });
39
43
  Object.defineProperty(exports, "getTemplatesCatalog", {
40
44
  enumerable: true,
41
- get: function () { return chunk6R6L6KSC_cjs.getTemplatesCatalog; }
45
+ get: function () { return chunkHSVXH7DD_cjs.getTemplatesCatalog; }
42
46
  });
43
47
  Object.defineProperty(exports, "querySlideTemplatesSchema", {
44
48
  enumerable: true,
45
- get: function () { return chunk6R6L6KSC_cjs.querySlideTemplatesSchema; }
49
+ get: function () { return chunkHSVXH7DD_cjs.querySlideTemplatesSchema; }
46
50
  });
47
51
  Object.defineProperty(exports, "searchTemplates", {
48
52
  enumerable: true,
49
- get: function () { return chunk6R6L6KSC_cjs.searchTemplates; }
53
+ get: function () { return chunkHSVXH7DD_cjs.searchTemplates; }
50
54
  });
51
55
  //# sourceMappingURL=index.cjs.map
52
56
  //# sourceMappingURL=index.cjs.map
@@ -8,7 +8,7 @@ interface TemplateCatalogItem {
8
8
  occasion: string[];
9
9
  tone: string[];
10
10
  formality: 'low' | 'medium-low' | 'medium' | 'medium-high' | 'high';
11
- density: 'low' | 'medium' | 'high';
11
+ density: 'low' | 'medium' | 'medium-high' | 'high';
12
12
  scheme: 'light' | 'dark' | 'mixed';
13
13
  best_for: string;
14
14
  avoid_for: string;
@@ -54,16 +54,30 @@ interface FrontendSlidesSkillOptions {
54
54
  declare function getTemplatesCatalog(): TemplateCatalogItem[];
55
55
  /**
56
56
  * Searches templates by mood, scheme, or keywords.
57
+ *
58
+ * Scoring semantics (graceful, not hard-AND):
59
+ * - `scheme` and `mood` add weight when they match.
60
+ * - `query` matches against slug/name/tagline/best_for/occasion/tone/avoid_for.
61
+ * - Results are ranked by score and a minimum threshold applies; when NO
62
+ * template clears the threshold the full catalog is returned so LLM agents
63
+ * never dead-end on an over-constrained query.
57
64
  */
58
65
  declare function searchTemplates(filter?: string | {
59
66
  mood?: string;
60
- scheme?: 'light' | 'dark';
67
+ scheme?: 'light' | 'dark' | 'mixed';
61
68
  query?: string;
62
69
  }): TemplateCatalogItem[];
63
70
  /**
64
- * Retrieves a style preset by its ID.
71
+ * Retrieves a style preset by its ID. Falls back to the first preset
72
+ * (electric-studio) when the ID is unknown — use `getStylePresetById`
73
+ * when a strict match is required (e.g. validating user-provided IDs).
65
74
  */
66
- declare function getStylePreset(id: string): StylePresetItem | undefined;
75
+ declare function getStylePreset(id: string): StylePresetItem;
76
+ /**
77
+ * Strict variant: returns the exact preset or `undefined` when unknown.
78
+ * Never falls back silently — callers can surface a proper error.
79
+ */
80
+ declare function getStylePresetById(id: string): StylePresetItem | undefined;
67
81
  /**
68
82
  * Assembles a comprehensive, production-grade Vercel AI SDK system prompt
69
83
  * integrating the entire Frontend-Slides Skill, fixed 16:9 stage rules,
@@ -73,40 +87,41 @@ declare function getFrontendSlidesSkillPrompt(options?: FrontendSlidesSkillOptio
73
87
 
74
88
  declare const querySlideTemplatesSchema: z.ZodObject<{
75
89
  mood: z.ZodOptional<z.ZodString>;
76
- scheme: z.ZodOptional<z.ZodEnum<["light", "dark"]>>;
90
+ scheme: z.ZodOptional<z.ZodEnum<["light", "dark", "mixed"]>>;
77
91
  query: z.ZodOptional<z.ZodString>;
78
92
  }, "strip", z.ZodTypeAny, {
79
- scheme?: "dark" | "light" | undefined;
93
+ scheme?: "dark" | "light" | "mixed" | undefined;
80
94
  mood?: string | undefined;
81
95
  query?: string | undefined;
82
96
  }, {
83
- scheme?: "dark" | "light" | undefined;
97
+ scheme?: "dark" | "light" | "mixed" | undefined;
84
98
  mood?: string | undefined;
85
99
  query?: string | undefined;
86
100
  }>;
87
101
  declare const getSlideStylePresetSchema: z.ZodObject<{
88
- presetId: z.ZodEnum<["electric-studio", "blue-professional", "creative-voltage"]>;
102
+ presetId: z.ZodString;
89
103
  }, "strip", z.ZodTypeAny, {
90
- presetId: "blue-professional" | "electric-studio" | "creative-voltage";
104
+ presetId: string;
91
105
  }, {
92
- presetId: "blue-professional" | "electric-studio" | "creative-voltage";
106
+ presetId: string;
93
107
  }>;
94
108
  /**
95
- * Tool definitions that can be directly passed to Vercel AI SDK's `tools` parameter.
109
+ * Tool definitions that can be directly passed to Vercel AI SDK v5+/v7's
110
+ * `tools` parameter (uses `inputSchema`, not the legacy v4 `parameters`).
96
111
  */
97
112
  declare const frontendSlidesTools: {
98
113
  querySlideTemplates: {
99
114
  description: string;
100
- parameters: z.ZodObject<{
115
+ inputSchema: z.ZodObject<{
101
116
  mood: z.ZodOptional<z.ZodString>;
102
- scheme: z.ZodOptional<z.ZodEnum<["light", "dark"]>>;
117
+ scheme: z.ZodOptional<z.ZodEnum<["light", "dark", "mixed"]>>;
103
118
  query: z.ZodOptional<z.ZodString>;
104
119
  }, "strip", z.ZodTypeAny, {
105
- scheme?: "dark" | "light" | undefined;
120
+ scheme?: "dark" | "light" | "mixed" | undefined;
106
121
  mood?: string | undefined;
107
122
  query?: string | undefined;
108
123
  }, {
109
- scheme?: "dark" | "light" | undefined;
124
+ scheme?: "dark" | "light" | "mixed" | undefined;
110
125
  mood?: string | undefined;
111
126
  query?: string | undefined;
112
127
  }>;
@@ -126,17 +141,18 @@ declare const frontendSlidesTools: {
126
141
  };
127
142
  getSlideStylePreset: {
128
143
  description: string;
129
- parameters: z.ZodObject<{
130
- presetId: z.ZodEnum<["electric-studio", "blue-professional", "creative-voltage"]>;
144
+ inputSchema: z.ZodObject<{
145
+ presetId: z.ZodString;
131
146
  }, "strip", z.ZodTypeAny, {
132
- presetId: "blue-professional" | "electric-studio" | "creative-voltage";
147
+ presetId: string;
133
148
  }, {
134
- presetId: "blue-professional" | "electric-studio" | "creative-voltage";
149
+ presetId: string;
135
150
  }>;
136
151
  execute: (args: z.infer<typeof getSlideStylePresetSchema>) => Promise<StylePresetItem | {
137
152
  error: string;
153
+ availablePresets: string[];
138
154
  }>;
139
155
  };
140
156
  };
141
157
 
142
- export { FRONTEND_SLIDES_CORE_RULES, type FrontendSlidesSkillOptions, STYLE_PRESETS, type StylePresetItem, TEMPLATES_CATALOG, type TemplateCatalogItem, VIEWPORT_BASE_CSS, frontendSlidesTools, getFrontendSlidesSkillPrompt, getSlideStylePresetSchema, getStylePreset, getTemplatesCatalog, querySlideTemplatesSchema, searchTemplates };
158
+ export { FRONTEND_SLIDES_CORE_RULES, type FrontendSlidesSkillOptions, STYLE_PRESETS, type StylePresetItem, TEMPLATES_CATALOG, type TemplateCatalogItem, VIEWPORT_BASE_CSS, frontendSlidesTools, getFrontendSlidesSkillPrompt, getSlideStylePresetSchema, getStylePreset, getStylePresetById, getTemplatesCatalog, querySlideTemplatesSchema, searchTemplates };
@@ -8,7 +8,7 @@ interface TemplateCatalogItem {
8
8
  occasion: string[];
9
9
  tone: string[];
10
10
  formality: 'low' | 'medium-low' | 'medium' | 'medium-high' | 'high';
11
- density: 'low' | 'medium' | 'high';
11
+ density: 'low' | 'medium' | 'medium-high' | 'high';
12
12
  scheme: 'light' | 'dark' | 'mixed';
13
13
  best_for: string;
14
14
  avoid_for: string;
@@ -54,16 +54,30 @@ interface FrontendSlidesSkillOptions {
54
54
  declare function getTemplatesCatalog(): TemplateCatalogItem[];
55
55
  /**
56
56
  * Searches templates by mood, scheme, or keywords.
57
+ *
58
+ * Scoring semantics (graceful, not hard-AND):
59
+ * - `scheme` and `mood` add weight when they match.
60
+ * - `query` matches against slug/name/tagline/best_for/occasion/tone/avoid_for.
61
+ * - Results are ranked by score and a minimum threshold applies; when NO
62
+ * template clears the threshold the full catalog is returned so LLM agents
63
+ * never dead-end on an over-constrained query.
57
64
  */
58
65
  declare function searchTemplates(filter?: string | {
59
66
  mood?: string;
60
- scheme?: 'light' | 'dark';
67
+ scheme?: 'light' | 'dark' | 'mixed';
61
68
  query?: string;
62
69
  }): TemplateCatalogItem[];
63
70
  /**
64
- * Retrieves a style preset by its ID.
71
+ * Retrieves a style preset by its ID. Falls back to the first preset
72
+ * (electric-studio) when the ID is unknown — use `getStylePresetById`
73
+ * when a strict match is required (e.g. validating user-provided IDs).
65
74
  */
66
- declare function getStylePreset(id: string): StylePresetItem | undefined;
75
+ declare function getStylePreset(id: string): StylePresetItem;
76
+ /**
77
+ * Strict variant: returns the exact preset or `undefined` when unknown.
78
+ * Never falls back silently — callers can surface a proper error.
79
+ */
80
+ declare function getStylePresetById(id: string): StylePresetItem | undefined;
67
81
  /**
68
82
  * Assembles a comprehensive, production-grade Vercel AI SDK system prompt
69
83
  * integrating the entire Frontend-Slides Skill, fixed 16:9 stage rules,
@@ -73,40 +87,41 @@ declare function getFrontendSlidesSkillPrompt(options?: FrontendSlidesSkillOptio
73
87
 
74
88
  declare const querySlideTemplatesSchema: z.ZodObject<{
75
89
  mood: z.ZodOptional<z.ZodString>;
76
- scheme: z.ZodOptional<z.ZodEnum<["light", "dark"]>>;
90
+ scheme: z.ZodOptional<z.ZodEnum<["light", "dark", "mixed"]>>;
77
91
  query: z.ZodOptional<z.ZodString>;
78
92
  }, "strip", z.ZodTypeAny, {
79
- scheme?: "dark" | "light" | undefined;
93
+ scheme?: "dark" | "light" | "mixed" | undefined;
80
94
  mood?: string | undefined;
81
95
  query?: string | undefined;
82
96
  }, {
83
- scheme?: "dark" | "light" | undefined;
97
+ scheme?: "dark" | "light" | "mixed" | undefined;
84
98
  mood?: string | undefined;
85
99
  query?: string | undefined;
86
100
  }>;
87
101
  declare const getSlideStylePresetSchema: z.ZodObject<{
88
- presetId: z.ZodEnum<["electric-studio", "blue-professional", "creative-voltage"]>;
102
+ presetId: z.ZodString;
89
103
  }, "strip", z.ZodTypeAny, {
90
- presetId: "blue-professional" | "electric-studio" | "creative-voltage";
104
+ presetId: string;
91
105
  }, {
92
- presetId: "blue-professional" | "electric-studio" | "creative-voltage";
106
+ presetId: string;
93
107
  }>;
94
108
  /**
95
- * Tool definitions that can be directly passed to Vercel AI SDK's `tools` parameter.
109
+ * Tool definitions that can be directly passed to Vercel AI SDK v5+/v7's
110
+ * `tools` parameter (uses `inputSchema`, not the legacy v4 `parameters`).
96
111
  */
97
112
  declare const frontendSlidesTools: {
98
113
  querySlideTemplates: {
99
114
  description: string;
100
- parameters: z.ZodObject<{
115
+ inputSchema: z.ZodObject<{
101
116
  mood: z.ZodOptional<z.ZodString>;
102
- scheme: z.ZodOptional<z.ZodEnum<["light", "dark"]>>;
117
+ scheme: z.ZodOptional<z.ZodEnum<["light", "dark", "mixed"]>>;
103
118
  query: z.ZodOptional<z.ZodString>;
104
119
  }, "strip", z.ZodTypeAny, {
105
- scheme?: "dark" | "light" | undefined;
120
+ scheme?: "dark" | "light" | "mixed" | undefined;
106
121
  mood?: string | undefined;
107
122
  query?: string | undefined;
108
123
  }, {
109
- scheme?: "dark" | "light" | undefined;
124
+ scheme?: "dark" | "light" | "mixed" | undefined;
110
125
  mood?: string | undefined;
111
126
  query?: string | undefined;
112
127
  }>;
@@ -126,17 +141,18 @@ declare const frontendSlidesTools: {
126
141
  };
127
142
  getSlideStylePreset: {
128
143
  description: string;
129
- parameters: z.ZodObject<{
130
- presetId: z.ZodEnum<["electric-studio", "blue-professional", "creative-voltage"]>;
144
+ inputSchema: z.ZodObject<{
145
+ presetId: z.ZodString;
131
146
  }, "strip", z.ZodTypeAny, {
132
- presetId: "blue-professional" | "electric-studio" | "creative-voltage";
147
+ presetId: string;
133
148
  }, {
134
- presetId: "blue-professional" | "electric-studio" | "creative-voltage";
149
+ presetId: string;
135
150
  }>;
136
151
  execute: (args: z.infer<typeof getSlideStylePresetSchema>) => Promise<StylePresetItem | {
137
152
  error: string;
153
+ availablePresets: string[];
138
154
  }>;
139
155
  };
140
156
  };
141
157
 
142
- export { FRONTEND_SLIDES_CORE_RULES, type FrontendSlidesSkillOptions, STYLE_PRESETS, type StylePresetItem, TEMPLATES_CATALOG, type TemplateCatalogItem, VIEWPORT_BASE_CSS, frontendSlidesTools, getFrontendSlidesSkillPrompt, getSlideStylePresetSchema, getStylePreset, getTemplatesCatalog, querySlideTemplatesSchema, searchTemplates };
158
+ export { FRONTEND_SLIDES_CORE_RULES, type FrontendSlidesSkillOptions, STYLE_PRESETS, type StylePresetItem, TEMPLATES_CATALOG, type TemplateCatalogItem, VIEWPORT_BASE_CSS, frontendSlidesTools, getFrontendSlidesSkillPrompt, getSlideStylePresetSchema, getStylePreset, getStylePresetById, getTemplatesCatalog, querySlideTemplatesSchema, searchTemplates };
@@ -1,3 +1,3 @@
1
- export { FRONTEND_SLIDES_CORE_RULES, STYLE_PRESETS, TEMPLATES_CATALOG, VIEWPORT_BASE_CSS, frontendSlidesTools, getFrontendSlidesSkillPrompt, getSlideStylePresetSchema, getStylePreset, getTemplatesCatalog, querySlideTemplatesSchema, searchTemplates } from '../chunk-BHJXQCVE.js';
1
+ export { FRONTEND_SLIDES_CORE_RULES, STYLE_PRESETS, TEMPLATES_CATALOG, VIEWPORT_BASE_CSS, frontendSlidesTools, getFrontendSlidesSkillPrompt, getSlideStylePresetSchema, getStylePreset, getStylePresetById, getTemplatesCatalog, querySlideTemplatesSchema, searchTemplates } from '../chunk-VRXEXUHR.js';
2
2
  //# sourceMappingURL=index.js.map
3
3
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thanh01.pmt/presentation-kit",
3
- "version": "0.2.17",
3
+ "version": "0.2.18",
4
4
  "description": "Standalone client-side slide rendering engine with Marp, Shiki syntax highlighting, Mermaid diagrams, custom themes, and AI slide authoring tools.",
5
5
  "author": "Thanh Pham <https://github.com/thanh01pmt>",
6
6
  "license": "MIT",