@jkwd/inbase 0.1.15 → 0.1.17

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.
@@ -19,7 +19,7 @@ import {
19
19
  folderOfFile,
20
20
  mapPointOntoFolder,
21
21
  } from '../layout'
22
- import { WORLD_VOID } from '../theme'
22
+ import { WORLD_VOID, CONFIG, fileHeight } from '../theme'
23
23
  import type {
24
24
  CodebaseGraph,
25
25
  FileNode,
@@ -33,6 +33,7 @@ import type {
33
33
  ViewMode,
34
34
  WorldLayout,
35
35
  } from '../types'
36
+ import { toCreatedFile } from '../userCreated'
36
37
 
37
38
  type WorldProps = {
38
39
  graph: CodebaseGraph
@@ -67,8 +68,11 @@ type WorldProps = {
67
68
  onBlueprintMenu?: (menu: MapBlueprintMenu) => void
68
69
  onCommitName?: (id: string, name: string) => boolean
69
70
  onCancelName?: (id: string) => void
71
+ onCommitIslandName?: (id: string, name: string) => boolean
72
+ onCancelIslandName?: (id: string) => void
70
73
  userCreatedBlocks?: UserCreatedBlock[]
71
74
  userCreatedIslands?: UserCreatedIsland[]
75
+ overlayBlocks?: UserCreatedBlock[]
72
76
  namingIslandId?: string | null
73
77
  mapGraph?: CodebaseGraph | null
74
78
  mapLayout?: WorldLayout | null
@@ -108,8 +112,11 @@ export function World({
108
112
  onBlueprintMenu,
109
113
  onCommitName,
110
114
  onCancelName,
115
+ onCommitIslandName,
116
+ onCancelIslandName,
111
117
  userCreatedBlocks = [],
112
118
  userCreatedIslands = [],
119
+ overlayBlocks = [],
113
120
  mapGraph = null,
114
121
  mapLayout = null,
115
122
  }: WorldProps) {
@@ -226,6 +233,7 @@ export function World({
226
233
  marker={mapMarker}
227
234
  highlightedFolders={highlightedFolders}
228
235
  selectedFolder={selectedFolder}
236
+ namingFolderPath={namingIslandId}
229
237
  onLand={onLand}
230
238
  onSelect={onSelect}
231
239
  onSelectFolder={onSelectFolder}
@@ -248,6 +256,18 @@ export function World({
248
256
  mapping ? highlightedFolders[folder.path] ?? null : null
249
257
  }
250
258
  labelVisible={!lod || lod.folderLabels.has(folder.path)}
259
+ onCommitName={
260
+ folder.path === namingIslandId && onCommitIslandName
261
+ ? (name) => {
262
+ onCommitIslandName(folder.path, name)
263
+ }
264
+ : undefined
265
+ }
266
+ onCancelName={
267
+ folder.path === namingIslandId && onCancelIslandName
268
+ ? () => onCancelIslandName(folder.path)
269
+ : undefined
270
+ }
251
271
  />
252
272
  )
253
273
  })}
@@ -309,6 +329,31 @@ export function World({
309
329
  )
310
330
  })}
311
331
  <DistantFileBlocks items={distantFiles} />
332
+ {overlayBlocks.map((block) => {
333
+ const file = toCreatedFile(block)
334
+ const height = fileHeight(12)
335
+ const placed: PlacedFile = {
336
+ id: block.id,
337
+ position: [block.x, height / 2 + 0.42, block.z],
338
+ size: [CONFIG.fileWidth, height, CONFIG.fileDepth],
339
+ aisleFace: 1,
340
+ }
341
+ return (
342
+ <FileBlock
343
+ key={`blueprint:${block.id}`}
344
+ file={file}
345
+ placed={placed}
346
+ selected={file.id === selectedId}
347
+ related={false}
348
+ planned={false}
349
+ changeKind="add"
350
+ added
351
+ dimmed={false}
352
+ mapMode={mapping}
353
+ labelVisible
354
+ />
355
+ )
356
+ })}
312
357
  {Object.values(ghosts).map((placed) => {
313
358
  const file: FileNode = {
314
359
  id: placed.id,
@@ -216,6 +216,15 @@ export type PatchImportAddition = {
216
216
  file: string
217
217
  }
218
218
 
219
+ export type BlueprintNoteKind = 'file' | 'function' | 'variable'
220
+
221
+ export type BlueprintNote = {
222
+ file: string
223
+ kind: BlueprintNoteKind
224
+ name?: string
225
+ note: string
226
+ }
227
+
219
228
  export type AimedRelation = {
220
229
  from: string
221
230
  to: string
@@ -250,13 +259,29 @@ export type WorkflowAction =
250
259
  | 'blueprint_no'
251
260
  | 'blueprint_send'
252
261
  | 'blueprint_update'
262
+ | 'blueprint_clear'
263
+ | 'blueprint_cleanup'
264
+ | 'blueprint_set_hidden'
253
265
  | 'focus'
254
266
  | 'set_step_by_step'
255
267
 
268
+ export type SharedBlueprint = {
269
+ hidden: boolean
270
+ revision: number
271
+ enabled: boolean
272
+ userCreatedBlocks: UserCreatedBlock[]
273
+ userCreatedIslands: UserCreatedIsland[]
274
+ addedFunctions: PatchSymbolAddition[]
275
+ addedVariables: PatchSymbolAddition[]
276
+ addedImports: PatchImportAddition[]
277
+ notes: BlueprintNote[]
278
+ }
279
+
256
280
  export type AgentIntentBundle = {
257
281
  focusedSessionId: string | null
258
282
  nextAttachSessionId: string | null
259
283
  intents: AgentIntent[]
284
+ blueprint: SharedBlueprint
260
285
  }
261
286
 
262
287
  export type AgentIntent = {
@@ -301,10 +326,13 @@ export type AgentIntent = {
301
326
  initialInstruction?: string | null
302
327
  creationMode: boolean
303
328
  canEnterBlueprint: boolean
329
+ blueprintHidden?: boolean
330
+ blueprintRevision?: number
304
331
  blueprintSessionId: string | null
305
332
  userCreatedBlocks: UserCreatedBlock[]
306
333
  userCreatedIslands: UserCreatedIsland[]
307
334
  blueprintFunctions: PatchSymbolAddition[]
308
335
  blueprintVariables: PatchSymbolAddition[]
309
336
  blueprintImports: PatchImportAddition[]
337
+ blueprintNotes: BlueprintNote[]
310
338
  }