@carto/ps-react-ui 4.14.1 → 4.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chat.js +494 -466
- package/dist/chat.js.map +1 -1
- package/dist/components.js +837 -774
- package/dist/components.js.map +1 -1
- package/dist/legend/stores.js +20 -16
- package/dist/legend-store-registry-CVYzhR1-.js +464 -0
- package/dist/legend-store-registry-CVYzhR1-.js.map +1 -0
- package/dist/legend.js +1478 -794
- package/dist/legend.js.map +1 -1
- package/dist/markdown-DdqANCiN.js +102 -0
- package/dist/markdown-DdqANCiN.js.map +1 -0
- package/dist/markdown-content-Dk2DSgbf.js +10287 -0
- package/dist/markdown-content-Dk2DSgbf.js.map +1 -0
- package/dist/types/chat/bubbles/chat-agent-message-markdown.d.ts +12 -0
- package/dist/types/chat/bubbles/chat-agent-message.d.ts +9 -0
- package/dist/types/chat/bubbles/index.d.ts +1 -0
- package/dist/types/chat/index.d.ts +2 -1
- package/dist/types/chat/types.d.ts +9 -0
- package/dist/types/components/index.d.ts +2 -1
- package/dist/types/components/lasso-tool/message.d.ts +7 -0
- package/dist/types/components/lasso-tool/types.d.ts +17 -2
- package/dist/types/components/responsive-drawer/responsive-drawer.d.ts +2 -9
- package/dist/types/legend/components/a11y.d.ts +6 -0
- package/dist/types/legend/components/contexts.d.ts +22 -4
- package/dist/types/legend/components/index.d.ts +2 -2
- package/dist/types/legend/components/legend-actions/legend-actions.d.ts +4 -3
- package/dist/types/legend/components/legend-group/legend-group.d.ts +2 -11
- package/dist/types/legend/components/legend-group/styles.d.ts +40 -2
- package/dist/types/legend/components/legend-group-menu/legend-group-menu-items.d.ts +28 -0
- package/dist/types/legend/components/legend-group-menu/legend-group-menu.d.ts +11 -0
- package/dist/types/legend/components/legend-opacity/legend-opacity.d.ts +7 -17
- package/dist/types/legend/components/legend-opacity/styles.d.ts +11 -6
- package/dist/types/legend/components/legend-overflow-menu/legend-overflow-menu.d.ts +12 -0
- package/dist/types/legend/components/legend-panel-menu/legend-panel-menu.d.ts +11 -0
- package/dist/types/legend/components/legend-row/legend-row.d.ts +4 -11
- package/dist/types/legend/components/legend-row/styles.d.ts +36 -1
- package/dist/types/legend/components/legend-row-menu/legend-row-menu-items.d.ts +12 -0
- package/dist/types/legend/components/legend-row-menu/legend-row-menu.d.ts +4 -10
- package/dist/types/legend/components/legend-row-menu/legend-zoom-to.d.ts +3 -8
- package/dist/types/legend/components/legend-sortable/contexts.d.ts +7 -0
- package/dist/types/legend/components/legend-sortable/legend-sortable.d.ts +11 -0
- package/dist/types/legend/components/legend-sortable/sortable-entity.d.ts +27 -0
- package/dist/types/legend/components/legend-sortable/sortable-ids.d.ts +6 -0
- package/dist/types/legend/components/legend-sortable/styles.d.ts +54 -0
- package/dist/types/legend/components/legend-visible-layers/legend-visible-layers.d.ts +7 -0
- package/dist/types/legend/components/legend-visible-layers/styles.d.ts +48 -0
- package/dist/types/legend/components/run-async-menu-action.d.ts +7 -0
- package/dist/types/legend/index.d.ts +53 -6
- package/dist/types/legend/provider/labels.d.ts +21 -0
- package/dist/types/legend/stores/index.d.ts +1 -1
- package/dist/types/legend/stores/selectors.d.ts +31 -0
- package/dist/types/legend/stores/types.d.ts +11 -0
- package/dist/types/widgets-v2/markdown/markdown-content.d.ts +7 -1
- package/dist/widgets-v2/markdown.js +9 -8
- package/dist/widgets-v2/markdown.js.map +1 -1
- package/dist/widgets-v2.js +23 -22
- package/dist/widgets-v2.js.map +1 -1
- package/package.json +5 -4
- package/src/chat/bubbles/chat-agent-message-markdown.test.tsx +38 -0
- package/src/chat/bubbles/chat-agent-message-markdown.tsx +34 -0
- package/src/chat/bubbles/chat-agent-message.test.tsx +12 -0
- package/src/chat/bubbles/chat-agent-message.tsx +21 -1
- package/src/chat/bubbles/index.ts +1 -0
- package/src/chat/index.ts +2 -0
- package/src/chat/types.ts +10 -0
- package/src/components/index.ts +2 -0
- package/src/components/lasso-tool/message.tsx +36 -0
- package/src/components/lasso-tool/types.ts +20 -1
- package/src/components/responsive-drawer/responsive-drawer.test.tsx +138 -0
- package/src/components/responsive-drawer/responsive-drawer.tsx +77 -51
- package/src/legend/components/a11y.ts +14 -0
- package/src/legend/components/contexts.ts +29 -4
- package/src/legend/components/index.ts +3 -4
- package/src/legend/components/legend-actions/legend-actions.tsx +4 -3
- package/src/legend/components/legend-group/legend-group.test.tsx +166 -9
- package/src/legend/components/legend-group/legend-group.tsx +88 -49
- package/src/legend/components/legend-group/styles.ts +59 -2
- package/src/legend/components/legend-group-menu/legend-group-menu-items.tsx +132 -0
- package/src/legend/components/legend-group-menu/legend-group-menu.tsx +25 -0
- package/src/legend/components/legend-opacity/legend-opacity.tsx +43 -70
- package/src/legend/components/legend-opacity/styles.ts +14 -9
- package/src/legend/components/legend-overflow-menu/legend-overflow-menu.tsx +84 -0
- package/src/legend/components/legend-panel-menu/legend-panel-menu.tsx +23 -0
- package/src/legend/components/legend-ramp/legend-ramp-ui.tsx +2 -1
- package/src/legend/components/legend-row/legend-row.test.tsx +304 -85
- package/src/legend/components/legend-row/legend-row.tsx +73 -50
- package/src/legend/components/legend-row/styles.ts +54 -1
- package/src/legend/components/legend-row-menu/legend-row-menu-items.tsx +57 -0
- package/src/legend/components/legend-row-menu/legend-row-menu.tsx +12 -50
- package/src/legend/components/legend-row-menu/legend-zoom-to.tsx +25 -17
- package/src/legend/components/legend-sortable/contexts.ts +12 -0
- package/src/legend/components/legend-sortable/legend-sortable.test.tsx +144 -0
- package/src/legend/components/legend-sortable/legend-sortable.tsx +195 -0
- package/src/legend/components/legend-sortable/sortable-entity.tsx +91 -0
- package/src/legend/components/legend-sortable/sortable-ids.ts +17 -0
- package/src/legend/components/legend-sortable/styles.ts +56 -0
- package/src/legend/components/legend-visibility-toggle/legend-visibility-toggle.tsx +14 -8
- package/src/legend/components/legend-visible-layers/legend-visible-layers.test.tsx +86 -0
- package/src/legend/components/legend-visible-layers/legend-visible-layers.tsx +135 -0
- package/src/legend/components/legend-visible-layers/styles.ts +60 -0
- package/src/legend/components/run-async-menu-action.ts +20 -0
- package/src/legend/index.ts +59 -4
- package/src/legend/provider/labels.ts +43 -1
- package/src/legend/stores/index.ts +4 -0
- package/src/legend/stores/legend-store-registry.ts +60 -0
- package/src/legend/stores/legend-store.test.ts +116 -0
- package/src/legend/stores/selectors.ts +64 -2
- package/src/legend/stores/types.ts +11 -0
- package/src/widgets/actions/download/exports.test.tsx +14 -1
- package/src/widgets-v2/markdown/markdown-content.test.tsx +10 -0
- package/src/widgets-v2/markdown/markdown-content.tsx +9 -0
- package/src/widgets-v2/wrapper/widget-wrapper.tsx +4 -1
- package/dist/markdown-BD1jcknS.js +0 -8326
- package/dist/markdown-BD1jcknS.js.map +0 -1
- package/dist/selectors-DwHj6mE2.js +0 -388
- package/dist/selectors-DwHj6mE2.js.map +0 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ChatAgentMessageMarkdownProps } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Agent reply bubble that renders its (string) children as GitHub-Flavored
|
|
4
|
+
* Markdown through the library's sanitized renderer — raw HTML is skipped and
|
|
5
|
+
* images are stripped, since the content is model output; tables / task lists /
|
|
6
|
+
* strikethrough pick up the bubble's element styling. Composition over
|
|
7
|
+
* `ChatAgentMessage`, which stays a plain styles container.
|
|
8
|
+
*/
|
|
9
|
+
export declare function ChatAgentMessageMarkdown({ children, ...props }: ChatAgentMessageMarkdownProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare namespace ChatAgentMessageMarkdown {
|
|
11
|
+
var displayName: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ChatAgentMessageProps } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Agent reply bubble. A styles container that positions the reply and its
|
|
4
|
+
* composed pieces (text, loaders, tool traces, …); it renders `children`
|
|
5
|
+
* verbatim and forwards its `ref` to the underlying element. For Markdown
|
|
6
|
+
* replies, compose `ChatAgentMessageMarkdown` instead of teaching this
|
|
7
|
+
* container about the markdown engine.
|
|
8
|
+
*/
|
|
9
|
+
export declare const ChatAgentMessage: import('react').ForwardRefExoticComponent<ChatAgentMessageProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { ChatUserMessage } from './chat-user-message';
|
|
2
2
|
export { ChatAgentMessage } from './chat-agent-message';
|
|
3
|
+
export { ChatAgentMessageMarkdown } from './chat-agent-message-markdown';
|
|
3
4
|
export { ChatErrorMessage } from './chat-error-message';
|
|
4
5
|
export { ChatSuggestionButton } from './chat-suggestion-button';
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export type { ChatSxProps, ChatErrorAction, ChatUserMessageProps, ChatAgentMessageProps, ChatErrorMessageProps, ChatSuggestionButtonProps, ChatThinkingProps, ChatLoaderProps, ChatContentProps, ChatContentRef, ChatHeaderProps, ChatFooterProps, ChatModelOption, ChatStarterItem, ChatStarterProps, ChatRatingActionProps, ChatToolItem, ChatToolTraceProps, ChatToolCodeAreaProps, ChatToolFullViewDialogProps, ChatToolGroupProps, } from './types';
|
|
1
|
+
export type { ChatSxProps, ChatErrorAction, ChatUserMessageProps, ChatAgentMessageProps, ChatAgentMessageMarkdownProps, ChatErrorMessageProps, ChatSuggestionButtonProps, ChatThinkingProps, ChatLoaderProps, ChatContentProps, ChatContentRef, ChatHeaderProps, ChatFooterProps, ChatModelOption, ChatStarterItem, ChatStarterProps, ChatRatingActionProps, ChatToolItem, ChatToolTraceProps, ChatToolCodeAreaProps, ChatToolFullViewDialogProps, ChatToolGroupProps, } from './types';
|
|
2
2
|
export { CHAT_MAX_WIDTH, CHAT_SCROLL_DELAY, CHAT_DIVIDER_DELAY, CHAT_TOOL_CODE_AREA_MAX_HEIGHT, } from './const';
|
|
3
3
|
export { useTypewriter } from './use-typewriter';
|
|
4
4
|
export { ChatUserMessage } from './bubbles/chat-user-message';
|
|
5
5
|
export { ChatAgentMessage } from './bubbles/chat-agent-message';
|
|
6
|
+
export { ChatAgentMessageMarkdown } from './bubbles/chat-agent-message-markdown';
|
|
6
7
|
export { ChatErrorMessage } from './bubbles/chat-error-message';
|
|
7
8
|
export { ChatSuggestionButton } from './bubbles/chat-suggestion-button';
|
|
8
9
|
export { ChatMessageOverflow } from './bubbles/styles';
|
|
@@ -17,6 +17,15 @@ export interface ChatUserMessageProps extends ChatSxProps {
|
|
|
17
17
|
export interface ChatAgentMessageProps extends ChatSxProps {
|
|
18
18
|
children: ReactNode;
|
|
19
19
|
}
|
|
20
|
+
export interface ChatAgentMessageMarkdownProps extends ChatSxProps {
|
|
21
|
+
/**
|
|
22
|
+
* Markdown source — rendered as GitHub-Flavored Markdown (tables, task lists,
|
|
23
|
+
* strikethrough) through the library's sanitized renderer, inside a
|
|
24
|
+
* `ChatAgentMessage`. Raw HTML is skipped and images are stripped, since the
|
|
25
|
+
* content is model output.
|
|
26
|
+
*/
|
|
27
|
+
children: string;
|
|
28
|
+
}
|
|
20
29
|
export interface ChatErrorMessageProps extends ChatSxProps {
|
|
21
30
|
errors: string[];
|
|
22
31
|
icon?: ReactNode;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export type { CustomMeasureMode, MeasurementMode, MeasurementModeOption, MeasurementModes, MeasurementModesMapping, MeasurementOptionsMode, MeasurementOptionsUnit, MeasurementSystem, MeasurementUnit, MeasurementUnitImperialDistance, MeasurementUnitMetricDistance, MeasurementUnitOption, MeasurementUnits, LassoToolsMode, LassoToolsModeOption, LassoToolsModes, LassoToolOptionsMode, LassoToolsModesMapping, } from './types';
|
|
2
|
-
export type { LassoToolsComponentProps, LassoToolsInlineComponentProps, LassoGeometryToolbarUIProps, LassoGeometryType, LassoLayerFiltersUIProps, LassoLayerFilterItem, } from './lasso-tool/types';
|
|
2
|
+
export type { LassoToolsComponentProps, LassoToolsInlineComponentProps, LassoGeometryToolbarUIProps, LassoGeometryType, LassoLayerFiltersUIProps, LassoLayerFilterItem, LassoMessageUIProps, } from './lasso-tool/types';
|
|
3
3
|
export { LassoToolsUI } from './lasso-tool/lasso-tool';
|
|
4
4
|
export { LassoToolsInlineUI } from './lasso-tool/lasso-tool-inline';
|
|
5
5
|
export { LassoGeometryToolbarUI } from './lasso-tool/geometry-toolbar';
|
|
6
6
|
export { LassoLayerFiltersUI } from './lasso-tool/layer-filters';
|
|
7
|
+
export { LassoMessageUI } from './lasso-tool/message';
|
|
7
8
|
export { DEFAULT_LASSO_TOOLS_MODES_MAPPING, LASSO_TOOLS_LABELS, } from './lasso-tool/const';
|
|
8
9
|
export { DrawCircleIcon, DrawLassoIcon, DrawPolygonIcon, DrawSquareIcon, SelectToolIcon, SpatialMaskIcon, TextAaIcon, } from './lasso-tool/icons';
|
|
9
10
|
export type { MeasurementToolsComponentProps } from './measurement-tools/types';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { LassoMessageUIProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Presentational counterpart of `LassoTools.Message` (`@carto/ps-react-maps`),
|
|
4
|
+
* positioned by that render-props component. Auto-hides after 5 seconds via
|
|
5
|
+
* MUI `Snackbar` (calls `onDismiss`, which removes the message from the store).
|
|
6
|
+
*/
|
|
7
|
+
export declare function LassoMessageUI({ message, onDismiss, AlertProps, SnackbarProps, }: LassoMessageUIProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Box, ChipProps, DialogProps, Paper, TooltipProps } from '@mui/material';
|
|
2
|
-
import { ComponentProps, ComponentType } from 'react';
|
|
1
|
+
import { AlertColor, AlertProps, Box, ChipProps, DialogProps, Paper, SnackbarProps, TooltipProps } from '@mui/material';
|
|
2
|
+
import { ComponentProps, ComponentType, ReactNode } from 'react';
|
|
3
3
|
import { LassoToolsMode, LassoToolsModes, LassoToolOptionsMode, LassoToolsModesMapping } from '../types';
|
|
4
4
|
export interface LassoToolsData {
|
|
5
5
|
id: string;
|
|
@@ -107,6 +107,21 @@ export interface LassoGeometryToolbarUIProps {
|
|
|
107
107
|
};
|
|
108
108
|
PaperProps?: ComponentProps<typeof Paper>;
|
|
109
109
|
}
|
|
110
|
+
export interface LassoMessageUIProps {
|
|
111
|
+
/** Message from the lasso tools store (`LassoToolsMessage` in `@carto/ps-react-maps`). */
|
|
112
|
+
message: {
|
|
113
|
+
id: string;
|
|
114
|
+
title: string;
|
|
115
|
+
/** Body rendered under the title. */
|
|
116
|
+
content?: ReactNode;
|
|
117
|
+
/** @default 'info' */
|
|
118
|
+
severity?: AlertColor;
|
|
119
|
+
action?: ReactNode;
|
|
120
|
+
};
|
|
121
|
+
onDismiss: () => void;
|
|
122
|
+
AlertProps?: Omit<AlertProps, 'severity' | 'onClose' | 'children' | 'action'>;
|
|
123
|
+
SnackbarProps?: Omit<SnackbarProps, 'open' | 'onClose' | 'children'>;
|
|
124
|
+
}
|
|
110
125
|
export interface LassoLayerFilterItem {
|
|
111
126
|
id: string;
|
|
112
127
|
label: string;
|
|
@@ -4,14 +4,7 @@ type ResponsiveDrawerPosition = 'top-left' | 'top-right' | 'bottom-left' | 'bott
|
|
|
4
4
|
/** Placement of the panel relative to its anchor (desktop popover only). */
|
|
5
5
|
export type ResponsiveDrawerPlacement = 'side' | 'overlay';
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* `transformOrigin` (the panel corner that pins to the anchor point) is the same
|
|
10
|
-
* for both placements: the panel's own corner matching `position`. `anchorOrigin`
|
|
11
|
-
* (the point on the anchor the panel pins to) differs:
|
|
12
|
-
* - `'side'` flips horizontally → the panel opens beside the trigger.
|
|
13
|
-
* - `'overlay'` uses the same corner → the panel sits **on top of** the anchor
|
|
14
|
-
* (e.g. a trigger that's hidden while the panel is open), pinned corner-to-corner.
|
|
7
|
+
* Popover anchor/transform origins. `'overlay'` pins corner-to-corner on the anchor.
|
|
15
8
|
*/
|
|
16
9
|
export declare function resolveOrigins(position: ResponsiveDrawerPosition, placement: ResponsiveDrawerPlacement): {
|
|
17
10
|
anchorOrigin: PopoverOrigin;
|
|
@@ -22,7 +15,7 @@ export declare function ResponsiveDrawer<T extends {
|
|
|
22
15
|
onChangeCollapsed: (collapsed: boolean) => void;
|
|
23
16
|
position: ResponsiveDrawerPosition;
|
|
24
17
|
slotProps?: PopoverProps['slotProps'];
|
|
25
|
-
}>({ ref, children, collapsed, isMobile, position, sx, slotProps, onChangeCollapsed, modal, placement, }: Required<Pick<T, 'collapsed' | 'onChangeCollapsed' | 'position'>> & Pick<PopoverProps, 'slotProps' | 'sx'> & {
|
|
18
|
+
}>({ ref, children, collapsed, isMobile, position, sx, slotProps, container, onChangeCollapsed, modal, placement, }: Required<Pick<T, 'collapsed' | 'onChangeCollapsed' | 'position'>> & Pick<PopoverProps, 'slotProps' | 'sx' | 'container'> & {
|
|
26
19
|
ref: HTMLElement | null;
|
|
27
20
|
isMobile: boolean;
|
|
28
21
|
children: ReactNode;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { KeyboardEvent } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Enter/Space activate a non-native `role='button'` element (the accordion
|
|
4
|
+
* title areas of `Legend.Row` / `Legend.Group`), like a real button.
|
|
5
|
+
*/
|
|
6
|
+
export declare function accordionKeyDown(toggle: () => void): (event: KeyboardEvent<HTMLElement>) => void;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Per-row composition context provided by `Legend.Row`. Actions placed inside
|
|
3
3
|
* the row resolve their target layer from here instead of taking a `layerId`
|
|
4
|
-
* prop, and the opacity compound
|
|
5
|
-
*
|
|
4
|
+
* prop, and the opacity compound (`Legend.Opacity.Item` / `.Inline`) shares
|
|
5
|
+
* its open state through it.
|
|
6
6
|
*/
|
|
7
7
|
export interface LegendRowContextValue {
|
|
8
8
|
layerId: string;
|
|
9
|
-
/** The row's sticky header element — anchor for `Legend.Opacity.Popover`. */
|
|
10
|
-
headerEl: HTMLElement | null;
|
|
11
9
|
opacityOpen: boolean;
|
|
12
10
|
setOpacityOpen: (open: boolean) => void;
|
|
13
11
|
}
|
|
@@ -18,3 +16,23 @@ export declare function useLegendRow(): LegendRowContextValue | null;
|
|
|
18
16
|
export declare const LegendGroupContext: import('react').Context<string | null>;
|
|
19
17
|
/** Nearest `Legend.Group` id, or `null` outside a group. */
|
|
20
18
|
export declare function useLegendGroupId(): string | null;
|
|
19
|
+
/**
|
|
20
|
+
* Overflow-menu controller for `Legend.RowMenu` / `Legend.GroupMenu` /
|
|
21
|
+
* `Legend.PanelMenu`. Async items (e.g. `Legend.ZoomTo`) use `setBusy` to keep
|
|
22
|
+
* the menu open and show in-item loading feedback, then `close()` when the
|
|
23
|
+
* handler settles. Prefer `runAsyncMenuAction` over calling these by hand.
|
|
24
|
+
*/
|
|
25
|
+
export interface LegendMenuController {
|
|
26
|
+
/** Reactive busy flag for UI (spinner / disabled). */
|
|
27
|
+
busy: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Synchronous busy check (ref-backed) — use this to gate clicks so a second
|
|
30
|
+
* press before React re-renders cannot start another async action.
|
|
31
|
+
*/
|
|
32
|
+
isBusy: () => boolean;
|
|
33
|
+
setBusy: (busy: boolean) => void;
|
|
34
|
+
close: () => void;
|
|
35
|
+
}
|
|
36
|
+
export declare const LegendMenuContext: import('react').Context<LegendMenuController | null>;
|
|
37
|
+
/** Nearest overflow-menu controller, or `null` outside a row/group menu. */
|
|
38
|
+
export declare function useLegendMenu(): LegendMenuController | null;
|
|
@@ -4,8 +4,8 @@ export { LegendRow } from './legend-row/legend-row';
|
|
|
4
4
|
export type { LegendRowProps } from './legend-row/legend-row';
|
|
5
5
|
export { LegendActions } from './legend-actions/legend-actions';
|
|
6
6
|
export type { LegendActionsProps } from './legend-actions/legend-actions';
|
|
7
|
-
export { LegendRowContext, LegendGroupContext, useLegendRow, useLegendGroupId, } from './contexts';
|
|
8
|
-
export type { LegendRowContextValue } from './contexts';
|
|
7
|
+
export { LegendRowContext, LegendGroupContext, LegendMenuContext, useLegendRow, useLegendGroupId, useLegendMenu, } from './contexts';
|
|
8
|
+
export type { LegendRowContextValue, LegendMenuController } from './contexts';
|
|
9
9
|
export { LegendVisibilityToggle } from './legend-visibility-toggle/legend-visibility-toggle';
|
|
10
10
|
export { LegendRowMenu } from './legend-row-menu/legend-row-menu';
|
|
11
11
|
export { LegendZoomTo } from './legend-row-menu/legend-zoom-to';
|
|
@@ -5,9 +5,10 @@ export interface LegendActionsProps {
|
|
|
5
5
|
/**
|
|
6
6
|
* Header actions slot for `Legend.Row` / `Legend.Group` (widgets-v2 `Actions`
|
|
7
7
|
* parity): the wrapper partitions its children by component identity and
|
|
8
|
-
* renders this slot inside the header,
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* renders this slot inside the header, wrapped in the hover-fade group
|
|
9
|
+
* (`PsLegend-rowFade` in rows, `PsLegend-groupFade` in group headers —
|
|
10
|
+
* resolved from the nearest context). Compose the ⋮ menu last so it sits
|
|
11
|
+
* rightmost, per design.
|
|
11
12
|
*
|
|
12
13
|
* @experimental This API is new and may change in a future release.
|
|
13
14
|
*/
|
|
@@ -1,20 +1,11 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
export interface LegendGroupProps {
|
|
3
3
|
groupId: string;
|
|
4
|
-
/**
|
|
5
|
-
* Composition slots: `<Legend.Actions>` children render in the sticky
|
|
6
|
-
* header (hover-fade); everything else is the collapsible body — the
|
|
7
|
-
* consumer renders the member `<Legend.Row>`s explicitly (use
|
|
8
|
-
* `selectLayersByGroup` to resolve them).
|
|
9
|
-
*/
|
|
4
|
+
/** `<Legend.Actions>` in the sticky header; member `<Legend.Row>`s in the body. */
|
|
10
5
|
children?: ReactNode;
|
|
11
6
|
}
|
|
12
7
|
/**
|
|
13
|
-
* Store-connected group wrapper
|
|
14
|
-
* sticky 48px header — group icon + label from the store, the partitioned
|
|
15
|
-
* `<Legend.Actions>` slot, and the collapse chevron — over the collapsible
|
|
16
|
-
* body. Provides the group composition context so `Legend.VisibilityToggle`
|
|
17
|
-
* placed in the header becomes the tri-state group eye.
|
|
8
|
+
* Store-connected group wrapper. Draggable inside `<Legend.Sortable>`.
|
|
18
9
|
*
|
|
19
10
|
* @experimental This API is new and may change in a future release.
|
|
20
11
|
*/
|
|
@@ -26,6 +26,19 @@ export declare const styles: {
|
|
|
26
26
|
'&:hover .PsLegend-groupFade > *, &:focus-within .PsLegend-groupFade > *': {
|
|
27
27
|
opacity: number;
|
|
28
28
|
};
|
|
29
|
+
'& .PsLegend-dragHandle-group > *': {
|
|
30
|
+
opacity: number;
|
|
31
|
+
transition: ({ transitions }: Theme) => string;
|
|
32
|
+
'@media (hover: none)': {
|
|
33
|
+
opacity: number;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
'&:hover .PsLegend-dragHandle-group > *, &:focus-within .PsLegend-dragHandle-group > *': {
|
|
37
|
+
opacity: number;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
groupDragging: {
|
|
41
|
+
opacity: number;
|
|
29
42
|
};
|
|
30
43
|
header: {
|
|
31
44
|
display: "flex";
|
|
@@ -38,19 +51,44 @@ export declare const styles: {
|
|
|
38
51
|
position: "sticky";
|
|
39
52
|
top: number;
|
|
40
53
|
zIndex: number;
|
|
41
|
-
backgroundColor: "background.
|
|
54
|
+
backgroundColor: "background.default";
|
|
55
|
+
};
|
|
56
|
+
titleArea: {
|
|
57
|
+
flex: number;
|
|
58
|
+
minWidth: number;
|
|
59
|
+
display: "flex";
|
|
60
|
+
alignItems: "center";
|
|
61
|
+
gap: number;
|
|
62
|
+
cursor: "pointer";
|
|
63
|
+
userSelect: "none";
|
|
64
|
+
'&:focus-visible': {
|
|
65
|
+
outline: string;
|
|
66
|
+
outlineColor: "primary.main";
|
|
67
|
+
outlineOffset: number;
|
|
68
|
+
};
|
|
42
69
|
};
|
|
43
70
|
groupIcon: {
|
|
44
71
|
display: "flex";
|
|
45
72
|
color: "text.secondary";
|
|
46
73
|
};
|
|
47
74
|
label: {
|
|
48
|
-
flex: number;
|
|
49
75
|
minWidth: number;
|
|
50
76
|
overflow: "hidden";
|
|
51
77
|
textOverflow: "ellipsis";
|
|
52
78
|
whiteSpace: "nowrap";
|
|
53
79
|
};
|
|
80
|
+
chevron: {
|
|
81
|
+
fontSize: number;
|
|
82
|
+
color: "text.secondary";
|
|
83
|
+
flexShrink: number;
|
|
84
|
+
transition: ({ transitions }: Theme) => string;
|
|
85
|
+
'@media (hover: none)': {
|
|
86
|
+
display: "none";
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
chevronCollapsed: {
|
|
90
|
+
transform: "rotate(-90deg)";
|
|
91
|
+
};
|
|
54
92
|
actions: {
|
|
55
93
|
display: "flex";
|
|
56
94
|
alignItems: "center";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Show only this group (hide all other layers).
|
|
3
|
+
*
|
|
4
|
+
* @experimental This API is new and may change in a future release.
|
|
5
|
+
*/
|
|
6
|
+
export declare function LegendShowOnlyGroup(): import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
+
/**
|
|
8
|
+
* Show every layer (panel-level `Legend.PanelMenu` only).
|
|
9
|
+
*
|
|
10
|
+
* @experimental This API is new and may change in a future release.
|
|
11
|
+
*/
|
|
12
|
+
export declare function LegendShowAllGroups(): import("react/jsx-runtime").JSX.Element | null;
|
|
13
|
+
/**
|
|
14
|
+
* Collapse / expand all groups (panel-level `Legend.PanelMenu` only).
|
|
15
|
+
*
|
|
16
|
+
* @experimental This API is new and may change in a future release.
|
|
17
|
+
*/
|
|
18
|
+
export declare function LegendCollapseAllGroups(): import("react/jsx-runtime").JSX.Element | null;
|
|
19
|
+
export interface LegendZoomToGroupProps {
|
|
20
|
+
/** Fit viewport to the group; may return a Promise for async menu feedback. */
|
|
21
|
+
onZoomTo: (groupId: string) => void | Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Zoom-to-group menu item for `Legend.GroupMenu`. Self-hides when all members are hidden.
|
|
25
|
+
*
|
|
26
|
+
* @experimental This API is new and may change in a future release.
|
|
27
|
+
*/
|
|
28
|
+
export declare function LegendZoomToGroup({ onZoomTo }: LegendZoomToGroupProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface LegendGroupMenuProps {
|
|
3
|
+
/** Menu items; async items use `stopPropagation` + `runAsyncMenuAction`. */
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Overflow (⋮) menu for a group header. Renders nothing outside a `Legend.Group`.
|
|
8
|
+
*
|
|
9
|
+
* @experimental This API is new and may change in a future release.
|
|
10
|
+
*/
|
|
11
|
+
export declare function LegendGroupMenu({ children }: LegendGroupMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,32 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Opacity
|
|
3
|
-
* `.active` in the hover-fade group while opacity ≠ 1 or the popover is open,
|
|
4
|
-
* disabled while the layer is hidden. Opens `Legend.Opacity.Popover` through
|
|
5
|
-
* the row context. Place it inside `<Legend.Actions>` of a `Legend.Row`.
|
|
2
|
+
* Opacity menu item — toggles the row's inline bar; self-hides when hidden or no `opacityControl`.
|
|
6
3
|
*
|
|
7
4
|
* @experimental This API is new and may change in a future release.
|
|
8
5
|
*/
|
|
9
|
-
declare function
|
|
6
|
+
declare function OpacityItem(): import("react/jsx-runtime").JSX.Element | null;
|
|
10
7
|
/**
|
|
11
|
-
*
|
|
12
|
-
* header, spanning its full width**, holding a slider (writes `setOpacity`
|
|
13
|
-
* only on release, widgets-v2 parity) and a percent input (commits live as
|
|
14
|
-
* soon as the draft parses, clamped 0–100; never ellipsizes "100 %").
|
|
15
|
-
* Declare it anywhere inside the `Legend.Row` (it renders in a portal);
|
|
16
|
-
* open it with `Legend.Opacity.Trigger`.
|
|
8
|
+
* Inline opacity bar (first body child of `Legend.Row`). Slider commits on release; input commits live.
|
|
17
9
|
*
|
|
18
10
|
* @experimental This API is new and may change in a future release.
|
|
19
11
|
*/
|
|
20
|
-
declare function
|
|
12
|
+
declare function OpacityInline(): import("react/jsx-runtime").JSX.Element | null;
|
|
21
13
|
/**
|
|
22
|
-
* Compound opacity control
|
|
23
|
-
* `Trigger` lives in the header `<Legend.Actions>`, `Popover` anywhere in the
|
|
24
|
-
* row body — they share state through the row context.
|
|
14
|
+
* Compound opacity control: `Item` in the row menu, `Inline` in the body.
|
|
25
15
|
*
|
|
26
16
|
* @experimental This API is new and may change in a future release.
|
|
27
17
|
*/
|
|
28
18
|
export declare const LegendOpacity: {
|
|
29
|
-
|
|
30
|
-
|
|
19
|
+
Item: typeof OpacityItem;
|
|
20
|
+
Inline: typeof OpacityInline;
|
|
31
21
|
};
|
|
32
22
|
export {};
|
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
import { Theme } from '@mui/material';
|
|
2
1
|
export declare const styles: {
|
|
3
|
-
|
|
4
|
-
display: "
|
|
2
|
+
inline: {
|
|
3
|
+
display: "flex";
|
|
4
|
+
flexDirection: "column";
|
|
5
|
+
gap: number;
|
|
6
|
+
borderRadius: number;
|
|
7
|
+
};
|
|
8
|
+
inlineHeader: {
|
|
9
|
+
display: "flex";
|
|
10
|
+
alignItems: "center";
|
|
11
|
+
justifyContent: "space-between";
|
|
5
12
|
};
|
|
6
|
-
|
|
13
|
+
inlineControls: {
|
|
7
14
|
display: "flex";
|
|
8
15
|
alignItems: "center";
|
|
9
16
|
gap: number;
|
|
10
|
-
padding: ({ spacing }: Theme) => string;
|
|
11
|
-
width: number;
|
|
12
17
|
};
|
|
13
18
|
slider: {
|
|
14
19
|
flex: number;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface LegendOverflowMenuProps {
|
|
3
|
+
/** Menu items; async items use `stopPropagation` + `runAsyncMenuAction`. */
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
/** When `false`, render nothing. Defaults to `true`. */
|
|
6
|
+
gate?: boolean;
|
|
7
|
+
/** `aria-label` for the ⋮ trigger. */
|
|
8
|
+
ariaLabel: string;
|
|
9
|
+
/** Extra `.active` pin (e.g. inline opacity bar open). */
|
|
10
|
+
active?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare function LegendOverflowMenu({ children, gate, ariaLabel, active, }: LegendOverflowMenuProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface LegendPanelMenuProps {
|
|
3
|
+
/** Menu items; async items use `stopPropagation` + `runAsyncMenuAction`. */
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Overflow (⋮) menu for the panel header (no row/group context).
|
|
8
|
+
*
|
|
9
|
+
* @experimental This API is new and may change in a future release.
|
|
10
|
+
*/
|
|
11
|
+
export declare function LegendPanelMenu({ children }: LegendPanelMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,21 +2,14 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
export interface LegendRowProps {
|
|
3
3
|
layerId: string;
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* in the collapsible body, followed by the layer's `helperText` footer.
|
|
5
|
+
* `<Legend.Actions>` in the sticky header; body children + `helperText` footer.
|
|
6
|
+
* Place `<Legend.Opacity.Inline />` first in the body.
|
|
8
7
|
*/
|
|
9
8
|
children?: ReactNode;
|
|
10
9
|
}
|
|
11
10
|
/**
|
|
12
|
-
* Store-connected layer
|
|
13
|
-
*
|
|
14
|
-
* tooltip, the partitioned `<Legend.Actions>` slot, and the collapse chevron —
|
|
15
|
-
* over the collapsible body. Provides the row composition context so actions
|
|
16
|
-
* (`Legend.VisibilityToggle`, `Legend.Opacity.*`, `Legend.RowMenu`,
|
|
17
|
-
* `Legend.ConfigSelect`, `Legend.Item`) resolve the layer without props.
|
|
18
|
-
* When the layer is hidden the body is force-collapsed, the content dims,
|
|
19
|
-
* and the chevron is disabled.
|
|
11
|
+
* Store-connected layer row. Provides row context for actions; hidden layers
|
|
12
|
+
* force-collapse the body.
|
|
20
13
|
*
|
|
21
14
|
* @experimental This API is new and may change in a future release.
|
|
22
15
|
*/
|
|
@@ -3,6 +3,7 @@ export declare const styles: {
|
|
|
3
3
|
row: {
|
|
4
4
|
display: "flex";
|
|
5
5
|
flexDirection: "column";
|
|
6
|
+
position: "relative";
|
|
6
7
|
'& + &': {
|
|
7
8
|
borderTop: string;
|
|
8
9
|
borderColor: "divider";
|
|
@@ -23,6 +24,19 @@ export declare const styles: {
|
|
|
23
24
|
'&:hover .PsLegend-value, &:focus-within .PsLegend-value': {
|
|
24
25
|
opacity: number;
|
|
25
26
|
};
|
|
27
|
+
'& .PsLegend-dragHandle-layer > *': {
|
|
28
|
+
opacity: number;
|
|
29
|
+
transition: ({ transitions }: Theme) => string;
|
|
30
|
+
'@media (hover: none)': {
|
|
31
|
+
opacity: number;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
'&:hover .PsLegend-dragHandle-layer > *, &:focus-within .PsLegend-dragHandle-layer > *': {
|
|
35
|
+
opacity: number;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
rowDragging: {
|
|
39
|
+
opacity: number;
|
|
26
40
|
};
|
|
27
41
|
header: {
|
|
28
42
|
display: "flex";
|
|
@@ -40,18 +54,39 @@ export declare const styles: {
|
|
|
40
54
|
display: "flex";
|
|
41
55
|
flexDirection: "column";
|
|
42
56
|
};
|
|
57
|
+
titleBoxInteractive: {
|
|
58
|
+
cursor: "pointer";
|
|
59
|
+
userSelect: "none";
|
|
60
|
+
'&:focus-visible': {
|
|
61
|
+
outline: string;
|
|
62
|
+
outlineColor: "primary.main";
|
|
63
|
+
outlineOffset: number;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
43
66
|
titleLine: {
|
|
44
67
|
minHeight: number;
|
|
45
68
|
display: "flex";
|
|
46
69
|
alignItems: "center";
|
|
70
|
+
gap: number;
|
|
47
71
|
};
|
|
48
72
|
title: {
|
|
49
|
-
flex: number;
|
|
50
73
|
minWidth: number;
|
|
51
74
|
overflow: "hidden";
|
|
52
75
|
textOverflow: "ellipsis";
|
|
53
76
|
whiteSpace: "nowrap";
|
|
54
77
|
};
|
|
78
|
+
chevron: {
|
|
79
|
+
fontSize: number;
|
|
80
|
+
color: "text.secondary";
|
|
81
|
+
flexShrink: number;
|
|
82
|
+
transition: ({ transitions }: Theme) => string;
|
|
83
|
+
'@media (hover: none)': {
|
|
84
|
+
display: "none";
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
chevronCollapsed: {
|
|
88
|
+
transform: "rotate(-90deg)";
|
|
89
|
+
};
|
|
55
90
|
actions: {
|
|
56
91
|
minHeight: number;
|
|
57
92
|
display: "flex";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Show only this layer (and hide siblings in the same bucket).
|
|
3
|
+
*
|
|
4
|
+
* @experimental This API is new and may change in a future release.
|
|
5
|
+
*/
|
|
6
|
+
export declare function LegendShowOnlyLayer(): import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
+
/**
|
|
8
|
+
* Show all layers in the enclosing group, or all ungrouped layers at row scope.
|
|
9
|
+
*
|
|
10
|
+
* @experimental This API is new and may change in a future release.
|
|
11
|
+
*/
|
|
12
|
+
export declare function LegendShowAllLayers(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
export interface LegendRowMenuProps {
|
|
3
|
-
/**
|
|
4
|
-
* The menu items — composed by the consumer (e.g. `<Legend.ZoomTo>` or any
|
|
5
|
-
* MUI `MenuItem`). A click on any item bubbles to the menu and closes it;
|
|
6
|
-
* an item that must keep the menu open should `event.stopPropagation()`.
|
|
7
|
-
*/
|
|
3
|
+
/** Menu items; async items use `stopPropagation` + `runAsyncMenuAction`. */
|
|
8
4
|
children?: ReactNode;
|
|
9
5
|
}
|
|
10
6
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* a row, or while the layer is hidden (a hidden row keeps only its
|
|
14
|
-
* visibility eye + collapse chevron).
|
|
7
|
+
* Overflow (⋮) menu for a layer row. Pins `.active` while open, busy, or the
|
|
8
|
+
* inline opacity bar is open. Items self-gate when hidden.
|
|
15
9
|
*
|
|
16
10
|
* @experimental This API is new and may change in a future release.
|
|
17
11
|
*/
|
|
18
|
-
export declare function LegendRowMenu({ children }: LegendRowMenuProps): import("react/jsx-runtime").JSX.Element
|
|
12
|
+
export declare function LegendRowMenu({ children }: LegendRowMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
export interface LegendZoomToProps {
|
|
2
|
-
/**
|
|
3
|
-
|
|
4
|
-
* site (not the Provider) — each menu can wire its own behavior.
|
|
5
|
-
*/
|
|
6
|
-
onZoomTo: (layerId: string) => void;
|
|
2
|
+
/** Fit viewport to the layer; may return a Promise for async menu feedback. */
|
|
3
|
+
onZoomTo: (layerId: string) => void | Promise<void>;
|
|
7
4
|
}
|
|
8
5
|
/**
|
|
9
|
-
*
|
|
10
|
-
* enclosing `Legend.Row` context and calls the `onZoomTo` it was composed
|
|
11
|
-
* with. The click bubbles to the menu, which closes itself.
|
|
6
|
+
* Zoom-to-layer menu item for `Legend.RowMenu`. Self-hides when the layer is hidden.
|
|
12
7
|
*
|
|
13
8
|
* @experimental This API is new and may change in a future release.
|
|
14
9
|
*/
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Present (true) below a `<Legend.Sortable>` wrapper — `Legend.Group` /
|
|
3
|
+
* `Legend.Row` read it to become draggable (sortable shell + drag handle).
|
|
4
|
+
*/
|
|
5
|
+
export declare const LegendSortableContext: import('react').Context<boolean>;
|
|
6
|
+
/** Whether the nearest legend composition is wrapped in `Legend.Sortable`. */
|
|
7
|
+
export declare function useLegendSortable(): boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface LegendSortableProps {
|
|
3
|
+
/** Panel content (`Legend.Group` / ungrouped `Legend.Row` children). */
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Opt-in DnD reordering for legend groups and layers (within bucket only).
|
|
8
|
+
*
|
|
9
|
+
* @experimental This API is new and may change in a future release.
|
|
10
|
+
*/
|
|
11
|
+
export declare function LegendSortable({ children }: LegendSortableProps): import("react/jsx-runtime").JSX.Element;
|