@dxos/plugin-debug 0.7.1 → 0.7.2-main.f1adc9f

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.
Files changed (80) hide show
  1. package/dist/lib/browser/{DebugGlobal-ZTCBF3XR.mjs → DebugApp-HCHR6GKO.mjs} +18 -16
  2. package/dist/lib/browser/DebugApp-HCHR6GKO.mjs.map +7 -0
  3. package/dist/lib/browser/DebugSpace-HK2GQYIB.mjs +276 -0
  4. package/dist/lib/browser/DebugSpace-HK2GQYIB.mjs.map +7 -0
  5. package/dist/lib/browser/SpaceGenerator-TIBUROQA.mjs +155 -0
  6. package/dist/lib/browser/SpaceGenerator-TIBUROQA.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-GSJS3HEM.mjs +15 -0
  8. package/dist/lib/browser/chunk-GSJS3HEM.mjs.map +7 -0
  9. package/dist/lib/browser/index.mjs +39 -41
  10. package/dist/lib/browser/index.mjs.map +3 -3
  11. package/dist/lib/browser/meta.json +1 -1
  12. package/dist/types/src/DebugPlugin.d.ts.map +1 -1
  13. package/dist/types/src/components/Container.d.ts +5 -0
  14. package/dist/types/src/components/Container.d.ts.map +1 -0
  15. package/dist/types/src/components/{DebugGlobal.d.ts → DebugApp/DebugApp.d.ts} +2 -3
  16. package/dist/types/src/components/DebugApp/DebugApp.d.ts.map +1 -0
  17. package/dist/types/src/components/DebugApp/Tree.d.ts.map +1 -0
  18. package/dist/types/src/components/DebugApp/index.d.ts +3 -0
  19. package/dist/types/src/components/DebugApp/index.d.ts.map +1 -0
  20. package/dist/types/src/components/DebugObjectPanel.d.ts +2 -2
  21. package/dist/types/src/components/DebugObjectPanel.d.ts.map +1 -1
  22. package/dist/types/src/components/{DebugSpace.d.ts → DebugSpace/DebugSpace.d.ts} +1 -2
  23. package/dist/types/src/components/DebugSpace/DebugSpace.d.ts.map +1 -0
  24. package/dist/types/src/components/{DebugSpace.stories.d.ts → DebugSpace/DebugSpace.stories.d.ts} +1 -1
  25. package/dist/types/src/components/DebugSpace/DebugSpace.stories.d.ts.map +1 -0
  26. package/dist/types/src/components/{ObjectCreator.d.ts → DebugSpace/ObjectCreator.d.ts} +4 -6
  27. package/dist/types/src/components/DebugSpace/ObjectCreator.d.ts.map +1 -0
  28. package/dist/types/src/components/{ObjectCreator.stories.d.ts → DebugSpace/ObjectCreator.stories.d.ts} +1 -1
  29. package/dist/types/src/components/DebugSpace/ObjectCreator.stories.d.ts.map +1 -0
  30. package/dist/types/src/components/DebugSpace/index.d.ts +3 -0
  31. package/dist/types/src/components/DebugSpace/index.d.ts.map +1 -0
  32. package/dist/types/src/components/{SurfaceDebug.d.ts → DebugSurface.d.ts} +2 -2
  33. package/dist/types/src/components/{SurfaceDebug.d.ts.map → DebugSurface.d.ts.map} +1 -1
  34. package/dist/types/src/components/SpaceGenerator/SpaceGenerator.d.ts +9 -0
  35. package/dist/types/src/components/SpaceGenerator/SpaceGenerator.d.ts.map +1 -0
  36. package/dist/types/src/components/SpaceGenerator/SpaceGenerator.stories.d.ts +6 -0
  37. package/dist/types/src/components/SpaceGenerator/SpaceGenerator.stories.d.ts.map +1 -0
  38. package/dist/types/src/components/SpaceGenerator/index.d.ts +3 -0
  39. package/dist/types/src/components/SpaceGenerator/index.d.ts.map +1 -0
  40. package/dist/types/src/components/index.d.ts +2 -1
  41. package/dist/types/src/components/index.d.ts.map +1 -1
  42. package/package.json +41 -38
  43. package/src/DebugPlugin.tsx +61 -48
  44. package/src/components/Container.tsx +15 -0
  45. package/src/components/{DebugGlobal.tsx → DebugApp/DebugApp.tsx} +9 -11
  46. package/src/components/{Tree.tsx → DebugApp/Tree.tsx} +1 -1
  47. package/src/components/DebugApp/index.ts +7 -0
  48. package/src/components/DebugObjectPanel.tsx +4 -3
  49. package/src/components/{DebugSpace.stories.tsx → DebugSpace/DebugSpace.stories.tsx} +8 -6
  50. package/src/components/{DebugSpace.tsx → DebugSpace/DebugSpace.tsx} +70 -82
  51. package/src/components/{ObjectCreator.stories.tsx → DebugSpace/ObjectCreator.stories.tsx} +14 -11
  52. package/src/components/DebugSpace/ObjectCreator.tsx +100 -0
  53. package/src/components/DebugSpace/index.ts +7 -0
  54. package/src/components/{SurfaceDebug.tsx → DebugSurface.tsx} +1 -1
  55. package/src/components/SpaceGenerator/SpaceGenerator.stories.tsx +37 -0
  56. package/src/components/SpaceGenerator/SpaceGenerator.tsx +169 -0
  57. package/src/components/SpaceGenerator/index.ts +7 -0
  58. package/src/components/index.ts +2 -1
  59. package/dist/lib/browser/DebugGlobal-ZTCBF3XR.mjs.map +0 -7
  60. package/dist/lib/browser/DebugSpace-6TGT3H4I.mjs +0 -411
  61. package/dist/lib/browser/DebugSpace-6TGT3H4I.mjs.map +0 -7
  62. package/dist/lib/browser/chunk-H3BJHVRD.mjs +0 -24
  63. package/dist/lib/browser/chunk-H3BJHVRD.mjs.map +0 -7
  64. package/dist/types/src/components/DebugGlobal.d.ts.map +0 -1
  65. package/dist/types/src/components/DebugPanel.d.ts +0 -5
  66. package/dist/types/src/components/DebugPanel.d.ts.map +0 -1
  67. package/dist/types/src/components/DebugSpace.d.ts.map +0 -1
  68. package/dist/types/src/components/DebugSpace.stories.d.ts.map +0 -1
  69. package/dist/types/src/components/ObjectCreator.d.ts.map +0 -1
  70. package/dist/types/src/components/ObjectCreator.stories.d.ts.map +0 -1
  71. package/dist/types/src/components/Tree.d.ts.map +0 -1
  72. package/dist/types/src/scaffolding/generator.d.ts +0 -11
  73. package/dist/types/src/scaffolding/generator.d.ts.map +0 -1
  74. package/dist/types/src/scaffolding/index.d.ts +0 -2
  75. package/dist/types/src/scaffolding/index.d.ts.map +0 -1
  76. package/src/components/DebugPanel.tsx +0 -29
  77. package/src/components/ObjectCreator.tsx +0 -99
  78. package/src/scaffolding/generator.ts +0 -146
  79. package/src/scaffolding/index.ts +0 -5
  80. /package/dist/types/src/components/{Tree.d.ts → DebugApp/Tree.d.ts} +0 -0
@@ -1,411 +0,0 @@
1
- import {
2
- DebugContext
3
- } from "./chunk-LZEK532R.mjs";
4
- import "./chunk-CAENAAHY.mjs";
5
- import {
6
- DebugPanel
7
- } from "./chunk-H3BJHVRD.mjs";
8
-
9
- // packages/plugins/plugin-debug/src/components/DebugSpace.tsx
10
- import { ArrowClockwise, DownloadSimple, Flag, FlagPennant, HandPalm, Play, PlusMinus, Timer, UserCirclePlus } from "@phosphor-icons/react";
11
- import React2, { useContext, useMemo as useMemo2, useState as useState2 } from "react";
12
- import { DocumentType as DocumentType2 } from "@dxos/plugin-markdown/types";
13
- import { Invitation } from "@dxos/protocols/proto/dxos/client/services";
14
- import { faker as faker2 } from "@dxos/random";
15
- import { useClient } from "@dxos/react-client";
16
- import { Filter, useSpaceInvitation } from "@dxos/react-client/echo";
17
- import { InvitationEncoder } from "@dxos/react-client/invitations";
18
- import { useAsyncEffect } from "@dxos/react-hooks";
19
- import { Button as Button2, Input, useFileDownload } from "@dxos/react-ui";
20
- import { getSize, mx } from "@dxos/react-ui-theme";
21
- import { safeParseInt } from "@dxos/util";
22
-
23
- // packages/plugins/plugin-debug/src/components/ObjectCreator.tsx
24
- import React, { useMemo, useState } from "react";
25
- import { Button } from "@dxos/react-ui";
26
- import { createColumnBuilder, Table } from "@dxos/react-ui-table/deprecated";
27
-
28
- // packages/plugins/plugin-debug/src/scaffolding/generator.ts
29
- import { createShapeId, defaultBindingUtils, defaultShapeUtils, defaultTools, Editor } from "@tldraw/tldraw";
30
- import { sleep } from "@dxos/async";
31
- import { next as A } from "@dxos/automerge/automerge";
32
- import { SpaceObjectGenerator } from "@dxos/echo-generator";
33
- import { create } from "@dxos/echo-schema";
34
- import { log } from "@dxos/log";
35
- import { DocumentType, TextType } from "@dxos/plugin-markdown/types";
36
- import { TLDrawStoreAdapter } from "@dxos/plugin-sketch/sdk";
37
- import { CanvasType, DiagramType, TLDRAW_SCHEMA } from "@dxos/plugin-sketch/types";
38
- import { faker } from "@dxos/random";
39
- import { createDocAccessor } from "@dxos/react-client/echo";
40
- var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-debug/src/scaffolding/generator.ts";
41
- var SchemasNames;
42
- (function(SchemasNames2) {
43
- SchemasNames2["document"] = "dxos.org/type/Document";
44
- SchemasNames2["diagram"] = "dxos.org/type/Diagram";
45
- })(SchemasNames || (SchemasNames = {}));
46
- var SchemasMap = {
47
- ["dxos.org/type/Document"]: DocumentType,
48
- ["dxos.org/type/Diagram"]: DiagramType
49
- };
50
- var ObjectGenerators = {
51
- ["dxos.org/type/Document"]: () => {
52
- const name = faker.lorem.sentence({
53
- min: 2,
54
- max: 3
55
- });
56
- return {
57
- name,
58
- content: create(TextType, {
59
- content: ""
60
- }),
61
- threads: []
62
- };
63
- },
64
- ["dxos.org/type/Diagram"]: () => {
65
- const name = faker.lorem.sentence({
66
- min: 2,
67
- max: 3
68
- });
69
- return {
70
- name,
71
- canvas: create(CanvasType, {
72
- schema: TLDRAW_SCHEMA,
73
- content: {}
74
- })
75
- };
76
- }
77
- };
78
- var MutationsGenerators = {
79
- ["dxos.org/type/Document"]: async (object, params) => {
80
- const accessor = createDocAccessor(object.content, [
81
- "content"
82
- ]);
83
- for (let i = 0; i < params.count; i++) {
84
- const length = object.content?.content?.length ?? 0;
85
- accessor.handle.change((doc) => {
86
- A.splice(doc, accessor.path.slice(), 0, params.maxContentLength >= length ? 0 : params.mutationSize, faker.string.hexadecimal({
87
- length: params.mutationSize - 1
88
- }) + " ");
89
- });
90
- if (i % 100 === 0 || i === params.count - 1) {
91
- log.info("Mutation:", {
92
- mutationIdx: i
93
- }, {
94
- F: __dxlog_file,
95
- L: 76,
96
- S: void 0,
97
- C: (f, a) => f(...a)
98
- });
99
- await sleep(1);
100
- }
101
- }
102
- },
103
- ["dxos.org/type/Diagram"]: async (object, params) => {
104
- const store = new TLDrawStoreAdapter();
105
- await store.open(createDocAccessor(object.canvas, [
106
- "content"
107
- ]));
108
- const app = new Editor({
109
- store: store.store,
110
- shapeUtils: defaultShapeUtils,
111
- bindingUtils: defaultBindingUtils,
112
- tools: defaultTools,
113
- getContainer: () => document.getElementsByTagName("body")[0]
114
- });
115
- const r = 100;
116
- const a = 0.05;
117
- const cx = 200;
118
- const cy = 200;
119
- for (let i = 0; i < params.count; i++) {
120
- const t = i;
121
- const t1 = i + 1;
122
- const x = cx + a * t * r * Math.cos(t);
123
- const y = cy + a * t * r * Math.sin(t);
124
- const x1 = cx + a * t1 * r * Math.cos(t1);
125
- const y1 = cy + a * t1 * r * Math.sin(t1);
126
- app.createShape({
127
- id: createShapeId(),
128
- isLocked: false,
129
- meta: {},
130
- opacity: 1,
131
- parentId: "page:page",
132
- props: {
133
- arrowheadEnd: "none",
134
- arrowheadStart: "none",
135
- bend: 0,
136
- color: "black",
137
- dash: "draw",
138
- start: {
139
- x,
140
- y
141
- },
142
- end: {
143
- x: x1,
144
- y: y1
145
- },
146
- fill: "none",
147
- font: "draw",
148
- labelColor: "black",
149
- labelPosition: 0.5,
150
- scale: 1,
151
- size: "m"
152
- },
153
- rotation: 0,
154
- type: "arrow",
155
- typeName: "shape",
156
- x: 0,
157
- y: 0
158
- });
159
- if (i % 100 === 0) {
160
- await sleep(1);
161
- }
162
- }
163
- }
164
- };
165
- var createSpaceObjectGenerator = (space) => new SpaceObjectGenerator(space, SchemasMap, ObjectGenerators, MutationsGenerators);
166
-
167
- // packages/plugins/plugin-debug/src/components/ObjectCreator.tsx
168
- var CREATE_OBJECTS_IN_ONE_CHUNK = 10;
169
- var ObjectCreator = ({ space, onAddObjects }) => {
170
- const generator = useMemo(() => createSpaceObjectGenerator(space), [
171
- space
172
- ]);
173
- const [objectsToCreate, setObjectsToCreate] = useState([
174
- {
175
- enabled: true,
176
- schema: SchemasNames.document,
177
- objectsCount: 10,
178
- mutationsCount: 10,
179
- mutationSize: 10,
180
- maxContentLength: 1e3
181
- },
182
- {
183
- enabled: true,
184
- schema: SchemasNames.diagram,
185
- objectsCount: 10,
186
- mutationsCount: 10,
187
- mutationSize: 10,
188
- maxContentLength: 1e3
189
- }
190
- ]);
191
- const handleCreate = async () => {
192
- for (const params of objectsToCreate) {
193
- if (!params.enabled) {
194
- continue;
195
- }
196
- let objectsCreated = 0;
197
- while (objectsCreated < params.objectsCount) {
198
- const objects = await generator.createObjects({
199
- [params.schema]: Math.min(CREATE_OBJECTS_IN_ONE_CHUNK, params.objectsCount - objectsCreated)
200
- });
201
- await generator.mutateObjects(objects, {
202
- count: params.mutationsCount,
203
- mutationSize: params.mutationSize,
204
- maxContentLength: params.maxContentLength
205
- });
206
- objectsCreated += objects.length;
207
- onAddObjects?.(objects);
208
- }
209
- }
210
- await space.db.flush();
211
- };
212
- const handleChangeOnRow = (row, key, value) => {
213
- const newObjects = [
214
- ...objectsToCreate
215
- ];
216
- Object.assign(newObjects.find((object) => object.schema === row.schema), {
217
- [key]: value
218
- });
219
- setObjectsToCreate(newObjects);
220
- };
221
- const { helper, builder } = createColumnBuilder();
222
- const columns = [
223
- helper.accessor("enabled", builder.switch({
224
- label: "Enabled",
225
- onUpdate: handleChangeOnRow
226
- })),
227
- helper.accessor("schema", builder.string({
228
- classNames: "font-mono",
229
- label: "Schema"
230
- })),
231
- helper.accessor("objectsCount", builder.number({
232
- label: "Objects",
233
- onUpdate: handleChangeOnRow
234
- })),
235
- helper.accessor("mutationsCount", builder.number({
236
- label: "Mutations",
237
- onUpdate: handleChangeOnRow
238
- })),
239
- helper.accessor("mutationSize", builder.number({
240
- label: "Mut. Size",
241
- onUpdate: handleChangeOnRow
242
- })),
243
- helper.accessor("maxContentLength", builder.number({
244
- label: "Length",
245
- onUpdate: handleChangeOnRow
246
- }))
247
- ];
248
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Table.Root, null, /* @__PURE__ */ React.createElement(Table.Viewport, null, /* @__PURE__ */ React.createElement(Table.Main, {
249
- columns,
250
- data: objectsToCreate
251
- }))), /* @__PURE__ */ React.createElement(Button, {
252
- onClick: handleCreate
253
- }, "Create"));
254
- };
255
-
256
- // packages/plugins/plugin-debug/src/components/DebugSpace.tsx
257
- var DEFAULT_COUNT = 100;
258
- var DEFAULT_PERIOD = 500;
259
- var DEFAULT_JITTER = 50;
260
- var useRefresh = () => {
261
- const [update, setUpdate] = useState2({});
262
- return [
263
- update,
264
- () => setUpdate({})
265
- ];
266
- };
267
- var DebugSpace = ({ space, onAddObjects }) => {
268
- const { connect } = useSpaceInvitation(space?.key);
269
- const client = useClient();
270
- const [data, setData] = useState2({});
271
- const [update, handleUpdate] = useRefresh();
272
- useAsyncEffect(async (isMounted) => {
273
- const data2 = await client.diagnostics({
274
- truncate: true
275
- });
276
- if (isMounted()) {
277
- setData(data2?.diagnostics?.spaces?.find(({ key }) => {
278
- return space.key.toHex().startsWith(key);
279
- }));
280
- }
281
- }, [
282
- space,
283
- update
284
- ]);
285
- const download = useFileDownload();
286
- const handleCopy = async () => {
287
- download(new Blob([
288
- JSON.stringify(data, void 0, 2)
289
- ], {
290
- type: "text/plain"
291
- }), `${(/* @__PURE__ */ new Date()).toISOString().replace(/\W/g, "-")}.json`);
292
- };
293
- const [mutationCount, setMutationCount] = useState2(String(DEFAULT_COUNT));
294
- const [mutationInterval, setMutationInterval] = useState2(String(DEFAULT_PERIOD));
295
- const [mutationJitter, setMutationJitter] = useState2(String(DEFAULT_JITTER));
296
- const generator = useMemo2(() => createSpaceObjectGenerator(space), [
297
- space
298
- ]);
299
- const { running, start, stop } = useContext(DebugContext);
300
- const handleToggleRunning = () => {
301
- if (running) {
302
- stop();
303
- handleUpdate();
304
- } else {
305
- start(async () => {
306
- const { objects } = await space.db.query(Filter.schema(DocumentType2)).run();
307
- if (objects.length) {
308
- const object = faker2.helpers.arrayElement(objects);
309
- await generator.mutateObject(object, {
310
- count: 10,
311
- mutationSize: 10,
312
- maxContentLength: 1e3
313
- });
314
- }
315
- }, {
316
- count: safeParseInt(mutationCount) ?? 0,
317
- interval: safeParseInt(mutationInterval) ?? 0,
318
- jitter: safeParseInt(mutationJitter) ?? 0
319
- });
320
- }
321
- };
322
- const handleCreateInvitation = () => {
323
- const invitation = space.share({
324
- type: Invitation.Type.INTERACTIVE,
325
- authMethod: Invitation.AuthMethod.NONE,
326
- multiUse: true
327
- });
328
- connect(invitation);
329
- const code = InvitationEncoder.encode(invitation.get());
330
- new URL(window.origin).searchParams.set("spaceInvitationCode", code);
331
- const url = `${window.origin}?spaceInvitationCode=${code}`;
332
- void navigator.clipboard.writeText(url);
333
- };
334
- const handleCreateEpoch = async () => {
335
- await space.internal.createEpoch();
336
- handleUpdate();
337
- };
338
- return /* @__PURE__ */ React2.createElement(DebugPanel, {
339
- menu: /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement("div", {
340
- className: "relative",
341
- title: "mutation count"
342
- }, /* @__PURE__ */ React2.createElement(Input.Root, null, /* @__PURE__ */ React2.createElement(Input.TextInput, {
343
- autoComplete: "off",
344
- size: 5,
345
- classNames: "w-[100px] text-right pie-[22px]",
346
- placeholder: "Count",
347
- value: mutationCount,
348
- onChange: ({ target: { value } }) => setMutationCount(value)
349
- })), /* @__PURE__ */ React2.createElement(Flag, {
350
- className: mx("absolute inline-end-1 block-start-1 mt-[6px]", getSize(3))
351
- })), /* @__PURE__ */ React2.createElement("div", {
352
- className: "relative",
353
- title: "mutation period"
354
- }, /* @__PURE__ */ React2.createElement(Input.Root, null, /* @__PURE__ */ React2.createElement(Input.TextInput, {
355
- autoComplete: "off",
356
- size: 5,
357
- classNames: "w-[100px] text-right pie-[22px]",
358
- placeholder: "Interval",
359
- value: mutationInterval,
360
- onChange: ({ target: { value } }) => setMutationInterval(value)
361
- })), /* @__PURE__ */ React2.createElement(Timer, {
362
- className: mx("absolute inline-end-1 block-start-1 mt-[6px]", getSize(3))
363
- })), /* @__PURE__ */ React2.createElement("div", {
364
- className: "relative",
365
- title: "mutation jitter"
366
- }, /* @__PURE__ */ React2.createElement(Input.Root, null, /* @__PURE__ */ React2.createElement(Input.TextInput, {
367
- autoComplete: "off",
368
- size: 5,
369
- classNames: "w-[100px] text-right pie-[22px]",
370
- placeholder: "Jitter",
371
- value: mutationJitter,
372
- onChange: ({ target: { value } }) => setMutationJitter(value)
373
- })), /* @__PURE__ */ React2.createElement(PlusMinus, {
374
- className: mx("absolute inline-end-1 block-start-1 mt-[6px]", getSize(3))
375
- })), /* @__PURE__ */ React2.createElement(Button2, {
376
- onClick: handleToggleRunning
377
- }, running ? /* @__PURE__ */ React2.createElement(HandPalm, {
378
- className: getSize(5)
379
- }) : /* @__PURE__ */ React2.createElement(Play, {
380
- className: getSize(5)
381
- })), /* @__PURE__ */ React2.createElement(Button2, {
382
- onClick: handleUpdate
383
- }, /* @__PURE__ */ React2.createElement(ArrowClockwise, {
384
- className: getSize(5)
385
- })), /* @__PURE__ */ React2.createElement(Button2, {
386
- onClick: handleCopy
387
- }, /* @__PURE__ */ React2.createElement(DownloadSimple, {
388
- className: getSize(5)
389
- })), /* @__PURE__ */ React2.createElement("div", {
390
- className: "grow"
391
- }), /* @__PURE__ */ React2.createElement(Button2, {
392
- onClick: handleCreateEpoch,
393
- title: "Create epoch"
394
- }, /* @__PURE__ */ React2.createElement(FlagPennant, {
395
- className: mx(getSize(5))
396
- })), /* @__PURE__ */ React2.createElement(Button2, {
397
- onClick: handleCreateInvitation,
398
- title: "Create Space invitation"
399
- }, /* @__PURE__ */ React2.createElement(UserCirclePlus, {
400
- className: mx(getSize(5), "text-blue-500")
401
- })))
402
- }, /* @__PURE__ */ React2.createElement(ObjectCreator, {
403
- space,
404
- onAddObjects
405
- }));
406
- };
407
- var DebugSpace_default = DebugSpace;
408
- export {
409
- DebugSpace_default as default
410
- };
411
- //# sourceMappingURL=DebugSpace-6TGT3H4I.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/DebugSpace.tsx", "../../../src/components/ObjectCreator.tsx", "../../../src/scaffolding/generator.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport {\n ArrowClockwise,\n DownloadSimple,\n Flag,\n FlagPennant,\n HandPalm,\n Play,\n PlusMinus,\n Timer,\n UserCirclePlus,\n} from '@phosphor-icons/react';\nimport React, { type FC, useContext, useMemo, useState } from 'react';\n\nimport { type ReactiveObject } from '@dxos/echo-schema';\nimport { DocumentType } from '@dxos/plugin-markdown/types';\nimport { Invitation } from '@dxos/protocols/proto/dxos/client/services';\nimport { faker } from '@dxos/random';\nimport { useClient } from '@dxos/react-client';\nimport { Filter, type Space, useSpaceInvitation } from '@dxos/react-client/echo';\nimport { InvitationEncoder } from '@dxos/react-client/invitations';\nimport { useAsyncEffect } from '@dxos/react-hooks';\nimport { Button, Input, useFileDownload } from '@dxos/react-ui';\nimport { getSize, mx } from '@dxos/react-ui-theme';\nimport { safeParseInt } from '@dxos/util';\n\nimport { DebugPanel } from './DebugPanel';\nimport { ObjectCreator } from './ObjectCreator';\nimport { createSpaceObjectGenerator } from '../scaffolding';\nimport { DebugContext } from '../types';\n\nconst DEFAULT_COUNT = 100;\nconst DEFAULT_PERIOD = 500;\nconst DEFAULT_JITTER = 50;\n\n// TODO(burdon): Factor out.\nconst useRefresh = (): [any, () => void] => {\n const [update, setUpdate] = useState({});\n return [update, () => setUpdate({})];\n};\n\nconst DebugSpace: FC<{\n space: Space;\n onAddObjects?: (objects: ReactiveObject<any>[]) => void;\n}> = ({ space, onAddObjects }) => {\n const { connect } = useSpaceInvitation(space?.key);\n const client = useClient();\n const [data, setData] = useState<any>({});\n\n const [update, handleUpdate] = useRefresh();\n useAsyncEffect(\n async (isMounted) => {\n const data = await client.diagnostics({ truncate: true });\n if (isMounted()) {\n setData(\n data?.diagnostics?.spaces?.find(({ key }: any) => {\n return space.key.toHex().startsWith(key);\n }),\n );\n }\n },\n [space, update],\n );\n\n const download = useFileDownload();\n const handleCopy = async () => {\n download(\n new Blob([JSON.stringify(data, undefined, 2)], { type: 'text/plain' }),\n `${new Date().toISOString().replace(/\\W/g, '-')}.json`,\n );\n };\n\n const [mutationCount, setMutationCount] = useState(String(DEFAULT_COUNT));\n const [mutationInterval, setMutationInterval] = useState(String(DEFAULT_PERIOD));\n const [mutationJitter, setMutationJitter] = useState(String(DEFAULT_JITTER));\n\n const generator = useMemo(() => createSpaceObjectGenerator(space), [space]);\n\n // TODO(burdon): Note: this is shared across all spaces!\n const { running, start, stop } = useContext(DebugContext);\n const handleToggleRunning = () => {\n if (running) {\n stop();\n handleUpdate();\n } else {\n start(\n async () => {\n const { objects } = await space.db.query(Filter.schema(DocumentType)).run();\n if (objects.length) {\n const object = faker.helpers.arrayElement(objects);\n await generator.mutateObject(object, { count: 10, mutationSize: 10, maxContentLength: 1000 });\n }\n },\n {\n count: safeParseInt(mutationCount) ?? 0,\n interval: safeParseInt(mutationInterval) ?? 0,\n jitter: safeParseInt(mutationJitter) ?? 0,\n },\n );\n }\n };\n\n const handleCreateInvitation = () => {\n const invitation = space.share({\n type: Invitation.Type.INTERACTIVE,\n authMethod: Invitation.AuthMethod.NONE,\n multiUse: true,\n });\n\n // TODO(burdon): Refactor.\n // TODO(burdon): Unsubscribe?\n connect(invitation);\n const code = InvitationEncoder.encode(invitation.get());\n new URL(window.origin).searchParams.set('spaceInvitationCode', code);\n const url = `${window.origin}?spaceInvitationCode=${code}`;\n void navigator.clipboard.writeText(url);\n };\n\n const handleCreateEpoch = async () => {\n await space.internal.createEpoch();\n handleUpdate();\n };\n\n return (\n <DebugPanel\n menu={\n <>\n <div className='relative' title='mutation count'>\n <Input.Root>\n <Input.TextInput\n autoComplete='off'\n size={5}\n classNames='w-[100px] text-right pie-[22px]'\n placeholder='Count'\n value={mutationCount}\n onChange={({ target: { value } }) => setMutationCount(value)}\n />\n </Input.Root>\n <Flag className={mx('absolute inline-end-1 block-start-1 mt-[6px]', getSize(3))} />\n </div>\n <div className='relative' title='mutation period'>\n <Input.Root>\n <Input.TextInput\n autoComplete='off'\n size={5}\n classNames='w-[100px] text-right pie-[22px]'\n placeholder='Interval'\n value={mutationInterval}\n onChange={({ target: { value } }) => setMutationInterval(value)}\n />\n </Input.Root>\n <Timer className={mx('absolute inline-end-1 block-start-1 mt-[6px]', getSize(3))} />\n </div>\n <div className='relative' title='mutation jitter'>\n <Input.Root>\n <Input.TextInput\n autoComplete='off'\n size={5}\n classNames='w-[100px] text-right pie-[22px]'\n placeholder='Jitter'\n value={mutationJitter}\n onChange={({ target: { value } }) => setMutationJitter(value)}\n />\n </Input.Root>\n <PlusMinus className={mx('absolute inline-end-1 block-start-1 mt-[6px]', getSize(3))} />\n </div>\n <Button onClick={handleToggleRunning}>\n {running ? <HandPalm className={getSize(5)} /> : <Play className={getSize(5)} />}\n </Button>\n <Button onClick={handleUpdate}>\n <ArrowClockwise className={getSize(5)} />\n </Button>\n <Button onClick={handleCopy}>\n <DownloadSimple className={getSize(5)} />\n </Button>\n\n <div className='grow' />\n <Button onClick={handleCreateEpoch} title='Create epoch'>\n <FlagPennant className={mx(getSize(5))} />\n </Button>\n <Button onClick={handleCreateInvitation} title='Create Space invitation'>\n <UserCirclePlus className={mx(getSize(5), 'text-blue-500')} />\n </Button>\n </>\n }\n >\n <ObjectCreator space={space} onAddObjects={onAddObjects} />\n </DebugPanel>\n );\n};\n\nexport default DebugSpace;\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { useMemo, useState } from 'react';\n\nimport { type EchoReactiveObject, type ReactiveObject, type Space } from '@dxos/react-client/echo';\nimport { Button } from '@dxos/react-ui';\nimport { createColumnBuilder, type TableColumnDef, Table } from '@dxos/react-ui-table/deprecated';\n\nimport { SchemasNames, createSpaceObjectGenerator } from '../scaffolding';\n\nexport type CreateObjectsParams = {\n enabled: boolean;\n schema: SchemasNames;\n objectsCount: number;\n mutationsCount: number;\n maxContentLength: number;\n mutationSize: number;\n};\n\nconst CREATE_OBJECTS_IN_ONE_CHUNK = 10;\n\nexport type ObjectCreatorProps = {\n space: Space;\n onAddObjects?: (objects: ReactiveObject<any>[]) => void;\n};\n\nexport const ObjectCreator = ({ space, onAddObjects }: ObjectCreatorProps) => {\n const generator = useMemo(() => createSpaceObjectGenerator(space), [space]);\n\n const [objectsToCreate, setObjectsToCreate] = useState<CreateObjectsParams[]>([\n {\n enabled: true,\n schema: SchemasNames.document,\n objectsCount: 10,\n mutationsCount: 10,\n mutationSize: 10,\n maxContentLength: 1000,\n },\n {\n enabled: true,\n schema: SchemasNames.diagram,\n objectsCount: 10,\n mutationsCount: 10,\n mutationSize: 10,\n maxContentLength: 1000,\n },\n ]);\n\n const handleCreate = async () => {\n for (const params of objectsToCreate) {\n if (!params.enabled) {\n continue;\n }\n let objectsCreated = 0;\n while (objectsCreated < params.objectsCount) {\n const objects = (await generator.createObjects({\n [params.schema]: Math.min(CREATE_OBJECTS_IN_ONE_CHUNK, params.objectsCount - objectsCreated),\n })) as EchoReactiveObject<any>[];\n\n await generator.mutateObjects(objects, {\n count: params.mutationsCount,\n mutationSize: params.mutationSize,\n maxContentLength: params.maxContentLength,\n });\n objectsCreated += objects.length;\n onAddObjects?.(objects);\n }\n }\n await space.db.flush();\n };\n const handleChangeOnRow = (row: CreateObjectsParams, key: string, value: any) => {\n const newObjects = [...objectsToCreate];\n Object.assign(newObjects.find((object) => object.schema === row.schema)!, { [key]: value });\n setObjectsToCreate(newObjects);\n };\n\n const { helper, builder } = createColumnBuilder<CreateObjectsParams>();\n const columns: TableColumnDef<CreateObjectsParams>[] = [\n helper.accessor('enabled', builder.switch({ label: 'Enabled', onUpdate: handleChangeOnRow })),\n helper.accessor('schema', builder.string({ classNames: 'font-mono', label: 'Schema' })),\n helper.accessor('objectsCount', builder.number({ label: 'Objects', onUpdate: handleChangeOnRow })),\n helper.accessor('mutationsCount', builder.number({ label: 'Mutations', onUpdate: handleChangeOnRow })),\n helper.accessor('mutationSize', builder.number({ label: 'Mut. Size', onUpdate: handleChangeOnRow })),\n helper.accessor('maxContentLength', builder.number({ label: 'Length', onUpdate: handleChangeOnRow })),\n ];\n\n return (\n <>\n <Table.Root>\n <Table.Viewport>\n <Table.Main<CreateObjectsParams> columns={columns} data={objectsToCreate} />\n </Table.Viewport>\n </Table.Root>\n <Button onClick={handleCreate}>Create</Button>\n </>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport {\n createShapeId,\n defaultBindingUtils,\n defaultShapeUtils,\n defaultTools,\n Editor,\n type TLParentId,\n} from '@tldraw/tldraw';\n\nimport { sleep } from '@dxos/async';\nimport { next as A } from '@dxos/automerge/automerge';\nimport {\n SpaceObjectGenerator,\n type TestGeneratorMap,\n type TestMutationsMap,\n type TestSchemaMap,\n} from '@dxos/echo-generator';\nimport { create } from '@dxos/echo-schema';\nimport { log } from '@dxos/log';\nimport { DocumentType, TextType } from '@dxos/plugin-markdown/types';\nimport { TLDrawStoreAdapter } from '@dxos/plugin-sketch/sdk';\nimport { CanvasType, DiagramType, TLDRAW_SCHEMA } from '@dxos/plugin-sketch/types';\nimport { faker } from '@dxos/random';\nimport { createDocAccessor, type Space } from '@dxos/react-client/echo';\n\n// TODO(burdon): Move to echo-generator.\n\n// TODO(wittjosiah): Remove? Just use DXNs.\nexport enum SchemasNames {\n document = 'dxos.org/type/Document',\n diagram = 'dxos.org/type/Diagram',\n}\n\nexport const SchemasMap: TestSchemaMap<SchemasNames> = {\n [SchemasNames.document]: DocumentType,\n [SchemasNames.diagram]: DiagramType,\n};\n\nexport const ObjectGenerators: TestGeneratorMap<SchemasNames> = {\n [SchemasNames.document]: () => {\n const name = faker.lorem.sentence({ min: 2, max: 3 });\n return { name, content: create(TextType, { content: '' }), threads: [] };\n },\n\n [SchemasNames.diagram]: () => {\n const name = faker.lorem.sentence({ min: 2, max: 3 });\n return {\n name,\n canvas: create(CanvasType, { schema: TLDRAW_SCHEMA, content: {} }),\n };\n },\n};\n\nexport const MutationsGenerators: TestMutationsMap<SchemasNames> = {\n [SchemasNames.document]: async (object, params) => {\n const accessor = createDocAccessor<DocumentType>(object.content, ['content']);\n\n for (let i = 0; i < params.count; i++) {\n const length = object.content?.content?.length ?? 0;\n accessor.handle.change((doc) => {\n A.splice(\n doc,\n accessor.path.slice(),\n 0,\n params.maxContentLength >= length ? 0 : params.mutationSize,\n faker.string.hexadecimal({ length: params.mutationSize - 1 }) + ' ',\n );\n });\n\n // Release the event loop.\n if (i % 100 === 0 || i === params.count - 1) {\n log.info('Mutation:', { mutationIdx: i });\n await sleep(1);\n }\n }\n },\n\n [SchemasNames.diagram]: async (object, params) => {\n const store = new TLDrawStoreAdapter();\n await store.open(createDocAccessor<CanvasType>(object.canvas, ['content']));\n const app = new Editor({\n store: store.store!,\n shapeUtils: defaultShapeUtils,\n bindingUtils: defaultBindingUtils,\n tools: defaultTools,\n getContainer: () => document.getElementsByTagName('body')[0],\n });\n\n //\n // Draw spiral.\n //\n const r = 100;\n const a = 0.05;\n const cx = 200;\n const cy = 200;\n\n for (let i = 0; i < params.count; i++) {\n const t = i;\n const t1 = i + 1;\n const x = cx + a * t * r * Math.cos(t);\n const y = cy + a * t * r * Math.sin(t);\n const x1 = cx + a * t1 * r * Math.cos(t1);\n const y1 = cy + a * t1 * r * Math.sin(t1);\n\n app.createShape({\n id: createShapeId(),\n isLocked: false,\n meta: {},\n opacity: 1,\n parentId: 'page:page' as TLParentId,\n props: {\n arrowheadEnd: 'none',\n arrowheadStart: 'none',\n bend: 0,\n color: 'black',\n dash: 'draw',\n start: { x, y },\n end: { x: x1, y: y1 },\n fill: 'none',\n font: 'draw',\n labelColor: 'black',\n labelPosition: 0.5,\n scale: 1,\n size: 'm',\n },\n rotation: 0,\n type: 'arrow',\n typeName: 'shape',\n x: 0,\n y: 0,\n });\n\n // Release the event loop.\n if (i % 100 === 0) {\n await sleep(1);\n }\n }\n },\n};\n\nexport const createSpaceObjectGenerator = (space: Space) =>\n new SpaceObjectGenerator(space, SchemasMap, ObjectGenerators, MutationsGenerators);\n"],
5
- "mappings": ";;;;;;;;;AAIA,SACEA,gBACAC,gBACAC,MACAC,aACAC,UACAC,MACAC,WACAC,OACAC,sBACK;AACP,OAAOC,UAAkBC,YAAYC,WAAAA,UAASC,YAAAA,iBAAgB;A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OrE;MACPsE,UAAU,CAAC,EAAEC,QAAQ,EAAEF,MAAK,EAAE,MAAOpE,kBAAkBoE,KAAAA;SAG3D,gBAAAb,OAAA,cAACoB,WAAAA;MAAUhB,WAAWa,GAAG,gDAAgDC,QAAQ,CAAA,CAAA;SAEnF,gBAAAlB,OAAA,cAACqB,SAAAA;MAAOC,SAASpE;OACdL,UAAU,gBAAAmD,OAAA,cAACuB,UAAAA;MAASnB,WAAWc,QAAQ,CAAA;SAAS,gBAAAlB,OAAA,cAACwB,MAAAA;MAAKpB,WAAWc,QAAQ,CAAA;SAE5E,gBAAAlB,OAAA,cAACqB,SAAAA;MAAOC,SAASvG;OACf,gBAAAiF,OAAA,cAACyB,gBAAAA;MAAerB,WAAWc,QAAQ,CAAA;SAErC,gBAAAlB,OAAA,cAACqB,SAAAA;MAAOC,SAAS5F;OACf,gBAAAsE,OAAA,cAAC0B,gBAAAA;MAAetB,WAAWc,QAAQ,CAAA;SAGrC,gBAAAlB,OAAA,cAACG,OAAAA;MAAIC,WAAU;QACf,gBAAAJ,OAAA,cAACqB,SAAAA;MAAOC,SAASzB;MAAmBQ,OAAM;OACxC,gBAAAL,OAAA,cAAC2B,aAAAA;MAAYvB,WAAWa,GAAGC,QAAQ,CAAA,CAAA;SAErC,gBAAAlB,OAAA,cAACqB,SAAAA;MAAOC,SAAShD;MAAwB+B,OAAM;OAC7C,gBAAAL,OAAA,cAAC4B,gBAAAA;MAAexB,WAAWa,GAAGC,QAAQ,CAAA,GAAI,eAAA;;KAKhD,gBAAAlB,OAAA,cAAC6B,eAAAA;IAAcvH;IAAcC;;AAGnC;AAEA,IAAA,qBAAeF;",
6
- "names": ["ArrowClockwise", "DownloadSimple", "Flag", "FlagPennant", "HandPalm", "Play", "PlusMinus", "Timer", "UserCirclePlus", "React", "useContext", "useMemo", "useState", "DocumentType", "Invitation", "faker", "useClient", "Filter", "useSpaceInvitation", "InvitationEncoder", "useAsyncEffect", "Button", "Input", "useFileDownload", "getSize", "mx", "safeParseInt", "React", "useMemo", "useState", "Button", "createColumnBuilder", "Table", "createShapeId", "defaultBindingUtils", "defaultShapeUtils", "defaultTools", "Editor", "sleep", "next", "A", "SpaceObjectGenerator", "create", "log", "DocumentType", "TextType", "TLDrawStoreAdapter", "CanvasType", "DiagramType", "TLDRAW_SCHEMA", "faker", "createDocAccessor", "SchemasNames", "SchemasMap", "ObjectGenerators", "name", "lorem", "sentence", "min", "max", "content", "threads", "canvas", "schema", "MutationsGenerators", "object", "params", "accessor", "i", "count", "length", "handle", "change", "doc", "splice", "path", "slice", "maxContentLength", "mutationSize", "string", "hexadecimal", "info", "mutationIdx", "store", "open", "app", "shapeUtils", "bindingUtils", "tools", "getContainer", "document", "getElementsByTagName", "r", "a", "cx", "cy", "t", "t1", "x", "Math", "cos", "y", "sin", "x1", "y1", "createShape", "id", "isLocked", "meta", "opacity", "parentId", "props", "arrowheadEnd", "arrowheadStart", "bend", "color", "dash", "start", "end", "fill", "font", "labelColor", "labelPosition", "scale", "size", "rotation", "type", "typeName", "createSpaceObjectGenerator", "space", "CREATE_OBJECTS_IN_ONE_CHUNK", "ObjectCreator", "space", "onAddObjects", "generator", "useMemo", "createSpaceObjectGenerator", "objectsToCreate", "setObjectsToCreate", "useState", "enabled", "schema", "SchemasNames", "document", "objectsCount", "mutationsCount", "mutationSize", "maxContentLength", "diagram", "handleCreate", "params", "objectsCreated", "objects", "createObjects", "Math", "min", "mutateObjects", "count", "length", "db", "flush", "handleChangeOnRow", "row", "key", "value", "newObjects", "Object", "assign", "find", "object", "helper", "builder", "createColumnBuilder", "columns", "accessor", "switch", "label", "onUpdate", "string", "classNames", "number", "Table", "Root", "Viewport", "Main", "data", "Button", "onClick", "DEFAULT_COUNT", "DEFAULT_PERIOD", "DEFAULT_JITTER", "useRefresh", "update", "setUpdate", "useState", "DebugSpace", "space", "onAddObjects", "connect", "useSpaceInvitation", "key", "client", "useClient", "data", "setData", "handleUpdate", "useAsyncEffect", "isMounted", "diagnostics", "truncate", "spaces", "find", "toHex", "startsWith", "download", "useFileDownload", "handleCopy", "Blob", "JSON", "stringify", "undefined", "type", "Date", "toISOString", "replace", "mutationCount", "setMutationCount", "String", "mutationInterval", "setMutationInterval", "mutationJitter", "setMutationJitter", "generator", "useMemo", "createSpaceObjectGenerator", "running", "start", "stop", "useContext", "DebugContext", "handleToggleRunning", "objects", "db", "query", "Filter", "schema", "DocumentType", "run", "length", "object", "faker", "helpers", "arrayElement", "mutateObject", "count", "mutationSize", "maxContentLength", "safeParseInt", "interval", "jitter", "handleCreateInvitation", "invitation", "share", "Invitation", "Type", "INTERACTIVE", "authMethod", "AuthMethod", "NONE", "multiUse", "code", "InvitationEncoder", "encode", "get", "URL", "window", "origin", "searchParams", "set", "url", "navigator", "clipboard", "writeText", "handleCreateEpoch", "internal", "createEpoch", "React", "DebugPanel", "menu", "div", "className", "title", "Input", "Root", "TextInput", "autoComplete", "size", "classNames", "placeholder", "value", "onChange", "target", "Flag", "mx", "getSize", "Timer", "PlusMinus", "Button", "onClick", "HandPalm", "Play", "ArrowClockwise", "DownloadSimple", "FlagPennant", "UserCirclePlus", "ObjectCreator"]
7
- }
@@ -1,24 +0,0 @@
1
- // packages/plugins/plugin-debug/src/components/DebugPanel.tsx
2
- import { formatDistance } from "date-fns";
3
- import React from "react";
4
- import { useConfig } from "@dxos/react-client";
5
- var DebugPanel = ({ menu, children }) => {
6
- const config = useConfig();
7
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", {
8
- className: "flex shrink-0 p-2 space-x-2"
9
- }, menu), /* @__PURE__ */ React.createElement("div", {
10
- className: "flex flex-col grow px-2 overflow-hidden"
11
- }, /* @__PURE__ */ React.createElement("div", {
12
- className: "flex flex-col grow overflow-auto"
13
- }, children), config.values?.runtime?.app?.build?.timestamp && /* @__PURE__ */ React.createElement("div", {
14
- className: "p-2 text-sm font-mono"
15
- }, config.values?.runtime?.app?.build?.version, formatDistance(new Date(config.values?.runtime?.app?.build?.timestamp), /* @__PURE__ */ new Date(), {
16
- addSuffix: true,
17
- includeSeconds: true
18
- }))));
19
- };
20
-
21
- export {
22
- DebugPanel
23
- };
24
- //# sourceMappingURL=chunk-H3BJHVRD.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/DebugPanel.tsx"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { formatDistance } from 'date-fns';\nimport React, { type PropsWithChildren, type ReactNode } from 'react';\n\nimport { useConfig } from '@dxos/react-client';\n\nexport const DebugPanel = ({ menu, children }: PropsWithChildren<{ menu: ReactNode }>) => {\n const config = useConfig();\n return (\n <>\n <div className='flex shrink-0 p-2 space-x-2'>{menu}</div>\n <div className='flex flex-col grow px-2 overflow-hidden'>\n <div className='flex flex-col grow overflow-auto'>{children}</div>\n {config.values?.runtime?.app?.build?.timestamp && (\n <div className='p-2 text-sm font-mono'>\n {config.values?.runtime?.app?.build?.version}\n {formatDistance(new Date(config.values?.runtime?.app?.build?.timestamp), new Date(), {\n addSuffix: true,\n includeSeconds: true,\n })}\n </div>\n )}\n </div>\n </>\n );\n};\n"],
5
- "mappings": ";AAIA,SAASA,sBAAsB;AAC/B,OAAOC,WAAuD;AAE9D,SAASC,iBAAiB;AAEnB,IAAMC,aAAa,CAAC,EAAEC,MAAMC,SAAQ,MAA0C;AACnF,QAAMC,SAASC,UAAAA;AACf,SACE,sBAAA,cAAA,MAAA,UAAA,MACE,sBAAA,cAACC,OAAAA;IAAIC,WAAU;KAA+BL,IAAAA,GAC9C,sBAAA,cAACI,OAAAA;IAAIC,WAAU;KACb,sBAAA,cAACD,OAAAA;IAAIC,WAAU;KAAoCJ,QAAAA,GAClDC,OAAOI,QAAQC,SAASC,KAAKC,OAAOC,aACnC,sBAAA,cAACN,OAAAA;IAAIC,WAAU;KACZH,OAAOI,QAAQC,SAASC,KAAKC,OAAOE,SACpCC,eAAe,IAAIC,KAAKX,OAAOI,QAAQC,SAASC,KAAKC,OAAOC,SAAAA,GAAY,oBAAIG,KAAAA,GAAQ;IACnFC,WAAW;IACXC,gBAAgB;EAClB,CAAA,CAAA,CAAA,CAAA;AAMZ;",
6
- "names": ["formatDistance", "React", "useConfig", "DebugPanel", "menu", "children", "config", "useConfig", "div", "className", "values", "runtime", "app", "build", "timestamp", "version", "formatDistance", "Date", "addSuffix", "includeSeconds"]
7
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"DebugGlobal.d.ts","sourceRoot":"","sources":["../../../../src/components/DebugGlobal.tsx"],"names":[],"mappings":"AAKA,OAAc,EAAE,KAAK,EAAE,EAAuB,MAAM,OAAO,CAAC;AAE5D,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAQhD,QAAA,MAAM,WAAW,EAAE,EAAE,CAAC;IAAE,KAAK,EAAE,KAAK,CAAA;CAAE,CA6DrC,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -1,5 +0,0 @@
1
- import React, { type PropsWithChildren, type ReactNode } from 'react';
2
- export declare const DebugPanel: ({ menu, children }: PropsWithChildren<{
3
- menu: ReactNode;
4
- }>) => React.JSX.Element;
5
- //# sourceMappingURL=DebugPanel.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DebugPanel.d.ts","sourceRoot":"","sources":["../../../../src/components/DebugPanel.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAItE,eAAO,MAAM,UAAU,uBAAwB,iBAAiB,CAAC;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,CAAC,sBAmBpF,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"DebugSpace.d.ts","sourceRoot":"","sources":["../../../../src/components/DebugSpace.tsx"],"names":[],"mappings":"AAeA,OAAc,EAAE,KAAK,EAAE,EAAiC,MAAM,OAAO,CAAC;AAEtE,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAKxD,OAAO,EAAU,KAAK,KAAK,EAAsB,MAAM,yBAAyB,CAAC;AAsBjF,QAAA,MAAM,UAAU,EAAE,EAAE,CAAC;IACnB,KAAK,EAAE,KAAK,CAAC;IACb,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,CAAC,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC;CACzD,CAiJA,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"DebugSpace.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/DebugSpace.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAyB7C,eAAO,MAAM,OAAO,IAAK,CAAC;AAE1B,QAAA,MAAM,IAAI,EAAE,IAOX,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ObjectCreator.d.ts","sourceRoot":"","sources":["../../../../src/components/ObjectCreator.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAEjD,OAAO,EAA2B,KAAK,cAAc,EAAE,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAInG,OAAO,EAAE,YAAY,EAA8B,MAAM,gBAAgB,CAAC;AAE1E,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,YAAY,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,MAAM,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAIF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,KAAK,CAAC;IACb,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,CAAC,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC;CACzD,CAAC;AAEF,eAAO,MAAM,aAAa,4BAA6B,kBAAkB,sBAsExE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ObjectCreator.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/ObjectCreator.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,kBAAkB,CAAC;AA6B7C,eAAO,MAAM,OAAO,IAAK,CAAC;AAE1B,QAAA,MAAM,IAAI,EAAE,IAOX,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Tree.d.ts","sourceRoot":"","sources":["../../../../src/components/Tree.tsx"],"names":[],"mappings":"AAIA,OAAc,EAAE,KAAK,EAAE,EAAiC,MAAM,OAAO,CAAC;AAQtE,eAAO,MAAM,QAAQ,QAAS,GAAG,SAAS,GAAG,QAgB5C,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,EAAE,CAAC;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAEtC,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,EAAE,CAAC;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAMtC,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,EAAE,CAAC;IAAE,IAAI,CAAC,EAAE,GAAG,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,CAsBnD,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,GAAG,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAiB1E,CAAC"}
@@ -1,11 +0,0 @@
1
- import { SpaceObjectGenerator, type TestGeneratorMap, type TestMutationsMap, type TestSchemaMap } from '@dxos/echo-generator';
2
- import { type Space } from '@dxos/react-client/echo';
3
- export declare enum SchemasNames {
4
- document = "dxos.org/type/Document",
5
- diagram = "dxos.org/type/Diagram"
6
- }
7
- export declare const SchemasMap: TestSchemaMap<SchemasNames>;
8
- export declare const ObjectGenerators: TestGeneratorMap<SchemasNames>;
9
- export declare const MutationsGenerators: TestMutationsMap<SchemasNames>;
10
- export declare const createSpaceObjectGenerator: (space: Space) => SpaceObjectGenerator<SchemasNames>;
11
- //# sourceMappingURL=generator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../../../src/scaffolding/generator.ts"],"names":[],"mappings":"AAeA,OAAO,EACL,oBAAoB,EACpB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAO9B,OAAO,EAAqB,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAKxE,oBAAY,YAAY;IACtB,QAAQ,2BAA2B;IACnC,OAAO,0BAA0B;CAClC;AAED,eAAO,MAAM,UAAU,EAAE,aAAa,CAAC,YAAY,CAGlD,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,gBAAgB,CAAC,YAAY,CAa3D,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,gBAAgB,CAAC,YAAY,CAqF9D,CAAC;AAEF,eAAO,MAAM,0BAA0B,UAAW,KAAK,uCAC6B,CAAC"}
@@ -1,2 +0,0 @@
1
- export * from './generator';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/scaffolding/index.ts"],"names":[],"mappings":"AAIA,cAAc,aAAa,CAAC"}
@@ -1,29 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- import { formatDistance } from 'date-fns';
6
- import React, { type PropsWithChildren, type ReactNode } from 'react';
7
-
8
- import { useConfig } from '@dxos/react-client';
9
-
10
- export const DebugPanel = ({ menu, children }: PropsWithChildren<{ menu: ReactNode }>) => {
11
- const config = useConfig();
12
- return (
13
- <>
14
- <div className='flex shrink-0 p-2 space-x-2'>{menu}</div>
15
- <div className='flex flex-col grow px-2 overflow-hidden'>
16
- <div className='flex flex-col grow overflow-auto'>{children}</div>
17
- {config.values?.runtime?.app?.build?.timestamp && (
18
- <div className='p-2 text-sm font-mono'>
19
- {config.values?.runtime?.app?.build?.version}
20
- {formatDistance(new Date(config.values?.runtime?.app?.build?.timestamp), new Date(), {
21
- addSuffix: true,
22
- includeSeconds: true,
23
- })}
24
- </div>
25
- )}
26
- </div>
27
- </>
28
- );
29
- };