mito-ai 0.1.57__py3-none-any.whl → 0.1.58__py3-none-any.whl
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.
- mito_ai/__init__.py +16 -22
- mito_ai/_version.py +1 -1
- mito_ai/anthropic_client.py +24 -14
- mito_ai/chart_wizard/handlers.py +78 -17
- mito_ai/chart_wizard/urls.py +8 -5
- mito_ai/completions/completion_handlers/agent_auto_error_fixup_handler.py +6 -8
- mito_ai/completions/completion_handlers/agent_execution_handler.py +6 -8
- mito_ai/completions/completion_handlers/chat_completion_handler.py +13 -17
- mito_ai/completions/completion_handlers/code_explain_handler.py +13 -17
- mito_ai/completions/completion_handlers/completion_handler.py +3 -5
- mito_ai/completions/completion_handlers/inline_completer_handler.py +5 -6
- mito_ai/completions/completion_handlers/scratchpad_result_handler.py +6 -8
- mito_ai/completions/completion_handlers/smart_debug_handler.py +13 -17
- mito_ai/completions/completion_handlers/utils.py +3 -7
- mito_ai/completions/handlers.py +32 -22
- mito_ai/completions/message_history.py +8 -10
- mito_ai/completions/prompt_builders/chart_add_field_prompt.py +35 -0
- mito_ai/constants.py +8 -1
- mito_ai/enterprise/__init__.py +1 -1
- mito_ai/enterprise/litellm_client.py +137 -0
- mito_ai/log/handlers.py +1 -1
- mito_ai/openai_client.py +10 -90
- mito_ai/{completions/providers.py → provider_manager.py} +157 -53
- mito_ai/settings/enterprise_handler.py +26 -0
- mito_ai/settings/urls.py +2 -0
- mito_ai/streamlit_conversion/agent_utils.py +2 -30
- mito_ai/streamlit_conversion/streamlit_agent_handler.py +48 -46
- mito_ai/streamlit_preview/handlers.py +6 -3
- mito_ai/streamlit_preview/urls.py +5 -3
- mito_ai/tests/message_history/test_generate_short_chat_name.py +72 -28
- mito_ai/tests/providers/test_anthropic_client.py +174 -16
- mito_ai/tests/providers/test_azure.py +13 -13
- mito_ai/tests/providers/test_capabilities.py +14 -17
- mito_ai/tests/providers/test_gemini_client.py +14 -13
- mito_ai/tests/providers/test_model_resolution.py +145 -89
- mito_ai/tests/providers/test_openai_client.py +209 -13
- mito_ai/tests/providers/test_provider_limits.py +5 -5
- mito_ai/tests/providers/test_providers.py +229 -51
- mito_ai/tests/providers/test_retry_logic.py +13 -22
- mito_ai/tests/providers/utils.py +4 -4
- mito_ai/tests/streamlit_conversion/test_streamlit_agent_handler.py +57 -85
- mito_ai/tests/streamlit_preview/test_streamlit_preview_handler.py +4 -1
- mito_ai/tests/test_enterprise_mode.py +162 -0
- mito_ai/tests/test_model_utils.py +271 -0
- mito_ai/utils/anthropic_utils.py +8 -6
- mito_ai/utils/gemini_utils.py +0 -3
- mito_ai/utils/litellm_utils.py +84 -0
- mito_ai/utils/model_utils.py +178 -0
- mito_ai/utils/open_ai_utils.py +0 -8
- mito_ai/utils/provider_utils.py +6 -28
- mito_ai/utils/telemetry_utils.py +14 -2
- {mito_ai-0.1.57.data → mito_ai-0.1.58.data}/data/share/jupyter/labextensions/mito_ai/build_log.json +102 -102
- {mito_ai-0.1.57.data → mito_ai-0.1.58.data}/data/share/jupyter/labextensions/mito_ai/package.json +2 -2
- {mito_ai-0.1.57.data → mito_ai-0.1.58.data}/data/share/jupyter/labextensions/mito_ai/schemas/mito_ai/package.json.orig +1 -1
- mito_ai-0.1.57.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.9d26322f3e78beb2b666.js → mito_ai-0.1.58.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.03302cc521d72eb56b00.js +671 -75
- mito_ai-0.1.58.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.03302cc521d72eb56b00.js.map +1 -0
- mito_ai-0.1.57.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.79c1ea8a3cda73a4cb6f.js → mito_ai-0.1.58.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.570df809a692f53a7ab7.js +17 -17
- mito_ai-0.1.57.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.79c1ea8a3cda73a4cb6f.js.map → mito_ai-0.1.58.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.570df809a692f53a7ab7.js.map +1 -1
- {mito_ai-0.1.57.dist-info → mito_ai-0.1.58.dist-info}/METADATA +2 -1
- {mito_ai-0.1.57.dist-info → mito_ai-0.1.58.dist-info}/RECORD +86 -79
- mito_ai-0.1.57.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.9d26322f3e78beb2b666.js.map +0 -1
- {mito_ai-0.1.57.data → mito_ai-0.1.58.data}/data/etc/jupyter/jupyter_server_config.d/mito_ai.json +0 -0
- {mito_ai-0.1.57.data → mito_ai-0.1.58.data}/data/share/jupyter/labextensions/mito_ai/schemas/mito_ai/toolbar-buttons.json +0 -0
- {mito_ai-0.1.57.data → mito_ai-0.1.58.data}/data/share/jupyter/labextensions/mito_ai/static/node_modules_process_browser_js.4b128e94d31a81ebd209.js +0 -0
- {mito_ai-0.1.57.data → mito_ai-0.1.58.data}/data/share/jupyter/labextensions/mito_ai/static/node_modules_process_browser_js.4b128e94d31a81ebd209.js.map +0 -0
- {mito_ai-0.1.57.data → mito_ai-0.1.58.data}/data/share/jupyter/labextensions/mito_ai/static/style.js +0 -0
- {mito_ai-0.1.57.data → mito_ai-0.1.58.data}/data/share/jupyter/labextensions/mito_ai/static/style_index_js.f5d476ac514294615881.js +0 -0
- {mito_ai-0.1.57.data → mito_ai-0.1.58.data}/data/share/jupyter/labextensions/mito_ai/static/style_index_js.f5d476ac514294615881.js.map +0 -0
- {mito_ai-0.1.57.data → mito_ai-0.1.58.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_auth_dist_esm_providers_cognito_apis_signOut_mjs-node_module-75790d.688c25857e7b81b1740f.js +0 -0
- {mito_ai-0.1.57.data → mito_ai-0.1.58.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_auth_dist_esm_providers_cognito_apis_signOut_mjs-node_module-75790d.688c25857e7b81b1740f.js.map +0 -0
- {mito_ai-0.1.57.data → mito_ai-0.1.58.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_auth_dist_esm_providers_cognito_tokenProvider_tokenProvider_-72f1c8.a917210f057fcfe224ad.js +0 -0
- {mito_ai-0.1.57.data → mito_ai-0.1.58.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_auth_dist_esm_providers_cognito_tokenProvider_tokenProvider_-72f1c8.a917210f057fcfe224ad.js.map +0 -0
- {mito_ai-0.1.57.data → mito_ai-0.1.58.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_dist_esm_index_mjs.6bac1a8c4cc93f15f6b7.js +0 -0
- {mito_ai-0.1.57.data → mito_ai-0.1.58.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_dist_esm_index_mjs.6bac1a8c4cc93f15f6b7.js.map +0 -0
- {mito_ai-0.1.57.data → mito_ai-0.1.58.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_ui-react_dist_esm_index_mjs.4fcecd65bef9e9847609.js +0 -0
- {mito_ai-0.1.57.data → mito_ai-0.1.58.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_ui-react_dist_esm_index_mjs.4fcecd65bef9e9847609.js.map +0 -0
- {mito_ai-0.1.57.data → mito_ai-0.1.58.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_react-dom_client_js-node_modules_aws-amplify_ui-react_dist_styles_css.b43d4249e4d3dac9ad7b.js +0 -0
- {mito_ai-0.1.57.data → mito_ai-0.1.58.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_react-dom_client_js-node_modules_aws-amplify_ui-react_dist_styles_css.b43d4249e4d3dac9ad7b.js.map +0 -0
- {mito_ai-0.1.57.data → mito_ai-0.1.58.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_semver_index_js.3f6754ac5116d47de76b.js +0 -0
- {mito_ai-0.1.57.data → mito_ai-0.1.58.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_semver_index_js.3f6754ac5116d47de76b.js.map +0 -0
- {mito_ai-0.1.57.data → mito_ai-0.1.58.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_vscode-diff_dist_index_js.ea55f1f9346638aafbcf.js +0 -0
- {mito_ai-0.1.57.data → mito_ai-0.1.58.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_vscode-diff_dist_index_js.ea55f1f9346638aafbcf.js.map +0 -0
- {mito_ai-0.1.57.data → mito_ai-0.1.58.data}/data/share/jupyter/labextensions/mito_ai/themes/mito_ai/index.css +0 -0
- {mito_ai-0.1.57.data → mito_ai-0.1.58.data}/data/share/jupyter/labextensions/mito_ai/themes/mito_ai/index.js +0 -0
- {mito_ai-0.1.57.dist-info → mito_ai-0.1.58.dist-info}/WHEEL +0 -0
- {mito_ai-0.1.57.dist-info → mito_ai-0.1.58.dist-info}/entry_points.txt +0 -0
- {mito_ai-0.1.57.dist-info → mito_ai-0.1.58.dist-info}/licenses/LICENSE +0 -0
|
@@ -7417,6 +7417,164 @@ const getAppNameFromNotebookID = (notebookID) => {
|
|
|
7417
7417
|
};
|
|
7418
7418
|
|
|
7419
7419
|
|
|
7420
|
+
/***/ }),
|
|
7421
|
+
|
|
7422
|
+
/***/ "./lib/Extensions/ChartWizard/AddFieldButton.js":
|
|
7423
|
+
/*!******************************************************!*\
|
|
7424
|
+
!*** ./lib/Extensions/ChartWizard/AddFieldButton.js ***!
|
|
7425
|
+
\******************************************************/
|
|
7426
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
7427
|
+
|
|
7428
|
+
__webpack_require__.r(__webpack_exports__);
|
|
7429
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
7430
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
7431
|
+
/* harmony export */ });
|
|
7432
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
|
|
7433
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
7434
|
+
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @jupyterlab/apputils */ "webpack/sharing/consume/default/@jupyterlab/apputils");
|
|
7435
|
+
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__);
|
|
7436
|
+
/* harmony import */ var _utils_parser__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/parser */ "./lib/Extensions/ChartWizard/utils/parser.js");
|
|
7437
|
+
/* harmony import */ var _restAPI_RestAPI__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../restAPI/RestAPI */ "./lib/restAPI/RestAPI.js");
|
|
7438
|
+
/* harmony import */ var _utils_strings__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utils/strings */ "./lib/utils/strings.js");
|
|
7439
|
+
/* harmony import */ var _style_AddFieldButton_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../style/AddFieldButton.css */ "./style/AddFieldButton.css");
|
|
7440
|
+
/*
|
|
7441
|
+
* Copyright (c) Saga Inc.
|
|
7442
|
+
* Distributed under the terms of the GNU Affero General Public License v3.0 License.
|
|
7443
|
+
*/
|
|
7444
|
+
|
|
7445
|
+
|
|
7446
|
+
|
|
7447
|
+
|
|
7448
|
+
|
|
7449
|
+
|
|
7450
|
+
/**
|
|
7451
|
+
* Component that renders a button to add a new field to the chart configuration.
|
|
7452
|
+
* When clicked, prompts the user for a description and uses LLM to add the field.
|
|
7453
|
+
*/
|
|
7454
|
+
const AddFieldButton = ({ code, onFieldAdded, clearPendingUpdate, onLoadingStateChange }) => {
|
|
7455
|
+
/**
|
|
7456
|
+
* Handles adding a new field to the chart configuration.
|
|
7457
|
+
*/
|
|
7458
|
+
const handleAddField = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(async () => {
|
|
7459
|
+
if (!code) {
|
|
7460
|
+
_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.Notification.emit('No source code available', 'error', {
|
|
7461
|
+
autoClose: 3000
|
|
7462
|
+
});
|
|
7463
|
+
return;
|
|
7464
|
+
}
|
|
7465
|
+
// Create a component that manages its own input state
|
|
7466
|
+
// Use a ref to store the value so we can access it after dialog closes
|
|
7467
|
+
const inputValueRef = { current: '' };
|
|
7468
|
+
const InputDialogBody = () => {
|
|
7469
|
+
const [value, setValue] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)('');
|
|
7470
|
+
const textareaRef = react__WEBPACK_IMPORTED_MODULE_0___default().useRef(null);
|
|
7471
|
+
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
|
7472
|
+
// Focus the textarea when component mounts
|
|
7473
|
+
// Use a small timeout to ensure the dialog is fully rendered and focusable
|
|
7474
|
+
const timeoutId = setTimeout(() => {
|
|
7475
|
+
if (textareaRef.current) {
|
|
7476
|
+
textareaRef.current.focus();
|
|
7477
|
+
// Also select any existing text for better UX
|
|
7478
|
+
textareaRef.current.select();
|
|
7479
|
+
}
|
|
7480
|
+
}, 100);
|
|
7481
|
+
return () => clearTimeout(timeoutId);
|
|
7482
|
+
}, []);
|
|
7483
|
+
const handleChange = (e) => {
|
|
7484
|
+
const newValue = e.target.value;
|
|
7485
|
+
setValue(newValue);
|
|
7486
|
+
inputValueRef.current = newValue;
|
|
7487
|
+
};
|
|
7488
|
+
return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null,
|
|
7489
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", null, "Describe what field you would like to add to the chart configuration:"),
|
|
7490
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("textarea", { ref: textareaRef, value: value, onChange: handleChange, placeholder: "e.g., font size for the title, background color, grid visibility...", className: "add-field-dialog-textarea" })));
|
|
7491
|
+
};
|
|
7492
|
+
// Show dialog to get user description
|
|
7493
|
+
const result = await (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.showDialog)({
|
|
7494
|
+
title: 'Add New Field',
|
|
7495
|
+
body: react__WEBPACK_IMPORTED_MODULE_0___default().createElement(InputDialogBody, null),
|
|
7496
|
+
buttons: [
|
|
7497
|
+
_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.Dialog.cancelButton({ label: 'Cancel' }),
|
|
7498
|
+
_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.Dialog.okButton({ label: 'Add Field' })
|
|
7499
|
+
],
|
|
7500
|
+
defaultButton: 1
|
|
7501
|
+
});
|
|
7502
|
+
if (!result.button.accept) {
|
|
7503
|
+
return;
|
|
7504
|
+
}
|
|
7505
|
+
// Get the input value from the ref
|
|
7506
|
+
const description = inputValueRef.current.trim();
|
|
7507
|
+
if (!description) {
|
|
7508
|
+
_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.Notification.emit('Please provide a description of the field you want to add', 'warning', {
|
|
7509
|
+
autoClose: 3000
|
|
7510
|
+
});
|
|
7511
|
+
return;
|
|
7512
|
+
}
|
|
7513
|
+
// Log the field addition event with user input
|
|
7514
|
+
void (0,_restAPI_RestAPI__WEBPACK_IMPORTED_MODULE_3__.logEvent)('chart_wizard_add_chart_field', {
|
|
7515
|
+
user_input: description
|
|
7516
|
+
});
|
|
7517
|
+
// Clear any pending debounced updates
|
|
7518
|
+
clearPendingUpdate();
|
|
7519
|
+
onLoadingStateChange(true);
|
|
7520
|
+
try {
|
|
7521
|
+
// Get existing variable names
|
|
7522
|
+
const parsed = (0,_utils_parser__WEBPACK_IMPORTED_MODULE_4__.parseChartConfig)(code);
|
|
7523
|
+
const existingVariables = parsed ? parsed.variables.map(v => v.name) : [];
|
|
7524
|
+
const response = await (0,_restAPI_RestAPI__WEBPACK_IMPORTED_MODULE_3__.addChartField)(code, description, existingVariables);
|
|
7525
|
+
if (response.updated_code) {
|
|
7526
|
+
// Check if the response contains a code block
|
|
7527
|
+
// If no code block is found, the AI couldn't add the field
|
|
7528
|
+
const hasCodeBlock = response.updated_code.includes(_utils_strings__WEBPACK_IMPORTED_MODULE_5__.PYTHON_CODE_BLOCK_START_WITH_NEW_LINE);
|
|
7529
|
+
if (!hasCodeBlock) {
|
|
7530
|
+
// AI couldn't add the field and didn't return a code block
|
|
7531
|
+
console.log('AI response does not contain a code block - field addition was not possible.');
|
|
7532
|
+
_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.Notification.emit('Unable to add the requested field. Please try a different description or ensure your request is clear and applicable to chart configuration.', 'warning', {
|
|
7533
|
+
autoClose: 5000
|
|
7534
|
+
});
|
|
7535
|
+
return;
|
|
7536
|
+
}
|
|
7537
|
+
// Extract code from markdown code blocks if present
|
|
7538
|
+
const extractedCode = (0,_utils_strings__WEBPACK_IMPORTED_MODULE_5__.removeMarkdownCodeFormatting)(response.updated_code);
|
|
7539
|
+
// Validate that extracted code is not empty
|
|
7540
|
+
if (!extractedCode || extractedCode.trim().length === 0) {
|
|
7541
|
+
console.error('Error: Extracted code is empty. Cannot update notebook cell.');
|
|
7542
|
+
_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.Notification.emit('Failed to add field: The updated code is empty. Please try again.', 'error', {
|
|
7543
|
+
autoClose: 5000
|
|
7544
|
+
});
|
|
7545
|
+
return;
|
|
7546
|
+
}
|
|
7547
|
+
// Notify parent component of the updated code
|
|
7548
|
+
onFieldAdded(extractedCode);
|
|
7549
|
+
_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.Notification.emit('Field added successfully!', 'success', {
|
|
7550
|
+
autoClose: 3000
|
|
7551
|
+
});
|
|
7552
|
+
}
|
|
7553
|
+
else {
|
|
7554
|
+
// Handle case where updated_code is missing, null, or empty
|
|
7555
|
+
console.error('Error: No updated code returned from server.');
|
|
7556
|
+
_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.Notification.emit('Failed to add field: The server did not return updated code. Please try again.', 'error', {
|
|
7557
|
+
autoClose: 5000
|
|
7558
|
+
});
|
|
7559
|
+
}
|
|
7560
|
+
}
|
|
7561
|
+
catch (error) {
|
|
7562
|
+
console.error('Error adding field:', error);
|
|
7563
|
+
const errorMessage = error instanceof Error ? error.message : 'An unknown error occurred';
|
|
7564
|
+
_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.Notification.emit(`Failed to add field: ${errorMessage}. Please try again.`, 'error', {
|
|
7565
|
+
autoClose: 5000
|
|
7566
|
+
});
|
|
7567
|
+
}
|
|
7568
|
+
finally {
|
|
7569
|
+
onLoadingStateChange(false);
|
|
7570
|
+
}
|
|
7571
|
+
}, [code, onFieldAdded, clearPendingUpdate, onLoadingStateChange]);
|
|
7572
|
+
return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "add-field-container" },
|
|
7573
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", { className: "button-base button-purple add-field-button", onClick: handleAddField, type: "button" }, "+ Add New Field")));
|
|
7574
|
+
};
|
|
7575
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AddFieldButton);
|
|
7576
|
+
|
|
7577
|
+
|
|
7420
7578
|
/***/ }),
|
|
7421
7579
|
|
|
7422
7580
|
/***/ "./lib/Extensions/ChartWizard/ChartWizardPlugin.js":
|
|
@@ -7449,6 +7607,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
7449
7607
|
/* harmony import */ var _components_TextAndIconButton__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../components/TextAndIconButton */ "./lib/components/TextAndIconButton.js");
|
|
7450
7608
|
/* harmony import */ var _icons_MagicWand__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../icons/MagicWand */ "./lib/icons/MagicWand.js");
|
|
7451
7609
|
/* harmony import */ var _restAPI_RestAPI__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../restAPI/RestAPI */ "./lib/restAPI/RestAPI.js");
|
|
7610
|
+
/* harmony import */ var _utils_notebook__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../utils/notebook */ "./lib/utils/notebook.js");
|
|
7452
7611
|
/* harmony import */ var _style_ChartWizardPlugin_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../style/ChartWizardPlugin.css */ "./style/ChartWizardPlugin.css");
|
|
7453
7612
|
/*
|
|
7454
7613
|
* Copyright (c) Saga Inc.
|
|
@@ -7468,6 +7627,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
7468
7627
|
|
|
7469
7628
|
|
|
7470
7629
|
|
|
7630
|
+
|
|
7471
7631
|
const ChartWizardButton = ({ onButtonClick }) => {
|
|
7472
7632
|
return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null,
|
|
7473
7633
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_TextAndIconButton__WEBPACK_IMPORTED_MODULE_9__["default"], { icon: _icons_MagicWand__WEBPACK_IMPORTED_MODULE_10__["default"], text: "Chart Wizard", title: "Chart Wizard", onClick: onButtonClick, variant: 'purple', width: 'fit-contents', iconPosition: 'left' })));
|
|
@@ -7519,7 +7679,7 @@ const ChartWizardPlugin = {
|
|
|
7519
7679
|
app.commands.addCommand(_commands__WEBPACK_IMPORTED_MODULE_12__.COMMAND_MITO_AI_OPEN_CHART_WIZARD, {
|
|
7520
7680
|
label: 'Open Chart Wizard',
|
|
7521
7681
|
execute: () => {
|
|
7522
|
-
void (0,_restAPI_RestAPI__WEBPACK_IMPORTED_MODULE_13__.logEvent)('
|
|
7682
|
+
void (0,_restAPI_RestAPI__WEBPACK_IMPORTED_MODULE_13__.logEvent)('chart_wizard_opened', { source: 'command_palette' });
|
|
7523
7683
|
openChartWizard();
|
|
7524
7684
|
}
|
|
7525
7685
|
});
|
|
@@ -7551,11 +7711,12 @@ const ChartWizardPlugin = {
|
|
|
7551
7711
|
* A widget that extends the default ImageRenderer for matplotlib charts.
|
|
7552
7712
|
*/
|
|
7553
7713
|
class AugmentedImageRenderer extends _lumino_widgets__WEBPACK_IMPORTED_MODULE_7__.Widget {
|
|
7554
|
-
constructor(
|
|
7714
|
+
constructor(app, originalRenderer, notebookTracker, openChartWizard) {
|
|
7555
7715
|
super();
|
|
7556
7716
|
this.reactRoot = null;
|
|
7557
7717
|
this.originalRenderer = originalRenderer;
|
|
7558
7718
|
this.notebookTracker = notebookTracker;
|
|
7719
|
+
this.app = app;
|
|
7559
7720
|
this.openChartWizard = openChartWizard;
|
|
7560
7721
|
}
|
|
7561
7722
|
/**
|
|
@@ -7594,7 +7755,7 @@ class AugmentedImageRenderer extends _lumino_widgets__WEBPACK_IMPORTED_MODULE_7_
|
|
|
7594
7755
|
Extracts chart data and source code, then opens the Chart Wizard panel.
|
|
7595
7756
|
*/
|
|
7596
7757
|
handleButtonClick(_model) {
|
|
7597
|
-
void (0,_restAPI_RestAPI__WEBPACK_IMPORTED_MODULE_13__.logEvent)('
|
|
7758
|
+
void (0,_restAPI_RestAPI__WEBPACK_IMPORTED_MODULE_13__.logEvent)('chart_wizard_opened', { source: 'chart_output_button' });
|
|
7598
7759
|
// Get the notebook panel
|
|
7599
7760
|
const notebookPanel = this.notebookTracker.currentWidget;
|
|
7600
7761
|
if (!notebookPanel) {
|
|
@@ -7620,8 +7781,20 @@ class AugmentedImageRenderer extends _lumino_widgets__WEBPACK_IMPORTED_MODULE_7_
|
|
|
7620
7781
|
}
|
|
7621
7782
|
const sourceCode = cellWidget.model.sharedModel.source;
|
|
7622
7783
|
const cellId = cellWidget.model.id;
|
|
7784
|
+
// Set the cell as active before collapsing and scrolling
|
|
7785
|
+
(0,_utils_notebook__WEBPACK_IMPORTED_MODULE_14__.setActiveCellByIDInNotebookPanel)(notebookPanel, cellId);
|
|
7786
|
+
// Collapse the code cell when opening the chart wizard
|
|
7787
|
+
cellWidget.inputHidden = true;
|
|
7788
|
+
// Scroll to the top of the cell
|
|
7789
|
+
void notebookPanel.content.scrollToCell(cellWidget, 'start');
|
|
7623
7790
|
// Open the Chart Wizard with the extracted data
|
|
7624
|
-
this.openChartWizard({
|
|
7791
|
+
this.openChartWizard({
|
|
7792
|
+
sourceCode,
|
|
7793
|
+
cellId,
|
|
7794
|
+
notebookTracker: this.notebookTracker,
|
|
7795
|
+
notebookPanelId: notebookPanel.id,
|
|
7796
|
+
app: this.app
|
|
7797
|
+
});
|
|
7625
7798
|
}
|
|
7626
7799
|
}
|
|
7627
7800
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ChartWizardPlugin);
|
|
@@ -7643,18 +7816,20 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
7643
7816
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
7644
7817
|
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @jupyterlab/apputils */ "webpack/sharing/consume/default/@jupyterlab/apputils");
|
|
7645
7818
|
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__);
|
|
7646
|
-
/* harmony import */ var
|
|
7647
|
-
/* harmony import */ var
|
|
7648
|
-
/* harmony import */ var
|
|
7649
|
-
/* harmony import */ var
|
|
7650
|
-
/* harmony import */ var
|
|
7651
|
-
/* harmony import */ var _inputs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./inputs */ "./lib/Extensions/ChartWizard/inputs/
|
|
7652
|
-
/* harmony import */ var _inputs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./inputs */ "./lib/Extensions/ChartWizard/inputs/
|
|
7653
|
-
/* harmony import */ var _inputs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./inputs */ "./lib/Extensions/ChartWizard/inputs/
|
|
7654
|
-
/* harmony import */ var _inputs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./inputs */ "./lib/Extensions/ChartWizard/inputs/
|
|
7655
|
-
/* harmony import */ var _inputs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./inputs */ "./lib/Extensions/ChartWizard/inputs/
|
|
7656
|
-
/* harmony import */ var
|
|
7657
|
-
/* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./hooks */ "./lib/Extensions/ChartWizard/hooks/
|
|
7819
|
+
/* harmony import */ var _utils_parser__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils/parser */ "./lib/Extensions/ChartWizard/utils/parser.js");
|
|
7820
|
+
/* harmony import */ var _restAPI_RestAPI__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../restAPI/RestAPI */ "./lib/restAPI/RestAPI.js");
|
|
7821
|
+
/* harmony import */ var _utils_strings__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../utils/strings */ "./lib/utils/strings.js");
|
|
7822
|
+
/* harmony import */ var _components_LoadingDots__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../components/LoadingDots */ "./lib/components/LoadingDots.js");
|
|
7823
|
+
/* harmony import */ var _AddFieldButton__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./AddFieldButton */ "./lib/Extensions/ChartWizard/AddFieldButton.js");
|
|
7824
|
+
/* harmony import */ var _inputs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./inputs */ "./lib/Extensions/ChartWizard/inputs/BooleanInputRow.js");
|
|
7825
|
+
/* harmony import */ var _inputs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./inputs */ "./lib/Extensions/ChartWizard/inputs/TupleInputRow.js");
|
|
7826
|
+
/* harmony import */ var _inputs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./inputs */ "./lib/Extensions/ChartWizard/inputs/NumberInputRow.js");
|
|
7827
|
+
/* harmony import */ var _inputs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./inputs */ "./lib/Extensions/ChartWizard/inputs/utils.js");
|
|
7828
|
+
/* harmony import */ var _inputs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./inputs */ "./lib/Extensions/ChartWizard/inputs/ColorInputRow.js");
|
|
7829
|
+
/* harmony import */ var _inputs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./inputs */ "./lib/Extensions/ChartWizard/inputs/StringInputRow.js");
|
|
7830
|
+
/* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./hooks */ "./lib/Extensions/ChartWizard/hooks/useChartConfig.js");
|
|
7831
|
+
/* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./hooks */ "./lib/Extensions/ChartWizard/hooks/useDebouncedNotebookUpdate.js");
|
|
7832
|
+
/* harmony import */ var _utils_notebook__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../utils/notebook */ "./lib/utils/notebook.js");
|
|
7658
7833
|
/* harmony import */ var _style_ChartWizardWidget_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../style/ChartWizardWidget.css */ "./style/ChartWizardWidget.css");
|
|
7659
7834
|
/*
|
|
7660
7835
|
* Copyright (c) Saga Inc.
|
|
@@ -7669,6 +7844,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
7669
7844
|
|
|
7670
7845
|
|
|
7671
7846
|
|
|
7847
|
+
|
|
7848
|
+
|
|
7672
7849
|
/**
|
|
7673
7850
|
* Formats a variable name into a human-readable label.
|
|
7674
7851
|
* Converts snake_case to Title Case (e.g., "figure_size" -> "Figure Size").
|
|
@@ -7681,18 +7858,73 @@ const formatVariableLabel = (variableName) => {
|
|
|
7681
7858
|
};
|
|
7682
7859
|
const ChartWizardContent = ({ chartData }) => {
|
|
7683
7860
|
const [isConverting, setIsConverting] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
|
|
7861
|
+
const [isAddingField, setIsAddingField] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
|
|
7684
7862
|
const [currentSourceCode, setCurrentSourceCode] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
|
|
7863
|
+
const widgetRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
|
|
7864
|
+
const [overlayHeight, setOverlayHeight] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0);
|
|
7865
|
+
const [isActiveCellMismatch, setIsActiveCellMismatch] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
|
|
7685
7866
|
// Reset currentSourceCode when switching to a different chart
|
|
7686
7867
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
|
7687
7868
|
setCurrentSourceCode(null);
|
|
7688
7869
|
}, [chartData === null || chartData === void 0 ? void 0 : chartData.sourceCode]);
|
|
7870
|
+
// Track active cell changes and compare with chart cell
|
|
7871
|
+
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
|
7872
|
+
if (!chartData) {
|
|
7873
|
+
setIsActiveCellMismatch(false);
|
|
7874
|
+
return;
|
|
7875
|
+
}
|
|
7876
|
+
const checkActiveCell = () => {
|
|
7877
|
+
const activeCellId = (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_3__.getActiveCellID)(chartData.notebookTracker);
|
|
7878
|
+
const chartCellId = chartData.cellId;
|
|
7879
|
+
// Show warning if active cell exists and doesn't match the chart cell
|
|
7880
|
+
setIsActiveCellMismatch(activeCellId !== undefined && activeCellId !== chartCellId);
|
|
7881
|
+
};
|
|
7882
|
+
// Initial check
|
|
7883
|
+
checkActiveCell();
|
|
7884
|
+
// Listen to active cell changes
|
|
7885
|
+
chartData.notebookTracker.activeCellChanged.connect(checkActiveCell);
|
|
7886
|
+
return () => {
|
|
7887
|
+
chartData.notebookTracker.activeCellChanged.disconnect(checkActiveCell);
|
|
7888
|
+
};
|
|
7889
|
+
}, [chartData]);
|
|
7890
|
+
// Update overlay height to cover full scrollable content
|
|
7891
|
+
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
|
7892
|
+
if (!isAddingField) {
|
|
7893
|
+
setOverlayHeight(0);
|
|
7894
|
+
return;
|
|
7895
|
+
}
|
|
7896
|
+
const updateOverlayHeight = () => {
|
|
7897
|
+
if (widgetRef.current) {
|
|
7898
|
+
// Use scrollHeight to get the full scrollable content height
|
|
7899
|
+
setOverlayHeight(widgetRef.current.scrollHeight);
|
|
7900
|
+
}
|
|
7901
|
+
};
|
|
7902
|
+
// Initial update
|
|
7903
|
+
updateOverlayHeight();
|
|
7904
|
+
// Use ResizeObserver to watch for content size changes
|
|
7905
|
+
let resizeObserver = null;
|
|
7906
|
+
if (widgetRef.current && typeof ResizeObserver !== 'undefined') {
|
|
7907
|
+
resizeObserver = new ResizeObserver(() => {
|
|
7908
|
+
updateOverlayHeight();
|
|
7909
|
+
});
|
|
7910
|
+
resizeObserver.observe(widgetRef.current);
|
|
7911
|
+
}
|
|
7912
|
+
// Fallback: Update on window resize
|
|
7913
|
+
window.addEventListener('resize', updateOverlayHeight);
|
|
7914
|
+
return () => {
|
|
7915
|
+
if (resizeObserver) {
|
|
7916
|
+
resizeObserver.disconnect();
|
|
7917
|
+
}
|
|
7918
|
+
window.removeEventListener('resize', updateOverlayHeight);
|
|
7919
|
+
};
|
|
7920
|
+
}, [isAddingField]);
|
|
7689
7921
|
// Use custom hook for chart config management
|
|
7690
|
-
const { configVariables, setConfigVariables, hasConfig } = (0,
|
|
7922
|
+
const { configVariables, setConfigVariables, hasConfig } = (0,_hooks__WEBPACK_IMPORTED_MODULE_4__.useChartConfig)({
|
|
7691
7923
|
sourceCode: chartData === null || chartData === void 0 ? void 0 : chartData.sourceCode,
|
|
7692
7924
|
currentSourceCode,
|
|
7693
7925
|
});
|
|
7694
7926
|
// Use custom hook for debounced notebook updates
|
|
7695
|
-
const { updateNotebookCell, scheduleUpdate, clearPendingUpdate } = (0,
|
|
7927
|
+
const { updateNotebookCell, scheduleUpdate, clearPendingUpdate } = (0,_hooks__WEBPACK_IMPORTED_MODULE_5__.useDebouncedNotebookUpdate)({
|
|
7696
7928
|
chartData,
|
|
7697
7929
|
debounceDelay: 500,
|
|
7698
7930
|
});
|
|
@@ -7707,7 +7939,7 @@ const ChartWizardContent = ({ chartData }) => {
|
|
|
7707
7939
|
const updated = configVariables.map((v) => v.name === variableName ? { ...v, value: newValue } : v);
|
|
7708
7940
|
setConfigVariables(updated);
|
|
7709
7941
|
// Update the source code
|
|
7710
|
-
const updatedCode = (0,
|
|
7942
|
+
const updatedCode = (0,_utils_parser__WEBPACK_IMPORTED_MODULE_6__.updateChartConfig)(codeToUse, updated);
|
|
7711
7943
|
setCurrentSourceCode(updatedCode);
|
|
7712
7944
|
// Schedule debounced notebook update
|
|
7713
7945
|
scheduleUpdate(updatedCode);
|
|
@@ -7716,7 +7948,7 @@ const ChartWizardContent = ({ chartData }) => {
|
|
|
7716
7948
|
* Handles chart conversion from matplotlib to Chart Wizard format.
|
|
7717
7949
|
*/
|
|
7718
7950
|
const handleConvertChart = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(async () => {
|
|
7719
|
-
void (0,
|
|
7951
|
+
void (0,_restAPI_RestAPI__WEBPACK_IMPORTED_MODULE_7__.logEvent)('chart_wizard_convert_chart');
|
|
7720
7952
|
if (!(chartData === null || chartData === void 0 ? void 0 : chartData.sourceCode)) {
|
|
7721
7953
|
console.error('No source code available');
|
|
7722
7954
|
return;
|
|
@@ -7725,10 +7957,10 @@ const ChartWizardContent = ({ chartData }) => {
|
|
|
7725
7957
|
clearPendingUpdate();
|
|
7726
7958
|
setIsConverting(true);
|
|
7727
7959
|
try {
|
|
7728
|
-
const response = await (0,
|
|
7960
|
+
const response = await (0,_restAPI_RestAPI__WEBPACK_IMPORTED_MODULE_7__.convertChartCode)(chartData.sourceCode);
|
|
7729
7961
|
if (response.converted_code) {
|
|
7730
7962
|
// Extract code from markdown code blocks if present
|
|
7731
|
-
const extractedCode = (0,
|
|
7963
|
+
const extractedCode = (0,_utils_strings__WEBPACK_IMPORTED_MODULE_8__.removeMarkdownCodeFormatting)(response.converted_code);
|
|
7732
7964
|
// Validate that extracted code is not empty to prevent deleting user's code
|
|
7733
7965
|
if (!extractedCode || extractedCode.trim().length === 0) {
|
|
7734
7966
|
console.error('Error: Extracted code is empty. Cannot update notebook cell.');
|
|
@@ -7754,6 +7986,15 @@ const ChartWizardContent = ({ chartData }) => {
|
|
|
7754
7986
|
setIsConverting(false);
|
|
7755
7987
|
}
|
|
7756
7988
|
}, [chartData === null || chartData === void 0 ? void 0 : chartData.sourceCode, clearPendingUpdate, updateNotebookCell]);
|
|
7989
|
+
/**
|
|
7990
|
+
* Handles when a new field is added via the AddFieldButton component.
|
|
7991
|
+
*/
|
|
7992
|
+
const handleFieldAdded = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((updatedCode) => {
|
|
7993
|
+
// Update current source code so the useEffect will parse it
|
|
7994
|
+
setCurrentSourceCode(updatedCode);
|
|
7995
|
+
// Update the cell with the updated code
|
|
7996
|
+
updateNotebookCell(updatedCode);
|
|
7997
|
+
}, [updateNotebookCell]);
|
|
7757
7998
|
/**
|
|
7758
7999
|
* Renders the appropriate input field component based on variable type.
|
|
7759
8000
|
*/
|
|
@@ -7766,22 +8007,22 @@ const ChartWizardContent = ({ chartData }) => {
|
|
|
7766
8007
|
};
|
|
7767
8008
|
switch (variable.type) {
|
|
7768
8009
|
case 'boolean':
|
|
7769
|
-
return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(
|
|
8010
|
+
return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_inputs__WEBPACK_IMPORTED_MODULE_9__.BooleanInputRow, { key: variable.name, ...commonProps });
|
|
7770
8011
|
case 'tuple':
|
|
7771
|
-
return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(
|
|
8012
|
+
return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_inputs__WEBPACK_IMPORTED_MODULE_10__.TupleInputRow, { key: variable.name, ...commonProps });
|
|
7772
8013
|
case 'number':
|
|
7773
|
-
return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(
|
|
8014
|
+
return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_inputs__WEBPACK_IMPORTED_MODULE_11__.NumberInputRow, { key: variable.name, ...commonProps });
|
|
7774
8015
|
case 'string': {
|
|
7775
8016
|
// String input - check if it's a hex color
|
|
7776
8017
|
const stringValue = variable.value;
|
|
7777
|
-
const isColor = (0,
|
|
8018
|
+
const isColor = (0,_inputs__WEBPACK_IMPORTED_MODULE_12__.isHexColor)(stringValue);
|
|
7778
8019
|
if (isColor) {
|
|
7779
|
-
return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(
|
|
8020
|
+
return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_inputs__WEBPACK_IMPORTED_MODULE_13__.ColorInputRow, { key: variable.name, ...commonProps });
|
|
7780
8021
|
}
|
|
7781
|
-
return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(
|
|
8022
|
+
return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_inputs__WEBPACK_IMPORTED_MODULE_14__.StringInputRow, { key: variable.name, ...commonProps });
|
|
7782
8023
|
}
|
|
7783
8024
|
default:
|
|
7784
|
-
return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(
|
|
8025
|
+
return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_inputs__WEBPACK_IMPORTED_MODULE_14__.StringInputRow, { key: variable.name, ...commonProps });
|
|
7785
8026
|
}
|
|
7786
8027
|
}, [handleVariableChange]);
|
|
7787
8028
|
// Memoize input fields to prevent unnecessary re-renders
|
|
@@ -7792,11 +8033,35 @@ const ChartWizardContent = ({ chartData }) => {
|
|
|
7792
8033
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("h2", null, "Chart Wizard"),
|
|
7793
8034
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", null, "Click the Chart Wizard button on a matplotlib chart to get started.")));
|
|
7794
8035
|
}
|
|
7795
|
-
return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "chart-wizard-widget" },
|
|
8036
|
+
return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "chart-wizard-widget", ref: widgetRef, style: { position: 'relative' } },
|
|
7796
8037
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("h2", null, "Chart Wizard"),
|
|
8038
|
+
isActiveCellMismatch && (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "chart-wizard-warning" },
|
|
8039
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "chart-wizard-warning-content" }, "The active cell is no longer the chart cell. Changes may not be applied correctly."),
|
|
8040
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", { className: "chart-wizard-warning-button", onClick: () => {
|
|
8041
|
+
var _a;
|
|
8042
|
+
if (chartData) {
|
|
8043
|
+
// Find the notebook panel by ID
|
|
8044
|
+
const notebookPanel = chartData.notebookTracker.find(panel => panel.id === chartData.notebookPanelId);
|
|
8045
|
+
if (notebookPanel) {
|
|
8046
|
+
// Activate the notebook panel if it's not the current one
|
|
8047
|
+
if (((_a = chartData.notebookTracker.currentWidget) === null || _a === void 0 ? void 0 : _a.id) !== notebookPanel.id) {
|
|
8048
|
+
chartData.app.shell.activateById(notebookPanel.id);
|
|
8049
|
+
// Wait a bit for the notebook to activate before scrolling
|
|
8050
|
+
setTimeout(() => {
|
|
8051
|
+
(0,_utils_notebook__WEBPACK_IMPORTED_MODULE_3__.scrollToCell)(notebookPanel, chartData.cellId, undefined, 'start');
|
|
8052
|
+
}, 100);
|
|
8053
|
+
}
|
|
8054
|
+
else {
|
|
8055
|
+
// Navigate to and scroll to the chart cell
|
|
8056
|
+
(0,_utils_notebook__WEBPACK_IMPORTED_MODULE_3__.scrollToCell)(notebookPanel, chartData.cellId, undefined, 'start');
|
|
8057
|
+
}
|
|
8058
|
+
}
|
|
8059
|
+
}
|
|
8060
|
+
}, type: "button" }, "Go to Chart Cell"))),
|
|
7797
8061
|
hasConfig ? (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "chart-wizard-config-container" },
|
|
7798
8062
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", { className: "chart-wizard-config-description" }, "Edit values below to customize your chart. Changes will be reflected in the notebook."),
|
|
7799
|
-
inputFields
|
|
8063
|
+
inputFields,
|
|
8064
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_AddFieldButton__WEBPACK_IMPORTED_MODULE_15__["default"], { code: currentSourceCode || (chartData === null || chartData === void 0 ? void 0 : chartData.sourceCode) || null, onFieldAdded: handleFieldAdded, clearPendingUpdate: clearPendingUpdate, onLoadingStateChange: setIsAddingField }))) : (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "chart-wizard-no-config" },
|
|
7800
8065
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", null,
|
|
7801
8066
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("strong", null, "This chart isn't ready for Chart Wizard yet."),
|
|
7802
8067
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("br", null),
|
|
@@ -7805,7 +8070,13 @@ const ChartWizardContent = ({ chartData }) => {
|
|
|
7805
8070
|
"Converting",
|
|
7806
8071
|
' ',
|
|
7807
8072
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", { className: "chart-wizard-loading-dots" },
|
|
7808
|
-
react__WEBPACK_IMPORTED_MODULE_0___default().createElement(
|
|
8073
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_LoadingDots__WEBPACK_IMPORTED_MODULE_16__["default"], null)))) : ('Convert')))),
|
|
8074
|
+
isAddingField && (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "chart-wizard-overlay", style: { height: overlayHeight > 0 ? `${overlayHeight}px` : '100%' } },
|
|
8075
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "chart-wizard-overlay-text" },
|
|
8076
|
+
"Adding new field",
|
|
8077
|
+
' ',
|
|
8078
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", { className: "chart-wizard-loading-dots" },
|
|
8079
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_LoadingDots__WEBPACK_IMPORTED_MODULE_16__["default"], null)))))));
|
|
7809
8080
|
};
|
|
7810
8081
|
class ChartWizardWidget extends _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.ReactWidget {
|
|
7811
8082
|
constructor() {
|
|
@@ -7910,14 +8181,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
7910
8181
|
*/
|
|
7911
8182
|
const useDebouncedNotebookUpdate = ({ chartData, debounceDelay = 500, }) => {
|
|
7912
8183
|
const executeTimeoutRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
|
|
7913
|
-
// Cleanup timeout on unmount
|
|
8184
|
+
// Cleanup timeout on unmount or when chartData changes
|
|
7914
8185
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
|
7915
8186
|
return () => {
|
|
7916
8187
|
if (executeTimeoutRef.current) {
|
|
7917
8188
|
clearTimeout(executeTimeoutRef.current);
|
|
7918
8189
|
}
|
|
7919
8190
|
};
|
|
7920
|
-
}, []);
|
|
8191
|
+
}, [chartData]);
|
|
7921
8192
|
const updateNotebookCell = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((updatedCode) => {
|
|
7922
8193
|
var _a;
|
|
7923
8194
|
if (!chartData)
|
|
@@ -12386,47 +12657,124 @@ const MODEL_MAPPINGS = [
|
|
|
12386
12657
|
complexityHandling: 'High'
|
|
12387
12658
|
}
|
|
12388
12659
|
];
|
|
12389
|
-
|
|
12660
|
+
// Removed ALL_MODEL_DISPLAY_NAMES - now using availableModels from backend
|
|
12390
12661
|
// Maximum length for displayed model name before truncating
|
|
12391
12662
|
const DEFAULT_MODEL = _utils_models__WEBPACK_IMPORTED_MODULE_3__.CLAUDE_HAIKU_DISPLAY_NAME;
|
|
12392
12663
|
const ModelSelector = ({ onConfigChange }) => {
|
|
12393
12664
|
const [selectedModel, setSelectedModel] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(DEFAULT_MODEL);
|
|
12394
12665
|
const [isOpen, setIsOpen] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
|
|
12395
12666
|
const [hoveredModel, setHoveredModel] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
|
|
12667
|
+
const [availableModels, setAvailableModels] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]);
|
|
12668
|
+
const [isLoadingModels, setIsLoadingModels] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(true);
|
|
12396
12669
|
const dropdownRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
|
|
12397
|
-
//
|
|
12670
|
+
// Fetch available models from backend on mount
|
|
12398
12671
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
|
12399
|
-
|
|
12400
|
-
|
|
12401
|
-
let fullModelName;
|
|
12402
|
-
let displayName;
|
|
12403
|
-
if (storedConfig) {
|
|
12672
|
+
const fetchModels = async () => {
|
|
12673
|
+
var _a, _b;
|
|
12404
12674
|
try {
|
|
12405
|
-
|
|
12406
|
-
|
|
12407
|
-
|
|
12675
|
+
setIsLoadingModels(true);
|
|
12676
|
+
const models = await (0,_utils_models__WEBPACK_IMPORTED_MODULE_3__.getAvailableModels)();
|
|
12677
|
+
setAvailableModels(models);
|
|
12678
|
+
// Load config from localStorage and validate against available models
|
|
12679
|
+
const storedConfig = localStorage.getItem('llmModelConfig');
|
|
12680
|
+
let fullModelName;
|
|
12681
|
+
let displayName;
|
|
12682
|
+
if (storedConfig) {
|
|
12683
|
+
try {
|
|
12684
|
+
const parsedConfig = JSON.parse(storedConfig);
|
|
12685
|
+
const storedModel = parsedConfig.model;
|
|
12686
|
+
if (storedModel && typeof storedModel === 'string') {
|
|
12687
|
+
fullModelName = storedModel;
|
|
12688
|
+
// Check if model is in available models list
|
|
12689
|
+
if (models.includes(fullModelName)) {
|
|
12690
|
+
// Check if it's a LiteLLM model (has provider prefix)
|
|
12691
|
+
if (fullModelName.includes('/')) {
|
|
12692
|
+
// LiteLLM model - use model name directly as display name
|
|
12693
|
+
displayName = fullModelName;
|
|
12694
|
+
}
|
|
12695
|
+
else {
|
|
12696
|
+
// Standard model - find display name from MODEL_MAPPINGS
|
|
12697
|
+
displayName = (_a = MODEL_MAPPINGS.find(m => m.fullName === fullModelName)) === null || _a === void 0 ? void 0 : _a.displayName;
|
|
12698
|
+
}
|
|
12699
|
+
}
|
|
12700
|
+
}
|
|
12701
|
+
}
|
|
12702
|
+
catch (e) {
|
|
12703
|
+
console.error('Failed to parse stored LLM config', e);
|
|
12704
|
+
}
|
|
12705
|
+
}
|
|
12706
|
+
// Fallback to default model or first available model if not found or invalid
|
|
12707
|
+
if (!fullModelName || !displayName || (fullModelName && !models.includes(fullModelName))) {
|
|
12708
|
+
if (models.length > 0) {
|
|
12709
|
+
// First, try to use the default model if it's available
|
|
12710
|
+
const defaultMapping = MODEL_MAPPINGS.find(m => m.displayName === DEFAULT_MODEL);
|
|
12711
|
+
if (defaultMapping && models.includes(defaultMapping.fullName)) {
|
|
12712
|
+
fullModelName = defaultMapping.fullName;
|
|
12713
|
+
displayName = defaultMapping.displayName;
|
|
12714
|
+
}
|
|
12715
|
+
else {
|
|
12716
|
+
// Fallback to first available model
|
|
12717
|
+
const firstModel = models[0];
|
|
12718
|
+
fullModelName = firstModel;
|
|
12719
|
+
// Check if it's a LiteLLM model
|
|
12720
|
+
if (firstModel && firstModel.includes('/')) {
|
|
12721
|
+
displayName = firstModel;
|
|
12722
|
+
}
|
|
12723
|
+
else {
|
|
12724
|
+
displayName = ((_b = MODEL_MAPPINGS.find(m => m.fullName === firstModel)) === null || _b === void 0 ? void 0 : _b.displayName) || firstModel;
|
|
12725
|
+
}
|
|
12726
|
+
}
|
|
12727
|
+
}
|
|
12728
|
+
else {
|
|
12729
|
+
// Fallback to default if no models available
|
|
12730
|
+
const defaultMapping = MODEL_MAPPINGS.find(m => m.displayName === DEFAULT_MODEL) || MODEL_MAPPINGS[0];
|
|
12731
|
+
if (defaultMapping) {
|
|
12732
|
+
fullModelName = defaultMapping.fullName;
|
|
12733
|
+
displayName = defaultMapping.displayName;
|
|
12734
|
+
}
|
|
12735
|
+
else {
|
|
12736
|
+
// Ultimate fallback
|
|
12737
|
+
fullModelName = _utils_models__WEBPACK_IMPORTED_MODULE_3__.GPT_4_1_MODEL_NAME;
|
|
12738
|
+
displayName = _utils_models__WEBPACK_IMPORTED_MODULE_3__.GPT_4_1_DISPLAY_NAME;
|
|
12739
|
+
}
|
|
12740
|
+
}
|
|
12741
|
+
}
|
|
12742
|
+
if (displayName && fullModelName) {
|
|
12743
|
+
setSelectedModel(displayName);
|
|
12744
|
+
onConfigChange({ model: fullModelName });
|
|
12745
|
+
}
|
|
12408
12746
|
}
|
|
12409
|
-
catch (
|
|
12410
|
-
console.error('Failed to
|
|
12747
|
+
catch (error) {
|
|
12748
|
+
console.error('Failed to fetch available models:', error);
|
|
12749
|
+
// Fallback to default models
|
|
12750
|
+
const defaultMapping = MODEL_MAPPINGS.find(m => m.displayName === DEFAULT_MODEL) || MODEL_MAPPINGS[0];
|
|
12751
|
+
setSelectedModel(defaultMapping.displayName);
|
|
12752
|
+
onConfigChange({ model: defaultMapping.fullName });
|
|
12411
12753
|
}
|
|
12412
|
-
|
|
12413
|
-
|
|
12414
|
-
|
|
12415
|
-
|
|
12416
|
-
|
|
12417
|
-
}
|
|
12418
|
-
if (!fullModelName || !displayName) {
|
|
12419
|
-
fullModelName = defaultMapping.fullName;
|
|
12420
|
-
displayName = defaultMapping.displayName;
|
|
12421
|
-
}
|
|
12422
|
-
setSelectedModel(displayName);
|
|
12423
|
-
onConfigChange({ model: fullModelName });
|
|
12754
|
+
finally {
|
|
12755
|
+
setIsLoadingModels(false);
|
|
12756
|
+
}
|
|
12757
|
+
};
|
|
12758
|
+
void fetchModels();
|
|
12424
12759
|
}, [onConfigChange]);
|
|
12425
|
-
const handleModelChange = (
|
|
12760
|
+
const handleModelChange = (modelName) => {
|
|
12426
12761
|
var _a;
|
|
12427
|
-
|
|
12762
|
+
if (!modelName) {
|
|
12763
|
+
return;
|
|
12764
|
+
}
|
|
12765
|
+
setSelectedModel(modelName);
|
|
12428
12766
|
setIsOpen(false);
|
|
12429
|
-
|
|
12767
|
+
// For LiteLLM models (with provider prefix), modelName is already the full model name
|
|
12768
|
+
// For standard models, we need to find the full name from MODEL_MAPPINGS
|
|
12769
|
+
let fullModelName;
|
|
12770
|
+
if (modelName.includes('/')) {
|
|
12771
|
+
// LiteLLM model - use model name directly
|
|
12772
|
+
fullModelName = modelName;
|
|
12773
|
+
}
|
|
12774
|
+
else {
|
|
12775
|
+
// Standard model - find full name from MODEL_MAPPINGS
|
|
12776
|
+
fullModelName = ((_a = MODEL_MAPPINGS.find(m => m.displayName === modelName)) === null || _a === void 0 ? void 0 : _a.fullName) || modelName;
|
|
12777
|
+
}
|
|
12430
12778
|
const newConfig = {
|
|
12431
12779
|
model: fullModelName
|
|
12432
12780
|
};
|
|
@@ -12466,18 +12814,30 @@ const ModelSelector = ({ onConfigChange }) => {
|
|
|
12466
12814
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_icons_NucleausIcon__WEBPACK_IMPORTED_MODULE_4__["default"], { height: 10, width: 10 })),
|
|
12467
12815
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", { className: "model-name" }, selectedModel),
|
|
12468
12816
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", { className: "dropdown-arrow" }, "\u25BC")),
|
|
12469
|
-
isOpen && (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: `model-options dropup`, style: { minWidth: '150px' }, onMouseLeave: () => setHoveredModel(null) },
|
|
12470
|
-
|
|
12471
|
-
|
|
12817
|
+
isOpen && (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: `model-options dropup`, style: { minWidth: '150px' }, onMouseLeave: () => setHoveredModel(null) }, isLoadingModels ? (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "model-option" }, "Loading models...")) : (availableModels.map(modelName => {
|
|
12818
|
+
// Check if it's a LiteLLM model (has provider prefix)
|
|
12819
|
+
const isLiteLLMModel = modelName.includes('/');
|
|
12820
|
+
let displayName;
|
|
12821
|
+
let modelMapping;
|
|
12822
|
+
if (isLiteLLMModel) {
|
|
12823
|
+
// LiteLLM model - use model name directly as display name
|
|
12824
|
+
displayName = modelName;
|
|
12825
|
+
}
|
|
12826
|
+
else {
|
|
12827
|
+
// Standard model - find display name from MODEL_MAPPINGS
|
|
12828
|
+
modelMapping = MODEL_MAPPINGS.find(m => m.fullName === modelName);
|
|
12829
|
+
displayName = (modelMapping === null || modelMapping === void 0 ? void 0 : modelMapping.displayName) || modelName;
|
|
12830
|
+
}
|
|
12831
|
+
return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { key: modelName, className: `model-option ${displayName === selectedModel ? 'selected' : ''}`, onClick: (e) => {
|
|
12472
12832
|
e.stopPropagation();
|
|
12473
|
-
handleModelChange(
|
|
12833
|
+
handleModelChange(displayName);
|
|
12474
12834
|
}, onMouseEnter: () => setHoveredModel(modelMapping || null), "data-testid": "model-option" },
|
|
12475
|
-
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", { className: "model-option-name" },
|
|
12835
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", { className: "model-option-name" }, displayName),
|
|
12476
12836
|
(modelMapping === null || modelMapping === void 0 ? void 0 : modelMapping.type) === 'smart' && (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", { className: "model-type-icon" },
|
|
12477
12837
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_icons_BrainIcon__WEBPACK_IMPORTED_MODULE_5__["default"], { height: 12, width: 12 }))),
|
|
12478
12838
|
(modelMapping === null || modelMapping === void 0 ? void 0 : modelMapping.type) === 'fast' && (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", { className: "model-type-icon" },
|
|
12479
12839
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_icons_LightningIcon__WEBPACK_IMPORTED_MODULE_6__["default"], { height: 12, width: 12 })))));
|
|
12480
|
-
})))),
|
|
12840
|
+
}))))),
|
|
12481
12841
|
isOpen && hoveredModel && react_dom__WEBPACK_IMPORTED_MODULE_1___default().createPortal(react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "model-tooltip" },
|
|
12482
12842
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "model-tooltip-content" },
|
|
12483
12843
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "model-tooltip-header" },
|
|
@@ -12499,7 +12859,14 @@ const ModelSelector = ({ onConfigChange }) => {
|
|
|
12499
12859
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", { className: "model-tooltip-metadata-value" }, hoveredModel.complexityHandling)))),
|
|
12500
12860
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "model-tooltip-section" },
|
|
12501
12861
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "model-tooltip-section-label" }, "Good For:"),
|
|
12502
|
-
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("ul", { className: "model-tooltip-bullet-list" }, hoveredModel.goodFor.map((item, index) => (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("li", { key: index, className: "model-tooltip-bullet-item" }, item))))))), document.body)
|
|
12862
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("ul", { className: "model-tooltip-bullet-list" }, hoveredModel.goodFor.map((item, index) => (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("li", { key: index, className: "model-tooltip-bullet-item" }, item))))))), document.body),
|
|
12863
|
+
isOpen && !hoveredModel && selectedModel.includes('/') && react_dom__WEBPACK_IMPORTED_MODULE_1___default().createPortal(react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "model-tooltip" },
|
|
12864
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "model-tooltip-content" },
|
|
12865
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "model-tooltip-header" },
|
|
12866
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "model-tooltip-title-row" },
|
|
12867
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "model-tooltip-title" }, selectedModel))),
|
|
12868
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "model-tooltip-section" },
|
|
12869
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "model-tooltip-section-label" }, "No additional information available")))), document.body)));
|
|
12503
12870
|
};
|
|
12504
12871
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ModelSelector);
|
|
12505
12872
|
|
|
@@ -14370,6 +14737,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
14370
14737
|
|
|
14371
14738
|
__webpack_require__.r(__webpack_exports__);
|
|
14372
14739
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
14740
|
+
/* harmony export */ addChartField: () => (/* binding */ addChartField),
|
|
14373
14741
|
/* harmony export */ convertChartCode: () => (/* binding */ convertChartCode),
|
|
14374
14742
|
/* harmony export */ getChatHistoryThread: () => (/* binding */ getChatHistoryThread),
|
|
14375
14743
|
/* harmony export */ getChatHistoryThreads: () => (/* binding */ getChatHistoryThreads),
|
|
@@ -14534,7 +14902,7 @@ CHART WIZARD ENDPOINTS
|
|
|
14534
14902
|
|
|
14535
14903
|
************************************/
|
|
14536
14904
|
const convertChartCode = async (code) => {
|
|
14537
|
-
const resp = await (0,_utils__WEBPACK_IMPORTED_MODULE_0__.requestAPI)('chart-wizard', {
|
|
14905
|
+
const resp = await (0,_utils__WEBPACK_IMPORTED_MODULE_0__.requestAPI)('chart-wizard/convert', {
|
|
14538
14906
|
method: 'POST',
|
|
14539
14907
|
body: JSON.stringify({ code }),
|
|
14540
14908
|
});
|
|
@@ -14543,6 +14911,20 @@ const convertChartCode = async (code) => {
|
|
|
14543
14911
|
}
|
|
14544
14912
|
return resp.data;
|
|
14545
14913
|
};
|
|
14914
|
+
const addChartField = async (code, userDescription, existingVariables) => {
|
|
14915
|
+
const resp = await (0,_utils__WEBPACK_IMPORTED_MODULE_0__.requestAPI)('chart-wizard/add-field', {
|
|
14916
|
+
method: 'POST',
|
|
14917
|
+
body: JSON.stringify({
|
|
14918
|
+
code,
|
|
14919
|
+
user_description: userDescription,
|
|
14920
|
+
existing_variables: existingVariables
|
|
14921
|
+
}),
|
|
14922
|
+
});
|
|
14923
|
+
if (resp.error) {
|
|
14924
|
+
throw new Error(resp.error.message);
|
|
14925
|
+
}
|
|
14926
|
+
return resp.data;
|
|
14927
|
+
};
|
|
14546
14928
|
const getChatHistoryThreads = async () => {
|
|
14547
14929
|
var _a;
|
|
14548
14930
|
const resp = await (0,_utils__WEBPACK_IMPORTED_MODULE_0__.requestAPI)('chat-history/threads');
|
|
@@ -16026,7 +16408,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
16026
16408
|
/* harmony export */ GPT_4_1_DISPLAY_NAME: () => (/* binding */ GPT_4_1_DISPLAY_NAME),
|
|
16027
16409
|
/* harmony export */ GPT_4_1_MODEL_NAME: () => (/* binding */ GPT_4_1_MODEL_NAME),
|
|
16028
16410
|
/* harmony export */ GPT_5_2_DISPLAY_NAME: () => (/* binding */ GPT_5_2_DISPLAY_NAME),
|
|
16029
|
-
/* harmony export */ GPT_5_2_MODEL_NAME: () => (/* binding */ GPT_5_2_MODEL_NAME)
|
|
16411
|
+
/* harmony export */ GPT_5_2_MODEL_NAME: () => (/* binding */ GPT_5_2_MODEL_NAME),
|
|
16412
|
+
/* harmony export */ getAvailableModels: () => (/* binding */ getAvailableModels)
|
|
16030
16413
|
/* harmony export */ });
|
|
16031
16414
|
/*
|
|
16032
16415
|
* Copyright (c) Saga Inc.
|
|
@@ -16044,6 +16427,33 @@ const GEMINI_3_FLASH_DISPLAY_NAME = 'Gemini 3 Flash';
|
|
|
16044
16427
|
const GEMINI_3_FLASH_MODEL_NAME = 'gemini-3-flash-preview';
|
|
16045
16428
|
const GEMINI_3_PRO_DISPLAY_NAME = 'Gemini 3 Pro';
|
|
16046
16429
|
const GEMINI_3_PRO_MODEL_NAME = 'gemini-3-pro-preview';
|
|
16430
|
+
/**
|
|
16431
|
+
* Fetch available models from the backend API.
|
|
16432
|
+
* Returns the list of model names that are available based on enterprise mode and LiteLLM configuration.
|
|
16433
|
+
*
|
|
16434
|
+
* @returns Promise resolving to an array of model names
|
|
16435
|
+
*/
|
|
16436
|
+
async function getAvailableModels() {
|
|
16437
|
+
var _a;
|
|
16438
|
+
// Lazy import to avoid loading JupyterLab dependencies when only constants are needed
|
|
16439
|
+
const { requestAPI } = await Promise.resolve(/*! import() */).then(__webpack_require__.bind(__webpack_require__, /*! ../restAPI/utils */ "./lib/restAPI/utils.js"));
|
|
16440
|
+
const response = await requestAPI('available-models', {
|
|
16441
|
+
method: 'GET'
|
|
16442
|
+
});
|
|
16443
|
+
if (response.error) {
|
|
16444
|
+
console.error('Failed to fetch available models:', response.error.message);
|
|
16445
|
+
// Return default models as fallback
|
|
16446
|
+
return [
|
|
16447
|
+
GPT_4_1_MODEL_NAME,
|
|
16448
|
+
GPT_5_2_MODEL_NAME,
|
|
16449
|
+
CLAUDE_SONNET_MODEL_NAME,
|
|
16450
|
+
CLAUDE_HAIKU_MODEL_NAME,
|
|
16451
|
+
GEMINI_3_FLASH_MODEL_NAME,
|
|
16452
|
+
GEMINI_3_PRO_MODEL_NAME,
|
|
16453
|
+
];
|
|
16454
|
+
}
|
|
16455
|
+
return ((_a = response.data) === null || _a === void 0 ? void 0 : _a.models) || [];
|
|
16456
|
+
}
|
|
16047
16457
|
|
|
16048
16458
|
|
|
16049
16459
|
/***/ }),
|
|
@@ -17973,6 +18383,59 @@ class CompletionWebsocketClient extends _BaseWebsocketClient__WEBPACK_IMPORTED_M
|
|
|
17973
18383
|
}
|
|
17974
18384
|
|
|
17975
18385
|
|
|
18386
|
+
/***/ }),
|
|
18387
|
+
|
|
18388
|
+
/***/ "./node_modules/css-loader/dist/cjs.js!./style/AddFieldButton.css":
|
|
18389
|
+
/*!************************************************************************!*\
|
|
18390
|
+
!*** ./node_modules/css-loader/dist/cjs.js!./style/AddFieldButton.css ***!
|
|
18391
|
+
\************************************************************************/
|
|
18392
|
+
/***/ ((module, __webpack_exports__, __webpack_require__) => {
|
|
18393
|
+
|
|
18394
|
+
__webpack_require__.r(__webpack_exports__);
|
|
18395
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
18396
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
18397
|
+
/* harmony export */ });
|
|
18398
|
+
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
|
|
18399
|
+
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
18400
|
+
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
|
|
18401
|
+
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
|
|
18402
|
+
// Imports
|
|
18403
|
+
|
|
18404
|
+
|
|
18405
|
+
var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
|
|
18406
|
+
// Module
|
|
18407
|
+
___CSS_LOADER_EXPORT___.push([module.id, `/*
|
|
18408
|
+
* Copyright (c) Saga Inc.
|
|
18409
|
+
* Distributed under the terms of the GNU Affero General Public License v3.0 License.
|
|
18410
|
+
*/
|
|
18411
|
+
|
|
18412
|
+
.add-field-container {
|
|
18413
|
+
margin-top: 16px;
|
|
18414
|
+
padding-top: 16px;
|
|
18415
|
+
border-top: 1px solid #e0e0e0;
|
|
18416
|
+
}
|
|
18417
|
+
|
|
18418
|
+
.add-field-button {
|
|
18419
|
+
width: 100%;
|
|
18420
|
+
}
|
|
18421
|
+
|
|
18422
|
+
.add-field-dialog-textarea {
|
|
18423
|
+
width: 100%;
|
|
18424
|
+
padding: 8px;
|
|
18425
|
+
margin-top: 10px;
|
|
18426
|
+
font-size: 14px;
|
|
18427
|
+
border: 1px solid #ccc;
|
|
18428
|
+
border-radius: 4px;
|
|
18429
|
+
min-height: 100px;
|
|
18430
|
+
resize: vertical;
|
|
18431
|
+
font-family: inherit;
|
|
18432
|
+
box-sizing: border-box;
|
|
18433
|
+
}
|
|
18434
|
+
`, "",{"version":3,"sources":["webpack://./style/AddFieldButton.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;IACI,gBAAgB;IAChB,iBAAiB;IACjB,6BAA6B;AACjC;;AAEA;IACI,WAAW;AACf;;AAEA;IACI,WAAW;IACX,YAAY;IACZ,gBAAgB;IAChB,eAAe;IACf,sBAAsB;IACtB,kBAAkB;IAClB,iBAAiB;IACjB,gBAAgB;IAChB,oBAAoB;IACpB,sBAAsB;AAC1B","sourcesContent":["/*\n * Copyright (c) Saga Inc.\n * Distributed under the terms of the GNU Affero General Public License v3.0 License.\n */\n\n.add-field-container {\n margin-top: 16px;\n padding-top: 16px;\n border-top: 1px solid #e0e0e0;\n}\n\n.add-field-button {\n width: 100%;\n}\n\n.add-field-dialog-textarea {\n width: 100%;\n padding: 8px;\n margin-top: 10px;\n font-size: 14px;\n border: 1px solid #ccc;\n border-radius: 4px;\n min-height: 100px;\n resize: vertical;\n font-family: inherit;\n box-sizing: border-box;\n}\n"],"sourceRoot":""}]);
|
|
18435
|
+
// Exports
|
|
18436
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
|
|
18437
|
+
|
|
18438
|
+
|
|
17976
18439
|
/***/ }),
|
|
17977
18440
|
|
|
17978
18441
|
/***/ "./node_modules/css-loader/dist/cjs.js!./style/AgentChangeControls.css":
|
|
@@ -19800,7 +20263,71 @@ ___CSS_LOADER_EXPORT___.push([module.id, `/*
|
|
|
19800
20263
|
display: inline-block;
|
|
19801
20264
|
min-width: 1.5em;
|
|
19802
20265
|
text-align: left;
|
|
19803
|
-
}
|
|
20266
|
+
}
|
|
20267
|
+
|
|
20268
|
+
.chart-wizard-overlay {
|
|
20269
|
+
position: absolute;
|
|
20270
|
+
top: 0;
|
|
20271
|
+
left: 0;
|
|
20272
|
+
right: 0;
|
|
20273
|
+
/* Height is set dynamically via inline style to cover full scrollable content */
|
|
20274
|
+
min-height: 100%;
|
|
20275
|
+
background-color: rgba(255, 255, 255, 0.8);
|
|
20276
|
+
display: flex;
|
|
20277
|
+
align-items: center;
|
|
20278
|
+
justify-content: center;
|
|
20279
|
+
z-index: 1000;
|
|
20280
|
+
pointer-events: all;
|
|
20281
|
+
}
|
|
20282
|
+
|
|
20283
|
+
.chart-wizard-overlay-text {
|
|
20284
|
+
font-size: 16px;
|
|
20285
|
+
font-weight: 500;
|
|
20286
|
+
color: #333;
|
|
20287
|
+
}
|
|
20288
|
+
|
|
20289
|
+
.chart-wizard-warning {
|
|
20290
|
+
background-color: var(--yellow-100);
|
|
20291
|
+
color: var(--yellow-900);
|
|
20292
|
+
padding: 10px 12px;
|
|
20293
|
+
border-radius: 4px;
|
|
20294
|
+
margin-bottom: 15px;
|
|
20295
|
+
font-size: 13px;
|
|
20296
|
+
line-height: 1.4;
|
|
20297
|
+
border: 1px solid var(--yellow-300);
|
|
20298
|
+
display: flex;
|
|
20299
|
+
flex-direction: column;
|
|
20300
|
+
gap: 10px;
|
|
20301
|
+
}
|
|
20302
|
+
|
|
20303
|
+
.chart-wizard-warning-content {
|
|
20304
|
+
flex: 1;
|
|
20305
|
+
}
|
|
20306
|
+
|
|
20307
|
+
.chart-wizard-warning strong {
|
|
20308
|
+
font-weight: 600;
|
|
20309
|
+
}
|
|
20310
|
+
|
|
20311
|
+
.chart-wizard-warning-button {
|
|
20312
|
+
background-color: var(--yellow-600);
|
|
20313
|
+
color: var(--yellow-900);
|
|
20314
|
+
border: none;
|
|
20315
|
+
padding: 6px 12px;
|
|
20316
|
+
border-radius: 4px;
|
|
20317
|
+
font-size: 12px;
|
|
20318
|
+
font-weight: 500;
|
|
20319
|
+
cursor: pointer;
|
|
20320
|
+
align-self: flex-start;
|
|
20321
|
+
transition: background-color 0.2s ease;
|
|
20322
|
+
}
|
|
20323
|
+
|
|
20324
|
+
.chart-wizard-warning-button:hover {
|
|
20325
|
+
background-color: var(--yellow-500);
|
|
20326
|
+
}
|
|
20327
|
+
|
|
20328
|
+
.chart-wizard-warning-button:active {
|
|
20329
|
+
background-color: var(--yellow-300);
|
|
20330
|
+
}`, "",{"version":3,"sources":["webpack://./style/ChartWizardWidget.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;IACI,aAAa;IACb,YAAY;IACZ,gBAAgB;IAChB,aAAa;IACb,sBAAsB;IACtB,sBAAsB;AAC1B;;AAEA;IACI,aAAa;IACb,sBAAsB;IACtB,mBAAmB;IACnB,QAAQ;AACZ;;AAEA;IACI,mBAAmB;IACnB,mBAAmB;IACnB,8BAA8B;IAC9B,mBAAmB;IACnB,SAAS;AACb;;AAEA;IACI,oCAAoC;IACpC,eAAe;IACf,gBAAgB;IAChB,oBAAoB;AACxB;;AAEA;IACI,OAAO;IACP,SAAS;IACT,eAAe;AACnB;;AAEA;IACI,kBAAkB;IAClB,oBAAoB;IACpB,mBAAmB;IACnB,eAAe;IACf,cAAc;AAClB;;AAEA;IACI,kBAAkB;IAClB,UAAU;IACV,eAAe;IACf,QAAQ;IACR,SAAS;IACT,SAAS;AACb;;AAEA;IACI,kBAAkB;IAClB,qBAAqB;IACrB,WAAW;IACX,YAAY;IACZ,yCAAyC;IACzC,mBAAmB;IACnB,sCAAsC;IACtC,sBAAsB;AAC1B;;AAEA;IACI,WAAW;IACX,kBAAkB;IAClB,WAAW;IACX,YAAY;IACZ,SAAS;IACT,QAAQ;IACR,uBAAuB;IACvB,kBAAkB;IAClB,+BAA+B;IAC/B,wCAAwC;AAC5C;;AAEA;IACI,wCAAwC;AAC5C;;AAEA;IACI,2BAA2B;AAC/B;;AAEA;IACI,6CAA6C;AACjD;;AAEA;IACI,yCAAyC;AAC7C;;AAEA;IACI,wCAAwC;AAC5C;;AAEA;;;;IAII,WAAW;IACX,sBAAsB;AAC1B;;AAEA;IACI,aAAa;IACb,QAAQ;IACR,WAAW;AACf;;AAEA;IACI,cAAc;AAClB;;AAEA;IACI,OAAO;AACX;;AAEA;IACI,aAAa;IACb,mBAAmB;IACnB,QAAQ;IACR,WAAW;AACf;;AAEA;IACI,OAAO;AACX;;AAEA;IACI,OAAO;IACP,aAAa;AACjB;;AAEA;;IAEI,OAAO;IACP,aAAa;IACb,sBAAsB;IACtB,uBAAuB;AAC3B;;AAEA;IACI,kBAAkB;AACtB;;AAEA;IACI,qBAAqB;IACrB,gBAAgB;IAChB,gBAAgB;AACpB;;AAEA;IACI,kBAAkB;IAClB,MAAM;IACN,OAAO;IACP,QAAQ;IACR,gFAAgF;IAChF,gBAAgB;IAChB,0CAA0C;IAC1C,aAAa;IACb,mBAAmB;IACnB,uBAAuB;IACvB,aAAa;IACb,mBAAmB;AACvB;;AAEA;IACI,eAAe;IACf,gBAAgB;IAChB,WAAW;AACf;;AAEA;IACI,mCAAmC;IACnC,wBAAwB;IACxB,kBAAkB;IAClB,kBAAkB;IAClB,mBAAmB;IACnB,eAAe;IACf,gBAAgB;IAChB,mCAAmC;IACnC,aAAa;IACb,sBAAsB;IACtB,SAAS;AACb;;AAEA;IACI,OAAO;AACX;;AAEA;IACI,gBAAgB;AACpB;;AAEA;IACI,mCAAmC;IACnC,wBAAwB;IACxB,YAAY;IACZ,iBAAiB;IACjB,kBAAkB;IAClB,eAAe;IACf,gBAAgB;IAChB,eAAe;IACf,sBAAsB;IACtB,sCAAsC;AAC1C;;AAEA;IACI,mCAAmC;AACvC;;AAEA;IACI,mCAAmC;AACvC","sourcesContent":["/*\n * Copyright (c) Saga Inc.\n * Distributed under the terms of the GNU Affero General Public License v3.0 License.\n */\n\n.chart-wizard-widget {\n padding: 10px;\n height: 100%;\n overflow-y: auto;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n}\n\n.chart-wizard-input-row {\n display: flex;\n flex-direction: column;\n margin-bottom: 15px;\n gap: 5px;\n}\n\n.chart-wizard-boolean-row {\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 12px;\n gap: 12px;\n}\n\n.chart-wizard-input-label {\n color: var(--jp-content-font-color2);\n font-size: 12px;\n font-weight: 500;\n text-transform: none;\n}\n\n.chart-wizard-boolean-label {\n flex: 1;\n margin: 0;\n cursor: pointer;\n}\n\n.chart-wizard-toggle-container {\n position: relative;\n display: inline-flex;\n align-items: center;\n cursor: pointer;\n flex-shrink: 0;\n}\n\n.chart-wizard-toggle-input {\n position: absolute;\n opacity: 0;\n cursor: pointer;\n width: 0;\n height: 0;\n margin: 0;\n}\n\n.chart-wizard-toggle-slider {\n position: relative;\n display: inline-block;\n width: 44px;\n height: 24px;\n background-color: var(--jp-border-color2);\n border-radius: 12px;\n transition: background-color 0.3s ease;\n box-sizing: border-box;\n}\n\n.chart-wizard-toggle-slider::before {\n content: '';\n position: absolute;\n width: 20px;\n height: 20px;\n left: 2px;\n top: 2px;\n background-color: white;\n border-radius: 50%;\n transition: transform 0.3s ease;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n}\n\n.chart-wizard-toggle-input:checked + .chart-wizard-toggle-slider {\n background-color: var(--jp-brand-color1);\n}\n\n.chart-wizard-toggle-input:checked + .chart-wizard-toggle-slider::before {\n transform: translateX(20px);\n}\n\n.chart-wizard-toggle-input:focus + .chart-wizard-toggle-slider {\n box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.2);\n}\n\n.chart-wizard-toggle-input:hover + .chart-wizard-toggle-slider {\n background-color: var(--jp-border-color1);\n}\n\n.chart-wizard-toggle-input:checked:hover + .chart-wizard-toggle-slider {\n background-color: var(--jp-brand-color0);\n}\n\n.chart-wizard-number-input,\n.chart-wizard-text-input,\n.chart-wizard-color-input,\n.chart-wizard-tuple-input {\n width: 100%;\n box-sizing: border-box;\n}\n\n.chart-wizard-color-container {\n display: flex;\n gap: 8px;\n width: 100%;\n}\n\n.chart-wizard-color-picker {\n flex-shrink: 0;\n}\n\n.chart-wizard-color-input {\n flex: 1;\n}\n\n.chart-wizard-tuple-container {\n display: flex;\n align-items: center;\n gap: 5px;\n width: 100%;\n}\n\n.chart-wizard-tuple-input {\n flex: 1;\n}\n\n.chart-wizard-config-container {\n flex: 1;\n min-height: 0;\n}\n\n.chart-wizard-empty-state,\n.chart-wizard-no-config {\n flex: 1;\n display: flex;\n flex-direction: column;\n justify-content: center;\n}\n\n.chart-wizard-no-config p {\n text-align: center;\n}\n\n.chart-wizard-loading-dots {\n display: inline-block;\n min-width: 1.5em;\n text-align: left;\n}\n\n.chart-wizard-overlay {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n /* Height is set dynamically via inline style to cover full scrollable content */\n min-height: 100%;\n background-color: rgba(255, 255, 255, 0.8);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 1000;\n pointer-events: all;\n}\n\n.chart-wizard-overlay-text {\n font-size: 16px;\n font-weight: 500;\n color: #333;\n}\n\n.chart-wizard-warning {\n background-color: var(--yellow-100);\n color: var(--yellow-900);\n padding: 10px 12px;\n border-radius: 4px;\n margin-bottom: 15px;\n font-size: 13px;\n line-height: 1.4;\n border: 1px solid var(--yellow-300);\n display: flex;\n flex-direction: column;\n gap: 10px;\n}\n\n.chart-wizard-warning-content {\n flex: 1;\n}\n\n.chart-wizard-warning strong {\n font-weight: 600;\n}\n\n.chart-wizard-warning-button {\n background-color: var(--yellow-600);\n color: var(--yellow-900);\n border: none;\n padding: 6px 12px;\n border-radius: 4px;\n font-size: 12px;\n font-weight: 500;\n cursor: pointer;\n align-self: flex-start;\n transition: background-color 0.2s ease;\n}\n\n.chart-wizard-warning-button:hover {\n background-color: var(--yellow-500);\n}\n\n.chart-wizard-warning-button:active {\n background-color: var(--yellow-300);\n}"],"sourceRoot":""}]);
|
|
19804
20331
|
// Exports
|
|
19805
20332
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
|
|
19806
20333
|
|
|
@@ -21146,10 +21673,9 @@ ___CSS_LOADER_EXPORT___.push([module.id, `/*
|
|
|
21146
21673
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
|
|
21147
21674
|
display: flex;
|
|
21148
21675
|
flex-direction: column;
|
|
21149
|
-
min-width:
|
|
21676
|
+
min-width: 225px;
|
|
21150
21677
|
white-space: nowrap;
|
|
21151
21678
|
height: 400px;
|
|
21152
|
-
min-width: 225px;
|
|
21153
21679
|
max-width: 350px;
|
|
21154
21680
|
overflow-y: auto;
|
|
21155
21681
|
}
|
|
@@ -21166,6 +21692,22 @@ ___CSS_LOADER_EXPORT___.push([module.id, `/*
|
|
|
21166
21692
|
left: auto;
|
|
21167
21693
|
}
|
|
21168
21694
|
|
|
21695
|
+
/* Responsive width based on chat taskpane container width */
|
|
21696
|
+
/* Make dropdown width relative to container width, accounting for padding */
|
|
21697
|
+
/* At minimum taskpane width (350px), dropdown should fit within available space (330px accounting for 20px padding) */
|
|
21698
|
+
@container (max-width: 350px) {
|
|
21699
|
+
.dropdown-menu {
|
|
21700
|
+
max-width: calc(100cqw - 20px);
|
|
21701
|
+
}
|
|
21702
|
+
}
|
|
21703
|
+
|
|
21704
|
+
/* For wider taskpanes, allow dropdown to use up to 350px but still respect container width */
|
|
21705
|
+
@container (min-width: 351px) {
|
|
21706
|
+
.dropdown-menu {
|
|
21707
|
+
max-width: min(350px, calc(100cqw - 20px));
|
|
21708
|
+
}
|
|
21709
|
+
}
|
|
21710
|
+
|
|
21169
21711
|
.dropdown-item-row {
|
|
21170
21712
|
display: flex;
|
|
21171
21713
|
flex-direction: row;
|
|
@@ -21221,7 +21763,7 @@ ___CSS_LOADER_EXPORT___.push([module.id, `/*
|
|
|
21221
21763
|
display: flex;
|
|
21222
21764
|
align-items: center;
|
|
21223
21765
|
}
|
|
21224
|
-
`, "",{"version":3,"sources":["webpack://./style/DropdownMenu.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;EACE,kBAAkB;EAClB,qBAAqB;AACvB;;AAEA;EACE,kBAAkB;EAClB,qBAAqB;EACrB,aAAa;EACb,yCAAyC;EACzC,yCAAyC;EACzC,kBAAkB;EAClB,wCAAwC;EACxC,aAAa;EACb,sBAAsB;EACtB,gBAAgB;EAChB,mBAAmB;EACnB,aAAa;EACb,gBAAgB;EAChB,gBAAgB;
|
|
21766
|
+
`, "",{"version":3,"sources":["webpack://./style/DropdownMenu.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;EACE,kBAAkB;EAClB,qBAAqB;AACvB;;AAEA;EACE,kBAAkB;EAClB,qBAAqB;EACrB,aAAa;EACb,yCAAyC;EACzC,yCAAyC;EACzC,kBAAkB;EAClB,wCAAwC;EACxC,aAAa;EACb,sBAAsB;EACtB,gBAAgB;EAChB,mBAAmB;EACnB,aAAa;EACb,gBAAgB;EAChB,gBAAgB;AAClB;;AAEA,0BAA0B;AAC1B;EACE,OAAO;EACP,WAAW;AACb;;AAEA,2BAA2B;AAC3B;EACE,QAAQ;EACR,UAAU;AACZ;;AAEA,4DAA4D;AAC5D,4EAA4E;AAC5E,sHAAsH;AACtH;EACE;IACE,8BAA8B;EAChC;AACF;;AAEA,6FAA6F;AAC7F;EACE;IACE,0CAA0C;EAC5C;AACF;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,8BAA8B;EAC9B,mBAAmB;EACnB,QAAQ;EACR,gBAAgB;EAChB,mBAAmB,EAAE,iDAAiD;AACxE;;AAEA;EACE,yCAAyC;AAC3C;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,mBAAmB;EACnB,gBAAgB;EAChB,YAAY;EACZ,gBAAgB;EAChB,+BAA+B;EAC/B,OAAO;EACP,gBAAgB;EAChB,uBAAuB;EACvB,eAAe;AACjB;;AAEA;EACE,WAAW;EACX,eAAe;EACf,YAAY;EACZ,aAAa;EACb,mBAAmB;EACnB,uBAAuB;AACzB;;AAEA;EACE,iBAAiB,EAAE,2BAA2B;AAChD;;AAEA;EACE,YAAY;EACZ,eAAe;AACjB;;AAEA;;;CAGC;AACD;;EAEE,aAAa;EACb,mBAAmB;AACrB","sourcesContent":["/*\n * Copyright (c) Saga Inc.\n * Distributed under the terms of the GNU Affero General Public License v3.0 License.\n */\n\n.dropdown-container {\n position: relative;\n display: inline-block;\n}\n\n.dropdown-menu {\n position: absolute;\n top: calc(100% + 4px);\n z-index: 1000;\n background-color: var(--jp-layout-color1);\n border: 1px solid var(--jp-layout-color2);\n border-radius: 3px;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n display: flex;\n flex-direction: column;\n min-width: 225px;\n white-space: nowrap;\n height: 400px;\n max-width: 350px;\n overflow-y: auto;\n}\n\n/* Left-aligned dropdown */\n.dropdown-menu-left {\n left: 0;\n right: auto;\n}\n\n/* Right-aligned dropdown */\n.dropdown-menu-right {\n right: 0;\n left: auto;\n}\n\n/* Responsive width based on chat taskpane container width */\n/* Make dropdown width relative to container width, accounting for padding */\n/* At minimum taskpane width (350px), dropdown should fit within available space (330px accounting for 20px padding) */\n@container (max-width: 350px) {\n .dropdown-menu {\n max-width: calc(100cqw - 20px);\n }\n}\n\n/* For wider taskpanes, allow dropdown to use up to 350px but still respect container width */\n@container (min-width: 351px) {\n .dropdown-menu {\n max-width: min(350px, calc(100cqw - 20px));\n }\n}\n\n.dropdown-item-row {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n gap: 8px;\n padding: 4px 2px;\n padding-right: 20px; /* Add padding to leave space for the scrollbar */\n}\n\n.dropdown-item-row:hover {\n background-color: var(--jp-layout-color2);\n}\n\n.dropdown-item-main {\n display: flex;\n flex-direction: row;\n align-items: center;\n text-align: left;\n border: none;\n background: none;\n color: var(--jp-ui-font-color1);\n flex: 1;\n overflow: hidden;\n text-overflow: ellipsis;\n cursor: pointer;\n}\n\n.dropdown-item-icon {\n width: 20px;\n min-width: 20px;\n height: 20px;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.dropdown-item-label {\n padding-left: 3px; /* Add consistent padding */\n}\n\n.dropdown-item-disabled {\n opacity: 0.5;\n cursor: default;\n}\n\n/* \n When using Lab Icons, we seem to get an extra div around the svg icon\n This makes sure the svg is aligned properly in that div\n*/\n.dropdown-item-icon > div, \n.dropdown-item-secondary > div{\n display: flex;\n align-items: center;\n}\n"],"sourceRoot":""}]);
|
|
21225
21767
|
// Exports
|
|
21226
21768
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
|
|
21227
21769
|
|
|
@@ -24207,6 +24749,60 @@ module.exports = "<svg width=\"14\" height=\"14\" viewBox=\"0 0 10 10\" fill=\"n
|
|
|
24207
24749
|
|
|
24208
24750
|
module.exports = "<svg width=\"33\" height=\"33\" viewBox=\"0 0 33 33\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g fill=\"currentColor\">\n <path d=\"M27.8204 5.193C24.7983 2.1709 20.7805 0.506836 16.5068 0.506836C7.78625 0.506836 0.506836 7.78625 0.506836 16.5068C0.506836 25.2274 7.78625 32.5068 16.5068 32.5068C25.2274 32.5068 32.5068 25.2274 32.5068 16.5068C32.5068 12.2332 30.8426 8.2151 27.8207 5.19329L27.8204 5.193ZM23.627 21.5962L21.7553 17.7403L23.4737 16.9062L24.3955 18.8053L24.4401 18.6209C24.608 17.9267 24.6932 17.2155 24.6932 16.5068C24.6932 11.6336 20.7854 7.66893 15.9819 7.66893C11.1788 7.66893 7.27066 11.6336 7.27066 16.5068C7.27066 21.3572 11.1414 25.3073 15.9137 25.3444V27.2546C10.0885 27.217 5.36066 22.41 5.36066 16.5067C5.36066 10.5804 10.1253 5.75855 15.9819 5.75855C21.8385 5.75855 26.6032 10.5801 26.6032 16.5067C26.6032 17.2903 26.5175 18.0775 26.3484 18.8468L26.315 18.999L27.9027 18.0676L28.8693 19.7151L24.9693 22.003C24.3869 22.4896 23.6689 21.9597 23.6268 21.5962L23.627 21.5962Z\"/>\n </g>\n</svg>\n";
|
|
24209
24751
|
|
|
24752
|
+
/***/ }),
|
|
24753
|
+
|
|
24754
|
+
/***/ "./style/AddFieldButton.css":
|
|
24755
|
+
/*!**********************************!*\
|
|
24756
|
+
!*** ./style/AddFieldButton.css ***!
|
|
24757
|
+
\**********************************/
|
|
24758
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
24759
|
+
|
|
24760
|
+
__webpack_require__.r(__webpack_exports__);
|
|
24761
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
24762
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
24763
|
+
/* harmony export */ });
|
|
24764
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
|
|
24765
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
24766
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
|
|
24767
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
|
|
24768
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
|
|
24769
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
|
|
24770
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
|
|
24771
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
|
|
24772
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
|
|
24773
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
|
|
24774
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
|
|
24775
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
|
|
24776
|
+
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_AddFieldButton_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../node_modules/css-loader/dist/cjs.js!./AddFieldButton.css */ "./node_modules/css-loader/dist/cjs.js!./style/AddFieldButton.css");
|
|
24777
|
+
|
|
24778
|
+
|
|
24779
|
+
|
|
24780
|
+
|
|
24781
|
+
|
|
24782
|
+
|
|
24783
|
+
|
|
24784
|
+
|
|
24785
|
+
|
|
24786
|
+
|
|
24787
|
+
|
|
24788
|
+
var options = {};
|
|
24789
|
+
|
|
24790
|
+
options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
|
|
24791
|
+
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
|
|
24792
|
+
|
|
24793
|
+
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
|
|
24794
|
+
|
|
24795
|
+
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
|
|
24796
|
+
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());
|
|
24797
|
+
|
|
24798
|
+
var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_AddFieldButton_css__WEBPACK_IMPORTED_MODULE_6__["default"], options);
|
|
24799
|
+
|
|
24800
|
+
|
|
24801
|
+
|
|
24802
|
+
|
|
24803
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_AddFieldButton_css__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_AddFieldButton_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_AddFieldButton_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);
|
|
24804
|
+
|
|
24805
|
+
|
|
24210
24806
|
/***/ }),
|
|
24211
24807
|
|
|
24212
24808
|
/***/ "./style/AgentChangeControls.css":
|
|
@@ -26694,4 +27290,4 @@ var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js
|
|
|
26694
27290
|
/***/ })
|
|
26695
27291
|
|
|
26696
27292
|
}]);
|
|
26697
|
-
//# sourceMappingURL=lib_index_js.
|
|
27293
|
+
//# sourceMappingURL=lib_index_js.03302cc521d72eb56b00.js.map
|