@ibgib/space-gib 0.0.32 โ 0.0.34
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/client/bootstrap.mjs +24 -51
- package/dist/client/chunk-25PXC4HP.mjs +9914 -0
- package/dist/client/chunk-RXWLL2AI.mjs +30 -0
- package/dist/client/css/activity-bar.css +417 -0
- package/dist/client/css/base.css +167 -0
- package/dist/client/css/components.css +218 -0
- package/dist/client/css/cosmic.css +557 -0
- package/dist/client/css/dev-tools.css +163 -0
- package/dist/client/css/landing.css +184 -0
- package/dist/client/css/layout.css +896 -0
- package/dist/client/css/onboarding.css +181 -0
- package/dist/client/css/repos.css +740 -0
- package/dist/client/css/variables.css +64 -0
- package/dist/client/index.html +202 -31
- package/dist/client/index.mjs +31 -31
- package/dist/client/script.mjs +1 -1
- package/dist/client/style.css +11 -1056
- package/dist/respec-gib.node.mjs +5 -0
- package/dist/server/server.mjs +6879 -3109
- package/package.json +6 -6
- package/src/client/AUTO-GENERATED-version.mts +1 -1
- package/src/client/cosmos/seed-cosmos-workspace.mts +69 -0
- package/src/client/css/activity-bar.css +417 -0
- package/src/client/css/base.css +167 -0
- package/src/client/css/components.css +218 -0
- package/src/client/css/cosmic.css +557 -0
- package/src/client/css/dev-tools.css +163 -0
- package/src/client/css/landing.css +184 -0
- package/src/client/css/layout.css +896 -0
- package/src/client/css/onboarding.css +181 -0
- package/src/client/css/repos.css +740 -0
- package/src/client/css/variables.css +64 -0
- package/src/client/dev-tools/vcs-workspace.mts +3 -3
- package/src/client/index.html +202 -31
- package/src/client/style.css +11 -1056
- package/src/client/ui/component/chat-view/IMPLEMENTATION.md +48 -0
- package/src/client/ui/component/chat-view/chat-view.css +381 -0
- package/src/client/ui/component/chat-view/chat-view.html +104 -0
- package/src/client/ui/component/chat-view/chat-view.mts +277 -0
- package/src/client/ui/component/chat-view/index.mts +9 -0
- package/src/client/ui/component/clone/IMPLEMENTATION.md +68 -0
- package/src/client/ui/component/clone/clone-constants.mts +16 -0
- package/src/client/ui/component/clone/clone-types.mts +60 -0
- package/src/client/ui/component/clone/clone.css +383 -0
- package/src/client/ui/component/clone/clone.html +89 -0
- package/src/client/ui/component/clone/clone.mts +620 -0
- package/src/client/ui/component/clone/index.mts +11 -0
- package/src/client/ui/component/code-editor/IMPLEMENTATION.md +89 -0
- package/src/client/ui/component/code-editor/code-editor.css +275 -0
- package/src/client/ui/component/code-editor/code-editor.html +54 -0
- package/src/client/ui/component/code-editor/code-editor.mts +427 -0
- package/src/client/ui/component/code-editor/index.mts +9 -0
- package/src/client/ui/component/cosmos-navigator/IMPLEMENTATION.md +31 -0
- package/src/client/ui/component/cosmos-navigator/cosmos-navigator.css +864 -0
- package/src/client/ui/component/cosmos-navigator/cosmos-navigator.html +97 -0
- package/src/client/ui/component/cosmos-navigator/cosmos-navigator.mts +1084 -0
- package/src/client/ui/component/cosmos-navigator/index.mts +18 -0
- package/src/client/ui/component/file-explorer/IMPLEMENTATION.md +42 -0
- package/src/client/ui/component/file-explorer/file-explorer.css +256 -0
- package/src/client/ui/component/file-explorer/file-explorer.html +75 -0
- package/src/client/ui/component/file-explorer/file-explorer.mts +346 -0
- package/src/client/ui/component/file-explorer/index.mts +9 -0
- package/src/client/ui/component/nested-chat/IMPLEMENTATION.md +18 -0
- package/src/client/ui/component/nested-chat/chat/IMPLEMENTATION.md +14 -0
- package/src/client/ui/component/nested-chat/chat/chat-constants.mts +14 -0
- package/src/client/ui/component/nested-chat/chat/chat-helpers.mts +66 -0
- package/src/client/ui/component/nested-chat/chat/chat.css +654 -0
- package/src/client/ui/component/nested-chat/chat/chat.html +90 -0
- package/src/client/ui/component/nested-chat/chat/chat.mts +646 -0
- package/src/client/ui/component/nested-chat/chat/index.mts +7 -0
- package/src/client/ui/component/nested-chat/index.mts +14 -0
- package/src/client/ui/component/nested-chat/nested-chat-constants.mts +12 -0
- package/src/client/ui/component/nested-chat/nested-chat-types.mts +53 -0
- package/src/client/ui/component/nested-chat/nested-chat.css +142 -0
- package/src/client/ui/component/nested-chat/nested-chat.html +11 -0
- package/src/client/ui/component/nested-chat/nested-chat.mts +393 -0
- package/src/client/ui/component/notes-explorer/index.mts +9 -0
- package/src/client/ui/component/notes-explorer/notes-explorer.css +313 -0
- package/src/client/ui/component/notes-explorer/notes-explorer.html +136 -0
- package/src/client/ui/component/notes-explorer/notes-explorer.mts +240 -0
- package/src/client/ui/component/notes-inspector/index.mts +9 -0
- package/src/client/ui/component/notes-inspector/notes-inspector.css +244 -0
- package/src/client/ui/component/notes-inspector/notes-inspector.html +97 -0
- package/src/client/ui/component/notes-inspector/notes-inspector.mts +152 -0
- package/src/client/ui/component/pitch/IMPLEMENTATION.md +48 -0
- package/src/client/ui/component/pitch/index.mts +9 -0
- package/src/client/ui/component/pitch/pitch.css +295 -0
- package/src/client/ui/component/pitch/pitch.html +97 -0
- package/src/client/ui/component/pitch/pitch.mts +135 -0
- package/src/client/ui/component/timeline/IMPLEMENTATION.md +33 -0
- package/src/client/ui/component/timeline/index.mts +9 -0
- package/src/client/ui/component/timeline/timeline.css +264 -0
- package/src/client/ui/component/timeline/timeline.html +23 -0
- package/src/client/ui/component/timeline/timeline.mts +317 -0
- package/src/client/ui/component/timeline-item-details/IMPLEMENTATION.md +28 -0
- package/src/client/ui/component/timeline-item-details/index.mts +9 -0
- package/src/client/ui/component/timeline-item-details/timeline-item-details.css +286 -0
- package/src/client/ui/component/timeline-item-details/timeline-item-details.html +64 -0
- package/src/client/ui/component/timeline-item-details/timeline-item-details.mts +194 -0
- package/src/client/ui/router/index.mts +3 -0
- package/src/client/ui/router/space-gib-router-helpers.mts +272 -0
- package/src/client/ui/router/space-gib-router-helpers.respec.mts +353 -0
- package/src/client/ui/router/space-gib-router-service.mts +186 -0
- package/src/client/ui/router/space-gib-router-types.mts +93 -0
- package/src/client/ui/shell/cosmic-big-bang.mts +844 -0
- package/src/client/ui/shell/space-gib-shell-constants.mts +7 -0
- package/src/client/ui/shell/space-gib-shell-service.mts +1728 -31
- package/src/server/server.mts +20 -1
- package/tsconfig.test.json +5 -1
- package/dist/client/chunk-AX6BROMT.mjs +0 -1
- package/dist/client/chunk-CIQUGV7U.mjs +0 -25
- package/dist/client/chunk-YPCHYDKL.mjs +0 -3102
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
import thisCss from "./chat-view.css";
|
|
2
|
+
import thisHtml from "./chat-view.html";
|
|
3
|
+
|
|
4
|
+
import { ROOT_ADDR } from "@ibgib/ts-gib/dist/V1/constants.mjs";
|
|
5
|
+
import { IbGibAddr } from "@ibgib/ts-gib/dist/types.mjs";
|
|
6
|
+
import { IbGib_V1 } from "@ibgib/ts-gib/dist/V1/types.mjs";
|
|
7
|
+
import { extractErrorMsg } from "@ibgib/helper-gib/dist/helpers/utils-helper.mjs";
|
|
8
|
+
import {
|
|
9
|
+
IbGibDynamicComponentMetaBase, IbGibDynamicComponentInstanceBase,
|
|
10
|
+
} from "@ibgib/web-gib/dist/ui/component/ibgib-dynamic-component-bases.mjs";
|
|
11
|
+
import {
|
|
12
|
+
ElementsBase, IbGibDynamicComponentInstance,
|
|
13
|
+
} from "@ibgib/web-gib/dist/ui/component/component-types.mjs";
|
|
14
|
+
import { getComponentCtorArg } from "@ibgib/web-gib/dist/app-bootstrap/init-orchestration.mjs";
|
|
15
|
+
|
|
16
|
+
export const CHAT_VIEW_COMPONENT_NAME = 'space-gib-chat-view';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Metadata factory for space-gib-chat-view Web Component.
|
|
20
|
+
*/
|
|
21
|
+
export class ChatViewComponentMeta extends IbGibDynamicComponentMetaBase {
|
|
22
|
+
protected lc: string = `[${ChatViewComponentMeta.name}]`;
|
|
23
|
+
|
|
24
|
+
routeRegExp?: RegExp = new RegExp(`^${CHAT_VIEW_COMPONENT_NAME}$`);
|
|
25
|
+
componentName = CHAT_VIEW_COMPONENT_NAME;
|
|
26
|
+
|
|
27
|
+
constructor() {
|
|
28
|
+
super(getComponentCtorArg());
|
|
29
|
+
if (!customElements.get(this.componentName)) {
|
|
30
|
+
customElements.define(this.componentName, ChatViewComponentInstance);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
async createInstance({
|
|
35
|
+
path,
|
|
36
|
+
ibGibAddr
|
|
37
|
+
}: {
|
|
38
|
+
path: string;
|
|
39
|
+
ibGibAddr: IbGibAddr;
|
|
40
|
+
}): Promise<IbGibDynamicComponentInstance> {
|
|
41
|
+
const component = document.createElement(this.componentName) as ChatViewComponentInstance;
|
|
42
|
+
await component.initialize({
|
|
43
|
+
ibGibAddr: ibGibAddr || ROOT_ADDR,
|
|
44
|
+
meta: this,
|
|
45
|
+
html: thisHtml,
|
|
46
|
+
css: [thisCss],
|
|
47
|
+
});
|
|
48
|
+
return component;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* References to DOM elements within the component's Shadow Root.
|
|
54
|
+
*/
|
|
55
|
+
export interface ChatViewElements extends ElementsBase {
|
|
56
|
+
rootEl: HTMLDivElement;
|
|
57
|
+
targetFileEl: HTMLSpanElement;
|
|
58
|
+
branchTipEl: HTMLSpanElement;
|
|
59
|
+
btnCloseEl: HTMLButtonElement;
|
|
60
|
+
messagesContainerEl: HTMLDivElement;
|
|
61
|
+
inputEl: HTMLTextAreaElement;
|
|
62
|
+
btnSendEl: HTMLButtonElement;
|
|
63
|
+
btnPinEl: HTMLButtonElement;
|
|
64
|
+
contentEl: HTMLDivElement;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface ChatMessageItem {
|
|
68
|
+
id: string;
|
|
69
|
+
author: string;
|
|
70
|
+
avatar: string;
|
|
71
|
+
role: 'Keystone' | 'Peer' | 'Agent';
|
|
72
|
+
timeAgo: string;
|
|
73
|
+
anchor?: string;
|
|
74
|
+
text: string;
|
|
75
|
+
callout?: string;
|
|
76
|
+
isInBandNote?: boolean;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Concrete implementation of the space-gib-chat-view component.
|
|
81
|
+
*/
|
|
82
|
+
export class ChatViewComponentInstance
|
|
83
|
+
extends IbGibDynamicComponentInstanceBase<IbGib_V1, ChatViewElements>
|
|
84
|
+
implements IbGibDynamicComponentInstance<IbGib_V1, ChatViewElements> {
|
|
85
|
+
|
|
86
|
+
protected lc: string = `[${ChatViewComponentInstance.name}]`;
|
|
87
|
+
|
|
88
|
+
private targetFile: string = 'src/index.ts';
|
|
89
|
+
private branchTip: string = 'main @ 7f8a1b2';
|
|
90
|
+
|
|
91
|
+
get el(): ChatViewElements {
|
|
92
|
+
if (!this.elements) {
|
|
93
|
+
throw new Error(`elements is not defined in ${this.lc}`);
|
|
94
|
+
}
|
|
95
|
+
return this.elements;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
private messages: ChatMessageItem[] = [
|
|
99
|
+
{
|
|
100
|
+
id: 'msg-1',
|
|
101
|
+
author: 'Alice',
|
|
102
|
+
avatar: '๐ฉโ๐ป',
|
|
103
|
+
role: 'Keystone',
|
|
104
|
+
timeAgo: '2m ago',
|
|
105
|
+
anchor: 'src/index.ts#L1-18',
|
|
106
|
+
text: 'Architectural Rationale: This entrypoint initializes the virtual repository workspace within the browserโs local IndexedDB metaspace.',
|
|
107
|
+
callout: 'Why Living Comments? Unlike centralized SaaS review comments, this discussion node is an in-band Merkle ibgib traveling directly with the branch DAG.',
|
|
108
|
+
isInBandNote: true,
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
id: 'msg-2',
|
|
112
|
+
author: 'Bob',
|
|
113
|
+
avatar: '๐จโ๐',
|
|
114
|
+
role: 'Peer',
|
|
115
|
+
timeAgo: '1m ago',
|
|
116
|
+
anchor: 'src/index.ts#L36-42',
|
|
117
|
+
text: 'Looks super clean! Should we add an async try/catch boundary around boot() as well?',
|
|
118
|
+
isInBandNote: false,
|
|
119
|
+
}
|
|
120
|
+
];
|
|
121
|
+
|
|
122
|
+
override async created(): Promise<void> {
|
|
123
|
+
const lc = `${this.lc}[${this.created.name}]`;
|
|
124
|
+
try {
|
|
125
|
+
const root = this.shadowRoot!;
|
|
126
|
+
this.elements = {
|
|
127
|
+
rootEl: root.getElementById('chat-root') as HTMLDivElement,
|
|
128
|
+
targetFileEl: root.getElementById('chat-target-file') as HTMLSpanElement,
|
|
129
|
+
branchTipEl: root.getElementById('chat-branch-tip') as HTMLSpanElement,
|
|
130
|
+
btnCloseEl: root.getElementById('btn-chat-close') as HTMLButtonElement,
|
|
131
|
+
messagesContainerEl: root.getElementById('chat-messages') as HTMLDivElement,
|
|
132
|
+
inputEl: root.getElementById('chat-input') as HTMLTextAreaElement,
|
|
133
|
+
btnSendEl: root.getElementById('btn-chat-send') as HTMLButtonElement,
|
|
134
|
+
btnPinEl: root.getElementById('btn-chat-pin') as HTMLButtonElement,
|
|
135
|
+
contentEl: root.getElementById('chat-root') as HTMLDivElement,
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
this.bindEvents();
|
|
139
|
+
this.renderMessages();
|
|
140
|
+
|
|
141
|
+
} catch (error) {
|
|
142
|
+
console.error(`${lc} ${extractErrorMsg(error)}`);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
private bindEvents(): void {
|
|
147
|
+
const lc = `${this.lc}[${this.bindEvents.name}]`;
|
|
148
|
+
if (!this.el) return;
|
|
149
|
+
|
|
150
|
+
this.el.btnSendEl?.addEventListener('click', () => this.sendMessage());
|
|
151
|
+
|
|
152
|
+
this.el.inputEl?.addEventListener('keydown', (e: KeyboardEvent) => {
|
|
153
|
+
if (e.key === 'Enter' && !e.shiftKey) {
|
|
154
|
+
e.preventDefault();
|
|
155
|
+
this.sendMessage();
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
this.el.btnCloseEl?.addEventListener('click', () => {
|
|
160
|
+
window.dispatchEvent(new CustomEvent('space-gib-chat-close-requested', {
|
|
161
|
+
bubbles: true,
|
|
162
|
+
composed: true,
|
|
163
|
+
}));
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
this.el.btnPinEl?.addEventListener('click', () => {
|
|
167
|
+
const currentPin = this.el?.btnPinEl?.querySelector('.tool-label')?.textContent || '';
|
|
168
|
+
const newPin = prompt('Pin comment to code reference (e.g. src/index.ts#L10-25):', currentPin);
|
|
169
|
+
if (newPin && this.el?.btnPinEl) {
|
|
170
|
+
const label = this.el.btnPinEl.querySelector('.tool-label');
|
|
171
|
+
if (label) { label.textContent = newPin; }
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
public sendMessage(): void {
|
|
177
|
+
const lc = `${this.lc}[${this.sendMessage.name}]`;
|
|
178
|
+
if (!this.el?.inputEl) return;
|
|
179
|
+
|
|
180
|
+
const text = this.el.inputEl.value.trim();
|
|
181
|
+
if (!text) { return; }
|
|
182
|
+
|
|
183
|
+
const pinLabel = this.el.btnPinEl?.querySelector('.tool-label')?.textContent || this.targetFile;
|
|
184
|
+
|
|
185
|
+
const newMsg: ChatMessageItem = {
|
|
186
|
+
id: `msg-${Date.now()}`,
|
|
187
|
+
author: 'You',
|
|
188
|
+
avatar: '๐ค',
|
|
189
|
+
role: 'Keystone',
|
|
190
|
+
timeAgo: 'just now',
|
|
191
|
+
anchor: pinLabel,
|
|
192
|
+
text,
|
|
193
|
+
isInBandNote: true,
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
this.messages.push(newMsg);
|
|
197
|
+
this.el.inputEl.value = '';
|
|
198
|
+
this.renderMessages();
|
|
199
|
+
|
|
200
|
+
// Scroll to bottom
|
|
201
|
+
if (this.el.messagesContainerEl) {
|
|
202
|
+
this.el.messagesContainerEl.scrollTop = this.el.messagesContainerEl.scrollHeight;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// Dispatch notification
|
|
206
|
+
window.dispatchEvent(new CustomEvent('space-gib-chat-message-sent', {
|
|
207
|
+
bubbles: true,
|
|
208
|
+
composed: true,
|
|
209
|
+
detail: {
|
|
210
|
+
message: newMsg,
|
|
211
|
+
targetFile: this.targetFile,
|
|
212
|
+
}
|
|
213
|
+
}));
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
private renderMessages(): void {
|
|
217
|
+
if (!this.el?.messagesContainerEl) return;
|
|
218
|
+
|
|
219
|
+
this.el.messagesContainerEl.innerHTML = this.messages.map(msg => `
|
|
220
|
+
<div class="chat-message ${msg.isInBandNote ? 'in-band-note' : 'peer-comment'}">
|
|
221
|
+
<div class="msg-header">
|
|
222
|
+
<div class="msg-author-group">
|
|
223
|
+
<span class="msg-avatar">${msg.avatar}</span>
|
|
224
|
+
<span class="msg-author">${msg.author}</span>
|
|
225
|
+
<span class="msg-badge">${msg.role}</span>
|
|
226
|
+
</div>
|
|
227
|
+
<span class="msg-time">${msg.timeAgo}</span>
|
|
228
|
+
</div>
|
|
229
|
+
${msg.anchor ? `
|
|
230
|
+
<div class="msg-anchor">
|
|
231
|
+
<span class="anchor-icon">๐</span>
|
|
232
|
+
<span class="anchor-label">${msg.anchor}</span>
|
|
233
|
+
${msg.isInBandNote ? '<span class="anchor-tag">Inverted Rel8n</span>' : ''}
|
|
234
|
+
</div>
|
|
235
|
+
` : ''}
|
|
236
|
+
<div class="msg-body">
|
|
237
|
+
<p>${msg.text}</p>
|
|
238
|
+
${msg.callout ? `
|
|
239
|
+
<div class="msg-callout">
|
|
240
|
+
<span class="callout-emoji">๐ก</span>
|
|
241
|
+
<div class="callout-text">${msg.callout}</div>
|
|
242
|
+
</div>
|
|
243
|
+
` : ''}
|
|
244
|
+
</div>
|
|
245
|
+
<div class="msg-footer">
|
|
246
|
+
<button class="msg-action-btn" type="button">Reply</button>
|
|
247
|
+
<button class="msg-action-btn" type="button">๐</button>
|
|
248
|
+
</div>
|
|
249
|
+
</div>
|
|
250
|
+
`).join('');
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
public setTargetFile(file: string, branchTip?: string): void {
|
|
254
|
+
this.targetFile = file;
|
|
255
|
+
if (branchTip) { this.branchTip = branchTip; }
|
|
256
|
+
|
|
257
|
+
if (this.el?.targetFileEl) {
|
|
258
|
+
this.el.targetFileEl.textContent = file;
|
|
259
|
+
}
|
|
260
|
+
if (this.el?.branchTipEl) {
|
|
261
|
+
this.el.branchTipEl.textContent = this.branchTip;
|
|
262
|
+
}
|
|
263
|
+
if (this.el?.btnPinEl) {
|
|
264
|
+
const label = this.el.btnPinEl.querySelector('.tool-label');
|
|
265
|
+
if (label) { label.textContent = file; }
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
override async disconnected(): Promise<void> {
|
|
270
|
+
const lc = `${this.lc}[${this.disconnected.name}]`;
|
|
271
|
+
try {
|
|
272
|
+
// cleanup if needed
|
|
273
|
+
} catch (error) {
|
|
274
|
+
console.error(`${lc} ${extractErrorMsg(error)}`);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { getComponentSvc } from "@ibgib/web-gib/dist/ui/component/ibgib-component-service.mjs";
|
|
2
|
+
import { ChatViewComponentMeta } from "./chat-view.mjs";
|
|
3
|
+
|
|
4
|
+
export * from "./chat-view.mjs";
|
|
5
|
+
|
|
6
|
+
export async function registerChatViewComponent(): Promise<void> {
|
|
7
|
+
const componentSvc = await getComponentSvc();
|
|
8
|
+
componentSvc.registerComponentMeta(new ChatViewComponentMeta());
|
|
9
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# space-gib-clone Component Implementation
|
|
2
|
+
|
|
3
|
+
## 1. Overview
|
|
4
|
+
`space-gib-clone` is a specialized Web Component providing a unified Clone & Export modal interface for `space-gib`. It allows users to clone workspaces, galaxies, branches, or individual files/directories across the 5-tier cosmos hierarchy via either terminal CLI commands (`vcs clone ...`) or browser archive downloads (.zip / .ibgib DAG bundle).
|
|
5
|
+
|
|
6
|
+
## 2. Target Scope Hierarchy & Mutual Exclusion Rules
|
|
7
|
+
The component provides a Target Scope Selector with three levels:
|
|
8
|
+
1. **`Cosmos`**: Entire project boundary containing multiple galaxies (e.g. Code Galaxy + Notes Galaxy).
|
|
9
|
+
2. **`Galaxy`**: Subspace representing a specific domain galaxy (e.g. Code Galaxy `</>` or Notes Galaxy `๐`) and its constituent branch spaces.
|
|
10
|
+
3. **`Single Item`**: Direct spacetime item (single file or directory tree) with its full timeline and companion comments.
|
|
11
|
+
|
|
12
|
+
### Mutual Exclusion / Greying-Out UX Rule:
|
|
13
|
+
- **Initiated with Single File/Folder Selected**:
|
|
14
|
+
- `Single Item` is automatically pre-selected.
|
|
15
|
+
- `Cosmos` and `Galaxy` scope options are strictly **disabled / greyed out**.
|
|
16
|
+
- Checkbox tree displays only the selected item path.
|
|
17
|
+
- **Initiated without Single Item (Global / Header / Cosmos / Galaxy context)**:
|
|
18
|
+
- `Single Item` is strictly **disabled / greyed out**.
|
|
19
|
+
- `Cosmos` and `Galaxy` scope options are available and selectable.
|
|
20
|
+
- Checkbox tree displays the full Cosmos hierarchy (Galaxies and constituent Branches).
|
|
21
|
+
|
|
22
|
+
## 3. Visual Layout Specification
|
|
23
|
+
```text
|
|
24
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
25
|
+
โ โค CLONE & EXPORT: Cosmos 1 [โ] โ
|
|
26
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
|
27
|
+
โ Target Scope: [ (โข) Cosmos ] [ ( ) Galaxy ] [ ( ) Single Item ] โ
|
|
28
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
|
29
|
+
โ SELECT GALAXIES & BRANCHES: โ
|
|
30
|
+
โ โ
|
|
31
|
+
โ โ๏ธ ๐ Cosmos 1 โ
|
|
32
|
+
โ โโโ โ๏ธ </> Code Galaxy โ
|
|
33
|
+
โ โ โโโ โ๏ธ ๐ฟ main (canonical) โ
|
|
34
|
+
โ โ โโโ โ ๐ฟ feature/cosmos-drift โ
|
|
35
|
+
โ โโโ โ๏ธ ๐ Notes Galaxy (Living companion discussions & comments) โ
|
|
36
|
+
โ โโโ โ๏ธ ๐ฟ main โ
|
|
37
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
|
38
|
+
โ CLONE METHOD: โ
|
|
39
|
+
โ โ
|
|
40
|
+
โ [ CLI Command ] [ Download ZIP ] [ Download .ibgib DAG ] โ
|
|
41
|
+
โ โ
|
|
42
|
+
โ $ vcs clone https://space-gib.localhost/cosmos-1 \ โ
|
|
43
|
+
โ --galaxy code:main --galaxy notes:main [๐ Copy]โ
|
|
44
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## 4. Dual Modalities
|
|
48
|
+
1. **CLI Command Tab**:
|
|
49
|
+
- Displays dynamically generated `vcs clone <url> [flags]` command matching the active scope and selected galaxies/branches (companion comments and discussions are managed directly via selection of the Notes Galaxy).
|
|
50
|
+
- Includes one-click `[๐ Copy]` button with feedback tooltip.
|
|
51
|
+
2. **Browser Download Tabs**:
|
|
52
|
+
- **Download ZIP**: Triggers browser download of a clean workspace projection archive.
|
|
53
|
+
- **Download .ibgib DAG**: Triggers browser export of the raw cryptographic ibgib dependency graph bundle.
|
|
54
|
+
|
|
55
|
+
## 5. Events & Interactions
|
|
56
|
+
- **Dispatches**:
|
|
57
|
+
- `space-gib-clone-closed`: When the user clicks the close button `[โ]`, cancels, or clicks the backdrop overlay.
|
|
58
|
+
- `space-gib-clone-executed`: When a download or clone action is triggered.
|
|
59
|
+
- **Listens for**:
|
|
60
|
+
- Direct invocations from `SpaceGibShellService.openCloneModal(options)`.
|
|
61
|
+
|
|
62
|
+
## 6. Implementation Checklist
|
|
63
|
+
- [x] Create `IMPLEMENTATION.md`
|
|
64
|
+
- [x] Create `clone-constants.mts` and `clone-types.mts`
|
|
65
|
+
- [x] Create `clone.html` and `clone.css`
|
|
66
|
+
- [x] Create `clone.mts` (Meta & Instance classes extending `IbGibDynamicComponentInstanceBase`)
|
|
67
|
+
- [x] Create `index.mts` and export registration function
|
|
68
|
+
- [x] Register in `SpaceGibShellService.registerComponents()` and connect launch triggers
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
|
|
2
|
+
export const CLONE_COMPONENT_NAME = 'space-gib-clone';
|
|
3
|
+
|
|
4
|
+
export const EVENT_SPACE_GIB_CLONE_CLOSED = 'space-gib-clone-closed';
|
|
5
|
+
export const EVENT_SPACE_GIB_CLONE_EXECUTED = 'space-gib-clone-executed';
|
|
6
|
+
|
|
7
|
+
export const CLONE_SCOPE_COSMOS = 'cosmos';
|
|
8
|
+
export const CLONE_SCOPE_GALAXY = 'galaxy';
|
|
9
|
+
export const CLONE_SCOPE_ITEM = 'item';
|
|
10
|
+
|
|
11
|
+
export const CLONE_MODALITY_CLI = 'cli';
|
|
12
|
+
export const CLONE_MODALITY_ZIP = 'zip';
|
|
13
|
+
export const CLONE_MODALITY_DAG = 'dag';
|
|
14
|
+
|
|
15
|
+
export const SETTINGS_TYPE_CLONE = 'clone';
|
|
16
|
+
export const CLONE_SETTINGS_TYPE = SETTINGS_TYPE_CLONE;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
|
|
2
|
+
import {
|
|
3
|
+
CLONE_SCOPE_COSMOS,
|
|
4
|
+
CLONE_SCOPE_GALAXY,
|
|
5
|
+
CLONE_SCOPE_ITEM,
|
|
6
|
+
CLONE_MODALITY_CLI,
|
|
7
|
+
CLONE_MODALITY_ZIP,
|
|
8
|
+
CLONE_MODALITY_DAG,
|
|
9
|
+
} from './clone-constants.mjs';
|
|
10
|
+
|
|
11
|
+
export type CloneScope =
|
|
12
|
+
| typeof CLONE_SCOPE_COSMOS
|
|
13
|
+
| typeof CLONE_SCOPE_GALAXY
|
|
14
|
+
| typeof CLONE_SCOPE_ITEM;
|
|
15
|
+
|
|
16
|
+
export type CloneModality =
|
|
17
|
+
| typeof CLONE_MODALITY_CLI
|
|
18
|
+
| typeof CLONE_MODALITY_ZIP
|
|
19
|
+
| typeof CLONE_MODALITY_DAG;
|
|
20
|
+
|
|
21
|
+
export interface CloneItemContext {
|
|
22
|
+
path: string;
|
|
23
|
+
isDir: boolean;
|
|
24
|
+
galaxyName?: string;
|
|
25
|
+
branchName?: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface CloneGalaxyBranchItem {
|
|
29
|
+
id: string;
|
|
30
|
+
name: string;
|
|
31
|
+
isCanonical?: boolean;
|
|
32
|
+
selected: boolean;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface CloneGalaxyTreeItem {
|
|
36
|
+
id: string;
|
|
37
|
+
name: string;
|
|
38
|
+
icon: string;
|
|
39
|
+
type: 'code' | 'notes' | string;
|
|
40
|
+
selected: boolean;
|
|
41
|
+
indeterminate?: boolean;
|
|
42
|
+
branches: CloneGalaxyBranchItem[];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface CloneTreeState {
|
|
46
|
+
cosmosId: string;
|
|
47
|
+
cosmosName: string;
|
|
48
|
+
selected: boolean;
|
|
49
|
+
indeterminate?: boolean;
|
|
50
|
+
galaxies: CloneGalaxyTreeItem[];
|
|
51
|
+
singleItem?: CloneItemContext;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface CloneModalOptions {
|
|
55
|
+
cosmosId?: string;
|
|
56
|
+
cosmosName?: string;
|
|
57
|
+
galaxyName?: string;
|
|
58
|
+
branchName?: string;
|
|
59
|
+
singleItem?: CloneItemContext;
|
|
60
|
+
}
|