@papermap/papermap 1.0.2 → 1.0.3
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/index.d.mts +12 -12
- package/dist/index.d.ts +12 -12
- package/dist/index.js +30 -36
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +27 -33
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/readme.md +27 -27
package/dist/index.d.mts
CHANGED
|
@@ -8,7 +8,7 @@ import * as axios from 'axios';
|
|
|
8
8
|
import { AxiosInstance } from 'axios';
|
|
9
9
|
import { Layout } from 'react-grid-layout';
|
|
10
10
|
|
|
11
|
-
interface
|
|
11
|
+
interface PaperChatProps {
|
|
12
12
|
token?: string;
|
|
13
13
|
workspaceId?: string;
|
|
14
14
|
dashboardId?: string;
|
|
@@ -30,7 +30,7 @@ interface PapermapChatProps {
|
|
|
30
30
|
*/
|
|
31
31
|
showToolbar?: boolean;
|
|
32
32
|
}
|
|
33
|
-
declare function
|
|
33
|
+
declare function PaperChat({ token, workspaceId, dashboardId, apiUrl, onToolbarHeightChange, showToolbar, ...uiProps }: PaperChatProps): react_jsx_runtime.JSX.Element;
|
|
34
34
|
|
|
35
35
|
type TChartMeta$1 = {
|
|
36
36
|
title?: string;
|
|
@@ -101,7 +101,7 @@ type ConversationHistory = Omit<TChartResponse, 'chart_response'> & {
|
|
|
101
101
|
latest_user_name?: string | null;
|
|
102
102
|
};
|
|
103
103
|
|
|
104
|
-
interface
|
|
104
|
+
interface PaperCardProps {
|
|
105
105
|
/**
|
|
106
106
|
* Connection details for API calls. Optional when the card is rendered inside
|
|
107
107
|
* `PapermapProvider` with the same values (or use props to override provider defaults).
|
|
@@ -176,7 +176,7 @@ interface PapermapChartCardProps {
|
|
|
176
176
|
*/
|
|
177
177
|
variant?: 'default' | 'streaming';
|
|
178
178
|
}
|
|
179
|
-
declare function
|
|
179
|
+
declare function PaperCard({ token: tokenProp, workspaceId: workspaceIdProp, dashboardId: dashboardIdProp, apiUrl: apiUrlProp, id, onSave, chartId, chart: chartProp, theme, onEditClick, onDelete, isViewer, wide, hideVariants, showToolbar, isEditMode, className, variant, }: PaperCardProps): react_jsx_runtime.JSX.Element;
|
|
180
180
|
|
|
181
181
|
declare function ChatAssistant(): react_jsx_runtime.JSX.Element;
|
|
182
182
|
|
|
@@ -434,7 +434,7 @@ type ResizeHandle = 'n' | 's' | 'e' | 'w' | 'ne' | 'nw' | 'se' | 'sw';
|
|
|
434
434
|
type TLayout = Layout & {
|
|
435
435
|
resizeHandles?: ResizeHandle[];
|
|
436
436
|
};
|
|
437
|
-
type
|
|
437
|
+
type PaperBoardLayouts = {
|
|
438
438
|
[key: string]: TLayout[];
|
|
439
439
|
};
|
|
440
440
|
interface DashboardTheme {
|
|
@@ -687,7 +687,7 @@ interface OpenPapermapChatAssistantOptions {
|
|
|
687
687
|
*/
|
|
688
688
|
chart?: TChartResponse | null;
|
|
689
689
|
/**
|
|
690
|
-
* When true, do not open/focus the floating
|
|
690
|
+
* When true, do not open/focus the floating PaperChat assistant.
|
|
691
691
|
* This is useful for streaming variants that render their own embedded
|
|
692
692
|
* chart+conversation panel instead of the global UI.
|
|
693
693
|
*/
|
|
@@ -789,14 +789,14 @@ declare function createApiClient(token: string, apiUrl?: string): {
|
|
|
789
789
|
authHeaders: Record<string, string>;
|
|
790
790
|
};
|
|
791
791
|
|
|
792
|
-
interface
|
|
792
|
+
interface PaperBoardProps {
|
|
793
793
|
token?: string;
|
|
794
794
|
workspaceId?: string;
|
|
795
795
|
dashboardId?: string;
|
|
796
796
|
apiUrl?: string;
|
|
797
797
|
charts?: TChartResponse[];
|
|
798
|
-
layouts?:
|
|
799
|
-
onLayoutsChange?: (layouts:
|
|
798
|
+
layouts?: PaperBoardLayouts;
|
|
799
|
+
onLayoutsChange?: (layouts: PaperBoardLayouts) => void;
|
|
800
800
|
isEditMode?: boolean;
|
|
801
801
|
showToolbar?: boolean;
|
|
802
802
|
showScreenshot?: boolean;
|
|
@@ -833,7 +833,7 @@ interface PapermapGridDashboardProps {
|
|
|
833
833
|
showChatAssistant?: boolean;
|
|
834
834
|
variant?: 'default' | 'streaming';
|
|
835
835
|
}
|
|
836
|
-
declare function
|
|
836
|
+
declare function PaperBoard({ token, workspaceId, dashboardId, apiUrl, ...rest }: PaperBoardProps): react_jsx_runtime.JSX.Element;
|
|
837
837
|
|
|
838
838
|
type ThemePreset = 'default' | 'lime' | 'blue' | 'green' | 'purple' | 'ocean' | 'sunset' | 'dark' | 'minimal';
|
|
839
839
|
|
|
@@ -871,7 +871,7 @@ declare function resolveDashboardThemeFromWorkspace(workspace: {
|
|
|
871
871
|
} | null | undefined, dashboardId: string): DashboardTheme | undefined;
|
|
872
872
|
|
|
873
873
|
/**
|
|
874
|
-
* Persistent link between a host-owned stable id (`id` on {@link
|
|
874
|
+
* Persistent link between a host-owned stable id (`id` on {@link PaperCard})
|
|
875
875
|
* and the Papermap backend `chat_id` (`llm_data_chat_id`).
|
|
876
876
|
*
|
|
877
877
|
* Stored in localStorage under a single key to avoid per-card key explosion and to allow
|
|
@@ -917,4 +917,4 @@ declare function resolveChartFetchChatId(params: {
|
|
|
917
917
|
dashboardId?: string;
|
|
918
918
|
}): string | undefined;
|
|
919
919
|
|
|
920
|
-
export { type AgentThought, AgentThoughtDisplay, BookmarkButton, BranchButton, ButtonWithTooltip, CHART_CARD_CHAT_MAP_KEY, CHAT_MODAL_TAB, type ChartCardIdLink, type ChartCardStorageNamespace, ChartDialog, ChartHistory, type ChartResponse, ChartView, ChatAssistant, type ChatModalTabType, type ConversationHistory, type DashboardTheme, DataTable, type DecodedToken, FeedbackButtons, type FinalResponse, LogoStandAlone, type Message, ModelSelector, MorphGradient, type OpenPapermapChatAssistantOptions, type
|
|
920
|
+
export { type AgentThought, AgentThoughtDisplay, BookmarkButton, BranchButton, ButtonWithTooltip, CHART_CARD_CHAT_MAP_KEY, CHAT_MODAL_TAB, type ChartCardIdLink, type ChartCardStorageNamespace, ChartDialog, ChartHistory, type ChartResponse, ChartView, ChatAssistant, type ChatModalTabType, type ConversationHistory, type DashboardTheme, DataTable, type DecodedToken, FeedbackButtons, type FinalResponse, LogoStandAlone, type Message, ModelSelector, MorphGradient, type OpenPapermapChatAssistantOptions, PaperBoard, type TLayout as PaperBoardLayoutItem, type PaperBoardLayouts, PaperCard, type PaperCardProps, PaperChat, type PaperChatProps, type PapermapActions, PapermapProvider as PapermapConfigProvider, type PapermapConnectionValue, type PapermapHttpServices, PapermapProvider, type PapermapState, type PapermapStore, type PapermapStoreApi, type PapermapStoreConfig, RecentConversations, SavedMemory, type StreamState, StreamingChartDialog, StreamingChatPanel, StreamingTimeline, type TChartMeta$1 as TChartMeta, type TChartResponse, ThemeCustomizationSettings, type ThemeCustomizationSettingsProps, type ThemePreset, type ThemeSaveMeta, type TimelineEvent, type ToolCall, ToolCallDisplay, buildAuthHeaders, createApiClient, createPapermapServices, createPapermapStore, decodeToken, defaultTheme, getChartCardIdLink, openPapermapChatAssistant, presetDisplayNames, removeChartCardIdLink, resolveChartFetchChatId, resolveDashboardThemeFromWorkspace, themePresetList, themePresets, upsertChartCardIdLink, useAnalyticsStream, useAutoFade, useAutoResize, useKeyboardShortcuts, usePapermapConnection, usePapermapConnectionOptional, usePapermapStore, usePapermapStoreApi, usePapermapStoreApiOptional };
|
package/dist/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import * as axios from 'axios';
|
|
|
8
8
|
import { AxiosInstance } from 'axios';
|
|
9
9
|
import { Layout } from 'react-grid-layout';
|
|
10
10
|
|
|
11
|
-
interface
|
|
11
|
+
interface PaperChatProps {
|
|
12
12
|
token?: string;
|
|
13
13
|
workspaceId?: string;
|
|
14
14
|
dashboardId?: string;
|
|
@@ -30,7 +30,7 @@ interface PapermapChatProps {
|
|
|
30
30
|
*/
|
|
31
31
|
showToolbar?: boolean;
|
|
32
32
|
}
|
|
33
|
-
declare function
|
|
33
|
+
declare function PaperChat({ token, workspaceId, dashboardId, apiUrl, onToolbarHeightChange, showToolbar, ...uiProps }: PaperChatProps): react_jsx_runtime.JSX.Element;
|
|
34
34
|
|
|
35
35
|
type TChartMeta$1 = {
|
|
36
36
|
title?: string;
|
|
@@ -101,7 +101,7 @@ type ConversationHistory = Omit<TChartResponse, 'chart_response'> & {
|
|
|
101
101
|
latest_user_name?: string | null;
|
|
102
102
|
};
|
|
103
103
|
|
|
104
|
-
interface
|
|
104
|
+
interface PaperCardProps {
|
|
105
105
|
/**
|
|
106
106
|
* Connection details for API calls. Optional when the card is rendered inside
|
|
107
107
|
* `PapermapProvider` with the same values (or use props to override provider defaults).
|
|
@@ -176,7 +176,7 @@ interface PapermapChartCardProps {
|
|
|
176
176
|
*/
|
|
177
177
|
variant?: 'default' | 'streaming';
|
|
178
178
|
}
|
|
179
|
-
declare function
|
|
179
|
+
declare function PaperCard({ token: tokenProp, workspaceId: workspaceIdProp, dashboardId: dashboardIdProp, apiUrl: apiUrlProp, id, onSave, chartId, chart: chartProp, theme, onEditClick, onDelete, isViewer, wide, hideVariants, showToolbar, isEditMode, className, variant, }: PaperCardProps): react_jsx_runtime.JSX.Element;
|
|
180
180
|
|
|
181
181
|
declare function ChatAssistant(): react_jsx_runtime.JSX.Element;
|
|
182
182
|
|
|
@@ -434,7 +434,7 @@ type ResizeHandle = 'n' | 's' | 'e' | 'w' | 'ne' | 'nw' | 'se' | 'sw';
|
|
|
434
434
|
type TLayout = Layout & {
|
|
435
435
|
resizeHandles?: ResizeHandle[];
|
|
436
436
|
};
|
|
437
|
-
type
|
|
437
|
+
type PaperBoardLayouts = {
|
|
438
438
|
[key: string]: TLayout[];
|
|
439
439
|
};
|
|
440
440
|
interface DashboardTheme {
|
|
@@ -687,7 +687,7 @@ interface OpenPapermapChatAssistantOptions {
|
|
|
687
687
|
*/
|
|
688
688
|
chart?: TChartResponse | null;
|
|
689
689
|
/**
|
|
690
|
-
* When true, do not open/focus the floating
|
|
690
|
+
* When true, do not open/focus the floating PaperChat assistant.
|
|
691
691
|
* This is useful for streaming variants that render their own embedded
|
|
692
692
|
* chart+conversation panel instead of the global UI.
|
|
693
693
|
*/
|
|
@@ -789,14 +789,14 @@ declare function createApiClient(token: string, apiUrl?: string): {
|
|
|
789
789
|
authHeaders: Record<string, string>;
|
|
790
790
|
};
|
|
791
791
|
|
|
792
|
-
interface
|
|
792
|
+
interface PaperBoardProps {
|
|
793
793
|
token?: string;
|
|
794
794
|
workspaceId?: string;
|
|
795
795
|
dashboardId?: string;
|
|
796
796
|
apiUrl?: string;
|
|
797
797
|
charts?: TChartResponse[];
|
|
798
|
-
layouts?:
|
|
799
|
-
onLayoutsChange?: (layouts:
|
|
798
|
+
layouts?: PaperBoardLayouts;
|
|
799
|
+
onLayoutsChange?: (layouts: PaperBoardLayouts) => void;
|
|
800
800
|
isEditMode?: boolean;
|
|
801
801
|
showToolbar?: boolean;
|
|
802
802
|
showScreenshot?: boolean;
|
|
@@ -833,7 +833,7 @@ interface PapermapGridDashboardProps {
|
|
|
833
833
|
showChatAssistant?: boolean;
|
|
834
834
|
variant?: 'default' | 'streaming';
|
|
835
835
|
}
|
|
836
|
-
declare function
|
|
836
|
+
declare function PaperBoard({ token, workspaceId, dashboardId, apiUrl, ...rest }: PaperBoardProps): react_jsx_runtime.JSX.Element;
|
|
837
837
|
|
|
838
838
|
type ThemePreset = 'default' | 'lime' | 'blue' | 'green' | 'purple' | 'ocean' | 'sunset' | 'dark' | 'minimal';
|
|
839
839
|
|
|
@@ -871,7 +871,7 @@ declare function resolveDashboardThemeFromWorkspace(workspace: {
|
|
|
871
871
|
} | null | undefined, dashboardId: string): DashboardTheme | undefined;
|
|
872
872
|
|
|
873
873
|
/**
|
|
874
|
-
* Persistent link between a host-owned stable id (`id` on {@link
|
|
874
|
+
* Persistent link between a host-owned stable id (`id` on {@link PaperCard})
|
|
875
875
|
* and the Papermap backend `chat_id` (`llm_data_chat_id`).
|
|
876
876
|
*
|
|
877
877
|
* Stored in localStorage under a single key to avoid per-card key explosion and to allow
|
|
@@ -917,4 +917,4 @@ declare function resolveChartFetchChatId(params: {
|
|
|
917
917
|
dashboardId?: string;
|
|
918
918
|
}): string | undefined;
|
|
919
919
|
|
|
920
|
-
export { type AgentThought, AgentThoughtDisplay, BookmarkButton, BranchButton, ButtonWithTooltip, CHART_CARD_CHAT_MAP_KEY, CHAT_MODAL_TAB, type ChartCardIdLink, type ChartCardStorageNamespace, ChartDialog, ChartHistory, type ChartResponse, ChartView, ChatAssistant, type ChatModalTabType, type ConversationHistory, type DashboardTheme, DataTable, type DecodedToken, FeedbackButtons, type FinalResponse, LogoStandAlone, type Message, ModelSelector, MorphGradient, type OpenPapermapChatAssistantOptions, type
|
|
920
|
+
export { type AgentThought, AgentThoughtDisplay, BookmarkButton, BranchButton, ButtonWithTooltip, CHART_CARD_CHAT_MAP_KEY, CHAT_MODAL_TAB, type ChartCardIdLink, type ChartCardStorageNamespace, ChartDialog, ChartHistory, type ChartResponse, ChartView, ChatAssistant, type ChatModalTabType, type ConversationHistory, type DashboardTheme, DataTable, type DecodedToken, FeedbackButtons, type FinalResponse, LogoStandAlone, type Message, ModelSelector, MorphGradient, type OpenPapermapChatAssistantOptions, PaperBoard, type TLayout as PaperBoardLayoutItem, type PaperBoardLayouts, PaperCard, type PaperCardProps, PaperChat, type PaperChatProps, type PapermapActions, PapermapProvider as PapermapConfigProvider, type PapermapConnectionValue, type PapermapHttpServices, PapermapProvider, type PapermapState, type PapermapStore, type PapermapStoreApi, type PapermapStoreConfig, RecentConversations, SavedMemory, type StreamState, StreamingChartDialog, StreamingChatPanel, StreamingTimeline, type TChartMeta$1 as TChartMeta, type TChartResponse, ThemeCustomizationSettings, type ThemeCustomizationSettingsProps, type ThemePreset, type ThemeSaveMeta, type TimelineEvent, type ToolCall, ToolCallDisplay, buildAuthHeaders, createApiClient, createPapermapServices, createPapermapStore, decodeToken, defaultTheme, getChartCardIdLink, openPapermapChatAssistant, presetDisplayNames, removeChartCardIdLink, resolveChartFetchChatId, resolveDashboardThemeFromWorkspace, themePresetList, themePresets, upsertChartCardIdLink, useAnalyticsStream, useAutoFade, useAutoResize, useKeyboardShortcuts, usePapermapConnection, usePapermapConnectionOptional, usePapermapStore, usePapermapStoreApi, usePapermapStoreApiOptional };
|
package/dist/index.js
CHANGED
|
@@ -45,10 +45,10 @@ __export(index_exports, {
|
|
|
45
45
|
LogoStandAlone: () => LogoStandAlone_default,
|
|
46
46
|
ModelSelector: () => ModelSelector,
|
|
47
47
|
MorphGradient: () => MorphGradient,
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
PaperBoard: () => PaperBoard,
|
|
49
|
+
PaperCard: () => PaperCard,
|
|
50
|
+
PaperChat: () => PaperChat,
|
|
50
51
|
PapermapConfigProvider: () => PapermapProvider,
|
|
51
|
-
PapermapGridDashboard: () => PapermapGridDashboard,
|
|
52
52
|
PapermapProvider: () => PapermapProvider,
|
|
53
53
|
RecentConversations: () => RecentConversations,
|
|
54
54
|
SavedMemory: () => SavedMemory,
|
|
@@ -84,7 +84,7 @@ __export(index_exports, {
|
|
|
84
84
|
});
|
|
85
85
|
module.exports = __toCommonJS(index_exports);
|
|
86
86
|
|
|
87
|
-
// src/components/
|
|
87
|
+
// src/components/PaperChat.tsx
|
|
88
88
|
var import_react22 = require("react");
|
|
89
89
|
var import_react_dom = require("react-dom");
|
|
90
90
|
var import_framer_motion8 = require("framer-motion");
|
|
@@ -6643,11 +6643,11 @@ function ModelSelector() {
|
|
|
6643
6643
|
] }) }) });
|
|
6644
6644
|
}
|
|
6645
6645
|
|
|
6646
|
-
// src/components/
|
|
6646
|
+
// src/components/PaperChat.tsx
|
|
6647
6647
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
6648
6648
|
var SPRING = { type: "spring", stiffness: 400, damping: 35, duration: 0.2 };
|
|
6649
6649
|
var EASE2 = [0.23, 1, 0.32, 1];
|
|
6650
|
-
function
|
|
6650
|
+
function PaperChat({
|
|
6651
6651
|
token,
|
|
6652
6652
|
workspaceId,
|
|
6653
6653
|
dashboardId,
|
|
@@ -6665,11 +6665,11 @@ function PapermapChat({
|
|
|
6665
6665
|
if (parentStore) {
|
|
6666
6666
|
if (!resolvedToken || !resolvedWorkspaceId || !resolvedDashboardId) {
|
|
6667
6667
|
throw new Error(
|
|
6668
|
-
"
|
|
6668
|
+
"PaperChat requires token, workspaceId, and dashboardId from props or PapermapProvider."
|
|
6669
6669
|
);
|
|
6670
6670
|
}
|
|
6671
6671
|
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
6672
|
-
|
|
6672
|
+
PaperChatInner,
|
|
6673
6673
|
{
|
|
6674
6674
|
onToolbarHeightChange,
|
|
6675
6675
|
showToolbar,
|
|
@@ -6679,7 +6679,7 @@ function PapermapChat({
|
|
|
6679
6679
|
}
|
|
6680
6680
|
if (!resolvedToken || !resolvedWorkspaceId || !resolvedDashboardId) {
|
|
6681
6681
|
throw new Error(
|
|
6682
|
-
"
|
|
6682
|
+
"PaperChat requires token, workspaceId, and dashboardId when used outside PapermapProvider."
|
|
6683
6683
|
);
|
|
6684
6684
|
}
|
|
6685
6685
|
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
@@ -6690,7 +6690,7 @@ function PapermapChat({
|
|
|
6690
6690
|
dashboardId: resolvedDashboardId,
|
|
6691
6691
|
apiUrl: resolvedApiUrl,
|
|
6692
6692
|
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
6693
|
-
|
|
6693
|
+
PaperChatInner,
|
|
6694
6694
|
{
|
|
6695
6695
|
onToolbarHeightChange,
|
|
6696
6696
|
showToolbar,
|
|
@@ -6700,7 +6700,7 @@ function PapermapChat({
|
|
|
6700
6700
|
}
|
|
6701
6701
|
);
|
|
6702
6702
|
}
|
|
6703
|
-
function
|
|
6703
|
+
function PaperChatInner({
|
|
6704
6704
|
placeholder = "Ask anything...",
|
|
6705
6705
|
shortcutKey = "k",
|
|
6706
6706
|
autoFade = false,
|
|
@@ -7175,7 +7175,7 @@ function PapermapChatInner({
|
|
|
7175
7175
|
return (0, import_react_dom.createPortal)(content, document.body);
|
|
7176
7176
|
}
|
|
7177
7177
|
|
|
7178
|
-
// src/components/
|
|
7178
|
+
// src/components/PaperCard.tsx
|
|
7179
7179
|
var import_react25 = require("react");
|
|
7180
7180
|
var import_lucide_react27 = require("lucide-react");
|
|
7181
7181
|
var import_react_query4 = require("@tanstack/react-query");
|
|
@@ -8327,7 +8327,7 @@ function resolveChartFetchChatId(params) {
|
|
|
8327
8327
|
return link?.chatId;
|
|
8328
8328
|
}
|
|
8329
8329
|
|
|
8330
|
-
// src/components/
|
|
8330
|
+
// src/components/PaperCard.tsx
|
|
8331
8331
|
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
8332
8332
|
function normalizeLatestChartPayload(result, fallbackChatId) {
|
|
8333
8333
|
const chartData = result?.data ?? result;
|
|
@@ -8385,11 +8385,11 @@ function persistChartLoaded(chart, cardId, workspaceId, dashboardId, onSave) {
|
|
|
8385
8385
|
try {
|
|
8386
8386
|
onSave(chart);
|
|
8387
8387
|
} catch (e) {
|
|
8388
|
-
console.error("
|
|
8388
|
+
console.error("PaperCard onSave:", e);
|
|
8389
8389
|
}
|
|
8390
8390
|
}
|
|
8391
8391
|
}
|
|
8392
|
-
function
|
|
8392
|
+
function PaperCard({
|
|
8393
8393
|
token: tokenProp,
|
|
8394
8394
|
workspaceId: workspaceIdProp,
|
|
8395
8395
|
dashboardId: dashboardIdProp,
|
|
@@ -8418,7 +8418,7 @@ function PapermapChartCard({
|
|
|
8418
8418
|
const apiUrl = apiUrlProp ?? conn?.apiUrl;
|
|
8419
8419
|
if (!token?.trim() || !workspaceId?.trim() || !dashboardId?.trim()) {
|
|
8420
8420
|
throw new Error(
|
|
8421
|
-
"
|
|
8421
|
+
"PaperCard requires token, workspaceId, and dashboardId from props or PapermapProvider."
|
|
8422
8422
|
);
|
|
8423
8423
|
}
|
|
8424
8424
|
const resolvedFetchChatId = (0, import_react25.useMemo)(
|
|
@@ -8974,7 +8974,7 @@ function useAutoResize(textareaRef, minHeight = 40, maxHeight = 120) {
|
|
|
8974
8974
|
return { resize };
|
|
8975
8975
|
}
|
|
8976
8976
|
|
|
8977
|
-
// src/features/GridDashboard/
|
|
8977
|
+
// src/features/GridDashboard/PaperBoard.tsx
|
|
8978
8978
|
var import_styles = require("react-grid-layout/css/styles.css");
|
|
8979
8979
|
var import_styles2 = require("react-resizable/css/styles.css");
|
|
8980
8980
|
var import_lucide_react36 = require("lucide-react");
|
|
@@ -10955,16 +10955,10 @@ var GRID_RESIZE_HANDLE_STYLES = `
|
|
|
10955
10955
|
}
|
|
10956
10956
|
`;
|
|
10957
10957
|
|
|
10958
|
-
// src/features/GridDashboard/
|
|
10958
|
+
// src/features/GridDashboard/PaperBoard.tsx
|
|
10959
10959
|
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
10960
10960
|
var ResponsiveGridLayout = (0, import_react_grid_layout.WidthProvider)(import_react_grid_layout.Responsive);
|
|
10961
|
-
function
|
|
10962
|
-
token,
|
|
10963
|
-
workspaceId,
|
|
10964
|
-
dashboardId,
|
|
10965
|
-
apiUrl,
|
|
10966
|
-
...rest
|
|
10967
|
-
}) {
|
|
10961
|
+
function PaperBoard({ token, workspaceId, dashboardId, apiUrl, ...rest }) {
|
|
10968
10962
|
const parentStore = usePapermapStoreApiOptional();
|
|
10969
10963
|
const connection = usePapermapConnectionOptional();
|
|
10970
10964
|
const resolvedToken = token ?? connection?.token;
|
|
@@ -10973,11 +10967,11 @@ function PapermapGridDashboard({
|
|
|
10973
10967
|
const resolvedApiUrl = apiUrl ?? connection?.apiUrl;
|
|
10974
10968
|
if (!resolvedToken || !resolvedWorkspaceId || !resolvedDashboardId) {
|
|
10975
10969
|
throw new Error(
|
|
10976
|
-
"
|
|
10970
|
+
"PaperBoard requires token, workspaceId, and dashboardId from props or PapermapProvider."
|
|
10977
10971
|
);
|
|
10978
10972
|
}
|
|
10979
10973
|
const inner = /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
10980
|
-
|
|
10974
|
+
PaperBoardInner,
|
|
10981
10975
|
{
|
|
10982
10976
|
...rest,
|
|
10983
10977
|
token: resolvedToken,
|
|
@@ -10998,7 +10992,7 @@ function PapermapGridDashboard({
|
|
|
10998
10992
|
}
|
|
10999
10993
|
);
|
|
11000
10994
|
}
|
|
11001
|
-
function
|
|
10995
|
+
function PaperBoardInner({
|
|
11002
10996
|
token,
|
|
11003
10997
|
workspaceId = "",
|
|
11004
10998
|
dashboardId,
|
|
@@ -11050,7 +11044,7 @@ function GridDashboardInner({
|
|
|
11050
11044
|
const [dashboardTitle, setDashboardTitle] = (0, import_react32.useState)("");
|
|
11051
11045
|
const [isTakingScreenshotInternal, setIsTakingScreenshotInternal] = (0, import_react32.useState)(false);
|
|
11052
11046
|
const [isGeneratingInternal, setIsGeneratingInternal] = (0, import_react32.useState)(false);
|
|
11053
|
-
const [
|
|
11047
|
+
const [paperChatToolbarHeight, setPaperChatToolbarHeight] = (0, import_react32.useState)(0);
|
|
11054
11048
|
const [themeModalOpen, setThemeModalOpen] = (0, import_react32.useState)(false);
|
|
11055
11049
|
const [localDashboardTheme, setLocalDashboardTheme] = (0, import_react32.useState)();
|
|
11056
11050
|
const [workspaceEntity, setWorkspaceEntity] = (0, import_react32.useState)(null);
|
|
@@ -11517,12 +11511,12 @@ function GridDashboardInner({
|
|
|
11517
11511
|
const themeCSS = (0, import_react32.useMemo)(() => generateThemeCSS(appliedDashboardTheme), [appliedDashboardTheme]);
|
|
11518
11512
|
const showLoader = isLoading && !charts?.length || isDashboardChanging;
|
|
11519
11513
|
const papermapChat = showChatAssistant ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
11520
|
-
|
|
11514
|
+
PaperChat,
|
|
11521
11515
|
{
|
|
11522
11516
|
token,
|
|
11523
11517
|
workspaceId,
|
|
11524
11518
|
dashboardId,
|
|
11525
|
-
onToolbarHeightChange:
|
|
11519
|
+
onToolbarHeightChange: setPaperChatToolbarHeight,
|
|
11526
11520
|
showToolbar: true
|
|
11527
11521
|
}
|
|
11528
11522
|
) : null;
|
|
@@ -11551,7 +11545,7 @@ function GridDashboardInner({
|
|
|
11551
11545
|
),
|
|
11552
11546
|
style: {
|
|
11553
11547
|
...themeStyles,
|
|
11554
|
-
paddingBottom: showChatAssistant ?
|
|
11548
|
+
paddingBottom: showChatAssistant ? paperChatToolbarHeight + 60 : void 0
|
|
11555
11549
|
},
|
|
11556
11550
|
"data-dashboard-theme": appliedDashboardTheme ? "custom" : void 0,
|
|
11557
11551
|
"data-edit-mode": isEditModeInternal || isEditMode ? "true" : "false",
|
|
@@ -11613,7 +11607,7 @@ function GridDashboardInner({
|
|
|
11613
11607
|
(isEditModeInternal || isEditMode) && !isSavingLayout && "drag-handle"
|
|
11614
11608
|
),
|
|
11615
11609
|
children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
11616
|
-
|
|
11610
|
+
PaperCard,
|
|
11617
11611
|
{
|
|
11618
11612
|
token,
|
|
11619
11613
|
workspaceId,
|
|
@@ -11671,10 +11665,10 @@ function GridDashboardInner({
|
|
|
11671
11665
|
LogoStandAlone,
|
|
11672
11666
|
ModelSelector,
|
|
11673
11667
|
MorphGradient,
|
|
11674
|
-
|
|
11675
|
-
|
|
11668
|
+
PaperBoard,
|
|
11669
|
+
PaperCard,
|
|
11670
|
+
PaperChat,
|
|
11676
11671
|
PapermapConfigProvider,
|
|
11677
|
-
PapermapGridDashboard,
|
|
11678
11672
|
PapermapProvider,
|
|
11679
11673
|
RecentConversations,
|
|
11680
11674
|
SavedMemory,
|