@wallarm-org/design-system 4.8.0-rc-fix-claude-code.1 → 4.8.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/README.md +2 -4
- package/dist/components/BulkBar/index.d.ts +0 -5
- package/dist/components/Drawer/classes.js +1 -1
- 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/Overlay/Overlay.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/components/SearchInput/SearchInput.d.ts +5 -7
- package/dist/components/SearchInput/SearchInput.js +101 -119
- package/dist/components/Select/SelectSearchInput.d.ts +1 -1
- package/dist/components/Table/types.d.ts +1 -1
- package/dist/components/Tabs/Tabs.d.ts +0 -1
- package/dist/components/Tabs/Tabs.js +28 -30
- package/dist/components/Tabs/TabsList/index.d.ts +1 -1
- package/dist/components/Tabs/index.d.ts +2 -2
- package/dist/components/Tour/TourPositioner.d.ts +0 -3
- package/dist/components/Tour/TourPositioner.js +4 -4
- package/dist/index.d.ts +3 -2
- package/dist/index.js +2 -1
- package/dist/metadata/components.json +9077 -12300
- package/dist/theme/typography.css +0 -5
- package/dist/utils/formatDateTime.d.ts +0 -6
- package/dist/utils/formatDateTime.js +1 -13
- package/package.json +4 -6
- package/dist/components/NotificationCenter/NotificationCenter.d.ts +0 -20
- package/dist/components/NotificationCenter/NotificationCenter.js +0 -65
- package/dist/components/NotificationCenter/NotificationCenterBody.d.ts +0 -18
- package/dist/components/NotificationCenter/NotificationCenterBody.js +0 -202
- package/dist/components/NotificationCenter/NotificationCenterContent.d.ts +0 -5
- package/dist/components/NotificationCenter/NotificationCenterContent.js +0 -42
- package/dist/components/NotificationCenter/NotificationCenterHeader.d.ts +0 -20
- package/dist/components/NotificationCenter/NotificationCenterHeader.js +0 -202
- package/dist/components/NotificationCenter/NotificationCenterItem.d.ts +0 -26
- package/dist/components/NotificationCenter/NotificationCenterItem.js +0 -211
- package/dist/components/NotificationCenter/NotificationCenterItemTime.d.ts +0 -9
- package/dist/components/NotificationCenter/NotificationCenterItemTime.js +0 -148
- package/dist/components/NotificationCenter/NotificationCenterItemTitle.d.ts +0 -14
- package/dist/components/NotificationCenter/NotificationCenterItemTitle.js +0 -115
- package/dist/components/NotificationCenter/NotificationCenterTabs.d.ts +0 -10
- package/dist/components/NotificationCenter/NotificationCenterTabs.js +0 -77
- package/dist/components/NotificationCenter/NotificationCenterTrigger.d.ts +0 -13
- package/dist/components/NotificationCenter/NotificationCenterTrigger.js +0 -138
- package/dist/components/NotificationCenter/index.d.ts +0 -9
- package/dist/components/NotificationCenter/index.js +0 -9
- package/dist/guidelines/foundations/color.md +0 -157
- package/dist/guidelines/foundations/focus.md +0 -122
- package/dist/guidelines/foundations/layering.md +0 -131
- package/dist/guidelines/foundations/radius-elevation.md +0 -111
- package/dist/guidelines/foundations/spacing.md +0 -117
- package/dist/guidelines/foundations/typography.md +0 -114
- package/dist/guidelines/patterns/app-layout.md +0 -1567
- package/dist/guidelines/patterns/auth-page.md +0 -668
- package/dist/guidelines/patterns/confirmation-dialogs.md +0 -605
- package/dist/guidelines/patterns/create-edit-forms.md +0 -768
- package/dist/guidelines/patterns/detail-drawer.md +0 -868
- package/dist/guidelines/patterns/empty-states.md +0 -461
- package/dist/guidelines/patterns/entity-table.md +0 -533
- package/dist/guidelines/patterns/feedback-toasts.md +0 -493
- package/dist/guidelines/patterns/filtering.md +0 -630
- package/dist/guidelines/patterns/resource-list-page.md +0 -558
- package/dist/guidelines/patterns/settings-page.md +0 -752
- package/dist/guidelines/rules.md +0 -25
- package/dist/metadata/guidelines.json +0 -1705
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { cn } from "../../../utils/cn.js";
|
|
4
|
+
import { useTestId } from "../../../utils/testId.js";
|
|
5
|
+
import { Tag } from "../../Tag/index.js";
|
|
6
|
+
import { chipSeparatorClasses, pendingLabelClasses, whereBarInputClasses, whereBarVariants } from "./classes.js";
|
|
7
|
+
const WhereBar = (t0)=>{
|
|
8
|
+
const $ = c(70);
|
|
9
|
+
let barRef;
|
|
10
|
+
let className;
|
|
11
|
+
let editable;
|
|
12
|
+
let errorMessage;
|
|
13
|
+
let errorSpan;
|
|
14
|
+
let inputRef;
|
|
15
|
+
let menuId;
|
|
16
|
+
let onChipClick;
|
|
17
|
+
let onFocus;
|
|
18
|
+
let onKeyDown;
|
|
19
|
+
let onQueryChange;
|
|
20
|
+
let props;
|
|
21
|
+
let proton;
|
|
22
|
+
let query;
|
|
23
|
+
let ref;
|
|
24
|
+
let segments;
|
|
25
|
+
let showInput;
|
|
26
|
+
let t1;
|
|
27
|
+
let t2;
|
|
28
|
+
let t3;
|
|
29
|
+
let t4;
|
|
30
|
+
if ($[0] !== t0) {
|
|
31
|
+
({ ref, barRef, inputRef, segments, proton, pointString: t1, pendingLabel: t2, showInput, editable, query, placeholder: t3, open: t4, menuId, errorSpan, errorMessage, className, onQueryChange, onKeyDown, onFocus, onChipClick, ...props } = t0);
|
|
32
|
+
$[0] = t0;
|
|
33
|
+
$[1] = barRef;
|
|
34
|
+
$[2] = className;
|
|
35
|
+
$[3] = editable;
|
|
36
|
+
$[4] = errorMessage;
|
|
37
|
+
$[5] = errorSpan;
|
|
38
|
+
$[6] = inputRef;
|
|
39
|
+
$[7] = menuId;
|
|
40
|
+
$[8] = onChipClick;
|
|
41
|
+
$[9] = onFocus;
|
|
42
|
+
$[10] = onKeyDown;
|
|
43
|
+
$[11] = onQueryChange;
|
|
44
|
+
$[12] = props;
|
|
45
|
+
$[13] = proton;
|
|
46
|
+
$[14] = query;
|
|
47
|
+
$[15] = ref;
|
|
48
|
+
$[16] = segments;
|
|
49
|
+
$[17] = showInput;
|
|
50
|
+
$[18] = t1;
|
|
51
|
+
$[19] = t2;
|
|
52
|
+
$[20] = t3;
|
|
53
|
+
$[21] = t4;
|
|
54
|
+
} else {
|
|
55
|
+
barRef = $[1];
|
|
56
|
+
className = $[2];
|
|
57
|
+
editable = $[3];
|
|
58
|
+
errorMessage = $[4];
|
|
59
|
+
errorSpan = $[5];
|
|
60
|
+
inputRef = $[6];
|
|
61
|
+
menuId = $[7];
|
|
62
|
+
onChipClick = $[8];
|
|
63
|
+
onFocus = $[9];
|
|
64
|
+
onKeyDown = $[10];
|
|
65
|
+
onQueryChange = $[11];
|
|
66
|
+
props = $[12];
|
|
67
|
+
proton = $[13];
|
|
68
|
+
query = $[14];
|
|
69
|
+
ref = $[15];
|
|
70
|
+
segments = $[16];
|
|
71
|
+
showInput = $[17];
|
|
72
|
+
t1 = $[18];
|
|
73
|
+
t2 = $[19];
|
|
74
|
+
t3 = $[20];
|
|
75
|
+
t4 = $[21];
|
|
76
|
+
}
|
|
77
|
+
const pendingLabel = void 0 === t2 ? "" : t2;
|
|
78
|
+
const placeholder = void 0 === t3 ? "" : t3;
|
|
79
|
+
const open = void 0 === t4 ? false : t4;
|
|
80
|
+
const testId = useTestId("bar");
|
|
81
|
+
let t5;
|
|
82
|
+
bb0: {
|
|
83
|
+
if (!proton) {
|
|
84
|
+
let t6;
|
|
85
|
+
if ($[22] !== segments) {
|
|
86
|
+
t6 = segments.map(_temp);
|
|
87
|
+
$[22] = segments;
|
|
88
|
+
$[23] = t6;
|
|
89
|
+
} else t6 = $[23];
|
|
90
|
+
t5 = t6;
|
|
91
|
+
break bb0;
|
|
92
|
+
}
|
|
93
|
+
let t6;
|
|
94
|
+
if ($[24] !== proton || $[25] !== segments) {
|
|
95
|
+
t6 = segments.map((seg, i)=>{
|
|
96
|
+
if (seg.label) return seg.label;
|
|
97
|
+
try {
|
|
98
|
+
const pathUpToHere = segments.slice(0, i + 1);
|
|
99
|
+
const fullPath = proton.point.render(pathUpToHere);
|
|
100
|
+
if (0 === i) return fullPath;
|
|
101
|
+
const pathBefore = proton.point.render(segments.slice(0, i));
|
|
102
|
+
if (fullPath.startsWith(pathBefore)) return fullPath.slice(pathBefore.length);
|
|
103
|
+
return fullPath;
|
|
104
|
+
} catch {
|
|
105
|
+
return "";
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
$[24] = proton;
|
|
109
|
+
$[25] = segments;
|
|
110
|
+
$[26] = t6;
|
|
111
|
+
} else t6 = $[26];
|
|
112
|
+
t5 = t6;
|
|
113
|
+
}
|
|
114
|
+
const segmentLabels = t5;
|
|
115
|
+
let t6;
|
|
116
|
+
if ($[27] !== errorSpan || $[28] !== segments) {
|
|
117
|
+
t6 = (segmentIndex)=>{
|
|
118
|
+
if (!errorSpan) return false;
|
|
119
|
+
let currentPos = 0;
|
|
120
|
+
let segmentStart = 0;
|
|
121
|
+
let segmentEnd = 0;
|
|
122
|
+
for(let i_0 = 0; i_0 <= segmentIndex; i_0++){
|
|
123
|
+
const seg_0 = segments[i_0];
|
|
124
|
+
segmentStart = currentPos;
|
|
125
|
+
segmentEnd = currentPos + (seg_0?.text?.length || 0);
|
|
126
|
+
currentPos = segmentEnd;
|
|
127
|
+
}
|
|
128
|
+
return segmentEnd > errorSpan[0] && segmentStart < errorSpan[1];
|
|
129
|
+
};
|
|
130
|
+
$[27] = errorSpan;
|
|
131
|
+
$[28] = segments;
|
|
132
|
+
$[29] = t6;
|
|
133
|
+
} else t6 = $[29];
|
|
134
|
+
const getSegmentInError = t6;
|
|
135
|
+
const t7 = ref ?? barRef;
|
|
136
|
+
const t8 = open || void 0;
|
|
137
|
+
let t9;
|
|
138
|
+
if ($[30] !== className || $[31] !== editable) {
|
|
139
|
+
t9 = cn(whereBarVariants({
|
|
140
|
+
editable
|
|
141
|
+
}), className);
|
|
142
|
+
$[30] = className;
|
|
143
|
+
$[31] = editable;
|
|
144
|
+
$[32] = t9;
|
|
145
|
+
} else t9 = $[32];
|
|
146
|
+
let t10;
|
|
147
|
+
if ($[33] !== errorMessage || $[34] !== getSegmentInError || $[35] !== onChipClick || $[36] !== pendingLabel || $[37] !== segmentLabels || $[38] !== segments || $[39] !== showInput) {
|
|
148
|
+
let t11;
|
|
149
|
+
if ($[41] !== errorMessage || $[42] !== getSegmentInError || $[43] !== onChipClick || $[44] !== pendingLabel || $[45] !== segmentLabels || $[46] !== segments.length || $[47] !== showInput) {
|
|
150
|
+
t11 = (s_0, i_1)=>{
|
|
151
|
+
const isInError = getSegmentInError(i_1);
|
|
152
|
+
const label = segmentLabels[i_1];
|
|
153
|
+
return /*#__PURE__*/ jsxs("span", {
|
|
154
|
+
className: "flex items-center gap-6",
|
|
155
|
+
children: [
|
|
156
|
+
/*#__PURE__*/ jsx(Tag, {
|
|
157
|
+
asChild: true,
|
|
158
|
+
children: /*#__PURE__*/ jsx("button", {
|
|
159
|
+
type: "button",
|
|
160
|
+
onClick: ()=>onChipClick(i_1),
|
|
161
|
+
title: isInError && errorMessage ? errorMessage : `Change what follows ${label}`,
|
|
162
|
+
className: cn(isInError && "ring-2 ring-border-critical"),
|
|
163
|
+
children: label
|
|
164
|
+
})
|
|
165
|
+
}),
|
|
166
|
+
(i_1 < segments.length - 1 || showInput || pendingLabel) && /*#__PURE__*/ jsx("span", {
|
|
167
|
+
className: chipSeparatorClasses,
|
|
168
|
+
"aria-hidden": true,
|
|
169
|
+
children: "›"
|
|
170
|
+
})
|
|
171
|
+
]
|
|
172
|
+
}, i_1);
|
|
173
|
+
};
|
|
174
|
+
$[41] = errorMessage;
|
|
175
|
+
$[42] = getSegmentInError;
|
|
176
|
+
$[43] = onChipClick;
|
|
177
|
+
$[44] = pendingLabel;
|
|
178
|
+
$[45] = segmentLabels;
|
|
179
|
+
$[46] = segments.length;
|
|
180
|
+
$[47] = showInput;
|
|
181
|
+
$[48] = t11;
|
|
182
|
+
} else t11 = $[48];
|
|
183
|
+
t10 = segments.map(t11);
|
|
184
|
+
$[33] = errorMessage;
|
|
185
|
+
$[34] = getSegmentInError;
|
|
186
|
+
$[35] = onChipClick;
|
|
187
|
+
$[36] = pendingLabel;
|
|
188
|
+
$[37] = segmentLabels;
|
|
189
|
+
$[38] = segments;
|
|
190
|
+
$[39] = showInput;
|
|
191
|
+
$[40] = t10;
|
|
192
|
+
} else t10 = $[40];
|
|
193
|
+
let t11;
|
|
194
|
+
if ($[49] !== pendingLabel) {
|
|
195
|
+
t11 = pendingLabel && /*#__PURE__*/ jsx("span", {
|
|
196
|
+
className: pendingLabelClasses,
|
|
197
|
+
children: pendingLabel
|
|
198
|
+
});
|
|
199
|
+
$[49] = pendingLabel;
|
|
200
|
+
$[50] = t11;
|
|
201
|
+
} else t11 = $[50];
|
|
202
|
+
let t12;
|
|
203
|
+
if ($[51] !== inputRef || $[52] !== menuId || $[53] !== onFocus || $[54] !== onKeyDown || $[55] !== onQueryChange || $[56] !== open || $[57] !== placeholder || $[58] !== query || $[59] !== showInput) {
|
|
204
|
+
t12 = showInput && /*#__PURE__*/ jsx("input", {
|
|
205
|
+
ref: inputRef,
|
|
206
|
+
role: "combobox",
|
|
207
|
+
"aria-label": "type to filter, or the number of an option",
|
|
208
|
+
"aria-haspopup": "listbox",
|
|
209
|
+
"aria-controls": menuId,
|
|
210
|
+
"aria-expanded": open,
|
|
211
|
+
className: whereBarInputClasses,
|
|
212
|
+
value: query,
|
|
213
|
+
placeholder: placeholder,
|
|
214
|
+
spellCheck: false,
|
|
215
|
+
autoComplete: "off",
|
|
216
|
+
onChange: (e)=>onQueryChange(e.target.value),
|
|
217
|
+
onKeyDown: onKeyDown,
|
|
218
|
+
onFocus: onFocus,
|
|
219
|
+
onClick: onFocus
|
|
220
|
+
});
|
|
221
|
+
$[51] = inputRef;
|
|
222
|
+
$[52] = menuId;
|
|
223
|
+
$[53] = onFocus;
|
|
224
|
+
$[54] = onKeyDown;
|
|
225
|
+
$[55] = onQueryChange;
|
|
226
|
+
$[56] = open;
|
|
227
|
+
$[57] = placeholder;
|
|
228
|
+
$[58] = query;
|
|
229
|
+
$[59] = showInput;
|
|
230
|
+
$[60] = t12;
|
|
231
|
+
} else t12 = $[60];
|
|
232
|
+
let t13;
|
|
233
|
+
if ($[61] !== props || $[62] !== t10 || $[63] !== t11 || $[64] !== t12 || $[65] !== t7 || $[66] !== t8 || $[67] !== t9 || $[68] !== testId) {
|
|
234
|
+
t13 = /*#__PURE__*/ jsxs("div", {
|
|
235
|
+
...props,
|
|
236
|
+
ref: t7,
|
|
237
|
+
"data-slot": "where-bar",
|
|
238
|
+
"data-testid": testId,
|
|
239
|
+
"data-open": t8,
|
|
240
|
+
className: t9,
|
|
241
|
+
children: [
|
|
242
|
+
t10,
|
|
243
|
+
t11,
|
|
244
|
+
t12
|
|
245
|
+
]
|
|
246
|
+
});
|
|
247
|
+
$[61] = props;
|
|
248
|
+
$[62] = t10;
|
|
249
|
+
$[63] = t11;
|
|
250
|
+
$[64] = t12;
|
|
251
|
+
$[65] = t7;
|
|
252
|
+
$[66] = t8;
|
|
253
|
+
$[67] = t9;
|
|
254
|
+
$[68] = testId;
|
|
255
|
+
$[69] = t13;
|
|
256
|
+
} else t13 = $[69];
|
|
257
|
+
return t13;
|
|
258
|
+
};
|
|
259
|
+
WhereBar.displayName = "WhereBar";
|
|
260
|
+
function _temp(s) {
|
|
261
|
+
return s.label || "";
|
|
262
|
+
}
|
|
263
|
+
export { WhereBar };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WhereBar CVA variants
|
|
3
|
+
*
|
|
4
|
+
* Chips-based point builder with inline input.
|
|
5
|
+
*/
|
|
6
|
+
export declare const whereBarVariants: (props?: ({
|
|
7
|
+
editable?: boolean | null | undefined;
|
|
8
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
|
+
/**
|
|
10
|
+
* WhereBar chip separator
|
|
11
|
+
*/
|
|
12
|
+
export declare const chipSeparatorClasses = "text-text-tertiary";
|
|
13
|
+
/**
|
|
14
|
+
* WhereBar pending label (during multi-select)
|
|
15
|
+
*/
|
|
16
|
+
export declare const pendingLabelClasses = "rounded-6 border border-dashed border-border-strong-brand bg-bg-light-brand px-8 py-2 text-sm text-text-brand";
|
|
17
|
+
/**
|
|
18
|
+
* WhereBar input field
|
|
19
|
+
*/
|
|
20
|
+
export declare const whereBarInputClasses = "h-24 min-w-160 flex-1 border-none bg-transparent p-0 text-sm text-text-primary shadow-none outline-none ring-0 placeholder:text-text-secondary";
|
|
21
|
+
/**
|
|
22
|
+
* PointSelectorError message
|
|
23
|
+
*/
|
|
24
|
+
export declare const errorMessageClasses = "mt-1 text-sm text-text-error";
|
|
25
|
+
/**
|
|
26
|
+
* MenuFooterHints container
|
|
27
|
+
*/
|
|
28
|
+
export declare const menuFooterHintsClasses = "flex flex-wrap items-center gap-12 text-xs text-text-secondary";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
const whereBarVariants = cva([
|
|
3
|
+
'flex min-h-40 w-full flex-wrap items-center gap-6 rounded-8 border px-8 py-6 shadow-xs',
|
|
4
|
+
'transition-[color,border,box-shadow]',
|
|
5
|
+
'border-border-primary'
|
|
6
|
+
], {
|
|
7
|
+
variants: {
|
|
8
|
+
editable: {
|
|
9
|
+
true: 'bg-component-input-bg',
|
|
10
|
+
false: 'bg-bg-surface-2'
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
defaultVariants: {
|
|
14
|
+
editable: true
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
const chipSeparatorClasses = 'text-text-tertiary';
|
|
18
|
+
const pendingLabelClasses = 'rounded-6 border border-dashed border-border-strong-brand bg-bg-light-brand px-8 py-2 text-sm text-text-brand';
|
|
19
|
+
const whereBarInputClasses = 'h-24 min-w-160 flex-1 border-none bg-transparent p-0 text-sm text-text-primary shadow-none outline-none ring-0 placeholder:text-text-secondary';
|
|
20
|
+
const errorMessageClasses = 'mt-1 text-sm text-text-error';
|
|
21
|
+
const menuFooterHintsClasses = 'flex flex-wrap items-center gap-12 text-xs text-text-secondary';
|
|
22
|
+
export { chipSeparatorClasses, errorMessageClasses, menuFooterHintsClasses, pendingLabelClasses, whereBarInputClasses, whereBarVariants };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type { Segment } from '@wallarm-org/rules-lib';
|
|
2
|
+
export { chipSeparatorClasses, errorMessageClasses, menuFooterHintsClasses, pendingLabelClasses, whereBarInputClasses, whereBarVariants, } from './classes.js';
|
|
3
|
+
export { KeyboardShortcutsDialog, type KeyboardShortcutsDialogProps, } from './KeyboardShortcutsDialog.js';
|
|
4
|
+
export { MatchStep } from './MatchStep.js';
|
|
5
|
+
export { MenuFooterHints, type MenuFooterHintsProps } from './MenuFooterHints.js';
|
|
6
|
+
export { PointPreview, type PointPreviewProps } from './PointPreview.js';
|
|
7
|
+
export { PointSelector } from './PointSelector.js';
|
|
8
|
+
export { PointSelectorEmptyState, type PointSelectorEmptyStateProps, } from './PointSelectorEmptyState.js';
|
|
9
|
+
export { PointSelectorError, type PointSelectorErrorProps } from './PointSelectorError.js';
|
|
10
|
+
export { PointSelectorInput, type PointSelectorInputProps } from './PointSelectorInput.js';
|
|
11
|
+
export { PointSelectorMenu, type PointSelectorMenuProps } from './PointSelectorMenu.js';
|
|
12
|
+
export { PointSelectorSkeleton } from './PointSelectorSkeleton.js';
|
|
13
|
+
export { SampleRequest, type SampleRequestProps } from './SampleRequest.js';
|
|
14
|
+
export { StepMenu } from './StepMenu.js';
|
|
15
|
+
export { sampleValueOf } from './sampleValue.js';
|
|
16
|
+
export { checkPoint, checkSegmentsDirectly, getSteps, getVersion, getVocabulary, isValuePoint, needsRecanonalization, renderSegments, type ValidationResult, validateSegments, } from './sdkBridge.js';
|
|
17
|
+
export type { ConditionType, ErrorFix, MenuFooter, MenuRow, PointSelectorProps, PointSelectorStage, PointSelectorValue, RuleContext, ValidationError, } from './types.js';
|
|
18
|
+
export { type PointSelectorModel, usePointSelector } from './usePointSelector.js';
|
|
19
|
+
export { VersionWarning, type VersionWarningProps } from './VersionWarning.js';
|
|
20
|
+
export { WhereBar, type WhereBarProps } from './WhereBar.js';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export { chipSeparatorClasses, errorMessageClasses, menuFooterHintsClasses, pendingLabelClasses, whereBarInputClasses, whereBarVariants } from "./classes.js";
|
|
2
|
+
export { KeyboardShortcutsDialog } from "./KeyboardShortcutsDialog.js";
|
|
3
|
+
export { MatchStep } from "./MatchStep.js";
|
|
4
|
+
export { MenuFooterHints } from "./MenuFooterHints.js";
|
|
5
|
+
export { PointPreview } from "./PointPreview.js";
|
|
6
|
+
export { PointSelector } from "./PointSelector.js";
|
|
7
|
+
export { PointSelectorEmptyState } from "./PointSelectorEmptyState.js";
|
|
8
|
+
export { PointSelectorError } from "./PointSelectorError.js";
|
|
9
|
+
export { PointSelectorInput } from "./PointSelectorInput.js";
|
|
10
|
+
export { PointSelectorMenu } from "./PointSelectorMenu.js";
|
|
11
|
+
export { PointSelectorSkeleton } from "./PointSelectorSkeleton.js";
|
|
12
|
+
export { SampleRequest } from "./SampleRequest.js";
|
|
13
|
+
export { StepMenu } from "./StepMenu.js";
|
|
14
|
+
export { sampleValueOf } from "./sampleValue.js";
|
|
15
|
+
export { checkPoint, checkSegmentsDirectly, getSteps, getVersion, getVocabulary, isValuePoint, needsRecanonalization, renderSegments, validateSegments } from "./sdkBridge.js";
|
|
16
|
+
export { usePointSelector } from "./usePointSelector.js";
|
|
17
|
+
export { VersionWarning } from "./VersionWarning.js";
|
|
18
|
+
export { WhereBar } from "./WhereBar.js";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ref for a portaled popup's content (menu, select): puts its positioner above
|
|
3
|
+
* the drawer that holds the rule builder. The popup layer is stacked below the
|
|
4
|
+
* drawer (50 < 70), so it opened behind it and a click on an option hit the
|
|
5
|
+
* drawer's backdrop. Set inline, so it does not depend on a stylesheet the
|
|
6
|
+
* host may not load or may serve from cache.
|
|
7
|
+
*/
|
|
8
|
+
export declare const liftLayer: (el: HTMLElement | null) => void;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { SampleValue } from '@wallarm-org/rules-lib';
|
|
2
|
+
import type { PointSelectorValue } from './types.js';
|
|
3
|
+
/** What stands at the value's place in a sample request: the value the
|
|
4
|
+
* condition looks for, read the way the condition reads it; nothing (a
|
|
5
|
+
* placeholder) until a condition is chosen. */
|
|
6
|
+
export declare const sampleValueOf: (v: PointSelectorValue) => SampleValue | undefined;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { takesValue } from "@wallarm-org/rules-lib/ui";
|
|
2
|
+
const sampleValueOf = (v)=>{
|
|
3
|
+
const text = v.value;
|
|
4
|
+
if (!v.condition || takesValue(v.condition) && '' === text) return;
|
|
5
|
+
switch(v.condition){
|
|
6
|
+
case 'equal':
|
|
7
|
+
return {
|
|
8
|
+
text
|
|
9
|
+
};
|
|
10
|
+
case 'contains':
|
|
11
|
+
return {
|
|
12
|
+
text: `…${text}…`
|
|
13
|
+
};
|
|
14
|
+
case 'startswith':
|
|
15
|
+
return {
|
|
16
|
+
text: `${text}…`
|
|
17
|
+
};
|
|
18
|
+
case 'endswith':
|
|
19
|
+
return {
|
|
20
|
+
text: `…${text}`
|
|
21
|
+
};
|
|
22
|
+
case 'nequal':
|
|
23
|
+
return {
|
|
24
|
+
text: `anything but "${text}"`,
|
|
25
|
+
placeholder: true
|
|
26
|
+
};
|
|
27
|
+
case 'regexp':
|
|
28
|
+
return {
|
|
29
|
+
text: `matches /${text}/`,
|
|
30
|
+
placeholder: true
|
|
31
|
+
};
|
|
32
|
+
case 'nregexp':
|
|
33
|
+
return {
|
|
34
|
+
text: `does not match /${text}/`,
|
|
35
|
+
placeholder: true
|
|
36
|
+
};
|
|
37
|
+
case 'exists':
|
|
38
|
+
return {
|
|
39
|
+
text: 'any value',
|
|
40
|
+
placeholder: true
|
|
41
|
+
};
|
|
42
|
+
case 'absent':
|
|
43
|
+
return {
|
|
44
|
+
text: 'not sent',
|
|
45
|
+
placeholder: true
|
|
46
|
+
};
|
|
47
|
+
default:
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
export { sampleValueOf };
|