@dxos/plugin-debug 0.8.3 → 0.8.4-main.28f8d3d
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/lib/browser/{DebugApp-WSEJPCKY.mjs → DebugApp-F4UFVW4Y.mjs} +64 -61
- package/dist/lib/browser/DebugApp-F4UFVW4Y.mjs.map +7 -0
- package/dist/lib/browser/{DevtoolsOverviewContainer-IIIWO77Q.mjs → DevtoolsOverviewContainer-EPD6EWT5.mjs} +2 -2
- package/dist/lib/browser/{SpaceGenerator-VB6IB2LL.mjs → SpaceGenerator-XJJAOTIT.mjs} +223 -481
- package/dist/lib/browser/SpaceGenerator-XJJAOTIT.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-builder-6HHJMKVU.mjs → app-graph-builder-PXPZIIGY.mjs} +7 -7
- package/dist/lib/browser/{app-graph-builder-6HHJMKVU.mjs.map → app-graph-builder-PXPZIIGY.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-47JOZTT2.mjs → chunk-5XPIRNQS.mjs} +2 -2
- package/dist/lib/browser/{chunk-KS3YBEL7.mjs → chunk-AJA6RYN3.mjs} +2 -2
- package/dist/lib/browser/index.mjs +13 -13
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-context-ZQRD2WG2.mjs → react-context-NVAGLAJD.mjs} +3 -3
- package/dist/lib/browser/{react-surface-UI6OK73H.mjs → react-surface-UNFNQFWK.mjs} +21 -21
- package/dist/lib/browser/react-surface-UNFNQFWK.mjs.map +7 -0
- package/dist/lib/browser/{settings-SXQWSIM4.mjs → settings-LSSWLM5I.mjs} +4 -4
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/DebugApp/DebugApp.d.ts.map +1 -1
- package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts +3 -1
- package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts.map +1 -1
- package/dist/types/src/components/SpaceGenerator/SpaceGenerator.d.ts +1 -1
- package/dist/types/src/components/SpaceGenerator/SpaceGenerator.d.ts.map +1 -1
- package/dist/types/src/components/SpaceGenerator/SpaceGenerator.stories.d.ts +1 -1
- package/dist/types/src/components/SpaceGenerator/SpaceGenerator.stories.d.ts.map +1 -1
- package/dist/types/src/components/SpaceGenerator/draw-util.d.ts.map +1 -1
- package/dist/types/src/components/SpaceGenerator/presets.d.ts +1 -4
- package/dist/types/src/components/SpaceGenerator/presets.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +60 -60
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +57 -58
- package/src/DebugPlugin.tsx +2 -2
- package/src/capabilities/app-graph-builder.ts +3 -3
- package/src/capabilities/react-surface.tsx +5 -5
- package/src/components/DebugApp/DebugApp.tsx +21 -13
- package/src/components/DebugSettings.tsx +2 -2
- package/src/components/SpaceGenerator/ObjectGenerator.tsx +31 -25
- package/src/components/SpaceGenerator/SpaceGenerator.stories.tsx +2 -2
- package/src/components/SpaceGenerator/SpaceGenerator.tsx +14 -71
- package/src/components/SpaceGenerator/draw-util.ts +3 -3
- package/src/components/SpaceGenerator/presets.ts +217 -215
- package/src/translations.ts +6 -4
- package/dist/lib/browser/DebugApp-WSEJPCKY.mjs.map +0 -7
- package/dist/lib/browser/SpaceGenerator-VB6IB2LL.mjs.map +0 -7
- package/dist/lib/browser/react-surface-UI6OK73H.mjs.map +0 -7
- /package/dist/lib/browser/{DevtoolsOverviewContainer-IIIWO77Q.mjs.map → DevtoolsOverviewContainer-EPD6EWT5.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-47JOZTT2.mjs.map → chunk-5XPIRNQS.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-KS3YBEL7.mjs.map → chunk-AJA6RYN3.mjs.map} +0 -0
- /package/dist/lib/browser/{react-context-ZQRD2WG2.mjs.map → react-context-NVAGLAJD.mjs.map} +0 -0
- /package/dist/lib/browser/{settings-SXQWSIM4.mjs.map → settings-LSSWLM5I.mjs.map} +0 -0
|
@@ -1,74 +1,68 @@
|
|
|
1
|
-
//
|
|
1
|
+
// src/components/SpaceGenerator/SpaceGenerator.tsx
|
|
2
2
|
import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
|
|
3
3
|
import React2, { useCallback, useMemo, useState } from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { useIntentDispatcher } from "@dxos/app-framework";
|
|
5
5
|
import { ComputeGraph as ComputeGraph2 } from "@dxos/conductor";
|
|
6
|
-
import { Filter as
|
|
7
|
-
import {
|
|
8
|
-
import { DocumentType as DocumentType2 } from "@dxos/plugin-markdown/types";
|
|
6
|
+
import { Filter as Filter2 } from "@dxos/echo";
|
|
7
|
+
import { Markdown as Markdown2 } from "@dxos/plugin-markdown/types";
|
|
9
8
|
import { SheetType as SheetType2 } from "@dxos/plugin-sheet/types";
|
|
10
9
|
import { DiagramType as DiagramType2 } from "@dxos/plugin-sketch/types";
|
|
11
|
-
import { SpaceAction } from "@dxos/plugin-space/types";
|
|
12
10
|
import { useClient } from "@dxos/react-client";
|
|
13
11
|
import { getTypename } from "@dxos/react-client/echo";
|
|
14
12
|
import { IconButton as IconButton2, Input, Toolbar, useAsyncEffect } from "@dxos/react-ui";
|
|
15
13
|
import { SyntaxHighlighter } from "@dxos/react-ui-syntax-highlighter";
|
|
16
|
-
import { initializeTable, TableType as TableType3 } from "@dxos/react-ui-table";
|
|
17
14
|
import { DataType as DataType2 } from "@dxos/schema";
|
|
18
15
|
import { jsonKeyReplacer, sortKeys } from "@dxos/util";
|
|
19
16
|
|
|
20
|
-
//
|
|
17
|
+
// src/components/SpaceGenerator/ObjectGenerator.tsx
|
|
18
|
+
import { createIntent } from "@dxos/app-framework";
|
|
21
19
|
import { addressToA1Notation } from "@dxos/compute";
|
|
22
20
|
import { ComputeGraph, ComputeGraphModel, DEFAULT_OUTPUT, NODE_INPUT, NODE_OUTPUT } from "@dxos/conductor";
|
|
23
|
-
import { DXN, Filter, Key, Obj, Ref } from "@dxos/echo";
|
|
24
|
-
import {
|
|
21
|
+
import { DXN, Filter, Key, Obj, Ref, Type } from "@dxos/echo";
|
|
22
|
+
import { Markdown } from "@dxos/plugin-markdown/types";
|
|
25
23
|
import { createSheet } from "@dxos/plugin-sheet/types";
|
|
26
24
|
import { SheetType } from "@dxos/plugin-sheet/types";
|
|
27
25
|
import { CanvasType, DiagramType } from "@dxos/plugin-sketch/types";
|
|
26
|
+
import { SpaceAction } from "@dxos/plugin-space/types";
|
|
28
27
|
import { faker } from "@dxos/random";
|
|
29
|
-
import {
|
|
30
|
-
import { createView, DataType } from "@dxos/schema";
|
|
28
|
+
import { DataType } from "@dxos/schema";
|
|
31
29
|
import { createAsyncGenerator } from "@dxos/schema/testing";
|
|
32
30
|
import { range } from "@dxos/util";
|
|
33
31
|
var generator = faker;
|
|
34
|
-
var
|
|
32
|
+
var findViewByTypename = async (views, typename) => {
|
|
33
|
+
return views.find((view) => view.query.typename === typename);
|
|
34
|
+
};
|
|
35
|
+
var createGenerator = (client, dispatch, schema) => {
|
|
35
36
|
return async (space, n, cb) => {
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const view = createView({
|
|
50
|
-
name,
|
|
51
|
-
typename: type.typename,
|
|
52
|
-
jsonSchema: schema.jsonSchema
|
|
53
|
-
});
|
|
54
|
-
space.db.add(Obj.make(TableType, {
|
|
55
|
-
name,
|
|
56
|
-
view: Ref.make(view)
|
|
37
|
+
const typename = schema.typename;
|
|
38
|
+
const { objects: views } = await space.db.query(Filter.type(DataType.View)).run();
|
|
39
|
+
const view = await findViewByTypename(views, typename);
|
|
40
|
+
const staticSchema = client?.graph.schemaRegistry.schemas.find((schema2) => Type.getTypename(schema2) === typename);
|
|
41
|
+
if (!view && !staticSchema) {
|
|
42
|
+
await dispatch(createIntent(SpaceAction.AddSchema, {
|
|
43
|
+
space,
|
|
44
|
+
schema
|
|
45
|
+
}));
|
|
46
|
+
} else if (!view && staticSchema) {
|
|
47
|
+
await dispatch(createIntent(SpaceAction.UseStaticSchema, {
|
|
48
|
+
space,
|
|
49
|
+
typename
|
|
57
50
|
}));
|
|
58
51
|
}
|
|
59
|
-
|
|
52
|
+
const generate = createAsyncGenerator(generator, schema, {
|
|
53
|
+
db: space.db
|
|
54
|
+
});
|
|
55
|
+
return generate.createObjects(n);
|
|
60
56
|
};
|
|
61
57
|
};
|
|
62
58
|
var staticGenerators = /* @__PURE__ */ new Map([
|
|
63
59
|
[
|
|
64
|
-
|
|
60
|
+
Markdown.Document.typename,
|
|
65
61
|
async (space, n, cb) => {
|
|
66
62
|
const objects = range(n).map(() => {
|
|
67
|
-
return space.db.add(
|
|
63
|
+
return space.db.add(Markdown.makeDocument({
|
|
68
64
|
name: faker.commerce.productName(),
|
|
69
|
-
content:
|
|
70
|
-
content: faker.lorem.sentences(5)
|
|
71
|
-
}))
|
|
65
|
+
content: faker.lorem.sentences(5)
|
|
72
66
|
}));
|
|
73
67
|
});
|
|
74
68
|
cb?.(objects);
|
|
@@ -202,58 +196,23 @@ var staticGenerators = /* @__PURE__ */ new Map([
|
|
|
202
196
|
]
|
|
203
197
|
]);
|
|
204
198
|
|
|
205
|
-
//
|
|
206
|
-
import {
|
|
207
|
-
import React from "react";
|
|
208
|
-
import { IconButton } from "@dxos/react-ui";
|
|
209
|
-
var SchemaTable = ({ types, objects = {}, label, onClick }) => {
|
|
210
|
-
var _effect = _useSignals();
|
|
211
|
-
try {
|
|
212
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
213
|
-
className: "grid grid-cols-[1fr_80px_40px] gap-1 overflow-none"
|
|
214
|
-
}, /* @__PURE__ */ React.createElement("h2", {
|
|
215
|
-
className: "p-2"
|
|
216
|
-
}, label), types.map((type) => /* @__PURE__ */ React.createElement("div", {
|
|
217
|
-
key: type.typename,
|
|
218
|
-
className: "grid grid-cols-subgrid col-span-3 items-center"
|
|
219
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
220
|
-
className: "px-2 text-sm font-mono text-subdued"
|
|
221
|
-
}, type.typename), /* @__PURE__ */ React.createElement("div", {
|
|
222
|
-
className: "px-2 text-right font-mono"
|
|
223
|
-
}, objects[type.typename] ?? 0), /* @__PURE__ */ React.createElement(IconButton, {
|
|
224
|
-
variant: "ghost",
|
|
225
|
-
icon: "ph--plus--regular",
|
|
226
|
-
iconOnly: true,
|
|
227
|
-
label: "Create data",
|
|
228
|
-
onClick: () => onClick(type.typename)
|
|
229
|
-
}))));
|
|
230
|
-
} finally {
|
|
231
|
-
_effect.f();
|
|
232
|
-
}
|
|
233
|
-
};
|
|
234
|
-
|
|
235
|
-
// packages/plugins/plugin-debug/src/components/SpaceGenerator/presets.ts
|
|
236
|
-
import { Schema, SchemaAST } from "effect";
|
|
199
|
+
// src/components/SpaceGenerator/presets.ts
|
|
200
|
+
import { Schema } from "effect";
|
|
237
201
|
import { NODE_INPUT as NODE_INPUT2 } from "@dxos/conductor";
|
|
238
|
-
import { DXN as DXN2, Key as Key2, Obj as Obj2, Ref as Ref2, Type } from "@dxos/echo";
|
|
239
|
-
import { FunctionTrigger, TriggerKind
|
|
202
|
+
import { DXN as DXN2, Key as Key2, Obj as Obj2, Ref as Ref2, Type as Type2 } from "@dxos/echo";
|
|
203
|
+
import { FunctionTrigger, TriggerKind } from "@dxos/functions";
|
|
240
204
|
import { invariant } from "@dxos/invariant";
|
|
241
|
-
import {
|
|
242
|
-
import { createAppend, createChat, createComputeGraph, createConstant, createFunction, createGpt, createQueue, createSurface, createRandom, createTemplate, createText, createTrigger } from "@dxos/react-ui-canvas-compute";
|
|
205
|
+
import { createAppend, createChat, createComputeGraph, createConstant, createFunction, createGpt, createQueue, createRandom, createSurface, createTemplate, createText, createTrigger } from "@dxos/react-ui-canvas-compute";
|
|
243
206
|
import { CanvasBoardType, CanvasGraphModel, pointMultiply, pointsToRect, rectToPoints } from "@dxos/react-ui-canvas-editor";
|
|
244
|
-
import { TableType as TableType2 } from "@dxos/react-ui-table";
|
|
245
207
|
import { range as range2 } from "@dxos/util";
|
|
246
|
-
var __dxlog_file = "/
|
|
208
|
+
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-debug/src/components/SpaceGenerator/presets.ts";
|
|
247
209
|
var PresetName = /* @__PURE__ */ function(PresetName2) {
|
|
248
|
-
PresetName2["EMAIL_TABLE"] = "email-table";
|
|
249
210
|
PresetName2["GPT_QUEUE"] = "webhook-gpt-queue";
|
|
250
211
|
PresetName2["CHAT_GPT"] = "chat-gpt-text";
|
|
251
|
-
PresetName2["EMAIL_WITH_SUMMARY"] = "email-gptSummary-table";
|
|
252
212
|
PresetName2["OBJECT_CHANGE_QUEUE"] = "objectChange-queue";
|
|
253
213
|
PresetName2["FOREX_FUNCTION_CALL"] = "forex-function-call";
|
|
254
214
|
PresetName2["TIMER_TICK_QUEUE"] = "timerTick-queue";
|
|
255
215
|
PresetName2["DISCORD_MESSAGES"] = "discord-messages";
|
|
256
|
-
PresetName2["KANBAN_QUEUE"] = "kanban-queue";
|
|
257
216
|
return PresetName2;
|
|
258
217
|
}({});
|
|
259
218
|
var generator2 = () => ({
|
|
@@ -349,101 +308,61 @@ var generator2 = () => ({
|
|
|
349
308
|
return objects;
|
|
350
309
|
}
|
|
351
310
|
],
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
builder.createEdge({
|
|
408
|
-
source: trigger.id,
|
|
409
|
-
target: template.id,
|
|
410
|
-
input: propName,
|
|
411
|
-
output: propName
|
|
412
|
-
});
|
|
413
|
-
templateContent.push(` "${propName}": "{{${propName}}}"` + (i === properties.length - 1 ? "" : ","));
|
|
414
|
-
}
|
|
415
|
-
templateContent.push("}");
|
|
416
|
-
builder.createEdge({
|
|
417
|
-
source: tableId.id,
|
|
418
|
-
target: appendToTable.id,
|
|
419
|
-
input: "id"
|
|
420
|
-
}).createEdge({
|
|
421
|
-
source: template.id,
|
|
422
|
-
target: appendToTable.id,
|
|
423
|
-
input: "items"
|
|
424
|
-
});
|
|
425
|
-
functionTrigger = triggerShape.functionTrigger.target;
|
|
426
|
-
});
|
|
427
|
-
const computeModel = createComputeGraph(canvasModel);
|
|
428
|
-
const templateComputeNode = computeModel.nodes.find((n2) => n2.id === template.node);
|
|
429
|
-
invariant(templateComputeNode, "Template compute node was not created.", {
|
|
430
|
-
F: __dxlog_file,
|
|
431
|
-
L: 182,
|
|
432
|
-
S: void 0,
|
|
433
|
-
A: [
|
|
434
|
-
"templateComputeNode",
|
|
435
|
-
"'Template compute node was not created.'"
|
|
436
|
-
]
|
|
437
|
-
});
|
|
438
|
-
templateComputeNode.value = templateContent.join("\n");
|
|
439
|
-
templateComputeNode.inputSchema = Type.toJsonSchema(EmailTriggerOutput);
|
|
440
|
-
attachTrigger(functionTrigger, computeModel);
|
|
441
|
-
return addToSpace("email-table", space, canvasModel, computeModel);
|
|
442
|
-
});
|
|
443
|
-
cb?.(objects);
|
|
444
|
-
return objects;
|
|
445
|
-
}
|
|
446
|
-
],
|
|
311
|
+
// TODO(wittjosiah): Remove?
|
|
312
|
+
// [
|
|
313
|
+
// PresetName.EMAIL_TABLE,
|
|
314
|
+
// async (space, n, cb) => {
|
|
315
|
+
// const objects = range(n, () => {
|
|
316
|
+
// const canvasModel = CanvasGraphModel.create<ComputeShape>();
|
|
317
|
+
// const results = space.db.query(Filter.type(TableType)).runSync();
|
|
318
|
+
// const emailTable = results.find((r) => r.object?.view?.target?.query?.typename?.endsWith('Email'));
|
|
319
|
+
// invariant(emailTable, 'Email table not found.');
|
|
320
|
+
// const template = canvasModel.createNode(
|
|
321
|
+
// createTemplate({
|
|
322
|
+
// valueType: 'object',
|
|
323
|
+
// ...rawPosition({ centerX: -80, centerY: -64, width: 320, height: 320 }),
|
|
324
|
+
// }),
|
|
325
|
+
// );
|
|
326
|
+
// const templateContent = ['{'];
|
|
327
|
+
// let functionTrigger: FunctionTrigger | undefined;
|
|
328
|
+
// canvasModel.builder.call((builder) => {
|
|
329
|
+
// const triggerShape = createTrigger({
|
|
330
|
+
// spaceId: space.id,
|
|
331
|
+
// triggerKind: TriggerKind.Email,
|
|
332
|
+
// ...position({ x: -18, y: -2 }),
|
|
333
|
+
// });
|
|
334
|
+
// const trigger = canvasModel.createNode(triggerShape);
|
|
335
|
+
// const tableId = canvasModel.createNode(
|
|
336
|
+
// createConstant({
|
|
337
|
+
// value: DXN.fromLocalObjectId(emailTable.id).toString(),
|
|
338
|
+
// ...position({ x: -18, y: 5, width: 8, height: 6 }),
|
|
339
|
+
// }),
|
|
340
|
+
// );
|
|
341
|
+
// const appendToTable = canvasModel.createNode(createAppend(position({ x: 10, y: 6 })));
|
|
342
|
+
// const properties = SchemaAST.getPropertySignatures(EmailTriggerOutput.ast);
|
|
343
|
+
// for (let i = 0; i < properties.length; i++) {
|
|
344
|
+
// const propName = properties[i].name.toString();
|
|
345
|
+
// builder.createEdge({ source: trigger.id, target: template.id, input: propName, output: propName });
|
|
346
|
+
// templateContent.push(` "${propName}": "{{${propName}}}"` + (i === properties.length - 1 ? '' : ','));
|
|
347
|
+
// }
|
|
348
|
+
// templateContent.push('}');
|
|
349
|
+
// builder
|
|
350
|
+
// .createEdge({ source: tableId.id, target: appendToTable.id, input: 'id' })
|
|
351
|
+
// .createEdge({ source: template.id, target: appendToTable.id, input: 'items' });
|
|
352
|
+
// functionTrigger = triggerShape.functionTrigger!.target!;
|
|
353
|
+
// });
|
|
354
|
+
// const computeModel = createComputeGraph(canvasModel);
|
|
355
|
+
// const templateComputeNode = computeModel.nodes.find((n) => n.id === template.node);
|
|
356
|
+
// invariant(templateComputeNode, 'Template compute node was not created.');
|
|
357
|
+
// templateComputeNode.value = templateContent.join('\n');
|
|
358
|
+
// templateComputeNode.inputSchema = Type.toJsonSchema(EmailTriggerOutput);
|
|
359
|
+
// attachTrigger(functionTrigger, computeModel);
|
|
360
|
+
// return addToSpace(PresetName.EMAIL_TABLE, space, canvasModel, computeModel);
|
|
361
|
+
// });
|
|
362
|
+
// cb?.(objects);
|
|
363
|
+
// return objects;
|
|
364
|
+
// },
|
|
365
|
+
// ],
|
|
447
366
|
[
|
|
448
367
|
"chat-gpt-text",
|
|
449
368
|
async (space, n, cb) => {
|
|
@@ -495,168 +414,86 @@ var generator2 = () => ({
|
|
|
495
414
|
return objects;
|
|
496
415
|
}
|
|
497
416
|
],
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
centerY: -544,
|
|
579
|
-
width: 192,
|
|
580
|
-
height: 256
|
|
581
|
-
})
|
|
582
|
-
}));
|
|
583
|
-
const appendToTable = canvasModel.createNode(createAppend(rawPosition({
|
|
584
|
-
centerX: 560,
|
|
585
|
-
centerY: -416,
|
|
586
|
-
width: 128,
|
|
587
|
-
height: 122
|
|
588
|
-
})));
|
|
589
|
-
templateContent.push(' "category": "{{text}}",');
|
|
590
|
-
builder.createEdge({
|
|
591
|
-
source: gpt.id,
|
|
592
|
-
target: template.id,
|
|
593
|
-
input: "text",
|
|
594
|
-
output: "text"
|
|
595
|
-
});
|
|
596
|
-
const properties = SchemaAST.getPropertySignatures(EmailTriggerOutput.ast);
|
|
597
|
-
for (let i = 0; i < properties.length; i++) {
|
|
598
|
-
const propName = properties[i].name.toString();
|
|
599
|
-
builder.createEdge({
|
|
600
|
-
source: trigger.id,
|
|
601
|
-
target: template.id,
|
|
602
|
-
input: propName,
|
|
603
|
-
output: propName
|
|
604
|
-
});
|
|
605
|
-
templateContent.push(` "${propName}": "{{${propName}}}"` + (i === properties.length - 1 ? "" : ","));
|
|
606
|
-
}
|
|
607
|
-
templateContent.push("}");
|
|
608
|
-
builder.createEdge({
|
|
609
|
-
source: tableId.id,
|
|
610
|
-
target: appendToTable.id,
|
|
611
|
-
input: "id"
|
|
612
|
-
}).createEdge({
|
|
613
|
-
source: queueId.id,
|
|
614
|
-
target: appendToQueue.id,
|
|
615
|
-
input: "id"
|
|
616
|
-
}).createEdge({
|
|
617
|
-
source: gpt.id,
|
|
618
|
-
target: appendToQueue.id,
|
|
619
|
-
output: "messages",
|
|
620
|
-
input: "items"
|
|
621
|
-
}).createEdge({
|
|
622
|
-
source: systemPrompt.id,
|
|
623
|
-
target: gpt.id,
|
|
624
|
-
input: "systemPrompt"
|
|
625
|
-
}).createEdge({
|
|
626
|
-
source: trigger.id,
|
|
627
|
-
target: gpt.id,
|
|
628
|
-
input: "prompt",
|
|
629
|
-
output: "body"
|
|
630
|
-
}).createEdge({
|
|
631
|
-
source: template.id,
|
|
632
|
-
target: appendToTable.id,
|
|
633
|
-
input: "items"
|
|
634
|
-
});
|
|
635
|
-
functionTrigger = triggerShape.functionTrigger.target;
|
|
636
|
-
});
|
|
637
|
-
const computeModel = createComputeGraph(canvasModel);
|
|
638
|
-
const templateComputeNode = computeModel.nodes.find((n2) => n2.id === template.node);
|
|
639
|
-
invariant(templateComputeNode, "Template compute node was not created.", {
|
|
640
|
-
F: __dxlog_file,
|
|
641
|
-
L: 305,
|
|
642
|
-
S: void 0,
|
|
643
|
-
A: [
|
|
644
|
-
"templateComputeNode",
|
|
645
|
-
"'Template compute node was not created.'"
|
|
646
|
-
]
|
|
647
|
-
});
|
|
648
|
-
templateComputeNode.value = templateContent.join("\n");
|
|
649
|
-
const extendedSchema = Schema.extend(EmailTriggerOutput, Schema.Struct({
|
|
650
|
-
text: Schema.String
|
|
651
|
-
}));
|
|
652
|
-
templateComputeNode.inputSchema = Type.toJsonSchema(extendedSchema);
|
|
653
|
-
attachTrigger(functionTrigger, computeModel);
|
|
654
|
-
return addToSpace("email-gptSummary-table", space, canvasModel, computeModel);
|
|
655
|
-
});
|
|
656
|
-
cb?.(objects);
|
|
657
|
-
return objects;
|
|
658
|
-
}
|
|
659
|
-
],
|
|
417
|
+
// TODO(wittjosiah): Remove?
|
|
418
|
+
// [
|
|
419
|
+
// PresetName.EMAIL_WITH_SUMMARY,
|
|
420
|
+
// async (space, n, cb) => {
|
|
421
|
+
// const objects = range(n, () => {
|
|
422
|
+
// const canvasModel = CanvasGraphModel.create<ComputeShape>();
|
|
423
|
+
// const results = space.db.query(Filter.type(TableType)).runSync();
|
|
424
|
+
// const emailTable = results.find((r) => r.object?.view?.target?.query?.typename?.endsWith('Email'));
|
|
425
|
+
// invariant(emailTable, 'Email table not found.');
|
|
426
|
+
// const template = canvasModel.createNode(
|
|
427
|
+
// createTemplate({
|
|
428
|
+
// valueType: 'object',
|
|
429
|
+
// ...rawPosition({ centerX: 192, centerY: -176, width: 320, height: 320 }),
|
|
430
|
+
// }),
|
|
431
|
+
// );
|
|
432
|
+
// const templateContent = ['{'];
|
|
433
|
+
// let functionTrigger: FunctionTrigger | undefined;
|
|
434
|
+
// canvasModel.builder.call((builder) => {
|
|
435
|
+
// const gpt = canvasModel.createNode(
|
|
436
|
+
// createGpt(rawPosition({ centerX: -400, centerY: -112, width: 256, height: 202 })),
|
|
437
|
+
// );
|
|
438
|
+
// const systemPrompt = canvasModel.createNode(
|
|
439
|
+
// createConstant({
|
|
440
|
+
// value: "use one word to describe content category. don't write anything else",
|
|
441
|
+
// ...rawPosition({ centerX: -800, centerY: -160, width: 192, height: 128 }),
|
|
442
|
+
// }),
|
|
443
|
+
// );
|
|
444
|
+
// const triggerShape = createTrigger({
|
|
445
|
+
// spaceId: space.id,
|
|
446
|
+
// triggerKind: TriggerKind.Email,
|
|
447
|
+
// ...rawPosition({ centerX: -736, centerY: -384, width: 182, height: 192 }),
|
|
448
|
+
// });
|
|
449
|
+
// const trigger = canvasModel.createNode(triggerShape);
|
|
450
|
+
// const { queueId } = setupQueue(space, canvasModel, {
|
|
451
|
+
// idPosition: { centerX: -720, centerY: 224, width: 192, height: 256 },
|
|
452
|
+
// queuePosition: { centerX: -144, centerY: 416, width: 320, height: 448 },
|
|
453
|
+
// });
|
|
454
|
+
// const appendToQueue = canvasModel.createNode(
|
|
455
|
+
// createAppend(rawPosition({ centerX: -80, centerY: 96, width: 122, height: 128 })),
|
|
456
|
+
// );
|
|
457
|
+
// const tableId = canvasModel.createNode(
|
|
458
|
+
// createConstant({
|
|
459
|
+
// value: DXN.fromLocalObjectId(emailTable.id).toString(),
|
|
460
|
+
// ...rawPosition({ centerX: -112, centerY: -544, width: 192, height: 256 }),
|
|
461
|
+
// }),
|
|
462
|
+
// );
|
|
463
|
+
// const appendToTable = canvasModel.createNode(
|
|
464
|
+
// createAppend(rawPosition({ centerX: 560, centerY: -416, width: 128, height: 122 })),
|
|
465
|
+
// );
|
|
466
|
+
// templateContent.push(' "category": "{{text}}",');
|
|
467
|
+
// builder.createEdge({ source: gpt.id, target: template.id, input: 'text', output: 'text' });
|
|
468
|
+
// const properties = SchemaAST.getPropertySignatures(EmailTriggerOutput.ast);
|
|
469
|
+
// for (let i = 0; i < properties.length; i++) {
|
|
470
|
+
// const propName = properties[i].name.toString();
|
|
471
|
+
// builder.createEdge({ source: trigger.id, target: template.id, input: propName, output: propName });
|
|
472
|
+
// templateContent.push(` "${propName}": "{{${propName}}}"` + (i === properties.length - 1 ? '' : ','));
|
|
473
|
+
// }
|
|
474
|
+
// templateContent.push('}');
|
|
475
|
+
// builder
|
|
476
|
+
// .createEdge({ source: tableId.id, target: appendToTable.id, input: 'id' })
|
|
477
|
+
// .createEdge({ source: queueId.id, target: appendToQueue.id, input: 'id' })
|
|
478
|
+
// .createEdge({ source: gpt.id, target: appendToQueue.id, output: 'messages', input: 'items' })
|
|
479
|
+
// .createEdge({ source: systemPrompt.id, target: gpt.id, input: 'systemPrompt' })
|
|
480
|
+
// .createEdge({ source: trigger.id, target: gpt.id, input: 'prompt', output: 'body' })
|
|
481
|
+
// .createEdge({ source: template.id, target: appendToTable.id, input: 'items' });
|
|
482
|
+
// functionTrigger = triggerShape.functionTrigger!.target!;
|
|
483
|
+
// });
|
|
484
|
+
// const computeModel = createComputeGraph(canvasModel);
|
|
485
|
+
// const templateComputeNode = computeModel.nodes.find((n) => n.id === template.node);
|
|
486
|
+
// invariant(templateComputeNode, 'Template compute node was not created.');
|
|
487
|
+
// templateComputeNode.value = templateContent.join('\n');
|
|
488
|
+
// const extendedSchema = Schema.extend(EmailTriggerOutput, Schema.Struct({ text: Schema.String }));
|
|
489
|
+
// templateComputeNode.inputSchema = Type.toJsonSchema(extendedSchema);
|
|
490
|
+
// attachTrigger(functionTrigger, computeModel);
|
|
491
|
+
// return addToSpace(PresetName.EMAIL_WITH_SUMMARY, space, canvasModel, computeModel);
|
|
492
|
+
// });
|
|
493
|
+
// cb?.(objects);
|
|
494
|
+
// return objects;
|
|
495
|
+
// },
|
|
496
|
+
// ],
|
|
660
497
|
[
|
|
661
498
|
"forex-function-call",
|
|
662
499
|
async (space, n, cb) => {
|
|
@@ -782,64 +619,6 @@ var generator2 = () => ({
|
|
|
782
619
|
cb?.(objects);
|
|
783
620
|
return objects;
|
|
784
621
|
}
|
|
785
|
-
],
|
|
786
|
-
[
|
|
787
|
-
"kanban-queue",
|
|
788
|
-
async (space, n, cb) => {
|
|
789
|
-
const objects = range2(n, () => {
|
|
790
|
-
const canvasModel = CanvasGraphModel.create();
|
|
791
|
-
const results = space.db.query(Filter2.type(TableType2)).runSync();
|
|
792
|
-
const messages = results.find((r) => r.object?.view?.target?.query?.typename?.endsWith("Message"));
|
|
793
|
-
invariant(messages, "Table not found.", {
|
|
794
|
-
F: __dxlog_file,
|
|
795
|
-
L: 411,
|
|
796
|
-
S: void 0,
|
|
797
|
-
A: [
|
|
798
|
-
"messages",
|
|
799
|
-
"'Table not found.'"
|
|
800
|
-
]
|
|
801
|
-
});
|
|
802
|
-
let functionTrigger;
|
|
803
|
-
canvasModel.builder.call((builder) => {
|
|
804
|
-
const triggerShape = createTrigger({
|
|
805
|
-
spaceId: space.id,
|
|
806
|
-
triggerKind: TriggerKind.Queue,
|
|
807
|
-
...position({
|
|
808
|
-
x: -10,
|
|
809
|
-
y: -5
|
|
810
|
-
})
|
|
811
|
-
});
|
|
812
|
-
const trigger = canvasModel.createNode(triggerShape);
|
|
813
|
-
const tableId = canvasModel.createNode(createConstant({
|
|
814
|
-
value: DXN2.fromLocalObjectId(messages.id).toString(),
|
|
815
|
-
...position({
|
|
816
|
-
x: -10,
|
|
817
|
-
y: 5
|
|
818
|
-
})
|
|
819
|
-
}));
|
|
820
|
-
const appendToTable = canvasModel.createNode(createAppend(position({
|
|
821
|
-
x: 10,
|
|
822
|
-
y: 0
|
|
823
|
-
})));
|
|
824
|
-
builder.createEdge({
|
|
825
|
-
source: tableId.id,
|
|
826
|
-
target: appendToTable.id,
|
|
827
|
-
input: "id"
|
|
828
|
-
}).createEdge({
|
|
829
|
-
source: trigger.id,
|
|
830
|
-
target: appendToTable.id,
|
|
831
|
-
input: "items",
|
|
832
|
-
output: "item"
|
|
833
|
-
});
|
|
834
|
-
functionTrigger = triggerShape.functionTrigger.target;
|
|
835
|
-
});
|
|
836
|
-
const computeModel = createComputeGraph(canvasModel);
|
|
837
|
-
attachTrigger(functionTrigger, computeModel);
|
|
838
|
-
return addToSpace("kanban-queue", space, canvasModel, computeModel);
|
|
839
|
-
});
|
|
840
|
-
cb?.(objects);
|
|
841
|
-
return objects;
|
|
842
|
-
}
|
|
843
622
|
]
|
|
844
623
|
]
|
|
845
624
|
});
|
|
@@ -909,7 +688,7 @@ var createQueueSinkPreset = (space, triggerKind, initSpec, triggerOutputName) =>
|
|
|
909
688
|
const triggerSpec = functionTrigger.spec;
|
|
910
689
|
invariant(triggerSpec && triggerSpec.kind === triggerKind, "No trigger spec.", {
|
|
911
690
|
F: __dxlog_file,
|
|
912
|
-
L:
|
|
691
|
+
L: 496,
|
|
913
692
|
S: void 0,
|
|
914
693
|
A: [
|
|
915
694
|
"triggerSpec && triggerSpec.kind === triggerKind",
|
|
@@ -922,7 +701,7 @@ var createQueueSinkPreset = (space, triggerKind, initSpec, triggerOutputName) =>
|
|
|
922
701
|
const templateComputeNode = computeModel.nodes.find((n) => n.id === template.node);
|
|
923
702
|
invariant(templateComputeNode, "Template compute node was not created.", {
|
|
924
703
|
F: __dxlog_file,
|
|
925
|
-
L:
|
|
704
|
+
L: 503,
|
|
926
705
|
S: void 0,
|
|
927
706
|
A: [
|
|
928
707
|
"templateComputeNode",
|
|
@@ -935,7 +714,7 @@ var createQueueSinkPreset = (space, triggerKind, initSpec, triggerOutputName) =>
|
|
|
935
714
|
' "id": "@{{changeId}}"',
|
|
936
715
|
"}"
|
|
937
716
|
].join("\n");
|
|
938
|
-
templateComputeNode.inputSchema =
|
|
717
|
+
templateComputeNode.inputSchema = Type2.toJsonSchema(Schema.Struct({
|
|
939
718
|
type: Schema.String,
|
|
940
719
|
changeId: Schema.String
|
|
941
720
|
}));
|
|
@@ -984,7 +763,7 @@ var setupQueue = (space, canvasModel, args) => {
|
|
|
984
763
|
var attachTrigger = (functionTrigger, computeModel) => {
|
|
985
764
|
invariant(functionTrigger, void 0, {
|
|
986
765
|
F: __dxlog_file,
|
|
987
|
-
L:
|
|
766
|
+
L: 542,
|
|
988
767
|
S: void 0,
|
|
989
768
|
A: [
|
|
990
769
|
"functionTrigger",
|
|
@@ -1039,24 +818,52 @@ var position = (rect) => {
|
|
|
1039
818
|
}
|
|
1040
819
|
};
|
|
1041
820
|
|
|
1042
|
-
//
|
|
1043
|
-
|
|
821
|
+
// src/components/SpaceGenerator/SchemaTable.tsx
|
|
822
|
+
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
823
|
+
import React from "react";
|
|
824
|
+
import { IconButton } from "@dxos/react-ui";
|
|
825
|
+
var SchemaTable = ({ types, objects = {}, label, onClick }) => {
|
|
826
|
+
var _effect = _useSignals();
|
|
827
|
+
try {
|
|
828
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
829
|
+
className: "grid grid-cols-[1fr_80px_40px] gap-1 overflow-none"
|
|
830
|
+
}, /* @__PURE__ */ React.createElement("h2", {
|
|
831
|
+
className: "p-2"
|
|
832
|
+
}, label), types.map((type) => /* @__PURE__ */ React.createElement("div", {
|
|
833
|
+
key: type.typename,
|
|
834
|
+
className: "grid grid-cols-subgrid col-span-3 items-center"
|
|
835
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
836
|
+
className: "px-2 text-sm font-mono text-subdued"
|
|
837
|
+
}, type.typename), /* @__PURE__ */ React.createElement("div", {
|
|
838
|
+
className: "px-2 text-right font-mono"
|
|
839
|
+
}, objects[type.typename] ?? 0), /* @__PURE__ */ React.createElement(IconButton, {
|
|
840
|
+
variant: "ghost",
|
|
841
|
+
icon: "ph--plus--regular",
|
|
842
|
+
iconOnly: true,
|
|
843
|
+
label: "Create data",
|
|
844
|
+
onClick: () => onClick(type.typename)
|
|
845
|
+
}))));
|
|
846
|
+
} finally {
|
|
847
|
+
_effect.f();
|
|
848
|
+
}
|
|
849
|
+
};
|
|
850
|
+
|
|
851
|
+
// src/components/SpaceGenerator/SpaceGenerator.tsx
|
|
1044
852
|
var SpaceGenerator = ({ space, onCreateObjects }) => {
|
|
1045
853
|
var _effect = _useSignals2();
|
|
1046
854
|
try {
|
|
1047
855
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
1048
856
|
const client = useClient();
|
|
1049
857
|
const staticTypes = [
|
|
1050
|
-
|
|
858
|
+
Markdown2.Document,
|
|
1051
859
|
DiagramType2,
|
|
1052
860
|
SheetType2,
|
|
1053
861
|
ComputeGraph2
|
|
1054
862
|
];
|
|
1055
|
-
const
|
|
863
|
+
const recordTypes = [
|
|
1056
864
|
DataType2.Organization,
|
|
1057
|
-
DataType2.Project,
|
|
1058
865
|
DataType2.Person,
|
|
1059
|
-
DataType2.
|
|
866
|
+
DataType2.Task
|
|
1060
867
|
];
|
|
1061
868
|
const [count, setCount] = useState(1);
|
|
1062
869
|
const [info, setInfo] = useState({});
|
|
@@ -1064,25 +871,26 @@ var SpaceGenerator = ({ space, onCreateObjects }) => {
|
|
|
1064
871
|
const typeMap = useMemo(() => {
|
|
1065
872
|
client.addTypes([
|
|
1066
873
|
...staticTypes,
|
|
874
|
+
...recordTypes,
|
|
1067
875
|
...presets.schemas
|
|
1068
876
|
]);
|
|
1069
|
-
const
|
|
877
|
+
const recordGenerators = new Map(recordTypes.map((type) => [
|
|
1070
878
|
type.typename,
|
|
1071
|
-
createGenerator(type)
|
|
879
|
+
createGenerator(client, dispatch, type)
|
|
1072
880
|
]));
|
|
1073
881
|
return new Map([
|
|
1074
882
|
...staticGenerators,
|
|
1075
883
|
...presets.items,
|
|
1076
|
-
...
|
|
884
|
+
...recordGenerators
|
|
1077
885
|
]);
|
|
1078
886
|
}, [
|
|
1079
887
|
client,
|
|
1080
|
-
|
|
888
|
+
recordTypes
|
|
1081
889
|
]);
|
|
1082
890
|
const updateInfo = async () => {
|
|
1083
891
|
const echoSchema = await space.db.schemaRegistry.query().run();
|
|
1084
892
|
const staticSchema = space.db.graph.schemaRegistry.schemas;
|
|
1085
|
-
const { objects } = await space.db.query(
|
|
893
|
+
const { objects } = await space.db.query(Filter2.everything()).run();
|
|
1086
894
|
const objectMap = sortKeys(objects.reduce((map, obj) => {
|
|
1087
895
|
const type = getTypename(obj);
|
|
1088
896
|
if (type) {
|
|
@@ -1112,67 +920,6 @@ var SpaceGenerator = ({ space, onCreateObjects }) => {
|
|
|
1112
920
|
typeMap,
|
|
1113
921
|
count
|
|
1114
922
|
]);
|
|
1115
|
-
const handleLoadTables = useCallback(async () => {
|
|
1116
|
-
const input = document.createElement("input");
|
|
1117
|
-
input.type = "file";
|
|
1118
|
-
input.accept = ".json";
|
|
1119
|
-
input.onchange = async (e) => {
|
|
1120
|
-
const file = e.target.files?.[0];
|
|
1121
|
-
if (!file) {
|
|
1122
|
-
return;
|
|
1123
|
-
}
|
|
1124
|
-
try {
|
|
1125
|
-
const content = await file.text();
|
|
1126
|
-
const data = JSON.parse(content);
|
|
1127
|
-
const schemas = await space.db.schemaRegistry.register(data.schemas.map(Type2.toEffectSchema));
|
|
1128
|
-
await Promise.all(schemas.map(async (schema) => {
|
|
1129
|
-
const parts = schema.typename.split("/");
|
|
1130
|
-
const name = parts[parts.length - 1];
|
|
1131
|
-
const table = Obj3.make(TableType3, {
|
|
1132
|
-
name,
|
|
1133
|
-
threads: []
|
|
1134
|
-
});
|
|
1135
|
-
await initializeTable({
|
|
1136
|
-
client,
|
|
1137
|
-
space,
|
|
1138
|
-
table,
|
|
1139
|
-
typename: schema.typename
|
|
1140
|
-
});
|
|
1141
|
-
await dispatch(createIntent(SpaceAction.AddObject, {
|
|
1142
|
-
target: space,
|
|
1143
|
-
object: table
|
|
1144
|
-
}));
|
|
1145
|
-
return table;
|
|
1146
|
-
}));
|
|
1147
|
-
await Promise.all(data.objects.map(async ({ id, "@type": typename, ...fields }) => {
|
|
1148
|
-
const schema = schemas.find((s) => `dxn:type:${s.typename}:${s.version}` === typename);
|
|
1149
|
-
if (!schema) {
|
|
1150
|
-
log.warn("Missing schema for object", {
|
|
1151
|
-
id,
|
|
1152
|
-
typename
|
|
1153
|
-
}, {
|
|
1154
|
-
F: __dxlog_file2,
|
|
1155
|
-
L: 125,
|
|
1156
|
-
S: void 0,
|
|
1157
|
-
C: (f, a) => f(...a)
|
|
1158
|
-
});
|
|
1159
|
-
return;
|
|
1160
|
-
}
|
|
1161
|
-
const object = Obj3.make(schema, fields);
|
|
1162
|
-
space.db.add(object);
|
|
1163
|
-
return object;
|
|
1164
|
-
}));
|
|
1165
|
-
} catch (err) {
|
|
1166
|
-
log.catch(err, void 0, {
|
|
1167
|
-
F: __dxlog_file2,
|
|
1168
|
-
L: 134,
|
|
1169
|
-
S: void 0,
|
|
1170
|
-
C: (f, a) => f(...a)
|
|
1171
|
-
});
|
|
1172
|
-
}
|
|
1173
|
-
};
|
|
1174
|
-
input.click();
|
|
1175
|
-
}, []);
|
|
1176
923
|
return /* @__PURE__ */ React2.createElement("div", {
|
|
1177
924
|
role: "none",
|
|
1178
925
|
className: "flex flex-col grow overflow-hidden"
|
|
@@ -1183,11 +930,6 @@ var SpaceGenerator = ({ space, onCreateObjects }) => {
|
|
|
1183
930
|
iconOnly: true,
|
|
1184
931
|
label: "Refresh",
|
|
1185
932
|
onClick: updateInfo
|
|
1186
|
-
}), /* @__PURE__ */ React2.createElement(IconButton2, {
|
|
1187
|
-
icon: "ph--file-arrow-up--regular",
|
|
1188
|
-
iconOnly: true,
|
|
1189
|
-
label: "Load tables from JSON",
|
|
1190
|
-
onClick: handleLoadTables
|
|
1191
933
|
}), /* @__PURE__ */ React2.createElement(Toolbar.Separator, {
|
|
1192
934
|
variant: "gap"
|
|
1193
935
|
}), /* @__PURE__ */ React2.createElement(Input.Root, null, /* @__PURE__ */ React2.createElement(Input.TextInput, {
|
|
@@ -1207,9 +949,9 @@ var SpaceGenerator = ({ space, onCreateObjects }) => {
|
|
|
1207
949
|
label: "Static Types",
|
|
1208
950
|
onClick: handleCreateData
|
|
1209
951
|
}), /* @__PURE__ */ React2.createElement(SchemaTable, {
|
|
1210
|
-
types:
|
|
952
|
+
types: recordTypes,
|
|
1211
953
|
objects: info.objects,
|
|
1212
|
-
label: "
|
|
954
|
+
label: "Record Types",
|
|
1213
955
|
onClick: handleCreateData
|
|
1214
956
|
}), /* @__PURE__ */ React2.createElement(SchemaTable, {
|
|
1215
957
|
types: presets.types,
|
|
@@ -1230,9 +972,9 @@ var SpaceGenerator = ({ space, onCreateObjects }) => {
|
|
|
1230
972
|
}
|
|
1231
973
|
};
|
|
1232
974
|
|
|
1233
|
-
//
|
|
975
|
+
// src/components/SpaceGenerator/index.ts
|
|
1234
976
|
var SpaceGenerator_default = SpaceGenerator;
|
|
1235
977
|
export {
|
|
1236
978
|
SpaceGenerator_default as default
|
|
1237
979
|
};
|
|
1238
|
-
//# sourceMappingURL=SpaceGenerator-
|
|
980
|
+
//# sourceMappingURL=SpaceGenerator-XJJAOTIT.mjs.map
|