@wallarm-org/design-system 4.8.0-rc-feat-parser.1 → 4.8.0-rc-fix-claude-code.2
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 +4 -2
- package/dist/components/BulkBar/index.d.ts +5 -0
- package/dist/components/Drawer/classes.js +1 -1
- package/dist/components/DropdownMenu/DropdownMenu.d.ts +0 -2
- package/dist/components/DropdownMenu/DropdownMenu.js +71 -84
- package/dist/components/DropdownMenu/DropdownMenuItemDescription.js +1 -1
- package/dist/components/FilterInput/hooks/useFilterInputAutocomplete/useFilterInputAutocomplete.js +1 -1
- package/dist/components/NotificationCenter/NotificationCenter.d.ts +20 -0
- package/dist/components/NotificationCenter/NotificationCenter.js +65 -0
- package/dist/components/NotificationCenter/NotificationCenterBody.d.ts +18 -0
- package/dist/components/NotificationCenter/NotificationCenterBody.js +202 -0
- package/dist/components/NotificationCenter/NotificationCenterContent.d.ts +5 -0
- package/dist/components/NotificationCenter/NotificationCenterContent.js +42 -0
- package/dist/components/NotificationCenter/NotificationCenterHeader.d.ts +20 -0
- package/dist/components/NotificationCenter/NotificationCenterHeader.js +202 -0
- package/dist/components/NotificationCenter/NotificationCenterItem.d.ts +26 -0
- package/dist/components/NotificationCenter/NotificationCenterItem.js +211 -0
- package/dist/components/NotificationCenter/NotificationCenterItemTime.d.ts +9 -0
- package/dist/components/NotificationCenter/NotificationCenterItemTime.js +148 -0
- package/dist/components/NotificationCenter/NotificationCenterItemTitle.d.ts +14 -0
- package/dist/components/NotificationCenter/NotificationCenterItemTitle.js +115 -0
- package/dist/components/NotificationCenter/NotificationCenterTabs.d.ts +10 -0
- package/dist/components/NotificationCenter/NotificationCenterTabs.js +77 -0
- package/dist/components/NotificationCenter/NotificationCenterTrigger.d.ts +13 -0
- package/dist/components/NotificationCenter/NotificationCenterTrigger.js +138 -0
- package/dist/components/NotificationCenter/index.d.ts +9 -0
- package/dist/components/NotificationCenter/index.js +9 -0
- package/dist/components/Overlay/Overlay.js +1 -1
- package/dist/components/SearchInput/SearchInput.d.ts +7 -5
- package/dist/components/SearchInput/SearchInput.js +119 -101
- 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 +1 -0
- package/dist/components/Tabs/Tabs.js +30 -28
- 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 +3 -0
- package/dist/components/Tour/TourPositioner.js +4 -4
- package/dist/guidelines/foundations/color.md +157 -0
- package/dist/guidelines/foundations/focus.md +122 -0
- package/dist/guidelines/foundations/layering.md +131 -0
- package/dist/guidelines/foundations/radius-elevation.md +111 -0
- package/dist/guidelines/foundations/spacing.md +117 -0
- package/dist/guidelines/foundations/typography.md +114 -0
- package/dist/guidelines/patterns/app-layout.md +1567 -0
- package/dist/guidelines/patterns/auth-page.md +668 -0
- package/dist/guidelines/patterns/confirmation-dialogs.md +605 -0
- package/dist/guidelines/patterns/create-edit-forms.md +768 -0
- package/dist/guidelines/patterns/detail-drawer.md +868 -0
- package/dist/guidelines/patterns/empty-states.md +461 -0
- package/dist/guidelines/patterns/entity-table.md +533 -0
- package/dist/guidelines/patterns/feedback-toasts.md +493 -0
- package/dist/guidelines/patterns/filtering.md +630 -0
- package/dist/guidelines/patterns/resource-list-page.md +558 -0
- package/dist/guidelines/patterns/settings-page.md +752 -0
- package/dist/guidelines/rules.md +25 -0
- package/dist/index.d.ts +2 -3
- package/dist/index.js +1 -2
- package/dist/metadata/components.json +12431 -9208
- package/dist/metadata/guidelines.json +1705 -0
- package/dist/theme/typography.css +5 -0
- package/dist/utils/formatDateTime.d.ts +6 -0
- package/dist/utils/formatDateTime.js +13 -1
- package/package.json +6 -4
- package/dist/components/Rules/PointSelector/KeyboardShortcutsDialog.d.ts +0 -14
- package/dist/components/Rules/PointSelector/KeyboardShortcutsDialog.js +0 -209
- package/dist/components/Rules/PointSelector/MatchStep.d.ts +0 -15
- package/dist/components/Rules/PointSelector/MatchStep.js +0 -186
- package/dist/components/Rules/PointSelector/MenuFooterHints.d.ts +0 -16
- package/dist/components/Rules/PointSelector/MenuFooterHints.js +0 -177
- package/dist/components/Rules/PointSelector/PointPreview.d.ts +0 -10
- package/dist/components/Rules/PointSelector/PointPreview.js +0 -88
- package/dist/components/Rules/PointSelector/PointSelector.d.ts +0 -17
- package/dist/components/Rules/PointSelector/PointSelector.js +0 -937
- package/dist/components/Rules/PointSelector/PointSelectorEmptyState.d.ts +0 -12
- package/dist/components/Rules/PointSelector/PointSelectorEmptyState.js +0 -173
- package/dist/components/Rules/PointSelector/PointSelectorError.d.ts +0 -31
- package/dist/components/Rules/PointSelector/PointSelectorError.js +0 -275
- package/dist/components/Rules/PointSelector/PointSelectorInput.d.ts +0 -20
- package/dist/components/Rules/PointSelector/PointSelectorInput.js +0 -130
- package/dist/components/Rules/PointSelector/PointSelectorMenu.d.ts +0 -31
- package/dist/components/Rules/PointSelector/PointSelectorMenu.js +0 -317
- package/dist/components/Rules/PointSelector/PointSelectorSkeleton.d.ts +0 -8
- package/dist/components/Rules/PointSelector/PointSelectorSkeleton.js +0 -73
- package/dist/components/Rules/PointSelector/SampleRequest.d.ts +0 -14
- package/dist/components/Rules/PointSelector/SampleRequest.js +0 -116
- package/dist/components/Rules/PointSelector/StepMenu.d.ts +0 -40
- package/dist/components/Rules/PointSelector/StepMenu.js +0 -210
- package/dist/components/Rules/PointSelector/VersionWarning.d.ts +0 -26
- package/dist/components/Rules/PointSelector/VersionWarning.js +0 -231
- package/dist/components/Rules/PointSelector/WhereBar.d.ts +0 -48
- package/dist/components/Rules/PointSelector/WhereBar.js +0 -263
- package/dist/components/Rules/PointSelector/classes.d.ts +0 -28
- package/dist/components/Rules/PointSelector/classes.js +0 -22
- package/dist/components/Rules/PointSelector/index.d.ts +0 -20
- package/dist/components/Rules/PointSelector/index.js +0 -18
- package/dist/components/Rules/PointSelector/liftLayer.d.ts +0 -8
- package/dist/components/Rules/PointSelector/liftLayer.js +0 -4
- package/dist/components/Rules/PointSelector/sampleValue.d.ts +0 -6
- package/dist/components/Rules/PointSelector/sampleValue.js +0 -51
- package/dist/components/Rules/PointSelector/sdkBridge.d.ts +0 -508
- package/dist/components/Rules/PointSelector/sdkBridge.js +0 -339
- package/dist/components/Rules/PointSelector/types.d.ts +0 -304
- package/dist/components/Rules/PointSelector/types.js +0 -0
- package/dist/components/Rules/PointSelector/usePointSelector.d.ts +0 -161
- package/dist/components/Rules/PointSelector/usePointSelector.js +0 -1088
- package/dist/components/Rules/RuleBuilder/ActionEditor/ActionEditor.d.ts +0 -28
- package/dist/components/Rules/RuleBuilder/ActionEditor/ActionEditor.js +0 -208
- package/dist/components/Rules/RuleBuilder/ActionEditor/ActionFields.d.ts +0 -23
- package/dist/components/Rules/RuleBuilder/ActionEditor/ActionFields.js +0 -950
- package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTargetPicker.d.ts +0 -21
- package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTargetPicker.js +0 -110
- package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTypeSelect.d.ts +0 -20
- package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTypeSelect.js +0 -31
- package/dist/components/Rules/RuleBuilder/ActionEditor/AttackTypeField.d.ts +0 -23
- package/dist/components/Rules/RuleBuilder/ActionEditor/AttackTypeField.js +0 -131
- package/dist/components/Rules/RuleBuilder/ActionEditor/classes.d.ts +0 -17
- package/dist/components/Rules/RuleBuilder/ActionEditor/classes.js +0 -14
- package/dist/components/Rules/RuleBuilder/ActionEditor/index.d.ts +0 -6
- package/dist/components/Rules/RuleBuilder/ActionEditor/index.js +0 -6
- package/dist/components/Rules/RuleBuilder/ConditionTree/AddConditionMenu.d.ts +0 -24
- package/dist/components/Rules/RuleBuilder/ConditionTree/AddConditionMenu.js +0 -245
- package/dist/components/Rules/RuleBuilder/ConditionTree/AttackCondition.d.ts +0 -15
- package/dist/components/Rules/RuleBuilder/ConditionTree/AttackCondition.js +0 -691
- package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionCard.d.ts +0 -19
- package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionCard.js +0 -72
- package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionTree.d.ts +0 -27
- package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionTree.js +0 -407
- package/dist/components/Rules/RuleBuilder/ConditionTree/FieldCondition.d.ts +0 -14
- package/dist/components/Rules/RuleBuilder/ConditionTree/FieldCondition.js +0 -269
- package/dist/components/Rules/RuleBuilder/ConditionTree/GroupCondition.d.ts +0 -25
- package/dist/components/Rules/RuleBuilder/ConditionTree/GroupCondition.js +0 -99
- package/dist/components/Rules/RuleBuilder/ConditionTree/SampleCondition.d.ts +0 -14
- package/dist/components/Rules/RuleBuilder/ConditionTree/SampleCondition.js +0 -118
- package/dist/components/Rules/RuleBuilder/ConditionTree/SignalCondition.d.ts +0 -14
- package/dist/components/Rules/RuleBuilder/ConditionTree/SignalCondition.js +0 -446
- package/dist/components/Rules/RuleBuilder/ConditionTree/TagCondition.d.ts +0 -14
- package/dist/components/Rules/RuleBuilder/ConditionTree/TagCondition.js +0 -266
- package/dist/components/Rules/RuleBuilder/ConditionTree/classes.d.ts +0 -35
- package/dist/components/Rules/RuleBuilder/ConditionTree/classes.js +0 -57
- package/dist/components/Rules/RuleBuilder/ConditionTree/index.d.ts +0 -15
- package/dist/components/Rules/RuleBuilder/ConditionTree/index.js +0 -10
- package/dist/components/Rules/RuleBuilder/RuleBuilder.d.ts +0 -67
- package/dist/components/Rules/RuleBuilder/RuleBuilder.js +0 -366
- package/dist/components/Rules/RuleBuilder/Summary/ActionSummary.d.ts +0 -32
- package/dist/components/Rules/RuleBuilder/Summary/ActionSummary.js +0 -420
- package/dist/components/Rules/RuleBuilder/Summary/ConditionSummary.d.ts +0 -27
- package/dist/components/Rules/RuleBuilder/Summary/ConditionSummary.js +0 -446
- package/dist/components/Rules/RuleBuilder/Summary/index.d.ts +0 -7
- package/dist/components/Rules/RuleBuilder/Summary/index.js +0 -2
- package/dist/components/Rules/RuleBuilder/classes.d.ts +0 -19
- package/dist/components/Rules/RuleBuilder/classes.js +0 -18
- package/dist/components/Rules/RuleBuilder/index.d.ts +0 -55
- package/dist/components/Rules/RuleBuilder/index.js +0 -11
- package/dist/components/Rules/RuleBuilder/models/actionModel.d.ts +0 -31
- package/dist/components/Rules/RuleBuilder/models/actionModel.js +0 -276
- package/dist/components/Rules/RuleBuilder/models/conditionModel.d.ts +0 -95
- package/dist/components/Rules/RuleBuilder/models/conditionModel.js +0 -418
- package/dist/components/Rules/RuleBuilder/models/index.d.ts +0 -3
- package/dist/components/Rules/RuleBuilder/models/index.js +0 -3
- package/dist/components/Rules/RuleBuilder/models/validation.d.ts +0 -176
- package/dist/components/Rules/RuleBuilder/models/validation.js +0 -242
- package/dist/components/Rules/RuleBuilder/shared/ChoiceSelect.d.ts +0 -27
- package/dist/components/Rules/RuleBuilder/shared/ChoiceSelect.js +0 -92
- package/dist/components/Rules/RuleBuilder/shared/index.d.ts +0 -1
- package/dist/components/Rules/RuleBuilder/shared/index.js +0 -1
- package/dist/components/Rules/RuleBuilder/types.d.ts +0 -384
- package/dist/components/Rules/RuleBuilder/types.js +0 -0
- package/dist/components/Rules/RuleBuilder/utils/constants.d.ts +0 -65
- package/dist/components/Rules/RuleBuilder/utils/constants.js +0 -356
- package/dist/components/Rules/RuleBuilder/utils/extractBindings.d.ts +0 -48
- package/dist/components/Rules/RuleBuilder/utils/extractBindings.js +0 -42
- package/dist/components/Rules/RuleBuilder/utils/helpers.d.ts +0 -92
- package/dist/components/Rules/RuleBuilder/utils/helpers.js +0 -54
- package/dist/components/Rules/RuleBuilder/utils/index.d.ts +0 -2
- package/dist/components/Rules/RuleBuilder/utils/index.js +0 -2
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ConditionCard
|
|
3
|
-
*
|
|
4
|
-
* Reusable card wrapper for individual condition nodes.
|
|
5
|
-
* Provides consistent styling and remove button.
|
|
6
|
-
*/
|
|
7
|
-
import type { FC, ReactNode, Ref } from 'react';
|
|
8
|
-
import type { VariantProps } from 'class-variance-authority';
|
|
9
|
-
import { conditionCardVariants } from './classes.js';
|
|
10
|
-
type ConditionCardVariantProps = VariantProps<typeof conditionCardVariants>;
|
|
11
|
-
export interface ConditionCardProps extends ConditionCardVariantProps {
|
|
12
|
-
ref?: Ref<HTMLDivElement>;
|
|
13
|
-
children?: ReactNode;
|
|
14
|
-
onRemove: () => void;
|
|
15
|
-
removeLabel: string;
|
|
16
|
-
className?: string;
|
|
17
|
-
}
|
|
18
|
-
export declare const ConditionCard: FC<ConditionCardProps>;
|
|
19
|
-
export {};
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { c } from "react/compiler-runtime";
|
|
3
|
-
import { Trash2 } from "../../../../icons/index.js";
|
|
4
|
-
import { cn } from "../../../../utils/cn.js";
|
|
5
|
-
import { useTestId } from "../../../../utils/testId.js";
|
|
6
|
-
import { Button } from "../../../Button/index.js";
|
|
7
|
-
import { conditionCardVariants } from "./classes.js";
|
|
8
|
-
const ConditionCard = (t0)=>{
|
|
9
|
-
const $ = c(15);
|
|
10
|
-
const { ref, variant: t1, children, onRemove, removeLabel, className } = t0;
|
|
11
|
-
const variant = void 0 === t1 ? "default" : t1;
|
|
12
|
-
const testId = useTestId("condition-card");
|
|
13
|
-
let t2;
|
|
14
|
-
if ($[0] !== className || $[1] !== variant) {
|
|
15
|
-
t2 = cn(conditionCardVariants({
|
|
16
|
-
variant
|
|
17
|
-
}), className);
|
|
18
|
-
$[0] = className;
|
|
19
|
-
$[1] = variant;
|
|
20
|
-
$[2] = t2;
|
|
21
|
-
} else t2 = $[2];
|
|
22
|
-
let t3;
|
|
23
|
-
if ($[3] !== children) {
|
|
24
|
-
t3 = /*#__PURE__*/ jsx("div", {
|
|
25
|
-
className: "flex min-w-0 grow flex-col gap-8",
|
|
26
|
-
children: children
|
|
27
|
-
});
|
|
28
|
-
$[3] = children;
|
|
29
|
-
$[4] = t3;
|
|
30
|
-
} else t3 = $[4];
|
|
31
|
-
let t4;
|
|
32
|
-
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
33
|
-
t4 = /*#__PURE__*/ jsx(Trash2, {});
|
|
34
|
-
$[5] = t4;
|
|
35
|
-
} else t4 = $[5];
|
|
36
|
-
let t5;
|
|
37
|
-
if ($[6] !== onRemove || $[7] !== removeLabel) {
|
|
38
|
-
t5 = /*#__PURE__*/ jsx(Button, {
|
|
39
|
-
variant: "ghost",
|
|
40
|
-
color: "neutral",
|
|
41
|
-
size: "small",
|
|
42
|
-
"aria-label": removeLabel,
|
|
43
|
-
onClick: onRemove,
|
|
44
|
-
children: t4
|
|
45
|
-
});
|
|
46
|
-
$[6] = onRemove;
|
|
47
|
-
$[7] = removeLabel;
|
|
48
|
-
$[8] = t5;
|
|
49
|
-
} else t5 = $[8];
|
|
50
|
-
let t6;
|
|
51
|
-
if ($[9] !== ref || $[10] !== t2 || $[11] !== t3 || $[12] !== t5 || $[13] !== testId) {
|
|
52
|
-
t6 = /*#__PURE__*/ jsxs("div", {
|
|
53
|
-
ref: ref,
|
|
54
|
-
"data-slot": "condition-card",
|
|
55
|
-
"data-testid": testId,
|
|
56
|
-
className: t2,
|
|
57
|
-
children: [
|
|
58
|
-
t3,
|
|
59
|
-
t5
|
|
60
|
-
]
|
|
61
|
-
});
|
|
62
|
-
$[9] = ref;
|
|
63
|
-
$[10] = t2;
|
|
64
|
-
$[11] = t3;
|
|
65
|
-
$[12] = t5;
|
|
66
|
-
$[13] = testId;
|
|
67
|
-
$[14] = t6;
|
|
68
|
-
} else t6 = $[14];
|
|
69
|
-
return t6;
|
|
70
|
-
};
|
|
71
|
-
ConditionCard.displayName = "ConditionCard";
|
|
72
|
-
export { ConditionCard };
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ConditionTree
|
|
3
|
-
*
|
|
4
|
-
* Main recursive renderer for condition trees.
|
|
5
|
-
* Displays operator selector, list of conditions, and add button.
|
|
6
|
-
*/
|
|
7
|
-
import type { FC, Ref } from 'react';
|
|
8
|
-
import { type TestableProps } from '../../../../utils/testId.js';
|
|
9
|
-
import type { Choice, GroupCondition as GroupConditionType } from '../types.js';
|
|
10
|
-
export interface ConditionTreeProps extends TestableProps {
|
|
11
|
-
ref?: Ref<HTMLDivElement>;
|
|
12
|
-
/** Root group condition */
|
|
13
|
-
condition: GroupConditionType;
|
|
14
|
-
/** Called when tree changes */
|
|
15
|
-
onChange: (condition: GroupConditionType) => void;
|
|
16
|
-
/** Whether this is the root node */
|
|
17
|
-
isRoot?: boolean;
|
|
18
|
-
/** Validation problems to display */
|
|
19
|
-
problems?: string[];
|
|
20
|
-
/** Show validation errors */
|
|
21
|
-
showProblems?: boolean;
|
|
22
|
-
/** Inside a 'not' group (affects what can be added) */
|
|
23
|
-
insideNone?: boolean;
|
|
24
|
-
/** Available attack types */
|
|
25
|
-
attackTypes: Choice[];
|
|
26
|
-
}
|
|
27
|
-
export declare const ConditionTree: FC<ConditionTreeProps>;
|
|
@@ -1,407 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { c as compiler_runtime_c } from "react/compiler-runtime";
|
|
3
|
-
import { useEffect } from "react";
|
|
4
|
-
import { createListCollection } from "@ark-ui/react/collection";
|
|
5
|
-
import { cn } from "../../../../utils/cn.js";
|
|
6
|
-
import { TestIdProvider, useTestId } from "../../../../utils/testId.js";
|
|
7
|
-
import { Code } from "../../../Code/index.js";
|
|
8
|
-
import { Select, SelectButton, SelectContent, SelectOption, SelectOptionIndicator, SelectOptionText, SelectPositioner } from "../../../Select/index.js";
|
|
9
|
-
import { Text } from "../../../Text/index.js";
|
|
10
|
-
import { newAttack, newField, newGroup, newSample, newSignal, newTag } from "../models/conditionModel.js";
|
|
11
|
-
import { OPERATOR_CHOICES } from "../utils/constants.js";
|
|
12
|
-
import { AddConditionMenu } from "./AddConditionMenu.js";
|
|
13
|
-
import { AttackCondition } from "./AttackCondition.js";
|
|
14
|
-
import { conditionTreeVariants } from "./classes.js";
|
|
15
|
-
import { FieldCondition } from "./FieldCondition.js";
|
|
16
|
-
import { GroupCondition, setConditionTreeComponent } from "./GroupCondition.js";
|
|
17
|
-
import { SampleCondition } from "./SampleCondition.js";
|
|
18
|
-
import { SignalCondition } from "./SignalCondition.js";
|
|
19
|
-
import { TagCondition } from "./TagCondition.js";
|
|
20
|
-
function hasSignalChecks(node) {
|
|
21
|
-
return "attack" === node.kind || "signal" === node.kind || "group" === node.kind && node.children.some(hasSignalChecks);
|
|
22
|
-
}
|
|
23
|
-
const ConditionTree = (t0)=>{
|
|
24
|
-
const $ = compiler_runtime_c(65);
|
|
25
|
-
const { ref, "data-testid": testIdProp, condition, onChange, isRoot: t1, problems: t2, showProblems: t3, insideNone: t4, attackTypes } = t0;
|
|
26
|
-
const isRoot = void 0 === t1 ? true : t1;
|
|
27
|
-
let t5;
|
|
28
|
-
if ($[0] !== t2) {
|
|
29
|
-
t5 = void 0 === t2 ? [] : t2;
|
|
30
|
-
$[0] = t2;
|
|
31
|
-
$[1] = t5;
|
|
32
|
-
} else t5 = $[1];
|
|
33
|
-
const problems = t5;
|
|
34
|
-
const showProblems = void 0 === t3 ? false : t3;
|
|
35
|
-
const insideNone = void 0 === t4 ? false : t4;
|
|
36
|
-
const testId = useTestId(isRoot ? "condition-tree" : "condition-group");
|
|
37
|
-
const finalTestId = testIdProp ?? testId;
|
|
38
|
-
let t6;
|
|
39
|
-
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
40
|
-
t6 = [];
|
|
41
|
-
$[2] = t6;
|
|
42
|
-
} else t6 = $[2];
|
|
43
|
-
useEffect(_temp, t6);
|
|
44
|
-
const noneHere = insideNone || "not" === condition.operator;
|
|
45
|
-
let t7;
|
|
46
|
-
if ($[3] !== condition.children || $[4] !== noneHere) {
|
|
47
|
-
t7 = noneHere && condition.children.some(hasSignalChecks);
|
|
48
|
-
$[3] = condition.children;
|
|
49
|
-
$[4] = noneHere;
|
|
50
|
-
$[5] = t7;
|
|
51
|
-
} else t7 = $[5];
|
|
52
|
-
const signalUnderNone = t7;
|
|
53
|
-
let t8;
|
|
54
|
-
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
55
|
-
t8 = createListCollection({
|
|
56
|
-
items: OPERATOR_CHOICES
|
|
57
|
-
});
|
|
58
|
-
$[6] = t8;
|
|
59
|
-
} else t8 = $[6];
|
|
60
|
-
const operatorCollection = t8;
|
|
61
|
-
let t9;
|
|
62
|
-
if ($[7] !== condition || $[8] !== onChange) {
|
|
63
|
-
t9 = (details)=>{
|
|
64
|
-
const operator = details.value[0] || "and";
|
|
65
|
-
onChange({
|
|
66
|
-
...condition,
|
|
67
|
-
operator: operator
|
|
68
|
-
});
|
|
69
|
-
};
|
|
70
|
-
$[7] = condition;
|
|
71
|
-
$[8] = onChange;
|
|
72
|
-
$[9] = t9;
|
|
73
|
-
} else t9 = $[9];
|
|
74
|
-
const handleOperatorChange = t9;
|
|
75
|
-
let t10;
|
|
76
|
-
if ($[10] !== condition || $[11] !== onChange) {
|
|
77
|
-
t10 = (index, next)=>{
|
|
78
|
-
onChange({
|
|
79
|
-
...condition,
|
|
80
|
-
children: next ? condition.children.map((c, i)=>i === index ? next : c) : condition.children.filter((_, i_0)=>i_0 !== index)
|
|
81
|
-
});
|
|
82
|
-
};
|
|
83
|
-
$[10] = condition;
|
|
84
|
-
$[11] = onChange;
|
|
85
|
-
$[12] = t10;
|
|
86
|
-
} else t10 = $[12];
|
|
87
|
-
const handleChildChange = t10;
|
|
88
|
-
let t11;
|
|
89
|
-
if ($[13] !== condition || $[14] !== onChange) {
|
|
90
|
-
t11 = (node)=>{
|
|
91
|
-
onChange({
|
|
92
|
-
...condition,
|
|
93
|
-
children: [
|
|
94
|
-
...condition.children,
|
|
95
|
-
node
|
|
96
|
-
]
|
|
97
|
-
});
|
|
98
|
-
};
|
|
99
|
-
$[13] = condition;
|
|
100
|
-
$[14] = onChange;
|
|
101
|
-
$[15] = t11;
|
|
102
|
-
} else t11 = $[15];
|
|
103
|
-
const handleAdd = t11;
|
|
104
|
-
let t12;
|
|
105
|
-
if ($[16] !== isRoot) {
|
|
106
|
-
t12 = cn(conditionTreeVariants({
|
|
107
|
-
variant: isRoot ? "root" : "nested"
|
|
108
|
-
}));
|
|
109
|
-
$[16] = isRoot;
|
|
110
|
-
$[17] = t12;
|
|
111
|
-
} else t12 = $[17];
|
|
112
|
-
const t13 = isRoot ? "If a request matches" : "Matches";
|
|
113
|
-
let t14;
|
|
114
|
-
if ($[18] !== t13) {
|
|
115
|
-
t14 = /*#__PURE__*/ jsx(Text, {
|
|
116
|
-
size: "sm",
|
|
117
|
-
children: t13
|
|
118
|
-
});
|
|
119
|
-
$[18] = t13;
|
|
120
|
-
$[19] = t14;
|
|
121
|
-
} else t14 = $[19];
|
|
122
|
-
let t15;
|
|
123
|
-
if ($[20] !== condition.operator) {
|
|
124
|
-
t15 = [
|
|
125
|
-
condition.operator
|
|
126
|
-
];
|
|
127
|
-
$[20] = condition.operator;
|
|
128
|
-
$[21] = t15;
|
|
129
|
-
} else t15 = $[21];
|
|
130
|
-
let t16;
|
|
131
|
-
if ($[22] === Symbol.for("react.memo_cache_sentinel")) {
|
|
132
|
-
t16 = /*#__PURE__*/ jsx(SelectButton, {
|
|
133
|
-
"aria-label": "How the conditions combine"
|
|
134
|
-
});
|
|
135
|
-
$[22] = t16;
|
|
136
|
-
} else t16 = $[22];
|
|
137
|
-
let t17;
|
|
138
|
-
if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
|
|
139
|
-
t17 = /*#__PURE__*/ jsx(SelectPositioner, {
|
|
140
|
-
children: /*#__PURE__*/ jsx(SelectContent, {
|
|
141
|
-
children: operatorCollection.items.map(_temp2)
|
|
142
|
-
})
|
|
143
|
-
});
|
|
144
|
-
$[23] = t17;
|
|
145
|
-
} else t17 = $[23];
|
|
146
|
-
let t18;
|
|
147
|
-
if ($[24] !== handleOperatorChange || $[25] !== t15) {
|
|
148
|
-
t18 = /*#__PURE__*/ jsx("div", {
|
|
149
|
-
className: "w-96",
|
|
150
|
-
children: /*#__PURE__*/ jsxs(Select, {
|
|
151
|
-
collection: operatorCollection,
|
|
152
|
-
value: t15,
|
|
153
|
-
onValueChange: handleOperatorChange,
|
|
154
|
-
children: [
|
|
155
|
-
t16,
|
|
156
|
-
t17
|
|
157
|
-
]
|
|
158
|
-
})
|
|
159
|
-
});
|
|
160
|
-
$[24] = handleOperatorChange;
|
|
161
|
-
$[25] = t15;
|
|
162
|
-
$[26] = t18;
|
|
163
|
-
} else t18 = $[26];
|
|
164
|
-
let t19;
|
|
165
|
-
if ($[27] === Symbol.for("react.memo_cache_sentinel")) {
|
|
166
|
-
t19 = /*#__PURE__*/ jsx(Text, {
|
|
167
|
-
size: "sm",
|
|
168
|
-
children: "of these conditions"
|
|
169
|
-
});
|
|
170
|
-
$[27] = t19;
|
|
171
|
-
} else t19 = $[27];
|
|
172
|
-
let t20;
|
|
173
|
-
if ($[28] !== t14 || $[29] !== t18) {
|
|
174
|
-
t20 = /*#__PURE__*/ jsxs("div", {
|
|
175
|
-
className: "flex flex-wrap items-center gap-8",
|
|
176
|
-
children: [
|
|
177
|
-
t14,
|
|
178
|
-
t18,
|
|
179
|
-
t19
|
|
180
|
-
]
|
|
181
|
-
});
|
|
182
|
-
$[28] = t14;
|
|
183
|
-
$[29] = t18;
|
|
184
|
-
$[30] = t20;
|
|
185
|
-
} else t20 = $[30];
|
|
186
|
-
let t21;
|
|
187
|
-
if ($[31] !== showProblems || $[32] !== signalUnderNone) {
|
|
188
|
-
t21 = signalUnderNone && showProblems && /*#__PURE__*/ jsx(Text, {
|
|
189
|
-
size: "sm",
|
|
190
|
-
color: "danger",
|
|
191
|
-
children: '"None of" cannot contain "an attack was detected" or "a request anomaly" — the rule could never react to them. Use "all" or "any", or remove those conditions.'
|
|
192
|
-
});
|
|
193
|
-
$[31] = showProblems;
|
|
194
|
-
$[32] = signalUnderNone;
|
|
195
|
-
$[33] = t21;
|
|
196
|
-
} else t21 = $[33];
|
|
197
|
-
let t22;
|
|
198
|
-
if ($[34] !== condition.children.length) {
|
|
199
|
-
t22 = 0 === condition.children.length && /*#__PURE__*/ jsx(Text, {
|
|
200
|
-
size: "sm",
|
|
201
|
-
color: "secondary",
|
|
202
|
-
children: "No conditions: the rule applies to every request."
|
|
203
|
-
});
|
|
204
|
-
$[34] = condition.children.length;
|
|
205
|
-
$[35] = t22;
|
|
206
|
-
} else t22 = $[35];
|
|
207
|
-
let t23;
|
|
208
|
-
if ($[36] !== attackTypes || $[37] !== condition.children || $[38] !== handleChildChange || $[39] !== noneHere) {
|
|
209
|
-
let t24;
|
|
210
|
-
if ($[41] !== attackTypes || $[42] !== handleChildChange || $[43] !== noneHere) {
|
|
211
|
-
t24 = (node_0, index_0)=>{
|
|
212
|
-
const remove = ()=>handleChildChange(index_0, null);
|
|
213
|
-
switch(node_0.kind){
|
|
214
|
-
case "field":
|
|
215
|
-
return /*#__PURE__*/ jsx(FieldCondition, {
|
|
216
|
-
condition: node_0,
|
|
217
|
-
onChange: (next_5)=>handleChildChange(index_0, next_5),
|
|
218
|
-
onRemove: remove
|
|
219
|
-
}, node_0.id);
|
|
220
|
-
case "attack":
|
|
221
|
-
return /*#__PURE__*/ jsx(AttackCondition, {
|
|
222
|
-
condition: node_0,
|
|
223
|
-
onChange: (next_4)=>handleChildChange(index_0, next_4),
|
|
224
|
-
onRemove: remove,
|
|
225
|
-
attackTypes: attackTypes
|
|
226
|
-
}, node_0.id);
|
|
227
|
-
case "signal":
|
|
228
|
-
return /*#__PURE__*/ jsx(SignalCondition, {
|
|
229
|
-
condition: node_0,
|
|
230
|
-
onChange: (next_3)=>handleChildChange(index_0, next_3),
|
|
231
|
-
onRemove: remove
|
|
232
|
-
}, node_0.id);
|
|
233
|
-
case "tag":
|
|
234
|
-
return /*#__PURE__*/ jsx(TagCondition, {
|
|
235
|
-
condition: node_0,
|
|
236
|
-
onChange: (next_2)=>handleChildChange(index_0, next_2),
|
|
237
|
-
onRemove: remove
|
|
238
|
-
}, node_0.id);
|
|
239
|
-
case "sample":
|
|
240
|
-
return /*#__PURE__*/ jsx(SampleCondition, {
|
|
241
|
-
condition: node_0,
|
|
242
|
-
onChange: (next_1)=>handleChildChange(index_0, next_1),
|
|
243
|
-
onRemove: remove
|
|
244
|
-
}, node_0.id);
|
|
245
|
-
case "group":
|
|
246
|
-
return /*#__PURE__*/ jsx(GroupCondition, {
|
|
247
|
-
condition: node_0,
|
|
248
|
-
onChange: (next_0)=>handleChildChange(index_0, next_0),
|
|
249
|
-
onRemove: remove,
|
|
250
|
-
insideNone: noneHere,
|
|
251
|
-
attackTypes: attackTypes
|
|
252
|
-
}, node_0.id);
|
|
253
|
-
case "raw":
|
|
254
|
-
return /*#__PURE__*/ jsxs("div", {
|
|
255
|
-
className: "flex flex-col gap-8 rounded-12 border border-border-primary-light p-12",
|
|
256
|
-
children: [
|
|
257
|
-
/*#__PURE__*/ jsx(Text, {
|
|
258
|
-
size: "xs",
|
|
259
|
-
color: "secondary",
|
|
260
|
-
children: "This condition cannot be edited here yet; it is kept as written."
|
|
261
|
-
}),
|
|
262
|
-
/*#__PURE__*/ jsx(Code, {
|
|
263
|
-
size: "s",
|
|
264
|
-
className: "break-all",
|
|
265
|
-
children: JSON.stringify(node_0.check)
|
|
266
|
-
})
|
|
267
|
-
]
|
|
268
|
-
}, node_0.id);
|
|
269
|
-
default:
|
|
270
|
-
return null;
|
|
271
|
-
}
|
|
272
|
-
};
|
|
273
|
-
$[41] = attackTypes;
|
|
274
|
-
$[42] = handleChildChange;
|
|
275
|
-
$[43] = noneHere;
|
|
276
|
-
$[44] = t24;
|
|
277
|
-
} else t24 = $[44];
|
|
278
|
-
t23 = condition.children.map(t24);
|
|
279
|
-
$[36] = attackTypes;
|
|
280
|
-
$[37] = condition.children;
|
|
281
|
-
$[38] = handleChildChange;
|
|
282
|
-
$[39] = noneHere;
|
|
283
|
-
$[40] = t23;
|
|
284
|
-
} else t23 = $[40];
|
|
285
|
-
let t24;
|
|
286
|
-
if ($[45] === Symbol.for("react.memo_cache_sentinel")) {
|
|
287
|
-
t24 = {
|
|
288
|
-
field: _temp3,
|
|
289
|
-
attack: _temp4,
|
|
290
|
-
signal: _temp5,
|
|
291
|
-
tag: _temp6,
|
|
292
|
-
sample: _temp7,
|
|
293
|
-
group: _temp8
|
|
294
|
-
};
|
|
295
|
-
$[45] = t24;
|
|
296
|
-
} else t24 = $[45];
|
|
297
|
-
let t25;
|
|
298
|
-
if ($[46] !== handleAdd || $[47] !== noneHere) {
|
|
299
|
-
t25 = /*#__PURE__*/ jsx(AddConditionMenu, {
|
|
300
|
-
onAdd: handleAdd,
|
|
301
|
-
insideNone: noneHere,
|
|
302
|
-
factories: t24
|
|
303
|
-
});
|
|
304
|
-
$[46] = handleAdd;
|
|
305
|
-
$[47] = noneHere;
|
|
306
|
-
$[48] = t25;
|
|
307
|
-
} else t25 = $[48];
|
|
308
|
-
let t26;
|
|
309
|
-
if ($[49] !== problems || $[50] !== showProblems) {
|
|
310
|
-
t26 = showProblems && problems.length > 0 && /*#__PURE__*/ jsx("div", {
|
|
311
|
-
className: "flex flex-col gap-4",
|
|
312
|
-
children: problems.map(_temp9)
|
|
313
|
-
});
|
|
314
|
-
$[49] = problems;
|
|
315
|
-
$[50] = showProblems;
|
|
316
|
-
$[51] = t26;
|
|
317
|
-
} else t26 = $[51];
|
|
318
|
-
let t27;
|
|
319
|
-
if ($[52] !== finalTestId || $[53] !== ref || $[54] !== t12 || $[55] !== t20 || $[56] !== t21 || $[57] !== t22 || $[58] !== t23 || $[59] !== t25 || $[60] !== t26) {
|
|
320
|
-
t27 = /*#__PURE__*/ jsxs("div", {
|
|
321
|
-
ref: ref,
|
|
322
|
-
"data-slot": "condition-tree",
|
|
323
|
-
"data-testid": finalTestId,
|
|
324
|
-
className: t12,
|
|
325
|
-
children: [
|
|
326
|
-
t20,
|
|
327
|
-
t21,
|
|
328
|
-
t22,
|
|
329
|
-
t23,
|
|
330
|
-
t25,
|
|
331
|
-
t26
|
|
332
|
-
]
|
|
333
|
-
});
|
|
334
|
-
$[52] = finalTestId;
|
|
335
|
-
$[53] = ref;
|
|
336
|
-
$[54] = t12;
|
|
337
|
-
$[55] = t20;
|
|
338
|
-
$[56] = t21;
|
|
339
|
-
$[57] = t22;
|
|
340
|
-
$[58] = t23;
|
|
341
|
-
$[59] = t25;
|
|
342
|
-
$[60] = t26;
|
|
343
|
-
$[61] = t27;
|
|
344
|
-
} else t27 = $[61];
|
|
345
|
-
let t28;
|
|
346
|
-
if ($[62] !== finalTestId || $[63] !== t27) {
|
|
347
|
-
t28 = /*#__PURE__*/ jsx(TestIdProvider, {
|
|
348
|
-
value: finalTestId,
|
|
349
|
-
children: t27
|
|
350
|
-
});
|
|
351
|
-
$[62] = finalTestId;
|
|
352
|
-
$[63] = t27;
|
|
353
|
-
$[64] = t28;
|
|
354
|
-
} else t28 = $[64];
|
|
355
|
-
return t28;
|
|
356
|
-
};
|
|
357
|
-
ConditionTree.displayName = "ConditionTree";
|
|
358
|
-
function _temp() {
|
|
359
|
-
setConditionTreeComponent(ConditionTree);
|
|
360
|
-
}
|
|
361
|
-
function _temp2(choice) {
|
|
362
|
-
return /*#__PURE__*/ jsxs(SelectOption, {
|
|
363
|
-
item: choice,
|
|
364
|
-
children: [
|
|
365
|
-
/*#__PURE__*/ jsxs("div", {
|
|
366
|
-
className: "flex flex-col",
|
|
367
|
-
children: [
|
|
368
|
-
/*#__PURE__*/ jsx(SelectOptionText, {
|
|
369
|
-
children: choice.label
|
|
370
|
-
}),
|
|
371
|
-
choice.description && /*#__PURE__*/ jsx(Text, {
|
|
372
|
-
size: "xs",
|
|
373
|
-
color: "secondary",
|
|
374
|
-
children: choice.description
|
|
375
|
-
})
|
|
376
|
-
]
|
|
377
|
-
}),
|
|
378
|
-
/*#__PURE__*/ jsx(SelectOptionIndicator, {})
|
|
379
|
-
]
|
|
380
|
-
}, choice.value);
|
|
381
|
-
}
|
|
382
|
-
function _temp3() {
|
|
383
|
-
return newField();
|
|
384
|
-
}
|
|
385
|
-
function _temp4() {
|
|
386
|
-
return newAttack();
|
|
387
|
-
}
|
|
388
|
-
function _temp5() {
|
|
389
|
-
return newSignal();
|
|
390
|
-
}
|
|
391
|
-
function _temp6() {
|
|
392
|
-
return newTag();
|
|
393
|
-
}
|
|
394
|
-
function _temp7() {
|
|
395
|
-
return newSample();
|
|
396
|
-
}
|
|
397
|
-
function _temp8() {
|
|
398
|
-
return newGroup("or");
|
|
399
|
-
}
|
|
400
|
-
function _temp9(problem, i_1) {
|
|
401
|
-
return /*#__PURE__*/ jsx(Text, {
|
|
402
|
-
size: "sm",
|
|
403
|
-
color: "danger",
|
|
404
|
-
children: problem
|
|
405
|
-
}, i_1);
|
|
406
|
-
}
|
|
407
|
-
export { ConditionTree };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* FieldCondition
|
|
3
|
-
*
|
|
4
|
-
* Condition on a value in the request or response.
|
|
5
|
-
* Integrates PointSelector for point selection and condition definition.
|
|
6
|
-
*/
|
|
7
|
-
import type { FC } from 'react';
|
|
8
|
-
import type { FieldCondition as FieldConditionType } from '../types.js';
|
|
9
|
-
export interface FieldConditionProps {
|
|
10
|
-
condition: FieldConditionType;
|
|
11
|
-
onChange: (condition: FieldConditionType) => void;
|
|
12
|
-
onRemove: () => void;
|
|
13
|
-
}
|
|
14
|
-
export declare const FieldCondition: FC<FieldConditionProps>;
|