@dxos/plugin-debug 0.8.4-main.c85a9c8dae → 0.8.4-main.dfabb4ec29

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 (198) hide show
  1. package/dist/lib/{browser/DebugGraph-7HXJ2PS2.mjs → neutral/DebugGraph-G4FWS57E.mjs} +4 -5
  2. package/dist/lib/neutral/DebugGraph-G4FWS57E.mjs.map +7 -0
  3. package/dist/lib/neutral/DebugObjectPanel-UJ63CV25.mjs +59 -0
  4. package/dist/lib/neutral/DebugObjectPanel-UJ63CV25.mjs.map +7 -0
  5. package/dist/lib/neutral/DebugPlugin.mjs +47 -0
  6. package/dist/lib/neutral/DebugPlugin.mjs.map +7 -0
  7. package/dist/lib/neutral/DebugPlugin.node.mjs +18 -0
  8. package/dist/lib/neutral/DebugPlugin.node.mjs.map +7 -0
  9. package/dist/lib/neutral/DebugSettings-Z3XADRNK.mjs +224 -0
  10. package/dist/lib/neutral/DebugSettings-Z3XADRNK.mjs.map +7 -0
  11. package/dist/lib/{browser/DebugSpaceObjectsPanel-7NRPLWZ4.mjs → neutral/DebugSpaceObjectsPanel-NISULU6U.mjs} +10 -26
  12. package/dist/lib/neutral/DebugSpaceObjectsPanel-NISULU6U.mjs.map +7 -0
  13. package/dist/lib/{browser/DebugStatus-COQGH37G.mjs → neutral/DebugStatus-YB3KFP7G.mjs} +35 -39
  14. package/dist/lib/neutral/DebugStatus-YB3KFP7G.mjs.map +7 -0
  15. package/dist/lib/{browser/DevtoolsOverviewContainer-C75NFVER.mjs → neutral/DevtoolsOverviewContainer-YX7Z3D2H.mjs} +9 -6
  16. package/dist/lib/neutral/DevtoolsOverviewContainer-YX7Z3D2H.mjs.map +7 -0
  17. package/dist/lib/neutral/SpaceGenerator-UBYB4NPD.mjs +143 -0
  18. package/dist/lib/neutral/SpaceGenerator-UBYB4NPD.mjs.map +7 -0
  19. package/dist/lib/{browser/Wireframe-KAGOKEFW.mjs → neutral/Wireframe-7SNRUKET.mjs} +8 -9
  20. package/dist/lib/neutral/Wireframe-7SNRUKET.mjs.map +7 -0
  21. package/dist/lib/{browser/app-graph-builder-LGUQNXHD.mjs → neutral/app-graph-builder-YPYHL2K5.mjs} +210 -258
  22. package/dist/lib/neutral/app-graph-builder-YPYHL2K5.mjs.map +7 -0
  23. package/dist/lib/neutral/capabilities/index.mjs +15 -0
  24. package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
  25. package/dist/lib/{browser/chunk-A5H5GRV6.mjs → neutral/chunk-3OGPOE7H.mjs} +2 -2
  26. package/dist/lib/{browser/chunk-A5H5GRV6.mjs.map → neutral/chunk-3OGPOE7H.mjs.map} +3 -3
  27. package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
  28. package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +7 -0
  29. package/dist/lib/{browser/chunk-4UFQXPP7.mjs → neutral/chunk-NFIOTQRZ.mjs} +23 -12
  30. package/dist/lib/neutral/chunk-NFIOTQRZ.mjs.map +7 -0
  31. package/dist/lib/{browser/SpaceGenerator-SWSGJEEL.mjs → neutral/components/index.mjs} +60 -253
  32. package/dist/lib/neutral/components/index.mjs.map +7 -0
  33. package/dist/lib/neutral/containers/index.mjs +21 -0
  34. package/dist/lib/neutral/containers/index.mjs.map +7 -0
  35. package/dist/lib/neutral/index.mjs +18 -0
  36. package/dist/lib/neutral/index.mjs.map +7 -0
  37. package/dist/lib/neutral/meta.json +1 -0
  38. package/dist/lib/neutral/meta.mjs +8 -0
  39. package/dist/lib/neutral/meta.mjs.map +7 -0
  40. package/dist/lib/neutral/plugin.mjs +12 -0
  41. package/dist/lib/neutral/plugin.mjs.map +7 -0
  42. package/dist/lib/{browser/react-context-I3USIAF6.mjs → neutral/react-context-MUZ3KVLU.mjs} +6 -6
  43. package/dist/lib/neutral/react-context-MUZ3KVLU.mjs.map +7 -0
  44. package/dist/lib/{browser/react-surface-BTVNKKVQ.mjs → neutral/react-surface-NH2H63KW.mjs} +153 -176
  45. package/dist/lib/neutral/react-surface-NH2H63KW.mjs.map +7 -0
  46. package/dist/lib/{browser/settings-SLTQJJNF.mjs → neutral/settings-MPM6YUP4.mjs} +7 -11
  47. package/dist/lib/neutral/settings-MPM6YUP4.mjs.map +7 -0
  48. package/dist/lib/neutral/translations.mjs +83 -0
  49. package/dist/lib/neutral/translations.mjs.map +7 -0
  50. package/dist/lib/neutral/types/index.mjs +14 -0
  51. package/dist/lib/neutral/types/index.mjs.map +7 -0
  52. package/dist/types/src/DebugPlugin.d.ts +2 -5
  53. package/dist/types/src/DebugPlugin.d.ts.map +1 -1
  54. package/dist/types/src/DebugPlugin.node.d.ts +5 -0
  55. package/dist/types/src/DebugPlugin.node.d.ts.map +1 -0
  56. package/dist/types/src/DebugPlugin.test.d.ts +2 -0
  57. package/dist/types/src/DebugPlugin.test.d.ts.map +1 -0
  58. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
  59. package/dist/types/src/capabilities/index.d.ts +11 -4
  60. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  61. package/dist/types/src/capabilities/react-context.d.ts.map +1 -0
  62. package/dist/types/src/capabilities/{react-surface/react-surface.d.ts → react-surface.d.ts} +2 -2
  63. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
  64. package/dist/types/src/capabilities/{settings/settings.d.ts → settings.d.ts} +2 -1
  65. package/dist/types/src/capabilities/settings.d.ts.map +1 -0
  66. package/dist/types/src/components/DebugSettings/DebugSettings.d.ts +11 -0
  67. package/dist/types/src/components/DebugSettings/DebugSettings.d.ts.map +1 -0
  68. package/dist/types/src/components/DebugSettings/DebugSettings.stories.d.ts +99 -0
  69. package/dist/types/src/components/DebugSettings/DebugSettings.stories.d.ts.map +1 -0
  70. package/dist/types/src/components/DebugSettings/index.d.ts +2 -0
  71. package/dist/types/src/components/DebugSettings/index.d.ts.map +1 -0
  72. package/dist/types/src/components/SchemaTable/SchemaTable.d.ts.map +1 -1
  73. package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts +2 -2
  74. package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts.map +1 -1
  75. package/dist/types/src/components/SpaceGenerator/draw-util.d.ts.map +1 -1
  76. package/dist/types/src/components/SpaceGenerator/presets.d.ts.map +1 -1
  77. package/dist/types/src/components/index.d.ts +2 -0
  78. package/dist/types/src/components/index.d.ts.map +1 -1
  79. package/dist/types/src/containers/DebugGraph/DebugGraph.d.ts +2 -2
  80. package/dist/types/src/containers/DebugGraph/DebugGraph.d.ts.map +1 -1
  81. package/dist/types/src/containers/DebugGraph/index.d.ts +1 -2
  82. package/dist/types/src/containers/DebugGraph/index.d.ts.map +1 -1
  83. package/dist/types/src/containers/DebugObjectPanel/DebugObjectPanel.d.ts +3 -4
  84. package/dist/types/src/containers/DebugObjectPanel/DebugObjectPanel.d.ts.map +1 -1
  85. package/dist/types/src/containers/DebugObjectPanel/index.d.ts +1 -2
  86. package/dist/types/src/containers/DebugObjectPanel/index.d.ts.map +1 -1
  87. package/dist/types/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.d.ts +3 -1
  88. package/dist/types/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.d.ts.map +1 -1
  89. package/dist/types/src/containers/DebugSpaceObjectsPanel/index.d.ts +1 -2
  90. package/dist/types/src/containers/DebugSpaceObjectsPanel/index.d.ts.map +1 -1
  91. package/dist/types/src/containers/DebugStatus/DebugStatus.d.ts.map +1 -1
  92. package/dist/types/src/containers/DebugStatus/index.d.ts +1 -2
  93. package/dist/types/src/containers/DebugStatus/index.d.ts.map +1 -1
  94. package/dist/types/src/containers/DevtoolsOverviewContainer/DevtoolsOverviewContainer.d.ts.map +1 -1
  95. package/dist/types/src/containers/DevtoolsOverviewContainer/index.d.ts +1 -2
  96. package/dist/types/src/containers/DevtoolsOverviewContainer/index.d.ts.map +1 -1
  97. package/dist/types/src/containers/SpaceGenerator/SpaceGenerator.d.ts +3 -1
  98. package/dist/types/src/containers/SpaceGenerator/SpaceGenerator.d.ts.map +1 -1
  99. package/dist/types/src/containers/SpaceGenerator/index.d.ts +1 -2
  100. package/dist/types/src/containers/SpaceGenerator/index.d.ts.map +1 -1
  101. package/dist/types/src/containers/Wireframe/Wireframe.d.ts.map +1 -1
  102. package/dist/types/src/containers/Wireframe/index.d.ts +1 -2
  103. package/dist/types/src/containers/Wireframe/index.d.ts.map +1 -1
  104. package/dist/types/src/containers/index.d.ts +0 -1
  105. package/dist/types/src/containers/index.d.ts.map +1 -1
  106. package/dist/types/src/index.d.ts +1 -1
  107. package/dist/types/src/index.d.ts.map +1 -1
  108. package/dist/types/src/plugin.d.ts +4 -0
  109. package/dist/types/src/plugin.d.ts.map +1 -0
  110. package/dist/types/src/translations.d.ts +80 -61
  111. package/dist/types/src/translations.d.ts.map +1 -1
  112. package/dist/types/src/types/Settings.d.ts +8 -0
  113. package/dist/types/src/types/Settings.d.ts.map +1 -0
  114. package/dist/types/src/types/index.d.ts +69 -0
  115. package/dist/types/src/types/index.d.ts.map +1 -0
  116. package/dist/types/tsconfig.tsbuildinfo +1 -1
  117. package/package.json +115 -64
  118. package/src/DebugPlugin.node.ts +18 -0
  119. package/src/DebugPlugin.test.ts +29 -0
  120. package/src/DebugPlugin.tsx +9 -11
  121. package/src/capabilities/app-graph-builder.ts +405 -0
  122. package/src/capabilities/index.ts +6 -4
  123. package/src/capabilities/{react-context/react-context.tsx → react-context.tsx} +7 -2
  124. package/src/capabilities/{react-surface/react-surface.tsx → react-surface.tsx} +169 -158
  125. package/src/capabilities/{settings/settings.ts → settings.ts} +4 -4
  126. package/src/components/DebugSettings/DebugSettings.stories.tsx +36 -0
  127. package/src/components/DebugSettings/DebugSettings.tsx +262 -0
  128. package/src/components/DebugSettings/index.ts +5 -0
  129. package/src/components/SpaceGenerator/ObjectGenerator.tsx +13 -15
  130. package/src/components/SpaceGenerator/draw-util.ts +8 -8
  131. package/src/components/SpaceGenerator/presets.ts +28 -50
  132. package/src/components/index.ts +4 -0
  133. package/src/containers/DebugGraph/DebugGraph.tsx +3 -2
  134. package/src/containers/DebugGraph/index.ts +1 -3
  135. package/src/containers/DebugObjectPanel/DebugObjectPanel.tsx +47 -16
  136. package/src/containers/DebugObjectPanel/index.ts +1 -3
  137. package/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.tsx +10 -23
  138. package/src/containers/DebugSpaceObjectsPanel/index.ts +1 -3
  139. package/src/containers/DebugStatus/DebugStatus.tsx +41 -19
  140. package/src/containers/DebugStatus/index.ts +1 -3
  141. package/src/containers/DevtoolsOverviewContainer/DevtoolsOverviewContainer.tsx +8 -1
  142. package/src/containers/DevtoolsOverviewContainer/index.ts +1 -3
  143. package/src/containers/SpaceGenerator/SpaceGenerator.tsx +102 -103
  144. package/src/containers/SpaceGenerator/index.ts +1 -3
  145. package/src/containers/Wireframe/Wireframe.tsx +2 -6
  146. package/src/containers/Wireframe/index.ts +1 -3
  147. package/src/containers/index.ts +0 -1
  148. package/src/index.ts +1 -1
  149. package/src/meta.ts +1 -1
  150. package/src/plugin.ts +10 -0
  151. package/src/translations.ts +75 -60
  152. package/src/types/Settings.ts +16 -0
  153. package/src/{types.ts → types/index.ts} +15 -14
  154. package/dist/lib/browser/DebugGraph-7HXJ2PS2.mjs.map +0 -7
  155. package/dist/lib/browser/DebugObjectPanel-3TCDNUNW.mjs +0 -33
  156. package/dist/lib/browser/DebugObjectPanel-3TCDNUNW.mjs.map +0 -7
  157. package/dist/lib/browser/DebugSettings-JZMIUDYB.mjs +0 -174
  158. package/dist/lib/browser/DebugSettings-JZMIUDYB.mjs.map +0 -7
  159. package/dist/lib/browser/DebugSpaceObjectsPanel-7NRPLWZ4.mjs.map +0 -7
  160. package/dist/lib/browser/DebugStatus-COQGH37G.mjs.map +0 -7
  161. package/dist/lib/browser/DevtoolsOverviewContainer-C75NFVER.mjs.map +0 -7
  162. package/dist/lib/browser/SpaceGenerator-SWSGJEEL.mjs.map +0 -7
  163. package/dist/lib/browser/Wireframe-KAGOKEFW.mjs.map +0 -7
  164. package/dist/lib/browser/app-graph-builder-LGUQNXHD.mjs.map +0 -7
  165. package/dist/lib/browser/chunk-4UFQXPP7.mjs.map +0 -7
  166. package/dist/lib/browser/index.mjs +0 -132
  167. package/dist/lib/browser/index.mjs.map +0 -7
  168. package/dist/lib/browser/meta.json +0 -1
  169. package/dist/lib/browser/react-context-I3USIAF6.mjs.map +0 -7
  170. package/dist/lib/browser/react-surface-BTVNKKVQ.mjs.map +0 -7
  171. package/dist/lib/browser/settings-SLTQJJNF.mjs.map +0 -7
  172. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
  173. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
  174. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
  175. package/dist/types/src/capabilities/react-context/index.d.ts +0 -7
  176. package/dist/types/src/capabilities/react-context/index.d.ts.map +0 -1
  177. package/dist/types/src/capabilities/react-context/react-context.d.ts.map +0 -1
  178. package/dist/types/src/capabilities/react-surface/index.d.ts +0 -5
  179. package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
  180. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
  181. package/dist/types/src/capabilities/settings/index.d.ts +0 -3
  182. package/dist/types/src/capabilities/settings/index.d.ts.map +0 -1
  183. package/dist/types/src/capabilities/settings/settings.d.ts.map +0 -1
  184. package/dist/types/src/containers/DebugSettings/DebugSettings.d.ts +0 -10
  185. package/dist/types/src/containers/DebugSettings/DebugSettings.d.ts.map +0 -1
  186. package/dist/types/src/containers/DebugSettings/index.d.ts +0 -3
  187. package/dist/types/src/containers/DebugSettings/index.d.ts.map +0 -1
  188. package/dist/types/src/types.d.ts +0 -68
  189. package/dist/types/src/types.d.ts.map +0 -1
  190. package/src/capabilities/app-graph-builder/app-graph-builder.ts +0 -441
  191. package/src/capabilities/app-graph-builder/index.ts +0 -7
  192. package/src/capabilities/react-context/index.ts +0 -7
  193. package/src/capabilities/react-surface/index.ts +0 -7
  194. package/src/capabilities/settings/index.ts +0 -7
  195. package/src/containers/DebugSettings/DebugSettings.tsx +0 -201
  196. package/src/containers/DebugSettings/index.ts +0 -7
  197. /package/dist/types/src/capabilities/{app-graph-builder/app-graph-builder.d.ts → app-graph-builder.d.ts} +0 -0
  198. /package/dist/types/src/capabilities/{react-context/react-context.d.ts → react-context.d.ts} +0 -0
@@ -1,11 +1,12 @@
1
+ import "./chunk-J5LGTIGS.mjs";
2
+
1
3
  // src/containers/DebugStatus/DebugStatus.tsx
2
4
  import React, { useEffect, useRef, useState } from "react";
3
5
  import { TimeoutError } from "@dxos/async";
4
- import { useActiveSpace } from "@dxos/plugin-space";
5
- import { StatusBar } from "@dxos/plugin-status-bar";
6
+ import { StatusBar } from "@dxos/plugin-status-bar/components";
6
7
  import { ConnectionState } from "@dxos/protocols/proto/dxos/client/services";
7
8
  import { useNetworkStatus } from "@dxos/react-client/mesh";
8
- import { Icon } from "@dxos/react-ui";
9
+ import { IconButton } from "@dxos/react-ui";
9
10
  var styles = {
10
11
  success: "text-sky-300 dark:text-green-700",
11
12
  warning: "text-orange-300 dark:text-orange-600",
@@ -34,20 +35,19 @@ var ErrorIndicator = () => {
34
35
  forceUpdate({});
35
36
  };
36
37
  if (errorRef.current) {
37
- return /* @__PURE__ */ React.createElement(StatusBar.Button, {
38
- title: errorRef.current.message,
39
- onClick: handleReset
40
- }, /* @__PURE__ */ React.createElement(Icon, {
38
+ return /* @__PURE__ */ React.createElement(StatusBar.Item, null, /* @__PURE__ */ React.createElement(IconButton, {
41
39
  icon: "ph--warning-circle--duotone",
42
- size: 4,
43
- classNames: styles.error
40
+ iconOnly: true,
41
+ label: errorRef.current.message,
42
+ classNames: styles.error,
43
+ onClick: handleReset
44
44
  }));
45
45
  } else {
46
- return /* @__PURE__ */ React.createElement(StatusBar.Item, {
47
- title: "No errors."
48
- }, /* @__PURE__ */ React.createElement(Icon, {
46
+ return /* @__PURE__ */ React.createElement(StatusBar.Item, null, /* @__PURE__ */ React.createElement(IconButton, {
47
+ variant: "ghost",
49
48
  icon: "ph--check--regular",
50
- size: 4
49
+ iconOnly: true,
50
+ label: "No errors."
51
51
  }));
52
52
  }
53
53
  };
@@ -60,49 +60,48 @@ var SwarmIndicator = () => {
60
60
  swarm
61
61
  ]);
62
62
  if (state === 0) {
63
- return /* @__PURE__ */ React.createElement(StatusBar.Item, {
64
- title: "Connected to swarm."
65
- }, /* @__PURE__ */ React.createElement(Icon, {
63
+ return /* @__PURE__ */ React.createElement(StatusBar.Item, null, /* @__PURE__ */ React.createElement(IconButton, {
64
+ variant: "ghost",
66
65
  icon: "ph--lightning--regular",
67
- size: 4
66
+ iconOnly: true,
67
+ label: "Connected to swarm."
68
68
  }));
69
69
  } else {
70
- return /* @__PURE__ */ React.createElement(StatusBar.Item, {
71
- title: "Disconnected from swarm."
72
- }, /* @__PURE__ */ React.createElement(Icon, {
70
+ return /* @__PURE__ */ React.createElement(StatusBar.Item, null, /* @__PURE__ */ React.createElement(IconButton, {
71
+ variant: "ghost",
73
72
  icon: "ph--lightning-slash--regular",
74
- size: 4,
73
+ iconOnly: true,
74
+ label: "Disconnected from swarm.",
75
75
  classNames: styles.warning
76
76
  }));
77
77
  }
78
78
  };
79
79
  var SavingIndicator = () => {
80
80
  const [state, _setState] = useState(0);
81
- const _space = useActiveSpace();
82
81
  switch (state) {
83
82
  case 2:
84
- return /* @__PURE__ */ React.createElement(StatusBar.Item, {
85
- title: "Edit not saved."
86
- }, /* @__PURE__ */ React.createElement(Icon, {
83
+ return /* @__PURE__ */ React.createElement(StatusBar.Item, null, /* @__PURE__ */ React.createElement(IconButton, {
84
+ variant: "ghost",
87
85
  icon: "ph--circle--duotone",
88
- size: 4,
86
+ iconOnly: true,
87
+ label: "Edit not saved.",
89
88
  classNames: styles.warning
90
89
  }));
91
90
  case 1:
92
- return /* @__PURE__ */ React.createElement(StatusBar.Item, {
93
- title: "Saving..."
94
- }, /* @__PURE__ */ React.createElement(Icon, {
91
+ return /* @__PURE__ */ React.createElement(StatusBar.Item, null, /* @__PURE__ */ React.createElement(IconButton, {
92
+ variant: "ghost",
95
93
  icon: "ph--circle--duotone",
96
- size: 4,
94
+ iconOnly: true,
95
+ label: "Saving...",
97
96
  classNames: styles.success
98
97
  }));
99
98
  case 0:
100
99
  default:
101
- return /* @__PURE__ */ React.createElement(StatusBar.Item, {
102
- title: "Modified indicator."
103
- }, /* @__PURE__ */ React.createElement(Icon, {
100
+ return /* @__PURE__ */ React.createElement(StatusBar.Item, null, /* @__PURE__ */ React.createElement(IconButton, {
101
+ variant: "ghost",
104
102
  icon: "ph--circle--duotone",
105
- size: 4
103
+ iconOnly: true,
104
+ label: "Modified indicator."
106
105
  }));
107
106
  }
108
107
  };
@@ -116,10 +115,7 @@ var DebugStatus = () => {
116
115
  key: Indicator.name
117
116
  })));
118
117
  };
119
-
120
- // src/containers/DebugStatus/index.ts
121
- var DebugStatus_default = DebugStatus;
122
118
  export {
123
- DebugStatus_default as default
119
+ DebugStatus as default
124
120
  };
125
- //# sourceMappingURL=DebugStatus-COQGH37G.mjs.map
121
+ //# sourceMappingURL=DebugStatus-YB3KFP7G.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/containers/DebugStatus/DebugStatus.tsx"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { useEffect, useRef, useState } from 'react';\n\nimport { TimeoutError } from '@dxos/async';\nimport { StatusBar } from '@dxos/plugin-status-bar/components';\nimport { ConnectionState } from '@dxos/protocols/proto/dxos/client/services';\nimport { useNetworkStatus } from '@dxos/react-client/mesh';\nimport { IconButton } from '@dxos/react-ui';\n\nconst styles = {\n success: 'text-sky-300 dark:text-green-700',\n warning: 'text-orange-300 dark:text-orange-600',\n error: 'text-red-300 dark:text-red-600',\n};\n\n// TODO(burdon): Move out of debug plugin.\n// TODO(burdon): Make pluggable (move indicators to relevant plugins).\n// TODO(burdon): Vault heartbeat indicator (global scope)?\n\n/**\n * Ensure light doesn't flicker immediately after start.\n */\n// TODO(burdon): Move to @dxos/async (debounce?)\nconst _timer = (cb: (err?: Error) => void, options?: { min?: number; max?: number }) => {\n const min = options?.min ?? 500;\n let start: number;\n let pending: NodeJS.Timeout;\n let timeout: NodeJS.Timeout;\n return {\n start: () => {\n start = Date.now();\n clearTimeout(pending);\n if (options?.max) {\n clearTimeout(timeout);\n timeout = setTimeout(() => {\n cb(new TimeoutError(options.max));\n }, options.max);\n }\n },\n stop: () => {\n clearTimeout(timeout);\n const delta = Date.now() - start;\n if (delta < min) {\n pending = setTimeout(() => {\n cb();\n }, min - delta);\n }\n },\n };\n};\n\n/**\n * Global error handler.\n */\n// TODO(burdon): Integrate with Sentry?\nconst ErrorIndicator = () => {\n const [, forceUpdate] = useState({});\n const errorRef = useRef<Error>(null);\n useEffect(() => {\n const errorListener = (event: any) => {\n const error: Error = event.error ?? event.reason;\n if (errorRef.current !== error) {\n errorRef.current = error;\n forceUpdate({});\n }\n };\n\n // TODO(burdon): Register globally?\n // https://developer.mozilla.org/en-US/docs/Web/API/Window/error_event\n window.addEventListener('error', errorListener);\n\n // https://developer.mozilla.org/en-US/docs/Web/API/Window/unhandledrejection_event\n window.addEventListener('unhandledrejection', errorListener);\n\n return () => {\n window.removeEventListener('error', errorListener);\n window.removeEventListener('unhandledrejection', errorListener);\n };\n }, []);\n\n const handleReset = () => {\n errorRef.current = null;\n forceUpdate({});\n };\n\n if (errorRef.current) {\n return (\n <StatusBar.Item>\n <IconButton\n icon='ph--warning-circle--duotone'\n iconOnly\n label={errorRef.current.message}\n classNames={styles.error}\n onClick={handleReset}\n />\n </StatusBar.Item>\n );\n } else {\n return (\n <StatusBar.Item>\n <IconButton variant='ghost' icon='ph--check--regular' iconOnly label='No errors.' />\n </StatusBar.Item>\n );\n }\n};\n\n/**\n * Swarm connection handler.\n */\nconst SwarmIndicator = () => {\n const [state, setState] = useState(0);\n const { swarm } = useNetworkStatus();\n useEffect(() => {\n setState(swarm === ConnectionState.ONLINE ? 0 : 1);\n }, [swarm]);\n\n if (state === 0) {\n return (\n <StatusBar.Item>\n <IconButton variant='ghost' icon='ph--lightning--regular' iconOnly label='Connected to swarm.' />\n </StatusBar.Item>\n );\n } else {\n return (\n <StatusBar.Item>\n <IconButton\n variant='ghost'\n icon='ph--lightning-slash--regular'\n iconOnly\n label='Disconnected from swarm.'\n classNames={styles.warning}\n />\n </StatusBar.Item>\n );\n }\n};\n\n/**\n * Data saving indicator.\n */\n// TODO(burdon): Merge with SaveStatus.\nconst SavingIndicator = () => {\n const [state, _setState] = useState(0);\n // TODO(dmaretskyi): Fix this when we have save status for automerge.\n // useEffect(() => {\n // if (!space) {\n // return;\n // }\n // const { start, stop } = timer(() => setState(0), { min: 250 });\n // return space.db.pendingBatch.on(({ duration, error }) => {\n // if (error) {\n // setState(2);\n // stop();\n // } else if (duration === undefined) {\n // setState(1);\n // start();\n // } else {\n // stop();\n // }\n // });\n // }, [space]);\n\n switch (state) {\n case 2:\n return (\n <StatusBar.Item>\n <IconButton\n variant='ghost'\n icon='ph--circle--duotone'\n iconOnly\n label='Edit not saved.'\n classNames={styles.warning}\n />\n </StatusBar.Item>\n );\n case 1:\n return (\n <StatusBar.Item>\n <IconButton\n variant='ghost'\n icon='ph--circle--duotone'\n iconOnly\n label='Saving...'\n classNames={styles.success}\n />\n </StatusBar.Item>\n );\n case 0:\n default:\n return (\n <StatusBar.Item>\n <IconButton variant='ghost' icon='ph--circle--duotone' iconOnly label='Modified indicator.' />\n </StatusBar.Item>\n );\n }\n};\n\nconst indicators = [SavingIndicator, SwarmIndicator, ErrorIndicator];\n\nexport const DebugStatus = () => {\n return (\n <>\n {indicators.map((Indicator) => (\n <Indicator key={Indicator.name} />\n ))}\n </>\n );\n};\n"],
5
+ "mappings": ";;;AAIA,OAAOA,SAASC,WAAWC,QAAQC,gBAAgB;AAEnD,SAASC,oBAAoB;AAC7B,SAASC,iBAAiB;AAC1B,SAASC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AAEV,MAAIF,UAAU,GAAG;AACf,WACE,sBAAA,cAACZ,UAAUC,MAAI,MACb,sBAAA,cAACC,YAAAA;MAAWQ,SAAQ;MAAQP,MAAK;MAAyBC,UAAAA;MAASC,OAAM;;EAG/E,OAAO;AACL,WACE,sBAAA,cAACL,UAAUC,MAAI,MACb,sBAAA,cAACC,YAAAA;MACCQ,SAAQ;MACRP,MAAK;MACLC,UAAAA;MACAC,OAAM;MACNE,YAAYC,OAAOU;;EAI3B;AACF;AAMA,IAAMC,kBAAkB,MAAA;AACtB,QAAM,CAACP,OAAOQ,SAAAA,IAAajC,SAAS,CAAA;AAoBpC,UAAQyB,OAAAA;IACN,KAAK;AACH,aACE,sBAAA,cAACZ,UAAUC,MAAI,MACb,sBAAA,cAACC,YAAAA;QACCQ,SAAQ;QACRP,MAAK;QACLC,UAAAA;QACAC,OAAM;QACNE,YAAYC,OAAOU;;IAI3B,KAAK;AACH,aACE,sBAAA,cAAClB,UAAUC,MAAI,MACb,sBAAA,cAACC,YAAAA;QACCQ,SAAQ;QACRP,MAAK;QACLC,UAAAA;QACAC,OAAM;QACNE,YAAYC,OAAOa;;IAI3B,KAAK;IACL;AACE,aACE,sBAAA,cAACrB,UAAUC,MAAI,MACb,sBAAA,cAACC,YAAAA;QAAWQ,SAAQ;QAAQP,MAAK;QAAsBC,UAAAA;QAASC,OAAM;;EAG9E;AACF;AAEA,IAAMiB,aAAa;EAACH;EAAiBR;EAAgB1B;;AAE9C,IAAMsC,cAAc,MAAA;AACzB,SACE,sBAAA,cAAA,MAAA,UAAA,MACGD,WAAWE,IAAI,CAACC,cACf,sBAAA,cAACA,WAAAA;IAAUC,KAAKD,UAAUE;;AAIlC;",
6
+ "names": ["React", "useEffect", "useRef", "useState", "TimeoutError", "StatusBar", "ConnectionState", "useNetworkStatus", "IconButton", "styles", "success", "warning", "error", "ErrorIndicator", "forceUpdate", "useState", "errorRef", "useRef", "useEffect", "errorListener", "event", "error", "reason", "current", "window", "addEventListener", "removeEventListener", "handleReset", "StatusBar", "Item", "IconButton", "icon", "iconOnly", "label", "message", "classNames", "styles", "onClick", "variant", "SwarmIndicator", "state", "setState", "swarm", "useNetworkStatus", "ConnectionState", "ONLINE", "warning", "SavingIndicator", "_setState", "success", "indicators", "DebugStatus", "map", "Indicator", "key", "name"]
7
+ }
@@ -1,20 +1,23 @@
1
+ import "./chunk-J5LGTIGS.mjs";
2
+
1
3
  // src/containers/DevtoolsOverviewContainer/DevtoolsOverviewContainer.tsx
2
4
  import React from "react";
3
5
  import { Surface } from "@dxos/app-framework/ui";
4
6
  import { StatsPanel, useStats } from "@dxos/devtools";
5
7
  var DevtoolsOverviewContainer = () => {
6
8
  const [stats, refreshStats] = useStats();
9
+ const surfaceProfilerStats = Surface.useProfilerStats();
10
+ const clearSurfaceProfiler = Surface.useProfilerClear();
7
11
  return /* @__PURE__ */ React.createElement(StatsPanel, {
8
12
  stats,
9
- onRefresh: refreshStats
13
+ surfaceProfilerStats,
14
+ onRefresh: refreshStats,
15
+ onClearSurfaceProfiler: clearSurfaceProfiler
10
16
  }, /* @__PURE__ */ React.createElement(Surface.Surface, {
11
17
  role: "devtools-overview"
12
18
  }));
13
19
  };
14
-
15
- // src/containers/DevtoolsOverviewContainer/index.ts
16
- var DevtoolsOverviewContainer_default = DevtoolsOverviewContainer;
17
20
  export {
18
- DevtoolsOverviewContainer_default as default
21
+ DevtoolsOverviewContainer as default
19
22
  };
20
- //# sourceMappingURL=DevtoolsOverviewContainer-C75NFVER.mjs.map
23
+ //# sourceMappingURL=DevtoolsOverviewContainer-YX7Z3D2H.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/containers/DevtoolsOverviewContainer/DevtoolsOverviewContainer.tsx"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Surface } from '@dxos/app-framework/ui';\nimport { StatsPanel, useStats } from '@dxos/devtools';\n\nexport const DevtoolsOverviewContainer = () => {\n const [stats, refreshStats] = useStats();\n const surfaceProfilerStats = Surface.useProfilerStats();\n const clearSurfaceProfiler = Surface.useProfilerClear();\n\n return (\n <StatsPanel\n stats={stats}\n surfaceProfilerStats={surfaceProfilerStats}\n onRefresh={refreshStats}\n onClearSurfaceProfiler={clearSurfaceProfiler}\n >\n <Surface.Surface role='devtools-overview' />\n </StatsPanel>\n );\n};\n"],
5
+ "mappings": ";;;AAIA,OAAOA,WAAW;AAElB,SAASC,eAAe;AACxB,SAASC,YAAYC,gBAAgB;AAE9B,IAAMC,4BAA4B,MAAA;AACvC,QAAM,CAACC,OAAOC,YAAAA,IAAgBH,SAAAA;AAC9B,QAAMI,uBAAuBN,QAAQO,iBAAgB;AACrD,QAAMC,uBAAuBR,QAAQS,iBAAgB;AAErD,SACE,sBAAA,cAACR,YAAAA;IACCG;IACAE;IACAI,WAAWL;IACXM,wBAAwBH;KAExB,sBAAA,cAACR,QAAQA,SAAO;IAACY,MAAK;;AAG5B;",
6
+ "names": ["React", "Surface", "StatsPanel", "useStats", "DevtoolsOverviewContainer", "stats", "refreshStats", "surfaceProfilerStats", "useProfilerStats", "clearSurfaceProfiler", "useProfilerClear", "onRefresh", "onClearSurfaceProfiler", "role"]
7
+ }
@@ -0,0 +1,143 @@
1
+ import "./chunk-J5LGTIGS.mjs";
2
+
3
+ // src/containers/SpaceGenerator/SpaceGenerator.tsx
4
+ import React, { useCallback, useMemo, useState } from "react";
5
+ import { useOperationInvoker } from "@dxos/app-framework/ui";
6
+ import { ComputeGraph } from "@dxos/conductor";
7
+ import { Filter, Obj } from "@dxos/echo";
8
+ import { Markdown } from "@dxos/plugin-markdown";
9
+ import { Sheet } from "@dxos/plugin-sheet";
10
+ import { Sketch } from "@dxos/plugin-sketch";
11
+ import { useClient } from "@dxos/react-client";
12
+ import { IconButton, Input, Panel, ScrollArea, Toolbar, useAsyncEffect } from "@dxos/react-ui";
13
+ import { Organization, Person, Task } from "@dxos/types";
14
+ import { composable, composableProps } from "@dxos/ui-theme";
15
+ import { sortKeys } from "@dxos/util";
16
+ import { SchemaTable, createGenerator, generator, staticGenerators } from "#components";
17
+ var staticTypes = [
18
+ Markdown.Document,
19
+ Sketch.Sketch,
20
+ Sheet.Sheet,
21
+ ComputeGraph
22
+ ];
23
+ var recordTypes = [
24
+ Organization.Organization,
25
+ Person.Person,
26
+ Task.Task
27
+ ];
28
+ var SpaceGenerator = composable(({ space, onCreateObjects, children, ...props }, forwardedRef) => {
29
+ const { invokePromise } = useOperationInvoker();
30
+ const client = useClient();
31
+ const [count, setCount] = useState(1);
32
+ const [info, setInfo] = useState({});
33
+ const presets = useMemo(() => generator(), []);
34
+ useAsyncEffect(async () => {
35
+ await client.addTypes([
36
+ ...staticTypes,
37
+ ...recordTypes,
38
+ ...presets.schemas
39
+ ]);
40
+ }, [
41
+ client,
42
+ presets
43
+ ]);
44
+ const typeMap = useMemo(() => {
45
+ const recordGenerators = new Map(recordTypes.map((type) => [
46
+ type.typename,
47
+ createGenerator(client, invokePromise, type)
48
+ ]));
49
+ return new Map([
50
+ ...staticGenerators,
51
+ ...presets.items,
52
+ ...recordGenerators
53
+ ]);
54
+ }, [
55
+ client,
56
+ invokePromise,
57
+ presets
58
+ ]);
59
+ const updateInfo = useCallback(async () => {
60
+ const echoSchema = await space.db.schemaRegistry.query().run();
61
+ const staticSchema = await space.db.graph.schemaRegistry.query().run();
62
+ const objects = await space.db.query(Filter.everything()).run();
63
+ const objectMap = sortKeys(objects.reduce((map, obj) => {
64
+ const type = Obj.getTypename(obj);
65
+ if (type) {
66
+ const count2 = map[type] ?? 0;
67
+ map[type] = count2 + 1;
68
+ }
69
+ return map;
70
+ }, {}));
71
+ setInfo({
72
+ schema: {
73
+ static: staticSchema.length,
74
+ mutable: echoSchema.length
75
+ },
76
+ objects: objectMap
77
+ });
78
+ }, [
79
+ space
80
+ ]);
81
+ useAsyncEffect(updateInfo, [
82
+ updateInfo
83
+ ]);
84
+ const handleCreateData = useCallback(async (typename) => {
85
+ const constructor = typeMap.get(typename);
86
+ if (constructor) {
87
+ await constructor(space, count, onCreateObjects);
88
+ await updateInfo();
89
+ }
90
+ }, [
91
+ typeMap,
92
+ count,
93
+ space,
94
+ onCreateObjects,
95
+ updateInfo
96
+ ]);
97
+ return /* @__PURE__ */ React.createElement(Panel.Root, {
98
+ ...composableProps(props),
99
+ ref: forwardedRef
100
+ }, /* @__PURE__ */ React.createElement(Panel.Toolbar, {
101
+ asChild: true
102
+ }, /* @__PURE__ */ React.createElement(Toolbar.Root, null, /* @__PURE__ */ React.createElement(IconButton, {
103
+ icon: "ph--arrow-clockwise--regular",
104
+ iconOnly: true,
105
+ label: "Refresh",
106
+ onClick: updateInfo
107
+ }), /* @__PURE__ */ React.createElement(Toolbar.Separator, null), /* @__PURE__ */ React.createElement(Input.Root, null, /* @__PURE__ */ React.createElement(Input.TextInput, {
108
+ type: "number",
109
+ placeholder: "Count",
110
+ classNames: "w-[4rem] text-right",
111
+ min: 1,
112
+ max: 100,
113
+ size: 8,
114
+ value: count,
115
+ onChange: (event) => setCount(parseInt(event.target.value))
116
+ })))), /* @__PURE__ */ React.createElement(Panel.Content, {
117
+ asChild: true
118
+ }, /* @__PURE__ */ React.createElement(ScrollArea.Root, {
119
+ thin: true,
120
+ orientation: "vertical"
121
+ }, /* @__PURE__ */ React.createElement(ScrollArea.Viewport, {
122
+ classNames: "dx-document gap-4 divide-y divide-subdued-separator"
123
+ }, /* @__PURE__ */ React.createElement(SchemaTable, {
124
+ types: staticTypes,
125
+ objects: info.objects,
126
+ label: "Static Types",
127
+ onClick: handleCreateData
128
+ }), /* @__PURE__ */ React.createElement(SchemaTable, {
129
+ types: recordTypes,
130
+ objects: info.objects,
131
+ label: "Record Types",
132
+ onClick: handleCreateData
133
+ }), /* @__PURE__ */ React.createElement(SchemaTable, {
134
+ types: presets.types,
135
+ objects: info.objects,
136
+ label: "Presets",
137
+ onClick: handleCreateData
138
+ })))));
139
+ });
140
+ export {
141
+ SpaceGenerator as default
142
+ };
143
+ //# sourceMappingURL=SpaceGenerator-UBYB4NPD.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/containers/SpaceGenerator/SpaceGenerator.tsx"],
4
+ "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useCallback, useMemo, useState } from 'react';\n\nimport { useOperationInvoker } from '@dxos/app-framework/ui';\nimport { ComputeGraph } from '@dxos/conductor';\nimport { Filter, Obj, type Type } from '@dxos/echo';\nimport { Markdown } from '@dxos/plugin-markdown';\nimport { Sheet } from '@dxos/plugin-sheet';\nimport { Sketch } from '@dxos/plugin-sketch';\nimport { useClient } from '@dxos/react-client';\nimport { type Space } from '@dxos/react-client/echo';\nimport { IconButton, Input, Panel, ScrollArea, Toolbar, useAsyncEffect } from '@dxos/react-ui';\nimport { Organization, Person, Task } from '@dxos/types';\nimport { composable, composableProps } from '@dxos/ui-theme';\nimport { sortKeys } from '@dxos/util';\n\nimport { type ObjectGenerator, SchemaTable, createGenerator, generator, staticGenerators } from '#components';\n\n// TODO(burdon): Make extensible.\nconst staticTypes = [Markdown.Document, Sketch.Sketch, Sheet.Sheet, ComputeGraph];\nconst recordTypes: Type.AnyObj[] = [Organization.Organization, Person.Person, Task.Task];\n\nexport type SpaceGeneratorProps = {\n space: Space;\n onCreateObjects?: (objects: Obj.Unknown[]) => void;\n};\n\nexport const SpaceGenerator = composable<HTMLDivElement, SpaceGeneratorProps>(\n ({ space, onCreateObjects, children, ...props }, forwardedRef) => {\n const { invokePromise } = useOperationInvoker();\n const client = useClient();\n const [count, setCount] = useState(1);\n const [info, setInfo] = useState<any>({});\n const presets = useMemo(() => generator(), []);\n\n // Register types.\n useAsyncEffect(async () => {\n await client.addTypes([...staticTypes, ...recordTypes, ...presets.schemas]);\n }, [client, presets]);\n\n // Create type generators.\n const typeMap = useMemo(() => {\n const recordGenerators = new Map<string, ObjectGenerator<any>>(\n recordTypes.map((type) => [type.typename, createGenerator(client, invokePromise, type)]),\n );\n\n return new Map([...staticGenerators, ...presets.items, ...recordGenerators]);\n }, [client, invokePromise, presets]);\n\n // Query space to get info.\n const updateInfo = useCallback(async () => {\n const echoSchema = await space.db.schemaRegistry.query().run();\n const staticSchema = await space.db.graph.schemaRegistry.query().run();\n\n const objects = await space.db.query(Filter.everything()).run();\n const objectMap = sortKeys(\n objects.reduce<Record<string, number>>((map, obj) => {\n const type = Obj.getTypename(obj);\n if (type) {\n const count = map[type] ?? 0;\n map[type] = count + 1;\n }\n\n return map;\n }, {}),\n );\n\n setInfo({\n schema: {\n static: staticSchema.length,\n mutable: echoSchema.length,\n },\n objects: objectMap,\n });\n }, [space]);\n\n useAsyncEffect(updateInfo, [updateInfo]);\n\n const handleCreateData = useCallback(\n async (typename: string) => {\n const constructor = typeMap.get(typename);\n if (constructor) {\n // TODO(burdon): Input to specify number of objects.\n await constructor(space, count, onCreateObjects);\n await updateInfo();\n }\n },\n [typeMap, count, space, onCreateObjects, updateInfo],\n );\n\n return (\n <Panel.Root {...composableProps(props)} ref={forwardedRef}>\n <Panel.Toolbar asChild>\n <Toolbar.Root>\n <IconButton icon='ph--arrow-clockwise--regular' iconOnly label='Refresh' onClick={updateInfo} />\n <Toolbar.Separator />\n <Input.Root>\n <Input.TextInput\n type='number'\n placeholder='Count'\n classNames='w-[4rem] text-right'\n min={1}\n max={100}\n size={8}\n value={count}\n onChange={(event) => setCount(parseInt(event.target.value))}\n />\n </Input.Root>\n </Toolbar.Root>\n </Panel.Toolbar>\n <Panel.Content asChild>\n <ScrollArea.Root thin orientation='vertical'>\n <ScrollArea.Viewport classNames='dx-document gap-4 divide-y divide-subdued-separator'>\n <SchemaTable types={staticTypes} objects={info.objects} label='Static Types' onClick={handleCreateData} />\n <SchemaTable types={recordTypes} objects={info.objects} label='Record Types' onClick={handleCreateData} />\n <SchemaTable types={presets.types} objects={info.objects} label='Presets' onClick={handleCreateData} />\n </ScrollArea.Viewport>\n </ScrollArea.Root>\n </Panel.Content>\n </Pan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OAAM;IAAUC,SAAS3B;MAClF,sBAAA,cAACrC,QAAQiE,WAAS,IAAA,GAClB,sBAAA,cAACpE,MAAM6D,MAAI,MACT,sBAAA,cAAC7D,MAAMqE,WAAS;IACdhC,MAAK;IACLiC,aAAY;IACZC,YAAW;IACXC,KAAK;IACLC,KAAK;IACLC,MAAM;IACNC,OAAOjD;IACPkD,UAAU,CAACC,UAAUlD,SAASmD,SAASD,MAAME,OAAOJ,KAAK,CAAA;SAKjE,sBAAA,cAAC1E,MAAM+E,SAAO;IAACjB,SAAAA;KACb,sBAAA,cAAC7D,WAAW2D,MAAI;IAACoB,MAAAA;IAAKC,aAAY;KAChC,sBAAA,cAAChF,WAAWiF,UAAQ;IAACZ,YAAW;KAC9B,sBAAA,cAAC5D,aAAAA;IAAYyE,OAAOrE;IAAaiC,SAASpB,KAAKoB;IAASkB,OAAM;IAAeC,SAAST;MACtF,sBAAA,cAAC/C,aAAAA;IAAYyE,OAAOnE;IAAa+B,SAASpB,KAAKoB;IAASkB,OAAM;IAAeC,SAAST;MACtF,sBAAA,cAAC/C,aAAAA;IAAYyE,OAAOtD,QAAQsD;IAAOpC,SAASpB,KAAKoB;IAASkB,OAAM;IAAUC,SAAST;;AAM/F,CAAA;",
6
+ "names": ["React", "useCallback", "useMemo", "useState", "useOperationInvoker", "ComputeGraph", "Filter", "Obj", "Markdown", "Sheet", "Sketch", "useClient", "IconButton", "Input", "Panel", "ScrollArea", "Toolbar", "useAsyncEffect", "Organization", "Person", "Task", "composable", "composableProps", "sortKeys", "SchemaTable", "createGenerator", "generator", "staticGenerators", "staticTypes", "Document", "recordTypes", "SpaceGenerator", "space", "onCreateObjects", "children", "props", "forwardedRef", "invokePromise", "client", "count", "setCount", "info", "setInfo", "presets", "addTypes", "schemas", "typeMap", "recordGenerators", "Map", "map", "type", "typename", "items", "updateInfo", "echoSchema", "db", "schemaRegistry", "query", "run", "staticSchema", "graph", "objects", "everything", "objectMap", "reduce", "obj", "getTypename", "schema", "static", "length", "mutable", "handleCreateData", "constructor", "get", "Root", "ref", "asChild", "icon", "iconOnly", "label", "onClick", "Separator", "TextInput", "placeholder", "classNames", "min", "max", "size", "value", "onChange", "event", "parseInt", "target", "Content", "thin", "orientation", "Viewport", "types"]
7
+ }
@@ -1,9 +1,11 @@
1
+ import "./chunk-J5LGTIGS.mjs";
2
+
1
3
  // src/containers/Wireframe/Wireframe.tsx
2
4
  import React from "react";
3
5
  import { useResizeDetector } from "react-resize-detector";
4
6
  import { Obj } from "@dxos/echo";
5
7
  import { useAttentionAttributes } from "@dxos/react-ui-attention";
6
- import { SyntaxHighlighter } from "@dxos/react-ui-syntax-highlighter";
8
+ import { JsonHighlighter } from "@dxos/react-ui-syntax-highlighter";
7
9
  import { mx } from "@dxos/ui-theme";
8
10
  var Wireframe = ({ classNames, label, object }) => {
9
11
  const attentionAttrs = useAttentionAttributes(Obj.getDXN(object).toString());
@@ -16,10 +18,10 @@ var Wireframe = ({ classNames, label, object }) => {
16
18
  className: "absolute inset-2 flex flex-col gap-2 overflow-hidden font-mono"
17
19
  }, /* @__PURE__ */ React.createElement("div", {
18
20
  className: "flex justify-between"
19
- }, /* @__PURE__ */ React.createElement("div", null, label), /* @__PURE__ */ React.createElement("div", null, `[${width}x${height}]`)), object && /* @__PURE__ */ React.createElement(SyntaxHighlighter, {
20
- language: "json",
21
+ }, /* @__PURE__ */ React.createElement("div", null, label), /* @__PURE__ */ React.createElement("div", null, `[${width}x${height}]`)), object && /* @__PURE__ */ React.createElement(JsonHighlighter, {
22
+ data: object,
21
23
  classNames: "text-xs opacity-75 rounded-sm"
22
- }, JSON.stringify(object, void 0, 2))), /* @__PURE__ */ React.createElement("svg", {
24
+ })), /* @__PURE__ */ React.createElement("svg", {
23
25
  width,
24
26
  height,
25
27
  className: "bg-transparent *:text-subdued"
@@ -44,10 +46,7 @@ var Wireframe = ({ classNames, label, object }) => {
44
46
  strokeWidth: 1
45
47
  })));
46
48
  };
47
-
48
- // src/containers/Wireframe/index.ts
49
- var Wireframe_default = Wireframe;
50
49
  export {
51
- Wireframe_default as default
50
+ Wireframe as default
52
51
  };
53
- //# sourceMappingURL=Wireframe-KAGOKEFW.mjs.map
52
+ //# sourceMappingURL=Wireframe-7SNRUKET.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/containers/Wireframe/Wireframe.tsx"],
4
+ "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\nimport { useResizeDetector } from 'react-resize-detector';\n\nimport { Obj } from '@dxos/echo';\nimport { type ThemedClassName } from '@dxos/react-ui';\nimport { useAttentionAttributes } from '@dxos/react-ui-attention';\nimport { JsonHighlighter } from '@dxos/react-ui-syntax-highlighter';\nimport { mx } from '@dxos/ui-theme';\n\n// TODO(burdon): Create generic container with wireframe mode.\nexport type WireframeProps = ThemedClassName<{\n object: Obj.Unknown;\n label?: string;\n}>;\n\n// TODO(burdon): Make focusable and attendable with input.\nexport const Wireframe = ({ classNames, label, object }: WireframeProps) => {\n const attentionAttrs = useAttentionAttributes(Obj.getDXN(object).toString());\n const { width, height, ref } = useResizeDetector();\n\n return (\n <div ref={ref} className={mx('relative grow min-h-96', classNames)} {...attentionAttrs}>\n <div className='absolute inset-2 flex flex-col gap-2 overflow-hidden font-mono'>\n <div className='flex justify-between'>\n <div>{label}</div>\n <div>{`[${width}x${height}]`}</div>\n </div>\n {object && <JsonHighlighter data={object} classNames='text-xs opacity-75 rounded-sm' />}\n </div>\n <svg width={width} height={height} className='bg-transparent *:text-subdued'>\n <rect x={0} y={0} width={width} height={height} strokeWidth={1} fill='none' />\n <line x1={0} y1={0} x2={width} y2={height} strokeWidth={1} />\n <line x1={0} y1={height} x2={width} y2={0} strokeWidth={1} />\n </svg>\n </div>\n );\n};\n"],
5
+ "mappings": ";;;AAIA,OAAOA,WAAW;AAClB,SAASC,yBAAyB;AAElC,SAASC,WAAW;AAEpB,SAASC,8BAA8B;AACvC,SAASC,uBAAuB;AAChC,SAASC,UAAU;AASZ,IAAMC,YAAY,CAAC,EAAEC,YAAYC,OAAOC,OAAM,MAAkB;AACrE,QAAMC,iBAAiBP,uBAAuBD,IAAIS,OAAOF,MAAAA,EAAQG,SAAQ,CAAA;AACzE,QAAM,EAAEC,OAAOC,QAAQC,IAAG,IAAKd,kBAAAA;AAE/B,SACE,sBAAA,cAACe,OAAAA;IAAID;IAAUE,WAAWZ,GAAG,0BAA0BE,UAAAA;IAAc,GAAGG;KACtE,sBAAA,cAACM,OAAAA;IAAIC,WAAU;KACb,sBAAA,cAACD,OAAAA;IAAIC,WAAU;KACb,sBAAA,cAACD,OAAAA,MAAKR,KAAAA,GACN,sBAAA,cAACQ,OAAAA,MAAK,IAAIH,KAAAA,IAASC,MAAAA,GAAS,CAAA,GAE7BL,UAAU,sBAAA,cAACL,iBAAAA;IAAgBc,MAAMT;IAAQF,YAAW;OAEvD,sBAAA,cAACY,OAAAA;IAAIN;IAAcC;IAAgBG,WAAU;KAC3C,sBAAA,cAACG,QAAAA;IAAKC,GAAG;IAAGC,GAAG;IAAGT;IAAcC;IAAgBS,aAAa;IAAGC,MAAK;MACrE,sBAAA,cAACC,QAAAA;IAAKC,IAAI;IAAGC,IAAI;IAAGC,IAAIf;IAAOgB,IAAIf;IAAQS,aAAa;MACxD,sBAAA,cAACE,QAAAA;IAAKC,IAAI;IAAGC,IAAIb;IAAQc,IAAIf;IAAOgB,IAAI;IAAGN,aAAa;;AAIhE;",
6
+ "names": ["React", "useResizeDetector", "Obj", "useAttentionAttributes", "JsonHighlighter", "mx", "Wireframe", "classNames", "label", "object", "attentionAttrs", "getDXN", "toString", "width", "height", "ref", "div", "className", "data", "svg", "rect", "x", "y", "strokeWidth", "fill", "line", "x1", "y1", "x2", "y2"]
7
+ }