@wallarm-org/design-system 4.9.0 → 4.10.0-rc-feat-parser.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/dist/components/DropdownMenu/DropdownMenu.d.ts +2 -0
  2. package/dist/components/DropdownMenu/DropdownMenu.js +84 -71
  3. package/dist/components/DropdownMenu/DropdownMenuItemDescription.js +1 -1
  4. package/dist/components/FilterInput/hooks/useFilterInputAutocomplete/useFilterInputAutocomplete.js +1 -1
  5. package/dist/components/Rules/PointSelector/KeyboardShortcutsDialog.d.ts +14 -0
  6. package/dist/components/Rules/PointSelector/KeyboardShortcutsDialog.js +209 -0
  7. package/dist/components/Rules/PointSelector/MatchStep.d.ts +15 -0
  8. package/dist/components/Rules/PointSelector/MatchStep.js +186 -0
  9. package/dist/components/Rules/PointSelector/MenuFooterHints.d.ts +16 -0
  10. package/dist/components/Rules/PointSelector/MenuFooterHints.js +177 -0
  11. package/dist/components/Rules/PointSelector/PointPreview.d.ts +10 -0
  12. package/dist/components/Rules/PointSelector/PointPreview.js +88 -0
  13. package/dist/components/Rules/PointSelector/PointSelector.d.ts +17 -0
  14. package/dist/components/Rules/PointSelector/PointSelector.js +937 -0
  15. package/dist/components/Rules/PointSelector/PointSelectorEmptyState.d.ts +12 -0
  16. package/dist/components/Rules/PointSelector/PointSelectorEmptyState.js +173 -0
  17. package/dist/components/Rules/PointSelector/PointSelectorError.d.ts +31 -0
  18. package/dist/components/Rules/PointSelector/PointSelectorError.js +275 -0
  19. package/dist/components/Rules/PointSelector/PointSelectorInput.d.ts +20 -0
  20. package/dist/components/Rules/PointSelector/PointSelectorInput.js +130 -0
  21. package/dist/components/Rules/PointSelector/PointSelectorMenu.d.ts +31 -0
  22. package/dist/components/Rules/PointSelector/PointSelectorMenu.js +317 -0
  23. package/dist/components/Rules/PointSelector/PointSelectorSkeleton.d.ts +8 -0
  24. package/dist/components/Rules/PointSelector/PointSelectorSkeleton.js +73 -0
  25. package/dist/components/Rules/PointSelector/SampleRequest.d.ts +14 -0
  26. package/dist/components/Rules/PointSelector/SampleRequest.js +116 -0
  27. package/dist/components/Rules/PointSelector/StepMenu.d.ts +40 -0
  28. package/dist/components/Rules/PointSelector/StepMenu.js +210 -0
  29. package/dist/components/Rules/PointSelector/VersionWarning.d.ts +26 -0
  30. package/dist/components/Rules/PointSelector/VersionWarning.js +231 -0
  31. package/dist/components/Rules/PointSelector/WhereBar.d.ts +48 -0
  32. package/dist/components/Rules/PointSelector/WhereBar.js +263 -0
  33. package/dist/components/Rules/PointSelector/classes.d.ts +28 -0
  34. package/dist/components/Rules/PointSelector/classes.js +22 -0
  35. package/dist/components/Rules/PointSelector/index.d.ts +20 -0
  36. package/dist/components/Rules/PointSelector/index.js +18 -0
  37. package/dist/components/Rules/PointSelector/liftLayer.d.ts +8 -0
  38. package/dist/components/Rules/PointSelector/liftLayer.js +4 -0
  39. package/dist/components/Rules/PointSelector/sampleValue.d.ts +6 -0
  40. package/dist/components/Rules/PointSelector/sampleValue.js +51 -0
  41. package/dist/components/Rules/PointSelector/sdkBridge.d.ts +508 -0
  42. package/dist/components/Rules/PointSelector/sdkBridge.js +339 -0
  43. package/dist/components/Rules/PointSelector/types.d.ts +304 -0
  44. package/dist/components/Rules/PointSelector/types.js +0 -0
  45. package/dist/components/Rules/PointSelector/usePointSelector.d.ts +161 -0
  46. package/dist/components/Rules/PointSelector/usePointSelector.js +1088 -0
  47. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionEditor.d.ts +28 -0
  48. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionEditor.js +208 -0
  49. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionFields.d.ts +23 -0
  50. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionFields.js +950 -0
  51. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTargetPicker.d.ts +21 -0
  52. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTargetPicker.js +110 -0
  53. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTypeSelect.d.ts +20 -0
  54. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTypeSelect.js +31 -0
  55. package/dist/components/Rules/RuleBuilder/ActionEditor/AttackTypeField.d.ts +23 -0
  56. package/dist/components/Rules/RuleBuilder/ActionEditor/AttackTypeField.js +131 -0
  57. package/dist/components/Rules/RuleBuilder/ActionEditor/classes.d.ts +17 -0
  58. package/dist/components/Rules/RuleBuilder/ActionEditor/classes.js +14 -0
  59. package/dist/components/Rules/RuleBuilder/ActionEditor/index.d.ts +6 -0
  60. package/dist/components/Rules/RuleBuilder/ActionEditor/index.js +6 -0
  61. package/dist/components/Rules/RuleBuilder/ConditionTree/AddConditionMenu.d.ts +24 -0
  62. package/dist/components/Rules/RuleBuilder/ConditionTree/AddConditionMenu.js +245 -0
  63. package/dist/components/Rules/RuleBuilder/ConditionTree/AttackCondition.d.ts +15 -0
  64. package/dist/components/Rules/RuleBuilder/ConditionTree/AttackCondition.js +691 -0
  65. package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionCard.d.ts +19 -0
  66. package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionCard.js +72 -0
  67. package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionTree.d.ts +27 -0
  68. package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionTree.js +407 -0
  69. package/dist/components/Rules/RuleBuilder/ConditionTree/FieldCondition.d.ts +14 -0
  70. package/dist/components/Rules/RuleBuilder/ConditionTree/FieldCondition.js +269 -0
  71. package/dist/components/Rules/RuleBuilder/ConditionTree/GroupCondition.d.ts +25 -0
  72. package/dist/components/Rules/RuleBuilder/ConditionTree/GroupCondition.js +99 -0
  73. package/dist/components/Rules/RuleBuilder/ConditionTree/SampleCondition.d.ts +14 -0
  74. package/dist/components/Rules/RuleBuilder/ConditionTree/SampleCondition.js +118 -0
  75. package/dist/components/Rules/RuleBuilder/ConditionTree/SignalCondition.d.ts +14 -0
  76. package/dist/components/Rules/RuleBuilder/ConditionTree/SignalCondition.js +446 -0
  77. package/dist/components/Rules/RuleBuilder/ConditionTree/TagCondition.d.ts +14 -0
  78. package/dist/components/Rules/RuleBuilder/ConditionTree/TagCondition.js +266 -0
  79. package/dist/components/Rules/RuleBuilder/ConditionTree/classes.d.ts +35 -0
  80. package/dist/components/Rules/RuleBuilder/ConditionTree/classes.js +57 -0
  81. package/dist/components/Rules/RuleBuilder/ConditionTree/index.d.ts +15 -0
  82. package/dist/components/Rules/RuleBuilder/ConditionTree/index.js +10 -0
  83. package/dist/components/Rules/RuleBuilder/RuleBuilder.d.ts +67 -0
  84. package/dist/components/Rules/RuleBuilder/RuleBuilder.js +366 -0
  85. package/dist/components/Rules/RuleBuilder/Summary/ActionSummary.d.ts +32 -0
  86. package/dist/components/Rules/RuleBuilder/Summary/ActionSummary.js +420 -0
  87. package/dist/components/Rules/RuleBuilder/Summary/ConditionSummary.d.ts +27 -0
  88. package/dist/components/Rules/RuleBuilder/Summary/ConditionSummary.js +446 -0
  89. package/dist/components/Rules/RuleBuilder/Summary/index.d.ts +7 -0
  90. package/dist/components/Rules/RuleBuilder/Summary/index.js +2 -0
  91. package/dist/components/Rules/RuleBuilder/classes.d.ts +19 -0
  92. package/dist/components/Rules/RuleBuilder/classes.js +18 -0
  93. package/dist/components/Rules/RuleBuilder/index.d.ts +55 -0
  94. package/dist/components/Rules/RuleBuilder/index.js +11 -0
  95. package/dist/components/Rules/RuleBuilder/models/actionModel.d.ts +31 -0
  96. package/dist/components/Rules/RuleBuilder/models/actionModel.js +276 -0
  97. package/dist/components/Rules/RuleBuilder/models/conditionModel.d.ts +95 -0
  98. package/dist/components/Rules/RuleBuilder/models/conditionModel.js +418 -0
  99. package/dist/components/Rules/RuleBuilder/models/index.d.ts +3 -0
  100. package/dist/components/Rules/RuleBuilder/models/index.js +3 -0
  101. package/dist/components/Rules/RuleBuilder/models/validation.d.ts +176 -0
  102. package/dist/components/Rules/RuleBuilder/models/validation.js +242 -0
  103. package/dist/components/Rules/RuleBuilder/shared/ChoiceSelect.d.ts +27 -0
  104. package/dist/components/Rules/RuleBuilder/shared/ChoiceSelect.js +92 -0
  105. package/dist/components/Rules/RuleBuilder/shared/index.d.ts +1 -0
  106. package/dist/components/Rules/RuleBuilder/shared/index.js +1 -0
  107. package/dist/components/Rules/RuleBuilder/types.d.ts +384 -0
  108. package/dist/components/Rules/RuleBuilder/types.js +0 -0
  109. package/dist/components/Rules/RuleBuilder/utils/constants.d.ts +65 -0
  110. package/dist/components/Rules/RuleBuilder/utils/constants.js +356 -0
  111. package/dist/components/Rules/RuleBuilder/utils/extractBindings.d.ts +48 -0
  112. package/dist/components/Rules/RuleBuilder/utils/extractBindings.js +42 -0
  113. package/dist/components/Rules/RuleBuilder/utils/helpers.d.ts +92 -0
  114. package/dist/components/Rules/RuleBuilder/utils/helpers.js +54 -0
  115. package/dist/components/Rules/RuleBuilder/utils/index.d.ts +2 -0
  116. package/dist/components/Rules/RuleBuilder/utils/index.js +2 -0
  117. package/dist/index.d.ts +2 -0
  118. package/dist/index.js +2 -0
  119. package/dist/metadata/components.json +100 -2
  120. package/dist/metadata/guidelines.json +1 -1
  121. package/package.json +4 -1
@@ -0,0 +1,12 @@
1
+ import type { FC } from 'react';
2
+ export interface PointSelectorEmptyStateProps {
3
+ /** Called when example is clicked - receives canonical point string to parse */
4
+ onSelectExample?: (point: string) => void;
5
+ }
6
+ /**
7
+ * PointSelectorEmptyState Component
8
+ *
9
+ * Rich empty state with examples shown when no segments chosen.
10
+ * Helps users understand where to start.
11
+ */
12
+ export declare const PointSelectorEmptyState: FC<PointSelectorEmptyStateProps>;
@@ -0,0 +1,173 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { c } from "react/compiler-runtime";
3
+ import { useTestId } from "../../../utils/testId.js";
4
+ import { Button } from "../../Button/index.js";
5
+ import { Text } from "../../Text/index.js";
6
+ const EXAMPLES = [
7
+ {
8
+ label: "Request header value",
9
+ description: "Match Authorization header",
10
+ point: "[http:header]['authorization']"
11
+ },
12
+ {
13
+ label: "JSON body field",
14
+ description: "Match user.email in request body",
15
+ point: "[http:body][format:json]['user']['email']"
16
+ },
17
+ {
18
+ label: "Query parameter",
19
+ description: "Match ?id= value",
20
+ point: "[http:query][format:form]['id']"
21
+ },
22
+ {
23
+ label: "Path segment",
24
+ description: "Match /api/users/[id]",
25
+ point: "[http:path][1]"
26
+ }
27
+ ];
28
+ const PointSelectorEmptyState = (t0)=>{
29
+ const $ = c(11);
30
+ const { onSelectExample } = t0;
31
+ const testId = useTestId("empty-state");
32
+ let t1;
33
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
34
+ t1 = /*#__PURE__*/ jsxs("div", {
35
+ className: "flex flex-col gap-8 px-4",
36
+ children: [
37
+ /*#__PURE__*/ jsx(Text, {
38
+ size: "sm",
39
+ weight: "bold",
40
+ children: "Build a point to match values in requests"
41
+ }),
42
+ /*#__PURE__*/ jsx(Text, {
43
+ size: "xs",
44
+ color: "secondary",
45
+ children: "Choose where the value is located in the request (header, body, query, path, etc.)"
46
+ })
47
+ ]
48
+ });
49
+ $[0] = t1;
50
+ } else t1 = $[0];
51
+ let t2;
52
+ if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
53
+ t2 = /*#__PURE__*/ jsx("div", {
54
+ className: "px-4",
55
+ children: /*#__PURE__*/ jsx(Text, {
56
+ size: "xs",
57
+ weight: "medium",
58
+ color: "secondary",
59
+ children: "Common patterns:"
60
+ })
61
+ });
62
+ $[1] = t2;
63
+ } else t2 = $[1];
64
+ let t3;
65
+ if ($[2] !== onSelectExample) {
66
+ t3 = EXAMPLES.map((example, i)=>/*#__PURE__*/ jsxs("div", {
67
+ className: "flex items-start justify-between gap-12 rounded-8 border border-border-primary-light bg-bg-canvas p-12 hover:bg-bg-surface-1",
68
+ children: [
69
+ /*#__PURE__*/ jsxs("div", {
70
+ className: "flex flex-col gap-4",
71
+ children: [
72
+ /*#__PURE__*/ jsx(Text, {
73
+ size: "sm",
74
+ weight: "medium",
75
+ children: example.label
76
+ }),
77
+ /*#__PURE__*/ jsx(Text, {
78
+ size: "xs",
79
+ color: "secondary",
80
+ children: example.description
81
+ }),
82
+ /*#__PURE__*/ jsx("code", {
83
+ className: "font-mono text-xs text-text-brand",
84
+ children: example.point
85
+ })
86
+ ]
87
+ }),
88
+ onSelectExample && /*#__PURE__*/ jsx(Button, {
89
+ variant: "outline",
90
+ color: "neutral",
91
+ size: "small",
92
+ onClick: ()=>onSelectExample(example.point),
93
+ "data-testid": `example-${i}`,
94
+ children: "Try"
95
+ })
96
+ ]
97
+ }, example.point));
98
+ $[2] = onSelectExample;
99
+ $[3] = t3;
100
+ } else t3 = $[3];
101
+ let t4;
102
+ if ($[4] !== t3) {
103
+ t4 = /*#__PURE__*/ jsxs("div", {
104
+ className: "flex flex-col gap-8",
105
+ children: [
106
+ t2,
107
+ /*#__PURE__*/ jsx("div", {
108
+ className: "grid gap-6",
109
+ children: t3
110
+ })
111
+ ]
112
+ });
113
+ $[4] = t3;
114
+ $[5] = t4;
115
+ } else t4 = $[5];
116
+ let t5;
117
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
118
+ t5 = /*#__PURE__*/ jsx(Text, {
119
+ size: "xs",
120
+ color: "secondary",
121
+ children: "Start typing to filter options"
122
+ });
123
+ $[6] = t5;
124
+ } else t5 = $[6];
125
+ let t6;
126
+ if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
127
+ t6 = /*#__PURE__*/ jsxs("div", {
128
+ className: "flex items-center justify-between border-t border-border-primary-light pt-12 px-4",
129
+ children: [
130
+ t5,
131
+ /*#__PURE__*/ jsxs("div", {
132
+ className: "flex items-center gap-4",
133
+ children: [
134
+ /*#__PURE__*/ jsx(Text, {
135
+ size: "xs",
136
+ color: "secondary",
137
+ children: "Press"
138
+ }),
139
+ /*#__PURE__*/ jsx("kbd", {
140
+ className: "rounded-4 bg-bg-surface-1 px-6 py-2 font-mono text-xs",
141
+ children: "?"
142
+ }),
143
+ /*#__PURE__*/ jsx(Text, {
144
+ size: "xs",
145
+ color: "secondary",
146
+ children: "for keyboard shortcuts"
147
+ })
148
+ ]
149
+ })
150
+ ]
151
+ });
152
+ $[7] = t6;
153
+ } else t6 = $[7];
154
+ let t7;
155
+ if ($[8] !== t4 || $[9] !== testId) {
156
+ t7 = /*#__PURE__*/ jsxs("div", {
157
+ "data-slot": "point-selector-empty-state",
158
+ "data-testid": testId,
159
+ className: "flex flex-col gap-12 p-8",
160
+ children: [
161
+ t1,
162
+ t4,
163
+ t6
164
+ ]
165
+ });
166
+ $[8] = t4;
167
+ $[9] = testId;
168
+ $[10] = t7;
169
+ } else t7 = $[10];
170
+ return t7;
171
+ };
172
+ PointSelectorEmptyState.displayName = "PointSelectorEmptyState";
173
+ export { PointSelectorEmptyState };
@@ -0,0 +1,31 @@
1
+ import { type FC, type HTMLAttributes, type Ref } from 'react';
2
+ import type { Verdict } from '@wallarm-org/rules-lib';
3
+ import type { TestableProps } from '../../../utils/testId.js';
4
+ import type { ErrorFix } from './types.js';
5
+ export interface PointSelectorErrorProps extends HTMLAttributes<HTMLDivElement>, TestableProps {
6
+ /** Ref forwarding to root element */
7
+ ref?: Ref<HTMLDivElement>;
8
+ /** Validation error from SDK */
9
+ error: Verdict;
10
+ /** True = valid prefix, show info instead of error */
11
+ incomplete?: boolean;
12
+ /** True = transport/SDK failure, show different icon */
13
+ transport?: boolean;
14
+ /** Called when user clicks a fix suggestion */
15
+ onApplyFix?: (fix: ErrorFix) => void;
16
+ /** Called when user dismisses the error */
17
+ onDismiss?: () => void;
18
+ }
19
+ /**
20
+ * Point Selector Error Component
21
+ *
22
+ * Displays validation errors with layer badges, fix suggestions, and span highlighting.
23
+ *
24
+ * Error States:
25
+ * - Incomplete (blue info): Valid prefix, keep typing
26
+ * - Grammar (red error): Syntax error in point string
27
+ * - Tree (red error): Point structure violates grammar
28
+ * - Value (red error): Point doesn't match value profile
29
+ * - Transport (red error): Network/SDK failure
30
+ */
31
+ export declare const PointSelectorError: FC<PointSelectorErrorProps>;
@@ -0,0 +1,275 @@
1
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
+ import { c } from "react/compiler-runtime";
3
+ import { useEffect, useRef } from "react";
4
+ import { Lightbulb } from "../../../icons/Lightbulb.js";
5
+ import { Alert, AlertClose, AlertContent, AlertDescription, AlertIcon, AlertTitle } from "../../Alert/index.js";
6
+ import { Badge } from "../../Badge/index.js";
7
+ import { Button } from "../../Button/index.js";
8
+ const PointSelectorError = (t0)=>{
9
+ const $ = c(51);
10
+ let className;
11
+ let error;
12
+ let onApplyFix;
13
+ let onDismiss;
14
+ let props;
15
+ let ref;
16
+ let t1;
17
+ let t2;
18
+ let testId;
19
+ if ($[0] !== t0) {
20
+ ({ ref, error, incomplete: t1, transport: t2, onApplyFix, onDismiss, className, "data-testid": testId, ...props } = t0);
21
+ $[0] = t0;
22
+ $[1] = className;
23
+ $[2] = error;
24
+ $[3] = onApplyFix;
25
+ $[4] = onDismiss;
26
+ $[5] = props;
27
+ $[6] = ref;
28
+ $[7] = t1;
29
+ $[8] = t2;
30
+ $[9] = testId;
31
+ } else {
32
+ className = $[1];
33
+ error = $[2];
34
+ onApplyFix = $[3];
35
+ onDismiss = $[4];
36
+ props = $[5];
37
+ ref = $[6];
38
+ t1 = $[7];
39
+ t2 = $[8];
40
+ testId = $[9];
41
+ }
42
+ const incomplete = void 0 === t1 ? false : t1;
43
+ const transport = void 0 === t2 ? false : t2;
44
+ let t3;
45
+ if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
46
+ t3 = [];
47
+ $[10] = t3;
48
+ } else t3 = $[10];
49
+ const fixButtonRefs = useRef(t3);
50
+ const handleFixKeyDown = (e, index)=>{
51
+ const fixes = error.fixes || [];
52
+ if ("ArrowRight" === e.key && index < fixes.length - 1) {
53
+ e.preventDefault();
54
+ fixButtonRefs.current[index + 1]?.focus();
55
+ } else if ("ArrowLeft" === e.key && index > 0) {
56
+ e.preventDefault();
57
+ fixButtonRefs.current[index - 1]?.focus();
58
+ }
59
+ };
60
+ let t4;
61
+ let t5;
62
+ if ($[11] !== error.fixes || $[12] !== onApplyFix) {
63
+ t4 = ()=>{
64
+ if (!onApplyFix || !error.fixes || 0 === error.fixes.length) return;
65
+ const handleKeyDown = (e_0)=>{
66
+ if (!(e_0.ctrlKey || e_0.metaKey) || !e_0.key.match(/^[1-9]$/)) return;
67
+ const fixIndex = parseInt(e_0.key, 10) - 1;
68
+ const fix = error.fixes?.[fixIndex];
69
+ if (fix) {
70
+ e_0.preventDefault();
71
+ onApplyFix(fix);
72
+ }
73
+ };
74
+ document.addEventListener("keydown", handleKeyDown);
75
+ return ()=>document.removeEventListener("keydown", handleKeyDown);
76
+ };
77
+ t5 = [
78
+ error.fixes,
79
+ onApplyFix
80
+ ];
81
+ $[11] = error.fixes;
82
+ $[12] = onApplyFix;
83
+ $[13] = t4;
84
+ $[14] = t5;
85
+ } else {
86
+ t4 = $[13];
87
+ t5 = $[14];
88
+ }
89
+ useEffect(t4, t5);
90
+ const isWarning = "HEADER_CASE_WARNING" === error.code;
91
+ const color = incomplete ? "info" : isWarning ? "warning" : "destructive";
92
+ const title = incomplete ? "Keep typing..." : isWarning ? "Header Case Recommendation" : transport ? "Connection Error" : "grammar" === error.layer ? "Syntax Error" : "tree" === error.layer ? "Invalid Point" : "Not a Value Point";
93
+ let t6;
94
+ if ($[15] !== error.layer || $[16] !== incomplete || $[17] !== transport) {
95
+ t6 = !incomplete && !transport && /*#__PURE__*/ jsx(Badge, {
96
+ size: "small",
97
+ color: "grammar" === error.layer ? "red" : "amber",
98
+ children: "grammar" === error.layer ? "Grammar" : "tree" === error.layer ? "Tree" : "Value"
99
+ });
100
+ $[15] = error.layer;
101
+ $[16] = incomplete;
102
+ $[17] = transport;
103
+ $[18] = t6;
104
+ } else t6 = $[18];
105
+ const layerBadge = t6;
106
+ const profileGuidance = !incomplete && !transport && "value" === error.layer && ("not_a_value" === error.code ? "This point addresses a container, not a value. Continue to pick a specific field." : "not_single" === error.code ? "This point matches multiple nodes. Refine your point to address a single node." : null);
107
+ const T0 = Alert;
108
+ const t7 = "point-selector-error";
109
+ let t8;
110
+ if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
111
+ t8 = /*#__PURE__*/ jsx(AlertIcon, {});
112
+ $[19] = t8;
113
+ } else t8 = $[19];
114
+ const T1 = AlertContent;
115
+ let t9;
116
+ if ($[20] !== title) {
117
+ t9 = /*#__PURE__*/ jsx(AlertTitle, {
118
+ children: title
119
+ });
120
+ $[20] = title;
121
+ $[21] = t9;
122
+ } else t9 = $[21];
123
+ let t10;
124
+ if ($[22] !== layerBadge || $[23] !== t9) {
125
+ t10 = /*#__PURE__*/ jsxs("div", {
126
+ className: "flex items-center gap-8",
127
+ children: [
128
+ t9,
129
+ layerBadge
130
+ ]
131
+ });
132
+ $[22] = layerBadge;
133
+ $[23] = t9;
134
+ $[24] = t10;
135
+ } else t10 = $[24];
136
+ let t11;
137
+ if ($[25] !== error.span || $[26] !== incomplete) {
138
+ t11 = error.span && !incomplete && /*#__PURE__*/ jsxs("span", {
139
+ className: "ml-4 text-text-tertiary",
140
+ children: [
141
+ "(characters ",
142
+ error.span[0],
143
+ "–",
144
+ error.span[1],
145
+ ")"
146
+ ]
147
+ });
148
+ $[25] = error.span;
149
+ $[26] = incomplete;
150
+ $[27] = t11;
151
+ } else t11 = $[27];
152
+ let t12;
153
+ if ($[28] !== profileGuidance) {
154
+ t12 = profileGuidance && /*#__PURE__*/ jsxs(Fragment, {
155
+ children: [
156
+ /*#__PURE__*/ jsx("br", {}),
157
+ /*#__PURE__*/ jsx("span", {
158
+ children: profileGuidance
159
+ })
160
+ ]
161
+ });
162
+ $[28] = profileGuidance;
163
+ $[29] = t12;
164
+ } else t12 = $[29];
165
+ let t13;
166
+ if ($[30] !== error.message || $[31] !== t11 || $[32] !== t12) {
167
+ t13 = /*#__PURE__*/ jsxs(AlertDescription, {
168
+ children: [
169
+ error.message,
170
+ t11,
171
+ t12
172
+ ]
173
+ });
174
+ $[30] = error.message;
175
+ $[31] = t11;
176
+ $[32] = t12;
177
+ $[33] = t13;
178
+ } else t13 = $[33];
179
+ const t14 = error.fixes && error.fixes.length > 0 && onApplyFix && !incomplete && /*#__PURE__*/ jsxs("div", {
180
+ className: "mt-8 flex flex-col gap-6",
181
+ children: [
182
+ /*#__PURE__*/ jsx("p", {
183
+ className: "text-sm font-medium text-text-secondary",
184
+ children: "Quick fixes:"
185
+ }),
186
+ /*#__PURE__*/ jsx("div", {
187
+ className: "flex flex-wrap gap-6",
188
+ role: "list",
189
+ "aria-label": "Fix suggestions",
190
+ children: error.fixes.map((fix_0, i)=>/*#__PURE__*/ jsxs(Button, {
191
+ ref: (el)=>{
192
+ fixButtonRefs.current[i] = el;
193
+ },
194
+ size: "small",
195
+ variant: "outline",
196
+ color: "neutral",
197
+ onClick: ()=>onApplyFix(fix_0),
198
+ onKeyDown: (e_1)=>handleFixKeyDown(e_1, i),
199
+ "aria-label": `Fix ${i + 1} of ${error.fixes.length}: ${fix_0.label}`,
200
+ "data-testid": testId ? `${testId}--fix-${i}` : void 0,
201
+ children: [
202
+ /*#__PURE__*/ jsx(Lightbulb, {
203
+ className: "size-16"
204
+ }),
205
+ /*#__PURE__*/ jsxs("span", {
206
+ children: [
207
+ i < 9 && /*#__PURE__*/ jsxs("span", {
208
+ className: "text-text-tertiary",
209
+ children: [
210
+ "[Ctrl+",
211
+ i + 1,
212
+ "] "
213
+ ]
214
+ }),
215
+ fix_0.label
216
+ ]
217
+ })
218
+ ]
219
+ }, i))
220
+ })
221
+ ]
222
+ });
223
+ let t15;
224
+ if ($[34] !== T1 || $[35] !== t10 || $[36] !== t13 || $[37] !== t14) {
225
+ t15 = /*#__PURE__*/ jsxs(T1, {
226
+ children: [
227
+ t10,
228
+ t13,
229
+ t14
230
+ ]
231
+ });
232
+ $[34] = T1;
233
+ $[35] = t10;
234
+ $[36] = t13;
235
+ $[37] = t14;
236
+ $[38] = t15;
237
+ } else t15 = $[38];
238
+ let t16;
239
+ if ($[39] !== onDismiss) {
240
+ t16 = onDismiss && /*#__PURE__*/ jsx(AlertClose, {
241
+ onClick: onDismiss
242
+ });
243
+ $[39] = onDismiss;
244
+ $[40] = t16;
245
+ } else t16 = $[40];
246
+ let t17;
247
+ if ($[41] !== T0 || $[42] !== className || $[43] !== color || $[44] !== props || $[45] !== ref || $[46] !== t15 || $[47] !== t16 || $[48] !== t8 || $[49] !== testId) {
248
+ t17 = /*#__PURE__*/ jsxs(T0, {
249
+ ...props,
250
+ ref: ref,
251
+ color: color,
252
+ className: className,
253
+ "data-slot": t7,
254
+ "data-testid": testId,
255
+ children: [
256
+ t8,
257
+ t15,
258
+ t16
259
+ ]
260
+ });
261
+ $[41] = T0;
262
+ $[42] = className;
263
+ $[43] = color;
264
+ $[44] = props;
265
+ $[45] = ref;
266
+ $[46] = t15;
267
+ $[47] = t16;
268
+ $[48] = t8;
269
+ $[49] = testId;
270
+ $[50] = t17;
271
+ } else t17 = $[50];
272
+ return t17;
273
+ };
274
+ PointSelectorError.displayName = "PointSelectorError";
275
+ export { PointSelectorError };
@@ -0,0 +1,20 @@
1
+ import { type FC, type HTMLAttributes, type Ref } from 'react';
2
+ import type { Verdict } from '@wallarm-org/rules-lib';
3
+ export interface PointSelectorInputProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
4
+ /** Ref forwarding to root element */
5
+ ref?: Ref<HTMLDivElement>;
6
+ value: string;
7
+ onChange: (value: string) => void;
8
+ onCursorMove: (pos: number) => void;
9
+ onFocus?: () => void;
10
+ onBlur?: () => void;
11
+ error?: Verdict;
12
+ disabled?: boolean;
13
+ placeholder?: string;
14
+ }
15
+ /**
16
+ * Point Selector Input Component
17
+ *
18
+ * Text input with cursor tracking and validation error display.
19
+ */
20
+ export declare const PointSelectorInput: FC<PointSelectorInputProps>;
@@ -0,0 +1,130 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { c } from "react/compiler-runtime";
3
+ import { useRef } from "react";
4
+ import { useTestId } from "../../../utils/testId.js";
5
+ import { Input } from "../../Input/index.js";
6
+ import { PointSelectorError } from "./PointSelectorError.js";
7
+ const PointSelectorInput = (t0)=>{
8
+ const $ = c(36);
9
+ let className;
10
+ let disabled;
11
+ let error;
12
+ let onBlur;
13
+ let onChange;
14
+ let onCursorMove;
15
+ let onFocus;
16
+ let placeholder;
17
+ let props;
18
+ let ref;
19
+ let value;
20
+ if ($[0] !== t0) {
21
+ ({ ref, value, onChange, onCursorMove, onFocus, onBlur, error, disabled, placeholder, className, ...props } = t0);
22
+ $[0] = t0;
23
+ $[1] = className;
24
+ $[2] = disabled;
25
+ $[3] = error;
26
+ $[4] = onBlur;
27
+ $[5] = onChange;
28
+ $[6] = onCursorMove;
29
+ $[7] = onFocus;
30
+ $[8] = placeholder;
31
+ $[9] = props;
32
+ $[10] = ref;
33
+ $[11] = value;
34
+ } else {
35
+ className = $[1];
36
+ disabled = $[2];
37
+ error = $[3];
38
+ onBlur = $[4];
39
+ onChange = $[5];
40
+ onCursorMove = $[6];
41
+ onFocus = $[7];
42
+ placeholder = $[8];
43
+ props = $[9];
44
+ ref = $[10];
45
+ value = $[11];
46
+ }
47
+ const inputRef = useRef(null);
48
+ const testId = useTestId("input");
49
+ let t1;
50
+ if ($[12] !== onCursorMove) {
51
+ t1 = ()=>{
52
+ if (inputRef.current) onCursorMove(inputRef.current.selectionStart || 0);
53
+ };
54
+ $[12] = onCursorMove;
55
+ $[13] = t1;
56
+ } else t1 = $[13];
57
+ const handleSelectionChange = t1;
58
+ let t2;
59
+ if ($[14] !== handleSelectionChange) {
60
+ t2 = (e)=>{
61
+ handleSelectionChange();
62
+ if ("Escape" === e.key) inputRef.current?.blur();
63
+ };
64
+ $[14] = handleSelectionChange;
65
+ $[15] = t2;
66
+ } else t2 = $[15];
67
+ const handleKeyUp = t2;
68
+ let t3;
69
+ if ($[16] !== onChange) {
70
+ t3 = (e_0)=>onChange(e_0.target.value);
71
+ $[16] = onChange;
72
+ $[17] = t3;
73
+ } else t3 = $[17];
74
+ let t4;
75
+ if ($[18] !== disabled || $[19] !== handleKeyUp || $[20] !== handleSelectionChange || $[21] !== onBlur || $[22] !== onFocus || $[23] !== placeholder || $[24] !== t3 || $[25] !== testId || $[26] !== value) {
76
+ t4 = /*#__PURE__*/ jsx(Input, {
77
+ ref: inputRef,
78
+ "data-testid": testId,
79
+ value: value,
80
+ onChange: t3,
81
+ onKeyUp: handleKeyUp,
82
+ onClick: handleSelectionChange,
83
+ onFocus: onFocus,
84
+ onBlur: onBlur,
85
+ disabled: disabled,
86
+ placeholder: placeholder,
87
+ className: "font-mono"
88
+ });
89
+ $[18] = disabled;
90
+ $[19] = handleKeyUp;
91
+ $[20] = handleSelectionChange;
92
+ $[21] = onBlur;
93
+ $[22] = onFocus;
94
+ $[23] = placeholder;
95
+ $[24] = t3;
96
+ $[25] = testId;
97
+ $[26] = value;
98
+ $[27] = t4;
99
+ } else t4 = $[27];
100
+ let t5;
101
+ if ($[28] !== error) {
102
+ t5 = error && /*#__PURE__*/ jsx(PointSelectorError, {
103
+ error: error
104
+ });
105
+ $[28] = error;
106
+ $[29] = t5;
107
+ } else t5 = $[29];
108
+ let t6;
109
+ if ($[30] !== className || $[31] !== props || $[32] !== ref || $[33] !== t4 || $[34] !== t5) {
110
+ t6 = /*#__PURE__*/ jsxs("div", {
111
+ ...props,
112
+ ref: ref,
113
+ "data-slot": "point-selector-input",
114
+ className: className,
115
+ children: [
116
+ t4,
117
+ t5
118
+ ]
119
+ });
120
+ $[30] = className;
121
+ $[31] = props;
122
+ $[32] = ref;
123
+ $[33] = t4;
124
+ $[34] = t5;
125
+ $[35] = t6;
126
+ } else t6 = $[35];
127
+ return t6;
128
+ };
129
+ PointSelectorInput.displayName = "PointSelectorInput";
130
+ export { PointSelectorInput };
@@ -0,0 +1,31 @@
1
+ import type { FC, HTMLAttributes, RefObject } from 'react';
2
+ import type { CompletionItem } from '@wallarm-org/rules-lib';
3
+ export interface PointSelectorMenuProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onSelect'> {
4
+ /** Whether menu is open */
5
+ open: boolean;
6
+ /** Menu content ID for ARIA */
7
+ contentId?: string;
8
+ /** Anchor element for positioning */
9
+ anchorRef?: RefObject<HTMLElement | null>;
10
+ /** Input element to keep focus */
11
+ focusRef?: RefObject<HTMLInputElement | null>;
12
+ /** Completion items from SDK */
13
+ items: CompletionItem[];
14
+ /** Currently highlighted item ID */
15
+ highlightedId?: string | null;
16
+ /** Called when item is selected */
17
+ onSelect: (item: CompletionItem) => void;
18
+ /** Called when highlight changes */
19
+ onHighlight?: (id: string) => void;
20
+ /** Called when menu should close */
21
+ onClose?: () => void;
22
+ /** Whether this is name/key mode */
23
+ isNameMode?: boolean;
24
+ }
25
+ /**
26
+ * Point Selector Menu Component
27
+ *
28
+ * DropdownMenu-based autocomplete matching rules-frontend StepMenu.
29
+ * Uses DropdownMenu for positioning, z-index, and accessibility.
30
+ */
31
+ export declare const PointSelectorMenu: FC<PointSelectorMenuProps>;