@tldiagram/core-ui 1.94.4 → 1.95.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/PanelUI.d.ts +3 -2
- package/dist/components/ZUI/ZUICanvas.d.ts +5 -0
- package/dist/components/ZUI/index.d.ts +1 -1
- package/dist/index.js +6989 -6768
- package/dist/pages/InfiniteZoom.d.ts +2 -0
- package/package.json +1 -1
- package/src/components/PanelUI.tsx +3 -2
- package/src/components/ViewExplorer/TagManager/index.tsx +94 -43
- package/src/components/ViewExplorer/ViewNavigator.tsx +122 -36
- package/src/components/ViewExplorer/index.tsx +9 -33
- package/src/components/ZUI/ZUICanvas.tsx +140 -1
- package/src/components/ZUI/index.ts +1 -1
- package/src/pages/InfiniteZoom.tsx +25 -3
|
@@ -24,7 +24,7 @@ import { FitViewIcon as FitViewSvg, TagsIcon, EyeIcon, EyeOffIcon, FocusIcon as
|
|
|
24
24
|
import ExploreOnboarding from '../components/ExploreOnboarding'
|
|
25
25
|
import ExplorePageOnboarding from '../components/ExplorePageOnboarding'
|
|
26
26
|
import MiniZoomOnboarding from '../components/MiniZoomOnboarding'
|
|
27
|
-
import { ZUICanvas, type ZUICanvasHandle } from '../components/ZUI'
|
|
27
|
+
import { ZUICanvas, type ZUICameraFrame, type ZUICanvasHandle } from '../components/ZUI'
|
|
28
28
|
import { useCrossBranchContextSettings } from '../crossBranch/settings'
|
|
29
29
|
import { primeWorkspaceGraphSnapshot } from '../crossBranch/store'
|
|
30
30
|
|
|
@@ -36,6 +36,7 @@ interface Props {
|
|
|
36
36
|
|
|
37
37
|
export interface InfiniteZoomHandle {
|
|
38
38
|
focusDiagram(viewId: number): boolean
|
|
39
|
+
setCameraFrame(frame: ZUICameraFrame): boolean
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
const MINI_ONBOARDING_KEY = 'shared_zoom_onboarding_dismissed'
|
|
@@ -62,6 +63,9 @@ function InfiniteZoomInner({ sharedToken, shareSlot }: Props, ref?: React.Ref<In
|
|
|
62
63
|
focusDiagram(viewId: number) {
|
|
63
64
|
return zuiRef.current?.focusDiagram(viewId) ?? false
|
|
64
65
|
},
|
|
66
|
+
setCameraFrame(frame: ZUICameraFrame) {
|
|
67
|
+
return zuiRef.current?.setCameraFrame(frame) ?? false
|
|
68
|
+
},
|
|
65
69
|
}), [])
|
|
66
70
|
|
|
67
71
|
// ── No data or No content ────────────────────────────────────────
|
|
@@ -173,6 +177,24 @@ function InfiniteZoomInner({ sharedToken, shareSlot }: Props, ref?: React.Ref<In
|
|
|
173
177
|
setCanvasReady(true)
|
|
174
178
|
}, [])
|
|
175
179
|
|
|
180
|
+
useEffect(() => {
|
|
181
|
+
if (!sharedToken) return
|
|
182
|
+
|
|
183
|
+
const handleMessage = (event: MessageEvent) => {
|
|
184
|
+
const data = event.data as { type?: unknown; progress?: unknown; profile?: unknown } | null
|
|
185
|
+
if (!data || data.type !== 'tldiagram-zui-camera') return
|
|
186
|
+
if (data.profile !== 'detail-to-overview') return
|
|
187
|
+
|
|
188
|
+
const progress = Number(data.progress)
|
|
189
|
+
if (!Number.isFinite(progress)) return
|
|
190
|
+
|
|
191
|
+
zuiRef.current?.setCameraFrame({ profile: 'detail-to-overview', progress })
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
window.addEventListener('message', handleMessage)
|
|
195
|
+
return () => window.removeEventListener('message', handleMessage)
|
|
196
|
+
}, [sharedToken])
|
|
197
|
+
|
|
176
198
|
if (!loading && (!data || (data.tree ?? []).length === 0 || !hasPlacements)) {
|
|
177
199
|
const noDiagrams = !data || (data.tree ?? []).length === 0
|
|
178
200
|
return (
|
|
@@ -193,7 +215,7 @@ function InfiniteZoomInner({ sharedToken, shareSlot }: Props, ref?: React.Ref<In
|
|
|
193
215
|
{noDiagrams ? 'Create First Diagram' : 'Go to Editor'}
|
|
194
216
|
</Button>
|
|
195
217
|
)}
|
|
196
|
-
{!noDiagrams && <ExplorePageOnboarding hasDiagrams={!noDiagrams} />}
|
|
218
|
+
{!noDiagrams && !sharedToken && <ExplorePageOnboarding hasDiagrams={!noDiagrams} />}
|
|
197
219
|
</Center>
|
|
198
220
|
)
|
|
199
221
|
}
|
|
@@ -231,7 +253,7 @@ function InfiniteZoomInner({ sharedToken, shareSlot }: Props, ref?: React.Ref<In
|
|
|
231
253
|
/>
|
|
232
254
|
|
|
233
255
|
{/* Onboarding overlay */}
|
|
234
|
-
{data && <ExploreOnboarding hasLinkedNodes={!!(data.navigations?.length > 0)} />}
|
|
256
|
+
{data && !sharedToken && <ExploreOnboarding hasLinkedNodes={!!(data.navigations?.length > 0)} />}
|
|
235
257
|
<MiniZoomOnboarding isVisible={showMiniOnboarding} />
|
|
236
258
|
|
|
237
259
|
{/* Bottom toolbar */}
|