@industry-theme/theme-editor-panel 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.
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Theme Editor Panel Tools
3
+ *
4
+ * UTCP-compatible tools for the theme editor 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: Set Theme Color
14
+ */
15
+ export declare const setThemeColorTool: PanelTool;
16
+ /**
17
+ * Tool: Reset Theme
18
+ */
19
+ export declare const resetThemeTool: PanelTool;
20
+ /**
21
+ * Tool: Apply Theme Preset
22
+ */
23
+ export declare const applyThemePresetTool: PanelTool;
24
+ /**
25
+ * Tool: Export Theme
26
+ */
27
+ export declare const exportThemeTool: PanelTool;
28
+ /**
29
+ * All tools exported as an array.
30
+ */
31
+ export declare const themeEditorTools: PanelTool[];
32
+ /**
33
+ * Panel tools metadata for registration with PanelToolRegistry.
34
+ */
35
+ export declare const themeEditorToolsMetadata: PanelToolsMetadata;
36
+ //# 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,iBAAiB,EAAE,SA8B/B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,SAwB5B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,SAyBlC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,SA0B7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,SAAS,EAKvC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB,EAAE,kBAKtC,CAAC"}
@@ -0,0 +1,130 @@
1
+ // src/tools/index.ts
2
+ var setThemeColorTool = {
3
+ name: "set_theme_color",
4
+ description: "Sets a specific color in the Industry theme",
5
+ inputs: {
6
+ type: "object",
7
+ properties: {
8
+ colorKey: {
9
+ type: "string",
10
+ description: 'The color key to set (e.g., "primary", "secondary", "accent", "background")'
11
+ },
12
+ colorValue: {
13
+ type: "string",
14
+ description: 'The color value in hex format (e.g., "#ff5500")'
15
+ }
16
+ },
17
+ required: ["colorKey", "colorValue"]
18
+ },
19
+ outputs: {
20
+ type: "object",
21
+ properties: {
22
+ success: { type: "boolean" },
23
+ colorKey: { type: "string" },
24
+ colorValue: { type: "string" }
25
+ }
26
+ },
27
+ tags: ["theme", "color", "customization"],
28
+ tool_call_template: {
29
+ call_template_type: "panel_event",
30
+ event_type: "industry-theme.theme-editor:set-color"
31
+ }
32
+ };
33
+ var resetThemeTool = {
34
+ name: "reset_theme",
35
+ description: "Resets the theme to default Industry theme colors",
36
+ inputs: {
37
+ type: "object",
38
+ properties: {
39
+ confirmReset: {
40
+ type: "boolean",
41
+ description: "Confirm the reset action"
42
+ }
43
+ }
44
+ },
45
+ outputs: {
46
+ type: "object",
47
+ properties: {
48
+ success: { type: "boolean" },
49
+ message: { type: "string" }
50
+ }
51
+ },
52
+ tags: ["theme", "reset", "default"],
53
+ tool_call_template: {
54
+ call_template_type: "panel_event",
55
+ event_type: "industry-theme.theme-editor:reset-theme"
56
+ }
57
+ };
58
+ var applyThemePresetTool = {
59
+ name: "apply_theme_preset",
60
+ description: "Applies a predefined theme preset",
61
+ inputs: {
62
+ type: "object",
63
+ properties: {
64
+ presetName: {
65
+ type: "string",
66
+ description: 'The name of the preset to apply (e.g., "dark", "light", "high-contrast")'
67
+ }
68
+ },
69
+ required: ["presetName"]
70
+ },
71
+ outputs: {
72
+ type: "object",
73
+ properties: {
74
+ success: { type: "boolean" },
75
+ appliedPreset: { type: "string" }
76
+ }
77
+ },
78
+ tags: ["theme", "preset", "customization"],
79
+ tool_call_template: {
80
+ call_template_type: "panel_event",
81
+ event_type: "industry-theme.theme-editor:apply-preset"
82
+ }
83
+ };
84
+ var exportThemeTool = {
85
+ name: "export_theme",
86
+ description: "Exports the current theme configuration",
87
+ inputs: {
88
+ type: "object",
89
+ properties: {
90
+ format: {
91
+ type: "string",
92
+ enum: ["json", "css", "scss"],
93
+ description: "The export format"
94
+ }
95
+ }
96
+ },
97
+ outputs: {
98
+ type: "object",
99
+ properties: {
100
+ success: { type: "boolean" },
101
+ format: { type: "string" },
102
+ content: { type: "string" }
103
+ }
104
+ },
105
+ tags: ["theme", "export", "configuration"],
106
+ tool_call_template: {
107
+ call_template_type: "panel_event",
108
+ event_type: "industry-theme.theme-editor:export-theme"
109
+ }
110
+ };
111
+ var themeEditorTools = [
112
+ setThemeColorTool,
113
+ resetThemeTool,
114
+ applyThemePresetTool,
115
+ exportThemeTool
116
+ ];
117
+ var themeEditorToolsMetadata = {
118
+ id: "industry-theme.theme-editor",
119
+ name: "Theme Editor",
120
+ description: "Tools provided by the Industry Theme Editor panel extension",
121
+ tools: themeEditorTools
122
+ };
123
+ export {
124
+ themeEditorToolsMetadata,
125
+ themeEditorTools,
126
+ setThemeColorTool,
127
+ resetThemeTool,
128
+ exportThemeTool,
129
+ applyThemePresetTool
130
+ };
@@ -3,5 +3,5 @@
3
3
  *
4
4
  * Re-exports core types from @principal-ade/panel-framework-core
5
5
  */
6
- export type { DataSlice, WorkspaceMetadata, RepositoryMetadata, FileTreeSource, ActiveFileSlice, PanelEventType, PanelEvent, PanelEventEmitter, PanelActions, PanelContextValue, PanelComponentProps, PanelMetadata, PanelLifecycleHooks, PanelDefinition, PanelModule, PanelRegistryEntry, PanelLoader, PanelRegistryConfig, } from '@principal-ade/panel-framework-core';
6
+ export type { DataSlice, WorkspaceMetadata, RepositoryMetadata, FileTreeSource, ActiveFileSlice, PanelEventType, PanelEvent, PanelEventEmitter, PanelActions, PanelContextValue, PanelComponentProps, PanelMetadata, PanelLifecycleHooks, PanelDefinition, PanelModule, PanelRegistryEntry, PanelLoader, PanelRegistryConfig, PanelTool, PanelToolsMetadata, JsonSchema, PanelEventCallTemplate, } from '@principal-ade/panel-framework-core';
7
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,YAAY,EAEV,SAAS,EACT,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,eAAe,EAGf,cAAc,EACd,UAAU,EACV,iBAAiB,EAGjB,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,EAGnB,aAAa,EACb,mBAAmB,EACnB,eAAe,EACf,WAAW,EAGX,kBAAkB,EAClB,WAAW,EACX,mBAAmB,GACpB,MAAM,qCAAqC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,YAAY,EAEV,SAAS,EACT,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,eAAe,EAGf,cAAc,EACd,UAAU,EACV,iBAAiB,EAGjB,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,EAGnB,aAAa,EACb,mBAAmB,EACnB,eAAe,EACf,WAAW,EAGX,kBAAkB,EAClB,WAAW,EACX,mBAAmB,EAGnB,SAAS,EACT,kBAAkB,EAClB,UAAU,EACV,sBAAsB,GACvB,MAAM,qCAAqC,CAAC"}
package/package.json CHANGED
@@ -1,19 +1,34 @@
1
1
  {
2
2
  "name": "@industry-theme/theme-editor-panel",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Theme editor panel for customizing the Industry theme appearance and styling",
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": "Principal ADE",
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",
@@ -37,23 +52,20 @@
37
52
  }
38
53
  },
39
54
  "dependencies": {
40
- "@principal-ade/industry-theme": "^0.1.2",
41
- "@principal-ade/panel-framework-core": "^0.1.2",
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",
42
58
  "clsx": "^2.1.1",
43
59
  "lucide-react": "^0.552.0",
44
60
  "react-colorful": "^5.6.1"
45
61
  },
46
62
  "devDependencies": {
47
- "@chromatic-com/storybook": "^3.2.2",
63
+ "@chromatic-com/storybook": "^4.1.3",
48
64
  "@eslint/js": "^9.32.0",
49
- "@storybook/addon-essentials": "^8.5.0",
50
- "@storybook/addon-interactions": "^8.5.0",
51
- "@storybook/addon-links": "^8.5.0",
52
- "@storybook/addon-onboarding": "^8.5.0",
53
- "@storybook/blocks": "^8.5.0",
54
- "@storybook/react": "^8.5.0",
55
- "@storybook/react-vite": "^8.5.0",
56
- "@storybook/test": "^8.5.0",
65
+ "@storybook/addon-docs": "10.1.2",
66
+ "@storybook/addon-links": "10.1.2",
67
+ "@storybook/addon-onboarding": "10.1.2",
68
+ "@storybook/react-vite": "10.1.2",
57
69
  "@types/bun": "latest",
58
70
  "@types/node": "^22.15.26",
59
71
  "@types/react": "^19.0.0",
@@ -66,11 +78,11 @@
66
78
  "eslint-config-prettier": "^10.1.8",
67
79
  "eslint-plugin-react": "^7.37.2",
68
80
  "eslint-plugin-react-hooks": "^5.0.0",
69
- "eslint-plugin-storybook": "^0.11.1",
81
+ "eslint-plugin-storybook": "10.1.2",
70
82
  "prettier": "^3.6.2",
71
83
  "react": "^19.0.0",
72
84
  "react-dom": "^19.0.0",
73
- "storybook": "^8.5.0",
85
+ "storybook": "10.1.2",
74
86
  "typescript": "^5.0.4",
75
87
  "typescript-eslint": "^8.38.0",
76
88
  "vite": "^6.0.7"