@launchdarkly/toolbar 1.6.0 → 2.2.0-beta.1
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/README.md +6 -4
- package/cdn/toolbar.min.js +339 -9
- package/dist/core/services/DevServerClient.d.ts +3 -10
- package/dist/core/services/FlagStateManager.d.ts +3 -0
- package/dist/core/types/devServer.d.ts +2 -3
- package/dist/core/ui/{Toolbar/components → Buttons}/StarButton.css.d.ts +1 -0
- package/dist/core/ui/Toolbar/LaunchDarklyToolbar.d.ts +1 -1
- package/dist/core/ui/Toolbar/components/FlagKeyWithCopy.css.d.ts +4 -0
- package/dist/core/ui/Toolbar/components/FlagKeyWithCopy.d.ts +6 -0
- package/dist/core/ui/Toolbar/components/LoginScreen/LoginScreen.css.d.ts +14 -0
- package/dist/core/ui/Toolbar/components/LoginScreen/LoginScreen.d.ts +10 -0
- package/dist/core/ui/Toolbar/components/icons/ChartHistogram.d.ts +5 -0
- package/dist/core/ui/Toolbar/components/icons/ChipAiIcon.d.ts +5 -0
- package/dist/core/ui/Toolbar/components/icons/ClickIcon.d.ts +5 -0
- package/dist/core/ui/Toolbar/components/icons/CursorIcon.d.ts +7 -0
- package/dist/core/ui/Toolbar/components/icons/ExternalLinkIcon.d.ts +6 -0
- package/dist/core/ui/Toolbar/components/icons/FilterTuneIcon.d.ts +5 -0
- package/dist/core/ui/Toolbar/components/icons/FlaskIcon.d.ts +5 -0
- package/dist/core/ui/Toolbar/components/icons/Icon.css.d.ts +1 -0
- package/dist/core/ui/Toolbar/components/icons/InfoIcon.d.ts +5 -0
- package/dist/core/ui/Toolbar/components/icons/LaunchDarklyIcon.d.ts +2 -1
- package/dist/core/ui/Toolbar/components/icons/index.d.ts +8 -0
- package/dist/core/ui/Toolbar/components/index.d.ts +2 -3
- package/dist/core/ui/Toolbar/components/{ExpandedToolbarContent.d.ts → legacy/ExpandedToolbarContentLegacy.d.ts} +3 -5
- package/dist/core/ui/Toolbar/components/{FlagControls.d.ts → legacy/FlagControls.d.ts} +1 -1
- package/dist/core/ui/Toolbar/{Header → components/legacy/Header}/Header.css.d.ts +2 -0
- package/dist/core/ui/Toolbar/{Header → components/legacy/Header}/Header.d.ts +1 -2
- package/dist/core/ui/Toolbar/components/{LocalFlagControls.d.ts → legacy/LocalFlagControls.d.ts} +2 -2
- package/dist/core/ui/Toolbar/components/{LocalObjectFlagControlListItem.d.ts → legacy/LocalObjectFlagControlListItem.d.ts} +2 -2
- package/dist/core/ui/Toolbar/{TabContent → components/legacy/TabContent}/EventsTabContent.d.ts +1 -1
- package/dist/core/ui/Toolbar/{TabContent → components/legacy/TabContent}/FlagSdkOverrideTabContent.d.ts +1 -1
- package/dist/core/ui/Toolbar/{TabContent → components/legacy/TabContent}/SettingsTabContent.d.ts +1 -3
- package/dist/core/ui/Toolbar/components/{TabContentRenderer.d.ts → legacy/TabContentRenderer.d.ts} +2 -4
- package/dist/core/ui/Toolbar/components/legacy/index.d.ts +1 -0
- package/dist/core/ui/Toolbar/components/new/ContentActions.d.ts +1 -0
- package/dist/core/ui/Toolbar/components/new/ContentActions.module.css.d.ts +4 -0
- package/dist/core/ui/Toolbar/components/new/ContentRenderer.d.ts +1 -0
- package/dist/core/ui/Toolbar/components/new/ExpandedToolbarContent.d.ts +9 -0
- package/dist/core/ui/Toolbar/components/new/ExpandedToolbarContent.module.css.d.ts +2 -0
- package/dist/core/ui/Toolbar/components/new/FeatureFlags/FlagControls.d.ts +37 -0
- package/dist/core/ui/Toolbar/components/new/FeatureFlags/FlagControls.module.css.d.ts +9 -0
- package/dist/core/ui/Toolbar/components/new/FeatureFlags/FlagItem.d.ts +11 -0
- package/dist/core/ui/Toolbar/components/new/FeatureFlags/FlagItem.module.css.d.ts +18 -0
- package/dist/core/ui/Toolbar/components/new/FeatureFlags/FlagList.d.ts +1 -0
- package/dist/core/ui/Toolbar/components/new/FeatureFlags/FlagList.module.css.d.ts +5 -0
- package/dist/core/ui/Toolbar/components/new/FeatureFlags/FlagListContent.d.ts +1 -0
- package/dist/core/ui/Toolbar/components/new/FeatureFlags/types.d.ts +9 -0
- package/dist/core/ui/Toolbar/components/new/FilterOverlay/FilterOverlay.d.ts +11 -0
- package/dist/core/ui/Toolbar/components/new/FilterOverlay/FilterOverlay.module.css.d.ts +16 -0
- package/dist/core/ui/Toolbar/components/new/FilterOverlay/index.d.ts +1 -0
- package/dist/core/ui/Toolbar/components/new/Header/ToolbarHeader.d.ts +7 -0
- package/dist/core/ui/Toolbar/components/new/Header/ToolbarHeader.module.css.d.ts +6 -0
- package/dist/core/ui/Toolbar/components/new/IconBar/IconBar.d.ts +6 -0
- package/dist/core/ui/Toolbar/components/new/IconBar/IconBar.module.css.d.ts +6 -0
- package/dist/core/ui/Toolbar/components/new/Interactive/InteractiveContent.d.ts +1 -0
- package/dist/core/ui/Toolbar/components/new/Interactive/InteractiveContent.module.css.d.ts +4 -0
- package/dist/core/ui/Toolbar/components/new/Interactive/InteractiveWrapper.d.ts +10 -0
- package/dist/core/ui/Toolbar/components/new/Interactive/MCPSetupAlert.d.ts +10 -0
- package/dist/core/ui/Toolbar/components/new/Interactive/MCPSetupAlert.module.css.d.ts +12 -0
- package/dist/core/ui/Toolbar/components/new/Interactive/SelectedElementInfo.d.ts +1 -0
- package/dist/core/ui/Toolbar/components/new/Interactive/SelectedElementInfo.module.css.d.ts +21 -0
- package/dist/core/ui/Toolbar/components/new/Interactive/SelectionModeBar.d.ts +1 -0
- package/dist/core/ui/Toolbar/components/new/Interactive/SelectionOverlay.d.ts +2 -0
- package/dist/core/ui/Toolbar/components/new/Interactive/WorkflowCard.d.ts +13 -0
- package/dist/core/ui/Toolbar/components/new/Interactive/WorkflowCard.module.css.d.ts +27 -0
- package/dist/core/ui/Toolbar/components/new/Interactive/WorkflowSection.d.ts +6 -0
- package/dist/core/ui/Toolbar/components/new/Interactive/WorkflowSection.module.css.d.ts +5 -0
- package/dist/core/ui/Toolbar/components/new/Interactive/index.d.ts +9 -0
- package/dist/core/ui/Toolbar/components/new/Interactive/utils/elementUtils.d.ts +56 -0
- package/dist/core/ui/Toolbar/components/new/Interactive/utils/ideLinks.d.ts +58 -0
- package/dist/core/ui/Toolbar/components/new/Interactive/utils/promptBuilder.d.ts +26 -0
- package/dist/core/ui/Toolbar/components/new/Interactive/utils/throttle.d.ts +10 -0
- package/dist/core/ui/Toolbar/components/new/Interactive/workflowConfigs.d.ts +36 -0
- package/dist/core/ui/Toolbar/components/new/Monitoring/EventsContent.d.ts +1 -0
- package/dist/core/ui/Toolbar/components/new/Monitoring/EventsContent.module.css.d.ts +24 -0
- package/dist/core/ui/Toolbar/components/new/SearchSection.d.ts +8 -0
- package/dist/core/ui/Toolbar/components/new/SearchSection.module.css.d.ts +3 -0
- package/dist/core/ui/Toolbar/components/new/Settings/ConnectionStatus.d.ts +5 -0
- package/dist/core/ui/Toolbar/components/new/Settings/ConnectionStatus.module.css.d.ts +6 -0
- package/dist/core/ui/Toolbar/components/new/Settings/EnvironmentSelector.d.ts +1 -0
- package/dist/core/ui/Toolbar/components/new/Settings/GeneralSettings.d.ts +1 -0
- package/dist/core/ui/Toolbar/components/new/Settings/LogoutButton.d.ts +1 -0
- package/dist/core/ui/Toolbar/components/new/Settings/LogoutButton.module.css.d.ts +1 -0
- package/dist/core/ui/Toolbar/components/new/Settings/PositionSelector.d.ts +6 -0
- package/dist/core/ui/Toolbar/components/new/Settings/ProjectSelector.d.ts +1 -0
- package/dist/core/ui/Toolbar/components/new/Settings/SettingsContent.d.ts +1 -0
- package/dist/core/ui/Toolbar/components/new/Settings/SettingsContent.module.css.d.ts +3 -0
- package/dist/core/ui/Toolbar/components/new/Settings/SettingsItem.d.ts +8 -0
- package/dist/core/ui/Toolbar/components/new/Settings/SettingsItem.module.css.d.ts +6 -0
- package/dist/core/ui/Toolbar/components/new/Settings/SettingsSection.d.ts +7 -0
- package/dist/core/ui/Toolbar/components/new/Settings/SettingsSection.module.css.d.ts +3 -0
- package/dist/core/ui/Toolbar/components/new/Settings/index.d.ts +8 -0
- package/dist/core/ui/Toolbar/components/new/SubtabDropdown.d.ts +8 -0
- package/dist/core/ui/Toolbar/components/new/SubtabDropdown.module.css.d.ts +10 -0
- package/dist/core/ui/Toolbar/components/new/TabBar.d.ts +1 -0
- package/dist/core/ui/Toolbar/components/new/TabBar.module.css.d.ts +4 -0
- package/dist/core/ui/Toolbar/components/new/Tooltip.d.ts +7 -0
- package/dist/core/ui/Toolbar/components/new/Tooltip.module.css.d.ts +2 -0
- package/dist/core/ui/Toolbar/components/new/context/ActiveSubtabProvider.d.ts +12 -0
- package/dist/core/ui/Toolbar/components/new/context/FiltersProvider.d.ts +41 -0
- package/dist/core/ui/Toolbar/components/new/context/TabSearchProvider.d.ts +10 -0
- package/dist/core/ui/Toolbar/components/new/context/index.d.ts +3 -0
- package/dist/core/ui/Toolbar/components/new/index.d.ts +10 -0
- package/dist/core/ui/Toolbar/components/new/types.d.ts +16 -0
- package/dist/core/ui/Toolbar/constants/virtualization.d.ts +1 -0
- package/dist/core/ui/Toolbar/context/DevServerProvider.d.ts +1 -5
- package/dist/core/ui/Toolbar/context/ElementSelectionProvider.d.ts +52 -0
- package/dist/core/ui/Toolbar/context/FlagSdkOverrideProvider.d.ts +5 -1
- package/dist/core/ui/Toolbar/context/api/ApiBundleProvider.d.ts +8 -0
- package/dist/core/ui/Toolbar/context/api/ApiProvider.d.ts +15 -0
- package/dist/core/ui/Toolbar/context/{AuthProvider.d.ts → api/AuthProvider.d.ts} +4 -3
- package/dist/core/ui/Toolbar/context/api/EnvironmentProvider.d.ts +12 -0
- package/dist/core/ui/Toolbar/context/api/FlagsProvider.d.ts +12 -0
- package/dist/core/ui/Toolbar/context/{IFrameProvider.d.ts → api/IFrameProvider.d.ts} +13 -11
- package/dist/core/ui/Toolbar/context/api/ProjectProvider.d.ts +17 -0
- package/dist/core/ui/Toolbar/context/api/index.d.ts +7 -0
- package/dist/core/ui/Toolbar/context/index.d.ts +7 -6
- package/dist/core/ui/Toolbar/context/state/ActiveTabProvider.d.ts +10 -0
- package/dist/core/ui/Toolbar/context/state/PluginsProvider.d.ts +16 -0
- package/dist/core/ui/Toolbar/context/{SearchProvider.d.ts → state/SearchProvider.d.ts} +2 -2
- package/dist/core/ui/Toolbar/context/state/ToolbarStateBundleProvider.d.ts +13 -0
- package/dist/core/ui/Toolbar/{hooks/useToolbarState.d.ts → context/state/ToolbarStateProvider.d.ts} +11 -11
- package/dist/core/ui/Toolbar/context/{ToolbarUIProvider.d.ts → state/ToolbarUIProvider.d.ts} +1 -1
- package/dist/core/ui/Toolbar/context/state/index.d.ts +6 -0
- package/dist/core/ui/Toolbar/context/{AnalyticsProvider.d.ts → telemetry/AnalyticsProvider.d.ts} +2 -2
- package/dist/core/ui/Toolbar/context/telemetry/TelemetryBundleProvider.d.ts +11 -0
- package/dist/core/ui/Toolbar/context/telemetry/index.d.ts +3 -0
- package/dist/core/ui/Toolbar/hooks/index.d.ts +0 -1
- package/dist/core/ui/Toolbar/types/ldApi.d.ts +40 -0
- package/dist/core/ui/Toolbar/types/toolbar.d.ts +3 -2
- package/dist/core/ui/Toolbar/utils/clipboard.d.ts +6 -0
- package/dist/core/ui/Toolbar/utils/localStorage.d.ts +9 -4
- package/dist/core/utils/analytics.d.ts +28 -0
- package/dist/flags/toolbarFlags.d.ts +4 -1
- package/dist/index.cjs +1 -3
- package/dist/index.cjs.map +1 -1
- package/dist/js/index.js +1 -3
- package/dist/js/index.js.map +1 -1
- package/dist/types/config.d.ts +11 -1
- package/package.json +16 -13
- package/dist/core/ui/Toolbar/components/Popover.css.d.ts +0 -2
- package/dist/core/ui/Toolbar/context/ApiProvider.d.ts +0 -11
- package/dist/core/ui/{Toolbar/components → Buttons}/IconButton.css.d.ts +0 -0
- package/dist/core/ui/{Toolbar/components → Buttons}/IconButton.d.ts +0 -0
- package/dist/core/ui/{Toolbar/components → Buttons}/IconLinkButton.d.ts +0 -0
- package/dist/core/ui/{Toolbar/components → Buttons}/StarButton.d.ts +0 -0
- package/dist/core/ui/{Toolbar/components → Select}/Select.css.d.ts +0 -0
- package/dist/core/ui/{Toolbar/components → Select}/Select.d.ts +0 -0
- package/dist/core/ui/Toolbar/components/{AuthenticationModal.css.d.ts → AuthenticationModal/AuthenticationModal.css.d.ts} +0 -0
- package/dist/core/ui/Toolbar/components/{AuthenticationModal.d.ts → AuthenticationModal/AuthenticationModal.d.ts} +0 -0
- package/dist/core/ui/Toolbar/components/{ActionButtonsContainer.css.d.ts → legacy/ActionButtonsContainer.css.d.ts} +0 -0
- package/dist/core/ui/Toolbar/components/{ActionButtonsContainer.d.ts → legacy/ActionButtonsContainer.d.ts} +0 -0
- package/dist/core/ui/Toolbar/components/{FlagControls.css.d.ts → legacy/FlagControls.css.d.ts} +0 -0
- package/dist/core/ui/Toolbar/{Header → components/legacy/Header}/components/ActionButtons.d.ts +0 -0
- package/dist/core/ui/Toolbar/{Header → components/legacy/Header}/components/EnvironmentLabel.d.ts +0 -0
- package/dist/core/ui/Toolbar/{Header → components/legacy/Header}/components/LogoSection.d.ts +0 -0
- package/dist/core/ui/Toolbar/{Header → components/legacy/Header}/components/SearchSection.d.ts +0 -0
- package/dist/core/ui/Toolbar/{Header → components/legacy/Header}/components/index.d.ts +1 -1
- /package/dist/core/ui/Toolbar/components/{LocalFlagControls.css.d.ts → legacy/LocalFlagControls.css.d.ts} +0 -0
- /package/dist/core/ui/Toolbar/components/{LocalObjectFlagControlListItem.css.d.ts → legacy/LocalObjectFlagControlListItem.css.d.ts} +0 -0
- /package/dist/core/ui/Toolbar/{TabContent → components/legacy/TabContent}/EventsTabContent.css.d.ts +0 -0
- /package/dist/core/ui/Toolbar/{TabContent → components/legacy/TabContent}/FlagDevServerTabContent.css.d.ts +0 -0
- /package/dist/core/ui/Toolbar/{TabContent → components/legacy/TabContent}/FlagDevServerTabContent.d.ts +0 -0
- /package/dist/core/ui/Toolbar/{TabContent → components/legacy/TabContent}/SettingsTab.css.d.ts +0 -0
- /package/dist/core/ui/Toolbar/components/{TabContentRenderer.css.d.ts → legacy/TabContentRenderer.css.d.ts} +0 -0
- /package/dist/core/ui/Toolbar/context/{InternalClientProvider.d.ts → telemetry/InternalClientProvider.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function SelectionModeBar(): import("react").ReactPortal | null;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type WorkflowType } from './workflowConfigs';
|
|
2
|
+
/**
|
|
3
|
+
* Props for the WorkflowCard component.
|
|
4
|
+
* A workflow card allows users to generate AI prompts for common development tasks
|
|
5
|
+
* like wrapping elements in feature flags or adding click tracking.
|
|
6
|
+
*/
|
|
7
|
+
export interface WorkflowCardProps {
|
|
8
|
+
/** The type of workflow this card represents */
|
|
9
|
+
workflow: WorkflowType;
|
|
10
|
+
/** Whether the workflow card is disabled (shows "Coming Soon" badge) */
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare function WorkflowCard({ workflow, disabled }: WorkflowCardProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare const card: string;
|
|
2
|
+
export declare const cardHeader: string;
|
|
3
|
+
export declare const iconContainer: string;
|
|
4
|
+
export declare const cardContent: string;
|
|
5
|
+
export declare const title: string;
|
|
6
|
+
export declare const description: string;
|
|
7
|
+
export declare const comingSoonBadge: string;
|
|
8
|
+
export declare const inputGroup: string;
|
|
9
|
+
export declare const inputLabel: string;
|
|
10
|
+
export declare const input: string;
|
|
11
|
+
export declare const actions: string;
|
|
12
|
+
export declare const actionsDisabled: string;
|
|
13
|
+
export declare const actionButton: string;
|
|
14
|
+
export declare const actionIcon: string;
|
|
15
|
+
export declare const ideIconWrapper: string;
|
|
16
|
+
export declare const ideIconSvg: string;
|
|
17
|
+
export declare const splitButtonContainer: string;
|
|
18
|
+
export declare const splitButtonGroup: string;
|
|
19
|
+
export declare const splitButtonMain: string;
|
|
20
|
+
export declare const splitButtonDropdown: string;
|
|
21
|
+
export declare const splitButtonDropdownOpen: string;
|
|
22
|
+
export declare const splitButtonDropdownSuccess: string;
|
|
23
|
+
export declare const dropdownMenu: string;
|
|
24
|
+
export declare const dropdownItem: string;
|
|
25
|
+
export declare const dropdownItemSelected: string;
|
|
26
|
+
export declare const dropdownSeparator: string;
|
|
27
|
+
export declare const preferredBadge: string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { InteractiveContent } from './InteractiveContent';
|
|
2
|
+
export { SelectionOverlay } from './SelectionOverlay';
|
|
3
|
+
export { SelectionModeBar } from './SelectionModeBar';
|
|
4
|
+
export { SelectedElementInfo } from './SelectedElementInfo';
|
|
5
|
+
export { InteractiveWrapper } from './InteractiveWrapper';
|
|
6
|
+
export { WorkflowCard } from './WorkflowCard';
|
|
7
|
+
export { WorkflowSection } from './WorkflowSection';
|
|
8
|
+
export { MCPSetupAlert } from './MCPSetupAlert';
|
|
9
|
+
export { type WorkflowType } from './workflowConfigs';
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export interface ElementAttribute {
|
|
2
|
+
name: string;
|
|
3
|
+
value: string;
|
|
4
|
+
}
|
|
5
|
+
export interface ElementInfo {
|
|
6
|
+
tagName: string;
|
|
7
|
+
id: string | null;
|
|
8
|
+
classes: string[];
|
|
9
|
+
textContent: string | null;
|
|
10
|
+
selector: string;
|
|
11
|
+
primaryIdentifier: string;
|
|
12
|
+
dataAttributes: ElementAttribute[];
|
|
13
|
+
htmlAttributes: ElementAttribute[];
|
|
14
|
+
dimensions: {
|
|
15
|
+
width: number;
|
|
16
|
+
height: number;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Checks if an element is part of the LaunchDarkly toolbar or selection UI.
|
|
21
|
+
* This is used to prevent selecting toolbar elements during element selection mode.
|
|
22
|
+
*
|
|
23
|
+
* @param element - The DOM element to check, or null
|
|
24
|
+
* @returns true if the element is part of the toolbar or selection UI, false otherwise
|
|
25
|
+
*/
|
|
26
|
+
export declare function isToolbarElement(element: Element | null): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Generates a CSS selector path for an element.
|
|
29
|
+
* Creates a readable selector path up to 4 levels deep, prioritizing IDs for uniqueness.
|
|
30
|
+
*
|
|
31
|
+
* @param element - The DOM element to generate a selector for
|
|
32
|
+
* @returns A CSS selector string (e.g., "div#container > button.submit-btn:nth-of-type(2)")
|
|
33
|
+
*/
|
|
34
|
+
export declare function getElementSelector(element: Element): string;
|
|
35
|
+
/**
|
|
36
|
+
* Gets a short display path for the element (for the hover tag).
|
|
37
|
+
* Returns a simplified identifier showing tag name, ID, or first few classes.
|
|
38
|
+
*
|
|
39
|
+
* @param element - The DOM element to get the display path for
|
|
40
|
+
* @returns A short identifier string (e.g., "button#submit" or "div.container.header")
|
|
41
|
+
*/
|
|
42
|
+
export declare function getElementDisplayPath(element: Element): string;
|
|
43
|
+
/**
|
|
44
|
+
* Extracts all relevant information about an element
|
|
45
|
+
* @param element - The DOM element to extract information from
|
|
46
|
+
* @returns ElementInfo object containing element details
|
|
47
|
+
* @throws Error if element is null, undefined, or not an instance of Element
|
|
48
|
+
*/
|
|
49
|
+
export declare function getElementInfo(element: Element): ElementInfo;
|
|
50
|
+
/**
|
|
51
|
+
* Gets the bounding rect of an element relative to the viewport
|
|
52
|
+
* @param element - The DOM element to get the bounding rect for
|
|
53
|
+
* @returns DOMRect object with element position and dimensions
|
|
54
|
+
* @throws Error if element is null, undefined, or not an instance of Element
|
|
55
|
+
*/
|
|
56
|
+
export declare function getElementRect(element: Element): DOMRect;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { PreferredIde } from '../../../../utils/localStorage';
|
|
2
|
+
export interface IdeConfig {
|
|
3
|
+
id: PreferredIde;
|
|
4
|
+
label: string;
|
|
5
|
+
icon: 'cursor' | 'windsurf' | 'vscode' | 'github-copilot';
|
|
6
|
+
}
|
|
7
|
+
export declare const IDE_CONFIGS: IdeConfig[];
|
|
8
|
+
/**
|
|
9
|
+
* Minify a prompt for URL encoding by removing unnecessary whitespace
|
|
10
|
+
* while preserving the actual content and readability.
|
|
11
|
+
* This can reduce URL length by 40-60%.
|
|
12
|
+
*/
|
|
13
|
+
export declare function minifyPromptForUrl(prompt: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* Open Cursor IDE with the prompt in composer
|
|
16
|
+
* Cursor uses cursor://anysphere.cursor-deeplink/prompt?text=<encoded_prompt>
|
|
17
|
+
* @returns true if the protocol handler was likely successful
|
|
18
|
+
*/
|
|
19
|
+
export declare function openInCursor(prompt: string): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Open Windsurf IDE with the prompt
|
|
22
|
+
* Windsurf uses windsurf://cascade?prompt=<encoded_prompt>
|
|
23
|
+
* @returns true if the protocol handler was likely successful, false if blocked
|
|
24
|
+
*/
|
|
25
|
+
export declare function openInWindsurf(prompt: string): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Open VS Code with the prompt
|
|
28
|
+
* VS Code doesn't have a direct prompt protocol, so we just open it
|
|
29
|
+
* and the user will need to paste the prompt
|
|
30
|
+
* @returns true if the protocol handler was likely successful, false if blocked
|
|
31
|
+
*/
|
|
32
|
+
export declare function openInVSCode(_prompt: string): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Open GitHub Copilot with the prompt
|
|
35
|
+
* GitHub Copilot uses https://github.com/copilot/agents?prompt=<encoded_prompt>
|
|
36
|
+
* Uses minified prompt, and if still too long, the caller should provide a condensed version.
|
|
37
|
+
* @param prompt - The prompt to use (should be condensed if full prompt is too long)
|
|
38
|
+
* @returns true if the link was opened successfully
|
|
39
|
+
*/
|
|
40
|
+
export declare function openInGitHubCopilot(prompt: string): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Get the URL length for a prompt (after minification and encoding)
|
|
43
|
+
* Useful for debugging URL length issues
|
|
44
|
+
*/
|
|
45
|
+
export declare function getGitHubCopilotUrlLength(prompt: string): number;
|
|
46
|
+
/**
|
|
47
|
+
* Open the specified IDE with the prompt
|
|
48
|
+
* @returns true if the protocol handler was likely successful, false if blocked
|
|
49
|
+
*/
|
|
50
|
+
export declare function openInIde(prompt: string, ide: PreferredIde): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Copy prompt to clipboard and open in the specified IDE
|
|
53
|
+
* @param prompt - Full prompt to copy to clipboard
|
|
54
|
+
* @param ide - The IDE to open
|
|
55
|
+
* @param urlPrompt - Optional condensed prompt for URL-based IDEs (GitHub Copilot). If not provided, uses full prompt.
|
|
56
|
+
* @returns true if both copy and IDE open were successful, false otherwise
|
|
57
|
+
*/
|
|
58
|
+
export declare function copyAndOpenInIde(prompt: string, ide: PreferredIde, urlPrompt?: string): Promise<boolean>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ElementInfo } from './elementUtils';
|
|
2
|
+
export interface FeatureFlagPromptOptions {
|
|
3
|
+
elementContext: string;
|
|
4
|
+
projectKey: string;
|
|
5
|
+
environmentKey?: string;
|
|
6
|
+
suggestedFlagKey?: string;
|
|
7
|
+
intent?: 'hide' | 'show' | 'replace' | 'experiment';
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Builds context string from element info for AI prompts
|
|
11
|
+
*/
|
|
12
|
+
export declare function buildElementContext(elementInfo: ElementInfo): string;
|
|
13
|
+
/**
|
|
14
|
+
* Builds a condensed prompt for URL-based delivery (under 8KB when encoded).
|
|
15
|
+
* Includes all essential steps but with less verbose examples.
|
|
16
|
+
*/
|
|
17
|
+
export declare function buildCondensedFeatureFlagPrompt(options: FeatureFlagPromptOptions): string;
|
|
18
|
+
/**
|
|
19
|
+
* Builds a detailed prompt for an AI agent to wrap an element in a LaunchDarkly feature flag.
|
|
20
|
+
* This prompt is designed for agents with access to LaunchDarkly MCP tools.
|
|
21
|
+
*/
|
|
22
|
+
export declare function buildFeatureFlagAgentPrompt(options: FeatureFlagPromptOptions): string;
|
|
23
|
+
/**
|
|
24
|
+
* Builds a prompt for adding click tracking to an element
|
|
25
|
+
*/
|
|
26
|
+
export declare function buildClickTrackingPrompt(elementInfo: ElementInfo, eventName: string): string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Throttles a function to execute at most once per specified delay.
|
|
3
|
+
* Ensures the function is called at regular intervals, useful for
|
|
4
|
+
* performance optimization of frequently triggered events like mousemove.
|
|
5
|
+
*
|
|
6
|
+
* @param func - The function to throttle
|
|
7
|
+
* @param delay - The delay in milliseconds between function calls
|
|
8
|
+
* @returns A throttled version of the function
|
|
9
|
+
*/
|
|
10
|
+
export declare function throttle<T extends (...args: any[]) => any>(func: T, delay: number): (...args: Parameters<T>) => void;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ElementInfo } from './utils/elementUtils';
|
|
3
|
+
/**
|
|
4
|
+
* Available workflow types for the WorkflowCard component.
|
|
5
|
+
*/
|
|
6
|
+
export type WorkflowType = 'featureFlag' | 'clickTracking';
|
|
7
|
+
/**
|
|
8
|
+
* Configuration for a single workflow type.
|
|
9
|
+
*/
|
|
10
|
+
export interface WorkflowConfig {
|
|
11
|
+
/** Icon to display in the card header */
|
|
12
|
+
icon: React.ReactNode;
|
|
13
|
+
/** Title of the workflow card */
|
|
14
|
+
title: string;
|
|
15
|
+
/** Description text explaining what the workflow does */
|
|
16
|
+
description: string;
|
|
17
|
+
/** Label for the input field */
|
|
18
|
+
inputLabel: string;
|
|
19
|
+
/** Placeholder text for the input field */
|
|
20
|
+
inputPlaceholder: string;
|
|
21
|
+
/**
|
|
22
|
+
* Builds the AI prompt given element info, project key, and user input.
|
|
23
|
+
*/
|
|
24
|
+
buildPrompt: (elementInfo: ElementInfo, projectKey: string, inputValue: string) => string;
|
|
25
|
+
/**
|
|
26
|
+
* Optional function that builds a condensed version of the prompt for URL-based IDEs
|
|
27
|
+
* (like GitHub Copilot) where URL length is limited.
|
|
28
|
+
*/
|
|
29
|
+
buildCondensedPrompt?: (elementInfo: ElementInfo, projectKey: string, inputValue: string) => string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Registry of all available workflow configurations.
|
|
33
|
+
* Each workflow knows how to build its own prompts using element context.
|
|
34
|
+
*/
|
|
35
|
+
export declare const WORKFLOW_CONFIGS: Record<WorkflowType, WorkflowConfig>;
|
|
36
|
+
export declare function getWorkflowConfig(type: WorkflowType): WorkflowConfig;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function EventsContent(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const statsHeader: string;
|
|
2
|
+
export declare const statsText: string;
|
|
3
|
+
export declare const eventInfo: string;
|
|
4
|
+
export declare const eventName: string;
|
|
5
|
+
export declare const eventMeta: string;
|
|
6
|
+
export declare const eventBadge: string;
|
|
7
|
+
export declare const eventBadgeFeature: string;
|
|
8
|
+
export declare const addButtonContainer: string;
|
|
9
|
+
export declare const addButton: string;
|
|
10
|
+
export declare const eventBadgeIdentify: string;
|
|
11
|
+
export declare const eventBadgeCustom: string;
|
|
12
|
+
export declare const eventBadgeDebug: string;
|
|
13
|
+
export declare const eventBadgeSummary: string;
|
|
14
|
+
export declare const eventBadgeDiagnostic: string;
|
|
15
|
+
export declare const eventBadgeDefault: string;
|
|
16
|
+
export declare const virtualContainer: string;
|
|
17
|
+
export declare const virtualInner: string;
|
|
18
|
+
export declare const virtualItem: string;
|
|
19
|
+
export declare const liveTailContainer: string;
|
|
20
|
+
export declare const liveTailIndicator: string;
|
|
21
|
+
export declare const liveTailDot: string;
|
|
22
|
+
export declare const liveTailText: string;
|
|
23
|
+
export declare const liveTailSubtext: string;
|
|
24
|
+
export declare const eventListItem: string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
interface SearchSectionProps {
|
|
3
|
+
searchTerm: string;
|
|
4
|
+
onSearch: (searchTerm: string) => void;
|
|
5
|
+
setSearchIsExpanded: Dispatch<SetStateAction<boolean>>;
|
|
6
|
+
}
|
|
7
|
+
export declare function SearchSection(props: SearchSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function EnvironmentSelector(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function GeneralSettings(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function LogoutButton(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const button: string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ToolbarPosition } from '../../../types/toolbar';
|
|
2
|
+
interface PositionSelectorProps {
|
|
3
|
+
currentPosition: ToolbarPosition;
|
|
4
|
+
}
|
|
5
|
+
export declare function PositionSelector({ currentPosition }: PositionSelectorProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ProjectSelector(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function SettingsContent(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface SettingsItemProps {
|
|
3
|
+
label: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare function SettingsItem({ label, description, children }: SettingsItemProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './SettingsContent';
|
|
2
|
+
export * from './GeneralSettings';
|
|
3
|
+
export * from './SettingsSection';
|
|
4
|
+
export * from './SettingsItem';
|
|
5
|
+
export * from './ProjectSelector';
|
|
6
|
+
export * from './PositionSelector';
|
|
7
|
+
export * from './ConnectionStatus';
|
|
8
|
+
export * from './LogoutButton';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SubTab, TabConfig } from './types';
|
|
2
|
+
interface SubtabDropdownProps {
|
|
3
|
+
subtabs: TabConfig[];
|
|
4
|
+
activeSubtab: SubTab | undefined;
|
|
5
|
+
onSelectSubtab: (subtab: SubTab) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function SubtabDropdown({ subtabs, activeSubtab, onSelectSubtab }: SubtabDropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const container: string;
|
|
2
|
+
export declare const trigger: string;
|
|
3
|
+
export declare const triggerOpen: string;
|
|
4
|
+
export declare const filterIcon: string;
|
|
5
|
+
export declare const label: string;
|
|
6
|
+
export declare const chevron: string;
|
|
7
|
+
export declare const chevronIcon: string;
|
|
8
|
+
export declare const menu: string;
|
|
9
|
+
export declare const menuItem: string;
|
|
10
|
+
export declare const menuItemActive: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function TabBar(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { SubTab } from '../types';
|
|
3
|
+
interface ActiveSubtabContextValue {
|
|
4
|
+
activeSubtab: SubTab | undefined;
|
|
5
|
+
setActiveSubtab: (subtab: SubTab) => void;
|
|
6
|
+
}
|
|
7
|
+
export interface ActiveSubtabProviderProps {
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export declare function ActiveSubtabProvider({ children }: ActiveSubtabProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function useActiveSubtabContext(): ActiveSubtabContextValue;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { SubTab } from '../types';
|
|
3
|
+
export interface FilterOption {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface SubtabFilterConfig {
|
|
9
|
+
subtab: SubTab;
|
|
10
|
+
options: FilterOption[];
|
|
11
|
+
defaultSelected: string[];
|
|
12
|
+
allowMultiple: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare const SUBTAB_FILTER_CONFIGS: Record<string, SubtabFilterConfig>;
|
|
15
|
+
interface FiltersContextValue {
|
|
16
|
+
getActiveFilters: (subtab: SubTab) => Set<string>;
|
|
17
|
+
getFilterConfig: (subtab: SubTab) => SubtabFilterConfig | null;
|
|
18
|
+
toggleFilter: (subtab: SubTab, filterId: string) => void;
|
|
19
|
+
setFilters: (subtab: SubTab, filterIds: string[]) => void;
|
|
20
|
+
resetFilters: (subtab: SubTab) => void;
|
|
21
|
+
hasFilters: (subtab: SubTab) => boolean;
|
|
22
|
+
hasActiveNonDefaultFilters: (subtab: SubTab) => boolean;
|
|
23
|
+
isFilterOverlayOpen: boolean;
|
|
24
|
+
openFilterOverlay: () => void;
|
|
25
|
+
closeFilterOverlay: () => void;
|
|
26
|
+
toggleFilterOverlay: () => void;
|
|
27
|
+
}
|
|
28
|
+
interface FiltersProviderProps {
|
|
29
|
+
children: ReactNode;
|
|
30
|
+
}
|
|
31
|
+
export declare function FiltersProvider({ children }: FiltersProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
export declare function useFilters(): FiltersContextValue;
|
|
33
|
+
export declare function useSubtabFilters(subtab: SubTab): {
|
|
34
|
+
activeFilters: Set<string>;
|
|
35
|
+
config: SubtabFilterConfig | null;
|
|
36
|
+
toggle: (filterId: string) => void;
|
|
37
|
+
reset: () => void;
|
|
38
|
+
hasFilters: boolean;
|
|
39
|
+
hasActiveNonDefaultFilters: boolean;
|
|
40
|
+
};
|
|
41
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TabId } from '../../../types';
|
|
2
|
+
type TabSearchContextType = {
|
|
3
|
+
searchTerms: Record<TabId, string>;
|
|
4
|
+
setSearchTerm: (tab: TabId, searchTerm: string) => void;
|
|
5
|
+
};
|
|
6
|
+
export declare function TabSearchProvider({ children }: {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare function useTabSearchContext(): TabSearchContextType;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { ActiveSubtabProvider, useActiveSubtabContext } from './ActiveSubtabProvider';
|
|
2
|
+
export { TabSearchProvider, useTabSearchContext } from './TabSearchProvider';
|
|
3
|
+
export { FiltersProvider, useFilters, useSubtabFilters, SUBTAB_FILTER_CONFIGS, type FilterOption, type SubtabFilterConfig, } from './FiltersProvider';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './ExpandedToolbarContent';
|
|
2
|
+
export * from './IconBar/IconBar';
|
|
3
|
+
export * from './TabBar';
|
|
4
|
+
export * from './ContentActions';
|
|
5
|
+
export * from './Tooltip';
|
|
6
|
+
export * from './ContentRenderer';
|
|
7
|
+
export * from './context';
|
|
8
|
+
export * from './types';
|
|
9
|
+
export * from './Settings';
|
|
10
|
+
export * from './FilterOverlay';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type FlagsSubtab = 'flags' | 'context';
|
|
2
|
+
export type MonitoringSubtab = 'events';
|
|
3
|
+
export type SettingsSubtab = 'general';
|
|
4
|
+
export type InteractiveSubtab = 'workflows';
|
|
5
|
+
export type SubTab = FlagsSubtab | MonitoringSubtab | SettingsSubtab | InteractiveSubtab;
|
|
6
|
+
export interface TabConfig {
|
|
7
|
+
id: string;
|
|
8
|
+
label: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const TAB_SUBTABS_MAP: {
|
|
11
|
+
readonly flags: TabConfig[];
|
|
12
|
+
readonly monitoring: TabConfig[];
|
|
13
|
+
readonly settings: TabConfig[];
|
|
14
|
+
readonly interactive: TabConfig[];
|
|
15
|
+
};
|
|
16
|
+
export declare function getDefaultSubtab(mainTab: string): SubTab;
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import type { FC, ReactNode } from 'react';
|
|
2
2
|
import { LdToolbarConfig, ToolbarState } from '../../../types/devServer';
|
|
3
3
|
interface DevServerContextValue {
|
|
4
|
-
state: ToolbarState
|
|
5
|
-
availableProjects: string[];
|
|
6
|
-
currentProjectKey: string | null;
|
|
7
|
-
};
|
|
4
|
+
state: ToolbarState;
|
|
8
5
|
setOverride: (flagKey: string, value: any) => Promise<void>;
|
|
9
6
|
clearOverride: (flagKey: string) => Promise<void>;
|
|
10
7
|
clearAllOverrides: () => Promise<void>;
|
|
11
8
|
refresh: () => Promise<void>;
|
|
12
|
-
switchProject: (projectKey: string) => Promise<void>;
|
|
13
9
|
}
|
|
14
10
|
export declare const useDevServerContext: () => DevServerContextValue;
|
|
15
11
|
export interface DevServerProviderProps {
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ElementInfo } from '../components/new/Interactive/utils/elementUtils';
|
|
3
|
+
/**
|
|
4
|
+
* Context value for element selection functionality.
|
|
5
|
+
* Provides state and actions for selecting DOM elements in the interactive mode.
|
|
6
|
+
*/
|
|
7
|
+
export interface ElementSelectionContextValue {
|
|
8
|
+
/** Whether the user is currently in element selection mode */
|
|
9
|
+
isSelecting: boolean;
|
|
10
|
+
/** The currently selected DOM element, or null if none selected */
|
|
11
|
+
selectedElement: HTMLElement | null;
|
|
12
|
+
/** Extracted information about the selected element */
|
|
13
|
+
selectedElementInfo: ElementInfo | null;
|
|
14
|
+
/** The element currently being hovered over during selection */
|
|
15
|
+
hoveredElement: HTMLElement | null;
|
|
16
|
+
/** Start element selection mode */
|
|
17
|
+
startSelection: () => void;
|
|
18
|
+
/** Exit element selection mode without selecting an element */
|
|
19
|
+
exitSelection: () => void;
|
|
20
|
+
/** Select an element and exit selection mode */
|
|
21
|
+
selectElement: (element: HTMLElement) => void;
|
|
22
|
+
/** Clear the current selection */
|
|
23
|
+
clearSelection: () => void;
|
|
24
|
+
/** Set the currently hovered element (used internally by SelectionOverlay) */
|
|
25
|
+
setHoveredElement: (element: HTMLElement | null) => void;
|
|
26
|
+
}
|
|
27
|
+
export interface ElementSelectionProviderProps {
|
|
28
|
+
/** Child components that will have access to the element selection context */
|
|
29
|
+
children: ReactNode;
|
|
30
|
+
/** Optional callback invoked when selection mode starts */
|
|
31
|
+
onSelectionStart?: () => void;
|
|
32
|
+
/** Optional callback invoked when selection mode ends (either by selecting or exiting) */
|
|
33
|
+
onSelectionEnd?: () => void;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Provider component that manages element selection state for the interactive mode.
|
|
37
|
+
* Wraps components that need access to element selection functionality.
|
|
38
|
+
*
|
|
39
|
+
* @param props - The provider props
|
|
40
|
+
* @param props.children - Child components
|
|
41
|
+
* @param props.onSelectionStart - Optional callback when selection starts
|
|
42
|
+
* @param props.onSelectionEnd - Optional callback when selection ends
|
|
43
|
+
*/
|
|
44
|
+
export declare function ElementSelectionProvider({ children, onSelectionStart, onSelectionEnd, }: ElementSelectionProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
45
|
+
/**
|
|
46
|
+
* Hook to access the element selection context.
|
|
47
|
+
* Must be used within an ElementSelectionProvider.
|
|
48
|
+
*
|
|
49
|
+
* @returns The element selection context value
|
|
50
|
+
* @throws Error if used outside of ElementSelectionProvider
|
|
51
|
+
*/
|
|
52
|
+
export declare function useElementSelection(): ElementSelectionContextValue;
|