@gooddata/sdk-ui-kit 11.51.0-alpha.3 → 11.51.0-alpha.5
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/esm/@ui/@types/icon.d.ts +1 -1
- package/esm/@ui/@types/icon.d.ts.map +1 -1
- package/esm/@ui/UiIcon/icons.d.ts.map +1 -1
- package/esm/@ui/UiIcon/icons.js +3 -0
- package/esm/@ui/UiMenu/UiMenu.d.ts.map +1 -1
- package/esm/@ui/UiMenu/UiMenu.js +14 -3
- package/esm/@ui/UiMenu/components/defaults/DefaultUiMenuInteractiveItem.d.ts +1 -1
- package/esm/@ui/UiMenu/components/defaults/DefaultUiMenuInteractiveItem.d.ts.map +1 -1
- package/esm/@ui/UiMenu/components/defaults/DefaultUiMenuInteractiveItem.js +35 -14
- package/esm/@ui/UiMenu/hooks.d.ts.map +1 -1
- package/esm/@ui/UiMenu/hooks.js +4 -0
- package/esm/@ui/UiMenu/types.d.ts +5 -0
- package/esm/@ui/UiMenu/types.d.ts.map +1 -1
- package/esm/Timezone/TimezoneSelect.d.ts.map +1 -1
- package/esm/Timezone/TimezoneSelect.js +15 -7
- package/esm/Timezone/timezones.d.ts +6 -0
- package/esm/Timezone/timezones.d.ts.map +1 -1
- package/esm/Timezone/timezones.js +15 -4
- package/esm/index.d.ts +2 -1
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +2 -1
- package/esm/sdk-ui-kit.d.ts +31 -4
- package/esm/syntaxHighlightingInput/YamlEditor.d.ts +2 -3
- package/esm/syntaxHighlightingInput/YamlEditor.d.ts.map +1 -1
- package/esm/syntaxHighlightingInput/YamlEditor.js +5 -2
- package/esm/syntaxHighlightingInput/yamlPosition.d.ts +14 -0
- package/esm/syntaxHighlightingInput/yamlPosition.d.ts.map +1 -0
- package/esm/syntaxHighlightingInput/yamlPosition.js +51 -0
- package/package.json +11 -11
- package/src/Timezone/TimezoneSelect.scss +8 -0
- package/styles/css/main.css +8 -0
- package/styles/css/main.css.map +1 -1
package/esm/index.js
CHANGED
|
@@ -29,6 +29,7 @@ export { createTemplates, createAllTemplates, createAdvancedTemplates, STANDARD_
|
|
|
29
29
|
export { useMetricTypePresets, useStandardPresets, useFormatTemplates, } from "./measureNumberFormat/hooks/useMetricTypePresets.js";
|
|
30
30
|
export { SyntaxHighlightingInput, } from "./syntaxHighlightingInput/SyntaxHighlightingInput.js";
|
|
31
31
|
export { YamlEditor } from "./syntaxHighlightingInput/YamlEditor.js";
|
|
32
|
+
export { yamlPositionAt, } from "./syntaxHighlightingInput/yamlPosition.js";
|
|
32
33
|
export { Button } from "./Button/Button.js";
|
|
33
34
|
export { Datepicker } from "./Datepicker/Datepicker.js";
|
|
34
35
|
export { Input } from "./Form/Input.js";
|
|
@@ -308,7 +309,7 @@ export { RECURRENCE_TYPES } from "./RecurrenceForm/constants.js";
|
|
|
308
309
|
export { AddButton } from "./AddButton/AddButton.js";
|
|
309
310
|
export { ZOOM_THRESHOLD, ZoomContext, ZoomProvider, useZoom, useIsZoomed, } from "./ZoomContext/ZoomContext.js";
|
|
310
311
|
export { FilterGroupItem } from "./FilterGroupItem/FilterGroupItem.js";
|
|
311
|
-
export { getTimezones, getTimezoneById, getTimezoneLabels, getTimezoneTitle, getTimezoneDisplayLabel, getUserTimezone, } from "./Timezone/timezones.js";
|
|
312
|
+
export { getTimezones, getTimezoneById, getTimezoneLabels, getCurrentTimeByTimezoneId, getTimezoneTitle, getTimezoneDisplayLabel, getUserTimezone, } from "./Timezone/timezones.js";
|
|
312
313
|
export { TimezoneSelect, } from "./Timezone/TimezoneSelect.js";
|
|
313
314
|
// export * from "./Table/index.js";
|
|
314
315
|
/**
|
package/esm/sdk-ui-kit.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ import { AriaRole } from 'react';
|
|
|
14
14
|
import { CertificationStatus } from '@gooddata/sdk-model';
|
|
15
15
|
import { ChangeEvent } from 'react';
|
|
16
16
|
import { ColorFormats } from 'tinycolor2';
|
|
17
|
+
import type { CompletionContext } from '@codemirror/autocomplete';
|
|
17
18
|
import { CompletionSource } from '@codemirror/autocomplete';
|
|
18
19
|
import { Component } from 'react';
|
|
19
20
|
import { ComponentProps } from 'react';
|
|
@@ -27,6 +28,7 @@ import { CsvDelimiterValidationError } from '@gooddata/sdk-model';
|
|
|
27
28
|
import { DebouncedFunc } from 'lodash-es';
|
|
28
29
|
import { DependencyList } from 'react';
|
|
29
30
|
import { Dispatch } from 'react';
|
|
31
|
+
import type { EditorState } from '@codemirror/state';
|
|
30
32
|
import { EditorView } from '@codemirror/view';
|
|
31
33
|
import { ElementType } from 'react';
|
|
32
34
|
import { EmptyObject } from '@gooddata/util';
|
|
@@ -734,7 +736,7 @@ export declare const DefaultUiMenuHeader: FC;
|
|
|
734
736
|
/**
|
|
735
737
|
* @internal
|
|
736
738
|
*/
|
|
737
|
-
export declare function DefaultUiMenuInteractiveItem<T extends IUiMenuItemData = object>({ item, isFocused }: IUiMenuInteractiveItemProps<T>): ReactNode;
|
|
739
|
+
export declare function DefaultUiMenuInteractiveItem<T extends IUiMenuItemData = object>({ item, isFocused, isTooltipOpen }: IUiMenuInteractiveItemProps<T>): ReactNode;
|
|
738
740
|
|
|
739
741
|
/**
|
|
740
742
|
* @internal
|
|
@@ -1211,6 +1213,13 @@ export declare const getColorsPreviewFromColorPalette: (colorPalette: IColorPale
|
|
|
1211
1213
|
*/
|
|
1212
1214
|
export declare const getColorsPreviewFromTheme: (theme: ITheme) => string[];
|
|
1213
1215
|
|
|
1216
|
+
/**
|
|
1217
|
+
* Returns the current time in the provided timezone.
|
|
1218
|
+
*
|
|
1219
|
+
* @internal
|
|
1220
|
+
*/
|
|
1221
|
+
export declare function getCurrentTimeByTimezoneId(id: string): string;
|
|
1222
|
+
|
|
1214
1223
|
/**
|
|
1215
1224
|
* Build date time config for InsightListItemDate component.
|
|
1216
1225
|
*
|
|
@@ -2672,7 +2681,7 @@ export declare function IconTreeMap({ className, width, height, color, ariaHidde
|
|
|
2672
2681
|
/**
|
|
2673
2682
|
* @internal
|
|
2674
2683
|
*/
|
|
2675
|
-
export declare type IconType = "aiAgent" | "aiAgentDisabled" | "brain" | "brainDisabled" | "check" | "checkCircle" | "certification" | "plus" | "plusCircle" | "sync" | "alert" | "alertPaused" | "close" | "cross" | "edit" | "crossCircle" | "question" | "chevronUp" | "chevronRight" | "chevronDown" | "chevronLeft" | "date" | "navigateUp" | "navigateDown" | "navigateRight" | "navigateLeft" | "download" | "slack" | "expand" | "exclamationCircle" | "infoCircle" | "book" | "visible" | "invisible" | "lock" | "unlock" | "ai" | "aiFill" | "drawer" | "drawerEmpty" | "prohibited" | "dropDown" | "dropRight" | "clock" | "clockPaused" | "questionMark" | "upload" | "expandRectangle" | "file" | "number" | "code" | "user" | "userPlus" | "users" | "magic" | "tab" | "pauseCircle" | "filter" | "timer" | "mail" | "envelope" | "copy" | "rain" | "earth" | "geoCollection" | "geoCollectionUpload" | "minimize" | "shrink" | "copyright" | "ellipsis" | "pencil" | "folder" | "folderSmall" | "folderPlus" | "trash" | "arrowUp" | "arrowRight" | "arrowDown" | "arrowLeft" | "undo" | "redo" | "trendDown" | "trendUp" | "save" | "minus" | "minusCircle" | "percent" | "enter" | "enterRight" | "money" | "ghost" | "warning" | "home" | "settings" | "search" | "university" | "building" | "printer" | "picture" | "visualization" | "dashboard" | "metric" | "fact" | "ldmAttribute" | "ldmKey" | "ldmLabel" | "sharp" | "attribute" | "horn" | "cw" | "ccw" | "table" | "directionColumn" | "directionRow" | "header" | "genai" | "genai2" | "explainai" | "hiddenForAi" | "box" | "ellipsisVertical" | "list" | "drillTo" | "hierarchy" | "history" | "history2" | "thumbsUp" | "thumbsDown" | "send" | "visualizationArea" | "visualizationTable" | "visualizationTreemap" | "visualizationScatter" | "visualizationDonut" | "visualizationHeadline" | "visualizationColumn" | "visualizationLine" | "visualizationPyramid" | "visualizationFunnel" | "visualizationHeatmap" | "visualizationBubble" | "visualizationPie" | "visualizationBar" | "visualizationCombo" | "visualizationBullet" | "visualizationWaterfall" | "visualizationDependencywheel" | "visualizationSankey" | "visualizationPushpin" | "visualizationRepeater" | "visualizationXirr" | "link" | "externalLink" | "click" | "fileXlsx" | "filePptx" | "filePdf" | "fileImage" | "fileCsvFormatted" | "fileCsvRaw" | "aiDocument" | "recommendation" | "streamUp" | "streamDown" | "stream" | "density" | "parameter" | "pin" | "unpin" | "speechBubble" | "pieChart";
|
|
2684
|
+
export declare type IconType = "aiAgent" | "aiAgentDisabled" | "brain" | "brainDisabled" | "check" | "checkCircle" | "certification" | "plus" | "plusCircle" | "sync" | "alert" | "alertPaused" | "close" | "cross" | "edit" | "crossCircle" | "question" | "chevronUp" | "chevronRight" | "chevronDown" | "chevronLeft" | "date" | "navigateUp" | "navigateDown" | "navigateRight" | "navigateLeft" | "download" | "slack" | "expand" | "exclamationCircle" | "infoCircle" | "book" | "visible" | "invisible" | "lock" | "unlock" | "ai" | "aiFill" | "drawer" | "drawerEmpty" | "prohibited" | "dropDown" | "dropRight" | "clock" | "clockPaused" | "questionMark" | "upload" | "expandRectangle" | "file" | "number" | "code" | "user" | "userPlus" | "users" | "magic" | "tab" | "pauseCircle" | "filter" | "timer" | "mail" | "envelope" | "copy" | "rain" | "earth" | "geoCollection" | "geoCollectionUpload" | "minimize" | "shrink" | "copyright" | "ellipsis" | "pencil" | "folder" | "folderSmall" | "folderPlus" | "trash" | "arrowUp" | "arrowRight" | "arrowDown" | "arrowLeft" | "undo" | "redo" | "trendDown" | "trendUp" | "save" | "minus" | "minusCircle" | "percent" | "enter" | "enterRight" | "money" | "ghost" | "warning" | "home" | "settings" | "search" | "university" | "building" | "printer" | "picture" | "visualization" | "dashboard" | "metric" | "fact" | "ldmAttribute" | "ldmKey" | "ldmLabel" | "sharp" | "attribute" | "horn" | "cw" | "ccw" | "table" | "directionColumn" | "directionRow" | "header" | "genai" | "genai2" | "explainai" | "hiddenForAi" | "box" | "ellipsisVertical" | "list" | "drillTo" | "hierarchy" | "history" | "history2" | "thumbsUp" | "thumbsDown" | "send" | "visualizationArea" | "visualizationTable" | "visualizationTreemap" | "visualizationScatter" | "visualizationDonut" | "visualizationHeadline" | "visualizationColumn" | "visualizationLine" | "visualizationPyramid" | "visualizationFunnel" | "visualizationHeatmap" | "visualizationBubble" | "visualizationPie" | "visualizationBar" | "visualizationCombo" | "visualizationBullet" | "visualizationWaterfall" | "visualizationDependencywheel" | "visualizationSankey" | "visualizationPushpin" | "visualizationRepeater" | "visualizationXirr" | "link" | "externalLink" | "click" | "fileXlsx" | "filePptx" | "filePdf" | "fileImage" | "fileCsvFormatted" | "fileCsvRaw" | "aiDocument" | "recommendation" | "streamUp" | "streamDown" | "stream" | "density" | "parameter" | "pin" | "unpin" | "speechBubble" | "pieChart" | "timezone";
|
|
2676
2685
|
|
|
2677
2686
|
/**
|
|
2678
2687
|
* @internal
|
|
@@ -8030,6 +8039,9 @@ export declare interface IUiMenuContext<T extends IUiMenuItemData = object, M =
|
|
|
8030
8039
|
isItemFocusable: (item: IUiMenuItem<T>) => boolean;
|
|
8031
8040
|
controlType: IUiMenuControlType;
|
|
8032
8041
|
setControlType: Dispatch<SetStateAction<IUiMenuControlType>>;
|
|
8042
|
+
/** Whether the <menu> container is real-DOM-focused with the browser's :focus-visible heuristic. */
|
|
8043
|
+
isMenuFocusVisible: boolean;
|
|
8044
|
+
setIsMenuFocusVisible: Dispatch<SetStateAction<boolean>>;
|
|
8033
8045
|
scrollToView: (element: HTMLElement | null) => void;
|
|
8034
8046
|
makeItemId: (item: IUiMenuItem<T>) => string | undefined;
|
|
8035
8047
|
/**
|
|
@@ -8096,6 +8108,8 @@ export declare type IUiMenuInteractiveItem<T extends IUiMenuItemData = object> =
|
|
|
8096
8108
|
export declare interface IUiMenuInteractiveItemProps<T extends IUiMenuItemData = object> {
|
|
8097
8109
|
item: IUiMenuInteractiveItem<T>;
|
|
8098
8110
|
isFocused: boolean;
|
|
8111
|
+
/** Whether the item's tooltip should be visually open right now (keyboard-focused, not dismissed). */
|
|
8112
|
+
isTooltipOpen?: boolean;
|
|
8099
8113
|
}
|
|
8100
8114
|
|
|
8101
8115
|
/**
|
|
@@ -9504,8 +9518,7 @@ export declare interface IYamlEditorProps {
|
|
|
9504
9518
|
disabled?: boolean;
|
|
9505
9519
|
/** Accessible name for the editor (wired to its aria-label). */
|
|
9506
9520
|
label?: string;
|
|
9507
|
-
|
|
9508
|
-
completionSource?: CompletionSource;
|
|
9521
|
+
completionSource?: YamlCompletionSource;
|
|
9509
9522
|
/**
|
|
9510
9523
|
* When set, wires the built-in YAML syntax linter with this (localized) diagnostic message.
|
|
9511
9524
|
* Applied once when the editor mounts; later changes are not re-applied.
|
|
@@ -9519,6 +9532,14 @@ export declare interface IYamlEditorProps {
|
|
|
9519
9532
|
placeholder?: string;
|
|
9520
9533
|
}
|
|
9521
9534
|
|
|
9535
|
+
/** @internal */
|
|
9536
|
+
export declare interface IYamlPosition {
|
|
9537
|
+
/** Keys of the mappings enclosing the position, outermost first. */
|
|
9538
|
+
ancestorKeys: string[];
|
|
9539
|
+
/** Block-scalar (`|`, `>`) text, whose content is not YAML structure. */
|
|
9540
|
+
isInBlockScalar: boolean;
|
|
9541
|
+
}
|
|
9542
|
+
|
|
9522
9543
|
/**
|
|
9523
9544
|
* @internal
|
|
9524
9545
|
* Interface for zoom context state
|
|
@@ -11996,6 +12017,9 @@ export declare function withBubble<T>(WrappedComponent: ComponentType<T>): Forwa
|
|
|
11996
12017
|
*/
|
|
11997
12018
|
export declare const WorkspacePickerHomeFooter: ComponentType<Omit<IWorkspacePickerHomeFooterProps, "theme" | "themeIsLoading" | "themeStatus">>;
|
|
11998
12019
|
|
|
12020
|
+
/** @internal */
|
|
12021
|
+
export declare type YamlCompletionSource = (context: CompletionContext, position: IYamlPosition) => ReturnType<CompletionSource>;
|
|
12022
|
+
|
|
11999
12023
|
/**
|
|
12000
12024
|
* A YAML source editor: syntax highlighting, line numbers, a lint gutter, an optional syntax linter,
|
|
12001
12025
|
* and optional schema-aware autocompletion. Generic YAML plumbing lives here; schema-specific policy
|
|
@@ -12007,6 +12031,9 @@ export declare const WorkspacePickerHomeFooter: ComponentType<Omit<IWorkspacePic
|
|
|
12007
12031
|
*/
|
|
12008
12032
|
export declare function YamlEditor({ initialValue, onChange, disabled, label, completionSource, syntaxErrorMessage, extensions, placeholder }: IYamlEditorProps): JSX.Element;
|
|
12009
12033
|
|
|
12034
|
+
/** @internal */
|
|
12035
|
+
export declare function yamlPositionAt(state: EditorState, pos: number): IYamlPosition;
|
|
12036
|
+
|
|
12010
12037
|
/**
|
|
12011
12038
|
* @internal
|
|
12012
12039
|
* The threshold for determining if the window is zoomed enough to handle it explicitly in components styles
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type CompletionSource } from "@codemirror/autocomplete";
|
|
2
1
|
import { type Extension } from "@codemirror/state";
|
|
2
|
+
import { type YamlCompletionSource } from "./yamlPosition.js";
|
|
3
3
|
/**
|
|
4
4
|
* @internal
|
|
5
5
|
*/
|
|
@@ -9,8 +9,7 @@ export interface IYamlEditorProps {
|
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
/** Accessible name for the editor (wired to its aria-label). */
|
|
11
11
|
label?: string;
|
|
12
|
-
|
|
13
|
-
completionSource?: CompletionSource;
|
|
12
|
+
completionSource?: YamlCompletionSource;
|
|
14
13
|
/**
|
|
15
14
|
* When set, wires the built-in YAML syntax linter with this (localized) diagnostic message.
|
|
16
15
|
* Applied once when the editor mounts; later changes are not re-applied.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"YamlEditor.d.ts","sourceRoot":"","sources":["../../src/syntaxHighlightingInput/YamlEditor.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"YamlEditor.d.ts","sourceRoot":"","sources":["../../src/syntaxHighlightingInput/YamlEditor.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAInD,OAAO,EAAE,KAAK,oBAAoB,EAAkB,MAAM,mBAAmB,CAAC;AAK9E;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gEAAgE;IAChE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,oBAAoB,CAAC;IACxC;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,EACvB,YAAY,EACZ,QAAQ,EACR,QAAgB,EAChB,KAAK,EACL,gBAAgB,EAChB,kBAAkB,EAClB,UAAU,EACV,WAAW,EACd,EAAE,gBAAgB,2CA2BlB"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
// (C) 2026 GoodData Corporation
|
|
3
|
-
import { useState } from "react";
|
|
3
|
+
import { useMemo, useState } from "react";
|
|
4
4
|
import { yaml } from "@codemirror/lang-yaml";
|
|
5
5
|
import { lintGutter } from "@codemirror/lint";
|
|
6
6
|
import { lineNumbers } from "@codemirror/view";
|
|
7
7
|
import { SyntaxHighlightingInput } from "./SyntaxHighlightingInput.js";
|
|
8
|
+
import { yamlPositionAt } from "./yamlPosition.js";
|
|
8
9
|
import { createYamlSyntaxLinter } from "./yamlSyntaxLinter.js";
|
|
9
10
|
const noop = () => { };
|
|
10
11
|
/**
|
|
@@ -18,6 +19,8 @@ const noop = () => { };
|
|
|
18
19
|
*/
|
|
19
20
|
export function YamlEditor({ initialValue, onChange, disabled = false, label, completionSource, syntaxErrorMessage, extensions, placeholder, }) {
|
|
20
21
|
const [seedValue] = useState(initialValue);
|
|
22
|
+
const onCompletion = useMemo(() => completionSource &&
|
|
23
|
+
((context) => completionSource(context, yamlPositionAt(context.state, context.pos))), [completionSource]);
|
|
21
24
|
const [allExtensions] = useState(() => [
|
|
22
25
|
yaml(),
|
|
23
26
|
lineNumbers(),
|
|
@@ -25,5 +28,5 @@ export function YamlEditor({ initialValue, onChange, disabled = false, label, co
|
|
|
25
28
|
...(syntaxErrorMessage ? [createYamlSyntaxLinter(syntaxErrorMessage)] : []),
|
|
26
29
|
...(extensions ?? []),
|
|
27
30
|
]);
|
|
28
|
-
return (_jsx(SyntaxHighlightingInput, { label: label, value: seedValue, onChange: onChange ?? noop, extensions: allExtensions, onCompletion:
|
|
31
|
+
return (_jsx(SyntaxHighlightingInput, { label: label, value: seedValue, onChange: onChange ?? noop, extensions: allExtensions, onCompletion: onCompletion, disabled: disabled, placeholder: placeholder }));
|
|
29
32
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CompletionContext, CompletionSource } from "@codemirror/autocomplete";
|
|
2
|
+
import type { EditorState } from "@codemirror/state";
|
|
3
|
+
/** @internal */
|
|
4
|
+
export interface IYamlPosition {
|
|
5
|
+
/** Keys of the mappings enclosing the position, outermost first. */
|
|
6
|
+
ancestorKeys: string[];
|
|
7
|
+
/** Block-scalar (`|`, `>`) text, whose content is not YAML structure. */
|
|
8
|
+
isInBlockScalar: boolean;
|
|
9
|
+
}
|
|
10
|
+
/** @internal */
|
|
11
|
+
export type YamlCompletionSource = (context: CompletionContext, position: IYamlPosition) => ReturnType<CompletionSource>;
|
|
12
|
+
/** @internal */
|
|
13
|
+
export declare function yamlPositionAt(state: EditorState, pos: number): IYamlPosition;
|
|
14
|
+
//# sourceMappingURL=yamlPosition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"yamlPosition.d.ts","sourceRoot":"","sources":["../../src/syntaxHighlightingInput/yamlPosition.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEpF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,gBAAgB;AAChB,MAAM,WAAW,aAAa;IAC1B,oEAAoE;IACpE,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,yEAAyE;IACzE,eAAe,EAAE,OAAO,CAAC;CAC5B;AAED,gBAAgB;AAChB,MAAM,MAAM,oBAAoB,GAAG,CAC/B,OAAO,EAAE,iBAAiB,EAC1B,QAAQ,EAAE,aAAa,KACtB,UAAU,CAAC,gBAAgB,CAAC,CAAC;AAMlC,gBAAgB;AAChB,wBAAgB,cAAc,CAAC,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,GAAG,aAAa,CAiC7E"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
import { syntaxTree } from "@codemirror/language";
|
|
3
|
+
// Sequence-item markers count as indentation: group 1 must capture every dash with the leading whitespace,
|
|
4
|
+
// or a key after them compares at the wrong depth.
|
|
5
|
+
const KEY_LINE = /^(\s*(?:-\s+)*)("[^"]*"|'[^']*'|[^\s:#][^:]*?)\s*:/;
|
|
6
|
+
/** @internal */
|
|
7
|
+
export function yamlPositionAt(state, pos) {
|
|
8
|
+
const treeKeys = [];
|
|
9
|
+
let isInBlockScalar = false;
|
|
10
|
+
let anchored = false;
|
|
11
|
+
for (let node = syntaxTree(state).resolveInner(pos, -1); node !== null; node = node.parent) {
|
|
12
|
+
if (node.name === "BlockLiteralContent") {
|
|
13
|
+
isInBlockScalar = true;
|
|
14
|
+
}
|
|
15
|
+
if (node.name !== "Pair") {
|
|
16
|
+
continue;
|
|
17
|
+
}
|
|
18
|
+
anchored = true;
|
|
19
|
+
const key = node.getChild("Key");
|
|
20
|
+
// A pair whose own key spans the position is the entry being typed, not a mapping around it.
|
|
21
|
+
if (key !== null && (pos < key.from || pos > key.to)) {
|
|
22
|
+
treeKeys.unshift(unquote(state.sliceDoc(key.from, key.to).trim()));
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
// With only whitespace before the cursor there is no token for the tree to place: it stops short of the
|
|
26
|
+
// position, or resolves it one level out from the block the indentation continues.
|
|
27
|
+
const line = state.doc.lineAt(pos);
|
|
28
|
+
const hasTokenBefore = state.doc.sliceString(line.from, pos).trim() !== "";
|
|
29
|
+
return {
|
|
30
|
+
ancestorKeys: hasTokenBefore && anchored ? treeKeys : indentationAncestors(state, pos),
|
|
31
|
+
isInBlockScalar,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function indentationAncestors(state, pos) {
|
|
35
|
+
const line = state.doc.lineAt(pos);
|
|
36
|
+
const prefix = state.doc.sliceString(line.from, pos);
|
|
37
|
+
let expected = prefix.length - prefix.trimStart().length;
|
|
38
|
+
const keys = [];
|
|
39
|
+
for (let number = line.number - 1; number >= 1 && expected > 0; number--) {
|
|
40
|
+
const match = KEY_LINE.exec(state.doc.line(number).text);
|
|
41
|
+
if (match === null || match[1].length >= expected) {
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
keys.unshift(unquote(match[2]));
|
|
45
|
+
expected = match[1].length;
|
|
46
|
+
}
|
|
47
|
+
return keys;
|
|
48
|
+
}
|
|
49
|
+
function unquote(key) {
|
|
50
|
+
return /^(".*"|'.*')$/.test(key) ? key.slice(1, -1) : key;
|
|
51
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gooddata/sdk-ui-kit",
|
|
3
|
-
"version": "11.51.0-alpha.
|
|
3
|
+
"version": "11.51.0-alpha.5",
|
|
4
4
|
"description": "GoodData SDK - UI Building Components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "GoodData Corporation",
|
|
@@ -76,11 +76,11 @@
|
|
|
76
76
|
"tslib": "2.8.1",
|
|
77
77
|
"unified": "^11.0.5",
|
|
78
78
|
"uuid": "11.1.1",
|
|
79
|
-
"@gooddata/sdk-backend-spi": "11.51.0-alpha.
|
|
80
|
-
"@gooddata/sdk-
|
|
81
|
-
"@gooddata/
|
|
82
|
-
"@gooddata/
|
|
83
|
-
"@gooddata/sdk-
|
|
79
|
+
"@gooddata/sdk-backend-spi": "11.51.0-alpha.5",
|
|
80
|
+
"@gooddata/sdk-model": "11.51.0-alpha.5",
|
|
81
|
+
"@gooddata/util": "11.51.0-alpha.5",
|
|
82
|
+
"@gooddata/sdk-ui-theme-provider": "11.51.0-alpha.5",
|
|
83
|
+
"@gooddata/sdk-ui": "11.51.0-alpha.5"
|
|
84
84
|
},
|
|
85
85
|
"devDependencies": {
|
|
86
86
|
"@microsoft/api-documenter": "^7.17.0",
|
|
@@ -129,11 +129,11 @@
|
|
|
129
129
|
"typescript": "5.9.3",
|
|
130
130
|
"vitest": "4.1.8",
|
|
131
131
|
"vitest-dom": "0.1.1",
|
|
132
|
-
"@gooddata/eslint-config": "11.51.0-alpha.
|
|
133
|
-
"@gooddata/oxlint-config": "11.51.0-alpha.
|
|
134
|
-
"@gooddata/
|
|
135
|
-
"@gooddata/stylelint-config": "11.51.0-alpha.
|
|
136
|
-
"@gooddata/
|
|
132
|
+
"@gooddata/eslint-config": "11.51.0-alpha.5",
|
|
133
|
+
"@gooddata/oxlint-config": "11.51.0-alpha.5",
|
|
134
|
+
"@gooddata/reference-workspace": "11.51.0-alpha.5",
|
|
135
|
+
"@gooddata/stylelint-config": "11.51.0-alpha.5",
|
|
136
|
+
"@gooddata/sdk-backend-mockingbird": "11.51.0-alpha.5"
|
|
137
137
|
},
|
|
138
138
|
"peerDependencies": {
|
|
139
139
|
"react": "^18.0.0 || ^19.0.0",
|
|
@@ -2,10 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
@use "../../styles/scss/variables";
|
|
4
4
|
|
|
5
|
+
.gd-timezone-select {
|
|
6
|
+
width: 300px;
|
|
7
|
+
}
|
|
8
|
+
|
|
5
9
|
.gd-timezone-select__body {
|
|
6
10
|
width: 300px;
|
|
7
11
|
}
|
|
8
12
|
|
|
13
|
+
.gd-timezone-select__button {
|
|
14
|
+
width: 100%;
|
|
15
|
+
}
|
|
16
|
+
|
|
9
17
|
.gd-timezone-select__search {
|
|
10
18
|
padding: 10px;
|
|
11
19
|
}
|
package/styles/css/main.css
CHANGED
|
@@ -14550,10 +14550,18 @@ input[type=search]::-webkit-search-cancel-button {
|
|
|
14550
14550
|
overflow-wrap: anywhere;
|
|
14551
14551
|
}
|
|
14552
14552
|
|
|
14553
|
+
.gd-timezone-select {
|
|
14554
|
+
width: 300px;
|
|
14555
|
+
}
|
|
14556
|
+
|
|
14553
14557
|
.gd-timezone-select__body {
|
|
14554
14558
|
width: 300px;
|
|
14555
14559
|
}
|
|
14556
14560
|
|
|
14561
|
+
.gd-timezone-select__button {
|
|
14562
|
+
width: 100%;
|
|
14563
|
+
}
|
|
14564
|
+
|
|
14557
14565
|
.gd-timezone-select__search {
|
|
14558
14566
|
padding: 10px;
|
|
14559
14567
|
}
|