@maka/maka-cli 5.1.40 → 5.1.42
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/.claude/codebase-overview.md +736 -0
- package/.claude/settings.local.json +17 -0
- package/bundle/typescript/package.json +8 -2
- package/bundle/typescript/src/commands/_index.d.ts +1 -1
- package/bundle/typescript/src/commands/_index.js +1 -1
- package/bundle/typescript/src/commands/_index.js.map +1 -1
- package/bundle/typescript/src/commands/ai/_index.d.ts +2 -0
- package/bundle/typescript/src/commands/ai/_index.js +3 -0
- package/bundle/typescript/src/commands/ai/_index.js.map +1 -0
- package/bundle/typescript/src/commands/ai/ai.command.d.ts +3 -0
- package/bundle/typescript/src/commands/{ai.js → ai/ai.command.js} +9 -7
- package/bundle/typescript/src/commands/ai/ai.command.js.map +1 -0
- package/bundle/typescript/src/commands/ai/mcp.sub.cmd.js +605 -0
- package/bundle/typescript/src/commands/ai/mcp.sub.cmd.js.map +1 -0
- package/bundle/typescript/src/commands/aws/cecr.sub.cmd.js +3 -1
- package/bundle/typescript/src/commands/aws/cecr.sub.cmd.js.map +1 -1
- package/bundle/typescript/src/commands/aws/lecr.sub.cmd.js +3 -1
- package/bundle/typescript/src/commands/aws/lecr.sub.cmd.js.map +1 -1
- package/bundle/typescript/src/commands/build/build.js +7 -1
- package/bundle/typescript/src/commands/build/build.js.map +1 -1
- package/bundle/typescript/src/commands/create.js +171 -36
- package/bundle/typescript/src/commands/create.js.map +1 -1
- package/bundle/typescript/src/commands/debug.js +20 -1
- package/bundle/typescript/src/commands/debug.js.map +1 -1
- package/bundle/typescript/src/commands/deploy/galaxy.sub.cmd.js +38 -8
- package/bundle/typescript/src/commands/deploy/galaxy.sub.cmd.js.map +1 -1
- package/bundle/typescript/src/commands/deploy/ubuntu.sub.cmd.js +47 -10
- package/bundle/typescript/src/commands/deploy/ubuntu.sub.cmd.js.map +1 -1
- package/bundle/typescript/src/commands/get/whoami.sub.cmd.js +3 -1
- package/bundle/typescript/src/commands/get/whoami.sub.cmd.js.map +1 -1
- package/bundle/typescript/src/commands/lint.js +4 -1
- package/bundle/typescript/src/commands/lint.js.map +1 -1
- package/bundle/typescript/src/commands/login.js +9 -1
- package/bundle/typescript/src/commands/login.js.map +1 -1
- package/bundle/typescript/src/commands/logout.js +3 -1
- package/bundle/typescript/src/commands/logout.js.map +1 -1
- package/bundle/typescript/src/commands/logs.js +3 -1
- package/bundle/typescript/src/commands/logs.js.map +1 -1
- package/bundle/typescript/src/commands/proxy.js +6 -1
- package/bundle/typescript/src/commands/proxy.js.map +1 -1
- package/bundle/typescript/src/commands/reconfig.js +1 -1
- package/bundle/typescript/src/commands/reconfig.js.map +1 -1
- package/bundle/typescript/src/commands/register.js +4 -1
- package/bundle/typescript/src/commands/register.js.map +1 -1
- package/bundle/typescript/src/commands/run/docker.sub.cmd.js +3 -1
- package/bundle/typescript/src/commands/run/docker.sub.cmd.js.map +1 -1
- package/bundle/typescript/src/commands/run/run.command.js +59 -12
- package/bundle/typescript/src/commands/run/run.command.js.map +1 -1
- package/bundle/typescript/src/commands/ssh.js +4 -1
- package/bundle/typescript/src/commands/ssh.js.map +1 -1
- package/bundle/typescript/src/commands/ssl.js +4 -1
- package/bundle/typescript/src/commands/ssl.js.map +1 -1
- package/bundle/typescript/src/commands/testCmd/mocha.sub.cmd.js +10 -10
- package/bundle/typescript/src/commands/testCmd/mocha.sub.cmd.js.map +1 -1
- package/bundle/typescript/src/commands/version/use.sub.cmd.js +15 -3
- package/bundle/typescript/src/commands/version/use.sub.cmd.js.map +1 -1
- package/bundle/typescript/src/commands/version/version.js +3 -1
- package/bundle/typescript/src/commands/version/version.js.map +1 -1
- package/bundle/typescript/src/generators/api.js +61 -9
- package/bundle/typescript/src/generators/api.js.map +1 -1
- package/bundle/typescript/src/generators/aws/cloudformation/cloudformation.js +1 -1
- package/bundle/typescript/src/generators/aws/cloudformation/cloudformation.js.map +1 -1
- package/bundle/typescript/src/generators/aws/cloudformation/create-ec2-instance.cf.gen.js +6 -3
- package/bundle/typescript/src/generators/aws/cloudformation/create-ec2-instance.cf.gen.js.map +1 -1
- package/bundle/typescript/src/generators/collection.js +8 -1
- package/bundle/typescript/src/generators/collection.js.map +1 -1
- package/bundle/typescript/src/generators/component.js +4 -1
- package/bundle/typescript/src/generators/component.js.map +1 -1
- package/bundle/typescript/src/generators/config.js +5 -1
- package/bundle/typescript/src/generators/config.js.map +1 -1
- package/bundle/typescript/src/generators/dbc.js +4 -1
- package/bundle/typescript/src/generators/dbc.js.map +1 -1
- package/bundle/typescript/src/generators/hook.js +3 -1
- package/bundle/typescript/src/generators/hook.js.map +1 -1
- package/bundle/typescript/src/generators/kits/_index.d.ts +1 -0
- package/bundle/typescript/src/generators/kits/_index.js +1 -0
- package/bundle/typescript/src/generators/kits/_index.js.map +1 -1
- package/bundle/typescript/src/generators/kits/auth/auth.generator.js +1 -1
- package/bundle/typescript/src/generators/kits/auth/auth.generator.js.map +1 -1
- package/bundle/typescript/src/generators/kits/auth/basic-meteor.auth.gen.js +5 -1
- package/bundle/typescript/src/generators/kits/auth/basic-meteor.auth.gen.js.map +1 -1
- package/bundle/typescript/src/generators/kits/auth/provider.auth.gen.js +5 -1
- package/bundle/typescript/src/generators/kits/auth/provider.auth.gen.js.map +1 -1
- package/bundle/typescript/src/generators/kits/esri/esri.generator.js +1 -1
- package/bundle/typescript/src/generators/kits/esri/esri.generator.js.map +1 -1
- package/bundle/typescript/src/generators/kits/esri/map.esri.gen.js +1 -1
- package/bundle/typescript/src/generators/kits/esri/map.esri.gen.js.map +1 -1
- package/bundle/typescript/src/generators/kits/frames/_index.d.ts +1 -0
- package/bundle/typescript/src/generators/kits/frames/_index.js +2 -0
- package/bundle/typescript/src/generators/kits/frames/_index.js.map +1 -0
- package/bundle/typescript/src/generators/kits/frames/frames.generator.d.ts +3 -0
- package/bundle/typescript/src/generators/kits/frames/frames.generator.js +163 -0
- package/bundle/typescript/src/generators/kits/frames/frames.generator.js.map +1 -0
- package/bundle/typescript/src/generators/kits/mui/auth.mui.gen.js +33 -14
- package/bundle/typescript/src/generators/kits/mui/auth.mui.gen.js.map +1 -1
- package/bundle/typescript/src/generators/kits/mui/frame.mui.gen.js +26 -6
- package/bundle/typescript/src/generators/kits/mui/frame.mui.gen.js.map +1 -1
- package/bundle/typescript/src/generators/kits/mui/mui.generator.js +19 -10
- package/bundle/typescript/src/generators/kits/mui/mui.generator.js.map +1 -1
- package/bundle/typescript/src/generators/layout.js +8 -2
- package/bundle/typescript/src/generators/layout.js.map +1 -1
- package/bundle/typescript/src/generators/methods.js +4 -1
- package/bundle/typescript/src/generators/methods.js.map +1 -1
- package/bundle/typescript/src/generators/package.js +7 -2
- package/bundle/typescript/src/generators/package.js.map +1 -1
- package/bundle/typescript/src/generators/page.js +6 -2
- package/bundle/typescript/src/generators/page.js.map +1 -1
- package/bundle/typescript/src/generators/publish.js +5 -1
- package/bundle/typescript/src/generators/publish.js.map +1 -1
- package/bundle/typescript/src/generators/route.js +4 -2
- package/bundle/typescript/src/generators/route.js.map +1 -1
- package/bundle/typescript/src/templates/meteor/template/template-tests.js.jsx +2 -2
- package/bundle/typescript/src/templates/meteor/template/template-tests.js.tsx +2 -2
- package/bundle/typescript/src/templates/meteor/template/template.js.jsx +2 -2
- package/bundle/typescript/src/templates/meteor/template/template.js.tsx +2 -2
- package/bundle/typescript/src/templates/react/hook/hook.js.jsx +1 -1
- package/bundle/typescript/src/templates/react/kit/auth/service/meteor-auth-service.js.jsx +4 -2
- package/bundle/typescript/src/templates/react/kit/frames/frames-demo.css +63 -0
- package/bundle/typescript/src/templates/react/kit/frames/frames-demo.jsx +153 -0
- package/bundle/typescript/src/templates/react/kit/frames/frames-demo.tsx +164 -0
- package/bundle/typescript/src/templates/react/kit/frames/workspace-manager.css +105 -0
- package/bundle/typescript/src/templates/react/kit/frames/workspace-manager.jsx +158 -0
- package/bundle/typescript/src/templates/react/kit/frames/workspace-manager.tsx +166 -0
- package/bundle/typescript/src/templates/react/kit/mui/auth/login/basic-login-page.js.jsx +3 -1
- package/bundle/typescript/src/templates/react/kit/mui/auth/login/basic-login-page.js.tsx +3 -1
- package/bundle/typescript/src/templates/react/test/test.js.jsx +2 -2
- package/bundle/typescript/src/templates/react/test/test.js.tsx +2 -2
- package/bundle/typescript/src/tools/fsi/fsi.interfaces.d.ts +3 -0
- package/bundle/typescript/src/tools/fsi/fsi.interfaces.js +3 -1
- package/bundle/typescript/src/tools/fsi/fsi.interfaces.js.map +1 -1
- package/docs/MCP_SERVER.md +396 -0
- package/package.json +8 -2
- package/bundle/typescript/src/commands/ai.js.map +0 -1
- /package/bundle/typescript/src/commands/{ai.d.ts → ai/mcp.sub.cmd.d.ts} +0 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
.<%= fileName %> {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
gap: 15px;
|
|
5
|
+
flex-wrap: wrap;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.workspace-selector {
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.workspace-select {
|
|
14
|
+
padding: 8px 12px;
|
|
15
|
+
border: 2px solid #667eea;
|
|
16
|
+
border-radius: 4px;
|
|
17
|
+
background: white;
|
|
18
|
+
font-size: 14px;
|
|
19
|
+
font-weight: 500;
|
|
20
|
+
color: #333;
|
|
21
|
+
cursor: pointer;
|
|
22
|
+
transition: all 0.2s ease;
|
|
23
|
+
min-width: 180px;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.workspace-select:hover {
|
|
27
|
+
border-color: #764ba2;
|
|
28
|
+
box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.workspace-select:focus {
|
|
32
|
+
outline: none;
|
|
33
|
+
border-color: #764ba2;
|
|
34
|
+
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.workspace-actions {
|
|
38
|
+
display: flex;
|
|
39
|
+
gap: 10px;
|
|
40
|
+
flex-wrap: wrap;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.workspace-btn {
|
|
44
|
+
padding: 8px 16px;
|
|
45
|
+
border: none;
|
|
46
|
+
border-radius: 4px;
|
|
47
|
+
font-size: 14px;
|
|
48
|
+
font-weight: 500;
|
|
49
|
+
cursor: pointer;
|
|
50
|
+
transition: all 0.2s ease;
|
|
51
|
+
white-space: nowrap;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.workspace-create-btn {
|
|
55
|
+
background: #667eea;
|
|
56
|
+
color: white;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.workspace-create-btn:hover {
|
|
60
|
+
background: #5568d3;
|
|
61
|
+
box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.workspace-rename-btn {
|
|
65
|
+
background: #48bb78;
|
|
66
|
+
color: white;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.workspace-rename-btn:hover {
|
|
70
|
+
background: #38a169;
|
|
71
|
+
box-shadow: 0 2px 4px rgba(72, 187, 120, 0.3);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.workspace-delete-btn {
|
|
75
|
+
background: #f56565;
|
|
76
|
+
color: white;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.workspace-delete-btn:hover {
|
|
80
|
+
background: #e53e3e;
|
|
81
|
+
box-shadow: 0 2px 4px rgba(245, 101, 101, 0.3);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.workspace-btn:active {
|
|
85
|
+
transform: translateY(1px);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
@media (max-width: 768px) {
|
|
89
|
+
.<%= fileName %> {
|
|
90
|
+
flex-direction: column;
|
|
91
|
+
align-items: stretch;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.workspace-select {
|
|
95
|
+
width: 100%;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.workspace-actions {
|
|
99
|
+
width: 100%;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.workspace-btn {
|
|
103
|
+
flex: 1;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import './<%= fileName %>.css';
|
|
2
|
+
import React, { Component } from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import { WorkspaceManager, WorkspaceStore } from 'meteor/maka:maka-frames';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* <%= className %> Component
|
|
8
|
+
*
|
|
9
|
+
* UI component for managing workspaces in the maka-frames package.
|
|
10
|
+
* Provides controls for creating, switching, renaming, and deleting workspaces.
|
|
11
|
+
*/
|
|
12
|
+
class <%= className %>Component extends Component {
|
|
13
|
+
static propTypes = {
|
|
14
|
+
currentWorkspaceId: PropTypes.string.isRequired,
|
|
15
|
+
allWorkspaces: PropTypes.array.isRequired,
|
|
16
|
+
user: PropTypes.object,
|
|
17
|
+
onWorkspaceSwitch: PropTypes.func
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
handleCreateWorkspace = () => {
|
|
21
|
+
const { user, onWorkspaceSwitch } = this.props;
|
|
22
|
+
|
|
23
|
+
const workspaceName = prompt('Enter workspace name:', `Workspace ${new Date().toLocaleTimeString()}`);
|
|
24
|
+
if (!workspaceName) return;
|
|
25
|
+
|
|
26
|
+
const workspaceId = `workspace-${Date.now()}`;
|
|
27
|
+
const workspaceData = {
|
|
28
|
+
id: workspaceId,
|
|
29
|
+
name: workspaceName,
|
|
30
|
+
frames: [],
|
|
31
|
+
createdAt: new Date(),
|
|
32
|
+
updatedAt: new Date()
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
// Use WorkspaceManager for logged-in users, WorkspaceStore for anonymous
|
|
36
|
+
if (user) {
|
|
37
|
+
WorkspaceManager.createWorkspace(workspaceData.id, workspaceData.name)
|
|
38
|
+
.then(() => {
|
|
39
|
+
console.log('Workspace created:', workspaceData.id);
|
|
40
|
+
if (onWorkspaceSwitch) onWorkspaceSwitch(workspaceData.id);
|
|
41
|
+
})
|
|
42
|
+
.catch((error) => {
|
|
43
|
+
console.error('Error creating workspace:', error);
|
|
44
|
+
});
|
|
45
|
+
} else {
|
|
46
|
+
WorkspaceStore.setWorkspace(workspaceData);
|
|
47
|
+
if (onWorkspaceSwitch) onWorkspaceSwitch(workspaceData.id);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
handleDeleteWorkspace = (workspaceId) => {
|
|
52
|
+
const { user, allWorkspaces, onWorkspaceSwitch } = this.props;
|
|
53
|
+
|
|
54
|
+
const workspace = allWorkspaces.find(ws => ws.id === workspaceId);
|
|
55
|
+
if (!workspace) return;
|
|
56
|
+
|
|
57
|
+
const confirmed = confirm(`Are you sure you want to delete "${workspace.name}"?`);
|
|
58
|
+
if (!confirmed) return;
|
|
59
|
+
|
|
60
|
+
// Use WorkspaceManager for logged-in users, WorkspaceStore for anonymous
|
|
61
|
+
if (user) {
|
|
62
|
+
WorkspaceManager.deleteWorkspace(workspaceId)
|
|
63
|
+
.then(() => {
|
|
64
|
+
console.log('Workspace deleted:', workspaceId);
|
|
65
|
+
// Switch to first available workspace
|
|
66
|
+
const remainingWorkspaces = allWorkspaces.filter(ws => ws.id !== workspaceId);
|
|
67
|
+
if (remainingWorkspaces.length > 0 && onWorkspaceSwitch) {
|
|
68
|
+
onWorkspaceSwitch(remainingWorkspaces[0].id);
|
|
69
|
+
}
|
|
70
|
+
})
|
|
71
|
+
.catch((error) => {
|
|
72
|
+
// Handle error (e.g., last workspace can't be deleted)
|
|
73
|
+
alert(error.message || 'Cannot delete workspace');
|
|
74
|
+
console.error('Error deleting workspace:', error);
|
|
75
|
+
});
|
|
76
|
+
} else {
|
|
77
|
+
const success = WorkspaceStore.deleteWorkspace(workspaceId);
|
|
78
|
+
if (success) {
|
|
79
|
+
// Switch to first available workspace
|
|
80
|
+
const remainingWorkspaces = allWorkspaces.filter(ws => ws.id !== workspaceId);
|
|
81
|
+
if (remainingWorkspaces.length > 0 && onWorkspaceSwitch) {
|
|
82
|
+
onWorkspaceSwitch(remainingWorkspaces[0].id);
|
|
83
|
+
}
|
|
84
|
+
} else {
|
|
85
|
+
alert('Cannot delete the last workspace');
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
handleRenameWorkspace = (workspaceId) => {
|
|
91
|
+
const { user, allWorkspaces } = this.props;
|
|
92
|
+
|
|
93
|
+
const workspace = allWorkspaces.find(ws => ws.id === workspaceId);
|
|
94
|
+
if (!workspace) return;
|
|
95
|
+
|
|
96
|
+
const newName = prompt('Enter new workspace name:', workspace.name);
|
|
97
|
+
if (!newName || newName === workspace.name) return;
|
|
98
|
+
|
|
99
|
+
// Use WorkspaceManager for logged-in users, WorkspaceStore for anonymous
|
|
100
|
+
if (user) {
|
|
101
|
+
WorkspaceManager.updateWorkspace(workspaceId, { name: newName });
|
|
102
|
+
} else {
|
|
103
|
+
const localWorkspace = WorkspaceStore.getWorkspace(workspaceId);
|
|
104
|
+
if (localWorkspace) {
|
|
105
|
+
localWorkspace.name = newName;
|
|
106
|
+
localWorkspace.updatedAt = new Date();
|
|
107
|
+
WorkspaceStore.setWorkspace(localWorkspace);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
render() {
|
|
113
|
+
const { currentWorkspaceId, allWorkspaces, onWorkspaceSwitch } = this.props;
|
|
114
|
+
|
|
115
|
+
return (
|
|
116
|
+
<div className="<%= fileName %>">
|
|
117
|
+
<div className="workspace-selector">
|
|
118
|
+
<select
|
|
119
|
+
value={currentWorkspaceId}
|
|
120
|
+
onChange={(e) => onWorkspaceSwitch && onWorkspaceSwitch(e.target.value)}
|
|
121
|
+
className="workspace-select"
|
|
122
|
+
>
|
|
123
|
+
{allWorkspaces.map(ws => (
|
|
124
|
+
<option key={ws.id} value={ws.id}>{ws.name}</option>
|
|
125
|
+
))}
|
|
126
|
+
</select>
|
|
127
|
+
</div>
|
|
128
|
+
|
|
129
|
+
<div className="workspace-actions">
|
|
130
|
+
<button
|
|
131
|
+
onClick={this.handleCreateWorkspace}
|
|
132
|
+
className="workspace-btn workspace-create-btn"
|
|
133
|
+
>
|
|
134
|
+
+ New Workspace
|
|
135
|
+
</button>
|
|
136
|
+
|
|
137
|
+
<button
|
|
138
|
+
onClick={() => this.handleRenameWorkspace(currentWorkspaceId)}
|
|
139
|
+
className="workspace-btn workspace-rename-btn"
|
|
140
|
+
>
|
|
141
|
+
Rename Workspace
|
|
142
|
+
</button>
|
|
143
|
+
|
|
144
|
+
{allWorkspaces.length > 1 && (
|
|
145
|
+
<button
|
|
146
|
+
onClick={() => this.handleDeleteWorkspace(currentWorkspaceId)}
|
|
147
|
+
className="workspace-btn workspace-delete-btn"
|
|
148
|
+
>
|
|
149
|
+
Delete Workspace
|
|
150
|
+
</button>
|
|
151
|
+
)}
|
|
152
|
+
</div>
|
|
153
|
+
</div>
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export { <%= className %>Component };
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import './<%= fileName %>.css';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Component } from 'react';
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
|
+
import { WorkspaceManager, WorkspaceStore } from 'meteor/maka:maka-frames';
|
|
6
|
+
|
|
7
|
+
interface <%= className %>Props {
|
|
8
|
+
currentWorkspaceId: string;
|
|
9
|
+
allWorkspaces: any[];
|
|
10
|
+
user?: any;
|
|
11
|
+
onWorkspaceSwitch?: (workspaceId: string) => void;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* <%= className %> Component
|
|
16
|
+
*
|
|
17
|
+
* UI component for managing workspaces in the maka-frames package.
|
|
18
|
+
* Provides controls for creating, switching, renaming, and deleting workspaces.
|
|
19
|
+
*/
|
|
20
|
+
class <%= className %>Component extends Component<<%= className %>Props> {
|
|
21
|
+
static propTypes = {
|
|
22
|
+
currentWorkspaceId: PropTypes.string.isRequired,
|
|
23
|
+
allWorkspaces: PropTypes.array.isRequired,
|
|
24
|
+
user: PropTypes.object,
|
|
25
|
+
onWorkspaceSwitch: PropTypes.func
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
handleCreateWorkspace = () => {
|
|
29
|
+
const { user, onWorkspaceSwitch } = this.props;
|
|
30
|
+
|
|
31
|
+
const workspaceName = prompt('Enter workspace name:', `Workspace ${new Date().toLocaleTimeString()}`);
|
|
32
|
+
if (!workspaceName) return;
|
|
33
|
+
|
|
34
|
+
const workspaceId = `workspace-${Date.now()}`;
|
|
35
|
+
const workspaceData = {
|
|
36
|
+
id: workspaceId,
|
|
37
|
+
name: workspaceName,
|
|
38
|
+
frames: [],
|
|
39
|
+
createdAt: new Date(),
|
|
40
|
+
updatedAt: new Date()
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
// Use WorkspaceManager for logged-in users, WorkspaceStore for anonymous
|
|
44
|
+
if (user) {
|
|
45
|
+
WorkspaceManager.createWorkspace(workspaceData.id, workspaceData.name)
|
|
46
|
+
.then(() => {
|
|
47
|
+
console.log('Workspace created:', workspaceData.id);
|
|
48
|
+
if (onWorkspaceSwitch) onWorkspaceSwitch(workspaceData.id);
|
|
49
|
+
})
|
|
50
|
+
.catch((error: any) => {
|
|
51
|
+
console.error('Error creating workspace:', error);
|
|
52
|
+
});
|
|
53
|
+
} else {
|
|
54
|
+
WorkspaceStore.setWorkspace(workspaceData);
|
|
55
|
+
if (onWorkspaceSwitch) onWorkspaceSwitch(workspaceData.id);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
handleDeleteWorkspace = (workspaceId: string) => {
|
|
60
|
+
const { user, allWorkspaces, onWorkspaceSwitch } = this.props;
|
|
61
|
+
|
|
62
|
+
const workspace = allWorkspaces.find(ws => ws.id === workspaceId);
|
|
63
|
+
if (!workspace) return;
|
|
64
|
+
|
|
65
|
+
const confirmed = confirm(`Are you sure you want to delete "${workspace.name}"?`);
|
|
66
|
+
if (!confirmed) return;
|
|
67
|
+
|
|
68
|
+
// Use WorkspaceManager for logged-in users, WorkspaceStore for anonymous
|
|
69
|
+
if (user) {
|
|
70
|
+
WorkspaceManager.deleteWorkspace(workspaceId)
|
|
71
|
+
.then(() => {
|
|
72
|
+
console.log('Workspace deleted:', workspaceId);
|
|
73
|
+
// Switch to first available workspace
|
|
74
|
+
const remainingWorkspaces = allWorkspaces.filter(ws => ws.id !== workspaceId);
|
|
75
|
+
if (remainingWorkspaces.length > 0 && onWorkspaceSwitch) {
|
|
76
|
+
onWorkspaceSwitch(remainingWorkspaces[0].id);
|
|
77
|
+
}
|
|
78
|
+
})
|
|
79
|
+
.catch((error: any) => {
|
|
80
|
+
// Handle error (e.g., last workspace can't be deleted)
|
|
81
|
+
alert(error.message || 'Cannot delete workspace');
|
|
82
|
+
console.error('Error deleting workspace:', error);
|
|
83
|
+
});
|
|
84
|
+
} else {
|
|
85
|
+
const success = WorkspaceStore.deleteWorkspace(workspaceId);
|
|
86
|
+
if (success) {
|
|
87
|
+
// Switch to first available workspace
|
|
88
|
+
const remainingWorkspaces = allWorkspaces.filter(ws => ws.id !== workspaceId);
|
|
89
|
+
if (remainingWorkspaces.length > 0 && onWorkspaceSwitch) {
|
|
90
|
+
onWorkspaceSwitch(remainingWorkspaces[0].id);
|
|
91
|
+
}
|
|
92
|
+
} else {
|
|
93
|
+
alert('Cannot delete the last workspace');
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
handleRenameWorkspace = (workspaceId: string) => {
|
|
99
|
+
const { user, allWorkspaces } = this.props;
|
|
100
|
+
|
|
101
|
+
const workspace = allWorkspaces.find(ws => ws.id === workspaceId);
|
|
102
|
+
if (!workspace) return;
|
|
103
|
+
|
|
104
|
+
const newName = prompt('Enter new workspace name:', workspace.name);
|
|
105
|
+
if (!newName || newName === workspace.name) return;
|
|
106
|
+
|
|
107
|
+
// Use WorkspaceManager for logged-in users, WorkspaceStore for anonymous
|
|
108
|
+
if (user) {
|
|
109
|
+
WorkspaceManager.updateWorkspace(workspaceId, { name: newName });
|
|
110
|
+
} else {
|
|
111
|
+
const localWorkspace = WorkspaceStore.getWorkspace(workspaceId);
|
|
112
|
+
if (localWorkspace) {
|
|
113
|
+
localWorkspace.name = newName;
|
|
114
|
+
localWorkspace.updatedAt = new Date();
|
|
115
|
+
WorkspaceStore.setWorkspace(localWorkspace);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
render() {
|
|
121
|
+
const { currentWorkspaceId, allWorkspaces, onWorkspaceSwitch } = this.props;
|
|
122
|
+
|
|
123
|
+
return (
|
|
124
|
+
<div className="<%= fileName %>">
|
|
125
|
+
<div className="workspace-selector">
|
|
126
|
+
<select
|
|
127
|
+
value={currentWorkspaceId}
|
|
128
|
+
onChange={(e) => onWorkspaceSwitch && onWorkspaceSwitch(e.target.value)}
|
|
129
|
+
className="workspace-select"
|
|
130
|
+
>
|
|
131
|
+
{allWorkspaces.map(ws => (
|
|
132
|
+
<option key={ws.id} value={ws.id}>{ws.name}</option>
|
|
133
|
+
))}
|
|
134
|
+
</select>
|
|
135
|
+
</div>
|
|
136
|
+
|
|
137
|
+
<div className="workspace-actions">
|
|
138
|
+
<button
|
|
139
|
+
onClick={this.handleCreateWorkspace}
|
|
140
|
+
className="workspace-btn workspace-create-btn"
|
|
141
|
+
>
|
|
142
|
+
+ New Workspace
|
|
143
|
+
</button>
|
|
144
|
+
|
|
145
|
+
<button
|
|
146
|
+
onClick={() => this.handleRenameWorkspace(currentWorkspaceId)}
|
|
147
|
+
className="workspace-btn workspace-rename-btn"
|
|
148
|
+
>
|
|
149
|
+
Rename Workspace
|
|
150
|
+
</button>
|
|
151
|
+
|
|
152
|
+
{allWorkspaces.length > 1 && (
|
|
153
|
+
<button
|
|
154
|
+
onClick={() => this.handleDeleteWorkspace(currentWorkspaceId)}
|
|
155
|
+
className="workspace-btn workspace-delete-btn"
|
|
156
|
+
>
|
|
157
|
+
Delete Workspace
|
|
158
|
+
</button>
|
|
159
|
+
)}
|
|
160
|
+
</div>
|
|
161
|
+
</div>
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export { <%= className %>Component };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React, { useContext, useEffect } from 'react';
|
|
2
2
|
import { Container, Paper, Typography, TextField, Button, Grid, Link } from '@mui/material';
|
|
3
|
-
import { useNavigate } from 'react-router-dom'
|
|
3
|
+
import { useNavigate } from 'react-router-dom';<% if (isSsr) { %>
|
|
4
|
+
import { AuthContext } from '/imports/startup/lib/authentication-provider';<% } else { %>
|
|
5
|
+
import { AuthContext } from '/imports/startup/client/authentication-provider';<% } %>
|
|
4
6
|
|
|
5
7
|
export const BasicLoginPage = () => {
|
|
6
8
|
const { currentUser, login } = useContext(AuthContext);
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React, { useContext, useEffect } from 'react';
|
|
2
2
|
import { Container, Paper, Typography, TextField, Button, Grid, Link } from '@mui/material';
|
|
3
|
-
import { useNavigate } from 'react-router-dom'
|
|
3
|
+
import { useNavigate } from 'react-router-dom';<% if (isSsr) { %>
|
|
4
|
+
import { AuthContext } from '/imports/startup/lib/authentication-provider';<% } else { %>
|
|
5
|
+
import { AuthContext } from '/imports/startup/client/authentication-provider';<% } %>
|
|
4
6
|
|
|
5
7
|
export const BasicLoginPage = () => {
|
|
6
8
|
const { currentUser, login } = useContext(AuthContext);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { render } from '@testing-library/react';
|
|
2
2
|
<% if (test === 'mocha') { %>import { expect } from 'chai';<% } %>
|
|
3
3
|
|
|
4
|
-
<% if(
|
|
4
|
+
<% if(clientGraphql === 'apollo') { %>
|
|
5
5
|
import { MockedProvider } from '@apollo/react-testing';
|
|
6
6
|
import gql from 'graphql-tag';
|
|
7
7
|
const mocks = [
|
|
@@ -24,7 +24,7 @@ const { <%=className%>%> } = require('./<%= fileName %>');
|
|
|
24
24
|
describe('<<%= className %>/>', function() {
|
|
25
25
|
|
|
26
26
|
it('did render', () => {
|
|
27
|
-
<%if(
|
|
27
|
+
<%if(clientGraphql === 'apollo') { %>
|
|
28
28
|
const <%=camelCaseName%> = render(
|
|
29
29
|
<MockedProvider mocks={mocks} addTypename={false}>
|
|
30
30
|
<<%= className %>/>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { render } from '@testing-library/react';
|
|
2
2
|
<% if (test === 'mocha') { %>import { expect } from 'chai';<% } %>
|
|
3
3
|
|
|
4
|
-
<% if(
|
|
4
|
+
<% if(clientGraphql === 'apollo') { %>
|
|
5
5
|
import { MockedProvider } from '@apollo/react-testing';
|
|
6
6
|
import gql from 'graphql-tag';
|
|
7
7
|
const mocks = [
|
|
@@ -24,7 +24,7 @@ const { <%=className%>%> } = require('./<%= fileName %>');
|
|
|
24
24
|
describe('<<%= className %>/>', function() {
|
|
25
25
|
|
|
26
26
|
it('did render', () => {
|
|
27
|
-
<%if(
|
|
27
|
+
<%if(clientGraphql === 'apollo') { %>
|
|
28
28
|
const <%=camelCaseName%> = render(
|
|
29
29
|
<MockedProvider mocks={mocks} addTypename={false}>
|
|
30
30
|
<<%= className %>/>
|
|
@@ -136,6 +136,8 @@ export declare enum CssEngines {
|
|
|
136
136
|
}
|
|
137
137
|
export declare enum ApiEngines {
|
|
138
138
|
REST = "rest",
|
|
139
|
+
RPC = "rpc",
|
|
140
|
+
GRAPHQL = "graphql",
|
|
139
141
|
NONE = "none"
|
|
140
142
|
}
|
|
141
143
|
export declare enum TestEngines {
|
|
@@ -164,6 +166,7 @@ export interface IEngines {
|
|
|
164
166
|
js?: JsEngines;
|
|
165
167
|
css?: CssEngines;
|
|
166
168
|
api?: ApiEngines;
|
|
169
|
+
apis?: ApiEngines[];
|
|
167
170
|
test?: TestEngines;
|
|
168
171
|
client?: ClientEngines;
|
|
169
172
|
graphql?: GraphqlEngines;
|
|
@@ -2,7 +2,7 @@ export const supportedEngines = {
|
|
|
2
2
|
html: ['html'],
|
|
3
3
|
js: ['js', 'jsx', 'ts', 'tsx'],
|
|
4
4
|
css: ['css', 'less', 'scss', 'none'],
|
|
5
|
-
api: ['rest', 'none'],
|
|
5
|
+
api: ['rest', 'rpc', 'graphql', 'none'],
|
|
6
6
|
test: ['jasmine', 'mocha', 'none'],
|
|
7
7
|
client: ['react', 'vanilla'],
|
|
8
8
|
graphql: ['apollo'],
|
|
@@ -31,6 +31,8 @@ export var CssEngines;
|
|
|
31
31
|
export var ApiEngines;
|
|
32
32
|
(function (ApiEngines) {
|
|
33
33
|
ApiEngines["REST"] = "rest";
|
|
34
|
+
ApiEngines["RPC"] = "rpc";
|
|
35
|
+
ApiEngines["GRAPHQL"] = "graphql";
|
|
34
36
|
ApiEngines["NONE"] = "none";
|
|
35
37
|
})(ApiEngines || (ApiEngines = {}));
|
|
36
38
|
export var TestEngines;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fsi.interfaces.js","sourceRoot":"","sources":["../../../../../src/tools/fsi/fsi.interfaces.ts"],"names":[],"mappings":"AAoIA,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,IAAI,EAAE,CAAC,MAAM,CAAC;IACd,EAAE,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC;IAC9B,GAAG,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;IACpC,GAAG,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"fsi.interfaces.js","sourceRoot":"","sources":["../../../../../src/tools/fsi/fsi.interfaces.ts"],"names":[],"mappings":"AAoIA,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,IAAI,EAAE,CAAC,MAAM,CAAC;IACd,EAAE,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC;IAC9B,GAAG,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;IACpC,GAAG,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC;IACvC,IAAI,EAAE,CAAC,SAAS,EAAE,OAAO,EAAE,MAAM,CAAC;IAClC,MAAM,EAAE,CAAC,OAAO,EAAE,SAAS,CAAC;IAC5B,OAAO,EAAE,CAAC,QAAQ,CAAC;IACnB,GAAG,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC;IAClB,KAAK,EAAE,CAAC,UAAU,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,6CAA6C;AAC7C,MAAM,CAAN,IAAY,WAEX;AAFD,WAAY,WAAW;IACrB,4BAAa,CAAA;AACf,CAAC,EAFW,WAAW,KAAX,WAAW,QAEtB;AAED,MAAM,CAAN,IAAY,SAKX;AALD,WAAY,SAAS;IACnB,sBAAS,CAAA;IACT,wBAAW,CAAA;IACX,sBAAS,CAAA;IACT,wBAAW,CAAA;AACb,CAAC,EALW,SAAS,KAAT,SAAS,QAKpB;AAED,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,yBAAW,CAAA;IACX,2BAAa,CAAA;IACb,2BAAa,CAAA;IACb,2BAAa,CAAA;AACf,CAAC,EALW,UAAU,KAAV,UAAU,QAKrB;AAED,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,2BAAa,CAAA;IACb,yBAAW,CAAA;IACX,iCAAmB,CAAA;IACnB,2BAAa,CAAA;AACf,CAAC,EALW,UAAU,KAAV,UAAU,QAKrB;AAED,MAAM,CAAN,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,8BAAe,CAAA;IACf,4BAAa,CAAA;AACf,CAAC,EAJW,WAAW,KAAX,WAAW,QAItB;AAED,MAAM,CAAN,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,gCAAe,CAAA;IACf,oCAAmB,CAAA;AACrB,CAAC,EAHW,aAAa,KAAb,aAAa,QAGxB;AAED,MAAM,CAAN,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,+BAAa,CAAA;IACb,mCAAiB,CAAA;AACnB,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB;AAED,MAAM,CAAN,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,2BAAa,CAAA;IACb,+BAAiB,CAAA;AACnB,CAAC,EAHW,UAAU,KAAV,UAAU,QAGrB;AAED,MAAM,CAAN,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,qCAAqB,CAAA;IACrB,6BAAa,CAAA;AACf,CAAC,EAHW,YAAY,KAAZ,YAAY,QAGvB"}
|