@seqyuan/annodex 0.1.10 → 0.1.12
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/app/api/agent/[id]/events/route.ts +94 -0
- package/app/api/agent/[id]/route.ts +83 -0
- package/app/api/agent/new/route.ts +53 -0
- package/app/api/auth/all-providers/route.ts +21 -0
- package/app/api/auth/api-key/[provider]/route.ts +7 -0
- package/app/api/auth/login/[provider]/route.ts +7 -0
- package/app/api/auth/login/route.ts +22 -0
- package/app/api/auth/logout/[provider]/route.ts +7 -0
- package/app/api/auth/providers/route.ts +15 -0
- package/app/api/auth/status/route.ts +6 -0
- package/app/api/default-cwd/route.ts +22 -0
- package/app/api/files/[...path]/route.ts +621 -0
- package/app/api/harness/route.ts +47 -0
- package/app/api/home/route.ts +6 -0
- package/app/api/internal/runtime/route.ts +26 -0
- package/app/api/models/route.ts +67 -0
- package/app/api/models-config/discover/route.ts +42 -0
- package/app/api/models-config/route.ts +152 -0
- package/app/api/models-config/test/route.ts +154 -0
- package/app/api/projects/browse/route.ts +51 -0
- package/app/api/projects/route.ts +83 -0
- package/app/api/reports/[id]/route.ts +108 -0
- package/app/api/search/route.ts +122 -0
- package/app/api/sessions/[id]/context/route.ts +23 -0
- package/app/api/sessions/[id]/route.ts +124 -0
- package/app/api/sessions/new/route.ts +5 -0
- package/app/api/sessions/route.ts +16 -0
- package/app/api/settings/route.ts +51 -0
- package/app/api/skills/install/route.ts +249 -0
- package/app/api/skills/route.ts +161 -0
- package/app/api/skills/search/route.ts +121 -0
- package/app/api/soul/route.ts +47 -0
- package/app/api/version/route.ts +55 -0
- package/app/globals.css +736 -0
- package/app/layout.tsx +40 -0
- package/app/login/page.tsx +133 -0
- package/app/page.tsx +10 -0
- package/components/AppShell.tsx +1058 -0
- package/components/ChatInput.tsx +1103 -0
- package/components/ChatMinimap.tsx +381 -0
- package/components/ChatWindow.tsx +576 -0
- package/components/CodeMirrorEditor.tsx +137 -0
- package/components/ConversationSearch.tsx +369 -0
- package/components/DataTableViewer.tsx +248 -0
- package/components/FileExplorer.tsx +758 -0
- package/components/FileIcons.tsx +241 -0
- package/components/FileViewer.tsx +1273 -0
- package/components/GlobalFileEditor.tsx +98 -0
- package/components/MarkdownRenderer.tsx +331 -0
- package/components/MermaidDiagram.tsx +80 -0
- package/components/MessageView.tsx +1141 -0
- package/components/ModelsConfig.tsx +1991 -0
- package/components/ProjectContext.tsx +252 -0
- package/components/ProjectFolderPicker.tsx +202 -0
- package/components/ProjectsConfig.tsx +288 -0
- package/components/ProviderIcons.tsx +91 -0
- package/components/ReportPanel.tsx +237 -0
- package/components/ResizeHandle.tsx +105 -0
- package/components/SessionSidebar.tsx +1464 -0
- package/components/SettingsDialog.tsx +287 -0
- package/components/SkillsConfig.tsx +1093 -0
- package/components/SubagentPanel.tsx +191 -0
- package/components/TabBar.tsx +115 -0
- package/components/ToolPanel.tsx +131 -0
- package/components/WidgetRenderer.tsx +505 -0
- package/components/viewers/DocumentToolbar.tsx +78 -0
- package/components/viewers/DocxViewer.tsx +97 -0
- package/components/viewers/PdfViewer.tsx +206 -0
- package/components/viewers/PptxViewer.tsx +240 -0
- package/components/viewers/XlsxViewer.tsx +143 -0
- package/hooks/useAgentSession.ts +710 -0
- package/hooks/useAudio.ts +50 -0
- package/hooks/useDragDrop.ts +52 -0
- package/hooks/useResizable.ts +60 -0
- package/hooks/useTheme.ts +85 -0
- package/lib/agent-client.ts +39 -0
- package/lib/annodex-config.ts +556 -0
- package/lib/auth-token.ts +74 -0
- package/lib/auth.ts +90 -0
- package/lib/brand.ts +5 -0
- package/lib/code-theme.ts +32 -0
- package/lib/codex-compat-proxy.ts +1603 -0
- package/lib/codex-home.ts +6 -0
- package/lib/codex-server.ts +796 -0
- package/lib/codex-session.ts +590 -0
- package/lib/codex-usage.ts +213 -0
- package/lib/file-paths.ts +34 -0
- package/lib/model-discovery.ts +379 -0
- package/lib/normalize.ts +30 -0
- package/lib/npx.ts +87 -0
- package/lib/pi-types.ts +49 -0
- package/lib/projects.ts +269 -0
- package/lib/provider-api.ts +88 -0
- package/lib/report-prompt.ts +61 -0
- package/lib/report-store.ts +597 -0
- package/lib/report-update-parser.ts +66 -0
- package/lib/rpc-manager.ts +668 -0
- package/lib/runtime-state.ts +117 -0
- package/lib/session-reader.ts +903 -0
- package/lib/session-runtime.ts +105 -0
- package/lib/subagent-progress.ts +279 -0
- package/lib/types.ts +241 -0
- package/lib/widget-export.ts +318 -0
- package/lib/widget-guidelines.ts +288 -0
- package/lib/widget-prompt.ts +76 -0
- package/lib/widget-utils.ts +523 -0
- package/package.json +23 -18
- package/postcss.config.mjs +8 -0
- package/proxy.ts +64 -0
- package/scripts/postinstall.cjs +25 -0
- package/tsconfig.json +41 -0
- package/.next/BUILD_ID +0 -1
- package/.next/app-path-routes-manifest.json +0 -39
- package/.next/build-manifest.json +0 -20
- package/.next/diagnostics/build-diagnostics.json +0 -6
- package/.next/diagnostics/framework.json +0 -1
- package/.next/export-marker.json +0 -6
- package/.next/images-manifest.json +0 -68
- package/.next/next-minimal-server.js.nft.json +0 -1
- package/.next/next-server.js.nft.json +0 -1
- package/.next/package.json +0 -1
- package/.next/prerender-manifest.json +0 -109
- package/.next/react-loadable-manifest.json +0 -2320
- package/.next/required-server-files.js +0 -343
- package/.next/required-server-files.json +0 -343
- package/.next/routes-manifest.json +0 -286
- package/.next/server/app/_global-error/page.js +0 -32
- package/.next/server/app/_global-error/page.js.nft.json +0 -1
- package/.next/server/app/_global-error/page_client-reference-manifest.js +0 -1
- package/.next/server/app/_global-error.html +0 -1
- package/.next/server/app/_global-error.meta +0 -16
- package/.next/server/app/_global-error.rsc +0 -14
- package/.next/server/app/_global-error.segments/_full.segment.rsc +0 -14
- package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +0 -5
- package/.next/server/app/_global-error.segments/_global-error.segment.rsc +0 -5
- package/.next/server/app/_global-error.segments/_head.segment.rsc +0 -5
- package/.next/server/app/_global-error.segments/_index.segment.rsc +0 -5
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +0 -1
- package/.next/server/app/_not-found/page.js +0 -2
- package/.next/server/app/_not-found/page.js.nft.json +0 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +0 -1
- package/.next/server/app/_not-found.html +0 -1
- package/.next/server/app/_not-found.meta +0 -16
- package/.next/server/app/_not-found.rsc +0 -18
- package/.next/server/app/_not-found.segments/_full.segment.rsc +0 -18
- package/.next/server/app/_not-found.segments/_head.segment.rsc +0 -6
- package/.next/server/app/_not-found.segments/_index.segment.rsc +0 -5
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +0 -5
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +0 -5
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +0 -4
- package/.next/server/app/api/agent/[id]/events/route.js +0 -3
- package/.next/server/app/api/agent/[id]/events/route.js.nft.json +0 -1
- package/.next/server/app/api/agent/[id]/events/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/agent/[id]/route.js +0 -1
- package/.next/server/app/api/agent/[id]/route.js.nft.json +0 -1
- package/.next/server/app/api/agent/[id]/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/agent/new/route.js +0 -1
- package/.next/server/app/api/agent/new/route.js.nft.json +0 -1
- package/.next/server/app/api/agent/new/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/auth/all-providers/route.js +0 -1
- package/.next/server/app/api/auth/all-providers/route.js.nft.json +0 -1
- package/.next/server/app/api/auth/all-providers/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/auth/api-key/[provider]/route.js +0 -1
- package/.next/server/app/api/auth/api-key/[provider]/route.js.nft.json +0 -1
- package/.next/server/app/api/auth/api-key/[provider]/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/auth/login/[provider]/route.js +0 -1
- package/.next/server/app/api/auth/login/[provider]/route.js.nft.json +0 -1
- package/.next/server/app/api/auth/login/[provider]/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/auth/login/route.js +0 -1
- package/.next/server/app/api/auth/login/route.js.nft.json +0 -1
- package/.next/server/app/api/auth/login/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/auth/logout/[provider]/route.js +0 -1
- package/.next/server/app/api/auth/logout/[provider]/route.js.nft.json +0 -1
- package/.next/server/app/api/auth/logout/[provider]/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/auth/providers/route.js +0 -1
- package/.next/server/app/api/auth/providers/route.js.nft.json +0 -1
- package/.next/server/app/api/auth/providers/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/auth/status/route.js +0 -1
- package/.next/server/app/api/auth/status/route.js.nft.json +0 -1
- package/.next/server/app/api/auth/status/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/default-cwd/route.js +0 -1
- package/.next/server/app/api/default-cwd/route.js.nft.json +0 -1
- package/.next/server/app/api/default-cwd/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/files/[...path]/route.js +0 -4
- package/.next/server/app/api/files/[...path]/route.js.nft.json +0 -1
- package/.next/server/app/api/files/[...path]/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/harness/route.js +0 -1
- package/.next/server/app/api/harness/route.js.nft.json +0 -1
- package/.next/server/app/api/harness/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/home/route.js +0 -1
- package/.next/server/app/api/home/route.js.nft.json +0 -1
- package/.next/server/app/api/home/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/internal/runtime/route.js +0 -1
- package/.next/server/app/api/internal/runtime/route.js.nft.json +0 -1
- package/.next/server/app/api/internal/runtime/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/models/route.js +0 -1
- package/.next/server/app/api/models/route.js.nft.json +0 -1
- package/.next/server/app/api/models/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/models-config/discover/route.js +0 -1
- package/.next/server/app/api/models-config/discover/route.js.nft.json +0 -1
- package/.next/server/app/api/models-config/discover/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/models-config/route.js +0 -1
- package/.next/server/app/api/models-config/route.js.nft.json +0 -1
- package/.next/server/app/api/models-config/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/models-config/test/route.js +0 -1
- package/.next/server/app/api/models-config/test/route.js.nft.json +0 -1
- package/.next/server/app/api/models-config/test/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/projects/browse/route.js +0 -1
- package/.next/server/app/api/projects/browse/route.js.nft.json +0 -1
- package/.next/server/app/api/projects/browse/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/projects/route.js +0 -1
- package/.next/server/app/api/projects/route.js.nft.json +0 -1
- package/.next/server/app/api/projects/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/reports/[id]/route.js +0 -10
- package/.next/server/app/api/reports/[id]/route.js.nft.json +0 -1
- package/.next/server/app/api/reports/[id]/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/search/route.js +0 -1
- package/.next/server/app/api/search/route.js.nft.json +0 -1
- package/.next/server/app/api/search/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/sessions/[id]/context/route.js +0 -1
- package/.next/server/app/api/sessions/[id]/context/route.js.nft.json +0 -1
- package/.next/server/app/api/sessions/[id]/context/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/sessions/[id]/route.js +0 -1
- package/.next/server/app/api/sessions/[id]/route.js.nft.json +0 -1
- package/.next/server/app/api/sessions/[id]/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/sessions/new/route.js +0 -1
- package/.next/server/app/api/sessions/new/route.js.nft.json +0 -1
- package/.next/server/app/api/sessions/new/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/sessions/route.js +0 -1
- package/.next/server/app/api/sessions/route.js.nft.json +0 -1
- package/.next/server/app/api/sessions/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/settings/route.js +0 -1
- package/.next/server/app/api/settings/route.js.nft.json +0 -1
- package/.next/server/app/api/settings/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/skills/install/route.js +0 -5
- package/.next/server/app/api/skills/install/route.js.nft.json +0 -1
- package/.next/server/app/api/skills/install/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/skills/route.js +0 -6
- package/.next/server/app/api/skills/route.js.nft.json +0 -1
- package/.next/server/app/api/skills/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/skills/search/route.js +0 -1
- package/.next/server/app/api/skills/search/route.js.nft.json +0 -1
- package/.next/server/app/api/skills/search/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/soul/route.js +0 -1
- package/.next/server/app/api/soul/route.js.nft.json +0 -1
- package/.next/server/app/api/soul/route_client-reference-manifest.js +0 -1
- package/.next/server/app/api/version/route.js +0 -1
- package/.next/server/app/api/version/route.js.nft.json +0 -1
- package/.next/server/app/api/version/route_client-reference-manifest.js +0 -1
- package/.next/server/app/index.html +0 -1
- package/.next/server/app/index.meta +0 -14
- package/.next/server/app/index.rsc +0 -17
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +0 -6
- package/.next/server/app/index.segments/_full.segment.rsc +0 -17
- package/.next/server/app/index.segments/_head.segment.rsc +0 -6
- package/.next/server/app/index.segments/_index.segment.rsc +0 -5
- package/.next/server/app/index.segments/_tree.segment.rsc +0 -4
- package/.next/server/app/login/page.js +0 -2
- package/.next/server/app/login/page.js.nft.json +0 -1
- package/.next/server/app/login/page_client-reference-manifest.js +0 -1
- package/.next/server/app/login.html +0 -1
- package/.next/server/app/login.meta +0 -15
- package/.next/server/app/login.rsc +0 -22
- package/.next/server/app/login.segments/_full.segment.rsc +0 -22
- package/.next/server/app/login.segments/_head.segment.rsc +0 -6
- package/.next/server/app/login.segments/_index.segment.rsc +0 -5
- package/.next/server/app/login.segments/_tree.segment.rsc +0 -4
- package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +0 -9
- package/.next/server/app/login.segments/login.segment.rsc +0 -5
- package/.next/server/app/page.js +0 -261
- package/.next/server/app/page.js.nft.json +0 -1
- package/.next/server/app/page_client-reference-manifest.js +0 -1
- package/.next/server/app-paths-manifest.json +0 -39
- package/.next/server/chunks/1048.js +0 -1
- package/.next/server/chunks/1367.js +0 -77
- package/.next/server/chunks/1381.js +0 -1
- package/.next/server/chunks/165.js +0 -1
- package/.next/server/chunks/1681.js +0 -215
- package/.next/server/chunks/1688.js +0 -45
- package/.next/server/chunks/1703.js +0 -79
- package/.next/server/chunks/1712.js +0 -43
- package/.next/server/chunks/1813.js +0 -1
- package/.next/server/chunks/2325.js +0 -80
- package/.next/server/chunks/258.js +0 -1
- package/.next/server/chunks/2671.js +0 -287
- package/.next/server/chunks/2778.js +0 -1
- package/.next/server/chunks/2943.js +0 -1
- package/.next/server/chunks/3031.js +0 -226
- package/.next/server/chunks/3181.js +0 -1
- package/.next/server/chunks/3493.js +0 -1
- package/.next/server/chunks/3672.js +0 -1
- package/.next/server/chunks/3701.js +0 -104
- package/.next/server/chunks/4013.js +0 -1
- package/.next/server/chunks/402.js +0 -2
- package/.next/server/chunks/4035.js +0 -80
- package/.next/server/chunks/4248.js +0 -153
- package/.next/server/chunks/4367.js +0 -1
- package/.next/server/chunks/4406.js +0 -141
- package/.next/server/chunks/4741.js +0 -18
- package/.next/server/chunks/4768.js +0 -1
- package/.next/server/chunks/4858.js +0 -148
- package/.next/server/chunks/4980.js +0 -1
- package/.next/server/chunks/5155.js +0 -5
- package/.next/server/chunks/5293.js +0 -166
- package/.next/server/chunks/5399.js +0 -8
- package/.next/server/chunks/5409.js +0 -1
- package/.next/server/chunks/5797.js +0 -93
- package/.next/server/chunks/5851.js +0 -36
- package/.next/server/chunks/6206.js +0 -1
- package/.next/server/chunks/6296.js +0 -1
- package/.next/server/chunks/63.js +0 -45
- package/.next/server/chunks/6346.js +0 -1
- package/.next/server/chunks/6406.js +0 -23
- package/.next/server/chunks/642.js +0 -1
- package/.next/server/chunks/6429.js +0 -50
- package/.next/server/chunks/6729.js +0 -64
- package/.next/server/chunks/6907.js +0 -115
- package/.next/server/chunks/6980.js +0 -1
- package/.next/server/chunks/7073.js +0 -24
- package/.next/server/chunks/7233.js +0 -24
- package/.next/server/chunks/7307.js +0 -1
- package/.next/server/chunks/7362.js +0 -9
- package/.next/server/chunks/7567.js +0 -29
- package/.next/server/chunks/7765.js +0 -1
- package/.next/server/chunks/7890.js +0 -1
- package/.next/server/chunks/8065.js +0 -1
- package/.next/server/chunks/8238.js +0 -34
- package/.next/server/chunks/8276.js +0 -1
- package/.next/server/chunks/8336.js +0 -1
- package/.next/server/chunks/8477.js +0 -3
- package/.next/server/chunks/8490.js +0 -1
- package/.next/server/chunks/8916.js +0 -1
- package/.next/server/chunks/9280.js +0 -252
- package/.next/server/chunks/9315.js +0 -1
- package/.next/server/chunks/9537.js +0 -90
- package/.next/server/chunks/966.js +0 -1
- package/.next/server/chunks/9818.js +0 -21
- package/.next/server/chunks/static/media/pdf.worker.min.c476e1a0.mjs +0 -6
- package/.next/server/functions-config-manifest.json +0 -16
- package/.next/server/interception-route-rewrite-manifest.js +0 -1
- package/.next/server/middleware-build-manifest.js +0 -1
- package/.next/server/middleware-manifest.json +0 -6
- package/.next/server/middleware-react-loadable-manifest.js +0 -1
- package/.next/server/middleware.js +0 -18
- package/.next/server/middleware.js.nft.json +0 -1
- package/.next/server/next-font-manifest.js +0 -1
- package/.next/server/next-font-manifest.json +0 -1
- package/.next/server/pages/404.html +0 -1
- package/.next/server/pages/500.html +0 -1
- package/.next/server/pages-manifest.json +0 -4
- package/.next/server/prefetch-hints.json +0 -1
- package/.next/server/server-reference-manifest.js +0 -1
- package/.next/server/server-reference-manifest.json +0 -1
- package/.next/server/webpack-runtime.js +0 -1
- package/.next/static/6cuMSvcr0FVO-GiK5RJZh/_buildManifest.js +0 -1
- package/.next/static/6cuMSvcr0FVO-GiK5RJZh/_ssgManifest.js +0 -1
- package/.next/static/chunks/0b9a0da7.9075af772487e743.js +0 -62
- package/.next/static/chunks/1413.922d232de90c0c41.js +0 -115
- package/.next/static/chunks/1643.467a526a1f24f54d.js +0 -24
- package/.next/static/chunks/1852.5543122f11aa7fed.js +0 -1
- package/.next/static/chunks/1960.b1e26436d7a5f586.js +0 -1
- package/.next/static/chunks/2170a4aa.4213bb2183c9cdf9.js +0 -1
- package/.next/static/chunks/2274.6cd173f80a1405a2.js +0 -21
- package/.next/static/chunks/2419.347fdfe3c170854d.js +0 -166
- package/.next/static/chunks/2619.9aac8983f30c7c8a.js +0 -1
- package/.next/static/chunks/2623.d20fabd8e18197c6.js +0 -287
- package/.next/static/chunks/2729.f5365061a849d659.js +0 -34
- package/.next/static/chunks/2821.934bcf60fbdc28c6.js +0 -1
- package/.next/static/chunks/2918becc.abff2ece1de37bc1.js +0 -153
- package/.next/static/chunks/2947.114e51cb06d1c01a.js +0 -23
- package/.next/static/chunks/3079.4c511fa1144e3adf.js +0 -79
- package/.next/static/chunks/3274.208ca44844cd7d95.js +0 -148
- package/.next/static/chunks/3308.465a94263d04bfea.js +0 -73
- package/.next/static/chunks/3325.e4bfe1ca657f3b5b.js +0 -80
- package/.next/static/chunks/3506.2a7eaa08b9f55337.js +0 -90
- package/.next/static/chunks/363642f4-043c1475ab9af70e.js +0 -1
- package/.next/static/chunks/3794-123fdf632563f469.js +0 -32
- package/.next/static/chunks/3837.a755ccfe6f9c1c1c.js +0 -5
- package/.next/static/chunks/394.91597771688df6d0.js +0 -1
- package/.next/static/chunks/3997.1009c06025691712.js +0 -1
- package/.next/static/chunks/4453.91a357dc43c21745.js +0 -1
- package/.next/static/chunks/4491.44fdf20580ac72bd.js +0 -24
- package/.next/static/chunks/4829.cf1d50e43e6d9db5.js +0 -1
- package/.next/static/chunks/498.fe1d9da9ecad6c36.js +0 -1
- package/.next/static/chunks/4bd1b696-e356ca5ba0218e27.js +0 -1
- package/.next/static/chunks/5019.b5a1a2b8daf17525.js +0 -1
- package/.next/static/chunks/5034.8f16c3fa3ce75411.js +0 -1
- package/.next/static/chunks/5074.d16651da01ec4e02.js +0 -1
- package/.next/static/chunks/51fb665c.0950e1b79671348d.js +0 -45
- package/.next/static/chunks/532.5956ed631aff722b.js +0 -9
- package/.next/static/chunks/5326.69460442bdcd6cd3.js +0 -1
- package/.next/static/chunks/5403.ff110bf5bf600758.js +0 -64
- package/.next/static/chunks/547.902a733488cfe3f7.js +0 -77
- package/.next/static/chunks/5567.540d7fc108ad6ee5.js +0 -215
- package/.next/static/chunks/5590.ef62922166d308b4.js +0 -1
- package/.next/static/chunks/5690.9d6eb1edb1399995.js +0 -1
- package/.next/static/chunks/5749.25faee4a1e55b854.js +0 -226
- package/.next/static/chunks/58bb9007.1ccb6bba34b4c635.js +0 -80
- package/.next/static/chunks/6121.f3f43f1896ea0cd9.js +0 -1
- package/.next/static/chunks/6600.583c88eef37aa524.js +0 -1
- package/.next/static/chunks/6696.a41aec266e657d54.js +0 -141
- package/.next/static/chunks/6922.42148793782d2fe7.js +0 -1
- package/.next/static/chunks/7006.e191611ffc2b9528.js +0 -43
- package/.next/static/chunks/7343.9fbb58204d8ac681.js +0 -1
- package/.next/static/chunks/73972abe.25a4cffa03b2bcef.js +0 -119
- package/.next/static/chunks/7547.58bda8a2aabba0d4.js +0 -93
- package/.next/static/chunks/7648.4ae2f183b4db0353.js +0 -1
- package/.next/static/chunks/7874.8db6929b94cdf697.js +0 -1
- package/.next/static/chunks/7959.1f20a35df316216a.js +0 -104
- package/.next/static/chunks/83.85d62d7fc9850b75.js +0 -29
- package/.next/static/chunks/8436.cab94b59cca0a8ff.js +0 -1
- package/.next/static/chunks/8451.ff6ff72b57dc52e1.js +0 -1
- package/.next/static/chunks/8489.45f22859734f514f.js +0 -36
- package/.next/static/chunks/8568.f85d8b36fc9a9037.js +0 -1
- package/.next/static/chunks/8771-3e14b6810486df1f.js +0 -1
- package/.next/static/chunks/8863.be51033a67436277.js +0 -1
- package/.next/static/chunks/90542734.dc1a2723e4f6affb.js +0 -1
- package/.next/static/chunks/9500.1488aec06ee78127.js +0 -1
- package/.next/static/chunks/9633.155548b5fca6e580.js +0 -1
- package/.next/static/chunks/9779.673004a62d70e36a.js +0 -1
- package/.next/static/chunks/app/_global-error/page-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/_not-found/page-c72daab99269beff.js +0 -1
- package/.next/static/chunks/app/api/agent/[id]/events/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/agent/[id]/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/agent/new/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/auth/all-providers/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/auth/api-key/[provider]/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/auth/login/[provider]/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/auth/login/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/auth/logout/[provider]/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/auth/providers/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/auth/status/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/default-cwd/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/files/[...path]/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/harness/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/home/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/internal/runtime/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/models/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/models-config/discover/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/models-config/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/models-config/test/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/projects/browse/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/projects/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/reports/[id]/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/search/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/context/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/sessions/new/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/sessions/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/settings/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/skills/install/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/skills/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/skills/search/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/soul/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/api/version/route-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/app/layout-be148b7ae915b22a.js +0 -1
- package/.next/static/chunks/app/login/page-ebf0e6de99062783.js +0 -1
- package/.next/static/chunks/app/page-c45d98ea81c548ca.js +0 -260
- package/.next/static/chunks/d3ac728e.7964f816a1ca64e5.js +0 -1
- package/.next/static/chunks/framework-711ef29bc66f648c.js +0 -1
- package/.next/static/chunks/main-app-45a0f19af99d61b6.js +0 -1
- package/.next/static/chunks/main-f74964b7ae52493e.js +0 -5
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/global-error-9bfa08b9491621f2.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-cc518af6b1ffb191.js +0 -1
- package/.next/static/chunks/polyfills-42372ed130431b0a.js +0 -1
- package/.next/static/chunks/webpack-fcf4a889ecbd753c.js +0 -1
- package/.next/static/css/45029451a1d7255d.css +0 -3
- package/.next/static/media/15605e25b523335c-s.woff2 +0 -0
- package/.next/static/media/1a3dce5cfb5f7760-s.woff2 +0 -0
- package/.next/static/media/1cdd02902f937a18-s.woff2 +0 -0
- package/.next/static/media/4c4b3b30b6bcb2be-s.woff2 +0 -0
- package/.next/static/media/641a7b8a5800ee0e-s.woff2 +0 -0
- package/.next/static/media/7deddc85b7ffd1dc-s.p.woff2 +0 -0
- package/.next/static/media/ec14413c594b3356-s.p.woff2 +0 -0
- package/.next/static/media/pdf.worker.min.29aaf158.mjs +0 -6
- package/.next/trace +0 -74
- package/.next/trace-build +0 -1
- package/.next/types/app/api/agent/[id]/events/route.ts +0 -351
- package/.next/types/app/api/agent/[id]/route.ts +0 -351
- package/.next/types/app/api/agent/new/route.ts +0 -351
- package/.next/types/app/api/auth/all-providers/route.ts +0 -351
- package/.next/types/app/api/auth/api-key/[provider]/route.ts +0 -351
- package/.next/types/app/api/auth/login/[provider]/route.ts +0 -351
- package/.next/types/app/api/auth/login/route.ts +0 -351
- package/.next/types/app/api/auth/logout/[provider]/route.ts +0 -351
- package/.next/types/app/api/auth/providers/route.ts +0 -351
- package/.next/types/app/api/auth/status/route.ts +0 -351
- package/.next/types/app/api/default-cwd/route.ts +0 -351
- package/.next/types/app/api/files/[...path]/route.ts +0 -351
- package/.next/types/app/api/harness/route.ts +0 -351
- package/.next/types/app/api/home/route.ts +0 -351
- package/.next/types/app/api/internal/runtime/route.ts +0 -351
- package/.next/types/app/api/models/route.ts +0 -351
- package/.next/types/app/api/models-config/discover/route.ts +0 -351
- package/.next/types/app/api/models-config/route.ts +0 -351
- package/.next/types/app/api/models-config/test/route.ts +0 -351
- package/.next/types/app/api/projects/browse/route.ts +0 -351
- package/.next/types/app/api/projects/route.ts +0 -351
- package/.next/types/app/api/reports/[id]/route.ts +0 -351
- package/.next/types/app/api/search/route.ts +0 -351
- package/.next/types/app/api/sessions/[id]/context/route.ts +0 -351
- package/.next/types/app/api/sessions/[id]/route.ts +0 -351
- package/.next/types/app/api/sessions/new/route.ts +0 -351
- package/.next/types/app/api/sessions/route.ts +0 -351
- package/.next/types/app/api/settings/route.ts +0 -351
- package/.next/types/app/api/skills/install/route.ts +0 -351
- package/.next/types/app/api/skills/route.ts +0 -351
- package/.next/types/app/api/skills/search/route.ts +0 -351
- package/.next/types/app/api/soul/route.ts +0 -351
- package/.next/types/app/api/version/route.ts +0 -351
- package/.next/types/app/layout.ts +0 -87
- package/.next/types/app/login/page.ts +0 -87
- package/.next/types/app/page.ts +0 -87
- package/.next/types/package.json +0 -1
- package/.next/types/routes.d.ts +0 -106
- package/.next/types/validator.ts +0 -376
|
@@ -0,0 +1,505 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useRef, useEffect, useState, useCallback, useMemo } from "react";
|
|
4
|
+
import { useTheme } from "@/hooks/useTheme";
|
|
5
|
+
import {
|
|
6
|
+
buildShowWidgetSource,
|
|
7
|
+
copyTextToClipboard,
|
|
8
|
+
downloadBlob,
|
|
9
|
+
exportWidgetPng,
|
|
10
|
+
safeWidgetFilename,
|
|
11
|
+
} from "@/lib/widget-export";
|
|
12
|
+
import type { WidgetCapturePayload } from "@/lib/widget-export";
|
|
13
|
+
import {
|
|
14
|
+
buildReceiverSrcdoc,
|
|
15
|
+
getWidgetIframeStyleBlock,
|
|
16
|
+
resolveWidgetThemeVars,
|
|
17
|
+
sanitizeForIframe,
|
|
18
|
+
sanitizeForStreaming,
|
|
19
|
+
} from "@/lib/widget-utils";
|
|
20
|
+
|
|
21
|
+
interface Props {
|
|
22
|
+
code: string;
|
|
23
|
+
isStreaming: boolean;
|
|
24
|
+
title?: string;
|
|
25
|
+
showOverlay?: boolean;
|
|
26
|
+
onSendMessage?: (message: string) => void;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const MAX_HEIGHT = 2000;
|
|
30
|
+
const STREAM_DEBOUNCE = 120;
|
|
31
|
+
const CDN_PATTERN = /cdnjs\.cloudflare\.com|cdn\.jsdelivr\.net|unpkg\.com|esm\.sh/;
|
|
32
|
+
const heightCache = new Map<string, number>();
|
|
33
|
+
const CAPTURE_TIMEOUT = 2500;
|
|
34
|
+
|
|
35
|
+
function getHeightCacheKey(code: string): string {
|
|
36
|
+
return code.slice(0, 200);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function WidgetRenderer({ code, isStreaming, title, showOverlay, onSendMessage }: Props) {
|
|
40
|
+
const { isDark } = useTheme();
|
|
41
|
+
const iframeRef = useRef<HTMLIFrameElement>(null);
|
|
42
|
+
const debounceRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
|
43
|
+
const statusTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
|
44
|
+
const captureRequestsRef = useRef(new Map<string, {
|
|
45
|
+
resolve: (payload: WidgetCapturePayload) => void;
|
|
46
|
+
reject: (error: Error) => void;
|
|
47
|
+
timeout: ReturnType<typeof setTimeout>;
|
|
48
|
+
}>());
|
|
49
|
+
const lastSentRef = useRef("");
|
|
50
|
+
const [iframeReady, setIframeReady] = useState(false);
|
|
51
|
+
const [iframeHeight, setIframeHeight] = useState(() => heightCache.get(getHeightCacheKey(code)) ?? 0);
|
|
52
|
+
const [showCode, setShowCode] = useState(false);
|
|
53
|
+
const [isFullscreen, setIsFullscreen] = useState(false);
|
|
54
|
+
const [actionStatus, setActionStatus] = useState<string | null>(null);
|
|
55
|
+
const [isExporting, setIsExporting] = useState(false);
|
|
56
|
+
const [finalized, setFinalized] = useState(false);
|
|
57
|
+
const finalizedCodeRef = useRef("");
|
|
58
|
+
const hasReceivedFirstHeight = useRef((heightCache.get(getHeightCacheKey(code)) ?? 0) > 0);
|
|
59
|
+
const heightLockedRef = useRef(false);
|
|
60
|
+
const initialIsDarkRef = useRef(isDark);
|
|
61
|
+
|
|
62
|
+
const hasCDN = useMemo(() => CDN_PATTERN.test(code), [code]);
|
|
63
|
+
const srcdoc = useMemo(() => {
|
|
64
|
+
const vars = typeof document === "undefined" ? {} : resolveWidgetThemeVars();
|
|
65
|
+
return buildReceiverSrcdoc(getWidgetIframeStyleBlock(vars), initialIsDarkRef.current);
|
|
66
|
+
}, []);
|
|
67
|
+
|
|
68
|
+
// postMessage handler
|
|
69
|
+
useEffect(() => {
|
|
70
|
+
function handleMessage(e: MessageEvent) {
|
|
71
|
+
if (!e.data || typeof e.data.type !== "string") return;
|
|
72
|
+
if (iframeRef.current && e.source !== iframeRef.current.contentWindow) return;
|
|
73
|
+
|
|
74
|
+
switch (e.data.type) {
|
|
75
|
+
case "widget:ready":
|
|
76
|
+
setIframeReady(true);
|
|
77
|
+
break;
|
|
78
|
+
case "widget:captured": {
|
|
79
|
+
const requestId = String(e.data.requestId ?? "");
|
|
80
|
+
const request = captureRequestsRef.current.get(requestId);
|
|
81
|
+
if (!request) break;
|
|
82
|
+
clearTimeout(request.timeout);
|
|
83
|
+
captureRequestsRef.current.delete(requestId);
|
|
84
|
+
request.resolve({
|
|
85
|
+
html: typeof e.data.html === "string" ? e.data.html : null,
|
|
86
|
+
styles: typeof e.data.styles === "string" ? e.data.styles : "",
|
|
87
|
+
canvases: Array.isArray(e.data.canvases) ? e.data.canvases : [],
|
|
88
|
+
bodyWidth: typeof e.data.bodyWidth === "number" ? e.data.bodyWidth : undefined,
|
|
89
|
+
bodyHeight: typeof e.data.bodyHeight === "number" ? e.data.bodyHeight : undefined,
|
|
90
|
+
});
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
case "widget:resize":
|
|
94
|
+
if (typeof e.data.height === "number" && e.data.height > 0) {
|
|
95
|
+
const nextHeight = Math.min(e.data.height + 2, MAX_HEIGHT);
|
|
96
|
+
const cacheKey = getHeightCacheKey(code);
|
|
97
|
+
if (heightLockedRef.current) {
|
|
98
|
+
setIframeHeight((prev) => {
|
|
99
|
+
const stableHeight = Math.max(prev, nextHeight);
|
|
100
|
+
heightCache.set(cacheKey, stableHeight);
|
|
101
|
+
return stableHeight;
|
|
102
|
+
});
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
heightCache.set(cacheKey, nextHeight);
|
|
107
|
+
if (!hasReceivedFirstHeight.current) {
|
|
108
|
+
hasReceivedFirstHeight.current = true;
|
|
109
|
+
const el = iframeRef.current;
|
|
110
|
+
if (el) {
|
|
111
|
+
el.style.transition = "none";
|
|
112
|
+
void el.offsetHeight;
|
|
113
|
+
}
|
|
114
|
+
setIframeHeight(nextHeight);
|
|
115
|
+
requestAnimationFrame(() => {
|
|
116
|
+
if (el) el.style.transition = "height 0.2s ease-out";
|
|
117
|
+
});
|
|
118
|
+
} else {
|
|
119
|
+
setIframeHeight(nextHeight);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
break;
|
|
123
|
+
case "widget:link": {
|
|
124
|
+
const href = String(e.data.href ?? "");
|
|
125
|
+
if (href && !/^\s*(javascript|data)\s*:/i.test(href)) {
|
|
126
|
+
window.open(href, "_blank", "noopener,noreferrer");
|
|
127
|
+
}
|
|
128
|
+
break;
|
|
129
|
+
}
|
|
130
|
+
case "widget:sendMessage": {
|
|
131
|
+
const text = String(e.data.text ?? "");
|
|
132
|
+
if (text && text.length <= 500) {
|
|
133
|
+
onSendMessage?.(text);
|
|
134
|
+
}
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
case "widget:publish": {
|
|
138
|
+
window.dispatchEvent(new CustomEvent("widget-cross-publish", {
|
|
139
|
+
detail: { topic: e.data.topic, data: e.data.data, sourceIframe: iframeRef.current },
|
|
140
|
+
}));
|
|
141
|
+
break;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
window.addEventListener("message", handleMessage);
|
|
146
|
+
return () => window.removeEventListener("message", handleMessage);
|
|
147
|
+
}, [code, onSendMessage]);
|
|
148
|
+
|
|
149
|
+
useEffect(() => {
|
|
150
|
+
const pendingCaptures = captureRequestsRef.current;
|
|
151
|
+
return () => {
|
|
152
|
+
if (statusTimerRef.current) clearTimeout(statusTimerRef.current);
|
|
153
|
+
for (const request of pendingCaptures.values()) {
|
|
154
|
+
clearTimeout(request.timeout);
|
|
155
|
+
request.reject(new Error("Widget renderer unmounted."));
|
|
156
|
+
}
|
|
157
|
+
pendingCaptures.clear();
|
|
158
|
+
};
|
|
159
|
+
}, []);
|
|
160
|
+
|
|
161
|
+
useEffect(() => {
|
|
162
|
+
function handleCrossPublish(e: Event) {
|
|
163
|
+
const detail = (e as CustomEvent).detail as { topic?: unknown; data?: unknown; sourceIframe?: HTMLIFrameElement | null } | undefined;
|
|
164
|
+
if (!iframeRef.current?.contentWindow || detail?.sourceIframe === iframeRef.current) return;
|
|
165
|
+
iframeRef.current.contentWindow.postMessage(
|
|
166
|
+
{ type: "widget:crossFilter", payload: { topic: detail?.topic, data: detail?.data } },
|
|
167
|
+
"*",
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
window.addEventListener("widget-cross-publish", handleCrossPublish);
|
|
171
|
+
return () => window.removeEventListener("widget-cross-publish", handleCrossPublish);
|
|
172
|
+
}, []);
|
|
173
|
+
|
|
174
|
+
// Streaming updates
|
|
175
|
+
const sendUpdate = useCallback((html: string) => {
|
|
176
|
+
const iframe = iframeRef.current;
|
|
177
|
+
if (!iframe?.contentWindow) return;
|
|
178
|
+
if (html === lastSentRef.current) return;
|
|
179
|
+
lastSentRef.current = html;
|
|
180
|
+
iframe.contentWindow.postMessage({ type: "widget:update", html }, "*");
|
|
181
|
+
}, []);
|
|
182
|
+
|
|
183
|
+
useEffect(() => {
|
|
184
|
+
if (!isStreaming || !iframeReady) return;
|
|
185
|
+
const sanitized = sanitizeForStreaming(code);
|
|
186
|
+
if (debounceRef.current) clearTimeout(debounceRef.current);
|
|
187
|
+
debounceRef.current = setTimeout(() => sendUpdate(sanitized), STREAM_DEBOUNCE);
|
|
188
|
+
return () => { if (debounceRef.current) clearTimeout(debounceRef.current); };
|
|
189
|
+
}, [code, isStreaming, iframeReady, sendUpdate]);
|
|
190
|
+
|
|
191
|
+
// Finalize
|
|
192
|
+
useEffect(() => {
|
|
193
|
+
if (isStreaming || !iframeReady) return;
|
|
194
|
+
if (finalizedCodeRef.current === code) return;
|
|
195
|
+
const sanitized = sanitizeForIframe(code);
|
|
196
|
+
const iframe = iframeRef.current;
|
|
197
|
+
if (!iframe?.contentWindow) return;
|
|
198
|
+
finalizedCodeRef.current = code;
|
|
199
|
+
lastSentRef.current = sanitized;
|
|
200
|
+
heightLockedRef.current = true;
|
|
201
|
+
setFinalized(false);
|
|
202
|
+
iframe.contentWindow.postMessage({ type: "widget:finalize", html: sanitized }, "*");
|
|
203
|
+
const id = setTimeout(() => {
|
|
204
|
+
heightLockedRef.current = false;
|
|
205
|
+
setFinalized(true);
|
|
206
|
+
}, 450);
|
|
207
|
+
return () => clearTimeout(id);
|
|
208
|
+
}, [isStreaming, iframeReady, code]);
|
|
209
|
+
|
|
210
|
+
useEffect(() => {
|
|
211
|
+
if (!iframeReady) return;
|
|
212
|
+
|
|
213
|
+
const sendTheme = () => {
|
|
214
|
+
iframeRef.current?.contentWindow?.postMessage(
|
|
215
|
+
{ type: "widget:theme", vars: resolveWidgetThemeVars(), isDark },
|
|
216
|
+
"*",
|
|
217
|
+
);
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
sendTheme();
|
|
221
|
+
const observer = new MutationObserver(sendTheme);
|
|
222
|
+
observer.observe(document.documentElement, { attributes: true, attributeFilter: ["class"] });
|
|
223
|
+
return () => observer.disconnect();
|
|
224
|
+
}, [iframeReady, isDark]);
|
|
225
|
+
|
|
226
|
+
useEffect(() => {
|
|
227
|
+
if (!isFullscreen) return;
|
|
228
|
+
|
|
229
|
+
const previousOverflow = document.body.style.overflow;
|
|
230
|
+
document.body.style.overflow = "hidden";
|
|
231
|
+
const onKeyDown = (event: KeyboardEvent) => {
|
|
232
|
+
if (event.key === "Escape") setIsFullscreen(false);
|
|
233
|
+
};
|
|
234
|
+
window.addEventListener("keydown", onKeyDown);
|
|
235
|
+
return () => {
|
|
236
|
+
document.body.style.overflow = previousOverflow;
|
|
237
|
+
window.removeEventListener("keydown", onKeyDown);
|
|
238
|
+
};
|
|
239
|
+
}, [isFullscreen]);
|
|
240
|
+
|
|
241
|
+
const setTemporaryStatus = useCallback((message: string) => {
|
|
242
|
+
if (statusTimerRef.current) clearTimeout(statusTimerRef.current);
|
|
243
|
+
setActionStatus(message);
|
|
244
|
+
statusTimerRef.current = setTimeout(() => setActionStatus(null), 1800);
|
|
245
|
+
}, []);
|
|
246
|
+
|
|
247
|
+
const requestWidgetCapture = useCallback(() => {
|
|
248
|
+
const targetWindow = iframeRef.current?.contentWindow;
|
|
249
|
+
if (!targetWindow) {
|
|
250
|
+
return Promise.reject(new Error("Widget iframe is not ready."));
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
return new Promise<WidgetCapturePayload>((resolve, reject) => {
|
|
254
|
+
const requestId = `${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
255
|
+
const timeout = setTimeout(() => {
|
|
256
|
+
captureRequestsRef.current.delete(requestId);
|
|
257
|
+
reject(new Error("Timed out waiting for widget capture."));
|
|
258
|
+
}, CAPTURE_TIMEOUT);
|
|
259
|
+
|
|
260
|
+
captureRequestsRef.current.set(requestId, { resolve, reject, timeout });
|
|
261
|
+
targetWindow.postMessage({ type: "widget:capture", requestId }, "*");
|
|
262
|
+
});
|
|
263
|
+
}, []);
|
|
264
|
+
|
|
265
|
+
const copyShowWidgetSource = useCallback(async () => {
|
|
266
|
+
try {
|
|
267
|
+
await copyTextToClipboard(buildShowWidgetSource(code, title));
|
|
268
|
+
setTemporaryStatus("Copied source");
|
|
269
|
+
} catch {
|
|
270
|
+
setTemporaryStatus("Copy failed");
|
|
271
|
+
}
|
|
272
|
+
}, [code, title, setTemporaryStatus]);
|
|
273
|
+
|
|
274
|
+
const copyWidgetHtml = useCallback(async () => {
|
|
275
|
+
try {
|
|
276
|
+
await copyTextToClipboard(code);
|
|
277
|
+
setTemporaryStatus("Copied HTML/SVG");
|
|
278
|
+
} catch {
|
|
279
|
+
setTemporaryStatus("Copy failed");
|
|
280
|
+
}
|
|
281
|
+
}, [code, setTemporaryStatus]);
|
|
282
|
+
|
|
283
|
+
const exportPng = useCallback(async () => {
|
|
284
|
+
if (isStreaming || isExporting) return;
|
|
285
|
+
setIsExporting(true);
|
|
286
|
+
setTemporaryStatus("Exporting PNG...");
|
|
287
|
+
|
|
288
|
+
try {
|
|
289
|
+
let blob: Blob;
|
|
290
|
+
try {
|
|
291
|
+
blob = await exportWidgetPng({ code });
|
|
292
|
+
} catch {
|
|
293
|
+
const capture = await requestWidgetCapture();
|
|
294
|
+
blob = await exportWidgetPng({ code, capture });
|
|
295
|
+
}
|
|
296
|
+
downloadBlob(blob, `${safeWidgetFilename(title)}.png`);
|
|
297
|
+
setTemporaryStatus("Downloaded PNG");
|
|
298
|
+
} catch (error) {
|
|
299
|
+
console.warn("[WidgetRenderer] PNG export failed:", error);
|
|
300
|
+
setTemporaryStatus("PNG export unavailable");
|
|
301
|
+
} finally {
|
|
302
|
+
setIsExporting(false);
|
|
303
|
+
}
|
|
304
|
+
}, [code, title, isStreaming, isExporting, requestWidgetCapture, setTemporaryStatus]);
|
|
305
|
+
|
|
306
|
+
const showLoadingOverlay = showOverlay || (hasCDN && !isStreaming && iframeReady && !finalized);
|
|
307
|
+
const toolbarButtonStyle = {
|
|
308
|
+
width: 24,
|
|
309
|
+
height: 22,
|
|
310
|
+
padding: 0,
|
|
311
|
+
background: "var(--bg-hover)",
|
|
312
|
+
color: "var(--text-dim)",
|
|
313
|
+
border: "1px solid var(--border)",
|
|
314
|
+
borderRadius: 3,
|
|
315
|
+
cursor: "pointer",
|
|
316
|
+
display: "flex",
|
|
317
|
+
alignItems: "center",
|
|
318
|
+
justifyContent: "center",
|
|
319
|
+
flexShrink: 0,
|
|
320
|
+
};
|
|
321
|
+
const codeButtonStyle = { ...toolbarButtonStyle, width: 48, fontSize: 10, whiteSpace: "nowrap" as const };
|
|
322
|
+
const disabledButtonStyle = {
|
|
323
|
+
opacity: 0.45,
|
|
324
|
+
cursor: "not-allowed",
|
|
325
|
+
};
|
|
326
|
+
|
|
327
|
+
return (
|
|
328
|
+
<div
|
|
329
|
+
className="widget-frame"
|
|
330
|
+
style={{
|
|
331
|
+
position: isFullscreen ? "fixed" : "relative",
|
|
332
|
+
inset: isFullscreen ? 12 : undefined,
|
|
333
|
+
zIndex: isFullscreen ? 1000 : undefined,
|
|
334
|
+
marginTop: isFullscreen ? 0 : 4,
|
|
335
|
+
marginBottom: isFullscreen ? 0 : 4,
|
|
336
|
+
borderRadius: isFullscreen ? 8 : 6,
|
|
337
|
+
background: isFullscreen ? "var(--bg)" : undefined,
|
|
338
|
+
boxShadow: isFullscreen ? "0 24px 80px rgba(0, 0, 0, 0.35)" : undefined,
|
|
339
|
+
display: isFullscreen ? "flex" : undefined,
|
|
340
|
+
flexDirection: isFullscreen ? "column" : undefined,
|
|
341
|
+
}}
|
|
342
|
+
>
|
|
343
|
+
{/* Title bar */}
|
|
344
|
+
<div
|
|
345
|
+
style={{
|
|
346
|
+
display: "flex",
|
|
347
|
+
alignItems: "center",
|
|
348
|
+
gap: 6,
|
|
349
|
+
padding: "4px 10px",
|
|
350
|
+
background: "var(--bg-panel)",
|
|
351
|
+
border: "1px solid var(--border)",
|
|
352
|
+
borderBottom: "none",
|
|
353
|
+
borderRadius: `${isFullscreen ? 8 : 6}px ${isFullscreen ? 8 : 6}px 0 0`,
|
|
354
|
+
fontSize: 11,
|
|
355
|
+
color: "var(--text-dim)",
|
|
356
|
+
minHeight: 26,
|
|
357
|
+
flexShrink: 0,
|
|
358
|
+
}}
|
|
359
|
+
>
|
|
360
|
+
<span style={{ fontWeight: 600, minWidth: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
|
|
361
|
+
{title || "Widget"}
|
|
362
|
+
</span>
|
|
363
|
+
{isStreaming && (
|
|
364
|
+
<span style={{ fontSize: 10, color: "var(--accent)", animation: "pulse 1.5s infinite", flexShrink: 0 }}>
|
|
365
|
+
streaming…
|
|
366
|
+
</span>
|
|
367
|
+
)}
|
|
368
|
+
{actionStatus && (
|
|
369
|
+
<span aria-live="polite" style={{ marginLeft: "auto", fontSize: 10, color: "var(--text-muted)", flexShrink: 0 }}>
|
|
370
|
+
{actionStatus}
|
|
371
|
+
</span>
|
|
372
|
+
)}
|
|
373
|
+
<div style={{ display: "flex", alignItems: "center", gap: 4, marginLeft: actionStatus ? 0 : "auto", flexShrink: 0 }}>
|
|
374
|
+
<button
|
|
375
|
+
onClick={copyShowWidgetSource}
|
|
376
|
+
title="Copy show-widget source"
|
|
377
|
+
aria-label="Copy show-widget source"
|
|
378
|
+
style={toolbarButtonStyle}
|
|
379
|
+
>
|
|
380
|
+
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
|
381
|
+
<polyline points="16 18 22 12 16 6" />
|
|
382
|
+
<polyline points="8 6 2 12 8 18" />
|
|
383
|
+
</svg>
|
|
384
|
+
</button>
|
|
385
|
+
<button
|
|
386
|
+
onClick={copyWidgetHtml}
|
|
387
|
+
title="Copy widget HTML/SVG"
|
|
388
|
+
aria-label="Copy widget HTML/SVG"
|
|
389
|
+
style={toolbarButtonStyle}
|
|
390
|
+
>
|
|
391
|
+
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
|
392
|
+
<rect x="9" y="9" width="13" height="13" rx="2" />
|
|
393
|
+
<path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" />
|
|
394
|
+
</svg>
|
|
395
|
+
</button>
|
|
396
|
+
<button
|
|
397
|
+
onClick={exportPng}
|
|
398
|
+
disabled={isStreaming || isExporting}
|
|
399
|
+
title={isStreaming ? "PNG export is available after streaming finishes" : "Export widget as PNG"}
|
|
400
|
+
aria-label="Export widget as PNG"
|
|
401
|
+
style={{
|
|
402
|
+
...toolbarButtonStyle,
|
|
403
|
+
...((isStreaming || isExporting) ? disabledButtonStyle : null),
|
|
404
|
+
}}
|
|
405
|
+
>
|
|
406
|
+
{isExporting ? (
|
|
407
|
+
<span style={{ fontSize: 9 }}>...</span>
|
|
408
|
+
) : (
|
|
409
|
+
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
|
410
|
+
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />
|
|
411
|
+
<polyline points="7 10 12 15 17 10" />
|
|
412
|
+
<line x1="12" y1="15" x2="12" y2="3" />
|
|
413
|
+
</svg>
|
|
414
|
+
)}
|
|
415
|
+
</button>
|
|
416
|
+
<button
|
|
417
|
+
onClick={() => setIsFullscreen((v) => !v)}
|
|
418
|
+
title={isFullscreen ? "Exit full screen" : "View full screen"}
|
|
419
|
+
aria-label={isFullscreen ? "Exit full screen" : "View full screen"}
|
|
420
|
+
style={toolbarButtonStyle}
|
|
421
|
+
>
|
|
422
|
+
{isFullscreen ? (
|
|
423
|
+
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
|
424
|
+
<polyline points="4 14 10 14 10 20" />
|
|
425
|
+
<polyline points="20 10 14 10 14 4" />
|
|
426
|
+
<line x1="14" y1="10" x2="21" y2="3" />
|
|
427
|
+
<line x1="3" y1="21" x2="10" y2="14" />
|
|
428
|
+
</svg>
|
|
429
|
+
) : (
|
|
430
|
+
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
|
431
|
+
<polyline points="15 3 21 3 21 9" />
|
|
432
|
+
<polyline points="9 21 3 21 3 15" />
|
|
433
|
+
<line x1="21" y1="3" x2="14" y2="10" />
|
|
434
|
+
<line x1="3" y1="21" x2="10" y2="14" />
|
|
435
|
+
</svg>
|
|
436
|
+
)}
|
|
437
|
+
</button>
|
|
438
|
+
<button
|
|
439
|
+
onClick={() => setShowCode((v) => !v)}
|
|
440
|
+
title={showCode ? "Show widget preview" : "Show widget code"}
|
|
441
|
+
style={codeButtonStyle}
|
|
442
|
+
>
|
|
443
|
+
{showCode ? "Preview" : "Code"}
|
|
444
|
+
</button>
|
|
445
|
+
</div>
|
|
446
|
+
</div>
|
|
447
|
+
|
|
448
|
+
{/* Code view */}
|
|
449
|
+
{showCode && (
|
|
450
|
+
<pre
|
|
451
|
+
style={{
|
|
452
|
+
margin: 0,
|
|
453
|
+
padding: "8px 10px",
|
|
454
|
+
fontSize: 11,
|
|
455
|
+
fontFamily: "var(--font-mono)",
|
|
456
|
+
color: "var(--text-muted)",
|
|
457
|
+
background: "var(--bg)",
|
|
458
|
+
border: "1px solid var(--border)",
|
|
459
|
+
borderRadius: "0 0 6px 6px",
|
|
460
|
+
overflow: "auto",
|
|
461
|
+
maxHeight: isFullscreen ? "none" : 400,
|
|
462
|
+
flex: isFullscreen ? 1 : undefined,
|
|
463
|
+
whiteSpace: "pre-wrap",
|
|
464
|
+
}}
|
|
465
|
+
>
|
|
466
|
+
{code}
|
|
467
|
+
</pre>
|
|
468
|
+
)}
|
|
469
|
+
|
|
470
|
+
{/* iframe */}
|
|
471
|
+
<iframe
|
|
472
|
+
ref={iframeRef}
|
|
473
|
+
sandbox="allow-scripts"
|
|
474
|
+
srcDoc={srcdoc}
|
|
475
|
+
title={title || "Widget"}
|
|
476
|
+
onLoad={() => setIframeReady(true)}
|
|
477
|
+
style={{
|
|
478
|
+
width: "100%",
|
|
479
|
+
height: isFullscreen ? "calc(100vh - 50px)" : iframeHeight,
|
|
480
|
+
minHeight: iframeHeight > 0 ? undefined : 80,
|
|
481
|
+
border: "1px solid var(--border)",
|
|
482
|
+
borderRadius: `0 0 ${isFullscreen ? 8 : 6}px ${isFullscreen ? 8 : 6}px`,
|
|
483
|
+
display: showCode ? "none" : "block",
|
|
484
|
+
overflow: "hidden",
|
|
485
|
+
background: "transparent",
|
|
486
|
+
flex: isFullscreen ? 1 : undefined,
|
|
487
|
+
transition: hasReceivedFirstHeight.current ? "height 0.2s ease-out" : "none",
|
|
488
|
+
}}
|
|
489
|
+
/>
|
|
490
|
+
|
|
491
|
+
{showLoadingOverlay && !showCode && (
|
|
492
|
+
<div
|
|
493
|
+
className="widget-shimmer"
|
|
494
|
+
style={{
|
|
495
|
+
position: "absolute",
|
|
496
|
+
inset: 0,
|
|
497
|
+
top: 26,
|
|
498
|
+
pointerEvents: "none",
|
|
499
|
+
borderRadius: "0 0 6px 6px",
|
|
500
|
+
}}
|
|
501
|
+
/>
|
|
502
|
+
)}
|
|
503
|
+
</div>
|
|
504
|
+
);
|
|
505
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import React from "react";
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
fileName?: string;
|
|
7
|
+
pageInfo?: string;
|
|
8
|
+
onZoomIn?: () => void;
|
|
9
|
+
onZoomOut?: () => void;
|
|
10
|
+
zoom?: number;
|
|
11
|
+
extra?: React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function DocumentToolbar({ fileName, pageInfo, onZoomIn, onZoomOut, zoom, extra }: Props) {
|
|
15
|
+
return (
|
|
16
|
+
<div
|
|
17
|
+
style={{
|
|
18
|
+
display: "flex",
|
|
19
|
+
alignItems: "center",
|
|
20
|
+
gap: 12,
|
|
21
|
+
padding: "4px 16px",
|
|
22
|
+
borderBottom: "1px solid var(--border)",
|
|
23
|
+
fontSize: 11,
|
|
24
|
+
color: "var(--text-dim)",
|
|
25
|
+
background: "var(--bg)",
|
|
26
|
+
flexShrink: 0,
|
|
27
|
+
minHeight: 32,
|
|
28
|
+
}}
|
|
29
|
+
>
|
|
30
|
+
{fileName && (
|
|
31
|
+
<span style={{ fontFamily: "var(--font-mono)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", maxWidth: 300 }} title={fileName}>
|
|
32
|
+
{fileName}
|
|
33
|
+
</span>
|
|
34
|
+
)}
|
|
35
|
+
<span style={{ marginLeft: "auto" }} />
|
|
36
|
+
{pageInfo && <span>{pageInfo}</span>}
|
|
37
|
+
{zoom !== undefined && onZoomOut && onZoomIn && (
|
|
38
|
+
<div style={{ display: "flex", alignItems: "center", gap: 4 }}>
|
|
39
|
+
<button
|
|
40
|
+
onClick={onZoomOut}
|
|
41
|
+
title="Zoom out"
|
|
42
|
+
style={toolbarBtnStyle}
|
|
43
|
+
>
|
|
44
|
+
<svg width="10" height="10" viewBox="0 0 10 10" fill="none" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round">
|
|
45
|
+
<line x1="2" y1="5" x2="8" y2="5" />
|
|
46
|
+
</svg>
|
|
47
|
+
</button>
|
|
48
|
+
<span style={{ minWidth: 36, textAlign: "center", fontVariantNumeric: "tabular-nums" }}>{Math.round(zoom * 100)}%</span>
|
|
49
|
+
<button
|
|
50
|
+
onClick={onZoomIn}
|
|
51
|
+
title="Zoom in"
|
|
52
|
+
style={toolbarBtnStyle}
|
|
53
|
+
>
|
|
54
|
+
<svg width="10" height="10" viewBox="0 0 10 10" fill="none" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round">
|
|
55
|
+
<line x1="5" y1="2" x2="5" y2="8" />
|
|
56
|
+
<line x1="2" y1="5" x2="8" y2="5" />
|
|
57
|
+
</svg>
|
|
58
|
+
</button>
|
|
59
|
+
</div>
|
|
60
|
+
)}
|
|
61
|
+
{extra}
|
|
62
|
+
</div>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const toolbarBtnStyle: React.CSSProperties = {
|
|
67
|
+
display: "flex",
|
|
68
|
+
alignItems: "center",
|
|
69
|
+
justifyContent: "center",
|
|
70
|
+
width: 24,
|
|
71
|
+
height: 24,
|
|
72
|
+
padding: 0,
|
|
73
|
+
background: "none",
|
|
74
|
+
border: "1px solid var(--border)",
|
|
75
|
+
borderRadius: 4,
|
|
76
|
+
color: "var(--text-muted)",
|
|
77
|
+
cursor: "pointer",
|
|
78
|
+
};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useEffect, useRef, useState } from "react";
|
|
4
|
+
import { DocumentToolbar } from "./DocumentToolbar";
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
arrayBuffer: ArrayBuffer;
|
|
8
|
+
fileName?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function DocxViewer({ arrayBuffer, fileName }: Props) {
|
|
12
|
+
const containerRef = useRef<HTMLDivElement>(null);
|
|
13
|
+
const [loading, setLoading] = useState(true);
|
|
14
|
+
const [error, setError] = useState<string | null>(null);
|
|
15
|
+
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
let cancelled = false;
|
|
18
|
+
|
|
19
|
+
async function render() {
|
|
20
|
+
setLoading(true);
|
|
21
|
+
setError(null);
|
|
22
|
+
|
|
23
|
+
try {
|
|
24
|
+
const { renderAsync } = await import("docx-preview");
|
|
25
|
+
|
|
26
|
+
const container = containerRef.current;
|
|
27
|
+
if (!container || cancelled) return;
|
|
28
|
+
|
|
29
|
+
container.innerHTML = "";
|
|
30
|
+
|
|
31
|
+
await renderAsync(arrayBuffer, container, undefined, {
|
|
32
|
+
className: "docx-preview",
|
|
33
|
+
inWrapper: true,
|
|
34
|
+
ignoreWidth: false,
|
|
35
|
+
ignoreHeight: false,
|
|
36
|
+
ignoreFonts: false,
|
|
37
|
+
breakPages: true,
|
|
38
|
+
ignoreLastRenderedPageBreak: false,
|
|
39
|
+
experimental: false,
|
|
40
|
+
trimXmlDeclaration: true,
|
|
41
|
+
useBase64URL: false,
|
|
42
|
+
renderChanges: false,
|
|
43
|
+
renderHeaders: true,
|
|
44
|
+
renderFooters: true,
|
|
45
|
+
renderFootnotes: true,
|
|
46
|
+
renderEndnotes: true,
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
if (!cancelled) setLoading(false);
|
|
50
|
+
} catch (err: unknown) {
|
|
51
|
+
if (!cancelled) {
|
|
52
|
+
console.error("DOCX render error:", err);
|
|
53
|
+
setError(String(err));
|
|
54
|
+
setLoading(false);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
render();
|
|
60
|
+
return () => { cancelled = true; };
|
|
61
|
+
}, [arrayBuffer]);
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<div style={{ display: "flex", flexDirection: "column", height: "100%", overflow: "hidden" }}>
|
|
65
|
+
<DocumentToolbar fileName={fileName} />
|
|
66
|
+
<div
|
|
67
|
+
style={{
|
|
68
|
+
flex: 1,
|
|
69
|
+
overflow: "auto",
|
|
70
|
+
background: "#e8e8e8",
|
|
71
|
+
padding: "24px 0",
|
|
72
|
+
}}
|
|
73
|
+
>
|
|
74
|
+
{loading && (
|
|
75
|
+
<div style={{ color: "var(--text-muted)", fontSize: 13, padding: "40px 16px", textAlign: "center" }}>
|
|
76
|
+
Loading document...
|
|
77
|
+
</div>
|
|
78
|
+
)}
|
|
79
|
+
{error && (
|
|
80
|
+
<div style={{ color: "#f87171", fontSize: 13, padding: "40px 16px", textAlign: "center" }}>{error}</div>
|
|
81
|
+
)}
|
|
82
|
+
<div
|
|
83
|
+
ref={containerRef}
|
|
84
|
+
style={{
|
|
85
|
+
maxWidth: 816,
|
|
86
|
+
margin: "0 auto",
|
|
87
|
+
background: "#fff",
|
|
88
|
+
boxShadow: "0 1px 4px rgba(0,0,0,0.12)",
|
|
89
|
+
minHeight: 100,
|
|
90
|
+
visibility: loading ? "hidden" : "visible",
|
|
91
|
+
}}
|
|
92
|
+
className="docx-preview-container"
|
|
93
|
+
/>
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
);
|
|
97
|
+
}
|