@launchdarkly/toolbar 1.2.0 → 1.3.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 +7 -12
- package/dist/core/ui/Toolbar/Header/Header.d.ts +1 -0
- package/dist/core/ui/Toolbar/Header/components/ActionButtons.d.ts +1 -0
- package/dist/core/ui/Toolbar/LaunchDarklyToolbar.d.ts +1 -0
- package/dist/core/ui/Toolbar/TabContent/SettingsTabContent.d.ts +2 -0
- package/dist/core/ui/Toolbar/components/AuthenticationModal.css.d.ts +1 -0
- package/dist/core/ui/Toolbar/components/AuthenticationModal.d.ts +6 -0
- package/dist/core/ui/Toolbar/components/ExpandedToolbarContent.d.ts +2 -0
- package/dist/core/ui/Toolbar/components/Select.css.d.ts +12 -0
- package/dist/core/ui/Toolbar/components/Select.d.ts +18 -0
- package/dist/core/ui/Toolbar/components/TabContentRenderer.d.ts +2 -0
- package/dist/core/ui/Toolbar/components/icons/PersonPassword.d.ts +5 -0
- package/dist/core/ui/Toolbar/components/icons/index.d.ts +1 -0
- package/dist/core/ui/Toolbar/context/ApiProvider.d.ts +11 -0
- package/dist/core/ui/Toolbar/context/AuthProvider.d.ts +12 -0
- package/dist/core/ui/Toolbar/context/IFrameProvider.d.ts +24 -0
- package/dist/core/ui/Toolbar/hooks/useToolbarState.d.ts +2 -0
- package/dist/core/ui/Toolbar/utils/localStorage.d.ts +4 -0
- package/dist/core/ui/Toolbar/utils/oauthPopup.d.ts +4 -0
- package/dist/index.cjs +1 -1
- package/dist/js/index.js +1 -1
- package/dist/types/config.d.ts +6 -0
- package/package.json +9 -9
|
@@ -10,6 +10,7 @@ export interface LdToolbarProps {
|
|
|
10
10
|
export declare function LdToolbar(props: LdToolbarProps): import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
export interface LaunchDarklyToolbarProps {
|
|
12
12
|
baseUrl?: string;
|
|
13
|
+
authUrl?: string;
|
|
13
14
|
devServerUrl?: string;
|
|
14
15
|
projectKey?: string;
|
|
15
16
|
flagOverridePlugin?: IFlagOverridePlugin;
|
|
@@ -5,6 +5,8 @@ interface SettingsTabContentProps {
|
|
|
5
5
|
onToggleReloadOnFlagChange: () => void;
|
|
6
6
|
isAutoCollapseEnabled: boolean;
|
|
7
7
|
onToggleAutoCollapse: () => void;
|
|
8
|
+
optInToNewFeatures: boolean;
|
|
9
|
+
onToggleOptInToNewFeatures: () => void;
|
|
8
10
|
}
|
|
9
11
|
export declare function SettingsTabContent(props: SettingsTabContentProps): import("react/jsx-runtime").JSX.Element;
|
|
10
12
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const iframeContainer: string;
|
|
@@ -20,6 +20,8 @@ interface ExpandedToolbarContentProps {
|
|
|
20
20
|
onHeaderMouseDown?: (event: React.MouseEvent) => void;
|
|
21
21
|
reloadOnFlagChangeIsEnabled: boolean;
|
|
22
22
|
onToggleReloadOnFlagChange: () => void;
|
|
23
|
+
optInToNewFeatures: boolean;
|
|
24
|
+
onToggleOptInToNewFeatures: () => void;
|
|
23
25
|
}
|
|
24
26
|
export declare const ExpandedToolbarContent: React.ForwardRefExoticComponent<ExpandedToolbarContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
25
27
|
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const selectContainer: string;
|
|
2
|
+
export declare const trigger: string;
|
|
3
|
+
export declare const disabled: string;
|
|
4
|
+
export declare const value: string;
|
|
5
|
+
export declare const placeholder: string;
|
|
6
|
+
export declare const icon: string;
|
|
7
|
+
export declare const iconOpen: string;
|
|
8
|
+
export declare const dropdown: string;
|
|
9
|
+
export declare const list: string;
|
|
10
|
+
export declare const option: string;
|
|
11
|
+
export declare const focused: string;
|
|
12
|
+
export declare const selected: string;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface SelectOption {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
value?: any;
|
|
6
|
+
}
|
|
7
|
+
export interface SelectProps {
|
|
8
|
+
selectedKey?: string | null;
|
|
9
|
+
onSelectionChange?: (key: string | null) => void;
|
|
10
|
+
'aria-label'?: string;
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
'data-theme'?: 'dark' | 'light';
|
|
13
|
+
className?: string;
|
|
14
|
+
isDisabled?: boolean;
|
|
15
|
+
children?: ReactNode;
|
|
16
|
+
options: SelectOption[];
|
|
17
|
+
}
|
|
18
|
+
export declare function Select(props: SelectProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -11,6 +11,8 @@ interface TabContentRendererProps {
|
|
|
11
11
|
onToggleReloadOnFlagChange: () => void;
|
|
12
12
|
isAutoCollapseEnabled: boolean;
|
|
13
13
|
onToggleAutoCollapse: () => void;
|
|
14
|
+
optInToNewFeatures: boolean;
|
|
15
|
+
onToggleOptInToNewFeatures: () => void;
|
|
14
16
|
}
|
|
15
17
|
export declare function TabContentRenderer(props: TabContentRendererProps): import("react/jsx-runtime").JSX.Element | null;
|
|
16
18
|
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface ApiProviderContextValue {
|
|
2
|
+
getFlag: (flagKey: string) => Promise<any>;
|
|
3
|
+
}
|
|
4
|
+
export interface ApiProviderProps {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare function ApiProvider({ children }: {
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function useApi(): ApiProviderContextValue;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
type AuthProviderType = {
|
|
3
|
+
authenticated: boolean;
|
|
4
|
+
authenticating: boolean;
|
|
5
|
+
loading: boolean;
|
|
6
|
+
setAuthenticating: Dispatch<SetStateAction<boolean>>;
|
|
7
|
+
};
|
|
8
|
+
export declare function AuthProvider({ children }: {
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function useAuthContext(): AuthProviderType;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
export declare const IFRAME_API_MESSAGES: {
|
|
3
|
+
AUTHENTICATION: {
|
|
4
|
+
authenticated: string;
|
|
5
|
+
authenticationRequired: string;
|
|
6
|
+
error: string;
|
|
7
|
+
};
|
|
8
|
+
GET_FLAG: {
|
|
9
|
+
request: string;
|
|
10
|
+
response: string;
|
|
11
|
+
error: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
interface IFrameProviderProps {
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
authUrl: string;
|
|
17
|
+
}
|
|
18
|
+
type IFrameProviderType = {
|
|
19
|
+
ref: RefObject<HTMLIFrameElement | null>;
|
|
20
|
+
iframeSrc: string;
|
|
21
|
+
};
|
|
22
|
+
export declare function IFrameProvider({ children, authUrl }: IFrameProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare function useIFrameContext(): IFrameProviderType;
|
|
24
|
+
export {};
|
|
@@ -14,12 +14,14 @@ export interface UseToolbarStateReturn {
|
|
|
14
14
|
hasBeenExpanded: boolean;
|
|
15
15
|
reloadOnFlagChangeIsEnabled: boolean;
|
|
16
16
|
isAutoCollapseEnabled: boolean;
|
|
17
|
+
optInToNewFeatures: boolean;
|
|
17
18
|
toolbarRef: React.RefObject<HTMLDivElement | null>;
|
|
18
19
|
handleTabChange: (tabId: string) => void;
|
|
19
20
|
handleClose: () => void;
|
|
20
21
|
handleSearch: (newSearchTerm: string) => void;
|
|
21
22
|
handleToggleReloadOnFlagChange: () => void;
|
|
22
23
|
handleToggleAutoCollapse: () => void;
|
|
24
|
+
handleToggleOptInToNewFeatures: () => void;
|
|
23
25
|
handleCircleClick: () => void;
|
|
24
26
|
setIsAnimating: Dispatch<SetStateAction<boolean>>;
|
|
25
27
|
setSearchIsExpanded: Dispatch<SetStateAction<boolean>>;
|
|
@@ -3,12 +3,14 @@ export declare const TOOLBAR_STORAGE_KEYS: {
|
|
|
3
3
|
readonly SETTINGS: "ld-toolbar-settings";
|
|
4
4
|
readonly DISABLED: "ld-toolbar-disabled";
|
|
5
5
|
readonly PROJECT: "ld-toolbar-project";
|
|
6
|
+
readonly OPT_IN_TO_NEW_FEATURES: "ld-toolbar-opt-in-to-new-features";
|
|
6
7
|
readonly STARRED_FLAGS: "ld-toolbar-starred-flags";
|
|
7
8
|
};
|
|
8
9
|
export interface ToolbarSettings {
|
|
9
10
|
position: ToolbarPosition;
|
|
10
11
|
reloadOnFlagChange: boolean;
|
|
11
12
|
autoCollapse: boolean;
|
|
13
|
+
optInToNewFeatures: boolean;
|
|
12
14
|
}
|
|
13
15
|
export declare const DEFAULT_SETTINGS: ToolbarSettings;
|
|
14
16
|
export declare function saveToolbarPosition(position: ToolbarPosition): void;
|
|
@@ -17,5 +19,7 @@ export declare function saveToolbarAutoCollapse(autoCollapse: boolean): void;
|
|
|
17
19
|
export declare function loadToolbarAutoCollapse(): boolean;
|
|
18
20
|
export declare function saveReloadOnFlagChange(isReloadOnFlagChange: boolean): void;
|
|
19
21
|
export declare function loadReloadOnFlagChange(): boolean;
|
|
22
|
+
export declare function saveOptInToNewFeatures(optInToNewFeatures: boolean): void;
|
|
23
|
+
export declare function loadOptInToNewFeatures(): boolean;
|
|
20
24
|
export declare function loadStarredFlags(): Set<string>;
|
|
21
25
|
export declare function saveStarredFlags(starredFlags: Set<string>): void;
|
package/dist/index.cjs
CHANGED
package/dist/js/index.js
CHANGED
package/dist/types/config.d.ts
CHANGED
|
@@ -7,6 +7,12 @@ export interface ToolbarConfig {
|
|
|
7
7
|
* Default `https://app.launchdarkly.com`
|
|
8
8
|
*/
|
|
9
9
|
baseUrl?: string;
|
|
10
|
+
/**
|
|
11
|
+
* The LaunchDarkly Auth URL the toolbar should use when authenticating.
|
|
12
|
+
*
|
|
13
|
+
* Default `https://integrations.launchdarkly.com`
|
|
14
|
+
*/
|
|
15
|
+
authUrl?: string;
|
|
10
16
|
/**
|
|
11
17
|
* The Dev Server URL (if you have a local instance of LaunchDarkly running). If
|
|
12
18
|
* provided, will set the toolbar to run in Dev Server mode.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"private": false,
|
|
3
3
|
"name": "@launchdarkly/toolbar",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.3.1",
|
|
5
5
|
"description": "A React component that provides a developer-friendly toolbar for interacting with LaunchDarkly during development",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"launchdarkly",
|
|
@@ -57,28 +57,28 @@
|
|
|
57
57
|
"@lezer/highlight": "^1.2.3",
|
|
58
58
|
"@react-aria/focus": "^3.21.2",
|
|
59
59
|
"@react-stately/flags": "^3.1.2",
|
|
60
|
-
"@rsbuild/core": "^1.6.
|
|
60
|
+
"@rsbuild/core": "^1.6.6",
|
|
61
61
|
"@rsbuild/plugin-react": "^1.4.2",
|
|
62
62
|
"@rslib/core": "^0.17.0",
|
|
63
63
|
"@storybook/addon-docs": "^10.0.7",
|
|
64
64
|
"@storybook/addon-essentials": "^9.0.0-alpha.12",
|
|
65
65
|
"@storybook/addon-interactions": "^9.0.0-alpha.10",
|
|
66
|
-
"@storybook/addon-links": "^10.0.
|
|
67
|
-
"@storybook/addon-onboarding": "^10.0.
|
|
66
|
+
"@storybook/addon-links": "^10.0.7",
|
|
67
|
+
"@storybook/addon-onboarding": "^10.0.7",
|
|
68
68
|
"@storybook/blocks": "^9.0.0-alpha.17",
|
|
69
|
-
"@storybook/react": "^10.0.
|
|
69
|
+
"@storybook/react": "^10.0.7",
|
|
70
70
|
"@storybook/react-vite": "^9.0.5",
|
|
71
71
|
"@storybook/test": "^9.0.0-alpha.2",
|
|
72
72
|
"@tanstack/react-virtual": "^3.13.12",
|
|
73
73
|
"@testing-library/jest-dom": "^6.9.1",
|
|
74
74
|
"@testing-library/react": "^16.3.0",
|
|
75
|
-
"@types/node": "^24.
|
|
76
|
-
"@types/react": "19.2.
|
|
75
|
+
"@types/node": "^24.10.1",
|
|
76
|
+
"@types/react": "19.2.4",
|
|
77
77
|
"@types/react-dom": "19.2.2",
|
|
78
78
|
"@vanilla-extract/css": "^1.17.4",
|
|
79
79
|
"@vanilla-extract/vite-plugin": "^5.1.1",
|
|
80
80
|
"@vanilla-extract/webpack-plugin": "^2.3.22",
|
|
81
|
-
"@vitest/coverage-v8": "4.0.
|
|
81
|
+
"@vitest/coverage-v8": "4.0.8",
|
|
82
82
|
"css-loader": "^7.1.2",
|
|
83
83
|
"jsdom": "^27.2.0",
|
|
84
84
|
"launchdarkly-js-client-sdk": "^3.9.0",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"react-dom": "^19.2.0",
|
|
89
89
|
"storybook": "^9.1.16",
|
|
90
90
|
"storybook-addon-rslib": "^2.1.4",
|
|
91
|
-
"storybook-react-rsbuild": "^2.1.
|
|
91
|
+
"storybook-react-rsbuild": "^2.1.4",
|
|
92
92
|
"typescript": "^5.9.3",
|
|
93
93
|
"vitest": "^4.0.8"
|
|
94
94
|
},
|