@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.
- package/dist/components/DropdownMenu/DropdownMenu.d.ts +2 -0
- package/dist/components/DropdownMenu/DropdownMenu.js +84 -71
- package/dist/components/DropdownMenu/DropdownMenuItemDescription.js +1 -1
- package/dist/components/FilterInput/hooks/useFilterInputAutocomplete/useFilterInputAutocomplete.js +1 -1
- package/dist/components/Rules/PointSelector/KeyboardShortcutsDialog.d.ts +14 -0
- package/dist/components/Rules/PointSelector/KeyboardShortcutsDialog.js +209 -0
- package/dist/components/Rules/PointSelector/MatchStep.d.ts +15 -0
- package/dist/components/Rules/PointSelector/MatchStep.js +186 -0
- package/dist/components/Rules/PointSelector/MenuFooterHints.d.ts +16 -0
- package/dist/components/Rules/PointSelector/MenuFooterHints.js +177 -0
- package/dist/components/Rules/PointSelector/PointPreview.d.ts +10 -0
- package/dist/components/Rules/PointSelector/PointPreview.js +88 -0
- package/dist/components/Rules/PointSelector/PointSelector.d.ts +17 -0
- package/dist/components/Rules/PointSelector/PointSelector.js +937 -0
- package/dist/components/Rules/PointSelector/PointSelectorEmptyState.d.ts +12 -0
- package/dist/components/Rules/PointSelector/PointSelectorEmptyState.js +173 -0
- package/dist/components/Rules/PointSelector/PointSelectorError.d.ts +31 -0
- package/dist/components/Rules/PointSelector/PointSelectorError.js +275 -0
- package/dist/components/Rules/PointSelector/PointSelectorInput.d.ts +20 -0
- package/dist/components/Rules/PointSelector/PointSelectorInput.js +130 -0
- package/dist/components/Rules/PointSelector/PointSelectorMenu.d.ts +31 -0
- package/dist/components/Rules/PointSelector/PointSelectorMenu.js +317 -0
- package/dist/components/Rules/PointSelector/PointSelectorSkeleton.d.ts +8 -0
- package/dist/components/Rules/PointSelector/PointSelectorSkeleton.js +73 -0
- package/dist/components/Rules/PointSelector/SampleRequest.d.ts +14 -0
- package/dist/components/Rules/PointSelector/SampleRequest.js +116 -0
- package/dist/components/Rules/PointSelector/StepMenu.d.ts +40 -0
- package/dist/components/Rules/PointSelector/StepMenu.js +210 -0
- package/dist/components/Rules/PointSelector/VersionWarning.d.ts +26 -0
- package/dist/components/Rules/PointSelector/VersionWarning.js +231 -0
- package/dist/components/Rules/PointSelector/WhereBar.d.ts +48 -0
- package/dist/components/Rules/PointSelector/WhereBar.js +263 -0
- package/dist/components/Rules/PointSelector/classes.d.ts +28 -0
- package/dist/components/Rules/PointSelector/classes.js +22 -0
- package/dist/components/Rules/PointSelector/index.d.ts +20 -0
- package/dist/components/Rules/PointSelector/index.js +18 -0
- package/dist/components/Rules/PointSelector/liftLayer.d.ts +8 -0
- package/dist/components/Rules/PointSelector/liftLayer.js +4 -0
- package/dist/components/Rules/PointSelector/sampleValue.d.ts +6 -0
- package/dist/components/Rules/PointSelector/sampleValue.js +51 -0
- package/dist/components/Rules/PointSelector/sdkBridge.d.ts +508 -0
- package/dist/components/Rules/PointSelector/sdkBridge.js +339 -0
- package/dist/components/Rules/PointSelector/types.d.ts +304 -0
- package/dist/components/Rules/PointSelector/types.js +0 -0
- package/dist/components/Rules/PointSelector/usePointSelector.d.ts +161 -0
- package/dist/components/Rules/PointSelector/usePointSelector.js +1088 -0
- package/dist/components/Rules/RuleBuilder/ActionEditor/ActionEditor.d.ts +28 -0
- package/dist/components/Rules/RuleBuilder/ActionEditor/ActionEditor.js +208 -0
- package/dist/components/Rules/RuleBuilder/ActionEditor/ActionFields.d.ts +23 -0
- package/dist/components/Rules/RuleBuilder/ActionEditor/ActionFields.js +950 -0
- package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTargetPicker.d.ts +21 -0
- package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTargetPicker.js +110 -0
- package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTypeSelect.d.ts +20 -0
- package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTypeSelect.js +31 -0
- package/dist/components/Rules/RuleBuilder/ActionEditor/AttackTypeField.d.ts +23 -0
- package/dist/components/Rules/RuleBuilder/ActionEditor/AttackTypeField.js +131 -0
- package/dist/components/Rules/RuleBuilder/ActionEditor/classes.d.ts +17 -0
- package/dist/components/Rules/RuleBuilder/ActionEditor/classes.js +14 -0
- package/dist/components/Rules/RuleBuilder/ActionEditor/index.d.ts +6 -0
- package/dist/components/Rules/RuleBuilder/ActionEditor/index.js +6 -0
- package/dist/components/Rules/RuleBuilder/ConditionTree/AddConditionMenu.d.ts +24 -0
- package/dist/components/Rules/RuleBuilder/ConditionTree/AddConditionMenu.js +245 -0
- package/dist/components/Rules/RuleBuilder/ConditionTree/AttackCondition.d.ts +15 -0
- package/dist/components/Rules/RuleBuilder/ConditionTree/AttackCondition.js +691 -0
- package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionCard.d.ts +19 -0
- package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionCard.js +72 -0
- package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionTree.d.ts +27 -0
- package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionTree.js +407 -0
- package/dist/components/Rules/RuleBuilder/ConditionTree/FieldCondition.d.ts +14 -0
- package/dist/components/Rules/RuleBuilder/ConditionTree/FieldCondition.js +269 -0
- package/dist/components/Rules/RuleBuilder/ConditionTree/GroupCondition.d.ts +25 -0
- package/dist/components/Rules/RuleBuilder/ConditionTree/GroupCondition.js +99 -0
- package/dist/components/Rules/RuleBuilder/ConditionTree/SampleCondition.d.ts +14 -0
- package/dist/components/Rules/RuleBuilder/ConditionTree/SampleCondition.js +118 -0
- package/dist/components/Rules/RuleBuilder/ConditionTree/SignalCondition.d.ts +14 -0
- package/dist/components/Rules/RuleBuilder/ConditionTree/SignalCondition.js +446 -0
- package/dist/components/Rules/RuleBuilder/ConditionTree/TagCondition.d.ts +14 -0
- package/dist/components/Rules/RuleBuilder/ConditionTree/TagCondition.js +266 -0
- package/dist/components/Rules/RuleBuilder/ConditionTree/classes.d.ts +35 -0
- package/dist/components/Rules/RuleBuilder/ConditionTree/classes.js +57 -0
- package/dist/components/Rules/RuleBuilder/ConditionTree/index.d.ts +15 -0
- package/dist/components/Rules/RuleBuilder/ConditionTree/index.js +10 -0
- package/dist/components/Rules/RuleBuilder/RuleBuilder.d.ts +67 -0
- package/dist/components/Rules/RuleBuilder/RuleBuilder.js +366 -0
- package/dist/components/Rules/RuleBuilder/Summary/ActionSummary.d.ts +32 -0
- package/dist/components/Rules/RuleBuilder/Summary/ActionSummary.js +420 -0
- package/dist/components/Rules/RuleBuilder/Summary/ConditionSummary.d.ts +27 -0
- package/dist/components/Rules/RuleBuilder/Summary/ConditionSummary.js +446 -0
- package/dist/components/Rules/RuleBuilder/Summary/index.d.ts +7 -0
- package/dist/components/Rules/RuleBuilder/Summary/index.js +2 -0
- package/dist/components/Rules/RuleBuilder/classes.d.ts +19 -0
- package/dist/components/Rules/RuleBuilder/classes.js +18 -0
- package/dist/components/Rules/RuleBuilder/index.d.ts +55 -0
- package/dist/components/Rules/RuleBuilder/index.js +11 -0
- package/dist/components/Rules/RuleBuilder/models/actionModel.d.ts +31 -0
- package/dist/components/Rules/RuleBuilder/models/actionModel.js +276 -0
- package/dist/components/Rules/RuleBuilder/models/conditionModel.d.ts +95 -0
- package/dist/components/Rules/RuleBuilder/models/conditionModel.js +418 -0
- package/dist/components/Rules/RuleBuilder/models/index.d.ts +3 -0
- package/dist/components/Rules/RuleBuilder/models/index.js +3 -0
- package/dist/components/Rules/RuleBuilder/models/validation.d.ts +176 -0
- package/dist/components/Rules/RuleBuilder/models/validation.js +242 -0
- package/dist/components/Rules/RuleBuilder/shared/ChoiceSelect.d.ts +27 -0
- package/dist/components/Rules/RuleBuilder/shared/ChoiceSelect.js +92 -0
- package/dist/components/Rules/RuleBuilder/shared/index.d.ts +1 -0
- package/dist/components/Rules/RuleBuilder/shared/index.js +1 -0
- package/dist/components/Rules/RuleBuilder/types.d.ts +384 -0
- package/dist/components/Rules/RuleBuilder/types.js +0 -0
- package/dist/components/Rules/RuleBuilder/utils/constants.d.ts +65 -0
- package/dist/components/Rules/RuleBuilder/utils/constants.js +356 -0
- package/dist/components/Rules/RuleBuilder/utils/extractBindings.d.ts +48 -0
- package/dist/components/Rules/RuleBuilder/utils/extractBindings.js +42 -0
- package/dist/components/Rules/RuleBuilder/utils/helpers.d.ts +92 -0
- package/dist/components/Rules/RuleBuilder/utils/helpers.js +54 -0
- package/dist/components/Rules/RuleBuilder/utils/index.d.ts +2 -0
- package/dist/components/Rules/RuleBuilder/utils/index.js +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/metadata/components.json +100 -2
- package/dist/metadata/guidelines.json +1 -1
- package/package.json +4 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ActionEditor
|
|
3
|
+
*
|
|
4
|
+
* Main action configuration component.
|
|
5
|
+
* Orchestrates action type selection, fields, and target picker.
|
|
6
|
+
*/
|
|
7
|
+
import type { FC } from 'react';
|
|
8
|
+
import type { TestableProps } from '../../../../utils/testId.js';
|
|
9
|
+
import type { ActionDraft, Choice, GroupCondition } from '../types.js';
|
|
10
|
+
export interface ActionEditorProps extends TestableProps {
|
|
11
|
+
/** Current action draft */
|
|
12
|
+
value: ActionDraft;
|
|
13
|
+
/** Called when action changes */
|
|
14
|
+
onChange: (value: ActionDraft) => void;
|
|
15
|
+
/** Available attack types for selection */
|
|
16
|
+
attackTypes: Choice[];
|
|
17
|
+
/** Current condition tree (for extracting bindings) */
|
|
18
|
+
condition: GroupCondition;
|
|
19
|
+
/** Validation problems to display */
|
|
20
|
+
problems?: string[];
|
|
21
|
+
/** Show validation errors */
|
|
22
|
+
showProblems?: boolean;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Action configuration editor.
|
|
26
|
+
* Handles all 12 action types with conditional field rendering.
|
|
27
|
+
*/
|
|
28
|
+
export declare const ActionEditor: FC<ActionEditorProps>;
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { Code } from "../../../Code/index.js";
|
|
4
|
+
import { Field, FieldLabel } from "../../../Field/index.js";
|
|
5
|
+
import { Text } from "../../../Text/index.js";
|
|
6
|
+
import { newAction } from "../models/actionModel.js";
|
|
7
|
+
import { ChoiceSelect } from "../shared/ChoiceSelect.js";
|
|
8
|
+
import { ACTION_KIND_CHOICES, TARGET_REQUIREMENT } from "../utils/constants.js";
|
|
9
|
+
import { ActionFields } from "./ActionFields.js";
|
|
10
|
+
import { ActionTargetPicker } from "./ActionTargetPicker.js";
|
|
11
|
+
import { ActionTypeSelect } from "./ActionTypeSelect.js";
|
|
12
|
+
const ROW = "flex flex-col gap-6";
|
|
13
|
+
const WIDE = {
|
|
14
|
+
maxWidth: 420
|
|
15
|
+
};
|
|
16
|
+
const ActionEditor = (t0)=>{
|
|
17
|
+
const $ = c(39);
|
|
18
|
+
const { value, onChange, attackTypes, condition, problems: t1, showProblems: t2, "data-testid": testId } = t0;
|
|
19
|
+
let t3;
|
|
20
|
+
if ($[0] !== t1) {
|
|
21
|
+
t3 = void 0 === t1 ? [] : t1;
|
|
22
|
+
$[0] = t1;
|
|
23
|
+
$[1] = t3;
|
|
24
|
+
} else t3 = $[1];
|
|
25
|
+
const problems = t3;
|
|
26
|
+
const showProblems = void 0 === t2 ? false : t2;
|
|
27
|
+
const kind = value.kind;
|
|
28
|
+
if ("raw" === kind) {
|
|
29
|
+
let t4;
|
|
30
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
31
|
+
t4 = /*#__PURE__*/ jsx(Text, {
|
|
32
|
+
size: "sm",
|
|
33
|
+
color: "secondary",
|
|
34
|
+
children: "This action cannot be edited here yet; it is kept as written. Pick another action to replace it."
|
|
35
|
+
});
|
|
36
|
+
$[2] = t4;
|
|
37
|
+
} else t4 = $[2];
|
|
38
|
+
let t5;
|
|
39
|
+
if ($[3] !== value.raw) {
|
|
40
|
+
t5 = JSON.stringify(value.raw);
|
|
41
|
+
$[3] = value.raw;
|
|
42
|
+
$[4] = t5;
|
|
43
|
+
} else t5 = $[4];
|
|
44
|
+
let t6;
|
|
45
|
+
if ($[5] !== t5) {
|
|
46
|
+
t6 = /*#__PURE__*/ jsx(Code, {
|
|
47
|
+
size: "s",
|
|
48
|
+
className: "break-all",
|
|
49
|
+
children: t5
|
|
50
|
+
});
|
|
51
|
+
$[5] = t5;
|
|
52
|
+
$[6] = t6;
|
|
53
|
+
} else t6 = $[6];
|
|
54
|
+
let t7;
|
|
55
|
+
if ($[7] !== onChange) {
|
|
56
|
+
t7 = /*#__PURE__*/ jsx("div", {
|
|
57
|
+
style: WIDE,
|
|
58
|
+
children: /*#__PURE__*/ jsx(ChoiceSelect, {
|
|
59
|
+
label: "Replace with",
|
|
60
|
+
placeholder: "Replace with another action",
|
|
61
|
+
value: "",
|
|
62
|
+
choices: ACTION_KIND_CHOICES,
|
|
63
|
+
onChange: (v)=>v && onChange(newAction(v))
|
|
64
|
+
})
|
|
65
|
+
});
|
|
66
|
+
$[7] = onChange;
|
|
67
|
+
$[8] = t7;
|
|
68
|
+
} else t7 = $[8];
|
|
69
|
+
let t8;
|
|
70
|
+
if ($[9] !== t6 || $[10] !== t7 || $[11] !== testId) {
|
|
71
|
+
t8 = /*#__PURE__*/ jsxs("div", {
|
|
72
|
+
className: ROW,
|
|
73
|
+
"data-testid": testId,
|
|
74
|
+
"data-slot": "action-editor",
|
|
75
|
+
children: [
|
|
76
|
+
t4,
|
|
77
|
+
t6,
|
|
78
|
+
t7
|
|
79
|
+
]
|
|
80
|
+
});
|
|
81
|
+
$[9] = t6;
|
|
82
|
+
$[10] = t7;
|
|
83
|
+
$[11] = testId;
|
|
84
|
+
$[12] = t8;
|
|
85
|
+
} else t8 = $[12];
|
|
86
|
+
return t8;
|
|
87
|
+
}
|
|
88
|
+
let t4;
|
|
89
|
+
if ($[13] !== onChange || $[14] !== value.attackType) {
|
|
90
|
+
t4 = (newKind)=>{
|
|
91
|
+
const preservedAction = newAction(newKind);
|
|
92
|
+
if (value.attackType && "attackType" in preservedAction) preservedAction.attackType = value.attackType;
|
|
93
|
+
onChange(preservedAction);
|
|
94
|
+
};
|
|
95
|
+
$[13] = onChange;
|
|
96
|
+
$[14] = value.attackType;
|
|
97
|
+
$[15] = t4;
|
|
98
|
+
} else t4 = $[15];
|
|
99
|
+
const handleKindChange = t4;
|
|
100
|
+
let t5;
|
|
101
|
+
let t6;
|
|
102
|
+
if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
|
|
103
|
+
t5 = /*#__PURE__*/ jsx(Text, {
|
|
104
|
+
size: "sm",
|
|
105
|
+
children: "Then"
|
|
106
|
+
});
|
|
107
|
+
t6 = {
|
|
108
|
+
width: 360
|
|
109
|
+
};
|
|
110
|
+
$[16] = t5;
|
|
111
|
+
$[17] = t6;
|
|
112
|
+
} else {
|
|
113
|
+
t5 = $[16];
|
|
114
|
+
t6 = $[17];
|
|
115
|
+
}
|
|
116
|
+
let t7;
|
|
117
|
+
if ($[18] !== handleKindChange || $[19] !== kind) {
|
|
118
|
+
t7 = /*#__PURE__*/ jsxs("div", {
|
|
119
|
+
className: "flex flex-wrap items-center gap-8",
|
|
120
|
+
children: [
|
|
121
|
+
t5,
|
|
122
|
+
/*#__PURE__*/ jsx("div", {
|
|
123
|
+
style: t6,
|
|
124
|
+
children: /*#__PURE__*/ jsx(ActionTypeSelect, {
|
|
125
|
+
value: kind,
|
|
126
|
+
onChange: handleKindChange,
|
|
127
|
+
testId: "action-kind"
|
|
128
|
+
})
|
|
129
|
+
})
|
|
130
|
+
]
|
|
131
|
+
});
|
|
132
|
+
$[18] = handleKindChange;
|
|
133
|
+
$[19] = kind;
|
|
134
|
+
$[20] = t7;
|
|
135
|
+
} else t7 = $[20];
|
|
136
|
+
let t8;
|
|
137
|
+
if ($[21] !== attackTypes || $[22] !== condition || $[23] !== onChange || $[24] !== value) {
|
|
138
|
+
t8 = /*#__PURE__*/ jsx(ActionFields, {
|
|
139
|
+
action: value,
|
|
140
|
+
onChange: onChange,
|
|
141
|
+
attackTypes: attackTypes,
|
|
142
|
+
condition: condition
|
|
143
|
+
});
|
|
144
|
+
$[21] = attackTypes;
|
|
145
|
+
$[22] = condition;
|
|
146
|
+
$[23] = onChange;
|
|
147
|
+
$[24] = value;
|
|
148
|
+
$[25] = t8;
|
|
149
|
+
} else t8 = $[25];
|
|
150
|
+
let t9;
|
|
151
|
+
if ($[26] !== kind || $[27] !== onChange || $[28] !== value) {
|
|
152
|
+
t9 = "flow" !== TARGET_REQUIREMENT[kind] && /*#__PURE__*/ jsxs(Field, {
|
|
153
|
+
children: [
|
|
154
|
+
/*#__PURE__*/ jsx(FieldLabel, {
|
|
155
|
+
children: "combine" === kind ? "Join repeated keys in" : "Applies to"
|
|
156
|
+
}),
|
|
157
|
+
/*#__PURE__*/ jsx(ActionTargetPicker, {
|
|
158
|
+
action: value,
|
|
159
|
+
onChange: onChange
|
|
160
|
+
})
|
|
161
|
+
]
|
|
162
|
+
});
|
|
163
|
+
$[26] = kind;
|
|
164
|
+
$[27] = onChange;
|
|
165
|
+
$[28] = value;
|
|
166
|
+
$[29] = t9;
|
|
167
|
+
} else t9 = $[29];
|
|
168
|
+
let t10;
|
|
169
|
+
if ($[30] !== problems || $[31] !== showProblems) {
|
|
170
|
+
t10 = showProblems && problems.length > 0 && /*#__PURE__*/ jsx("div", {
|
|
171
|
+
className: "flex flex-col gap-2",
|
|
172
|
+
children: problems.map(_temp)
|
|
173
|
+
});
|
|
174
|
+
$[30] = problems;
|
|
175
|
+
$[31] = showProblems;
|
|
176
|
+
$[32] = t10;
|
|
177
|
+
} else t10 = $[32];
|
|
178
|
+
let t11;
|
|
179
|
+
if ($[33] !== t10 || $[34] !== t7 || $[35] !== t8 || $[36] !== t9 || $[37] !== testId) {
|
|
180
|
+
t11 = /*#__PURE__*/ jsxs("div", {
|
|
181
|
+
className: "flex flex-col gap-12",
|
|
182
|
+
"data-testid": testId,
|
|
183
|
+
"data-slot": "action-editor",
|
|
184
|
+
children: [
|
|
185
|
+
t7,
|
|
186
|
+
t8,
|
|
187
|
+
t9,
|
|
188
|
+
t10
|
|
189
|
+
]
|
|
190
|
+
});
|
|
191
|
+
$[33] = t10;
|
|
192
|
+
$[34] = t7;
|
|
193
|
+
$[35] = t8;
|
|
194
|
+
$[36] = t9;
|
|
195
|
+
$[37] = testId;
|
|
196
|
+
$[38] = t11;
|
|
197
|
+
} else t11 = $[38];
|
|
198
|
+
return t11;
|
|
199
|
+
};
|
|
200
|
+
ActionEditor.displayName = "ActionEditor";
|
|
201
|
+
function _temp(p) {
|
|
202
|
+
return /*#__PURE__*/ jsx(Text, {
|
|
203
|
+
size: "sm",
|
|
204
|
+
color: "danger",
|
|
205
|
+
children: p
|
|
206
|
+
}, p);
|
|
207
|
+
}
|
|
208
|
+
export { ActionEditor };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ActionFields
|
|
3
|
+
*
|
|
4
|
+
* Conditional field rendering based on action kind.
|
|
5
|
+
* Each action type has different required fields.
|
|
6
|
+
*/
|
|
7
|
+
import type { FC } from 'react';
|
|
8
|
+
import type { ActionDraft, Choice, GroupCondition } from '../types.js';
|
|
9
|
+
export interface ActionFieldsProps {
|
|
10
|
+
/** Current action draft */
|
|
11
|
+
action: ActionDraft;
|
|
12
|
+
/** Called when action changes */
|
|
13
|
+
onChange: (action: ActionDraft) => void;
|
|
14
|
+
/** Available attack types for selection */
|
|
15
|
+
attackTypes: Choice[];
|
|
16
|
+
/** Current condition tree (for extracting bindings) */
|
|
17
|
+
condition: GroupCondition;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Renders action-specific fields based on action.kind.
|
|
21
|
+
* Switches on kind and renders appropriate input fields.
|
|
22
|
+
*/
|
|
23
|
+
export declare const ActionFields: FC<ActionFieldsProps>;
|