@motiadev/workbench 0.8.2-beta.140-362903 → 0.8.2-beta.140-424079
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/motia-plugin/hmr.d.ts +4 -1
- package/dist/motia-plugin/hmr.js +77 -27
- package/dist/motia-plugin/index.d.ts +0 -24
- package/dist/motia-plugin/index.js +50 -16
- package/dist/src/App.js +18 -16
- package/dist/src/lib/plugins.d.ts +2 -1
- package/dist/src/lib/plugins.js +3 -3
- package/dist/src/stores/use-app-tabs-store.d.ts +0 -2
- package/dist/src/stores/use-app-tabs-store.js +0 -6
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/tsconfig.node.tsbuildinfo +1 -1
- package/motia-plugin/hmr.ts +90 -28
- package/motia-plugin/index.ts +59 -20
- package/package.json +4 -4
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import type { Printer } from '@motiadev/core';
|
|
1
2
|
import type { HmrContext, ModuleNode } from 'vite';
|
|
2
3
|
import type { WorkbenchPlugin } from './types';
|
|
4
|
+
export declare function isConfigFile(file: string): boolean;
|
|
3
5
|
/**
|
|
4
6
|
* Checks if a file change should trigger HMR for plugins.
|
|
5
7
|
*
|
|
@@ -14,6 +16,7 @@ export declare function shouldInvalidatePlugins(file: string, plugins: Workbench
|
|
|
14
16
|
*
|
|
15
17
|
* @param ctx - Vite's HMR context
|
|
16
18
|
* @param plugins - Current plugin configurations
|
|
19
|
+
* @param printer - Printer instance for logging
|
|
17
20
|
* @returns Array of modules to update, or undefined to continue with default behavior
|
|
18
21
|
*/
|
|
19
|
-
export declare function handlePluginHotUpdate(ctx: HmrContext, plugins: WorkbenchPlugin[]): ModuleNode[] |
|
|
22
|
+
export declare function handlePluginHotUpdate(ctx: HmrContext, plugins: WorkbenchPlugin[], printer: Printer): ModuleNode[] | undefined;
|
package/dist/motia-plugin/hmr.js
CHANGED
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.isConfigFile = isConfigFile;
|
|
3
7
|
exports.shouldInvalidatePlugins = shouldInvalidatePlugins;
|
|
4
8
|
exports.handlePluginHotUpdate = handlePluginHotUpdate;
|
|
9
|
+
const path_1 = __importDefault(require("path"));
|
|
10
|
+
const resolver_1 = require("./resolver");
|
|
5
11
|
const types_1 = require("./types");
|
|
6
12
|
const utils_1 = require("./utils");
|
|
13
|
+
const WATCHED_EXTENSIONS = ['.ts', '.tsx', '.js', '.jsx', '.css', '.scss', '.less'];
|
|
14
|
+
function isConfigFile(file) {
|
|
15
|
+
const normalizedFile = (0, utils_1.normalizePath)(file);
|
|
16
|
+
return normalizedFile.endsWith('motia.config.ts') || normalizedFile.endsWith('motia.config.js');
|
|
17
|
+
}
|
|
7
18
|
/**
|
|
8
19
|
* Checks if a file change should trigger HMR for plugins.
|
|
9
20
|
*
|
|
@@ -13,19 +24,28 @@ const utils_1 = require("./utils");
|
|
|
13
24
|
*/
|
|
14
25
|
function shouldInvalidatePlugins(file, plugins) {
|
|
15
26
|
const normalizedFile = (0, utils_1.normalizePath)(file);
|
|
16
|
-
|
|
27
|
+
const absoluteFile = path_1.default.isAbsolute(normalizedFile) ? normalizedFile : path_1.default.resolve(process.cwd(), normalizedFile);
|
|
28
|
+
if (isConfigFile(file)) {
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
const hasWatchedExtension = WATCHED_EXTENSIONS.some((ext) => absoluteFile.endsWith(ext));
|
|
32
|
+
if (!hasWatchedExtension) {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
17
35
|
for (const plugin of plugins) {
|
|
18
|
-
if (plugin.packageName
|
|
19
|
-
const
|
|
20
|
-
|
|
36
|
+
if ((0, utils_1.isLocalPlugin)(plugin.packageName)) {
|
|
37
|
+
const resolved = (0, resolver_1.resolvePluginPackage)(plugin);
|
|
38
|
+
const pluginAbsolutePath = path_1.default.isAbsolute(resolved.resolvedPath)
|
|
39
|
+
? resolved.resolvedPath
|
|
40
|
+
: path_1.default.resolve(process.cwd(), resolved.resolvedPath);
|
|
41
|
+
const normalizedPluginPath = pluginAbsolutePath.endsWith(path_1.default.sep)
|
|
42
|
+
? pluginAbsolutePath
|
|
43
|
+
: `${pluginAbsolutePath}${path_1.default.sep}`;
|
|
44
|
+
if (absoluteFile.startsWith(normalizedPluginPath) || absoluteFile === pluginAbsolutePath) {
|
|
21
45
|
return true;
|
|
22
46
|
}
|
|
23
47
|
}
|
|
24
48
|
}
|
|
25
|
-
// Check if it's a plugin configuration file
|
|
26
|
-
if (normalizedFile.endsWith('motia.config.ts') || normalizedFile.endsWith('motia.config.js')) {
|
|
27
|
-
return true;
|
|
28
|
-
}
|
|
29
49
|
return false;
|
|
30
50
|
}
|
|
31
51
|
/**
|
|
@@ -34,33 +54,63 @@ function shouldInvalidatePlugins(file, plugins) {
|
|
|
34
54
|
*
|
|
35
55
|
* @param ctx - Vite's HMR context
|
|
36
56
|
* @param plugins - Current plugin configurations
|
|
57
|
+
* @param printer - Printer instance for logging
|
|
37
58
|
* @returns Array of modules to update, or undefined to continue with default behavior
|
|
38
59
|
*/
|
|
39
|
-
function handlePluginHotUpdate(ctx, plugins) {
|
|
40
|
-
const { file, server } = ctx;
|
|
41
|
-
|
|
60
|
+
function handlePluginHotUpdate(ctx, plugins, printer) {
|
|
61
|
+
const { file, server, timestamp } = ctx;
|
|
62
|
+
printer.printPluginLog(`HMR: File changed: ${(0, utils_1.normalizePath)(file)}`);
|
|
42
63
|
// Check if this change affects plugins
|
|
43
64
|
if (!shouldInvalidatePlugins(file, plugins)) {
|
|
44
65
|
return; // Let Vite handle it normally
|
|
45
66
|
}
|
|
46
|
-
|
|
67
|
+
if (isConfigFile(file)) {
|
|
68
|
+
printer.printPluginLog('HMR: Config file changed, triggering full page reload');
|
|
69
|
+
printer.printPluginWarn('Configuration changes require a server restart for full effect. Please restart the dev server to apply all changes.');
|
|
70
|
+
server.ws.send({
|
|
71
|
+
type: 'full-reload',
|
|
72
|
+
path: '*',
|
|
73
|
+
});
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
printer.printPluginLog('HMR: Plugin change detected, invalidating virtual module');
|
|
47
77
|
// Find the virtual module
|
|
48
78
|
const virtualModule = server.moduleGraph.getModuleById(types_1.CONSTANTS.RESOLVED_VIRTUAL_MODULE_ID);
|
|
49
|
-
if (virtualModule) {
|
|
50
|
-
|
|
51
|
-
server.
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
if (virtualModule) {
|
|
57
|
-
modulesToUpdate.push(virtualModule);
|
|
58
|
-
}
|
|
59
|
-
// Add any modules that import the virtual module
|
|
60
|
-
const importers = virtualModule?.importers || new Set();
|
|
61
|
-
for (const importer of importers) {
|
|
62
|
-
modulesToUpdate.push(importer);
|
|
63
|
-
console.log('[motia-plugins] HMR: Invalidating importer:', importer.id);
|
|
79
|
+
if (!virtualModule) {
|
|
80
|
+
printer.printPluginWarn('HMR: Virtual module not found, triggering full reload');
|
|
81
|
+
server.ws.send({
|
|
82
|
+
type: 'full-reload',
|
|
83
|
+
path: '*',
|
|
84
|
+
});
|
|
85
|
+
return;
|
|
64
86
|
}
|
|
87
|
+
server.moduleGraph.invalidateModule(virtualModule, new Set(), timestamp);
|
|
88
|
+
printer.printPluginLog('HMR: Virtual module invalidated');
|
|
89
|
+
const modulesToUpdate = [virtualModule];
|
|
90
|
+
const processedModules = new Set([virtualModule]);
|
|
91
|
+
// Recursively add all importers
|
|
92
|
+
const addImporters = (module) => {
|
|
93
|
+
for (const importer of module.importers) {
|
|
94
|
+
if (!processedModules.has(importer)) {
|
|
95
|
+
processedModules.add(importer);
|
|
96
|
+
modulesToUpdate.push(importer);
|
|
97
|
+
server.moduleGraph.invalidateModule(importer, new Set(), timestamp);
|
|
98
|
+
addImporters(importer);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
addImporters(virtualModule);
|
|
103
|
+
server.ws.send({
|
|
104
|
+
type: 'update',
|
|
105
|
+
updates: modulesToUpdate
|
|
106
|
+
.filter((m) => m.url)
|
|
107
|
+
.map((m) => ({
|
|
108
|
+
type: m.type === 'css' ? 'css-update' : 'js-update',
|
|
109
|
+
path: m.url,
|
|
110
|
+
acceptedPath: m.url,
|
|
111
|
+
timestamp,
|
|
112
|
+
})),
|
|
113
|
+
});
|
|
114
|
+
printer.printPluginLog(`HMR: Updated ${modulesToUpdate.length} module(s)`);
|
|
65
115
|
return modulesToUpdate;
|
|
66
116
|
}
|
|
@@ -1,27 +1,3 @@
|
|
|
1
1
|
import type { Plugin } from 'vite';
|
|
2
2
|
import type { WorkbenchPlugin } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* Vite plugin for loading and managing Motia workbench plugins.
|
|
5
|
-
*
|
|
6
|
-
* Features:
|
|
7
|
-
* - Hot Module Replacement (HMR) support
|
|
8
|
-
* - Runtime validation with detailed error messages
|
|
9
|
-
* - Verbose logging for debugging
|
|
10
|
-
* - CSS injection for plugin styles
|
|
11
|
-
*
|
|
12
|
-
* @param plugins - Array of plugin configurations
|
|
13
|
-
* @param options - Optional loader configuration
|
|
14
|
-
* @returns Vite plugin instance
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```ts
|
|
18
|
-
* export default defineConfig({
|
|
19
|
-
* plugins: [
|
|
20
|
-
* motiaPluginsPlugin([
|
|
21
|
-
* { packageName: '@my-org/plugin', label: 'My Plugin' }
|
|
22
|
-
* ])
|
|
23
|
-
* ]
|
|
24
|
-
* })
|
|
25
|
-
* ```
|
|
26
|
-
*/
|
|
27
3
|
export default function motiaPluginsPlugin(plugins: WorkbenchPlugin[]): Plugin;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.default = motiaPluginsPlugin;
|
|
7
|
+
const core_1 = require("@motiadev/core");
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
4
9
|
const generator_1 = require("./generator");
|
|
5
10
|
const hmr_1 = require("./hmr");
|
|
6
11
|
const resolver_1 = require("./resolver");
|
|
@@ -31,6 +36,7 @@ const validator_1 = require("./validator");
|
|
|
31
36
|
* })
|
|
32
37
|
* ```
|
|
33
38
|
*/
|
|
39
|
+
const printer = new core_1.Printer(process.cwd());
|
|
34
40
|
function motiaPluginsPlugin(plugins) {
|
|
35
41
|
let devServer = null;
|
|
36
42
|
try {
|
|
@@ -38,25 +44,29 @@ function motiaPluginsPlugin(plugins) {
|
|
|
38
44
|
failFast: false,
|
|
39
45
|
});
|
|
40
46
|
if (!validationResult.valid) {
|
|
41
|
-
|
|
42
|
-
validationResult.errors
|
|
47
|
+
printer.printPluginError('Plugin configuration validation failed:');
|
|
48
|
+
for (const err of validationResult.errors) {
|
|
49
|
+
printer.printPluginError(` ${err}`);
|
|
50
|
+
}
|
|
43
51
|
throw new Error('Invalid plugin configuration. See errors above.');
|
|
44
52
|
}
|
|
45
53
|
if (validationResult.warnings.length > 0) {
|
|
46
|
-
|
|
54
|
+
for (const warning of validationResult.warnings) {
|
|
55
|
+
printer.printPluginWarn(warning);
|
|
56
|
+
}
|
|
47
57
|
}
|
|
48
58
|
}
|
|
49
59
|
catch (error) {
|
|
50
|
-
|
|
60
|
+
printer.printPluginError(`Failed to validate plugins: ${error}`);
|
|
51
61
|
throw error;
|
|
52
62
|
}
|
|
53
63
|
const alias = (0, resolver_1.createAliasConfig)(plugins);
|
|
54
|
-
|
|
64
|
+
printer.printPluginLog(`Initialized with ${plugins.length} plugin(s)`);
|
|
55
65
|
return {
|
|
56
66
|
name: 'vite-plugin-motia-plugins',
|
|
57
67
|
enforce: 'pre',
|
|
58
68
|
buildStart() {
|
|
59
|
-
|
|
69
|
+
printer.printPluginLog('Build started');
|
|
60
70
|
},
|
|
61
71
|
config: () => ({
|
|
62
72
|
resolve: {
|
|
@@ -65,7 +75,30 @@ function motiaPluginsPlugin(plugins) {
|
|
|
65
75
|
}),
|
|
66
76
|
configureServer(server) {
|
|
67
77
|
devServer = server;
|
|
68
|
-
|
|
78
|
+
printer.printPluginLog('Dev server configured, HMR enabled');
|
|
79
|
+
const configPaths = [path_1.default.join(process.cwd(), 'motia.config.ts'), path_1.default.join(process.cwd(), 'motia.config.js')];
|
|
80
|
+
for (const configPath of configPaths) {
|
|
81
|
+
server.watcher.add(configPath);
|
|
82
|
+
}
|
|
83
|
+
printer.printPluginLog('Watching for config file changes');
|
|
84
|
+
const localPlugins = plugins.filter((p) => (0, utils_1.isLocalPlugin)(p.packageName));
|
|
85
|
+
if (localPlugins.length > 0) {
|
|
86
|
+
printer.printPluginLog(`Watching ${localPlugins.length} local plugin(s)`);
|
|
87
|
+
for (const plugin of localPlugins) {
|
|
88
|
+
const resolved = (0, resolver_1.resolvePluginPackage)(plugin);
|
|
89
|
+
const watchPath = resolved.resolvedPath;
|
|
90
|
+
server.watcher.add(watchPath);
|
|
91
|
+
printer.printPluginLog(`Watching: ${watchPath}`);
|
|
92
|
+
}
|
|
93
|
+
server.watcher.on('change', (file) => {
|
|
94
|
+
const normalizedFile = (0, utils_1.normalizePath)(file);
|
|
95
|
+
printer.printPluginLog(`File watcher detected change: ${normalizedFile}`);
|
|
96
|
+
});
|
|
97
|
+
server.watcher.on('add', (file) => {
|
|
98
|
+
const normalizedFile = (0, utils_1.normalizePath)(file);
|
|
99
|
+
printer.printPluginLog(`File watcher detected new file: ${normalizedFile}`);
|
|
100
|
+
});
|
|
101
|
+
}
|
|
69
102
|
},
|
|
70
103
|
resolveId(id) {
|
|
71
104
|
if (id === types_1.CONSTANTS.VIRTUAL_MODULE_ID) {
|
|
@@ -76,14 +109,14 @@ function motiaPluginsPlugin(plugins) {
|
|
|
76
109
|
if (id !== types_1.CONSTANTS.RESOLVED_VIRTUAL_MODULE_ID) {
|
|
77
110
|
return null;
|
|
78
111
|
}
|
|
79
|
-
|
|
80
|
-
|
|
112
|
+
printer.printPluginLog('Loading plugins virtual module');
|
|
113
|
+
printer.printPluginLog('Generating plugin code...');
|
|
81
114
|
const code = (0, generator_1.generatePluginCode)(plugins);
|
|
82
115
|
if (!(0, generator_1.isValidCode)(code)) {
|
|
83
|
-
|
|
116
|
+
printer.printPluginError('Generated code is invalid or empty');
|
|
84
117
|
return 'export const plugins = []';
|
|
85
118
|
}
|
|
86
|
-
|
|
119
|
+
printer.printPluginLog('Plugin code generated successfully');
|
|
87
120
|
return code;
|
|
88
121
|
},
|
|
89
122
|
async transform(code, id) {
|
|
@@ -91,7 +124,7 @@ function motiaPluginsPlugin(plugins) {
|
|
|
91
124
|
if (!normalizedId.endsWith('src/index.css')) {
|
|
92
125
|
return null;
|
|
93
126
|
}
|
|
94
|
-
|
|
127
|
+
printer.printPluginLog('Injecting plugin CSS imports');
|
|
95
128
|
const cssImports = (0, generator_1.generateCssImports)(plugins);
|
|
96
129
|
if (!cssImports) {
|
|
97
130
|
return null;
|
|
@@ -103,16 +136,17 @@ function motiaPluginsPlugin(plugins) {
|
|
|
103
136
|
},
|
|
104
137
|
handleHotUpdate(ctx) {
|
|
105
138
|
if (!devServer) {
|
|
139
|
+
printer.printPluginWarn('HMR: Dev server not available');
|
|
106
140
|
return;
|
|
107
141
|
}
|
|
108
|
-
const modulesToUpdate = (0, hmr_1.handlePluginHotUpdate)(ctx, plugins);
|
|
109
|
-
if (modulesToUpdate) {
|
|
110
|
-
|
|
142
|
+
const modulesToUpdate = (0, hmr_1.handlePluginHotUpdate)(ctx, plugins, printer);
|
|
143
|
+
if (modulesToUpdate && modulesToUpdate.length > 0) {
|
|
144
|
+
printer.printPluginLog(`HMR: Successfully updated ${modulesToUpdate.length} module(s)`);
|
|
111
145
|
return modulesToUpdate;
|
|
112
146
|
}
|
|
113
147
|
},
|
|
114
148
|
buildEnd() {
|
|
115
|
-
|
|
149
|
+
printer.printPluginLog('Build ended');
|
|
116
150
|
},
|
|
117
151
|
};
|
|
118
152
|
}
|
package/dist/src/App.js
CHANGED
|
@@ -1,31 +1,33 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo } from 'react';
|
|
2
|
+
import { useEffect, useMemo } from 'react';
|
|
3
3
|
import { FlowPage } from './components/flow/flow-page';
|
|
4
4
|
import { FlowTabMenuItem } from './components/flow/flow-tab-menu-item';
|
|
5
5
|
import { registerPluginTabs } from './lib/plugins';
|
|
6
6
|
import { getViewModeFromURL } from './lib/utils';
|
|
7
7
|
import { ProjectViewMode } from './project-view-mode';
|
|
8
|
-
import {
|
|
8
|
+
import { TabLocation, useAppTabsStore } from './stores/use-app-tabs-store';
|
|
9
9
|
import { SystemViewMode } from './system-view-mode';
|
|
10
10
|
const TAB_IDS = {
|
|
11
11
|
FLOW: 'flow',
|
|
12
12
|
LOGS: 'logs',
|
|
13
13
|
};
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
];
|
|
22
|
-
const bottomTabs = [];
|
|
23
|
-
setAppTabs(TabLocation.TOP, topTabs);
|
|
24
|
-
setAppTabs(TabLocation.BOTTOM, bottomTabs);
|
|
25
|
-
};
|
|
26
|
-
registerDefaultTabs();
|
|
27
|
-
registerPluginTabs();
|
|
14
|
+
const topTabs = [
|
|
15
|
+
{
|
|
16
|
+
id: TAB_IDS.FLOW,
|
|
17
|
+
tabLabel: FlowTabMenuItem,
|
|
18
|
+
content: FlowPage,
|
|
19
|
+
},
|
|
20
|
+
];
|
|
28
21
|
export const App = () => {
|
|
22
|
+
const setTabs = useAppTabsStore((state) => state.setTabs);
|
|
23
|
+
const addTab = useAppTabsStore((state) => state.addTab);
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
const timeout = setTimeout(() => {
|
|
26
|
+
setTabs(TabLocation.TOP, topTabs);
|
|
27
|
+
registerPluginTabs(addTab);
|
|
28
|
+
}, 10);
|
|
29
|
+
return () => clearTimeout(timeout);
|
|
30
|
+
}, [setTabs, addTab]);
|
|
29
31
|
const viewMode = useMemo(getViewModeFromURL, []);
|
|
30
32
|
const ViewComponent = viewMode === 'project' ? ProjectViewMode : SystemViewMode;
|
|
31
33
|
return _jsx(ViewComponent, {});
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { type AppTab, TabLocation } from '@/stores/use-app-tabs-store';
|
|
2
|
+
export declare const registerPluginTabs: (addTab: (position: TabLocation, tab: AppTab) => void) => void;
|
package/dist/src/lib/plugins.js
CHANGED
|
@@ -2,9 +2,9 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
import { plugins } from 'virtual:motia-plugins';
|
|
3
3
|
import { DynamicIcon, dynamicIconImports } from 'lucide-react/dynamic';
|
|
4
4
|
import { memo } from 'react';
|
|
5
|
-
import {
|
|
5
|
+
import { TabLocation } from '@/stores/use-app-tabs-store';
|
|
6
6
|
import { isValidTabLocation } from './utils';
|
|
7
|
-
export const registerPluginTabs = () => {
|
|
7
|
+
export const registerPluginTabs = (addTab) => {
|
|
8
8
|
if (!Array.isArray(plugins)) {
|
|
9
9
|
console.warn('[Motia] Invalid plugins configuration: expected array');
|
|
10
10
|
return;
|
|
@@ -42,7 +42,7 @@ export const registerPluginTabs = () => {
|
|
|
42
42
|
return _jsx(Component, { ...props });
|
|
43
43
|
});
|
|
44
44
|
PluginContent.displayName = `${plugin.label}Content`;
|
|
45
|
-
|
|
45
|
+
addTab(tabLocation, {
|
|
46
46
|
id: plugin.label.toLowerCase(),
|
|
47
47
|
tabLabel: PluginTabLabel,
|
|
48
48
|
content: PluginContent,
|
|
@@ -14,5 +14,3 @@ export interface AppTabsState {
|
|
|
14
14
|
removeTab: (position: TabLocation, id: string) => void;
|
|
15
15
|
}
|
|
16
16
|
export declare const useAppTabsStore: import("zustand").UseBoundStore<import("zustand").StoreApi<AppTabsState>>;
|
|
17
|
-
export declare const setAppTabs: (position: TabLocation, tabs: AppTab[]) => void;
|
|
18
|
-
export declare const addAppTab: (position: TabLocation, tab: AppTab) => void;
|
|
@@ -29,9 +29,3 @@ export const useAppTabsStore = create((set) => ({
|
|
|
29
29
|
},
|
|
30
30
|
})),
|
|
31
31
|
}));
|
|
32
|
-
export const setAppTabs = (position, tabs) => {
|
|
33
|
-
useAppTabsStore.getState().setTabs(position, tabs);
|
|
34
|
-
};
|
|
35
|
-
export const addAppTab = (position, tab) => {
|
|
36
|
-
useAppTabsStore.getState().addTab(position, tab);
|
|
37
|
-
};
|