@cognizant-ai-lab/ui-common 1.12.0 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AgentChat/ChatCommon/ChatCommon.js +9 -3
- package/dist/components/AgentChat/ChatCommon/Const.js +1 -1
- package/dist/components/AgentChat/ChatCommon/SlyDataDialog.js +6 -2
- package/dist/components/Common/Snackbar.js +12 -12
- package/dist/components/MultiAgentAccelerator/AgentFlow/AgentFlow.js +12 -5
- package/dist/components/MultiAgentAccelerator/Editor/Const.d.ts +2 -0
- package/dist/components/MultiAgentAccelerator/Editor/Const.js +5 -0
- package/dist/components/MultiAgentAccelerator/Editor/NetworkEditorDock.d.ts +0 -1
- package/dist/components/MultiAgentAccelerator/Editor/NetworkEditorDock.js +3 -5
- package/dist/components/MultiAgentAccelerator/PanelSeparator.js +2 -2
- package/dist/components/MultiAgentAccelerator/Publish/Publish.d.ts +36 -0
- package/dist/components/MultiAgentAccelerator/Publish/Publish.js +99 -0
- package/dist/components/MultiAgentAccelerator/Publish/PublishButton.d.ts +16 -0
- package/dist/components/MultiAgentAccelerator/Publish/PublishButton.js +98 -0
- package/dist/components/MultiAgentAccelerator/Publish/PublishConfirmation.d.ts +15 -0
- package/dist/components/MultiAgentAccelerator/Publish/PublishConfirmation.js +8 -0
- package/dist/components/MultiAgentAccelerator/Publish/PublishIconButton.d.ts +17 -0
- package/dist/components/MultiAgentAccelerator/Publish/PublishIconButton.js +72 -0
- package/dist/components/MultiAgentAccelerator/Publish/PublishPanel.d.ts +13 -0
- package/dist/components/MultiAgentAccelerator/Publish/PublishPanel.js +28 -0
- package/dist/components/MultiAgentAccelerator/Publish/PublishedNetworkUrl.d.ts +11 -0
- package/dist/components/MultiAgentAccelerator/Publish/PublishedNetworkUrl.js +64 -0
- package/dist/components/MultiAgentAccelerator/Publish/usePublishTarget.d.ts +6 -0
- package/dist/components/MultiAgentAccelerator/Publish/usePublishTarget.js +33 -0
- package/dist/components/MultiAgentAccelerator/Sidebar/AgentNetworkTreeItem.js +9 -2
- package/dist/components/MultiAgentAccelerator/Sidebar/TreeBuilder.d.ts +2 -0
- package/dist/components/MultiAgentAccelerator/Sidebar/TreeBuilder.js +2 -0
- package/dist/components/Settings/ApiKeyInput.d.ts +1 -0
- package/dist/components/Settings/ApiKeyInput.js +8 -3
- package/dist/components/Settings/Byok/ByokDialog.d.ts +24 -0
- package/dist/components/Settings/Byok/ByokDialog.js +42 -0
- package/dist/components/Settings/Byok/ByokInputs.d.ts +38 -0
- package/dist/components/Settings/Byok/ByokInputs.js +35 -0
- package/dist/components/Settings/Byok/ByokStorageTooltip.d.ts +7 -0
- package/dist/components/Settings/Byok/ByokStorageTooltip.js +41 -0
- package/dist/components/Settings/Byok/ByokUnsavedChangesModal.d.ts +23 -0
- package/dist/components/Settings/Byok/ByokUnsavedChangesModal.js +19 -0
- package/dist/components/Settings/Byok/index.d.ts +5 -0
- package/dist/components/Settings/Byok/index.js +20 -0
- package/dist/components/Settings/Byok/useByokKeyManager.d.ts +59 -0
- package/dist/components/Settings/Byok/useByokKeyManager.js +135 -0
- package/dist/components/Settings/PublishSettings.d.ts +15 -0
- package/dist/components/Settings/PublishSettings.js +109 -0
- package/dist/components/Settings/SettingsDialog.js +17 -133
- package/dist/components/Settings/SettingsLayout.d.ts +13 -0
- package/dist/components/Settings/SettingsLayout.js +59 -0
- package/dist/controller/publish/Publish.d.ts +29 -0
- package/dist/controller/publish/Publish.js +94 -0
- package/dist/generated/neuro-san/NeuroSanClient.d.ts +9 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/state/Environment.d.ts +4 -0
- package/dist/state/Environment.js +4 -0
- package/dist/state/Publish.d.ts +39 -0
- package/dist/state/Publish.js +41 -0
- package/dist/state/Settings.d.ts +18 -0
- package/dist/state/Settings.js +4 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utils/Url.d.ts +12 -0
- package/dist/utils/Url.js +32 -0
- package/package.json +1 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type Protocol = "http" | "https";
|
|
2
|
+
export declare const stripProtocol: (value: string) => string;
|
|
3
|
+
/**
|
|
4
|
+
* Normalize a server URL input by stripping the protocol and determining the protocol to use.
|
|
5
|
+
* @param value The input URL value to normalize.
|
|
6
|
+
* @param fallbackProtocol The protocol to use if the input value does not specify one.
|
|
7
|
+
* @return An object containing the normalized host and protocol.
|
|
8
|
+
*/
|
|
9
|
+
export declare const normalizeUrlInput: (value: string, fallbackProtocol: Protocol) => {
|
|
10
|
+
host: string;
|
|
11
|
+
protocol: Protocol;
|
|
12
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2026 Cognizant Technology Solutions Corp, www.cognizant.com.
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
const URL_PROTOCOL_REGEX = /^https?:\/\//iu;
|
|
17
|
+
const HTTP_PROTOCOL_REGEX = /^http:\/\//iu;
|
|
18
|
+
export const stripProtocol = (value) => (value ?? "").replace(URL_PROTOCOL_REGEX, "");
|
|
19
|
+
/**
|
|
20
|
+
* Normalize a server URL input by stripping the protocol and determining the protocol to use.
|
|
21
|
+
* @param value The input URL value to normalize.
|
|
22
|
+
* @param fallbackProtocol The protocol to use if the input value does not specify one.
|
|
23
|
+
* @return An object containing the normalized host and protocol.
|
|
24
|
+
*/
|
|
25
|
+
export const normalizeUrlInput = (value, fallbackProtocol) => {
|
|
26
|
+
const trimmedValue = value.trim();
|
|
27
|
+
const hasProtocol = URL_PROTOCOL_REGEX.exec(trimmedValue);
|
|
28
|
+
return {
|
|
29
|
+
host: stripProtocol(trimmedValue),
|
|
30
|
+
protocol: hasProtocol ? (HTTP_PROTOCOL_REGEX.test(trimmedValue) ? "http" : "https") : fallbackProtocol,
|
|
31
|
+
};
|
|
32
|
+
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cognizant-ai-lab/ui-common",
|
|
3
3
|
"description": "A shared UI component library for Cognizant AI Labs projects",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.13.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "yarn clean && yarn generate && yarn run --top-level tsc --project tsconfig.build.json && fix-esm-import-path dist > /dev/null",
|