@launchdarkly/toolbar 2.4.1-beta.1 → 2.5.1-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/cdn/toolbar.min.js +38 -34
- package/dist/core/ui/Buttons/IconButton.d.ts +2 -1
- package/dist/core/ui/JsonEditor/JsonEditor.d.ts +2 -1
- package/dist/core/ui/Toolbar/components/AuthenticationModal/AuthenticationModal.d.ts +1 -1
- package/dist/core/ui/Toolbar/components/{FlagKeyWithCopy.css.d.ts → CopyableText.css.d.ts} +1 -1
- package/dist/core/ui/Toolbar/components/CopyableText.d.ts +18 -0
- package/dist/core/ui/Toolbar/components/icons/index.d.ts +1 -0
- package/dist/core/ui/Toolbar/components/index.d.ts +1 -0
- package/dist/core/ui/Toolbar/components/legacy/ExpandedToolbarContentLegacy.d.ts +1 -0
- package/dist/core/ui/Toolbar/components/new/Contexts/AddContextForm.d.ts +6 -0
- package/dist/core/ui/Toolbar/components/new/Contexts/AddContextForm.module.css.d.ts +14 -0
- package/dist/core/ui/Toolbar/components/new/Contexts/ContextItem.d.ts +9 -0
- package/dist/core/ui/Toolbar/components/new/Contexts/ContextItem.module.css.d.ts +19 -0
- package/dist/core/ui/Toolbar/components/new/Contexts/ContextList.d.ts +1 -0
- package/dist/core/ui/Toolbar/components/new/Contexts/ContextList.module.css.d.ts +8 -0
- package/dist/core/ui/Toolbar/components/new/Contexts/ContextListContent.d.ts +1 -0
- package/dist/core/ui/Toolbar/components/new/Contexts/index.d.ts +4 -0
- package/dist/core/ui/Toolbar/components/new/context/TabSearchProvider.d.ts +7 -5
- package/dist/core/ui/Toolbar/components/new/types.d.ts +1 -1
- package/dist/core/ui/Toolbar/context/api/ContextsProvider.d.ts +18 -0
- package/dist/core/ui/Toolbar/context/api/index.d.ts +1 -0
- package/dist/core/ui/Toolbar/types/ldApi.d.ts +7 -0
- package/dist/core/ui/Toolbar/utils/context.d.ts +15 -0
- package/dist/core/ui/Toolbar/utils/localStorage.d.ts +7 -0
- package/dist/core/utils/analytics.d.ts +28 -0
- package/dist/index.cjs +1 -1
- package/dist/js/index.js +1 -1
- package/package.json +4 -4
- package/dist/core/ui/Toolbar/components/FlagKeyWithCopy.d.ts +0 -6
|
@@ -2,10 +2,11 @@ import React from 'react';
|
|
|
2
2
|
interface IconButtonProps {
|
|
3
3
|
icon: React.ReactNode;
|
|
4
4
|
label: string;
|
|
5
|
-
onClick: () => void;
|
|
5
|
+
onClick: (event: React.MouseEvent) => void;
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
className?: string;
|
|
8
8
|
size?: 'small' | 'medium' | 'large';
|
|
9
|
+
title?: string;
|
|
9
10
|
}
|
|
10
11
|
export declare function IconButton(props: IconButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
11
12
|
export {};
|
|
@@ -6,12 +6,13 @@ interface JsonEditorProps {
|
|
|
6
6
|
onFocus?: () => void;
|
|
7
7
|
onBlur?: (e: React.FocusEvent<HTMLDivElement>, value: string) => void;
|
|
8
8
|
onChange?: (value: string, viewUpdate: ViewUpdate) => void;
|
|
9
|
-
onLintErrors
|
|
9
|
+
onLintErrors?: (errors: Diagnostic[]) => void;
|
|
10
10
|
initialState?: {
|
|
11
11
|
startCursorAtLine?: number;
|
|
12
12
|
autoFocus?: boolean;
|
|
13
13
|
};
|
|
14
14
|
onEditorHeightChange: (height: number) => void;
|
|
15
|
+
readOnly?: boolean;
|
|
15
16
|
}
|
|
16
17
|
export declare function JsonEditor(props: JsonEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
17
18
|
export {};
|
|
@@ -2,5 +2,5 @@ interface AuthenticationModalProps {
|
|
|
2
2
|
isOpen: boolean;
|
|
3
3
|
onClose: () => void;
|
|
4
4
|
}
|
|
5
|
-
export declare function AuthenticationModal(props: AuthenticationModalProps):
|
|
5
|
+
export declare function AuthenticationModal(props: AuthenticationModalProps): null;
|
|
6
6
|
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
interface CopyableTextProps {
|
|
2
|
+
/** The text to display and copy to clipboard */
|
|
3
|
+
text: string;
|
|
4
|
+
/** Optional callback fired after copying (useful for analytics) */
|
|
5
|
+
onCopy?: (text: string) => void;
|
|
6
|
+
/** Custom aria-label for accessibility. Defaults to "Copy {text} to clipboard" */
|
|
7
|
+
ariaLabel?: string;
|
|
8
|
+
/** Custom title tooltip. Defaults to "Copy {text} to clipboard" */
|
|
9
|
+
title?: string;
|
|
10
|
+
/** Additional CSS class name */
|
|
11
|
+
className?: string;
|
|
12
|
+
/** Custom tooltip text shown after copying. Defaults to "Copied!" */
|
|
13
|
+
copiedMessage?: string;
|
|
14
|
+
/** Duration in ms to show the copied tooltip. Defaults to 2000 */
|
|
15
|
+
copiedDuration?: number;
|
|
16
|
+
}
|
|
17
|
+
export declare function CopyableText({ text, onCopy, ariaLabel, title, className, copiedMessage, copiedDuration, }: CopyableTextProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { ActionButtonsContainer } from './legacy/ActionButtonsContainer';
|
|
2
2
|
export { CircleLogo } from './CircleLogo';
|
|
3
3
|
export { ConnectionStatus } from './ConnectionStatus';
|
|
4
|
+
export { CopyableText } from './CopyableText';
|
|
4
5
|
export { DoNotTrackWarning } from './DoNotTrackWarning';
|
|
5
6
|
export { LaunchDarklyIcon } from './icons/LaunchDarklyIcon';
|
|
6
7
|
export { StatusDot } from './StatusDot';
|
|
@@ -20,6 +20,7 @@ interface ExpandedToolbarContentProps {
|
|
|
20
20
|
onHeaderMouseDown?: (event: React.MouseEvent) => void;
|
|
21
21
|
reloadOnFlagChangeIsEnabled: boolean;
|
|
22
22
|
onToggleReloadOnFlagChange: () => void;
|
|
23
|
+
onOpenAuthModal?: () => void;
|
|
23
24
|
}
|
|
24
25
|
export declare const ExpandedToolbarContentLegacy: React.ForwardRefExoticComponent<ExpandedToolbarContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
25
26
|
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const container: string;
|
|
2
|
+
export declare const header: string;
|
|
3
|
+
export declare const title: string;
|
|
4
|
+
export declare const closeButton: string;
|
|
5
|
+
export declare const form: string;
|
|
6
|
+
export declare const field: string;
|
|
7
|
+
export declare const label: string;
|
|
8
|
+
export declare const required: string;
|
|
9
|
+
export declare const input: string;
|
|
10
|
+
export declare const jsonEditorContainer: string;
|
|
11
|
+
export declare const errorText: string;
|
|
12
|
+
export declare const actions: string;
|
|
13
|
+
export declare const cancelButton: string;
|
|
14
|
+
export declare const submitButton: string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Context } from '../../../types/ldApi';
|
|
2
|
+
interface ContextItemProps {
|
|
3
|
+
context: Context;
|
|
4
|
+
isActiveContext: boolean;
|
|
5
|
+
handleHeightChange?: (index: number, height: number) => void;
|
|
6
|
+
index?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function ContextItem({ context, isActiveContext, handleHeightChange, index }: ContextItemProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const container: string;
|
|
2
|
+
export declare const header: string;
|
|
3
|
+
export declare const containerActive: string;
|
|
4
|
+
export declare const containerClickable: string;
|
|
5
|
+
export declare const info: string;
|
|
6
|
+
export declare const nameRow: string;
|
|
7
|
+
export declare const name: string;
|
|
8
|
+
export declare const keyRow: string;
|
|
9
|
+
export declare const key: string;
|
|
10
|
+
export declare const kindBadge: string;
|
|
11
|
+
export declare const anonymousBadge: string;
|
|
12
|
+
export declare const activeDot: string;
|
|
13
|
+
export declare const actions: string;
|
|
14
|
+
export declare const deleteButton: string;
|
|
15
|
+
export declare const iconButton: string;
|
|
16
|
+
export declare const expandButton: string;
|
|
17
|
+
export declare const chevron: string;
|
|
18
|
+
export declare const chevronExpanded: string;
|
|
19
|
+
export declare const editActions: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ContextList(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const container: string;
|
|
2
|
+
export declare const statsHeader: string;
|
|
3
|
+
export declare const statsText: string;
|
|
4
|
+
export declare const addButton: string;
|
|
5
|
+
export declare const scrollContainer: string;
|
|
6
|
+
export declare const virtualInner: string;
|
|
7
|
+
export declare const loadingMore: string;
|
|
8
|
+
export declare const loadingMoreText: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ContextListContent(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type
|
|
3
|
-
searchTerms: Record<
|
|
4
|
-
setSearchTerm: (
|
|
1
|
+
import { SubTab } from '../types';
|
|
2
|
+
type SubTabSearchContextType = {
|
|
3
|
+
searchTerms: Record<SubTab, string>;
|
|
4
|
+
setSearchTerm: (subtab: SubTab, searchTerm: string) => void;
|
|
5
|
+
clearSearchTerm: (subtab: SubTab) => void;
|
|
6
|
+
clearAllSearchTerms: () => void;
|
|
5
7
|
};
|
|
6
8
|
export declare function TabSearchProvider({ children }: {
|
|
7
9
|
children: React.ReactNode;
|
|
8
10
|
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export declare function useTabSearchContext():
|
|
11
|
+
export declare function useTabSearchContext(): SubTabSearchContextType;
|
|
10
12
|
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Context } from '../../types/ldApi';
|
|
2
|
+
interface ContextsContextType {
|
|
3
|
+
contexts: Context[];
|
|
4
|
+
filter: string;
|
|
5
|
+
setFilter: (filter: string) => void;
|
|
6
|
+
addContext: (context: Context) => void;
|
|
7
|
+
removeContext: (id: string) => void;
|
|
8
|
+
updateContext: (id: string, newContext: Context) => void;
|
|
9
|
+
setContext: (context: Context) => Promise<void>;
|
|
10
|
+
activeContext: Context | null;
|
|
11
|
+
isAddFormOpen: boolean;
|
|
12
|
+
setIsAddFormOpen: (isOpen: boolean) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare const ContextsProvider: ({ children }: {
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare function useContextsContext(): ContextsContextType;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { LDContext } from 'launchdarkly-js-client-sdk';
|
|
2
|
+
import { Context } from '../types/ldApi';
|
|
3
|
+
/**
|
|
4
|
+
* Generates a unique ID for a context
|
|
5
|
+
*/
|
|
6
|
+
export declare function generateContextId(): string;
|
|
7
|
+
/**
|
|
8
|
+
* Extracts normalized context info from an LDContext
|
|
9
|
+
* Handles both single-kind and multi-kind contexts
|
|
10
|
+
*/
|
|
11
|
+
export declare function extractContextInfo(ldContext: LDContext | undefined): Context | null;
|
|
12
|
+
/**
|
|
13
|
+
* Helper function to check if a given context matches the current SDK context
|
|
14
|
+
*/
|
|
15
|
+
export declare function isCurrentContext(currentContext: Context | null, contextKind: string, contextKey: string): boolean;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Context } from '../types/ldApi';
|
|
1
2
|
import { ToolbarPosition } from '../types/toolbar';
|
|
2
3
|
export declare const TOOLBAR_STORAGE_KEYS: {
|
|
3
4
|
readonly ENVIRONMENT: "ld-toolbar-environment";
|
|
@@ -6,6 +7,8 @@ export declare const TOOLBAR_STORAGE_KEYS: {
|
|
|
6
7
|
readonly PROJECT: "ld-toolbar-project";
|
|
7
8
|
readonly STARRED_FLAGS: "ld-toolbar-starred-flags";
|
|
8
9
|
readonly MCP_ALERT_DISMISSED: "ld-toolbar-mcp-alert-dismissed";
|
|
10
|
+
readonly CONTEXTS: "ld-toolbar-contexts";
|
|
11
|
+
readonly ACTIVE_CONTEXT: "ld-toolbar-active-context";
|
|
9
12
|
};
|
|
10
13
|
export type PreferredIde = 'cursor' | 'windsurf' | 'vscode' | 'github-copilot';
|
|
11
14
|
export declare const PREFERRED_IDES: PreferredIde[];
|
|
@@ -28,3 +31,7 @@ export declare function savePreferredIde(ide: PreferredIde): void;
|
|
|
28
31
|
export declare function loadPreferredIde(): PreferredIde;
|
|
29
32
|
export declare function saveMCPAlertDismissed(dismissed: boolean): void;
|
|
30
33
|
export declare function loadMCPAlertDismissed(): boolean;
|
|
34
|
+
export declare function loadContexts(): Array<Context>;
|
|
35
|
+
export declare function saveContexts(contexts: Array<Context>): void;
|
|
36
|
+
export declare function loadActiveContext(): Context | null;
|
|
37
|
+
export declare function saveActiveContext(context: Context | null): void;
|
|
@@ -102,4 +102,32 @@ export declare class ToolbarAnalytics {
|
|
|
102
102
|
* Track flag key copy
|
|
103
103
|
*/
|
|
104
104
|
trackFlagKeyCopy(flagKey: string): void;
|
|
105
|
+
/**
|
|
106
|
+
* Track context added
|
|
107
|
+
*/
|
|
108
|
+
trackContextAdded(contextKind: string, contextKey: string, isMultiKind: boolean): void;
|
|
109
|
+
/**
|
|
110
|
+
* Track context removed
|
|
111
|
+
*/
|
|
112
|
+
trackContextRemoved(contextKind: string, contextKey: string): void;
|
|
113
|
+
/**
|
|
114
|
+
* Track context updated
|
|
115
|
+
*/
|
|
116
|
+
trackContextUpdated(oldKind: string, oldKey: string, newKind: string, newKey: string): void;
|
|
117
|
+
/**
|
|
118
|
+
* Track context selected/activated
|
|
119
|
+
*/
|
|
120
|
+
trackContextSelected(contextKind: string, contextKey: string): void;
|
|
121
|
+
/**
|
|
122
|
+
* Track context edit started
|
|
123
|
+
*/
|
|
124
|
+
trackContextEditStarted(contextKind: string, contextKey: string): void;
|
|
125
|
+
/**
|
|
126
|
+
* Track context edit cancelled
|
|
127
|
+
*/
|
|
128
|
+
trackContextEditCancelled(contextKind: string, contextKey: string): void;
|
|
129
|
+
/**
|
|
130
|
+
* Track context key copy
|
|
131
|
+
*/
|
|
132
|
+
trackContextKeyCopy(contextKey: string): void;
|
|
105
133
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -552,7 +552,7 @@ async function lazyLoad(signal, url) {
|
|
|
552
552
|
throw new Error(`Could not load LaunchDarkly developer toolbar bundle from ${url}`);
|
|
553
553
|
}
|
|
554
554
|
}
|
|
555
|
-
var package_namespaceObject = JSON.parse('{"rE":"2.
|
|
555
|
+
var package_namespaceObject = JSON.parse('{"rE":"2.5.1-beta.1"}');
|
|
556
556
|
function useLaunchDarklyToolbar(args) {
|
|
557
557
|
const { toolbarBundleUrl, enabled, ...initConfig } = args;
|
|
558
558
|
const configRef = (0, external_react_namespaceObject.useRef)(null);
|
package/dist/js/index.js
CHANGED
|
@@ -518,7 +518,7 @@ async function lazyLoad(signal, url) {
|
|
|
518
518
|
throw new Error(`Could not load LaunchDarkly developer toolbar bundle from ${url}`);
|
|
519
519
|
}
|
|
520
520
|
}
|
|
521
|
-
var package_namespaceObject = JSON.parse('{"rE":"2.
|
|
521
|
+
var package_namespaceObject = JSON.parse('{"rE":"2.5.1-beta.1"}');
|
|
522
522
|
function useLaunchDarklyToolbar(args) {
|
|
523
523
|
const { toolbarBundleUrl, enabled, ...initConfig } = args;
|
|
524
524
|
const configRef = useRef(null);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"private": false,
|
|
3
3
|
"name": "@launchdarkly/toolbar",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.5.1-beta.1",
|
|
5
5
|
"description": "A framework-agnostic developer toolbar for interacting with LaunchDarkly during development",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"launchdarkly",
|
|
@@ -84,12 +84,12 @@
|
|
|
84
84
|
"@vanilla-extract/webpack-plugin": "^2.3.24",
|
|
85
85
|
"@vitest/coverage-v8": "4.0.15",
|
|
86
86
|
"css-loader": "^7.1.2",
|
|
87
|
-
"jsdom": "^27.
|
|
87
|
+
"jsdom": "^27.3.0",
|
|
88
88
|
"launchdarkly-js-client-sdk": "^3.9.0",
|
|
89
89
|
"motion": "^12.23.26",
|
|
90
90
|
"oxlint": "^1.32.0",
|
|
91
|
-
"react": "^19.2.
|
|
92
|
-
"react-dom": "^19.2.
|
|
91
|
+
"react": "^19.2.3",
|
|
92
|
+
"react-dom": "^19.2.3",
|
|
93
93
|
"storybook": "^10.1.4",
|
|
94
94
|
"storybook-addon-rslib": "^3.1.0",
|
|
95
95
|
"storybook-react-rsbuild": "^3.1.0",
|