@baishuyun/ai-design 1.0.7 → 1.0.9
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/.turbo/turbo-build.log +17 -7
- package/CHANGELOG.md +16 -0
- package/dist/ai-design.css +0 -14
- package/dist/ai-design.js +6627 -6463
- package/dist/ai-design.js.map +1 -1
- package/dist/ai-design.umd.cjs +69 -69
- package/dist/ai-design.umd.cjs.map +1 -1
- package/dist/src/components/agent-helper/app-select/index.d.ts +4 -1
- package/dist/src/components/agent-helper/app-select/index.d.ts.map +1 -1
- package/dist/src/components/agent-helper/condition-input/index.d.ts +14 -0
- package/dist/src/components/agent-helper/condition-input/index.d.ts.map +1 -1
- package/dist/src/components/agent-helper/exec-log-filter/index.d.ts +2 -2
- package/dist/src/components/agent-helper/exec-log-filter/index.d.ts.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/stories/BsConditionInput.stories.d.ts +13 -0
- package/dist/src/stories/BsConditionInput.stories.d.ts.map +1 -0
- package/dist/src/stories/ExecLogFilter.stories.d.ts.map +1 -1
- package/package.json +7 -7
- package/scripts/strip-layers.cjs +41 -0
- package/src/components/agent-helper/app-select/index.tsx +32 -1
- package/src/components/agent-helper/condition-input/index.tsx +88 -0
- package/src/components/agent-helper/exec-log-filter/index.tsx +58 -27
- package/src/index.ts +1 -1
- package/src/stories/BsConditionInput.stories.tsx +460 -0
- package/src/stories/ExecLogFilter.stories.tsx +2 -4
- package/style.css +0 -14
|
@@ -9,6 +9,7 @@ export interface AppTreeNode {
|
|
|
9
9
|
data?: IAppGroupItem;
|
|
10
10
|
}
|
|
11
11
|
export declare function groupsToAppTreeNodes(groups: IAppGroup[]): AppTreeNode[];
|
|
12
|
+
export declare const ALL_APPS_VALUE = "__all__";
|
|
12
13
|
export interface AppSelectProps {
|
|
13
14
|
/** Tree nodes to display. Use groupsToAppTreeNodes() to convert IAppGroup[] */
|
|
14
15
|
nodes: AppTreeNode[];
|
|
@@ -30,7 +31,9 @@ export interface AppSelectProps {
|
|
|
30
31
|
maxVisibleChips?: number;
|
|
31
32
|
/** Additional className */
|
|
32
33
|
className?: string;
|
|
34
|
+
/** Show a "全部应用" (All Apps) item at the top. Only effective in single mode. */
|
|
35
|
+
showAll?: boolean;
|
|
33
36
|
popoverContentOnly?: boolean;
|
|
34
37
|
}
|
|
35
|
-
export declare const AppSelect: ({ nodes, mode, popoverContentOnly, value: controlledValue, defaultValue, onChange, placeholder, searchPlaceholder, disabled, maxVisibleChips, className, }: AppSelectProps) => import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
export declare const AppSelect: ({ nodes, mode, popoverContentOnly, showAll, value: controlledValue, defaultValue, onChange, placeholder, searchPlaceholder, disabled, maxVisibleChips, className, }: AppSelectProps) => import("react/jsx-runtime").JSX.Element;
|
|
36
39
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/agent-helper/app-select/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAMjE,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAC;IACzB,6CAA6C;IAC7C,IAAI,CAAC,EAAE,aAAa,CAAC;CACtB;AAID,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,WAAW,EAAE,CAavE;AAyED,MAAM,WAAW,cAAc;IAC7B,+EAA+E;IAC/E,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,qBAAqB;IACrB,IAAI,CAAC,EAAE,QAAQ,G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BAAqB;IACrB,IAAI,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;IAC7B,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC1B,iCAAiC;IACjC,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACjC,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,IAAI,CAAC;IAC9C,oCAAoC;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yBAAyB;IACzB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,4DAA4D;IAC5D,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+EAA+E;IAC/E,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAmBD,eAAO,MAAM,SAAS,GAAI,qKAavB,cAAc,4CA8WhB,CAAC"}
|
|
@@ -13,4 +13,18 @@ export declare const ConditionInput: {
|
|
|
13
13
|
({ targetName, fields, value: controlledValue, defaultValue, onChange, service, disabled, className, }: ConditionInputProps): import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
displayName: string;
|
|
15
15
|
};
|
|
16
|
+
export interface BsConditionInputProps {
|
|
17
|
+
targetName: string;
|
|
18
|
+
fields: IField[];
|
|
19
|
+
value?: string;
|
|
20
|
+
defaultValue?: string;
|
|
21
|
+
onChange?: (condition: string) => void;
|
|
22
|
+
service?: IFieldValueService;
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
className?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare const BsConditionInput: {
|
|
27
|
+
({ targetName, fields, value: controlledValue, defaultValue, onChange, service, disabled, className, }: BsConditionInputProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
displayName: string;
|
|
29
|
+
};
|
|
16
30
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/agent-helper/condition-input/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAA8B,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/agent-helper/condition-input/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAA8B,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAwB3G,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,YAAY,CAAC,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,EAAE,CAAC,SAAS,EAAE,UAAU,KAAK,IAAI,CAAC;IAC3C,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,cAAc;4GASxB,mBAAmB;;CA0FrB,CAAC;AAiCF,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,gBAAgB;4GAS1B,qBAAqB;;CA+BvB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { triggerType } from '@baishuyun/types';
|
|
2
|
-
import { DateRange } from 'react-day-picker';
|
|
3
2
|
export interface ExecLogFilterValue {
|
|
4
|
-
|
|
3
|
+
startDate?: Date;
|
|
4
|
+
endDate?: Date;
|
|
5
5
|
execUserId?: string;
|
|
6
6
|
triggerType?: triggerType;
|
|
7
7
|
execResult?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/agent-helper/exec-log-filter/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/agent-helper/exec-log-filter/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAqBpD,MAAM,WAAW,kBAAkB;IACjC,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAC3B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC/C,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC/C,eAAe,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC1D,iBAAiB,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,eAAoB,EACpB,iBAAsB,EACtB,SAAS,GACV,EAAE,kBAAkB,2CAyLpB"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -52,7 +52,7 @@ export { TriggerSelect, TriggerConfigList } from './components/agent-helper/trig
|
|
|
52
52
|
export { SearchInput, type SearchInputProps } from './components/agent-helper/search-input';
|
|
53
53
|
export type { ITriggerSelectProps, TriggerCardConfig, } from './components/agent-helper/trigger-select';
|
|
54
54
|
export { FormSelect } from './components/agent-helper/form-select';
|
|
55
|
-
export { AppSelect, groupsToAppTreeNodes } from './components/agent-helper/app-select';
|
|
55
|
+
export { AppSelect, groupsToAppTreeNodes, ALL_APPS_VALUE } from './components/agent-helper/app-select';
|
|
56
56
|
export type { AppSelectProps } from './components/agent-helper/app-select';
|
|
57
57
|
export type { FormSelectProps, FormSelectItem, FormSelectChangeResult, } from './components/agent-helper/form-select';
|
|
58
58
|
export { FormActionTriggerSelect } from './components/agent-helper/form-action-trigger-select';
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,mBAAmB,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAG5F,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAG/C,OAAO,EACL,QAAQ,EACR,SAAS,EACT,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,YAAY,CAAC;AAGpB,YAAY,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAGlE,OAAO,EAAE,YA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AAgB,EAAE,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAE,qBAAqB,EAAE,MAAM,oDAAoD,CAAC;AAC3F,YAAY,EAAE,2BAA2B,EAAE,MAAM,oDAAoD,CAAC;AACtG,cAAc,2CAA2C,CAAC;AAC1D,cAAc,wDAAwD,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAC5D,cAAc,iCAAiC,CAAC;AAChD,YAAY,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAC;AAC9E,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;AACzG,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,YAAY,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAC1E,YAAY,EACV,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,2CAA2C,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { BsConditionInput } from '../components/agent-helper/condition-input';
|
|
3
|
+
declare const meta: Meta<typeof BsConditionInput>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Empty: Story;
|
|
7
|
+
export declare const WithConditions: Story;
|
|
8
|
+
export declare const WithDeleteAll: Story;
|
|
9
|
+
export declare const Controlled: Story;
|
|
10
|
+
export declare const RangeOperators: Story;
|
|
11
|
+
export declare const MixedOperators: Story;
|
|
12
|
+
export declare const Disabled: Story;
|
|
13
|
+
//# sourceMappingURL=BsConditionInput.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BsConditionInput.stories.d.ts","sourceRoot":"","sources":["../../../src/stories/BsConditionInput.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAmO9E,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,gBAAgB,CAmBvC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,KAAK,EAAE,KAKnB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAuB5B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAmC3B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAyCxB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAwB5B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAoC5B,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KA8BtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExecLogFilter.stories.d.ts","sourceRoot":"","sources":["../../../src/stories/ExecLogFilter.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,4CAA4C,CAAC;AAiB3E,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,aAAa,CAgBpC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,eAAO,MAAM,gBAAgB,EAAE,
|
|
1
|
+
{"version":3,"file":"ExecLogFilter.stories.d.ts","sourceRoot":"","sources":["../../../src/stories/ExecLogFilter.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,4CAA4C,CAAC;AAiB3E,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,aAAa,CAgBpC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,eAAO,MAAM,gBAAgB,EAAE,KAS9B,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,KAiBhC,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAK1B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KA0BzB,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,KA2BhC,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAQ7B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@baishuyun/ai-design",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"description": "AI 功能 UI 组件库 - 所有 AI 功能的 UI 表现唯一真相来源",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -62,9 +62,9 @@
|
|
|
62
62
|
"tw-animate-css": "^1.4.0",
|
|
63
63
|
"vaul": "^1.1.2",
|
|
64
64
|
"zod": "^4.1.13",
|
|
65
|
-
"@baishuyun/
|
|
66
|
-
"@baishuyun/
|
|
67
|
-
"@baishuyun/
|
|
65
|
+
"@baishuyun/agents": "1.0.2",
|
|
66
|
+
"@baishuyun/ai-feat-utils": "1.0.3",
|
|
67
|
+
"@baishuyun/types": "2.0.4"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@storybook/addon-docs": "^10.1.11",
|
|
@@ -81,15 +81,15 @@
|
|
|
81
81
|
"typescript": "^5.5.0",
|
|
82
82
|
"vite": "^5.1.4",
|
|
83
83
|
"vite-plugin-dts": "^4.5.4",
|
|
84
|
+
"@baishuyun/types": "2.0.4",
|
|
84
85
|
"@baishuyun/tailwind-config": "2.0.3",
|
|
85
|
-
"@baishuyun/typescript-config": "1.0.3"
|
|
86
|
-
"@baishuyun/types": "2.0.3"
|
|
86
|
+
"@baishuyun/typescript-config": "1.0.3"
|
|
87
87
|
},
|
|
88
88
|
"keywords": [],
|
|
89
89
|
"author": "",
|
|
90
90
|
"license": "ISC",
|
|
91
91
|
"scripts": {
|
|
92
|
-
"build": "vite build && tailwindcss -i src/style.css -o dist/tailwind.css && cat dist/tailwind.css dist/index.css > dist/ai-design.css && cp dist/ai-design.css style.css && rm dist/tailwind.css dist/index.css",
|
|
92
|
+
"build": "vite build && tailwindcss -i src/style.css -o dist/tailwind.css && cat dist/tailwind.css dist/index.css > dist/ai-design.css && node scripts/strip-layers.cjs && cp dist/ai-design.css style.css && rm dist/tailwind.css dist/index.css",
|
|
93
93
|
"dev": "vite build --watch",
|
|
94
94
|
"storybook": "storybook dev -p 6007",
|
|
95
95
|
"build-storybook": "storybook build"
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
|
|
3
|
+
const css = fs.readFileSync('dist/ai-design.css', 'utf-8');
|
|
4
|
+
|
|
5
|
+
let result = [];
|
|
6
|
+
let inLayer = false;
|
|
7
|
+
let depth = 0;
|
|
8
|
+
|
|
9
|
+
for (const line of css.split('\n')) {
|
|
10
|
+
const trimmed = line.trim();
|
|
11
|
+
|
|
12
|
+
// Skip single-line @layer declarations: @layer properties;
|
|
13
|
+
if (/^@layer\s+[^{;]+;/.test(trimmed)) {
|
|
14
|
+
continue;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// Skip @layer block opening: @layer theme {
|
|
18
|
+
const m = trimmed.match(/^@layer\s+(\w+)\s*\{/);
|
|
19
|
+
if (m) {
|
|
20
|
+
inLayer = true;
|
|
21
|
+
depth = 1;
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (inLayer) {
|
|
26
|
+
for (const ch of line) {
|
|
27
|
+
if (ch === '{') depth++;
|
|
28
|
+
if (ch === '}') depth--;
|
|
29
|
+
}
|
|
30
|
+
if (depth <= 0) {
|
|
31
|
+
inLayer = false;
|
|
32
|
+
continue; // skip the closing }
|
|
33
|
+
}
|
|
34
|
+
result.push(line);
|
|
35
|
+
} else {
|
|
36
|
+
result.push(line);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
fs.writeFileSync('dist/ai-design.css', result.join('\n'));
|
|
41
|
+
console.log('Stripped @layer directives. Output lines:', result.length);
|
|
@@ -107,6 +107,8 @@ const DropdownChevron = ({ open }: { open: boolean }) => (
|
|
|
107
107
|
|
|
108
108
|
// ── Types ─────────────────────────────────────────────────────────
|
|
109
109
|
|
|
110
|
+
export const ALL_APPS_VALUE = '__all__';
|
|
111
|
+
|
|
110
112
|
export interface AppSelectProps {
|
|
111
113
|
/** Tree nodes to display. Use groupsToAppTreeNodes() to convert IAppGroup[] */
|
|
112
114
|
nodes: AppTreeNode[];
|
|
@@ -128,6 +130,8 @@ export interface AppSelectProps {
|
|
|
128
130
|
maxVisibleChips?: number;
|
|
129
131
|
/** Additional className */
|
|
130
132
|
className?: string;
|
|
133
|
+
/** Show a "全部应用" (All Apps) item at the top. Only effective in single mode. */
|
|
134
|
+
showAll?: boolean;
|
|
131
135
|
popoverContentOnly?: boolean; // for testing: render only the popover content without the trigger
|
|
132
136
|
}
|
|
133
137
|
|
|
@@ -152,6 +156,7 @@ export const AppSelect = ({
|
|
|
152
156
|
nodes,
|
|
153
157
|
mode = 'single',
|
|
154
158
|
popoverContentOnly,
|
|
159
|
+
showAll = false,
|
|
155
160
|
value: controlledValue,
|
|
156
161
|
defaultValue,
|
|
157
162
|
onChange,
|
|
@@ -206,7 +211,12 @@ export const AppSelect = ({
|
|
|
206
211
|
return ids.map((id) => nodeMap.get(id)?.label ?? id);
|
|
207
212
|
}, [resolvedValue, nodeMap]);
|
|
208
213
|
|
|
209
|
-
const selectedAppLabel =
|
|
214
|
+
const selectedAppLabel =
|
|
215
|
+
mode === 'single' && selectedLabels.length === 1
|
|
216
|
+
? selectedLabels[0] === ALL_APPS_VALUE
|
|
217
|
+
? '全部应用'
|
|
218
|
+
: selectedLabels[0]
|
|
219
|
+
: null;
|
|
210
220
|
|
|
211
221
|
// ── Tree filter by search ──────────────────────────────────────
|
|
212
222
|
|
|
@@ -400,6 +410,27 @@ export const AppSelect = ({
|
|
|
400
410
|
/>
|
|
401
411
|
</div>
|
|
402
412
|
|
|
413
|
+
{/* "全部应用" item */}
|
|
414
|
+
{showAll && mode === 'single' && !searchQuery.trim() && (
|
|
415
|
+
<button
|
|
416
|
+
type="button"
|
|
417
|
+
onClick={() => {
|
|
418
|
+
updateValue(ALL_APPS_VALUE);
|
|
419
|
+
setOpen(false);
|
|
420
|
+
}}
|
|
421
|
+
className={cn(
|
|
422
|
+
'flex items-center w-full h-[34px] rounded-[4px] text-left',
|
|
423
|
+
'px-[10px]',
|
|
424
|
+
transCls,
|
|
425
|
+
selectedIds.has(ALL_APPS_VALUE)
|
|
426
|
+
? 'bg-[#F0F6FF] text-[#0265FF]'
|
|
427
|
+
: 'text-[#030303] hover:bg-[#EFF0F6]'
|
|
428
|
+
)}
|
|
429
|
+
>
|
|
430
|
+
<span className="text-[14px] leading-[normal]">全部应用</span>
|
|
431
|
+
</button>
|
|
432
|
+
)}
|
|
433
|
+
|
|
403
434
|
{/* Tree */}
|
|
404
435
|
<div className="max-h-[400px] overflow-y-auto">
|
|
405
436
|
{filteredNodes.length > 0 ? (
|
|
@@ -5,6 +5,10 @@ import { transCls } from '../../../const/ui';
|
|
|
5
5
|
import { ConditonTriggerDescription } from '../condition-trigger-description';
|
|
6
6
|
import { ConditionGroup } from '../condition-group';
|
|
7
7
|
import { AddIcon } from '../../bs-icons';
|
|
8
|
+
import {
|
|
9
|
+
conditionStringify2bsCondition,
|
|
10
|
+
bsConditionParse2Condition,
|
|
11
|
+
} from '@baishuyun/ai-feat-utils';
|
|
8
12
|
|
|
9
13
|
function generateId(): string {
|
|
10
14
|
return `cond-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
|
|
@@ -132,3 +136,87 @@ export const ConditionInput = ({
|
|
|
132
136
|
};
|
|
133
137
|
|
|
134
138
|
ConditionInput.displayName = 'ConditionInput';
|
|
139
|
+
|
|
140
|
+
// ── BsConditionInput (IBsCondition string ↔ ICondition adapter) ──────────────
|
|
141
|
+
|
|
142
|
+
function parseBsCondition(
|
|
143
|
+
str: string | undefined,
|
|
144
|
+
targetName: string,
|
|
145
|
+
): ICondition {
|
|
146
|
+
if (str) {
|
|
147
|
+
try {
|
|
148
|
+
const parsed = bsConditionParse2Condition(str);
|
|
149
|
+
return { ...parsed, targetName };
|
|
150
|
+
} catch {
|
|
151
|
+
// invalid JSON, fall through to default
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return {
|
|
155
|
+
targetName,
|
|
156
|
+
quantifier: 'all',
|
|
157
|
+
items: [],
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
function defaultBsConditionString(targetName: string): string {
|
|
162
|
+
return conditionStringify2bsCondition({
|
|
163
|
+
targetName,
|
|
164
|
+
quantifier: 'all',
|
|
165
|
+
items: [],
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export interface BsConditionInputProps {
|
|
170
|
+
targetName: string;
|
|
171
|
+
fields: IField[];
|
|
172
|
+
value?: string;
|
|
173
|
+
defaultValue?: string;
|
|
174
|
+
onChange?: (condition: string) => void;
|
|
175
|
+
service?: IFieldValueService;
|
|
176
|
+
disabled?: boolean;
|
|
177
|
+
className?: string;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export const BsConditionInput = ({
|
|
181
|
+
targetName,
|
|
182
|
+
fields,
|
|
183
|
+
value: controlledValue,
|
|
184
|
+
defaultValue,
|
|
185
|
+
onChange,
|
|
186
|
+
service,
|
|
187
|
+
disabled = false,
|
|
188
|
+
className,
|
|
189
|
+
}: BsConditionInputProps) => {
|
|
190
|
+
const defaultBS = useRef<string>(
|
|
191
|
+
defaultValue ?? defaultBsConditionString(targetName),
|
|
192
|
+
).current;
|
|
193
|
+
|
|
194
|
+
const [internalValue, setInternalValue] = useState<string>(defaultBS);
|
|
195
|
+
const isControlled = controlledValue !== undefined;
|
|
196
|
+
const currentBS = isControlled ? controlledValue : internalValue;
|
|
197
|
+
|
|
198
|
+
const currentCondition = parseBsCondition(currentBS, targetName);
|
|
199
|
+
|
|
200
|
+
const handleChange = useCallback(
|
|
201
|
+
(cond: ICondition) => {
|
|
202
|
+
const bsStr = conditionStringify2bsCondition({ ...cond, targetName });
|
|
203
|
+
if (!isControlled) setInternalValue(bsStr);
|
|
204
|
+
onChange?.(bsStr);
|
|
205
|
+
},
|
|
206
|
+
[isControlled, onChange, targetName],
|
|
207
|
+
);
|
|
208
|
+
|
|
209
|
+
return (
|
|
210
|
+
<ConditionInput
|
|
211
|
+
targetName={targetName}
|
|
212
|
+
fields={fields}
|
|
213
|
+
value={currentCondition}
|
|
214
|
+
onChange={handleChange}
|
|
215
|
+
service={service}
|
|
216
|
+
disabled={disabled}
|
|
217
|
+
className={className}
|
|
218
|
+
/>
|
|
219
|
+
);
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
BsConditionInput.displayName = 'BsConditionInput';
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { useState, useCallback } from 'react';
|
|
2
2
|
import type { triggerType } from '@baishuyun/types';
|
|
3
|
-
import type { DateRange } from 'react-day-picker';
|
|
4
3
|
import { cn } from '../../../lib/utils';
|
|
5
|
-
import {
|
|
4
|
+
import { DateInput } from '../date-picker';
|
|
6
5
|
import {
|
|
7
6
|
Select,
|
|
8
7
|
SelectTrigger,
|
|
@@ -11,6 +10,8 @@ import {
|
|
|
11
10
|
SelectItem,
|
|
12
11
|
} from '../../ui/select';
|
|
13
12
|
|
|
13
|
+
import { usePortalContainer } from '../../../hooks/use-portal-container';
|
|
14
|
+
|
|
14
15
|
const TRIGGER_TYPE_OPTIONS: Array<{ value: triggerType; label: string }> = [
|
|
15
16
|
{ value: 'universal', label: '通用型' },
|
|
16
17
|
{ value: 'form_field', label: '表单字段触发' },
|
|
@@ -20,7 +21,8 @@ const TRIGGER_TYPE_OPTIONS: Array<{ value: triggerType; label: string }> = [
|
|
|
20
21
|
];
|
|
21
22
|
|
|
22
23
|
export interface ExecLogFilterValue {
|
|
23
|
-
|
|
24
|
+
startDate?: Date;
|
|
25
|
+
endDate?: Date;
|
|
24
26
|
execUserId?: string;
|
|
25
27
|
triggerType?: triggerType;
|
|
26
28
|
execResult?: string;
|
|
@@ -43,8 +45,11 @@ export function ExecLogFilter({
|
|
|
43
45
|
execResultOptions = [],
|
|
44
46
|
className,
|
|
45
47
|
}: ExecLogFilterProps) {
|
|
46
|
-
const [
|
|
47
|
-
value?.
|
|
48
|
+
const [startDate, setStartDate] = useState<Date | undefined>(
|
|
49
|
+
value?.startDate
|
|
50
|
+
);
|
|
51
|
+
const [endDate, setEndDate] = useState<Date | undefined>(
|
|
52
|
+
value?.endDate
|
|
48
53
|
);
|
|
49
54
|
const [execUserId, setExecUserId] = useState<string>(
|
|
50
55
|
value?.execUserId ?? 'all'
|
|
@@ -56,46 +61,57 @@ export function ExecLogFilter({
|
|
|
56
61
|
value?.execResult ?? 'all'
|
|
57
62
|
);
|
|
58
63
|
|
|
59
|
-
const
|
|
60
|
-
(
|
|
61
|
-
|
|
62
|
-
|
|
64
|
+
const handleStartDateChange = useCallback(
|
|
65
|
+
(date: Date | null) => {
|
|
66
|
+
const d = date ?? undefined;
|
|
67
|
+
setStartDate(d);
|
|
68
|
+
onChange?.({ startDate: d, endDate, execUserId, triggerType: triggerType === 'all' ? undefined : triggerType, execResult: execResult === 'all' ? undefined : execResult });
|
|
69
|
+
},
|
|
70
|
+
[onChange, execUserId, triggerType, execResult, endDate]
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
const handleEndDateChange = useCallback(
|
|
74
|
+
(date: Date | null) => {
|
|
75
|
+
const d = date ?? undefined;
|
|
76
|
+
setEndDate(d);
|
|
77
|
+
onChange?.({ startDate, endDate: d, execUserId, triggerType: triggerType === 'all' ? undefined : triggerType, execResult: execResult === 'all' ? undefined : execResult });
|
|
63
78
|
},
|
|
64
|
-
[onChange, execUserId, triggerType, execResult]
|
|
79
|
+
[onChange, execUserId, triggerType, execResult, startDate]
|
|
65
80
|
);
|
|
66
81
|
|
|
67
82
|
const handleExecUserIdChange = useCallback(
|
|
68
83
|
(v: string) => {
|
|
69
84
|
setExecUserId(v);
|
|
70
|
-
onChange?.({
|
|
85
|
+
onChange?.({ startDate, endDate, execUserId: v, triggerType: triggerType === 'all' ? undefined : triggerType, execResult: execResult === 'all' ? undefined : execResult });
|
|
71
86
|
},
|
|
72
|
-
[onChange,
|
|
87
|
+
[onChange, startDate, endDate, triggerType, execResult]
|
|
73
88
|
);
|
|
74
89
|
|
|
75
90
|
const handleTriggerTypeChange = useCallback(
|
|
76
91
|
(v: triggerType | 'all') => {
|
|
77
92
|
setTriggerType(v);
|
|
78
|
-
onChange?.({
|
|
93
|
+
onChange?.({ startDate, endDate, execUserId, triggerType: v === 'all' ? undefined : v, execResult: execResult === 'all' ? undefined : execResult });
|
|
79
94
|
},
|
|
80
|
-
[onChange,
|
|
95
|
+
[onChange, startDate, endDate, execUserId, execResult]
|
|
81
96
|
);
|
|
82
97
|
|
|
83
98
|
const handleExecResultChange = useCallback(
|
|
84
99
|
(v: string) => {
|
|
85
100
|
setExecResult(v);
|
|
86
|
-
onChange?.({
|
|
101
|
+
onChange?.({ startDate, endDate, execUserId, triggerType: triggerType === 'all' ? undefined : triggerType, execResult: v === 'all' ? undefined : v });
|
|
87
102
|
},
|
|
88
|
-
[onChange,
|
|
103
|
+
[onChange, startDate, endDate, execUserId, triggerType]
|
|
89
104
|
);
|
|
90
105
|
|
|
91
106
|
const handleFilter = useCallback(() => {
|
|
92
107
|
onFilter?.({
|
|
93
|
-
|
|
108
|
+
startDate,
|
|
109
|
+
endDate,
|
|
94
110
|
execUserId: execUserId === 'all' ? undefined : execUserId,
|
|
95
111
|
triggerType: triggerType === 'all' ? undefined : triggerType,
|
|
96
112
|
execResult: execResult === 'all' ? undefined : execResult,
|
|
97
113
|
});
|
|
98
|
-
}, [onFilter,
|
|
114
|
+
}, [onFilter, startDate, endDate, execUserId, triggerType, execResult]);
|
|
99
115
|
|
|
100
116
|
const allExecUserOptions = [
|
|
101
117
|
{ value: 'all', label: '全部' },
|
|
@@ -112,6 +128,11 @@ export function ExecLogFilter({
|
|
|
112
128
|
...TRIGGER_TYPE_OPTIONS,
|
|
113
129
|
];
|
|
114
130
|
|
|
131
|
+
|
|
132
|
+
const { portalContainer, setTriggerRef } = usePortalContainer('data-bs-exec-user-select-portal');
|
|
133
|
+
const { portalContainer: triggerTypePortalContainer, setTriggerRef: setTriggerTypeTriggerRef } = usePortalContainer('data-bs-trigger-type-select-portal');
|
|
134
|
+
const { portalContainer: execResultPortalContainer, setTriggerRef: setExecResultTriggerRef } = usePortalContainer('data-bs-exec-result-select-portal');
|
|
135
|
+
|
|
115
136
|
return (
|
|
116
137
|
<div
|
|
117
138
|
className={cn(
|
|
@@ -124,10 +145,20 @@ export function ExecLogFilter({
|
|
|
124
145
|
<span className="shrink-0 text-[14px] text-[#030303] leading-[normal] whitespace-nowrap">
|
|
125
146
|
执行时间
|
|
126
147
|
</span>
|
|
127
|
-
<
|
|
128
|
-
value={
|
|
129
|
-
onChange={
|
|
148
|
+
<DateInput
|
|
149
|
+
value={startDate}
|
|
150
|
+
onChange={handleStartDateChange}
|
|
151
|
+
placeholder="开始日期"
|
|
152
|
+
className="flex-1 min-w-0"
|
|
153
|
+
format='yyyy-MM-dd HH:mm:ss'
|
|
154
|
+
/>
|
|
155
|
+
<span className="shrink-0 text-[14px] text-[#030303] leading-[normal]">~</span>
|
|
156
|
+
<DateInput
|
|
157
|
+
value={endDate}
|
|
158
|
+
onChange={handleEndDateChange}
|
|
159
|
+
placeholder="结束日期"
|
|
130
160
|
className="flex-1 min-w-0"
|
|
161
|
+
format='yyyy-MM-dd HH:mm:ss'
|
|
131
162
|
/>
|
|
132
163
|
</div>
|
|
133
164
|
|
|
@@ -138,9 +169,9 @@ export function ExecLogFilter({
|
|
|
138
169
|
</span>
|
|
139
170
|
<Select value={execUserId} onValueChange={handleExecUserIdChange}>
|
|
140
171
|
<SelectTrigger className="flex-1 min-w-0">
|
|
141
|
-
<SelectValue placeholder="请输入" />
|
|
172
|
+
<SelectValue placeholder="请输入" ref={setTriggerRef} />
|
|
142
173
|
</SelectTrigger>
|
|
143
|
-
<SelectContent>
|
|
174
|
+
<SelectContent container={portalContainer}>
|
|
144
175
|
{allExecUserOptions.map((opt) => (
|
|
145
176
|
<SelectItem key={opt.value} value={opt.value}>
|
|
146
177
|
{opt.label}
|
|
@@ -157,9 +188,9 @@ export function ExecLogFilter({
|
|
|
157
188
|
</span>
|
|
158
189
|
<Select value={triggerType} onValueChange={handleTriggerTypeChange}>
|
|
159
190
|
<SelectTrigger className="flex-1 min-w-0">
|
|
160
|
-
<SelectValue placeholder="全部" />
|
|
191
|
+
<SelectValue placeholder="全部" ref={setTriggerTypeTriggerRef} />
|
|
161
192
|
</SelectTrigger>
|
|
162
|
-
<SelectContent>
|
|
193
|
+
<SelectContent container={triggerTypePortalContainer}>
|
|
163
194
|
{allTriggerTypeOptions.map((opt) => (
|
|
164
195
|
<SelectItem key={opt.value} value={opt.value}>
|
|
165
196
|
{opt.label}
|
|
@@ -176,9 +207,9 @@ export function ExecLogFilter({
|
|
|
176
207
|
</span>
|
|
177
208
|
<Select value={execResult} onValueChange={handleExecResultChange}>
|
|
178
209
|
<SelectTrigger className="flex-1 min-w-0">
|
|
179
|
-
<SelectValue placeholder="请输入" />
|
|
210
|
+
<SelectValue placeholder="请输入" ref={setExecResultTriggerRef} />
|
|
180
211
|
</SelectTrigger>
|
|
181
|
-
<SelectContent>
|
|
212
|
+
<SelectContent container={execResultPortalContainer}>
|
|
182
213
|
{allExecResultOptions.map((opt) => (
|
|
183
214
|
<SelectItem key={opt.value} value={opt.value}>
|
|
184
215
|
{opt.label}
|
package/src/index.ts
CHANGED
|
@@ -76,7 +76,7 @@ export type {
|
|
|
76
76
|
TriggerCardConfig,
|
|
77
77
|
} from './components/agent-helper/trigger-select';
|
|
78
78
|
export { FormSelect } from './components/agent-helper/form-select';
|
|
79
|
-
export { AppSelect, groupsToAppTreeNodes } from './components/agent-helper/app-select';
|
|
79
|
+
export { AppSelect, groupsToAppTreeNodes, ALL_APPS_VALUE } from './components/agent-helper/app-select';
|
|
80
80
|
export type { AppSelectProps } from './components/agent-helper/app-select';
|
|
81
81
|
export type {
|
|
82
82
|
FormSelectProps,
|