@nocobase/plugin-ai 2.1.0-beta.14 → 2.1.0-beta.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai/ai-employees/atlas/index.d.ts +10 -0
- package/dist/{server/ai-employees/built-in/ai-coding/prompt.js → ai/ai-employees/atlas/index.js} +29 -20
- package/dist/ai/ai-employees/atlas/prompt.md +84 -0
- package/dist/ai/ai-employees/dara.d.ts +10 -0
- package/dist/{server/ai-employees/built-in/data-visualization/prompt.js → ai/ai-employees/dara.js} +21 -13
- package/dist/ai/ai-employees/dex.d.ts +10 -0
- package/dist/{server/ai-employees/built-in/data-organizer/prompt.js → ai/ai-employees/dex.js} +15 -7
- package/dist/ai/ai-employees/ellis.d.ts +10 -0
- package/dist/{server/ai-employees/built-in/email-assistant/prompt.js → ai/ai-employees/ellis.js} +19 -11
- package/dist/ai/ai-employees/lexi.d.ts +10 -0
- package/dist/{server/ai-employees/built-in/translator/prompt.js → ai/ai-employees/lexi.js} +15 -7
- package/dist/ai/ai-employees/vera.d.ts +10 -0
- package/dist/{server/ai-employees/built-in/research-analyst/prompt.js → ai/ai-employees/vera.js} +16 -8
- package/dist/ai/ai-employees/viz.d.ts +10 -0
- package/dist/{server/ai-employees/built-in/insights-analyst/prompt.js → ai/ai-employees/viz.js} +15 -7
- package/dist/ai/skills/business-analysis-report/SKILLS.md +88 -0
- package/dist/{server/ai-employees/built-in/ai-coding/prompt.d.ts → ai/skills/business-analysis-report/tools/businessReportGenerator.d.ts} +1 -3
- package/dist/ai/skills/business-analysis-report/tools/businessReportGenerator.js +98 -0
- package/dist/ai/skills/document-search/SKILLS.md +69 -0
- package/dist/ai/tools/chartGenerator.js +15 -3
- package/dist/ai/tools/formFiller.js +13 -2
- package/dist/{server/ai-employees/built-in/data-modeling/prompt.d.ts → ai/tools/getSkill.d.ts} +1 -3
- package/dist/{server/ai-employees/built-in/data-modeling/index.js → ai/tools/getSkill.js} +39 -32
- package/dist/{server/ai-employees/built-in/data-organizer/prompt.d.ts → ai/tools/knowledge-base-retrieve.d.ts} +1 -3
- package/dist/ai/tools/knowledge-base-retrieve.js +94 -0
- package/dist/{server/ai-employees/built-in/data-visualization/prompt.d.ts → ai/tools/sub-agents/dispatch-sub-agent-task.d.ts} +1 -3
- package/dist/ai/tools/sub-agents/dispatch-sub-agent-task.js +108 -0
- package/dist/ai/tools/sub-agents/get-ai-employee.d.ts +10 -0
- package/dist/{server/ai-employees/built-in/translator/profile.js → ai/tools/sub-agents/get-ai-employee.js} +28 -21
- package/dist/ai/tools/sub-agents/list-ai-employees.d.ts +10 -0
- package/dist/{server/ai-employees/built-in/email-assistant/profile.js → ai/tools/sub-agents/list-ai-employees.js} +25 -21
- package/dist/ai/tools/sub-agents/shared.d.ts +33 -0
- package/dist/ai/tools/sub-agents/shared.js +169 -0
- package/dist/ai/tools/suggestions.js +15 -4
- package/dist/client/170.d98eacdc00d9d527.js +10 -0
- package/dist/client/228.b18148eb1009d2fb.js +10 -0
- package/dist/client/280.029428b83d62155f.js +10 -0
- package/dist/client/290.0888139e33c9b7cb.js +10 -0
- package/dist/client/{524.954f96ec4fc2fd7a.js → 331.d547c95410476a69.js} +1 -1
- package/dist/client/343.83f7d96664e4e038.js +10 -0
- package/dist/client/406.15c09d98faa2ccf1.js +10 -0
- package/dist/client/428.e9f38da3b0d8b498.js +10 -0
- package/dist/client/486.77c26e2e7f8daf28.js +10 -0
- package/dist/client/502.2b4a51e0a8122e52.js +10 -0
- package/dist/client/525.33a9c8ec28be4ec4.js +10 -0
- package/dist/client/559.133d286a0a0a1d93.js +10 -0
- package/dist/client/{91.90e7098b7fbd5d00.js → 561.776886c5308e3c26.js} +1 -1
- package/dist/client/580.e75f97fb883ad042.js +10 -0
- package/dist/client/597.aa363881a325b5c0.js +10 -0
- package/dist/client/604.de96f3ec4d471afd.js +10 -0
- package/dist/client/614.aa766080f6b99aab.js +10 -0
- package/dist/client/646.ef9d7c2ea8641044.js +10 -0
- package/dist/client/687.224e569a99cae4bb.js +10 -0
- package/dist/client/699.57c0a1acb723202a.js +10 -0
- package/dist/client/711.266b8f1c520d467a.js +10 -0
- package/dist/client/758.a9741e81911e53c3.js +10 -0
- package/dist/client/768.973ce32e15099a48.js +10 -0
- package/dist/client/792.ae8ad1fcae9fd974.js +10 -0
- package/dist/client/820.6a26239ea96c075a.js +10 -0
- package/dist/client/832.0cf69e3f43c320b2.js +10 -0
- package/dist/client/927.ff5cd05b14901ae6.js +10 -0
- package/dist/client/ai-employees/admin/SkillSettings.d.ts +7 -5
- package/dist/client/ai-employees/admin/ToolsSettings.d.ts +17 -0
- package/dist/client/ai-employees/admin/mcp/MCPSettings.d.ts +10 -0
- package/dist/client/ai-employees/admin/mcp/MCPToolsList.d.ts +19 -0
- package/dist/client/ai-employees/admin/mcp/context.d.ts +15 -0
- package/dist/client/ai-employees/admin/mcp/schemas.d.ts +1286 -0
- package/dist/client/ai-employees/built-in/utils.d.ts +1 -0
- package/dist/client/ai-employees/business-report/tools/index.d.ts +10 -0
- package/dist/client/ai-employees/business-report/ui/BusinessReportCard.d.ts +12 -0
- package/dist/client/ai-employees/business-report/ui/BusinessReportModal.d.ts +17 -0
- package/dist/client/ai-employees/business-report/ui/report-utils.d.ts +38 -0
- package/dist/client/ai-employees/chatbox/AIEmployeeSwitch.d.ts +3 -2
- package/dist/client/ai-employees/chatbox/HintMessageHeader.d.ts +10 -0
- package/dist/client/ai-employees/chatbox/ModelSwitcher.d.ts +3 -1
- package/dist/client/ai-employees/chatbox/SearchSwitch.d.ts +3 -1
- package/dist/client/ai-employees/chatbox/Upload.d.ts +3 -1
- package/dist/client/ai-employees/chatbox/conversations/ConversationsList.d.ts +27 -0
- package/dist/client/ai-employees/chatbox/conversations/WorkflowTasksList.d.ts +31 -0
- package/dist/client/ai-employees/chatbox/conversations/common.d.ts +43 -0
- package/dist/{server/document-loader/loader.worker.d.ts → client/ai-employees/chatbox/conversations/index.d.ts} +1 -1
- package/dist/client/ai-employees/chatbox/hooks/useChatBoxActions.d.ts +5 -3
- package/dist/client/ai-employees/chatbox/hooks/useWorkflowTasks.d.ts +24 -0
- package/dist/client/ai-employees/chatbox/markdown/ECharts.d.ts +1 -2
- package/dist/client/ai-employees/chatbox/markdown/Markdown.d.ts +1 -1
- package/dist/client/ai-employees/chatbox/roles.d.ts +1 -0
- package/dist/client/ai-employees/chatbox/stores/chat-box.d.ts +8 -0
- package/dist/client/ai-employees/chatbox/stores/chat-conversations.d.ts +4 -0
- package/dist/client/ai-employees/chatbox/stores/chat-messages.d.ts +8 -0
- package/dist/client/ai-employees/chatbox/stores/workflow-tasks.d.ts +41 -0
- package/dist/client/ai-employees/chatbox/utils.d.ts +17 -7
- package/dist/client/ai-employees/sub-agents/tools/index.d.ts +10 -0
- package/dist/client/ai-employees/sub-agents/ui/SubAgentDispatchCard.d.ts +21 -0
- package/dist/client/ai-employees/types.d.ts +24 -4
- package/dist/{server/ai-employees/built-in/ai-coding/document/example/js-filter → client/ai-employees/workflow-tasks/tools}/index.d.ts +2 -7
- package/dist/client/ai-employees/workflow-tasks/ui/WorkflowTaskOutputCard.d.ts +11 -0
- package/dist/client/components/ListCollapse.d.ts +28 -0
- package/dist/client/index.js +7 -7
- package/dist/client/manager/ai-manager.d.ts +4 -23
- package/dist/client/repositories/AIConfigRepository.d.ts +11 -3
- package/dist/client/workflow/nodes/employee/components/AIEmployeeSelect.d.ts +10 -0
- package/dist/client/workflow/nodes/employee/components/assigness.d.ts +11 -0
- package/dist/client/workflow/nodes/employee/components/file-inputs.d.ts +10 -0
- package/dist/client/workflow/nodes/employee/components/message-inputs.d.ts +12 -0
- package/dist/client/workflow/nodes/employee/components/model-options.d.ts +10 -0
- package/dist/client/workflow/nodes/employee/components/skill-settings.d.ts +10 -0
- package/dist/client/workflow/nodes/employee/components/structured-output.d.ts +10 -0
- package/dist/client/workflow/nodes/employee/components/users-select.d.ts +15 -0
- package/dist/client/workflow/nodes/employee/components/web-search-options.d.ts +10 -0
- package/dist/client/workflow/nodes/employee/configuration.d.ts +12 -0
- package/dist/client/workflow/nodes/employee/flow-models/feedback.d.ts +13 -0
- package/dist/client/workflow/nodes/employee/flow-models/task.d.ts +13 -0
- package/dist/client/workflow/nodes/employee/index.d.ts +7 -31
- package/dist/collections/ai-employees.js +2 -1
- package/dist/collections/ai-mcp-clients.d.ts +51 -0
- package/dist/collections/ai-mcp-clients.js +111 -0
- package/dist/externalVersion.js +17 -16
- package/dist/locale/en-US.json +136 -8
- package/dist/locale/zh-CN.json +138 -9
- package/dist/node_modules/fast-glob/out/index.js +8 -8
- package/dist/node_modules/fast-glob/package.json +1 -1
- package/dist/node_modules/flexsearch/dist/flexsearch.bundle.min.js +2 -2
- package/dist/node_modules/flexsearch/package.json +1 -1
- package/dist/node_modules/fs-extra/lib/index.js +1 -1
- package/dist/node_modules/fs-extra/package.json +1 -1
- package/dist/node_modules/nodejs-snowflake/nodejs_snowflake.js +1 -1
- package/dist/node_modules/nodejs-snowflake/package.json +1 -1
- package/dist/node_modules/openai/index.js +1 -1
- package/dist/node_modules/openai/package.json +1 -1
- package/dist/node_modules/zod/index.cjs +1 -1
- package/dist/node_modules/zod/package.json +1 -1
- package/dist/server/ai-employees/ai-conversations.d.ts +70 -0
- package/dist/server/ai-employees/ai-conversations.js +325 -0
- package/dist/server/ai-employees/ai-employee.d.ts +100 -19
- package/dist/server/ai-employees/ai-employee.js +484 -261
- package/dist/server/ai-employees/ai-knowledge-base.d.ts +28 -0
- package/dist/server/ai-employees/ai-knowledge-base.js +167 -0
- package/dist/server/ai-employees/middleware/conversation.d.ts +2 -0
- package/dist/server/ai-employees/middleware/conversation.js +38 -5
- package/dist/server/ai-employees/middleware/index.d.ts +2 -0
- package/dist/server/ai-employees/middleware/index.js +5 -1
- package/dist/server/ai-employees/middleware/skill-tools.d.ts +12 -0
- package/dist/server/ai-employees/middleware/skill-tools.js +88 -0
- package/dist/server/ai-employees/middleware/tools.js +37 -10
- package/dist/server/ai-employees/middleware/workflow-history.d.ts +22 -0
- package/dist/server/ai-employees/middleware/workflow-history.js +173 -0
- package/dist/server/ai-employees/prompts.d.ts +16 -1
- package/dist/server/ai-employees/prompts.js +37 -1
- package/dist/server/ai-employees/sub-agents/dispatcher.d.ts +36 -0
- package/dist/server/ai-employees/sub-agents/dispatcher.js +225 -0
- package/dist/server/ai-employees/sub-agents/index.d.ts +9 -0
- package/dist/server/{migrations/20250923221107-setup-build-in.js → ai-employees/sub-agents/index.js} +9 -13
- package/dist/server/ai-employees/templates/form-assistant.d.ts +2 -2
- package/dist/server/ai-employees/templates/form-assistant.js +2 -2
- package/dist/server/ai-employees/utils.js +2 -2
- package/dist/server/collections/ai-conversations.js +18 -0
- package/dist/server/{ai-employees/built-in/ai-coding/document/example/js-column/js_columns_for_contacts_en.d.ts → collections/ai-mcp-clients.d.ts} +1 -4
- package/dist/server/{ai-employees/built-in/nocobase-assistant/index.js → collections/ai-mcp-clients.js} +12 -13
- package/dist/server/{ai-employees/built-in/ai-coding/document/basic/flow-resource.d.ts → collections/ai-skills.d.ts} +1 -4
- package/dist/server/collections/ai-skills.js +73 -0
- package/dist/server/{ai-employees/built-in/ai-coding/document/example/js-column/js_columns_for_opportunities_en.d.ts → collections/ai-workflow-tasks.d.ts} +1 -4
- package/dist/server/collections/ai-workflow-tasks.js +112 -0
- package/dist/server/{ai-employees/built-in/ai-coding/document/example/js-column/js_columns_for_accounts_en.d.ts → collections/users-ai-workflow-tasks.d.ts} +1 -4
- package/dist/server/collections/users-ai-workflow-tasks.js +44 -0
- package/dist/server/document-loader/constants.d.ts +1 -2
- package/dist/server/document-loader/constants.js +6 -1
- package/dist/server/document-loader/loader.d.ts +0 -1
- package/dist/server/document-loader/loader.js +2 -55
- package/dist/server/document-loader/types.d.ts +0 -1
- package/dist/server/llm-providers/anthropic.d.ts +1 -0
- package/dist/server/llm-providers/anthropic.js +2 -1
- package/dist/server/llm-providers/dashscope.d.ts +1 -0
- package/dist/server/llm-providers/deepseek.d.ts +1 -0
- package/dist/server/llm-providers/google-genai.d.ts +1 -0
- package/dist/server/llm-providers/google-genai.js +2 -1
- package/dist/server/llm-providers/kimi/provider.d.ts +1 -0
- package/dist/server/llm-providers/openai/responses.d.ts +1 -0
- package/dist/server/llm-providers/openai/responses.js +2 -1
- package/dist/server/llm-providers/provider.d.ts +1 -10
- package/dist/server/llm-providers/provider.js +4 -35
- package/dist/server/manager/ai-coding-manager.d.ts +1 -2
- package/dist/server/manager/ai-coding-manager.js +0 -41
- package/dist/server/manager/ai-context-datasource-manager.js +30 -1
- package/dist/server/manager/built-in-manager.d.ts +2 -4
- package/dist/server/manager/built-in-manager.js +8 -118
- package/dist/server/migrations/20260306000001-migrate-skill-settings-tools.js +68 -0
- package/dist/server/migrations/20260319000000-add-ai-conversations-from.d.ts +14 -0
- package/dist/server/migrations/20260319000000-add-ai-conversations-from.js +63 -0
- package/dist/server/migrations/20260424000000-remove-cole-ai-employee.d.ts +14 -0
- package/dist/server/{ai-employees/built-in/email-assistant/index.js → migrations/20260424000000-remove-cole-ai-employee.js} +20 -22
- package/dist/server/plugin.d.ts +6 -1
- package/dist/server/plugin.js +31 -8
- package/dist/server/resource/aiConversations.js +112 -188
- package/dist/server/resource/aiEmployees.js +5 -7
- package/dist/server/resource/aiMcpClients.d.ts +11 -0
- package/dist/server/resource/aiMcpClients.js +78 -0
- package/dist/server/{ai-employees/built-in/ai-coding/document/example/js-column/index.d.ts → resource/aiSkills.d.ts} +3 -7
- package/dist/server/resource/aiSkills.js +71 -0
- package/dist/server/resource/aiTools.js +4 -6
- package/dist/server/resource/aiWorkflowTasks.d.ts +12 -0
- package/dist/server/resource/aiWorkflowTasks.js +290 -0
- package/dist/server/tools/docs.js +4 -3
- package/dist/server/tools/workflow-caller.js +1 -0
- package/dist/server/types/ai-chat-conversation.type.d.ts +8 -2
- package/dist/server/types/ai-message.type.d.ts +7 -0
- package/dist/server/utils.d.ts +3 -0
- package/dist/server/utils.js +28 -3
- package/dist/server/workflow/nodes/employee/files.d.ts +16 -0
- package/dist/server/workflow/nodes/employee/files.js +125 -0
- package/dist/server/workflow/nodes/employee/handler.d.ts +11 -0
- package/dist/server/workflow/nodes/employee/handler.js +107 -0
- package/dist/server/workflow/nodes/employee/index.d.ts +17 -0
- package/dist/server/workflow/nodes/employee/index.js +391 -0
- package/dist/server/workflow/nodes/employee/tools.d.ts +12 -0
- package/dist/server/workflow/nodes/employee/tools.js +133 -0
- package/dist/server/workflow/nodes/employee/types.d.ts +35 -0
- package/dist/server/workflow/nodes/employee/types.js +24 -0
- package/dist/server/workflow/utils.d.ts +14 -0
- package/dist/server/workflow/utils.js +111 -0
- package/package.json +4 -2
- package/dist/client/107.64d9efa24d6b9143.js +0 -10
- package/dist/client/124.768c8aa5d6e6b461.js +0 -10
- package/dist/client/159.d52107c7a34ce2da.js +0 -10
- package/dist/client/192.0419770b69678994.js +0 -10
- package/dist/client/204.91be8cfc54d91a59.js +0 -10
- package/dist/client/238.9f784a7cdb751999.js +0 -10
- package/dist/client/263.6e1dfb1cbb1964f5.js +0 -10
- package/dist/client/35.5ee7503d9c09daa8.js +0 -10
- package/dist/client/47.6bd245f2140efd24.js +0 -10
- package/dist/client/481.03b3d2306d409933.js +0 -10
- package/dist/client/586.6a1510cabaa84f23.js +0 -10
- package/dist/client/650.8871a07b31c307ea.js +0 -10
- package/dist/client/755.e295bbd2b2a1cc21.js +0 -10
- package/dist/client/772.d51f683c55e18dd4.js +0 -10
- package/dist/client/870.84187dcb8c89b4dc.js +0 -10
- package/dist/client/933.baab3aa75f30e020.js +0 -10
- package/dist/client/987.3aee964e7f406939.js +0 -10
- package/dist/server/ai-employees/built-in/ai-coding/document/basic/flow-resource.js +0 -256
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-column/index.js +0 -48
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-column/js_columns_for_accounts_en.js +0 -452
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-column/js_columns_for_contacts_en.js +0 -363
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-column/js_columns_for_opportunities_en.js +0 -270
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-column/js_columns_for_quotations_en.d.ts +0 -13
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-column/js_columns_for_quotations_en.js +0 -219
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-column/js_columns_for_tickets_en.d.ts +0 -13
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-column/js_columns_for_tickets_en.js +0 -409
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-filter/accounts_filter_ant_style.d.ts +0 -13
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-filter/accounts_filter_ant_style.js +0 -324
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-filter/contacts_filter_ant_style.d.ts +0 -13
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-filter/contacts_filter_ant_style.js +0 -309
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-filter/index.js +0 -50
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-filter/leads_filter_ant_style.d.ts +0 -13
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-filter/leads_filter_ant_style.js +0 -345
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-filter/opportunities_filter_ant_style.d.ts +0 -13
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-filter/opportunities_filter_ant_style.js +0 -381
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-filter/product_categories_ant_style.d.ts +0 -13
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-filter/product_categories_ant_style.js +0 -545
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-filter/tickets_filter_ant_style.d.ts +0 -13
- package/dist/server/ai-employees/built-in/ai-coding/document/example/js-filter/tickets_filter_ant_style.js +0 -346
- package/dist/server/ai-employees/built-in/ai-coding/document/js-action.d.ts +0 -13
- package/dist/server/ai-employees/built-in/ai-coding/document/js-action.js +0 -102
- package/dist/server/ai-employees/built-in/ai-coding/document/js-block.d.ts +0 -13
- package/dist/server/ai-employees/built-in/ai-coding/document/js-block.js +0 -314
- package/dist/server/ai-employees/built-in/ai-coding/document/js-column.d.ts +0 -13
- package/dist/server/ai-employees/built-in/ai-coding/document/js-column.js +0 -113
- package/dist/server/ai-employees/built-in/ai-coding/document/js-field.d.ts +0 -13
- package/dist/server/ai-employees/built-in/ai-coding/document/js-field.js +0 -498
- package/dist/server/ai-employees/built-in/ai-coding/document/js-item.d.ts +0 -13
- package/dist/server/ai-employees/built-in/ai-coding/document/js-item.js +0 -184
- package/dist/server/ai-employees/built-in/ai-coding/index.d.ts +0 -37
- package/dist/server/ai-employees/built-in/ai-coding/index.js +0 -99
- package/dist/server/ai-employees/built-in/ai-coding/profile.d.ts +0 -27
- package/dist/server/ai-employees/built-in/ai-coding/profile.js +0 -60
- package/dist/server/ai-employees/built-in/ai-coding/prompt_en.md +0 -110
- package/dist/server/ai-employees/built-in/data-modeling/index.d.ts +0 -37
- package/dist/server/ai-employees/built-in/data-modeling/profile.d.ts +0 -27
- package/dist/server/ai-employees/built-in/data-modeling/profile.js +0 -60
- package/dist/server/ai-employees/built-in/data-modeling/prompt.js +0 -283
- package/dist/server/ai-employees/built-in/data-organizer/index.d.ts +0 -37
- package/dist/server/ai-employees/built-in/data-organizer/index.js +0 -63
- package/dist/server/ai-employees/built-in/data-organizer/profile.d.ts +0 -27
- package/dist/server/ai-employees/built-in/data-organizer/profile.js +0 -60
- package/dist/server/ai-employees/built-in/data-visualization/index.d.ts +0 -37
- package/dist/server/ai-employees/built-in/data-visualization/index.js +0 -58
- package/dist/server/ai-employees/built-in/data-visualization/profile.d.ts +0 -27
- package/dist/server/ai-employees/built-in/data-visualization/profile.js +0 -60
- package/dist/server/ai-employees/built-in/email-assistant/index.d.ts +0 -34
- package/dist/server/ai-employees/built-in/email-assistant/profile.d.ts +0 -27
- package/dist/server/ai-employees/built-in/email-assistant/prompt.d.ts +0 -12
- package/dist/server/ai-employees/built-in/insights-analyst/index.d.ts +0 -37
- package/dist/server/ai-employees/built-in/insights-analyst/index.js +0 -63
- package/dist/server/ai-employees/built-in/insights-analyst/profile.d.ts +0 -27
- package/dist/server/ai-employees/built-in/insights-analyst/profile.js +0 -60
- package/dist/server/ai-employees/built-in/insights-analyst/prompt.d.ts +0 -12
- package/dist/server/ai-employees/built-in/nocobase-assistant/index.d.ts +0 -34
- package/dist/server/ai-employees/built-in/nocobase-assistant/profile.d.ts +0 -27
- package/dist/server/ai-employees/built-in/nocobase-assistant/profile.js +0 -60
- package/dist/server/ai-employees/built-in/nocobase-assistant/prompt.d.ts +0 -12
- package/dist/server/ai-employees/built-in/nocobase-assistant/prompt.js +0 -52
- package/dist/server/ai-employees/built-in/research-analyst/index.d.ts +0 -37
- package/dist/server/ai-employees/built-in/research-analyst/index.js +0 -63
- package/dist/server/ai-employees/built-in/research-analyst/profile.d.ts +0 -27
- package/dist/server/ai-employees/built-in/research-analyst/profile.js +0 -60
- package/dist/server/ai-employees/built-in/research-analyst/prompt.d.ts +0 -12
- package/dist/server/ai-employees/built-in/translator/index.d.ts +0 -37
- package/dist/server/ai-employees/built-in/translator/index.js +0 -67
- package/dist/server/ai-employees/built-in/translator/profile.d.ts +0 -27
- package/dist/server/ai-employees/built-in/translator/prompt.d.ts +0 -12
- package/dist/server/document-loader/loader.worker.js +0 -68
- package/dist/server/document-loader/vendor/langchain/document_loaders/fs/text.d.ts +0 -20
- package/dist/server/document-loader/vendor/langchain/document_loaders/fs/text.js +0 -96
- /package/dist/client/ai-employees/chatbox/{Conversations.d.ts → conversations/Conversations.d.ts} +0 -0
- /package/dist/server/migrations/{20250923221107-setup-build-in.d.ts → 20260306000001-migrate-skill-settings-tools.d.ts} +0 -0
|
@@ -1,545 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __defProp = Object.defineProperty;
|
|
11
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
-
var __export = (target, all) => {
|
|
15
|
-
for (var name in all)
|
|
16
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
-
};
|
|
18
|
-
var __copyProps = (to, from, except, desc) => {
|
|
19
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
-
for (let key of __getOwnPropNames(from))
|
|
21
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
-
}
|
|
24
|
-
return to;
|
|
25
|
-
};
|
|
26
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
-
var product_categories_ant_style_exports = {};
|
|
28
|
-
__export(product_categories_ant_style_exports, {
|
|
29
|
-
default: () => product_categories_ant_style_default
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(product_categories_ant_style_exports);
|
|
32
|
-
var product_categories_ant_style_default = {
|
|
33
|
-
name: "product_categories_ant_style",
|
|
34
|
-
content: String.raw`// Product Categories Tree - Ant Design Style
|
|
35
|
-
ctx.useResource('MultiRecordResource');
|
|
36
|
-
ctx.resource.setResourceName('product_categories');
|
|
37
|
-
if (typeof ctx.resource.setPageSize === 'function') {
|
|
38
|
-
ctx.resource.setPageSize(200);
|
|
39
|
-
}
|
|
40
|
-
ctx.resource.setFields(['id', 'name', 'description', 'parentId']);
|
|
41
|
-
|
|
42
|
-
// Load icon library
|
|
43
|
-
await ctx.loadCSS('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');
|
|
44
|
-
|
|
45
|
-
await ctx.resource.refresh();
|
|
46
|
-
|
|
47
|
-
// Get product list model for filtering
|
|
48
|
-
const listModel = ctx.engine.getModel('b542ef8c56f'); // Replace with actual product list block UID
|
|
49
|
-
|
|
50
|
-
// State management
|
|
51
|
-
const state = {
|
|
52
|
-
activeId: null,
|
|
53
|
-
expandedIds: new Set(),
|
|
54
|
-
initialized: false,
|
|
55
|
-
searchText: '',
|
|
56
|
-
searchVisible: false,
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
// Common button styles
|
|
60
|
-
const buttonStyles = {
|
|
61
|
-
base: \`
|
|
62
|
-
display: inline-flex;
|
|
63
|
-
align-items: center;
|
|
64
|
-
justify-content: center;
|
|
65
|
-
width: 32px;
|
|
66
|
-
height: 32px;
|
|
67
|
-
padding: 0;
|
|
68
|
-
border-radius: 4px;
|
|
69
|
-
cursor: pointer;
|
|
70
|
-
transition: all 0.3s;
|
|
71
|
-
\`,
|
|
72
|
-
primary: \`
|
|
73
|
-
border: none;
|
|
74
|
-
background: #1677ff;
|
|
75
|
-
color: #fff;
|
|
76
|
-
\`,
|
|
77
|
-
default: \`
|
|
78
|
-
border: 1px solid #d9d9d9;
|
|
79
|
-
background: #fff;
|
|
80
|
-
color: rgba(0,0,0,0.65);
|
|
81
|
-
\`,
|
|
82
|
-
small: \`
|
|
83
|
-
width: 24px;
|
|
84
|
-
height: 24px;
|
|
85
|
-
\`,
|
|
86
|
-
text: \`
|
|
87
|
-
padding: 4px 15px;
|
|
88
|
-
width: auto;
|
|
89
|
-
font-size: 14px;
|
|
90
|
-
\`
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
// Apply filter to product list
|
|
94
|
-
async function applyFilter() {
|
|
95
|
-
if (!listModel?.resource) return;
|
|
96
|
-
const resource = listModel.resource;
|
|
97
|
-
|
|
98
|
-
if (typeof resource.removeFilterGroup === 'function') {
|
|
99
|
-
resource.removeFilterGroup(ctx.model.uid);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
if (state.activeId) {
|
|
103
|
-
if (typeof resource.addFilterGroup === 'function') {
|
|
104
|
-
resource.addFilterGroup(ctx.model.uid, { 'category_id.$eq': state.activeId });
|
|
105
|
-
} else if (typeof resource.setFilter === 'function') {
|
|
106
|
-
resource.setFilter({ 'category_id.$eq': state.activeId });
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
try {
|
|
111
|
-
await resource.refresh();
|
|
112
|
-
} catch (error) {
|
|
113
|
-
ctx.message.error('Product list refresh failed: ' + error.message);
|
|
114
|
-
console.error('applyFilter error:', error);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
// Build tree structure
|
|
119
|
-
function buildTree(categories) {
|
|
120
|
-
const map = new Map();
|
|
121
|
-
const roots = [];
|
|
122
|
-
|
|
123
|
-
// First pass: create all nodes
|
|
124
|
-
categories.forEach(cat => {
|
|
125
|
-
map.set(cat.id, { ...cat, children: [] });
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
// Second pass: build tree structure
|
|
129
|
-
categories.forEach(cat => {
|
|
130
|
-
const node = map.get(cat.id);
|
|
131
|
-
if (cat.parentId && map.has(cat.parentId)) {
|
|
132
|
-
map.get(cat.parentId).children.push(node);
|
|
133
|
-
} else {
|
|
134
|
-
roots.push(node);
|
|
135
|
-
}
|
|
136
|
-
});
|
|
137
|
-
|
|
138
|
-
return roots;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
// Escape HTML
|
|
142
|
-
const escapeHtml = (value) => String(value ?? '')
|
|
143
|
-
.replace(/&/g, '&')
|
|
144
|
-
.replace(/</g, '<')
|
|
145
|
-
.replace(/>/g, '>')
|
|
146
|
-
.replace(/"/g, '"')
|
|
147
|
-
.replace(/'/g, ''');
|
|
148
|
-
|
|
149
|
-
// Filter tree by search text
|
|
150
|
-
function filterTree(nodes, searchText) {
|
|
151
|
-
if (!searchText) return nodes;
|
|
152
|
-
|
|
153
|
-
const search = searchText.toLowerCase();
|
|
154
|
-
const filtered = [];
|
|
155
|
-
|
|
156
|
-
nodes.forEach(node => {
|
|
157
|
-
const name = (node.name || '').toLowerCase();
|
|
158
|
-
const desc = (node.description || '').toLowerCase();
|
|
159
|
-
const childrenMatch = filterTree(node.children || [], searchText);
|
|
160
|
-
|
|
161
|
-
if (name.includes(search) || desc.includes(search) || childrenMatch.length > 0) {
|
|
162
|
-
filtered.push({
|
|
163
|
-
...node,
|
|
164
|
-
children: childrenMatch
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
|
-
|
|
169
|
-
return filtered;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
// Render tree node
|
|
173
|
-
function renderTreeNode(node, level = 0) {
|
|
174
|
-
const id = Number(node.id);
|
|
175
|
-
const isActive = state.activeId === id;
|
|
176
|
-
const isExpanded = state.expandedIds.has(id);
|
|
177
|
-
const hasChildren = node.children && node.children.length > 0;
|
|
178
|
-
const name = escapeHtml(node.name ?? 'Unnamed');
|
|
179
|
-
const desc = escapeHtml(node.description ?? '');
|
|
180
|
-
|
|
181
|
-
const nodeHtml = \`
|
|
182
|
-
<div class="tree-node" data-id="\${id}" data-level="\${level}" style="
|
|
183
|
-
display: flex;
|
|
184
|
-
align-items: center;
|
|
185
|
-
height: 32px;
|
|
186
|
-
padding: 0 8px;
|
|
187
|
-
padding-left: \${8 + level * 24}px;
|
|
188
|
-
cursor: pointer;
|
|
189
|
-
transition: all 0.3s;
|
|
190
|
-
\${isActive ? 'background: #e6f4ff;' : ''}
|
|
191
|
-
">
|
|
192
|
-
\${hasChildren ? \`
|
|
193
|
-
<span data-action="toggle-expand" data-id="\${id}" class="tree-toggle" style="
|
|
194
|
-
display: inline-flex;
|
|
195
|
-
align-items: center;
|
|
196
|
-
justify-content: center;
|
|
197
|
-
width: 20px;
|
|
198
|
-
height: 20px;
|
|
199
|
-
margin-right: 8px;
|
|
200
|
-
color: rgba(0,0,0,0.45);
|
|
201
|
-
cursor: pointer;
|
|
202
|
-
border-radius: 2px;
|
|
203
|
-
transition: all 0.2s;
|
|
204
|
-
">
|
|
205
|
-
<i class="fas fa-chevron-\${isExpanded ? 'down' : 'right'}" style="font-size: 10px;"></i>
|
|
206
|
-
</span>
|
|
207
|
-
\` : \`
|
|
208
|
-
<span style="width: 28px; display: inline-block;"></span>
|
|
209
|
-
\`}
|
|
210
|
-
|
|
211
|
-
<span data-action="filter" data-id="\${id}" style="
|
|
212
|
-
flex: 1;
|
|
213
|
-
display: flex;
|
|
214
|
-
align-items: center;
|
|
215
|
-
gap: 8px;
|
|
216
|
-
font-size: 14px;
|
|
217
|
-
color: \${isActive ? '#1677ff' : 'rgba(0,0,0,0.88)'};
|
|
218
|
-
font-weight: \${isActive ? '500' : '400'};
|
|
219
|
-
">
|
|
220
|
-
<span>\${name}</span>
|
|
221
|
-
\${desc ? \`<span style="font-size: 12px; color: rgba(0,0,0,0.45);">\${desc}</span>\` : ''}
|
|
222
|
-
</span>
|
|
223
|
-
|
|
224
|
-
<div class="node-actions" style="display: none; gap: 4px; align-items: center;">
|
|
225
|
-
<button type="button" data-action="add-child" data-id="\${id}" title="Add Child"
|
|
226
|
-
style="\${buttonStyles.base}\${buttonStyles.default}\${buttonStyles.small}color: #52c41a;">
|
|
227
|
-
<i class="fas fa-plus" style="font-size: 11px;"></i>
|
|
228
|
-
</button>
|
|
229
|
-
<button type="button" data-action="edit" data-id="\${id}" title="Edit"
|
|
230
|
-
style="\${buttonStyles.base}\${buttonStyles.default}\${buttonStyles.small}color: #1677ff;">
|
|
231
|
-
<i class="fas fa-edit" style="font-size: 11px;"></i>
|
|
232
|
-
</button>
|
|
233
|
-
<button type="button" data-action="delete" data-id="\${id}" title="Delete"
|
|
234
|
-
style="\${buttonStyles.base}\${buttonStyles.default}\${buttonStyles.small}color: #ff4d4f;">
|
|
235
|
-
<i class="fas fa-trash" style="font-size: 11px;"></i>
|
|
236
|
-
</button>
|
|
237
|
-
</div>
|
|
238
|
-
</div>
|
|
239
|
-
\`;
|
|
240
|
-
|
|
241
|
-
let childrenHtml = '';
|
|
242
|
-
if (hasChildren && isExpanded) {
|
|
243
|
-
childrenHtml = node.children.map(child => renderTreeNode(child, level + 1)).join('');
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
return nodeHtml + childrenHtml;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
// Render function
|
|
250
|
-
function render() {
|
|
251
|
-
const categories = ctx.resource.getData() || [];
|
|
252
|
-
const tree = buildTree(categories);
|
|
253
|
-
|
|
254
|
-
// Initialize: expand all nodes on first render
|
|
255
|
-
if (!state.initialized && categories.length > 0) {
|
|
256
|
-
state.initialized = true;
|
|
257
|
-
categories.forEach(cat => {
|
|
258
|
-
if (cat.parentId && categories.some(c => c.id === cat.parentId)) {
|
|
259
|
-
state.expandedIds.add(cat.parentId);
|
|
260
|
-
}
|
|
261
|
-
});
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
// Filter tree by search
|
|
265
|
-
const filteredTree = filterTree(tree, state.searchText);
|
|
266
|
-
|
|
267
|
-
// Tree HTML
|
|
268
|
-
const treeHtml = filteredTree.length === 0
|
|
269
|
-
? \`
|
|
270
|
-
<div style="
|
|
271
|
-
padding: 32px;
|
|
272
|
-
text-align: center;
|
|
273
|
-
color: rgba(0,0,0,0.25);
|
|
274
|
-
font-size: 14px;
|
|
275
|
-
">
|
|
276
|
-
<i class="fas fa-folder-open" style="font-size: 24px; margin-bottom: 8px; display: block;"></i>
|
|
277
|
-
No categories yet
|
|
278
|
-
</div>
|
|
279
|
-
\`
|
|
280
|
-
: filteredTree.map(node => renderTreeNode(node)).join('');
|
|
281
|
-
|
|
282
|
-
// Search overlay
|
|
283
|
-
const searchOverlay = state.searchVisible ? \`
|
|
284
|
-
<div style="
|
|
285
|
-
position: absolute;
|
|
286
|
-
top: 12px;
|
|
287
|
-
left: 16px;
|
|
288
|
-
right: 16px;
|
|
289
|
-
z-index: 10;
|
|
290
|
-
background: #fff;
|
|
291
|
-
">
|
|
292
|
-
<div style="position: relative;">
|
|
293
|
-
<i class="fas fa-search" style="
|
|
294
|
-
position: absolute;
|
|
295
|
-
left: 10px;
|
|
296
|
-
top: 50%;
|
|
297
|
-
transform: translateY(-50%);
|
|
298
|
-
color: rgba(0,0,0,0.25);
|
|
299
|
-
font-size: 12px;
|
|
300
|
-
pointer-events: none;
|
|
301
|
-
"></i>
|
|
302
|
-
<input
|
|
303
|
-
type="text"
|
|
304
|
-
placeholder="Search categories..."
|
|
305
|
-
value="\${state.searchText}"
|
|
306
|
-
data-action="search-input"
|
|
307
|
-
autocomplete="off"
|
|
308
|
-
style="
|
|
309
|
-
width: 100%;
|
|
310
|
-
height: 32px;
|
|
311
|
-
padding: 0 40px 0 30px;
|
|
312
|
-
font-size: 14px;
|
|
313
|
-
border: 1px solid #40a9ff;
|
|
314
|
-
border-radius: 4px;
|
|
315
|
-
outline: none;
|
|
316
|
-
background: #fff;
|
|
317
|
-
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
|
|
318
|
-
transition: all 0.3s;
|
|
319
|
-
"
|
|
320
|
-
onkeydown="event.stopPropagation()"
|
|
321
|
-
oninput="event.stopPropagation()"
|
|
322
|
-
/>
|
|
323
|
-
<i class="fas fa-times" data-action="close-search" style="
|
|
324
|
-
position: absolute;
|
|
325
|
-
right: 10px;
|
|
326
|
-
top: 50%;
|
|
327
|
-
transform: translateY(-50%);
|
|
328
|
-
color: rgba(0,0,0,0.45);
|
|
329
|
-
font-size: 12px;
|
|
330
|
-
cursor: pointer;
|
|
331
|
-
padding: 4px;
|
|
332
|
-
"></i>
|
|
333
|
-
</div>
|
|
334
|
-
</div>
|
|
335
|
-
\` : '';
|
|
336
|
-
|
|
337
|
-
// Main HTML
|
|
338
|
-
ctx.element.innerHTML = \`
|
|
339
|
-
<div style="background: #fff; border-radius: 6px;">
|
|
340
|
-
<div style="
|
|
341
|
-
padding: 12px 16px;
|
|
342
|
-
border-bottom: 1px solid #f0f0f0;
|
|
343
|
-
position: relative;
|
|
344
|
-
">
|
|
345
|
-
\${searchOverlay}
|
|
346
|
-
|
|
347
|
-
<div style="
|
|
348
|
-
display: flex;
|
|
349
|
-
justify-content: space-between;
|
|
350
|
-
align-items: center;
|
|
351
|
-
">
|
|
352
|
-
<button type="button" data-action="toggle-search" title="Search"
|
|
353
|
-
style="\${buttonStyles.base}\${state.searchText ?
|
|
354
|
-
'border: 1px solid #40a9ff; background: #e6f4ff; color: #1677ff;' :
|
|
355
|
-
buttonStyles.default}">
|
|
356
|
-
<i class="fas fa-search" style="font-size: 12px;"></i>
|
|
357
|
-
</button>
|
|
358
|
-
|
|
359
|
-
<div style="display: flex; gap: 4px;">
|
|
360
|
-
<button type="button" data-action="add-root" title="Add Category"
|
|
361
|
-
style="\${buttonStyles.base}\${buttonStyles.primary}">
|
|
362
|
-
<i class="fas fa-plus" style="font-size: 12px;"></i>
|
|
363
|
-
</button>
|
|
364
|
-
<button type="button" data-action="refresh" title="Refresh"
|
|
365
|
-
style="\${buttonStyles.base}\${buttonStyles.default}">
|
|
366
|
-
<i class="fas fa-sync-alt" style="font-size: 12px;"></i>
|
|
367
|
-
</button>
|
|
368
|
-
</div>
|
|
369
|
-
</div>
|
|
370
|
-
</div>
|
|
371
|
-
|
|
372
|
-
<div class="tree-container" style="
|
|
373
|
-
max-height: 400px;
|
|
374
|
-
overflow-y: auto;
|
|
375
|
-
overflow-x: hidden;
|
|
376
|
-
">
|
|
377
|
-
\${treeHtml}
|
|
378
|
-
</div>
|
|
379
|
-
</div>
|
|
380
|
-
|
|
381
|
-
<style>
|
|
382
|
-
.tree-node:hover {
|
|
383
|
-
background: #fafafa !important;
|
|
384
|
-
}
|
|
385
|
-
.tree-node:hover .node-actions {
|
|
386
|
-
display: flex !important;
|
|
387
|
-
}
|
|
388
|
-
.tree-toggle:hover {
|
|
389
|
-
background: rgba(0,0,0,0.04);
|
|
390
|
-
}
|
|
391
|
-
.node-actions button:hover {
|
|
392
|
-
border-color: currentColor !important;
|
|
393
|
-
box-shadow: 0 2px 4px rgba(0,0,0,0.08);
|
|
394
|
-
}
|
|
395
|
-
button:hover {
|
|
396
|
-
opacity: 0.8;
|
|
397
|
-
}
|
|
398
|
-
button:active {
|
|
399
|
-
transform: scale(0.95);
|
|
400
|
-
}
|
|
401
|
-
</style>
|
|
402
|
-
\`;
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
// Event handlers
|
|
406
|
-
async function handleClick(event) {
|
|
407
|
-
const actionTarget = event.target.closest('[data-action]');
|
|
408
|
-
if (!actionTarget) return;
|
|
409
|
-
|
|
410
|
-
const action = actionTarget.dataset.action;
|
|
411
|
-
const id = Number(actionTarget.dataset.id);
|
|
412
|
-
|
|
413
|
-
switch(action) {
|
|
414
|
-
case 'toggle-expand':
|
|
415
|
-
event.stopPropagation();
|
|
416
|
-
if (state.expandedIds.has(id)) {
|
|
417
|
-
state.expandedIds.delete(id);
|
|
418
|
-
} else {
|
|
419
|
-
state.expandedIds.add(id);
|
|
420
|
-
}
|
|
421
|
-
render();
|
|
422
|
-
break;
|
|
423
|
-
|
|
424
|
-
case 'filter':
|
|
425
|
-
state.activeId = state.activeId === id ? null : (Number.isFinite(id) ? id : null);
|
|
426
|
-
render();
|
|
427
|
-
await applyFilter();
|
|
428
|
-
break;
|
|
429
|
-
|
|
430
|
-
case 'add-root':
|
|
431
|
-
ctx.openView(\`\${ctx.model.uid}-add\`, {
|
|
432
|
-
mode: 'dialog',
|
|
433
|
-
size: 'small',
|
|
434
|
-
title: 'Add Category',
|
|
435
|
-
pageModelClass: 'ChildPageModel',
|
|
436
|
-
collectionName: 'product_categories',
|
|
437
|
-
dataSourceKey: 'main'
|
|
438
|
-
});
|
|
439
|
-
break;
|
|
440
|
-
|
|
441
|
-
case 'add-child':
|
|
442
|
-
ctx.openView(\`\${ctx.model.uid}-add\`, {
|
|
443
|
-
mode: 'dialog',
|
|
444
|
-
size: 'small',
|
|
445
|
-
title: 'Add Subcategory',
|
|
446
|
-
pageModelClass: 'ChildPageModel',
|
|
447
|
-
collectionName: 'product_categories',
|
|
448
|
-
dataSourceKey: 'main'
|
|
449
|
-
});
|
|
450
|
-
break;
|
|
451
|
-
|
|
452
|
-
case 'edit':
|
|
453
|
-
if (!Number.isFinite(id)) return;
|
|
454
|
-
const category = (ctx.resource.getData() || []).find(c => c.id === id);
|
|
455
|
-
if (!category) return;
|
|
456
|
-
|
|
457
|
-
ctx.openView(\`\${ctx.model.uid}-edit\`, {
|
|
458
|
-
mode: 'dialog',
|
|
459
|
-
size: 'small',
|
|
460
|
-
title: 'Edit Category',
|
|
461
|
-
pageModelClass: 'ChildPageModel',
|
|
462
|
-
collectionName: 'product_categories',
|
|
463
|
-
filterByTk: id,
|
|
464
|
-
dataSourceKey: 'main'
|
|
465
|
-
});
|
|
466
|
-
break;
|
|
467
|
-
|
|
468
|
-
case 'delete':
|
|
469
|
-
if (!Number.isFinite(id)) return;
|
|
470
|
-
if (confirm('Delete this category and all its subcategories?')) {
|
|
471
|
-
try {
|
|
472
|
-
ctx.message.loading('Deleting...');
|
|
473
|
-
await ctx.resource.destroy(id);
|
|
474
|
-
await ctx.resource.refresh();
|
|
475
|
-
if (state.activeId === id) {
|
|
476
|
-
state.activeId = null;
|
|
477
|
-
}
|
|
478
|
-
state.expandedIds.delete(id);
|
|
479
|
-
ctx.message.success('Category deleted');
|
|
480
|
-
render();
|
|
481
|
-
await applyFilter();
|
|
482
|
-
} catch (error) {
|
|
483
|
-
ctx.message.error('Delete failed: ' + error.message);
|
|
484
|
-
console.error('Delete category error:', error);
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
break;
|
|
488
|
-
|
|
489
|
-
case 'refresh':
|
|
490
|
-
ctx.message.loading('Refreshing...');
|
|
491
|
-
await ctx.resource.refresh();
|
|
492
|
-
ctx.message.success('Refreshed');
|
|
493
|
-
render();
|
|
494
|
-
break;
|
|
495
|
-
|
|
496
|
-
case 'toggle-search':
|
|
497
|
-
state.searchVisible = !state.searchVisible;
|
|
498
|
-
render();
|
|
499
|
-
if (state.searchVisible) {
|
|
500
|
-
setTimeout(() => {
|
|
501
|
-
const input = ctx.element.querySelector('input[data-action="search-input"]');
|
|
502
|
-
if (input) input.focus();
|
|
503
|
-
}, 0);
|
|
504
|
-
}
|
|
505
|
-
break;
|
|
506
|
-
|
|
507
|
-
case 'close-search':
|
|
508
|
-
state.searchVisible = false;
|
|
509
|
-
state.searchText = '';
|
|
510
|
-
render();
|
|
511
|
-
break;
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
// Handle search input
|
|
516
|
-
function handleSearch(event) {
|
|
517
|
-
const input = event.target;
|
|
518
|
-
if (input.dataset.action !== 'search-input') return;
|
|
519
|
-
|
|
520
|
-
state.searchText = input.value;
|
|
521
|
-
|
|
522
|
-
// Auto-expand all when searching
|
|
523
|
-
if (input.value) {
|
|
524
|
-
const categories = ctx.resource.getData() || [];
|
|
525
|
-
categories.forEach(cat => {
|
|
526
|
-
if (cat.parentId) {
|
|
527
|
-
state.expandedIds.add(cat.parentId);
|
|
528
|
-
}
|
|
529
|
-
});
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
render();
|
|
533
|
-
}
|
|
534
|
-
|
|
535
|
-
// Bind events
|
|
536
|
-
function ensureBound() {
|
|
537
|
-
if (ctx.element._bound) return;
|
|
538
|
-
ctx.element._bound = true;
|
|
539
|
-
ctx.element.addEventListener('click', handleClick);
|
|
540
|
-
ctx.element.addEventListener('input', handleSearch);
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
ensureBound();
|
|
544
|
-
render();`
|
|
545
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
declare const _default: {
|
|
10
|
-
name: string;
|
|
11
|
-
content: string;
|
|
12
|
-
};
|
|
13
|
-
export default _default;
|