@tldiagram/core-ui 2.0.8 → 2.0.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tldiagram/core-ui",
3
- "version": "2.0.8",
3
+ "version": "2.0.9",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -37,7 +37,7 @@
37
37
  "test": "vitest run"
38
38
  },
39
39
  "dependencies": {
40
- "@buf/tldiagramcom_diagram.bufbuild_es": "^2.12.0-20260510134954-1dd1981cf3f6.1",
40
+ "@buf/tldiagramcom_diagram.bufbuild_es": "^2.12.0-20260516210401-05aeb295f766.1",
41
41
  "@bufbuild/protobuf": "^2.11.0",
42
42
  "esbuild": "^0.25.12",
43
43
  "zustand": "^5.0.12"
package/src/api/client.ts CHANGED
@@ -650,15 +650,16 @@ export const api = {
650
650
  }),
651
651
 
652
652
  content: (id: number): Promise<{ placements: PlacedElement[]; connectors: Connector[] }> =>
653
- (async () => {
654
- const res = await fetch(apiUrl(`/views/${id}/projected-content`))
655
- if (!res.ok) throw new Error('Failed to load view content')
656
- const json = await res.json() as { placements?: Record<string, unknown>[]; connectors?: Record<string, unknown>[] }
653
+ rpc(async () => {
654
+ const res = await workspaceClient.getView({ viewId: id, includeContent: true })
655
+ const json = j<{
656
+ content?: { placements?: Record<string, unknown>[]; connectors?: Record<string, unknown>[] }
657
+ }>(GetViewResponseSchema, res)
657
658
  return {
658
- placements: (json.placements ?? []).map(protoPlacedElement),
659
- connectors: (json.connectors ?? []).map(protoConnector),
659
+ placements: (json.content?.placements ?? []).map(protoPlacedElement),
660
+ connectors: (json.content?.connectors ?? []).map(protoConnector),
660
661
  }
661
- })(),
662
+ }),
662
663
 
663
664
  tree: (): Promise<ViewTreeNode[]> =>
664
665
  rpc(async () => {