@launchdarkly/toolbar 2.0.0-beta.1 → 2.1.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/README.md +7 -5
- package/cdn/toolbar.min.js +984 -10
- package/cdn/toolbar.min.js.LICENSE.txt +14 -0
- package/dist/core/services/DevServerClient.d.ts +10 -8
- package/dist/core/services/FlagStateManager.d.ts +2 -0
- package/dist/core/tests/mocks/providers.d.ts +132 -0
- package/dist/core/types/devServer.d.ts +2 -3
- package/dist/core/ui/{Toolbar/components → Buttons}/IconButton.d.ts +2 -1
- package/dist/core/ui/{Toolbar/components → Buttons}/StarButton.css.d.ts +1 -0
- package/dist/core/ui/JsonEditor/JsonEditor.d.ts +2 -1
- package/dist/core/ui/Toolbar/LaunchDarklyToolbar.d.ts +0 -1
- package/dist/core/ui/Toolbar/components/{AuthenticationModal.d.ts → AuthenticationModal/AuthenticationModal.d.ts} +1 -1
- package/dist/core/ui/Toolbar/components/CopyableText.css.d.ts +4 -0
- package/dist/core/ui/Toolbar/components/CopyableText.d.ts +18 -0
- package/dist/core/ui/Toolbar/components/FilterOptions/FilterOptions.css.d.ts +1 -0
- package/dist/core/ui/Toolbar/components/FilterOptions/FilterOptions.d.ts +1 -0
- package/dist/core/ui/Toolbar/components/FilterOptions/ShareUrlButton.css.d.ts +2 -0
- package/dist/core/ui/Toolbar/components/FilterOptions/ShareUrlButton.d.ts +7 -0
- package/dist/core/ui/Toolbar/components/LoadingScreen/LoadingScreen.css.d.ts +7 -0
- package/dist/core/ui/Toolbar/components/LoadingScreen/LoadingScreen.d.ts +5 -0
- package/dist/core/ui/Toolbar/components/LoadingScreen/index.d.ts +1 -0
- package/dist/core/ui/Toolbar/components/ShareStatePopover/ShareStatePopover.css.d.ts +10 -0
- package/dist/core/ui/Toolbar/components/ShareStatePopover/ShareStatePopover.d.ts +15 -0
- package/dist/core/ui/Toolbar/components/ShareStatePopover/index.d.ts +2 -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/ShareIcon.d.ts +5 -0
- package/dist/core/ui/Toolbar/components/icons/index.d.ts +10 -0
- package/dist/core/ui/Toolbar/components/index.d.ts +3 -4
- package/dist/core/ui/Toolbar/components/{ExpandedToolbarContent.d.ts → legacy/ExpandedToolbarContentLegacy.d.ts} +4 -3
- 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.d.ts +1 -1
- 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 -1
- package/dist/core/ui/Toolbar/components/{TabContentRenderer.d.ts → legacy/TabContentRenderer.d.ts} +2 -2
- package/dist/core/ui/Toolbar/components/legacy/index.d.ts +1 -0
- package/dist/core/ui/Toolbar/components/new/AnalyticsConsentToast/AnalyticsConsentToast.d.ts +5 -0
- package/dist/core/ui/Toolbar/components/new/AnalyticsConsentToast/AnalyticsConsentToast.module.css.d.ts +13 -0
- package/dist/core/ui/Toolbar/components/new/AnalyticsConsentToast/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 +8 -0
- package/dist/core/ui/Toolbar/components/new/ContentRenderer.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/ExpandedToolbarContent.d.ts +10 -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 +12 -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 +17 -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 +25 -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/Privacy/PrivacySettings.d.ts +1 -0
- package/dist/core/ui/Toolbar/components/new/Settings/ProjectSelector.d.ts +1 -0
- package/dist/core/ui/Toolbar/components/new/Settings/SettingsContent.module.css.d.ts +5 -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/ShareButton.d.ts +5 -0
- package/dist/core/ui/Toolbar/components/new/Settings/ShareButton.module.css.d.ts +1 -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 +9 -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 +12 -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/animations.d.ts +14 -0
- package/dist/core/ui/Toolbar/constants/virtualization.d.ts +1 -0
- package/dist/core/ui/Toolbar/context/DevServerProvider.d.ts +2 -0
- 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/{ApiProvider.d.ts → api/ApiProvider.d.ts} +1 -2
- package/dist/core/ui/Toolbar/context/{AuthProvider.d.ts → api/AuthProvider.d.ts} +3 -3
- package/dist/core/ui/Toolbar/context/api/ContextsProvider.d.ts +19 -0
- package/dist/core/ui/Toolbar/context/api/EnvironmentProvider.d.ts +12 -0
- package/dist/core/ui/Toolbar/context/{FlagsProvider.d.ts → api/FlagsProvider.d.ts} +5 -4
- package/dist/core/ui/Toolbar/context/{ProjectProvider.d.ts → api/ProjectProvider.d.ts} +4 -3
- package/dist/core/ui/Toolbar/context/api/index.d.ts +8 -0
- package/dist/core/ui/Toolbar/context/index.d.ts +7 -7
- package/dist/core/ui/Toolbar/context/{ActiveTabProvider.d.ts → state/ActiveTabProvider.d.ts} +3 -3
- 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/context/state/ToolbarStateProvider.d.ts +35 -0
- 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/telemetry/AnalyticsPreferencesProvider.d.ts +14 -0
- package/dist/core/ui/Toolbar/context/{AnalyticsProvider.d.ts → telemetry/AnalyticsProvider.d.ts} +2 -2
- package/dist/core/ui/Toolbar/context/{InternalClientProvider.d.ts → telemetry/InternalClientProvider.d.ts} +15 -1
- package/dist/core/ui/Toolbar/context/telemetry/TelemetryBundleProvider.d.ts +13 -0
- package/dist/core/ui/Toolbar/context/telemetry/index.d.ts +4 -0
- package/dist/core/ui/Toolbar/hooks/index.d.ts +2 -1
- package/dist/core/ui/Toolbar/hooks/useLocalStorage.d.ts +10 -0
- package/dist/core/ui/Toolbar/hooks/useReducedMotion.d.ts +5 -0
- package/dist/core/ui/Toolbar/hooks/useToolbarAnimations.d.ts +1 -1
- 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/context.d.ts +33 -0
- package/dist/core/ui/Toolbar/utils/localStorage.d.ts +29 -1
- package/dist/core/utils/analytics.d.ts +56 -2
- package/dist/core/utils/feedback.d.ts +18 -0
- package/dist/core/utils/urlOverrides.d.ts +105 -0
- package/dist/flags/toolbarFlags.d.ts +7 -1
- package/dist/index.cjs +8 -6
- package/dist/index.cjs.map +1 -1
- package/dist/js/263.js +88 -0
- package/dist/js/263.js.map +1 -0
- package/dist/js/758.js +446 -0
- package/dist/js/758.js.map +1 -0
- package/dist/js/index.js +3 -527
- package/dist/js/index.js.map +1 -1
- package/dist/js/plugins.js +1 -0
- package/dist/js/react.js +1 -0
- package/dist/js/types-entry.js +0 -0
- package/dist/plugins.cjs +483 -0
- package/dist/plugins.cjs.map +1 -0
- package/dist/plugins.d.ts +21 -0
- package/dist/react/useLaunchDarklyToolbar.d.ts +1 -1
- package/dist/react.cjs +125 -0
- package/dist/react.cjs.map +1 -0
- package/dist/react.d.ts +25 -0
- package/dist/types-entry.cjs +20 -0
- package/dist/types-entry.cjs.map +1 -0
- package/dist/types-entry.d.ts +12 -0
- package/package.json +98 -50
- package/dist/core/ui/Toolbar/components/Popover.css.d.ts +0 -2
- package/dist/core/ui/Toolbar/hooks/useToolbarState.d.ts +0 -25
- package/dist/core/ui/{Toolbar/components → Buttons}/IconButton.css.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/{LoginScreen.css.d.ts → LoginScreen/LoginScreen.css.d.ts} +0 -0
- package/dist/core/ui/Toolbar/components/{LoginScreen.d.ts → LoginScreen/LoginScreen.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}/Header.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/{IFrameProvider.d.ts → api/IFrameProvider.d.ts} +0 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface AnalyticsPreferencesContextValue {
|
|
3
|
+
isOptedInToAnalytics: boolean;
|
|
4
|
+
isOptedInToEnhancedAnalytics: boolean;
|
|
5
|
+
isOptedInToSessionReplay: boolean;
|
|
6
|
+
handleToggleAnalyticsOptOut: (enabled: boolean) => void;
|
|
7
|
+
handleToggleEnhancedAnalyticsOptOut: (enabled: boolean) => void;
|
|
8
|
+
handleToggleSessionReplayOptOut: (enabled: boolean) => void;
|
|
9
|
+
}
|
|
10
|
+
export interface AnalyticsPreferencesProviderProps {
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
export declare function AnalyticsPreferencesProvider({ children }: AnalyticsPreferencesProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare function useAnalyticsPreferences(): AnalyticsPreferencesContextValue;
|
package/dist/core/ui/Toolbar/context/{AnalyticsProvider.d.ts → telemetry/AnalyticsProvider.d.ts}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ToolbarAnalytics } from '
|
|
2
|
-
import { ToolbarMode } from '
|
|
1
|
+
import { ToolbarAnalytics } from '../../../../utils/analytics';
|
|
2
|
+
import { ToolbarMode } from '../../types';
|
|
3
3
|
interface AnalyticsProviderProps {
|
|
4
4
|
children: React.ReactNode;
|
|
5
5
|
mode?: ToolbarMode;
|
|
@@ -20,6 +20,10 @@ export interface InternalClientContextValue {
|
|
|
20
20
|
* Error during initialization, if any.
|
|
21
21
|
*/
|
|
22
22
|
error: Error | null;
|
|
23
|
+
/**
|
|
24
|
+
* Update the client context with new member/account information.
|
|
25
|
+
*/
|
|
26
|
+
updateContext: (accountId: string, memberId: string) => Promise<void>;
|
|
23
27
|
}
|
|
24
28
|
export interface InternalClientProviderProps {
|
|
25
29
|
children: ReactNode;
|
|
@@ -52,6 +56,16 @@ export interface InternalClientProviderProps {
|
|
|
52
56
|
* Set this if using a custom LaunchDarkly instance.
|
|
53
57
|
*/
|
|
54
58
|
eventsUrl?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Backend URL for Observability and Session Replay.
|
|
61
|
+
* Defaults to standard LaunchDarkly observability backend.
|
|
62
|
+
*/
|
|
63
|
+
backendUrl?: string;
|
|
64
|
+
/**
|
|
65
|
+
* OTLP HTTP endpoint for Observability tracing (OpenTelemetry).
|
|
66
|
+
* If not provided, Observability will use its default endpoint.
|
|
67
|
+
*/
|
|
68
|
+
observabilityOtlpEndpoint?: string;
|
|
55
69
|
}
|
|
56
70
|
/**
|
|
57
71
|
* InternalClientProvider manages the toolbar's internal LaunchDarkly client.
|
|
@@ -63,7 +77,7 @@ export interface InternalClientProviderProps {
|
|
|
63
77
|
*
|
|
64
78
|
* The external client (user's app client) is accessed separately via plugins.
|
|
65
79
|
*/
|
|
66
|
-
export declare function InternalClientProvider({ children, clientSideId, initialContext, baseUrl, streamUrl, eventsUrl, }: InternalClientProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
80
|
+
export declare function InternalClientProvider({ children, clientSideId, initialContext, baseUrl, streamUrl, eventsUrl, backendUrl, observabilityOtlpEndpoint, }: InternalClientProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
67
81
|
/**
|
|
68
82
|
* Hook to access the internal LaunchDarkly client.
|
|
69
83
|
*/
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ToolbarMode } from '../../types';
|
|
2
|
+
interface TelemetryBundleProviderProps {
|
|
3
|
+
mode: ToolbarMode;
|
|
4
|
+
baseUrl?: string;
|
|
5
|
+
clientSideId?: string;
|
|
6
|
+
streamUrl?: string;
|
|
7
|
+
eventsUrl?: string;
|
|
8
|
+
backendUrl?: string;
|
|
9
|
+
observabilityOtlpEndpoint?: string;
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export declare function TelemetryBundleProvider(props: TelemetryBundleProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export { useToolbarState } from './useToolbarState';
|
|
2
1
|
export { useToolbarAnimations } from './useToolbarAnimations';
|
|
3
2
|
export { useToolbarVisibility } from './useToolbarVisibility';
|
|
4
3
|
export { useToolbarDrag } from './useToolbarDrag';
|
|
5
4
|
export { useEvents } from './useEvents';
|
|
6
5
|
export { useCurrentDate } from './useCurrentDate';
|
|
6
|
+
export { useLocalStorage } from './useLocalStorage';
|
|
7
|
+
export { useReducedMotion } from './useReducedMotion';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface UseLocalStorageOptions<T> {
|
|
2
|
+
/** Sync across browser tabs (default: false) */
|
|
3
|
+
syncTabs?: boolean;
|
|
4
|
+
/** Custom serializer (default: JSON.stringify) */
|
|
5
|
+
serialize?: (value: T) => string;
|
|
6
|
+
/** Custom deserializer (default: JSON.parse) */
|
|
7
|
+
deserialize?: (value: string) => T;
|
|
8
|
+
}
|
|
9
|
+
export declare function useLocalStorage<T>(key: string, defaultValue: T, options?: UseLocalStorageOptions<T>): [T, (value: T | ((prev: T) => T)) => void, () => void];
|
|
10
|
+
export {};
|
|
@@ -6,7 +6,7 @@ export interface UseToolbarAnimationsProps {
|
|
|
6
6
|
onExpandComplete?: () => void;
|
|
7
7
|
onCollapseComplete?: () => void;
|
|
8
8
|
}
|
|
9
|
-
type AnimationConfig = typeof ANIMATION_CONFIG.containerExpand | typeof ANIMATION_CONFIG.containerCollapse;
|
|
9
|
+
type AnimationConfig = typeof ANIMATION_CONFIG.containerExpand | typeof ANIMATION_CONFIG.containerCollapse | typeof ANIMATION_CONFIG.containerInstant;
|
|
10
10
|
export interface UseToolbarAnimationsReturn {
|
|
11
11
|
containerAnimations: {
|
|
12
12
|
width: number;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
export type TabId = 'flag-sdk' | 'flag-dev-server' | 'events' | 'settings';
|
|
1
|
+
export type TabId = 'flag-sdk' | 'flag-dev-server' | 'events' | 'settings' | 'flags' | 'monitoring' | 'interactive' | 'ai' | 'optimize';
|
|
2
2
|
export type ActiveTabId = TabId | undefined;
|
|
3
3
|
export declare const TAB_ORDER: readonly TabId[];
|
|
4
4
|
export type ToolbarMode = 'dev-server' | 'sdk';
|
|
5
5
|
export declare const DEV_SERVER_TABS: readonly TabId[];
|
|
6
6
|
export declare const SDK_MODE_TABS: readonly TabId[];
|
|
7
|
+
export declare const NEW_TOOLBAR_TABS: readonly TabId[];
|
|
7
8
|
export declare function getToolbarMode(devServerUrl?: string): ToolbarMode;
|
|
8
9
|
export declare function getTabsForMode(mode: ToolbarMode, hasFlagOverridePlugin: boolean, hasEventInterceptionPlugin: boolean): readonly TabId[];
|
|
9
|
-
export declare function getDefaultActiveTab(mode: ToolbarMode, hasFlagOverridePlugin?: boolean, hasEventInterceptionPlugin?: boolean): TabId;
|
|
10
|
+
export declare function getDefaultActiveTab(mode: ToolbarMode, hasFlagOverridePlugin?: boolean, hasEventInterceptionPlugin?: boolean, useNewToolbarDesign?: boolean): TabId;
|
|
10
11
|
export interface FeatureFlag {
|
|
11
12
|
id: string;
|
|
12
13
|
name: string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copy text to clipboard with fallback for older browsers
|
|
3
|
+
* @param text - The text to copy to clipboard
|
|
4
|
+
* @returns Promise that resolves to true if copy was successful, false otherwise
|
|
5
|
+
*/
|
|
6
|
+
export declare function copyToClipboard(text: string): Promise<boolean>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { LDContext } from 'launchdarkly-js-client-sdk';
|
|
2
|
+
/**
|
|
3
|
+
* Check if two contexts are the same using their stable IDs (kind+key)
|
|
4
|
+
* @deprecated Prefer comparing getStableContextId(a) === getStableContextId(b) directly
|
|
5
|
+
*/
|
|
6
|
+
export declare function areContextsEqual(a: LDContext | null | undefined, b: LDContext | null | undefined): boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Gets the kind of an LDContext (handles multi-kind and single-kind)
|
|
9
|
+
*/
|
|
10
|
+
export declare function getContextKind(context: LDContext | null | undefined): string;
|
|
11
|
+
/**
|
|
12
|
+
* Gets the key of an LDContext
|
|
13
|
+
* For multi-kind contexts, returns the key of the first nested context
|
|
14
|
+
*/
|
|
15
|
+
export declare function getContextKey(context: LDContext | null | undefined): string;
|
|
16
|
+
/**
|
|
17
|
+
* Gets a display name for an LDContext
|
|
18
|
+
* Uses name if available, otherwise falls back to key
|
|
19
|
+
*/
|
|
20
|
+
export declare function getContextDisplayName(context: LDContext | null | undefined): string;
|
|
21
|
+
/**
|
|
22
|
+
* Check if a context is anonymous
|
|
23
|
+
*/
|
|
24
|
+
export declare function isContextAnonymous(context: LDContext | null | undefined): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Generates a stable identifier for a context based on kind+key.
|
|
27
|
+
* This identifier remains the same even if other properties change,
|
|
28
|
+
* allowing contexts to be updated rather than duplicated.
|
|
29
|
+
*
|
|
30
|
+
* For single-kind contexts: "kind:key"
|
|
31
|
+
* For multi-kind contexts: "multi:kind1:key1:kind2:key2" (sorted by kind name)
|
|
32
|
+
*/
|
|
33
|
+
export declare function getStableContextId(context: LDContext | null | undefined): string;
|
|
@@ -1,14 +1,24 @@
|
|
|
1
|
+
import type { LDContext } from 'launchdarkly-js-client-sdk';
|
|
1
2
|
import { ToolbarPosition } from '../types/toolbar';
|
|
2
3
|
export declare const TOOLBAR_STORAGE_KEYS: {
|
|
3
4
|
readonly SETTINGS: "ld-toolbar-settings";
|
|
4
5
|
readonly DISABLED: "ld-toolbar-disabled";
|
|
5
|
-
readonly PROJECT: "ld-toolbar-project";
|
|
6
6
|
readonly STARRED_FLAGS: "ld-toolbar-starred-flags";
|
|
7
|
+
readonly MCP_ALERT_DISMISSED: "ld-toolbar-mcp-alert-dismissed";
|
|
8
|
+
readonly ANALYTICS_CONSENT_SHOWN: "ld-toolbar-analytics-consent-shown";
|
|
9
|
+
readonly CONTEXTS: "ld-toolbar-contexts";
|
|
10
|
+
readonly ACTIVE_CONTEXT: "ld-toolbar-active-context";
|
|
7
11
|
};
|
|
12
|
+
export type PreferredIde = 'cursor' | 'windsurf' | 'vscode' | 'github-copilot';
|
|
13
|
+
export declare const PREFERRED_IDES: PreferredIde[];
|
|
8
14
|
export interface ToolbarSettings {
|
|
9
15
|
position: ToolbarPosition;
|
|
10
16
|
reloadOnFlagChange: boolean;
|
|
11
17
|
autoCollapse: boolean;
|
|
18
|
+
preferredIde: PreferredIde;
|
|
19
|
+
isOptedInToAnalytics: boolean;
|
|
20
|
+
isOptedInToEnhancedAnalytics: boolean;
|
|
21
|
+
isOptedInToSessionReplay: boolean;
|
|
12
22
|
}
|
|
13
23
|
export declare const DEFAULT_SETTINGS: ToolbarSettings;
|
|
14
24
|
export declare function saveToolbarPosition(position: ToolbarPosition): void;
|
|
@@ -19,3 +29,21 @@ export declare function saveReloadOnFlagChange(isReloadOnFlagChange: boolean): v
|
|
|
19
29
|
export declare function loadReloadOnFlagChange(): boolean;
|
|
20
30
|
export declare function loadStarredFlags(): Set<string>;
|
|
21
31
|
export declare function saveStarredFlags(starredFlags: Set<string>): void;
|
|
32
|
+
export declare function savePreferredIde(ide: PreferredIde): void;
|
|
33
|
+
export declare function loadPreferredIde(): PreferredIde;
|
|
34
|
+
export declare function saveMCPAlertDismissed(dismissed: boolean): void;
|
|
35
|
+
export declare function loadMCPAlertDismissed(): boolean;
|
|
36
|
+
export declare function loadContexts(): Array<LDContext>;
|
|
37
|
+
export declare function saveContexts(contexts: Array<LDContext>): void;
|
|
38
|
+
export declare function loadActiveContext(): LDContext | null;
|
|
39
|
+
export declare function saveActiveContext(context: LDContext | null): void;
|
|
40
|
+
export declare function saveIsOptedInToAnalytics(isOptedInToAnalytics: boolean): void;
|
|
41
|
+
export declare function loadIsOptedInToAnalytics(): boolean;
|
|
42
|
+
export declare function saveIsOptedInToEnhancedAnalytics(isOptedInToEnhancedAnalytics: boolean): void;
|
|
43
|
+
export declare function saveIsOptedInToSessionReplay(isOptedInToSessionReplay: boolean): void;
|
|
44
|
+
export declare function loadIsOptedInToSessionReplay(): boolean;
|
|
45
|
+
export declare function loadIsOptedInToEnhancedAnalytics(): boolean;
|
|
46
|
+
export declare function saveAnalyticsConsentShown(shown: boolean): void;
|
|
47
|
+
export declare function loadAnalyticsConsentShown(): boolean;
|
|
48
|
+
export declare function loadAllSettings(): Partial<ToolbarSettings>;
|
|
49
|
+
export declare function saveAllSettings(settings: Partial<ToolbarSettings>): void;
|
|
@@ -8,8 +8,9 @@ export declare const ANALYTICS_EVENT_PREFIX = "ld.toolbar";
|
|
|
8
8
|
export declare class ToolbarAnalytics {
|
|
9
9
|
private ldClient;
|
|
10
10
|
private mode;
|
|
11
|
+
private isOptedInToAnalytics;
|
|
11
12
|
private searchDebounceTimer;
|
|
12
|
-
constructor(ldClient?: LDClient | null, mode?: ToolbarMode);
|
|
13
|
+
constructor(ldClient?: LDClient | null, mode?: ToolbarMode, isOptedInToAnalytics?: boolean);
|
|
13
14
|
/**
|
|
14
15
|
* Internal method to send tracking events
|
|
15
16
|
*/
|
|
@@ -30,6 +31,10 @@ export declare class ToolbarAnalytics {
|
|
|
30
31
|
* Track toolbar tab navigation
|
|
31
32
|
*/
|
|
32
33
|
trackTabChange(fromTab: string | null, toTab: string): void;
|
|
34
|
+
/**
|
|
35
|
+
* Track toolbar subtab navigation
|
|
36
|
+
*/
|
|
37
|
+
trackSubtabChange(fromSubtab: string | null, toSubtab: string): void;
|
|
33
38
|
/**
|
|
34
39
|
* Track search usage
|
|
35
40
|
*/
|
|
@@ -54,6 +59,10 @@ export declare class ToolbarAnalytics {
|
|
|
54
59
|
* Track opening a flag deeplink
|
|
55
60
|
*/
|
|
56
61
|
trackOpenFlagDeeplink(flagKey: string, baseUrl: string): void;
|
|
62
|
+
/**
|
|
63
|
+
* Track clearing events
|
|
64
|
+
*/
|
|
65
|
+
trackClearEvents(): void;
|
|
57
66
|
/**
|
|
58
67
|
* Track Event clicks
|
|
59
68
|
*/
|
|
@@ -93,5 +102,50 @@ export declare class ToolbarAnalytics {
|
|
|
93
102
|
/**
|
|
94
103
|
* Track user feedback
|
|
95
104
|
*/
|
|
96
|
-
trackFeedback(feedback: string, sentiment: FeedbackSentiment
|
|
105
|
+
trackFeedback(feedback: string, sentiment: FeedbackSentiment, options?: {
|
|
106
|
+
flagKey?: string;
|
|
107
|
+
prompt?: string;
|
|
108
|
+
customProperties?: Record<string, unknown>;
|
|
109
|
+
}): void;
|
|
110
|
+
/**
|
|
111
|
+
* Track flag key copy
|
|
112
|
+
*/
|
|
113
|
+
trackFlagKeyCopy(flagKey: string): void;
|
|
114
|
+
/**
|
|
115
|
+
* Track context added
|
|
116
|
+
*/
|
|
117
|
+
trackContextAdded(contextKind: string, contextKey: string, isMultiKind: boolean): void;
|
|
118
|
+
/**
|
|
119
|
+
* Track context removed
|
|
120
|
+
*/
|
|
121
|
+
trackContextRemoved(contextKind: string, contextKey: string): void;
|
|
122
|
+
/**
|
|
123
|
+
* Track context updated
|
|
124
|
+
*/
|
|
125
|
+
trackContextUpdated(oldKind: string, oldKey: string, newKind: string, newKey: string): void;
|
|
126
|
+
/**
|
|
127
|
+
* Track context selected/activated
|
|
128
|
+
*/
|
|
129
|
+
trackContextSelected(contextKind: string, contextKey: string): void;
|
|
130
|
+
/**
|
|
131
|
+
* Track context edit started
|
|
132
|
+
*/
|
|
133
|
+
trackContextEditStarted(contextKind: string, contextKey: string): void;
|
|
134
|
+
/**
|
|
135
|
+
* Track context edit cancelled
|
|
136
|
+
*/
|
|
137
|
+
trackContextEditCancelled(contextKind: string, contextKey: string): void;
|
|
138
|
+
/**
|
|
139
|
+
* Track context key copy
|
|
140
|
+
*/
|
|
141
|
+
trackContextKeyCopy(contextKey: string): void;
|
|
142
|
+
/**
|
|
143
|
+
* Track state sharing via URL
|
|
144
|
+
*/
|
|
145
|
+
trackShareState(options: {
|
|
146
|
+
includeSettings: boolean;
|
|
147
|
+
overrideCount: number;
|
|
148
|
+
contextCount: number;
|
|
149
|
+
starredFlagCount: number;
|
|
150
|
+
}): void;
|
|
97
151
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { LDClient } from 'launchdarkly-js-client-sdk';
|
|
2
|
+
export type LDFeedbackSentiment = 'positive' | 'neutral' | 'negative';
|
|
3
|
+
export type LDFeedbackData = {
|
|
4
|
+
feedback_answer: string;
|
|
5
|
+
flag_key: string;
|
|
6
|
+
sentiment?: LDFeedbackSentiment;
|
|
7
|
+
feedback_prompt?: string;
|
|
8
|
+
o11y_session_id?: string;
|
|
9
|
+
custom_properties?: Record<string, unknown>;
|
|
10
|
+
};
|
|
11
|
+
export interface SendFeedbackOptions {
|
|
12
|
+
flagKey: string;
|
|
13
|
+
feedback: string;
|
|
14
|
+
sentiment?: LDFeedbackSentiment;
|
|
15
|
+
prompt?: string;
|
|
16
|
+
customProperties?: Record<string, unknown>;
|
|
17
|
+
}
|
|
18
|
+
export declare function sendFeedback(client: LDClient, options: SendFeedbackOptions): void;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utilities for sharing and loading toolbar state via URL query parameters.
|
|
3
|
+
*
|
|
4
|
+
* State is encoded as a single base64-encoded JSON object in the ldToolbarState parameter.
|
|
5
|
+
* The state includes: flag overrides, contexts, settings, starred flags, etc.
|
|
6
|
+
*/
|
|
7
|
+
import { LDContext } from 'launchdarkly-js-client-sdk';
|
|
8
|
+
import { ToolbarSettings } from '../ui/Toolbar/utils/localStorage';
|
|
9
|
+
/** Current version of the shared state format */
|
|
10
|
+
export declare const SHARED_STATE_VERSION = 1;
|
|
11
|
+
/** Default query parameter name for shared toolbar state */
|
|
12
|
+
export declare const DEFAULT_STATE_PARAM = "ldToolbarState";
|
|
13
|
+
/** Maximum size of encoded state in characters (warning threshold) */
|
|
14
|
+
export declare const MAX_STATE_SIZE_WARNING = 2000;
|
|
15
|
+
/** Maximum size of encoded state in characters (hard limit) */
|
|
16
|
+
export declare const MAX_STATE_SIZE_LIMIT = 8192;
|
|
17
|
+
/**
|
|
18
|
+
* Structure of the shared toolbar state
|
|
19
|
+
*/
|
|
20
|
+
export interface SharedToolbarState {
|
|
21
|
+
/** Version of the state format */
|
|
22
|
+
version: number;
|
|
23
|
+
/** Flag overrides (flag key -> value) */
|
|
24
|
+
overrides: Record<string, any>;
|
|
25
|
+
/** Saved contexts */
|
|
26
|
+
contexts: LDContext[];
|
|
27
|
+
/** Currently active context */
|
|
28
|
+
activeContext: LDContext | null;
|
|
29
|
+
/** Toolbar settings */
|
|
30
|
+
settings: Partial<ToolbarSettings>;
|
|
31
|
+
/** Starred flag keys */
|
|
32
|
+
starredFlags: string[];
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Result of serializing shared state
|
|
36
|
+
*/
|
|
37
|
+
export interface SerializeStateResult {
|
|
38
|
+
/** The full URL with the state parameter */
|
|
39
|
+
url: string;
|
|
40
|
+
/** Size of the encoded state in characters */
|
|
41
|
+
size: number;
|
|
42
|
+
/** Whether the size exceeds the warning threshold */
|
|
43
|
+
exceedsWarning: boolean;
|
|
44
|
+
/** Whether the size exceeds the hard limit */
|
|
45
|
+
exceedsLimit: boolean;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Result of parsing shared state from URL
|
|
49
|
+
*/
|
|
50
|
+
export interface ParseStateResult {
|
|
51
|
+
/** Whether a state parameter was found in the URL */
|
|
52
|
+
found: boolean;
|
|
53
|
+
/** The parsed state (if found and valid) */
|
|
54
|
+
state: SharedToolbarState | null;
|
|
55
|
+
/** Error message if parsing failed */
|
|
56
|
+
error: string | null;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Serializes toolbar state into a URL with a query parameter
|
|
60
|
+
*
|
|
61
|
+
* @param state - The state to serialize
|
|
62
|
+
* @param baseUrl - The base URL to append the parameter to (defaults to current URL without params)
|
|
63
|
+
* @param paramName - The query parameter name (defaults to 'ldToolbarState')
|
|
64
|
+
* @returns Result containing the URL and size information
|
|
65
|
+
*
|
|
66
|
+
*/
|
|
67
|
+
export declare function serializeToolbarState(state: SharedToolbarState, baseUrl?: string, paramName?: string): SerializeStateResult;
|
|
68
|
+
/**
|
|
69
|
+
* Parses toolbar state from a URL query parameter
|
|
70
|
+
*
|
|
71
|
+
* @param url - The URL to parse (defaults to window.location.href)
|
|
72
|
+
* @param paramName - The query parameter name (defaults to 'ldToolbarState')
|
|
73
|
+
* @returns Result containing whether state was found, the parsed state, and any error
|
|
74
|
+
*
|
|
75
|
+
*/
|
|
76
|
+
export declare function parseToolbarState(url?: string, paramName?: string): ParseStateResult;
|
|
77
|
+
/**
|
|
78
|
+
* Checks if the current URL contains a toolbar state parameter
|
|
79
|
+
*
|
|
80
|
+
* @param url - The URL to check (defaults to window.location.href)
|
|
81
|
+
* @param paramName - The query parameter name (defaults to 'ldToolbarState')
|
|
82
|
+
* @returns True if the URL contains a state parameter
|
|
83
|
+
*/
|
|
84
|
+
export declare function hasToolbarState(url?: string, paramName?: string): boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Removes the toolbar state parameter from the current URL
|
|
87
|
+
* Uses history.replaceState to avoid affecting browser history
|
|
88
|
+
*
|
|
89
|
+
* @param paramName - The query parameter name (defaults to 'ldToolbarState')
|
|
90
|
+
*/
|
|
91
|
+
export declare function clearToolbarStateFromUrl(paramName?: string): void;
|
|
92
|
+
/**
|
|
93
|
+
* Loads shared toolbar state from URL and applies it to localStorage
|
|
94
|
+
* Should be called during toolbar initialization, before any components render
|
|
95
|
+
*
|
|
96
|
+
* @param paramName - The query parameter name (defaults to 'ldToolbarState')
|
|
97
|
+
* @param flagOverrideStorageNamespace - The storage namespace for flag overrides (defaults to 'ld-flag-override')
|
|
98
|
+
* @param flagOverridePlugin - Optional flag override plugin to apply overrides to directly
|
|
99
|
+
* @returns Object indicating whether state was loaded and if there were any errors
|
|
100
|
+
*
|
|
101
|
+
*/
|
|
102
|
+
export declare function loadSharedStateFromUrl(paramName?: string, flagOverrideStorageNamespace?: string, flagOverridePlugin?: any): {
|
|
103
|
+
loaded: boolean;
|
|
104
|
+
error: string | null;
|
|
105
|
+
};
|
|
@@ -7,4 +7,10 @@
|
|
|
7
7
|
* To add a toolbar feature flag, export it here like:
|
|
8
8
|
* export const myFeature = createToolbarFlagFunction('my-feature-key', defaultValue);
|
|
9
9
|
*/
|
|
10
|
-
export declare const
|
|
10
|
+
export declare const ENABLE_SESSION_REPLAY_FLAG_KEY = "toolbar-enable-session-replay";
|
|
11
|
+
export declare const USE_NEW_TOOLBAR_DESIGN_FLAG_KEY = "use-new-toolbar-design";
|
|
12
|
+
export declare const enableAiIcon: () => boolean;
|
|
13
|
+
export declare const enableInteractiveIcon: () => boolean;
|
|
14
|
+
export declare const enableOptimizeIcon: () => boolean;
|
|
15
|
+
export declare const enableSessionReplay: () => boolean;
|
|
16
|
+
export declare const useNewToolbarDesign: () => boolean;
|
package/dist/index.cjs
CHANGED
|
@@ -13,7 +13,7 @@ var __webpack_require__ = {};
|
|
|
13
13
|
})();
|
|
14
14
|
(()=>{
|
|
15
15
|
__webpack_require__.r = (exports1)=>{
|
|
16
|
-
if (
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
17
|
value: 'Module'
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports1, '__esModule', {
|
|
@@ -127,7 +127,7 @@ class AfterTrackHook {
|
|
|
127
127
|
data: hookContext.data,
|
|
128
128
|
metricValue: hookContext.metricValue,
|
|
129
129
|
creationDate: Date.now(),
|
|
130
|
-
url:
|
|
130
|
+
url: "u" > typeof window ? window.location.href : void 0
|
|
131
131
|
};
|
|
132
132
|
if (!this.shouldProcessEvent()) return;
|
|
133
133
|
const processedEvent = this.processEvent(syntheticContext);
|
|
@@ -462,7 +462,7 @@ class FlagOverridePlugin {
|
|
|
462
462
|
return this.ldClient;
|
|
463
463
|
}
|
|
464
464
|
getStorage() {
|
|
465
|
-
if (
|
|
465
|
+
if ("u" < typeof window) return null;
|
|
466
466
|
return window.localStorage;
|
|
467
467
|
}
|
|
468
468
|
persistOverride(flagKey, value) {
|
|
@@ -552,7 +552,9 @@ 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 =
|
|
555
|
+
var package_namespaceObject = {
|
|
556
|
+
rE: "2.1.0"
|
|
557
|
+
};
|
|
556
558
|
function useLaunchDarklyToolbar(args) {
|
|
557
559
|
const { toolbarBundleUrl, enabled, ...initConfig } = args;
|
|
558
560
|
const configRef = (0, external_react_namespaceObject.useRef)(null);
|
|
@@ -591,7 +593,7 @@ exports.TOOLBAR_POSITIONS = __webpack_exports__.TOOLBAR_POSITIONS;
|
|
|
591
593
|
exports.isValidEventCategory = __webpack_exports__.isValidEventCategory;
|
|
592
594
|
exports.isValidEventKind = __webpack_exports__.isValidEventKind;
|
|
593
595
|
exports.useLaunchDarklyToolbar = __webpack_exports__.useLaunchDarklyToolbar;
|
|
594
|
-
for(var
|
|
596
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
595
597
|
"ANALYTICS_EVENT_PREFIX",
|
|
596
598
|
"EventInterceptionPlugin",
|
|
597
599
|
"FlagOverridePlugin",
|
|
@@ -599,7 +601,7 @@ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
|
599
601
|
"isValidEventCategory",
|
|
600
602
|
"isValidEventKind",
|
|
601
603
|
"useLaunchDarklyToolbar"
|
|
602
|
-
].indexOf(
|
|
604
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
603
605
|
Object.defineProperty(exports, '__esModule', {
|
|
604
606
|
value: true
|
|
605
607
|
});
|