@industry-theme/markdown-panels 0.2.11 → 0.2.12
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.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/panels.bundle.js +108 -2
- package/dist/panels.bundle.js.map +1 -1
- package/dist/tools/index.d.ts +32 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools.bundle.js +107 -0
- package/package.json +34 -18
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Panel Tools
|
|
3
|
+
*
|
|
4
|
+
* UTCP-compatible tools for the Markdown panel extension.
|
|
5
|
+
* These tools can be invoked by AI agents and emit events that panels listen for.
|
|
6
|
+
*
|
|
7
|
+
* IMPORTANT: This file should NOT import any React components to ensure
|
|
8
|
+
* it can be imported server-side without pulling in React dependencies.
|
|
9
|
+
* Use the './tools' subpath export for server-safe imports.
|
|
10
|
+
*/
|
|
11
|
+
import type { PanelTool, PanelToolsMetadata } from '@principal-ade/utcp-panel-event';
|
|
12
|
+
/**
|
|
13
|
+
* Tool: Scroll To Section
|
|
14
|
+
*/
|
|
15
|
+
export declare const scrollToSectionTool: PanelTool;
|
|
16
|
+
/**
|
|
17
|
+
* Tool: Navigate Slide
|
|
18
|
+
*/
|
|
19
|
+
export declare const navigateSlideTool: PanelTool;
|
|
20
|
+
/**
|
|
21
|
+
* Tool: Change Font Size
|
|
22
|
+
*/
|
|
23
|
+
export declare const changeFontSizeTool: PanelTool;
|
|
24
|
+
/**
|
|
25
|
+
* All tools exported as an array.
|
|
26
|
+
*/
|
|
27
|
+
export declare const markdownPanelTools: PanelTool[];
|
|
28
|
+
/**
|
|
29
|
+
* Panel tools metadata for registration with PanelToolRegistry.
|
|
30
|
+
*/
|
|
31
|
+
export declare const markdownPanelToolsMetadata: PanelToolsMetadata;
|
|
32
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErF;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,SA6BjC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,SA8B/B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,SA0BhC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,EAIzC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,0BAA0B,EAAE,kBAKxC,CAAC"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
// src/tools/index.ts
|
|
2
|
+
var scrollToSectionTool = {
|
|
3
|
+
name: "scroll_to_section",
|
|
4
|
+
description: "Scrolls the markdown panel to a specific heading section",
|
|
5
|
+
inputs: {
|
|
6
|
+
type: "object",
|
|
7
|
+
properties: {
|
|
8
|
+
sectionId: {
|
|
9
|
+
type: "string",
|
|
10
|
+
description: "The ID or slug of the section heading to scroll to"
|
|
11
|
+
},
|
|
12
|
+
animate: {
|
|
13
|
+
type: "boolean",
|
|
14
|
+
description: "Whether to animate the scroll transition"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
required: ["sectionId"]
|
|
18
|
+
},
|
|
19
|
+
outputs: {
|
|
20
|
+
type: "object",
|
|
21
|
+
properties: {
|
|
22
|
+
success: { type: "boolean" },
|
|
23
|
+
message: { type: "string" }
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
tags: ["markdown", "navigation", "scroll"],
|
|
27
|
+
tool_call_template: {
|
|
28
|
+
call_template_type: "panel_event",
|
|
29
|
+
event_type: "industry-theme.markdown-panels:scroll-to-section"
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
var navigateSlideTool = {
|
|
33
|
+
name: "navigate_slide",
|
|
34
|
+
description: "Navigates to a specific slide in presentation mode",
|
|
35
|
+
inputs: {
|
|
36
|
+
type: "object",
|
|
37
|
+
properties: {
|
|
38
|
+
slideIndex: {
|
|
39
|
+
type: "number",
|
|
40
|
+
description: "The index of the slide to navigate to (0-based)"
|
|
41
|
+
},
|
|
42
|
+
direction: {
|
|
43
|
+
type: "string",
|
|
44
|
+
enum: ["next", "previous", "first", "last"],
|
|
45
|
+
description: "Navigate relative to current slide"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
outputs: {
|
|
50
|
+
type: "object",
|
|
51
|
+
properties: {
|
|
52
|
+
success: { type: "boolean" },
|
|
53
|
+
currentSlide: { type: "number" },
|
|
54
|
+
totalSlides: { type: "number" }
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
tags: ["markdown", "presentation", "slide"],
|
|
58
|
+
tool_call_template: {
|
|
59
|
+
call_template_type: "panel_event",
|
|
60
|
+
event_type: "industry-theme.markdown-panels:navigate-slide"
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
var changeFontSizeTool = {
|
|
64
|
+
name: "change_font_size",
|
|
65
|
+
description: "Changes the font size of the markdown content",
|
|
66
|
+
inputs: {
|
|
67
|
+
type: "object",
|
|
68
|
+
properties: {
|
|
69
|
+
size: {
|
|
70
|
+
type: "string",
|
|
71
|
+
enum: ["small", "medium", "large"],
|
|
72
|
+
description: "The font size to apply"
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
required: ["size"]
|
|
76
|
+
},
|
|
77
|
+
outputs: {
|
|
78
|
+
type: "object",
|
|
79
|
+
properties: {
|
|
80
|
+
success: { type: "boolean" },
|
|
81
|
+
currentSize: { type: "string" }
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
tags: ["markdown", "display", "font"],
|
|
85
|
+
tool_call_template: {
|
|
86
|
+
call_template_type: "panel_event",
|
|
87
|
+
event_type: "industry-theme.markdown-panels:change-font-size"
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
var markdownPanelTools = [
|
|
91
|
+
scrollToSectionTool,
|
|
92
|
+
navigateSlideTool,
|
|
93
|
+
changeFontSizeTool
|
|
94
|
+
];
|
|
95
|
+
var markdownPanelToolsMetadata = {
|
|
96
|
+
id: "industry-theme.markdown-panels",
|
|
97
|
+
name: "Markdown Panel",
|
|
98
|
+
description: "Tools provided by the markdown rendering panel extension",
|
|
99
|
+
tools: markdownPanelTools
|
|
100
|
+
};
|
|
101
|
+
export {
|
|
102
|
+
scrollToSectionTool,
|
|
103
|
+
navigateSlideTool,
|
|
104
|
+
markdownPanelToolsMetadata,
|
|
105
|
+
markdownPanelTools,
|
|
106
|
+
changeFontSizeTool
|
|
107
|
+
};
|
package/package.json
CHANGED
|
@@ -1,19 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@industry-theme/markdown-panels",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.12",
|
|
4
4
|
"description": "Markdown rendering panels with industry theming support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/panels.bundle.js",
|
|
7
7
|
"module": "dist/panels.bundle.js",
|
|
8
8
|
"types": "dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/panels.bundle.js",
|
|
13
|
+
"require": "./dist/panels.bundle.js",
|
|
14
|
+
"default": "./dist/panels.bundle.js"
|
|
15
|
+
},
|
|
16
|
+
"./tools": {
|
|
17
|
+
"types": "./dist/tools/index.d.ts",
|
|
18
|
+
"import": "./dist/tools.bundle.js",
|
|
19
|
+
"require": "./dist/tools.bundle.js",
|
|
20
|
+
"default": "./dist/tools.bundle.js"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
9
23
|
"keywords": [
|
|
10
24
|
"panel-extension"
|
|
11
25
|
],
|
|
12
26
|
"author": "Your Name",
|
|
13
27
|
"license": "MIT",
|
|
14
28
|
"scripts": {
|
|
15
|
-
"build": "bun run clean && bun run build:panel && bun run build:types",
|
|
29
|
+
"build": "bun run clean && bun run build:panel && bun run build:tools && bun run build:types",
|
|
16
30
|
"build:panel": "vite build",
|
|
31
|
+
"build:tools": "bun build ./src/tools/index.ts --outfile ./dist/tools.bundle.js --format esm --target browser",
|
|
17
32
|
"build:types": "tsc --project tsconfig.build.json --emitDeclarationOnly --declaration --declarationMap",
|
|
18
33
|
"dev": "vite build --watch",
|
|
19
34
|
"clean": "rm -rf dist",
|
|
@@ -28,12 +43,18 @@
|
|
|
28
43
|
"build-storybook": "storybook build"
|
|
29
44
|
},
|
|
30
45
|
"peerDependencies": {
|
|
31
|
-
"@principal-ade/panel-framework-core": "^0.1.2",
|
|
32
46
|
"react": ">=19.0.0",
|
|
33
47
|
"react-dom": ">=19.0.0"
|
|
34
48
|
},
|
|
49
|
+
"peerDependenciesMeta": {
|
|
50
|
+
"@principal-ade/panel-framework-core": {
|
|
51
|
+
"optional": true
|
|
52
|
+
}
|
|
53
|
+
},
|
|
35
54
|
"dependencies": {
|
|
36
|
-
"@principal-ade/industry-theme": "^0.1.
|
|
55
|
+
"@principal-ade/industry-theme": "^0.1.3",
|
|
56
|
+
"@principal-ade/panel-framework-core": "^0.1.5",
|
|
57
|
+
"@principal-ade/utcp-panel-event": "^0.1.0",
|
|
37
58
|
"clsx": "^2.1.1",
|
|
38
59
|
"hast-util-sanitize": "^5.0.2",
|
|
39
60
|
"highlight.js": "^11.11.1",
|
|
@@ -48,21 +69,16 @@
|
|
|
48
69
|
"themed-markdown": "^0.1.71"
|
|
49
70
|
},
|
|
50
71
|
"devDependencies": {
|
|
51
|
-
"@chromatic-com/storybook": "^
|
|
72
|
+
"@chromatic-com/storybook": "^4.1.3",
|
|
52
73
|
"@eslint/js": "^9.32.0",
|
|
53
|
-
"@
|
|
54
|
-
"@storybook/addon-
|
|
55
|
-
"@storybook/addon-
|
|
56
|
-
"@storybook/
|
|
57
|
-
"@storybook/addon-onboarding": "^8.5.0",
|
|
58
|
-
"@storybook/blocks": "^8.5.0",
|
|
59
|
-
"@storybook/react": "^8.5.0",
|
|
60
|
-
"@storybook/react-vite": "^8.5.0",
|
|
61
|
-
"@storybook/test": "^8.5.0",
|
|
74
|
+
"@storybook/addon-docs": "10.1.2",
|
|
75
|
+
"@storybook/addon-links": "10.1.2",
|
|
76
|
+
"@storybook/addon-onboarding": "10.1.2",
|
|
77
|
+
"@storybook/react-vite": "10.1.2",
|
|
62
78
|
"@types/bun": "latest",
|
|
63
79
|
"@types/node": "^22.15.26",
|
|
64
|
-
"@types/react": "^
|
|
65
|
-
"@types/react-dom": "^
|
|
80
|
+
"@types/react": "^19.0.0",
|
|
81
|
+
"@types/react-dom": "^19.0.0",
|
|
66
82
|
"@typescript-eslint/eslint-plugin": "^8.38.0",
|
|
67
83
|
"@typescript-eslint/parser": "^8.38.0",
|
|
68
84
|
"@vitejs/plugin-react": "^4.3.4",
|
|
@@ -71,11 +87,11 @@
|
|
|
71
87
|
"eslint-config-prettier": "^10.1.8",
|
|
72
88
|
"eslint-plugin-react": "^7.37.2",
|
|
73
89
|
"eslint-plugin-react-hooks": "^5.0.0",
|
|
74
|
-
"eslint-plugin-storybook": "
|
|
90
|
+
"eslint-plugin-storybook": "10.1.2",
|
|
75
91
|
"prettier": "^3.6.2",
|
|
76
92
|
"react": "^19.0.0",
|
|
77
93
|
"react-dom": "^19.0.0",
|
|
78
|
-
"storybook": "
|
|
94
|
+
"storybook": "10.1.2",
|
|
79
95
|
"typescript": "^5.0.4",
|
|
80
96
|
"typescript-eslint": "^8.38.0",
|
|
81
97
|
"vite": "^6.0.7"
|