@fses/workbench-app 0.2.0 → 0.2.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/WORKBENCH-CLOSURE.json +80 -0
- package/dist/Workspace-fYH2XNdb.js +22699 -0
- package/dist/fses-workbench-app.js +2 -2
- package/dist/{index-DbH6tMQy.js → index-CbIJlts1.js} +8 -8
- package/dist/internal/personal-workbench/components/workbench/WorkbenchStudio.vue.d.ts +2 -2
- package/dist/internal/personal-workbench/lib/deepAgentApi.d.ts +41 -2
- package/dist/internal/personal-workbench/lib/deepAgentQueueState.d.ts +111 -0
- package/dist/internal/personal-workbench/lib/vueRuntimeAdapters.d.ts +72 -0
- package/dist/internal/personal-workbench/lib/workbenchSocketClient.d.ts +1 -1
- package/dist/internal/personal-workbench/lib/workbenchStorage.d.ts +2 -0
- package/dist/runtime/index.js +1 -1
- package/dist/style.css +1 -1
- package/dist/{useWorkbenchRuntime-XpOzwm56.js → useWorkbenchRuntime-Ch8lqkjO.js} +6707 -6315
- package/node_modules/@byteluck/agentic-protocol/LICENSE +9 -0
- package/node_modules/@byteluck/agentic-protocol/README.md +74 -0
- package/node_modules/@byteluck/agentic-protocol/dist/index.d.ts +1623 -0
- package/node_modules/@byteluck/agentic-protocol/dist/index.mjs +3380 -0
- package/node_modules/@byteluck/agentic-protocol/package.json +37 -0
- package/node_modules/@byteluck/workbench-skill-contracts/LICENSE +9 -0
- package/node_modules/@byteluck/workbench-skill-contracts/dist/index.d.ts +234 -0
- package/node_modules/@byteluck/workbench-skill-contracts/dist/index.mjs +394 -0
- package/node_modules/@byteluck/workbench-skill-contracts/package.json +37 -0
- package/node_modules/@fses/ai-chat/LICENSE +9 -0
- package/node_modules/@fses/ai-chat/README.md +320 -0
- package/node_modules/@fses/ai-chat/dist/chart-card/data.d.ts +12 -0
- package/node_modules/@fses/ai-chat/dist/chart-card/from-markdown.d.ts +11 -0
- package/node_modules/@fses/ai-chat/dist/chart-card/from-tool.d.ts +8 -0
- package/node_modules/@fses/ai-chat/dist/chart-card/options.d.ts +4 -0
- package/node_modules/@fses/ai-chat/dist/chart-card/trace.d.ts +19 -0
- package/node_modules/@fses/ai-chat/dist/chart-card/types.d.ts +133 -0
- package/node_modules/@fses/ai-chat/dist/components/CardRecommendationDeferredDraft.vue.d.ts +13 -0
- package/node_modules/@fses/ai-chat/dist/components/CardRecommendationDraft.vue.d.ts +18 -0
- package/node_modules/@fses/ai-chat/dist/components/ChartCardRenderer.vue.d.ts +11 -0
- package/node_modules/@fses/ai-chat/dist/components/ChatMessageItem.vue.d.ts +76 -0
- package/node_modules/@fses/ai-chat/dist/components/ChatMessageList.vue.d.ts +79 -0
- package/node_modules/@fses/ai-chat/dist/components/ChatSender.vue.d.ts +98 -0
- package/node_modules/@fses/ai-chat/dist/components/CollapsedToolActivity.vue.d.ts +9 -0
- package/node_modules/@fses/ai-chat/dist/components/ContextUsageRing.vue.d.ts +12 -0
- package/node_modules/@fses/ai-chat/dist/components/EChartsView.vue.d.ts +6 -0
- package/node_modules/@fses/ai-chat/dist/components/FsesAiChat.vue.d.ts +306 -0
- package/node_modules/@fses/ai-chat/dist/components/PlanDraftCard.vue.d.ts +19 -0
- package/node_modules/@fses/ai-chat/dist/components/ShellExecPanel.vue.d.ts +6 -0
- package/node_modules/@fses/ai-chat/dist/components/TaskTodoPlanBar.vue.d.ts +6 -0
- package/node_modules/@fses/ai-chat/dist/components/ThinkingShimmer.vue.d.ts +6 -0
- package/node_modules/@fses/ai-chat/dist/composables/context-usage.d.ts +11 -0
- package/node_modules/@fses/ai-chat/dist/composables/types.d.ts +465 -0
- package/node_modules/@fses/ai-chat/dist/composables/useChat.d.ts +2 -0
- package/node_modules/@fses/ai-chat/dist/composables/useSystemEChartsIcon.d.ts +11 -0
- package/node_modules/@fses/ai-chat/dist/fses-ai-chat.js +11408 -0
- package/node_modules/@fses/ai-chat/dist/fses-ai-chat.umd.cjs +25 -0
- package/node_modules/@fses/ai-chat/dist/index.d.ts +17 -0
- package/node_modules/@fses/ai-chat/dist/plugin.d.ts +8 -0
- package/node_modules/@fses/ai-chat/dist/style.css +1 -0
- package/node_modules/@fses/ai-chat/dist/utils/assistant-markdown.d.ts +11 -0
- package/node_modules/@fses/ai-chat/dist/utils/attachment-upload.d.ts +22 -0
- package/node_modules/@fses/ai-chat/dist/utils/card-recommendation-config-summary.d.ts +86 -0
- package/node_modules/@fses/ai-chat/dist/utils/card-recommendation-field-label.d.ts +24 -0
- package/node_modules/@fses/ai-chat/dist/utils/card-recommendation-source.d.ts +18 -0
- package/node_modules/@fses/ai-chat/dist/utils/card-recommendation-title-source.d.ts +12 -0
- package/node_modules/@fses/ai-chat/dist/utils/chart-card-visibility.d.ts +24 -0
- package/node_modules/@fses/ai-chat/dist/utils/derived-process-labels.d.ts +13 -0
- package/node_modules/@fses/ai-chat/dist/utils/echarts-recommendation-icon.d.ts +36 -0
- package/node_modules/@fses/ai-chat/dist/utils/group-messages.d.ts +30 -0
- package/node_modules/@fses/ai-chat/dist/utils/status-activity.d.ts +48 -0
- package/node_modules/@fses/ai-chat/dist/utils/system-echarts-template-icons.generated.d.ts +305 -0
- package/node_modules/@fses/ai-chat/dist/utils/system-echarts-template.d.ts +20 -0
- package/node_modules/@fses/ai-chat/dist/utils/task-todo-plan.d.ts +40 -0
- package/node_modules/@fses/ai-chat/dist/utils/workbench-echarts-theme.d.ts +35 -0
- package/node_modules/@fses/ai-chat/package.json +81 -0
- package/node_modules/@fses/workbench-card/LICENSE +9 -0
- package/node_modules/@fses/workbench-card/README.md +81 -0
- package/node_modules/@fses/workbench-card/dist/chart/index.d.ts +8 -0
- package/node_modules/@fses/workbench-card/dist/fses-workbench-card-echarts-protocol.js +2230 -0
- package/node_modules/@fses/workbench-card/dist/fses-workbench-card-renderers.js +33742 -0
- package/node_modules/@fses/workbench-card/dist/fses-workbench-card.js +21238 -0
- package/node_modules/@fses/workbench-card/dist/fses-workbench-card.umd.cjs +1 -0
- package/node_modules/@fses/workbench-card/dist/index.d.ts +11 -0
- package/node_modules/@fses/workbench-card/dist/registry/cardRegistry.d.ts +50 -0
- package/node_modules/@fses/workbench-card/dist/registry/compositeCardPatterns.d.ts +39 -0
- package/node_modules/@fses/workbench-card/dist/registry/echartsTemplateCategories.d.ts +20 -0
- package/node_modules/@fses/workbench-card/dist/registry/echartsTemplateRegistry.d.ts +1158 -0
- package/node_modules/@fses/workbench-card/dist/registry/echartsTemplateRegistry.generated.d.ts +1141 -0
- package/node_modules/@fses/workbench-card/dist/registry/echartsTemplateTypes.d.ts +76 -0
- package/node_modules/@fses/workbench-card/dist/registry/index.d.ts +10 -0
- package/node_modules/@fses/workbench-card/dist/renderers/WorkbenchBlockRenderer.vue.d.ts +55 -0
- package/node_modules/@fses/workbench-card/dist/renderers/chart/ChartRegistry.vue.d.ts +22 -0
- package/node_modules/@fses/workbench-card/dist/renderers/chart/EChartsProtocolRenderer.vue.d.ts +34 -0
- package/node_modules/@fses/workbench-card/dist/renderers/chart/chartRendererRegistry.d.ts +219 -0
- package/node_modules/@fses/workbench-card/dist/renderers/chart/chartResponsiveLayout.d.ts +47 -0
- package/node_modules/@fses/workbench-card/dist/renderers/chart/dynamicEchartOption.d.ts +30 -0
- package/node_modules/@fses/workbench-card/dist/renderers/chart/echarts-protocol/adapter.d.ts +73 -0
- package/node_modules/@fses/workbench-card/dist/renderers/chart/echarts-protocol/converters/composite.converter.d.ts +11 -0
- package/node_modules/@fses/workbench-card/dist/renderers/chart/echarts-protocol/converters/configOnly.converter.d.ts +11 -0
- package/node_modules/@fses/workbench-card/dist/renderers/chart/echarts-protocol/converters/geo.converter.d.ts +10 -0
- package/node_modules/@fses/workbench-card/dist/renderers/chart/echarts-protocol/converters/graphic.converter.d.ts +10 -0
- package/node_modules/@fses/workbench-card/dist/renderers/chart/echarts-protocol/converters/layout.converter.d.ts +11 -0
- package/node_modules/@fses/workbench-card/dist/renderers/chart/echarts-protocol/converters/network.converter.d.ts +10 -0
- package/node_modules/@fses/workbench-card/dist/renderers/chart/echarts-protocol/converters/scene3D.converter.d.ts +11 -0
- package/node_modules/@fses/workbench-card/dist/renderers/chart/echarts-protocol/converters/series.converter.d.ts +10 -0
- package/node_modules/@fses/workbench-card/dist/renderers/chart/echarts-protocol/converters/table.converter.d.ts +10 -0
- package/node_modules/@fses/workbench-card/dist/renderers/chart/echarts-protocol/converters/timeline.converter.d.ts +11 -0
- package/node_modules/@fses/workbench-card/dist/renderers/chart/echarts-protocol/converters/transition.converter.d.ts +11 -0
- package/node_modules/@fses/workbench-card/dist/renderers/chart/echarts-protocol/converters/tree.converter.d.ts +10 -0
- package/node_modules/@fses/workbench-card/dist/renderers/chart/echarts-protocol/converters/tuple.converter.d.ts +10 -0
- package/node_modules/@fses/workbench-card/dist/renderers/chart/echarts-protocol/index.d.ts +9 -0
- package/node_modules/@fses/workbench-card/dist/renderers/chart/echarts-protocol/merger.d.ts +16 -0
- package/node_modules/@fses/workbench-card/dist/renderers/chart/echarts-protocol/types.d.ts +447 -0
- package/node_modules/@fses/workbench-card/dist/renderers/chart/echartsRuntimeInteractions.d.ts +30 -0
- package/node_modules/@fses/workbench-card/dist/renderers/chart/echartsTitle.d.ts +13 -0
- package/node_modules/@fses/workbench-card/dist/renderers/chart/echartsTooltipPortal.d.ts +12 -0
- package/node_modules/@fses/workbench-card/dist/renderers/chart/types.d.ts +47 -0
- package/node_modules/@fses/workbench-card/dist/renderers/chart/useEchart.d.ts +29 -0
- package/node_modules/@fses/workbench-card/dist/renderers/chart/workbenchChartTheme.d.ts +36 -0
- package/node_modules/@fses/workbench-card/dist/renderers/custom-canvas/canvasLayoutBindings.d.ts +86 -0
- package/node_modules/@fses/workbench-card/dist/renderers/hostBridge.d.ts +61 -0
- package/node_modules/@fses/workbench-card/dist/renderers/index.d.ts +17 -0
- package/node_modules/@fses/workbench-card/dist/renderers/native/nativeBindings.d.ts +145 -0
- package/node_modules/@fses/workbench-card/dist/renderers/nested/nestedBlockBindings.d.ts +107 -0
- package/node_modules/@fses/workbench-card/dist/renderers/quickLinkDisplay.d.ts +24 -0
- package/node_modules/@fses/workbench-card/dist/renderers/reference-composite/referenceCompositeBindings.d.ts +171 -0
- package/node_modules/@fses/workbench-card/dist/renderers/reference-composite/referenceRiskAndStrategyBindings.d.ts +91 -0
- package/node_modules/@fses/workbench-card/dist/renderers/resizableTable.d.ts +51 -0
- package/node_modules/@fses/workbench-card/dist/renderers/style.css +1 -0
- package/node_modules/@fses/workbench-card/dist/renderers/tableDisplay.d.ts +25 -0
- package/node_modules/@fses/workbench-card/dist/renderers/useWorkbenchBlockRendererBindings.d.ts +580 -0
- package/node_modules/@fses/workbench-card/dist/shell/workbenchVisualShell.d.ts +48 -0
- package/node_modules/@fses/workbench-card/dist/style.css +1 -0
- package/node_modules/@fses/workbench-card/dist/types/block.d.ts +2011 -0
- package/node_modules/@fses/workbench-card/dist/types/canvas.d.ts +25 -0
- package/node_modules/@fses/workbench-card/dist/types/echartsProtocol.d.ts +445 -0
- package/node_modules/@fses/workbench-card/dist/types/index.d.ts +10 -0
- package/node_modules/@fses/workbench-card/dist/types/registry.d.ts +7 -0
- package/node_modules/@fses/workbench-card/dist/types/runtime.d.ts +34 -0
- package/node_modules/@fses/workbench-card/package.json +83 -0
- package/node_modules/@fses/workbench-card/src/chart/index.ts +8 -0
- package/node_modules/@fses/workbench-card/src/index.ts +13 -0
- package/node_modules/@fses/workbench-card/src/registry/cardRegistry.ts +476 -0
- package/node_modules/@fses/workbench-card/src/registry/compositeCardPatterns.ts +206 -0
- package/node_modules/@fses/workbench-card/src/registry/echartsTemplateCategories.ts +74 -0
- package/node_modules/@fses/workbench-card/src/registry/echartsTemplateRegistry.generated.js +19950 -0
- package/node_modules/@fses/workbench-card/src/registry/echartsTemplateRegistry.generated.ts +19951 -0
- package/node_modules/@fses/workbench-card/src/registry/echartsTemplateRegistry.ts +32 -0
- package/node_modules/@fses/workbench-card/src/registry/echartsTemplateTypes.ts +83 -0
- package/node_modules/@fses/workbench-card/src/registry/index.ts +10 -0
- package/node_modules/@fses/workbench-card/src/renderers/WorkbenchBlockRenderer.vue +2728 -0
- package/node_modules/@fses/workbench-card/src/renderers/chart/ChartRegistry.vue +221 -0
- package/node_modules/@fses/workbench-card/src/renderers/chart/EChartsProtocolRenderer.vue +304 -0
- package/node_modules/@fses/workbench-card/src/renderers/chart/chartRendererRegistry.ts +311 -0
- package/node_modules/@fses/workbench-card/src/renderers/chart/chartResponsiveLayout.ts +172 -0
- package/node_modules/@fses/workbench-card/src/renderers/chart/dynamicEchartOption.ts +127 -0
- package/node_modules/@fses/workbench-card/src/renderers/chart/echarts-protocol/adapter.ts +1349 -0
- package/node_modules/@fses/workbench-card/src/renderers/chart/echarts-protocol/converters/composite.converter.ts +71 -0
- package/node_modules/@fses/workbench-card/src/renderers/chart/echarts-protocol/converters/configOnly.converter.ts +45 -0
- package/node_modules/@fses/workbench-card/src/renderers/chart/echarts-protocol/converters/geo.converter.ts +97 -0
- package/node_modules/@fses/workbench-card/src/renderers/chart/echarts-protocol/converters/graphic.converter.ts +59 -0
- package/node_modules/@fses/workbench-card/src/renderers/chart/echarts-protocol/converters/layout.converter.ts +53 -0
- package/node_modules/@fses/workbench-card/src/renderers/chart/echarts-protocol/converters/network.converter.ts +82 -0
- package/node_modules/@fses/workbench-card/src/renderers/chart/echarts-protocol/converters/scene3D.converter.ts +73 -0
- package/node_modules/@fses/workbench-card/src/renderers/chart/echarts-protocol/converters/series.converter.ts +795 -0
- package/node_modules/@fses/workbench-card/src/renderers/chart/echarts-protocol/converters/table.converter.ts +195 -0
- package/node_modules/@fses/workbench-card/src/renderers/chart/echarts-protocol/converters/timeline.converter.ts +62 -0
- package/node_modules/@fses/workbench-card/src/renderers/chart/echarts-protocol/converters/transition.converter.ts +58 -0
- package/node_modules/@fses/workbench-card/src/renderers/chart/echarts-protocol/converters/tree.converter.ts +75 -0
- package/node_modules/@fses/workbench-card/src/renderers/chart/echarts-protocol/converters/tuple.converter.ts +112 -0
- package/node_modules/@fses/workbench-card/src/renderers/chart/echarts-protocol/index.ts +10 -0
- package/node_modules/@fses/workbench-card/src/renderers/chart/echarts-protocol/merger.ts +109 -0
- package/node_modules/@fses/workbench-card/src/renderers/chart/echarts-protocol/types.ts +515 -0
- package/node_modules/@fses/workbench-card/src/renderers/chart/echartsRuntimeInteractions.ts +450 -0
- package/node_modules/@fses/workbench-card/src/renderers/chart/echartsTitle.ts +94 -0
- package/node_modules/@fses/workbench-card/src/renderers/chart/echartsTooltipPortal.ts +140 -0
- package/node_modules/@fses/workbench-card/src/renderers/chart/types.ts +53 -0
- package/node_modules/@fses/workbench-card/src/renderers/chart/useEchart.ts +1820 -0
- package/node_modules/@fses/workbench-card/src/renderers/chart/workbenchChartTheme.ts +240 -0
- package/node_modules/@fses/workbench-card/src/renderers/custom-canvas/canvasLayoutBindings.ts +660 -0
- package/node_modules/@fses/workbench-card/src/renderers/hostBridge.ts +74 -0
- package/node_modules/@fses/workbench-card/src/renderers/index.ts +25 -0
- package/node_modules/@fses/workbench-card/src/renderers/native/nativeBindings.ts +1096 -0
- package/node_modules/@fses/workbench-card/src/renderers/nested/nestedBlockBindings.ts +1349 -0
- package/node_modules/@fses/workbench-card/src/renderers/quickLinkDisplay.ts +53 -0
- package/node_modules/@fses/workbench-card/src/renderers/reference-composite/referenceCompositeBindings.ts +3209 -0
- package/node_modules/@fses/workbench-card/src/renderers/reference-composite/referenceRiskAndStrategyBindings.ts +1004 -0
- package/node_modules/@fses/workbench-card/src/renderers/resizableTable.ts +136 -0
- package/node_modules/@fses/workbench-card/src/renderers/tableDisplay.ts +140 -0
- package/node_modules/@fses/workbench-card/src/renderers/useWorkbenchBlockRendererBindings.ts +3192 -0
- package/node_modules/@fses/workbench-card/src/shell/workbenchVisualShell.ts +228 -0
- package/node_modules/@fses/workbench-card/src/styles/workbench-card.css +343 -0
- package/node_modules/@fses/workbench-card/src/types/block.ts +2496 -0
- package/node_modules/@fses/workbench-card/src/types/canvas.ts +30 -0
- package/node_modules/@fses/workbench-card/src/types/echartsProtocol.ts +513 -0
- package/node_modules/@fses/workbench-card/src/types/index.ts +10 -0
- package/node_modules/@fses/workbench-card/src/types/registry.ts +17 -0
- package/node_modules/@fses/workbench-card/src/types/runtime.ts +31 -0
- package/node_modules/dompurify/LICENSE +568 -0
- package/node_modules/dompurify/README.md +523 -0
- package/node_modules/dompurify/dist/purify.cjs.d.ts +451 -0
- package/node_modules/dompurify/dist/purify.cjs.js +1472 -0
- package/node_modules/dompurify/dist/purify.cjs.js.map +1 -0
- package/node_modules/dompurify/dist/purify.es.d.mts +448 -0
- package/node_modules/dompurify/dist/purify.es.mjs +1470 -0
- package/node_modules/dompurify/dist/purify.es.mjs.map +1 -0
- package/node_modules/dompurify/dist/purify.js +1478 -0
- package/node_modules/dompurify/dist/purify.js.map +1 -0
- package/node_modules/dompurify/dist/purify.min.js +3 -0
- package/node_modules/dompurify/dist/purify.min.js.map +1 -0
- package/node_modules/dompurify/package.json +168 -0
- package/node_modules/zod/LICENSE +21 -0
- package/node_modules/zod/README.md +208 -0
- package/node_modules/zod/index.cjs +33 -0
- package/node_modules/zod/index.d.cts +4 -0
- package/node_modules/zod/index.d.ts +4 -0
- package/node_modules/zod/index.js +4 -0
- package/node_modules/zod/package.json +118 -0
- package/node_modules/zod/src/index.ts +4 -0
- package/node_modules/zod/src/v3/ZodError.ts +330 -0
- package/node_modules/zod/src/v3/benchmarks/datetime.ts +58 -0
- package/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +80 -0
- package/node_modules/zod/src/v3/benchmarks/index.ts +59 -0
- package/node_modules/zod/src/v3/benchmarks/ipv4.ts +57 -0
- package/node_modules/zod/src/v3/benchmarks/object.ts +69 -0
- package/node_modules/zod/src/v3/benchmarks/primitives.ts +162 -0
- package/node_modules/zod/src/v3/benchmarks/realworld.ts +63 -0
- package/node_modules/zod/src/v3/benchmarks/string.ts +55 -0
- package/node_modules/zod/src/v3/benchmarks/union.ts +80 -0
- package/node_modules/zod/src/v3/errors.ts +13 -0
- package/node_modules/zod/src/v3/external.ts +6 -0
- package/node_modules/zod/src/v3/helpers/enumUtil.ts +17 -0
- package/node_modules/zod/src/v3/helpers/errorUtil.ts +8 -0
- package/node_modules/zod/src/v3/helpers/parseUtil.ts +176 -0
- package/node_modules/zod/src/v3/helpers/partialUtil.ts +34 -0
- package/node_modules/zod/src/v3/helpers/typeAliases.ts +2 -0
- package/node_modules/zod/src/v3/helpers/util.ts +224 -0
- package/node_modules/zod/src/v3/index.ts +4 -0
- package/node_modules/zod/src/v3/locales/en.ts +124 -0
- package/node_modules/zod/src/v3/standard-schema.ts +113 -0
- package/node_modules/zod/src/v3/tests/Mocker.ts +54 -0
- package/node_modules/zod/src/v3/tests/all-errors.test.ts +157 -0
- package/node_modules/zod/src/v3/tests/anyunknown.test.ts +28 -0
- package/node_modules/zod/src/v3/tests/array.test.ts +71 -0
- package/node_modules/zod/src/v3/tests/async-parsing.test.ts +388 -0
- package/node_modules/zod/src/v3/tests/async-refinements.test.ts +46 -0
- package/node_modules/zod/src/v3/tests/base.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/bigint.test.ts +55 -0
- package/node_modules/zod/src/v3/tests/branded.test.ts +53 -0
- package/node_modules/zod/src/v3/tests/catch.test.ts +220 -0
- package/node_modules/zod/src/v3/tests/coerce.test.ts +133 -0
- package/node_modules/zod/src/v3/tests/complex.test.ts +56 -0
- package/node_modules/zod/src/v3/tests/custom.test.ts +31 -0
- package/node_modules/zod/src/v3/tests/date.test.ts +32 -0
- package/node_modules/zod/src/v3/tests/deepmasking.test.ts +186 -0
- package/node_modules/zod/src/v3/tests/default.test.ts +112 -0
- package/node_modules/zod/src/v3/tests/description.test.ts +33 -0
- package/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +315 -0
- package/node_modules/zod/src/v3/tests/enum.test.ts +80 -0
- package/node_modules/zod/src/v3/tests/error.test.ts +551 -0
- package/node_modules/zod/src/v3/tests/firstparty.test.ts +87 -0
- package/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +21 -0
- package/node_modules/zod/src/v3/tests/function.test.ts +257 -0
- package/node_modules/zod/src/v3/tests/generics.test.ts +48 -0
- package/node_modules/zod/src/v3/tests/instanceof.test.ts +37 -0
- package/node_modules/zod/src/v3/tests/intersection.test.ts +110 -0
- package/node_modules/zod/src/v3/tests/language-server.source.ts +76 -0
- package/node_modules/zod/src/v3/tests/language-server.test.ts +207 -0
- package/node_modules/zod/src/v3/tests/literal.test.ts +36 -0
- package/node_modules/zod/src/v3/tests/map.test.ts +110 -0
- package/node_modules/zod/src/v3/tests/masking.test.ts +4 -0
- package/node_modules/zod/src/v3/tests/mocker.test.ts +19 -0
- package/node_modules/zod/src/v3/tests/nan.test.ts +21 -0
- package/node_modules/zod/src/v3/tests/nativeEnum.test.ts +87 -0
- package/node_modules/zod/src/v3/tests/nullable.test.ts +42 -0
- package/node_modules/zod/src/v3/tests/number.test.ts +176 -0
- package/node_modules/zod/src/v3/tests/object-augmentation.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/object.test.ts +434 -0
- package/node_modules/zod/src/v3/tests/optional.test.ts +42 -0
- package/node_modules/zod/src/v3/tests/parseUtil.test.ts +23 -0
- package/node_modules/zod/src/v3/tests/parser.test.ts +41 -0
- package/node_modules/zod/src/v3/tests/partials.test.ts +243 -0
- package/node_modules/zod/src/v3/tests/pickomit.test.ts +111 -0
- package/node_modules/zod/src/v3/tests/pipeline.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/preprocess.test.ts +186 -0
- package/node_modules/zod/src/v3/tests/primitive.test.ts +440 -0
- package/node_modules/zod/src/v3/tests/promise.test.ts +90 -0
- package/node_modules/zod/src/v3/tests/readonly.test.ts +194 -0
- package/node_modules/zod/src/v3/tests/record.test.ts +171 -0
- package/node_modules/zod/src/v3/tests/recursive.test.ts +197 -0
- package/node_modules/zod/src/v3/tests/refine.test.ts +313 -0
- package/node_modules/zod/src/v3/tests/safeparse.test.ts +27 -0
- package/node_modules/zod/src/v3/tests/set.test.ts +142 -0
- package/node_modules/zod/src/v3/tests/standard-schema.test.ts +83 -0
- package/node_modules/zod/src/v3/tests/string.test.ts +916 -0
- package/node_modules/zod/src/v3/tests/transformer.test.ts +233 -0
- package/node_modules/zod/src/v3/tests/tuple.test.ts +90 -0
- package/node_modules/zod/src/v3/tests/unions.test.ts +57 -0
- package/node_modules/zod/src/v3/tests/validations.test.ts +133 -0
- package/node_modules/zod/src/v3/tests/void.test.ts +15 -0
- package/node_modules/zod/src/v3/types.ts +5136 -0
- package/node_modules/zod/src/v4/classic/checks.ts +30 -0
- package/node_modules/zod/src/v4/classic/coerce.ts +27 -0
- package/node_modules/zod/src/v4/classic/compat.ts +66 -0
- package/node_modules/zod/src/v4/classic/errors.ts +75 -0
- package/node_modules/zod/src/v4/classic/external.ts +50 -0
- package/node_modules/zod/src/v4/classic/index.ts +5 -0
- package/node_modules/zod/src/v4/classic/iso.ts +90 -0
- package/node_modules/zod/src/v4/classic/parse.ts +33 -0
- package/node_modules/zod/src/v4/classic/schemas.ts +2054 -0
- package/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +26 -0
- package/node_modules/zod/src/v4/classic/tests/array.test.ts +264 -0
- package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +210 -0
- package/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +381 -0
- package/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +68 -0
- package/node_modules/zod/src/v4/classic/tests/base.test.ts +7 -0
- package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +54 -0
- package/node_modules/zod/src/v4/classic/tests/brand.test.ts +63 -0
- package/node_modules/zod/src/v4/classic/tests/catch.test.ts +252 -0
- package/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +20 -0
- package/node_modules/zod/src/v4/classic/tests/coerce.test.ts +160 -0
- package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +352 -0
- package/node_modules/zod/src/v4/classic/tests/custom.test.ts +40 -0
- package/node_modules/zod/src/v4/classic/tests/date.test.ts +31 -0
- package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +296 -0
- package/node_modules/zod/src/v4/classic/tests/default.test.ts +313 -0
- package/node_modules/zod/src/v4/classic/tests/description.test.ts +32 -0
- package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +619 -0
- package/node_modules/zod/src/v4/classic/tests/enum.test.ts +285 -0
- package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +527 -0
- package/node_modules/zod/src/v4/classic/tests/error.test.ts +711 -0
- package/node_modules/zod/src/v4/classic/tests/file.test.ts +91 -0
- package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +175 -0
- package/node_modules/zod/src/v4/classic/tests/function.test.ts +268 -0
- package/node_modules/zod/src/v4/classic/tests/generics.test.ts +72 -0
- package/node_modules/zod/src/v4/classic/tests/index.test.ts +829 -0
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +34 -0
- package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +171 -0
- package/node_modules/zod/src/v4/classic/tests/json.test.ts +108 -0
- package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +227 -0
- package/node_modules/zod/src/v4/classic/tests/literal.test.ts +92 -0
- package/node_modules/zod/src/v4/classic/tests/map.test.ts +196 -0
- package/node_modules/zod/src/v4/classic/tests/nan.test.ts +21 -0
- package/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +168 -0
- package/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +86 -0
- package/node_modules/zod/src/v4/classic/tests/nullable.test.ts +22 -0
- package/node_modules/zod/src/v4/classic/tests/number.test.ts +247 -0
- package/node_modules/zod/src/v4/classic/tests/object.test.ts +563 -0
- package/node_modules/zod/src/v4/classic/tests/optional.test.ts +123 -0
- package/node_modules/zod/src/v4/classic/tests/partial.test.ts +147 -0
- package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +127 -0
- package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +81 -0
- package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +37 -0
- package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +298 -0
- package/node_modules/zod/src/v4/classic/tests/primitive.test.ts +175 -0
- package/node_modules/zod/src/v4/classic/tests/promise.test.ts +81 -0
- package/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +23 -0
- package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +252 -0
- package/node_modules/zod/src/v4/classic/tests/record.test.ts +342 -0
- package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +356 -0
- package/node_modules/zod/src/v4/classic/tests/refine.test.ts +532 -0
- package/node_modules/zod/src/v4/classic/tests/registries.test.ts +204 -0
- package/node_modules/zod/src/v4/classic/tests/set.test.ts +179 -0
- package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +57 -0
- package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +109 -0
- package/node_modules/zod/src/v4/classic/tests/string.test.ts +881 -0
- package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +66 -0
- package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +758 -0
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +2314 -0
- package/node_modules/zod/src/v4/classic/tests/transform.test.ts +250 -0
- package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +163 -0
- package/node_modules/zod/src/v4/classic/tests/union.test.ts +94 -0
- package/node_modules/zod/src/v4/classic/tests/validations.test.ts +283 -0
- package/node_modules/zod/src/v4/classic/tests/void.test.ts +12 -0
- package/node_modules/zod/src/v4/core/api.ts +1594 -0
- package/node_modules/zod/src/v4/core/checks.ts +1283 -0
- package/node_modules/zod/src/v4/core/config.ts +15 -0
- package/node_modules/zod/src/v4/core/core.ts +134 -0
- package/node_modules/zod/src/v4/core/doc.ts +44 -0
- package/node_modules/zod/src/v4/core/errors.ts +424 -0
- package/node_modules/zod/src/v4/core/function.ts +176 -0
- package/node_modules/zod/src/v4/core/index.ts +15 -0
- package/node_modules/zod/src/v4/core/json-schema.ts +143 -0
- package/node_modules/zod/src/v4/core/parse.ts +94 -0
- package/node_modules/zod/src/v4/core/regexes.ts +135 -0
- package/node_modules/zod/src/v4/core/registries.ts +96 -0
- package/node_modules/zod/src/v4/core/schemas.ts +3842 -0
- package/node_modules/zod/src/v4/core/standard-schema.ts +64 -0
- package/node_modules/zod/src/v4/core/tests/index.test.ts +46 -0
- package/node_modules/zod/src/v4/core/tests/locales/be.test.ts +124 -0
- package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +22 -0
- package/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +128 -0
- package/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +69 -0
- package/node_modules/zod/src/v4/core/to-json-schema.ts +977 -0
- package/node_modules/zod/src/v4/core/util.ts +775 -0
- package/node_modules/zod/src/v4/core/versions.ts +5 -0
- package/node_modules/zod/src/v4/core/zsf.ts +323 -0
- package/node_modules/zod/src/v4/index.ts +4 -0
- package/node_modules/zod/src/v4/locales/ar.ts +125 -0
- package/node_modules/zod/src/v4/locales/az.ts +121 -0
- package/node_modules/zod/src/v4/locales/be.ts +184 -0
- package/node_modules/zod/src/v4/locales/ca.ts +127 -0
- package/node_modules/zod/src/v4/locales/cs.ts +142 -0
- package/node_modules/zod/src/v4/locales/de.ts +124 -0
- package/node_modules/zod/src/v4/locales/en.ts +127 -0
- package/node_modules/zod/src/v4/locales/eo.ts +125 -0
- package/node_modules/zod/src/v4/locales/es.ts +125 -0
- package/node_modules/zod/src/v4/locales/fa.ts +134 -0
- package/node_modules/zod/src/v4/locales/fi.ts +131 -0
- package/node_modules/zod/src/v4/locales/fr-CA.ts +126 -0
- package/node_modules/zod/src/v4/locales/fr.ts +124 -0
- package/node_modules/zod/src/v4/locales/he.ts +125 -0
- package/node_modules/zod/src/v4/locales/hu.ts +126 -0
- package/node_modules/zod/src/v4/locales/id.ts +125 -0
- package/node_modules/zod/src/v4/locales/index.ts +39 -0
- package/node_modules/zod/src/v4/locales/it.ts +125 -0
- package/node_modules/zod/src/v4/locales/ja.ts +122 -0
- package/node_modules/zod/src/v4/locales/kh.ts +126 -0
- package/node_modules/zod/src/v4/locales/ko.ts +131 -0
- package/node_modules/zod/src/v4/locales/mk.ts +127 -0
- package/node_modules/zod/src/v4/locales/ms.ts +124 -0
- package/node_modules/zod/src/v4/locales/nl.ts +126 -0
- package/node_modules/zod/src/v4/locales/no.ts +124 -0
- package/node_modules/zod/src/v4/locales/ota.ts +125 -0
- package/node_modules/zod/src/v4/locales/pl.ts +126 -0
- package/node_modules/zod/src/v4/locales/ps.ts +133 -0
- package/node_modules/zod/src/v4/locales/pt.ts +123 -0
- package/node_modules/zod/src/v4/locales/ru.ts +184 -0
- package/node_modules/zod/src/v4/locales/sl.ts +126 -0
- package/node_modules/zod/src/v4/locales/sv.ts +127 -0
- package/node_modules/zod/src/v4/locales/ta.ts +125 -0
- package/node_modules/zod/src/v4/locales/th.ts +126 -0
- package/node_modules/zod/src/v4/locales/tr.ts +121 -0
- package/node_modules/zod/src/v4/locales/ua.ts +126 -0
- package/node_modules/zod/src/v4/locales/ur.ts +126 -0
- package/node_modules/zod/src/v4/locales/vi.ts +125 -0
- package/node_modules/zod/src/v4/locales/zh-CN.ts +123 -0
- package/node_modules/zod/src/v4/locales/zh-TW.ts +125 -0
- package/node_modules/zod/src/v4/mini/checks.ts +32 -0
- package/node_modules/zod/src/v4/mini/coerce.ts +22 -0
- package/node_modules/zod/src/v4/mini/external.ts +40 -0
- package/node_modules/zod/src/v4/mini/index.ts +3 -0
- package/node_modules/zod/src/v4/mini/iso.ts +62 -0
- package/node_modules/zod/src/v4/mini/parse.ts +1 -0
- package/node_modules/zod/src/v4/mini/schemas.ts +1579 -0
- package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +129 -0
- package/node_modules/zod/src/v4/mini/tests/brand.test.ts +51 -0
- package/node_modules/zod/src/v4/mini/tests/checks.test.ts +144 -0
- package/node_modules/zod/src/v4/mini/tests/computed.test.ts +36 -0
- package/node_modules/zod/src/v4/mini/tests/error.test.ts +22 -0
- package/node_modules/zod/src/v4/mini/tests/functions.test.ts +43 -0
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +871 -0
- package/node_modules/zod/src/v4/mini/tests/number.test.ts +95 -0
- package/node_modules/zod/src/v4/mini/tests/object.test.ts +185 -0
- package/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +43 -0
- package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +275 -0
- package/node_modules/zod/src/v4/mini/tests/string.test.ts +299 -0
- package/node_modules/zod/src/v4-mini/index.ts +1 -0
- package/node_modules/zod/v3/ZodError.cjs +138 -0
- package/node_modules/zod/v3/ZodError.d.cts +164 -0
- package/node_modules/zod/v3/ZodError.d.ts +164 -0
- package/node_modules/zod/v3/ZodError.js +133 -0
- package/node_modules/zod/v3/errors.cjs +17 -0
- package/node_modules/zod/v3/errors.d.cts +5 -0
- package/node_modules/zod/v3/errors.d.ts +5 -0
- package/node_modules/zod/v3/errors.js +9 -0
- package/node_modules/zod/v3/external.cjs +22 -0
- package/node_modules/zod/v3/external.d.cts +6 -0
- package/node_modules/zod/v3/external.d.ts +6 -0
- package/node_modules/zod/v3/external.js +6 -0
- package/node_modules/zod/v3/helpers/enumUtil.cjs +2 -0
- package/node_modules/zod/v3/helpers/enumUtil.d.cts +8 -0
- package/node_modules/zod/v3/helpers/enumUtil.d.ts +8 -0
- package/node_modules/zod/v3/helpers/enumUtil.js +1 -0
- package/node_modules/zod/v3/helpers/errorUtil.cjs +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.d.cts +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.d.ts +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.js +6 -0
- package/node_modules/zod/v3/helpers/parseUtil.cjs +124 -0
- package/node_modules/zod/v3/helpers/parseUtil.d.cts +78 -0
- package/node_modules/zod/v3/helpers/parseUtil.d.ts +78 -0
- package/node_modules/zod/v3/helpers/parseUtil.js +109 -0
- package/node_modules/zod/v3/helpers/partialUtil.cjs +2 -0
- package/node_modules/zod/v3/helpers/partialUtil.d.cts +8 -0
- package/node_modules/zod/v3/helpers/partialUtil.d.ts +8 -0
- package/node_modules/zod/v3/helpers/partialUtil.js +1 -0
- package/node_modules/zod/v3/helpers/typeAliases.cjs +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.d.cts +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.d.ts +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.js +1 -0
- package/node_modules/zod/v3/helpers/util.cjs +137 -0
- package/node_modules/zod/v3/helpers/util.d.cts +85 -0
- package/node_modules/zod/v3/helpers/util.d.ts +85 -0
- package/node_modules/zod/v3/helpers/util.js +133 -0
- package/node_modules/zod/v3/index.cjs +33 -0
- package/node_modules/zod/v3/index.d.cts +4 -0
- package/node_modules/zod/v3/index.d.ts +4 -0
- package/node_modules/zod/v3/index.js +4 -0
- package/node_modules/zod/v3/locales/en.cjs +111 -0
- package/node_modules/zod/v3/locales/en.d.cts +3 -0
- package/node_modules/zod/v3/locales/en.d.ts +3 -0
- package/node_modules/zod/v3/locales/en.js +109 -0
- package/node_modules/zod/v3/standard-schema.cjs +2 -0
- package/node_modules/zod/v3/standard-schema.d.cts +102 -0
- package/node_modules/zod/v3/standard-schema.d.ts +102 -0
- package/node_modules/zod/v3/standard-schema.js +1 -0
- package/node_modules/zod/v3/types.cjs +3775 -0
- package/node_modules/zod/v3/types.d.cts +1031 -0
- package/node_modules/zod/v3/types.d.ts +1031 -0
- package/node_modules/zod/v3/types.js +3693 -0
- package/node_modules/zod/v4/classic/checks.cjs +32 -0
- package/node_modules/zod/v4/classic/checks.d.cts +1 -0
- package/node_modules/zod/v4/classic/checks.d.ts +1 -0
- package/node_modules/zod/v4/classic/checks.js +1 -0
- package/node_modules/zod/v4/classic/coerce.cjs +47 -0
- package/node_modules/zod/v4/classic/coerce.d.cts +17 -0
- package/node_modules/zod/v4/classic/coerce.d.ts +17 -0
- package/node_modules/zod/v4/classic/coerce.js +17 -0
- package/node_modules/zod/v4/classic/compat.cjs +57 -0
- package/node_modules/zod/v4/classic/compat.d.cts +46 -0
- package/node_modules/zod/v4/classic/compat.d.ts +46 -0
- package/node_modules/zod/v4/classic/compat.js +27 -0
- package/node_modules/zod/v4/classic/errors.cjs +67 -0
- package/node_modules/zod/v4/classic/errors.d.cts +30 -0
- package/node_modules/zod/v4/classic/errors.d.ts +30 -0
- package/node_modules/zod/v4/classic/errors.js +41 -0
- package/node_modules/zod/v4/classic/external.cjs +70 -0
- package/node_modules/zod/v4/classic/external.d.cts +13 -0
- package/node_modules/zod/v4/classic/external.d.ts +13 -0
- package/node_modules/zod/v4/classic/external.js +18 -0
- package/node_modules/zod/v4/classic/index.cjs +33 -0
- package/node_modules/zod/v4/classic/index.d.cts +4 -0
- package/node_modules/zod/v4/classic/index.d.ts +4 -0
- package/node_modules/zod/v4/classic/index.js +4 -0
- package/node_modules/zod/v4/classic/iso.cjs +60 -0
- package/node_modules/zod/v4/classic/iso.d.cts +22 -0
- package/node_modules/zod/v4/classic/iso.d.ts +22 -0
- package/node_modules/zod/v4/classic/iso.js +30 -0
- package/node_modules/zod/v4/classic/parse.cjs +32 -0
- package/node_modules/zod/v4/classic/parse.d.cts +23 -0
- package/node_modules/zod/v4/classic/parse.d.ts +23 -0
- package/node_modules/zod/v4/classic/parse.js +6 -0
- package/node_modules/zod/v4/classic/schemas.cjs +1109 -0
- package/node_modules/zod/v4/classic/schemas.d.cts +630 -0
- package/node_modules/zod/v4/classic/schemas.d.ts +630 -0
- package/node_modules/zod/v4/classic/schemas.js +1006 -0
- package/node_modules/zod/v4/core/api.cjs +1039 -0
- package/node_modules/zod/v4/core/api.d.cts +284 -0
- package/node_modules/zod/v4/core/api.d.ts +284 -0
- package/node_modules/zod/v4/core/api.js +906 -0
- package/node_modules/zod/v4/core/checks.cjs +591 -0
- package/node_modules/zod/v4/core/checks.d.cts +278 -0
- package/node_modules/zod/v4/core/checks.d.ts +278 -0
- package/node_modules/zod/v4/core/checks.js +565 -0
- package/node_modules/zod/v4/core/core.cjs +67 -0
- package/node_modules/zod/v4/core/core.d.cts +49 -0
- package/node_modules/zod/v4/core/core.d.ts +49 -0
- package/node_modules/zod/v4/core/core.js +61 -0
- package/node_modules/zod/v4/core/doc.cjs +39 -0
- package/node_modules/zod/v4/core/doc.d.cts +14 -0
- package/node_modules/zod/v4/core/doc.d.ts +14 -0
- package/node_modules/zod/v4/core/doc.js +35 -0
- package/node_modules/zod/v4/core/errors.cjs +226 -0
- package/node_modules/zod/v4/core/errors.d.cts +208 -0
- package/node_modules/zod/v4/core/errors.d.ts +208 -0
- package/node_modules/zod/v4/core/errors.js +195 -0
- package/node_modules/zod/v4/core/function.cjs +102 -0
- package/node_modules/zod/v4/core/function.d.cts +52 -0
- package/node_modules/zod/v4/core/function.d.ts +52 -0
- package/node_modules/zod/v4/core/function.js +75 -0
- package/node_modules/zod/v4/core/index.cjs +44 -0
- package/node_modules/zod/v4/core/index.d.cts +15 -0
- package/node_modules/zod/v4/core/index.d.ts +15 -0
- package/node_modules/zod/v4/core/index.js +15 -0
- package/node_modules/zod/v4/core/json-schema.cjs +2 -0
- package/node_modules/zod/v4/core/json-schema.d.cts +87 -0
- package/node_modules/zod/v4/core/json-schema.d.ts +87 -0
- package/node_modules/zod/v4/core/json-schema.js +1 -0
- package/node_modules/zod/v4/core/parse.cjs +87 -0
- package/node_modules/zod/v4/core/parse.d.cts +25 -0
- package/node_modules/zod/v4/core/parse.d.ts +25 -0
- package/node_modules/zod/v4/core/parse.js +57 -0
- package/node_modules/zod/v4/core/regexes.cjs +103 -0
- package/node_modules/zod/v4/core/regexes.d.cts +62 -0
- package/node_modules/zod/v4/core/regexes.d.ts +62 -0
- package/node_modules/zod/v4/core/regexes.js +95 -0
- package/node_modules/zod/v4/core/registries.cjs +56 -0
- package/node_modules/zod/v4/core/registries.d.cts +35 -0
- package/node_modules/zod/v4/core/registries.d.ts +35 -0
- package/node_modules/zod/v4/core/registries.js +51 -0
- package/node_modules/zod/v4/core/schemas.cjs +1748 -0
- package/node_modules/zod/v4/core/schemas.d.cts +1041 -0
- package/node_modules/zod/v4/core/schemas.d.ts +1041 -0
- package/node_modules/zod/v4/core/schemas.js +1717 -0
- package/node_modules/zod/v4/core/standard-schema.cjs +2 -0
- package/node_modules/zod/v4/core/standard-schema.d.cts +55 -0
- package/node_modules/zod/v4/core/standard-schema.d.ts +55 -0
- package/node_modules/zod/v4/core/standard-schema.js +1 -0
- package/node_modules/zod/v4/core/to-json-schema.cjs +854 -0
- package/node_modules/zod/v4/core/to-json-schema.d.cts +88 -0
- package/node_modules/zod/v4/core/to-json-schema.d.ts +88 -0
- package/node_modules/zod/v4/core/to-json-schema.js +849 -0
- package/node_modules/zod/v4/core/util.cjs +539 -0
- package/node_modules/zod/v4/core/util.d.cts +183 -0
- package/node_modules/zod/v4/core/util.d.ts +183 -0
- package/node_modules/zod/v4/core/util.js +493 -0
- package/node_modules/zod/v4/core/versions.cjs +8 -0
- package/node_modules/zod/v4/core/versions.d.cts +5 -0
- package/node_modules/zod/v4/core/versions.d.ts +5 -0
- package/node_modules/zod/v4/core/versions.js +5 -0
- package/node_modules/zod/v4/index.cjs +22 -0
- package/node_modules/zod/v4/index.d.cts +3 -0
- package/node_modules/zod/v4/index.d.ts +3 -0
- package/node_modules/zod/v4/index.js +3 -0
- package/node_modules/zod/v4/locales/ar.cjs +142 -0
- package/node_modules/zod/v4/locales/ar.d.cts +4 -0
- package/node_modules/zod/v4/locales/ar.d.ts +4 -0
- package/node_modules/zod/v4/locales/ar.js +116 -0
- package/node_modules/zod/v4/locales/az.cjs +141 -0
- package/node_modules/zod/v4/locales/az.d.cts +4 -0
- package/node_modules/zod/v4/locales/az.d.ts +4 -0
- package/node_modules/zod/v4/locales/az.js +115 -0
- package/node_modules/zod/v4/locales/be.cjs +190 -0
- package/node_modules/zod/v4/locales/be.d.cts +4 -0
- package/node_modules/zod/v4/locales/be.d.ts +4 -0
- package/node_modules/zod/v4/locales/be.js +164 -0
- package/node_modules/zod/v4/locales/ca.cjs +144 -0
- package/node_modules/zod/v4/locales/ca.d.cts +4 -0
- package/node_modules/zod/v4/locales/ca.d.ts +4 -0
- package/node_modules/zod/v4/locales/ca.js +118 -0
- package/node_modules/zod/v4/locales/cs.cjs +161 -0
- package/node_modules/zod/v4/locales/cs.d.cts +4 -0
- package/node_modules/zod/v4/locales/cs.d.ts +4 -0
- package/node_modules/zod/v4/locales/cs.js +135 -0
- package/node_modules/zod/v4/locales/de.cjs +142 -0
- package/node_modules/zod/v4/locales/de.d.cts +4 -0
- package/node_modules/zod/v4/locales/de.d.ts +4 -0
- package/node_modules/zod/v4/locales/de.js +116 -0
- package/node_modules/zod/v4/locales/en.cjs +145 -0
- package/node_modules/zod/v4/locales/en.d.cts +5 -0
- package/node_modules/zod/v4/locales/en.d.ts +5 -0
- package/node_modules/zod/v4/locales/en.js +117 -0
- package/node_modules/zod/v4/locales/eo.cjs +144 -0
- package/node_modules/zod/v4/locales/eo.d.cts +5 -0
- package/node_modules/zod/v4/locales/eo.d.ts +5 -0
- package/node_modules/zod/v4/locales/eo.js +116 -0
- package/node_modules/zod/v4/locales/es.cjs +143 -0
- package/node_modules/zod/v4/locales/es.d.cts +4 -0
- package/node_modules/zod/v4/locales/es.d.ts +4 -0
- package/node_modules/zod/v4/locales/es.js +117 -0
- package/node_modules/zod/v4/locales/fa.cjs +148 -0
- package/node_modules/zod/v4/locales/fa.d.cts +4 -0
- package/node_modules/zod/v4/locales/fa.d.ts +4 -0
- package/node_modules/zod/v4/locales/fa.js +122 -0
- package/node_modules/zod/v4/locales/fi.cjs +148 -0
- package/node_modules/zod/v4/locales/fi.d.cts +4 -0
- package/node_modules/zod/v4/locales/fi.d.ts +4 -0
- package/node_modules/zod/v4/locales/fi.js +122 -0
- package/node_modules/zod/v4/locales/fr-CA.cjs +143 -0
- package/node_modules/zod/v4/locales/fr-CA.d.cts +4 -0
- package/node_modules/zod/v4/locales/fr-CA.d.ts +4 -0
- package/node_modules/zod/v4/locales/fr-CA.js +117 -0
- package/node_modules/zod/v4/locales/fr.cjs +142 -0
- package/node_modules/zod/v4/locales/fr.d.cts +4 -0
- package/node_modules/zod/v4/locales/fr.d.ts +4 -0
- package/node_modules/zod/v4/locales/fr.js +116 -0
- package/node_modules/zod/v4/locales/he.cjs +143 -0
- package/node_modules/zod/v4/locales/he.d.cts +4 -0
- package/node_modules/zod/v4/locales/he.d.ts +4 -0
- package/node_modules/zod/v4/locales/he.js +117 -0
- package/node_modules/zod/v4/locales/hu.cjs +143 -0
- package/node_modules/zod/v4/locales/hu.d.cts +4 -0
- package/node_modules/zod/v4/locales/hu.d.ts +4 -0
- package/node_modules/zod/v4/locales/hu.js +117 -0
- package/node_modules/zod/v4/locales/id.cjs +142 -0
- package/node_modules/zod/v4/locales/id.d.cts +4 -0
- package/node_modules/zod/v4/locales/id.d.ts +4 -0
- package/node_modules/zod/v4/locales/id.js +116 -0
- package/node_modules/zod/v4/locales/index.cjs +84 -0
- package/node_modules/zod/v4/locales/index.d.cts +39 -0
- package/node_modules/zod/v4/locales/index.d.ts +39 -0
- package/node_modules/zod/v4/locales/index.js +39 -0
- package/node_modules/zod/v4/locales/it.cjs +143 -0
- package/node_modules/zod/v4/locales/it.d.cts +4 -0
- package/node_modules/zod/v4/locales/it.d.ts +4 -0
- package/node_modules/zod/v4/locales/it.js +117 -0
- package/node_modules/zod/v4/locales/ja.cjs +141 -0
- package/node_modules/zod/v4/locales/ja.d.cts +4 -0
- package/node_modules/zod/v4/locales/ja.d.ts +4 -0
- package/node_modules/zod/v4/locales/ja.js +115 -0
- package/node_modules/zod/v4/locales/kh.cjs +143 -0
- package/node_modules/zod/v4/locales/kh.d.cts +4 -0
- package/node_modules/zod/v4/locales/kh.d.ts +4 -0
- package/node_modules/zod/v4/locales/kh.js +117 -0
- package/node_modules/zod/v4/locales/ko.cjs +147 -0
- package/node_modules/zod/v4/locales/ko.d.cts +4 -0
- package/node_modules/zod/v4/locales/ko.d.ts +4 -0
- package/node_modules/zod/v4/locales/ko.js +121 -0
- package/node_modules/zod/v4/locales/mk.cjs +144 -0
- package/node_modules/zod/v4/locales/mk.d.cts +4 -0
- package/node_modules/zod/v4/locales/mk.d.ts +4 -0
- package/node_modules/zod/v4/locales/mk.js +118 -0
- package/node_modules/zod/v4/locales/ms.cjs +142 -0
- package/node_modules/zod/v4/locales/ms.d.cts +4 -0
- package/node_modules/zod/v4/locales/ms.d.ts +4 -0
- package/node_modules/zod/v4/locales/ms.js +116 -0
- package/node_modules/zod/v4/locales/nl.cjs +143 -0
- package/node_modules/zod/v4/locales/nl.d.cts +4 -0
- package/node_modules/zod/v4/locales/nl.d.ts +4 -0
- package/node_modules/zod/v4/locales/nl.js +117 -0
- package/node_modules/zod/v4/locales/no.cjs +142 -0
- package/node_modules/zod/v4/locales/no.d.cts +4 -0
- package/node_modules/zod/v4/locales/no.d.ts +4 -0
- package/node_modules/zod/v4/locales/no.js +116 -0
- package/node_modules/zod/v4/locales/ota.cjs +143 -0
- package/node_modules/zod/v4/locales/ota.d.cts +4 -0
- package/node_modules/zod/v4/locales/ota.d.ts +4 -0
- package/node_modules/zod/v4/locales/ota.js +117 -0
- package/node_modules/zod/v4/locales/pl.cjs +143 -0
- package/node_modules/zod/v4/locales/pl.d.cts +4 -0
- package/node_modules/zod/v4/locales/pl.d.ts +4 -0
- package/node_modules/zod/v4/locales/pl.js +117 -0
- package/node_modules/zod/v4/locales/ps.cjs +148 -0
- package/node_modules/zod/v4/locales/ps.d.cts +4 -0
- package/node_modules/zod/v4/locales/ps.d.ts +4 -0
- package/node_modules/zod/v4/locales/ps.js +122 -0
- package/node_modules/zod/v4/locales/pt.cjs +142 -0
- package/node_modules/zod/v4/locales/pt.d.cts +4 -0
- package/node_modules/zod/v4/locales/pt.d.ts +4 -0
- package/node_modules/zod/v4/locales/pt.js +116 -0
- package/node_modules/zod/v4/locales/ru.cjs +190 -0
- package/node_modules/zod/v4/locales/ru.d.cts +4 -0
- package/node_modules/zod/v4/locales/ru.d.ts +4 -0
- package/node_modules/zod/v4/locales/ru.js +164 -0
- package/node_modules/zod/v4/locales/sl.cjs +143 -0
- package/node_modules/zod/v4/locales/sl.d.cts +4 -0
- package/node_modules/zod/v4/locales/sl.d.ts +4 -0
- package/node_modules/zod/v4/locales/sl.js +117 -0
- package/node_modules/zod/v4/locales/sv.cjs +144 -0
- package/node_modules/zod/v4/locales/sv.d.cts +4 -0
- package/node_modules/zod/v4/locales/sv.d.ts +4 -0
- package/node_modules/zod/v4/locales/sv.js +118 -0
- package/node_modules/zod/v4/locales/ta.cjs +143 -0
- package/node_modules/zod/v4/locales/ta.d.cts +4 -0
- package/node_modules/zod/v4/locales/ta.d.ts +4 -0
- package/node_modules/zod/v4/locales/ta.js +117 -0
- package/node_modules/zod/v4/locales/th.cjs +143 -0
- package/node_modules/zod/v4/locales/th.d.cts +4 -0
- package/node_modules/zod/v4/locales/th.d.ts +4 -0
- package/node_modules/zod/v4/locales/th.js +117 -0
- package/node_modules/zod/v4/locales/tr.cjs +143 -0
- package/node_modules/zod/v4/locales/tr.d.cts +5 -0
- package/node_modules/zod/v4/locales/tr.d.ts +5 -0
- package/node_modules/zod/v4/locales/tr.js +115 -0
- package/node_modules/zod/v4/locales/ua.cjs +143 -0
- package/node_modules/zod/v4/locales/ua.d.cts +4 -0
- package/node_modules/zod/v4/locales/ua.d.ts +4 -0
- package/node_modules/zod/v4/locales/ua.js +117 -0
- package/node_modules/zod/v4/locales/ur.cjs +143 -0
- package/node_modules/zod/v4/locales/ur.d.cts +4 -0
- package/node_modules/zod/v4/locales/ur.d.ts +4 -0
- package/node_modules/zod/v4/locales/ur.js +117 -0
- package/node_modules/zod/v4/locales/vi.cjs +142 -0
- package/node_modules/zod/v4/locales/vi.d.cts +4 -0
- package/node_modules/zod/v4/locales/vi.d.ts +4 -0
- package/node_modules/zod/v4/locales/vi.js +116 -0
- package/node_modules/zod/v4/locales/zh-CN.cjs +142 -0
- package/node_modules/zod/v4/locales/zh-CN.d.cts +4 -0
- package/node_modules/zod/v4/locales/zh-CN.d.ts +4 -0
- package/node_modules/zod/v4/locales/zh-CN.js +116 -0
- package/node_modules/zod/v4/locales/zh-TW.cjs +143 -0
- package/node_modules/zod/v4/locales/zh-TW.d.cts +4 -0
- package/node_modules/zod/v4/locales/zh-TW.d.ts +4 -0
- package/node_modules/zod/v4/locales/zh-TW.js +117 -0
- package/node_modules/zod/v4/mini/checks.cjs +34 -0
- package/node_modules/zod/v4/mini/checks.d.cts +1 -0
- package/node_modules/zod/v4/mini/checks.d.ts +1 -0
- package/node_modules/zod/v4/mini/checks.js +1 -0
- package/node_modules/zod/v4/mini/coerce.cjs +47 -0
- package/node_modules/zod/v4/mini/coerce.d.cts +7 -0
- package/node_modules/zod/v4/mini/coerce.d.ts +7 -0
- package/node_modules/zod/v4/mini/coerce.js +17 -0
- package/node_modules/zod/v4/mini/external.cjs +62 -0
- package/node_modules/zod/v4/mini/external.d.cts +11 -0
- package/node_modules/zod/v4/mini/external.d.ts +11 -0
- package/node_modules/zod/v4/mini/external.js +13 -0
- package/node_modules/zod/v4/mini/index.cjs +32 -0
- package/node_modules/zod/v4/mini/index.d.cts +3 -0
- package/node_modules/zod/v4/mini/index.d.ts +3 -0
- package/node_modules/zod/v4/mini/index.js +3 -0
- package/node_modules/zod/v4/mini/iso.cjs +60 -0
- package/node_modules/zod/v4/mini/iso.d.cts +22 -0
- package/node_modules/zod/v4/mini/iso.d.ts +22 -0
- package/node_modules/zod/v4/mini/iso.js +30 -0
- package/node_modules/zod/v4/mini/parse.cjs +8 -0
- package/node_modules/zod/v4/mini/parse.d.cts +1 -0
- package/node_modules/zod/v4/mini/parse.d.ts +1 -0
- package/node_modules/zod/v4/mini/parse.js +1 -0
- package/node_modules/zod/v4/mini/schemas.cjs +839 -0
- package/node_modules/zod/v4/mini/schemas.d.cts +356 -0
- package/node_modules/zod/v4/mini/schemas.d.ts +356 -0
- package/node_modules/zod/v4/mini/schemas.js +732 -0
- package/node_modules/zod/v4-mini/index.cjs +17 -0
- package/node_modules/zod/v4-mini/index.d.cts +1 -0
- package/node_modules/zod/v4-mini/index.d.ts +1 -0
- package/node_modules/zod/v4-mini/index.js +1 -0
- package/package.json +99 -104
- package/dist/Workspace-DMye5DU8.js +0 -43113
|
@@ -0,0 +1,1349 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview 嵌套卡片预览绑定 - 提供 customCanvas 子卡片的数据归一化、语义分类和样式 helper。
|
|
3
|
+
* @author seadon
|
|
4
|
+
* @created 2026-05-20
|
|
5
|
+
*/
|
|
6
|
+
import type { CSSProperties } from 'vue';
|
|
7
|
+
import type { CustomCanvasData, CustomCanvasNestedBlock, BlockVisualOptions, WorkbenchBlock } from '../../types';
|
|
8
|
+
import {
|
|
9
|
+
imageTableColumnVisible,
|
|
10
|
+
structuredTableCellText,
|
|
11
|
+
visibleImageTableColumns,
|
|
12
|
+
} from '../tableDisplay';
|
|
13
|
+
|
|
14
|
+
type TextValueHelper = (value: unknown, fallback?: string) => string;
|
|
15
|
+
type NumberValueHelper = (value: unknown, fallback?: number) => number;
|
|
16
|
+
type NestedBlockContext = {
|
|
17
|
+
textValue: TextValueHelper;
|
|
18
|
+
numberValue: NumberValueHelper;
|
|
19
|
+
isRecord: (value: unknown) => value is Record<string, unknown>;
|
|
20
|
+
formatMetricValue: (value: number, format?: string) => string;
|
|
21
|
+
businessGapDiagnosticSummary: (input: { message?: unknown; fallback?: string; diagnostics?: unknown }) => string;
|
|
22
|
+
dataBindingHumanInterventionFromRecord: (value: unknown) => Record<string, unknown> | undefined;
|
|
23
|
+
recordHasImageComposeSource: (value: unknown) => boolean;
|
|
24
|
+
customCanvasGeneratedElement: (element: unknown) => boolean;
|
|
25
|
+
nestedBlockRendererKey: (block: CustomCanvasNestedBlock) => string;
|
|
26
|
+
nestedBlockComposeSource: (block: CustomCanvasNestedBlock) => string;
|
|
27
|
+
nestedBlockSummaryEntry: (key: string, value: unknown) => string;
|
|
28
|
+
visualForScene: (block: WorkbenchBlock, data?: CustomCanvasData) => BlockVisualOptions;
|
|
29
|
+
referenceCompositeLooksLikeChairmanRiskDirectContext: () => (block: WorkbenchBlock, data: CustomCanvasData) => boolean;
|
|
30
|
+
referenceCompositeLooksLikeChairmanRiskContext: () => (block: WorkbenchBlock, data: CustomCanvasData) => boolean;
|
|
31
|
+
referenceOpsTrendItems: () => (data: CustomCanvasData) => Array<Record<string, unknown>>;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const NESTED_BLOCK_INTERNAL_SUMMARY_KEYS = new Set([
|
|
35
|
+
'shape',
|
|
36
|
+
'dataShape',
|
|
37
|
+
'chartType',
|
|
38
|
+
'rendererKey',
|
|
39
|
+
'primaryLabel',
|
|
40
|
+
'primaryFormat',
|
|
41
|
+
'metricFormat',
|
|
42
|
+
'valueFormat',
|
|
43
|
+
'dimensionLabel',
|
|
44
|
+
'source',
|
|
45
|
+
'rawValue',
|
|
46
|
+
'payload',
|
|
47
|
+
'sourceLabel',
|
|
48
|
+
'composeSource',
|
|
49
|
+
'snapshotSource',
|
|
50
|
+
'dataBinding',
|
|
51
|
+
'dataBindingId',
|
|
52
|
+
'dataBindingStatus',
|
|
53
|
+
'dataBindingError',
|
|
54
|
+
'dataBindingHumanIntervention',
|
|
55
|
+
'humanIntervention',
|
|
56
|
+
'queryIntent',
|
|
57
|
+
'refreshApi',
|
|
58
|
+
'items',
|
|
59
|
+
'rows',
|
|
60
|
+
'metrics',
|
|
61
|
+
'secondary',
|
|
62
|
+
'links',
|
|
63
|
+
'alerts',
|
|
64
|
+
'series',
|
|
65
|
+
'categories',
|
|
66
|
+
'columns',
|
|
67
|
+
'elements',
|
|
68
|
+
]);
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Creates helpers for nested customCanvas card previews.
|
|
72
|
+
* @param context - Shared renderer helpers from the main workbench block binding.
|
|
73
|
+
* @returns Nested card helper functions consumed by the block renderer template.
|
|
74
|
+
*/
|
|
75
|
+
export function createNestedBlockBindings(context: NestedBlockContext) {
|
|
76
|
+
const {
|
|
77
|
+
textValue,
|
|
78
|
+
numberValue,
|
|
79
|
+
isRecord,
|
|
80
|
+
formatMetricValue,
|
|
81
|
+
businessGapDiagnosticSummary,
|
|
82
|
+
dataBindingHumanInterventionFromRecord,
|
|
83
|
+
recordHasImageComposeSource,
|
|
84
|
+
customCanvasGeneratedElement,
|
|
85
|
+
nestedBlockRendererKey,
|
|
86
|
+
nestedBlockComposeSource,
|
|
87
|
+
nestedBlockSummaryEntry,
|
|
88
|
+
visualForScene,
|
|
89
|
+
referenceCompositeLooksLikeChairmanRiskDirectContext,
|
|
90
|
+
referenceCompositeLooksLikeChairmanRiskContext,
|
|
91
|
+
referenceOpsTrendItems,
|
|
92
|
+
} = context;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Checks whether a renderer value is an internal image-compose sentinel rather than user-facing data.
|
|
96
|
+
* @param value - Candidate display value.
|
|
97
|
+
* @returns True when the value should be hidden from card previews.
|
|
98
|
+
*/
|
|
99
|
+
function nestedBlockInternalSentinelValue(value: string): boolean {
|
|
100
|
+
return /^KNOWN_IMAGE_/i.test(value) || /^structured_(?:timeout|fallback)$/i.test(value);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function nestedBlockMetricValue(block: CustomCanvasNestedBlock) {
|
|
104
|
+
const data = isRecord(block.data) ? block.data : {};
|
|
105
|
+
const displayValue = textValue(data.displayValue);
|
|
106
|
+
if (displayValue && !nestedBlockInternalSentinelValue(displayValue)) return displayValue;
|
|
107
|
+
if (typeof data.value === 'number') return String(data.value);
|
|
108
|
+
if (typeof data.value === 'string' && !nestedBlockInternalSentinelValue(data.value.trim())) return data.value;
|
|
109
|
+
if (typeof data.primaryValue === 'number' || typeof data.primaryValue === 'string') {
|
|
110
|
+
return typeof data.primaryValue === 'number'
|
|
111
|
+
? formatMetricValue(data.primaryValue, typeof data.primaryFormat === 'string' ? data.primaryFormat : undefined)
|
|
112
|
+
: nestedBlockInternalSentinelValue(data.primaryValue.trim()) ? '--' : data.primaryValue;
|
|
113
|
+
}
|
|
114
|
+
const numericEntry = Object.entries(data).find(([key, value]) => {
|
|
115
|
+
if (NESTED_BLOCK_INTERNAL_SUMMARY_KEYS.has(key) || !imageTableColumnVisible(key)) return false;
|
|
116
|
+
return (typeof value === 'number' || typeof value === 'string') && String(value).trim();
|
|
117
|
+
});
|
|
118
|
+
const candidate = numericEntry ? String(numericEntry[1]).trim() : '';
|
|
119
|
+
return candidate && !nestedBlockInternalSentinelValue(candidate) ? candidate : '--';
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
type NestedBlockVisualKind =
|
|
123
|
+
| 'metric'
|
|
124
|
+
| 'table'
|
|
125
|
+
| 'list'
|
|
126
|
+
| 'chart'
|
|
127
|
+
| 'statusList'
|
|
128
|
+
| 'incidentList'
|
|
129
|
+
| 'resourceBars'
|
|
130
|
+
| 'securityScore'
|
|
131
|
+
| 'simpleList'
|
|
132
|
+
| 'progressList'
|
|
133
|
+
| 'todoGrid'
|
|
134
|
+
| 'quickLinks'
|
|
135
|
+
| 'donut'
|
|
136
|
+
| 'summary';
|
|
137
|
+
|
|
138
|
+
type NestedBlockTone = 'healthy' | 'warning' | 'critical' | 'info' | 'violet' | 'neutral';
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Returns a compact searchable string for choosing a screenshot-like child-card template.
|
|
142
|
+
* @param block - Nested child card preview.
|
|
143
|
+
* @returns Title, kind, capability, and renderer metadata joined for visual classification.
|
|
144
|
+
*/
|
|
145
|
+
function nestedBlockClassifierText(block: CustomCanvasNestedBlock): string {
|
|
146
|
+
const data = isRecord(block.data) ? block.data : {};
|
|
147
|
+
const meta = isRecord(block.meta) ? block.meta : {};
|
|
148
|
+
return [
|
|
149
|
+
block.title,
|
|
150
|
+
block.kind,
|
|
151
|
+
block.visualKind,
|
|
152
|
+
block.capabilityId,
|
|
153
|
+
block.dataShape,
|
|
154
|
+
nestedBlockRendererKey(block),
|
|
155
|
+
textValue(meta.visualKind),
|
|
156
|
+
textValue(data.visualKind),
|
|
157
|
+
textValue(data.variant),
|
|
158
|
+
textValue(data.kind),
|
|
159
|
+
].filter(Boolean).join(' ');
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Reads a declared visual kind from model or registry data when one is available.
|
|
164
|
+
* @param block - Nested child card preview.
|
|
165
|
+
* @returns Specialized visual kind, or an empty string when no supported kind was declared.
|
|
166
|
+
*/
|
|
167
|
+
function nestedBlockDeclaredVisualKind(block: CustomCanvasNestedBlock): NestedBlockVisualKind | '' {
|
|
168
|
+
const data = isRecord(block.data) ? block.data : {};
|
|
169
|
+
const meta = isRecord(block.meta) ? block.meta : {};
|
|
170
|
+
const declaredCandidates = [
|
|
171
|
+
block.visualKind,
|
|
172
|
+
meta.visualKind,
|
|
173
|
+
data.visualKind,
|
|
174
|
+
data.variant,
|
|
175
|
+
data.kind,
|
|
176
|
+
];
|
|
177
|
+
for (const candidate of declaredCandidates) {
|
|
178
|
+
const declared = textValue(candidate);
|
|
179
|
+
if (declared === 'statusList') return 'statusList';
|
|
180
|
+
if (declared === 'incidentList') return 'incidentList';
|
|
181
|
+
if (declared === 'resourceBars') return 'resourceBars';
|
|
182
|
+
if (declared === 'securityScore') return 'securityScore';
|
|
183
|
+
if (declared === 'simpleList' || declared === 'noticeList') return 'simpleList';
|
|
184
|
+
if (declared === 'progressList') return 'progressList';
|
|
185
|
+
if (declared === 'todoGrid' || declared === 'metricTiles') return 'todoGrid';
|
|
186
|
+
if (declared === 'quickLinks') return 'quickLinks';
|
|
187
|
+
if (declared === 'donut') return 'donut';
|
|
188
|
+
if (declared === 'barChart' || declared === 'areaTrend' || declared === 'comboChart') return 'chart';
|
|
189
|
+
}
|
|
190
|
+
return '';
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Chooses the closest reference-style nested card renderer for image-composed child cards.
|
|
195
|
+
* @param block - Nested child card preview.
|
|
196
|
+
* @returns Specialized CIO-like visual kind or the generic preview kind.
|
|
197
|
+
*/
|
|
198
|
+
function nestedBlockVisualKind(block: CustomCanvasNestedBlock): NestedBlockVisualKind {
|
|
199
|
+
const declared = nestedBlockDeclaredVisualKind(block);
|
|
200
|
+
if (declared) return declared;
|
|
201
|
+
const text = nestedBlockClassifierText(block);
|
|
202
|
+
if (block.kind === 'metric' && !declared && !/个人待办|快捷区|metricTiles|todoGrid/i.test(text)) return 'metric';
|
|
203
|
+
if (/安全风险|安全健康|security/i.test(text)) return 'securityScore';
|
|
204
|
+
if (/成本分析|费用分析|预算分析|donut/i.test(text)) return 'donut';
|
|
205
|
+
if (/资源负载|负载监控|CPU|内存|存储|带宽|resource/i.test(text)) return 'resourceBars';
|
|
206
|
+
if (/服务监控|系统监控|系统在线|service/i.test(text)) return 'statusList';
|
|
207
|
+
if (/项目看板|项目进度|重点\s*IT\s*项目|project/i.test(text)) return 'progressList';
|
|
208
|
+
if (/待办|审批|todo/i.test(text)) return 'todoGrid';
|
|
209
|
+
if (/快捷|入口|平台|工单|堡垒|quick/i.test(text)) return 'quickLinks';
|
|
210
|
+
if (/趋势|走势|近七日|七日|trend/i.test(text)) return 'chart';
|
|
211
|
+
if (/故障|告警|红警|事件|incident|alarm/i.test(text)) return 'incidentList';
|
|
212
|
+
if (/合规|审计|敏感|账号|权限|资产运营|成本优化|效能|notice|audit/i.test(text)) return 'simpleList';
|
|
213
|
+
return nestedBlockPreviewKind(block) as NestedBlockVisualKind;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Converts primitive array entries into item records for template rendering.
|
|
218
|
+
* @param value - Candidate array from nested render data.
|
|
219
|
+
* @returns Record items with strings represented as labels.
|
|
220
|
+
*/
|
|
221
|
+
function nestedBlockItemRecords(value: unknown): Array<Record<string, unknown>> {
|
|
222
|
+
if (!Array.isArray(value)) return [];
|
|
223
|
+
return value
|
|
224
|
+
.map((item) => {
|
|
225
|
+
if (isRecord(item)) return item;
|
|
226
|
+
if (typeof item === 'string' || typeof item === 'number') return { label: String(item) };
|
|
227
|
+
return undefined;
|
|
228
|
+
})
|
|
229
|
+
.filter((item): item is Record<string, unknown> => Boolean(item));
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Checks whether a model item carries only placeholder dashes or empty text.
|
|
234
|
+
* @param item - Candidate item record.
|
|
235
|
+
* @returns True when the item should be replaced by a visual fallback.
|
|
236
|
+
*/
|
|
237
|
+
function nestedBlockItemEmpty(item: Record<string, unknown>): boolean {
|
|
238
|
+
const cells = Array.isArray(item.cells) ? item.cells : [];
|
|
239
|
+
const values = [
|
|
240
|
+
item.label,
|
|
241
|
+
item.name,
|
|
242
|
+
item.title,
|
|
243
|
+
item.status,
|
|
244
|
+
item.value,
|
|
245
|
+
item.amount,
|
|
246
|
+
item.detail,
|
|
247
|
+
...cells,
|
|
248
|
+
].map((value) => (value === null || value === undefined ? '' : String(value).trim()));
|
|
249
|
+
return values.length === 0 || values.every((value) => value === '' || value === '--' || value === '-');
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Detects weak model/OCR list items that are less useful than reference-style visual fallbacks.
|
|
254
|
+
* @param item - Candidate item record.
|
|
255
|
+
* @returns True when the item looks like an index-only placeholder.
|
|
256
|
+
*/
|
|
257
|
+
function nestedBlockItemLooksWeak(item: Record<string, unknown>): boolean {
|
|
258
|
+
const label = textValue(item.label, textValue(item.name, textValue(item.title)));
|
|
259
|
+
const value = nestedBlockDisplayValue(item.value ?? item.amount ?? item.status, '');
|
|
260
|
+
const detail = nestedBlockDisplayValue(item.detail ?? item.description, '');
|
|
261
|
+
const cells = Array.isArray(item.cells) ? item.cells.map((cell) => String(cell ?? '').trim()).filter(Boolean) : [];
|
|
262
|
+
const usefulText = [label, value, detail, ...cells].filter(Boolean);
|
|
263
|
+
if (usefulText.length === 0) return true;
|
|
264
|
+
if (usefulText.every((text) => /^(\d+|项目\s*\d+|--|-)$/.test(text))) return true;
|
|
265
|
+
if (/^项目\s*\d+$/.test(label) && (!value || /^\d+$/.test(value)) && !detail) return true;
|
|
266
|
+
if (cells.length > 0 && cells.every((text) => /^(\d+|--|-)$/.test(text))) return true;
|
|
267
|
+
return false;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Checks whether a group of model rows is mostly index placeholders.
|
|
272
|
+
* @param items - Candidate item records.
|
|
273
|
+
* @returns True when the row group should use a visual fallback instead.
|
|
274
|
+
*/
|
|
275
|
+
function nestedBlockItemsLookTooWeak(items: Array<Record<string, unknown>>): boolean {
|
|
276
|
+
if (items.length === 0) return true;
|
|
277
|
+
const weakCount = items.filter((item) => {
|
|
278
|
+
const label = nestedBlockItemLabel(item, 0);
|
|
279
|
+
return nestedBlockItemLooksWeak(item) || /^(\d+|项目\s*\d+|--|-)$/.test(label);
|
|
280
|
+
}).length;
|
|
281
|
+
return weakCount / items.length >= 0.5;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* Checks weak OCR rows with visual-template-specific expectations.
|
|
286
|
+
* @param items - Candidate item records.
|
|
287
|
+
* @param visualKind - Reference visual template that will render the rows.
|
|
288
|
+
* @returns True when the template should use reference fallback rows.
|
|
289
|
+
*/
|
|
290
|
+
function nestedBlockItemsLookTooWeakForVisualKind(items: Array<Record<string, unknown>>, visualKind: NestedBlockVisualKind): boolean {
|
|
291
|
+
if (nestedBlockItemsLookTooWeak(items)) return true;
|
|
292
|
+
if (visualKind === 'progressList') {
|
|
293
|
+
const weakProgressRows = items.filter((item) => {
|
|
294
|
+
const value = nestedBlockItemValue(item);
|
|
295
|
+
return !/%|延期|卡点|完成|达标|延迟|风险|通过|[1-9]\d\s*%/.test(value);
|
|
296
|
+
}).length;
|
|
297
|
+
return weakProgressRows / items.length >= 0.5;
|
|
298
|
+
}
|
|
299
|
+
if (visualKind === 'simpleList') {
|
|
300
|
+
const valueLessRows = items.filter((item) => !nestedBlockItemValue(item)).length;
|
|
301
|
+
return valueLessRows / items.length >= 0.5;
|
|
302
|
+
}
|
|
303
|
+
return false;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* Reads model-provided list-like data from a nested child card.
|
|
308
|
+
* @param block - Nested child card preview.
|
|
309
|
+
* @returns Non-empty item records from items, rows, metrics, links, or alerts.
|
|
310
|
+
*/
|
|
311
|
+
function nestedBlockRawItems(block: CustomCanvasNestedBlock): Array<Record<string, unknown>> {
|
|
312
|
+
const data = isRecord(block.data) ? block.data : {};
|
|
313
|
+
return [
|
|
314
|
+
...nestedBlockItemRecords(data.items),
|
|
315
|
+
...nestedBlockItemRecords(data.rows),
|
|
316
|
+
...nestedBlockItemRecords(data.metrics),
|
|
317
|
+
...nestedBlockItemRecords(data.secondary),
|
|
318
|
+
...nestedBlockItemRecords(data.links),
|
|
319
|
+
...nestedBlockItemRecords(data.alerts),
|
|
320
|
+
].filter((item) => !nestedBlockItemEmpty(item));
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* Reads OCR/customCanvas elements from a nested card and maps them into template-specific rows.
|
|
325
|
+
* @param block - Nested child card preview.
|
|
326
|
+
* @param visualKind - Target visual template.
|
|
327
|
+
* @returns Element-derived rows for status, resource, or incident regions.
|
|
328
|
+
*/
|
|
329
|
+
function nestedBlockElementItems(block: CustomCanvasNestedBlock, visualKind: NestedBlockVisualKind): Array<Record<string, unknown>> {
|
|
330
|
+
const data = isRecord(block.data) ? block.data : {};
|
|
331
|
+
const elements = Array.isArray(data.elements) ? data.elements : [];
|
|
332
|
+
return elements
|
|
333
|
+
.flatMap((element): Array<Record<string, unknown>> => {
|
|
334
|
+
if (!isRecord(element)) return [];
|
|
335
|
+
const kind = textValue(element.kind);
|
|
336
|
+
if (visualKind === 'statusList' && kind === 'statusItem') {
|
|
337
|
+
return [{
|
|
338
|
+
label: textValue(element.label, textValue(element.title)),
|
|
339
|
+
status: textValue(element.status, '正常'),
|
|
340
|
+
tone: nestedBlockToneFromStatus(textValue(element.status)),
|
|
341
|
+
}];
|
|
342
|
+
}
|
|
343
|
+
if (visualKind === 'resourceBars' && kind === 'progress') {
|
|
344
|
+
const label = textValue(element.label, textValue(element.title));
|
|
345
|
+
const value = numberValue(element.value, 0);
|
|
346
|
+
return [{
|
|
347
|
+
label,
|
|
348
|
+
value: `${value}${textValue(element.unit) || '%'}`,
|
|
349
|
+
progress: value,
|
|
350
|
+
tone: nestedBlockToneFromProgress(label, value),
|
|
351
|
+
}];
|
|
352
|
+
}
|
|
353
|
+
if (visualKind === 'incidentList' && /alert|incident|warning|event/i.test(kind)) {
|
|
354
|
+
return [{
|
|
355
|
+
title: textValue(element.title, textValue(element.label)),
|
|
356
|
+
detail: textValue(element.detail, textValue(element.description)),
|
|
357
|
+
severity: textValue(element.severity, textValue(element.level, 'P1')),
|
|
358
|
+
time: textValue(element.time, textValue(element.meta)),
|
|
359
|
+
tone: nestedBlockToneFromStatus(textValue(element.severity, textValue(element.level))),
|
|
360
|
+
}];
|
|
361
|
+
}
|
|
362
|
+
return [];
|
|
363
|
+
})
|
|
364
|
+
.filter((item) => !nestedBlockItemEmpty(item));
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
/**
|
|
368
|
+
* Maps status-like OCR text to the nested preview tone system.
|
|
369
|
+
* @param status - Status, severity, or level text.
|
|
370
|
+
* @returns Tone key used by dots, pills, and bars.
|
|
371
|
+
*/
|
|
372
|
+
function nestedBlockToneFromStatus(status: string): NestedBlockTone {
|
|
373
|
+
if (/P1|告警|异常|失败|高危|超权|critical|error/i.test(status)) return 'critical';
|
|
374
|
+
if (/P2|卡顿|延期|中风险|弱口令|warning/i.test(status)) return 'warning';
|
|
375
|
+
if (/正常|通过|已归档|达标|完成|healthy|success/i.test(status)) return 'healthy';
|
|
376
|
+
return 'neutral';
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* Maps resource utilization values to compact bar tones.
|
|
381
|
+
* @param label - Resource label from OCR.
|
|
382
|
+
* @param value - Utilization percentage.
|
|
383
|
+
* @returns Tone key for resource bars.
|
|
384
|
+
*/
|
|
385
|
+
function nestedBlockToneFromProgress(label: string, value: number): NestedBlockTone {
|
|
386
|
+
if (/存储|storage/i.test(label) || value >= 80) return 'warning';
|
|
387
|
+
if (/CPU|内存|memory/i.test(label) || value >= 65) return 'info';
|
|
388
|
+
return 'healthy';
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
type NestedBlockFallbackDomain = 'hr' | 'it' | 'marketing' | 'risk' | 'business';
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* Checks whether text contains IT/CIO-specific terms instead of generic business words.
|
|
395
|
+
* @param text - Searchable parent and child text.
|
|
396
|
+
* @returns True when fixed CIO templates are safe to apply.
|
|
397
|
+
*/
|
|
398
|
+
function referenceCompositeTextHasItContext(text: string): boolean {
|
|
399
|
+
return /\b(CIO|IT)\b|信息化中心|IT\s*年度|IT\s*项目|IT\s*采购|IT\s*成本|IT\s*资产|系统上线审批|权限变更审批|安全整改待办|运维|研发|基础设施|服务监控|资源负载|机房|服务器|云主机|终端|License|软件|硬件|账号|权限|漏洞|攻击|网络安全|信息安全|安全事件|等保|堡垒机|服务工单|数据库|接口|中台|ERP|MES|WMS|SCM|CRM|ops|infrastructure|software|system|cyber|service desk/i.test(text);
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* Chooses the business domain for screenshot-only fallback rows.
|
|
404
|
+
* @param text - Searchable nested-card classifier text.
|
|
405
|
+
* @returns Domain used to avoid leaking IT sample copy into HR or business dashboards.
|
|
406
|
+
*/
|
|
407
|
+
function nestedBlockFallbackDomain(text: string): NestedBlockFallbackDomain {
|
|
408
|
+
if (/人力|人事|人才|用工|社保|合同|考勤|加班|迟到|旷工|请假|薪酬|绩效|招聘|员工|组织|编制|司龄|任免|继任|培训|持证|人效|HR/i.test(text)) return 'hr';
|
|
409
|
+
if (referenceCompositeTextHasItContext(text)) return 'it';
|
|
410
|
+
if (/风险|预警|偏差|盈利|资金|应收|预算|担保|投资|项目|隐患|超支|下滑|红线|亏损|违规|董事长|经营健康|risk/i.test(text)) return 'risk';
|
|
411
|
+
if (/营销|销售|客户|渠道|投放|线索|转化|竞品|品牌|舆情|活动|ROI|CAC/i.test(text)) return 'marketing';
|
|
412
|
+
return 'business';
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
/**
|
|
416
|
+
* Expands generic HR child titles with parent-scene context before selecting fallback rows.
|
|
417
|
+
* @param block - Nested child card preview.
|
|
418
|
+
* @returns Searchable text with HR context added for generic titles such as 快捷入口.
|
|
419
|
+
*/
|
|
420
|
+
function nestedBlockFallbackClassifierText(block: CustomCanvasNestedBlock): string {
|
|
421
|
+
const text = nestedBlockClassifierText(block);
|
|
422
|
+
if (/快捷|入口|待办|排行|梯队/.test(text)) return `${text} 人力 人事 人才 绩效 招聘 员工`;
|
|
423
|
+
return text;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
/**
|
|
427
|
+
* Provides screenshot-reference fallback rows when the image model only returned a coarse child card.
|
|
428
|
+
* @param block - Nested child card preview.
|
|
429
|
+
* @param visualKind - Selected visual template.
|
|
430
|
+
* @returns Fallback item rows used only for screenshot preview fidelity.
|
|
431
|
+
*/
|
|
432
|
+
function nestedBlockFallbackItems(block: CustomCanvasNestedBlock, visualKind: NestedBlockVisualKind): Array<Record<string, unknown>> {
|
|
433
|
+
const text = nestedBlockFallbackClassifierText(block);
|
|
434
|
+
const domain = nestedBlockFallbackDomain(text);
|
|
435
|
+
if (visualKind === 'statusList') {
|
|
436
|
+
if (domain === 'hr') {
|
|
437
|
+
return [
|
|
438
|
+
{ label: '组织编制', status: '关注', tone: 'warning' },
|
|
439
|
+
{ label: '员工档案', status: '正常', tone: 'healthy' },
|
|
440
|
+
{ label: '考勤同步', status: '正常', tone: 'healthy' },
|
|
441
|
+
{ label: '薪酬批次', status: '待复核', tone: 'warning' },
|
|
442
|
+
{ label: '用工合规', status: '告警', tone: 'critical' },
|
|
443
|
+
];
|
|
444
|
+
}
|
|
445
|
+
return [
|
|
446
|
+
{ label: 'ERP 核心套件', status: '正常', tone: 'healthy' },
|
|
447
|
+
{ label: 'OA 协同门户', status: '正常', tone: 'healthy' },
|
|
448
|
+
{ label: 'MES 生产执行', status: '卡顿', tone: 'warning' },
|
|
449
|
+
{ label: 'CRM 客户平台', status: '正常', tone: 'healthy' },
|
|
450
|
+
{ label: '财务共享系统', status: '告警', tone: 'critical' },
|
|
451
|
+
];
|
|
452
|
+
}
|
|
453
|
+
if (visualKind === 'resourceBars') {
|
|
454
|
+
if (domain === 'hr') {
|
|
455
|
+
return [
|
|
456
|
+
{ label: '研发', value: 97, tone: 'healthy' },
|
|
457
|
+
{ label: '制造', value: 112, tone: 'critical' },
|
|
458
|
+
{ label: '营销', value: 88, tone: 'warning' },
|
|
459
|
+
{ label: '运营', value: 101, tone: 'healthy' },
|
|
460
|
+
];
|
|
461
|
+
}
|
|
462
|
+
return [
|
|
463
|
+
{ label: 'CPU', value: 68, tone: 'info' },
|
|
464
|
+
{ label: '内存', value: 74, tone: 'info' },
|
|
465
|
+
{ label: '存储', value: 84, tone: 'warning' },
|
|
466
|
+
{ label: '带宽', value: 51, tone: 'healthy' },
|
|
467
|
+
];
|
|
468
|
+
}
|
|
469
|
+
if (visualKind === 'incidentList') {
|
|
470
|
+
if (domain === 'hr') {
|
|
471
|
+
return [
|
|
472
|
+
{ severity: '红', title: '合同 30 天内到期', detail: '重点岗位需续签确认', time: '今日', tone: 'critical' },
|
|
473
|
+
{ severity: '红', title: '社保断缴 / 基数异常', detail: '跨区派遣与外包集中预警', time: '本周', tone: 'critical' },
|
|
474
|
+
{ severity: '黄', title: '加班超标部门', detail: '制造、客服、交付中心连续超标', time: '6 项', tone: 'warning' },
|
|
475
|
+
];
|
|
476
|
+
}
|
|
477
|
+
return [
|
|
478
|
+
{ severity: 'P1', title: '财务系统支付网关失败', detail: '责任:应用中台 · 处理 68%', time: '32m', tone: 'critical' },
|
|
479
|
+
{ severity: 'P1', title: 'MES 接口平均耗时 3.8s', detail: '责任:制造 IT · 已升级', time: '48m', tone: 'critical' },
|
|
480
|
+
{ severity: 'P2', title: '数据库备份延迟', detail: '责任:DBA · 预计 10:30 恢复', time: '1h', tone: 'warning' },
|
|
481
|
+
];
|
|
482
|
+
}
|
|
483
|
+
if (visualKind === 'progressList') {
|
|
484
|
+
if (domain === 'hr') {
|
|
485
|
+
return [
|
|
486
|
+
{ label: '储备干部', value: '74%', progress: 74, tone: 'info' },
|
|
487
|
+
{ label: '继任计划', value: '62%', progress: 62, tone: 'warning' },
|
|
488
|
+
{ label: '培训完成', value: '88%', progress: 88, tone: 'healthy' },
|
|
489
|
+
{ label: '持证覆盖', value: '79%', progress: 79, tone: 'info' },
|
|
490
|
+
{ label: '低绩效改善', value: '216', progress: 42, tone: 'critical' },
|
|
491
|
+
];
|
|
492
|
+
}
|
|
493
|
+
return [
|
|
494
|
+
{ label: '数据中台二期', value: '76%', progress: 76, tone: 'healthy' },
|
|
495
|
+
{ label: '供应链数字化改造', value: '延期', progress: 58, tone: 'warning' },
|
|
496
|
+
{ label: '统一身份认证', value: '83%', progress: 83, tone: 'healthy' },
|
|
497
|
+
{ label: '容灾双活改造', value: '卡点', progress: 42, tone: 'critical' },
|
|
498
|
+
];
|
|
499
|
+
}
|
|
500
|
+
if (visualKind === 'todoGrid') {
|
|
501
|
+
if (domain === 'hr') {
|
|
502
|
+
return [
|
|
503
|
+
{ label: '组织调整方案审批', value: '18' },
|
|
504
|
+
{ label: '关键岗位任免确认', value: '7' },
|
|
505
|
+
{ label: '年度调薪包复核', value: '24' },
|
|
506
|
+
{ label: '招聘编制补录', value: '5' },
|
|
507
|
+
];
|
|
508
|
+
}
|
|
509
|
+
return [
|
|
510
|
+
{ label: 'IT 采购审批', value: '18' },
|
|
511
|
+
{ label: '系统上线审批', value: '7' },
|
|
512
|
+
{ label: '权限变更审批', value: '24' },
|
|
513
|
+
{ label: '安全整改待办', value: '5' },
|
|
514
|
+
];
|
|
515
|
+
}
|
|
516
|
+
if (visualKind === 'quickLinks') {
|
|
517
|
+
if (domain === 'hr') {
|
|
518
|
+
return [{ label: '招聘系统' }, { label: '绩效平台' }, { label: '员工档案' }, { label: '用工审计' }];
|
|
519
|
+
}
|
|
520
|
+
return [{ label: '运维平台' }, { label: '堡垒机' }, { label: '安全平台' }, { label: '服务工单' }];
|
|
521
|
+
}
|
|
522
|
+
if (visualKind === 'donut') {
|
|
523
|
+
if (domain === 'hr') {
|
|
524
|
+
return [
|
|
525
|
+
{ label: '固定薪酬', value: '56%', share: 56, tone: 'info' },
|
|
526
|
+
{ label: '浮动奖金', value: '16%', share: 16, tone: 'violet' },
|
|
527
|
+
{ label: '社保福利', value: '14%', share: 14, tone: 'warning' },
|
|
528
|
+
{ label: '外包费用', value: '14%', share: 14, tone: 'neutral' },
|
|
529
|
+
];
|
|
530
|
+
}
|
|
531
|
+
return [
|
|
532
|
+
{ label: '云资源费用', value: '42%', share: 42, tone: 'info' },
|
|
533
|
+
{ label: '软件采购', value: '25%', share: 25, tone: 'violet' },
|
|
534
|
+
{ label: '外包服务', value: '17%', share: 17, tone: 'warning' },
|
|
535
|
+
{ label: '维保与机房', value: '16%', share: 16, tone: 'neutral' },
|
|
536
|
+
];
|
|
537
|
+
}
|
|
538
|
+
if (visualKind === 'list') {
|
|
539
|
+
if (domain === 'hr') {
|
|
540
|
+
return [
|
|
541
|
+
{ label: '合同到期续签', value: '待确认', tone: 'warning' },
|
|
542
|
+
{ label: '社保基数异常', value: '需口径', tone: 'critical' },
|
|
543
|
+
{ label: '人效排行复核', value: '待处理', tone: 'info' },
|
|
544
|
+
];
|
|
545
|
+
}
|
|
546
|
+
if (domain === 'risk') {
|
|
547
|
+
return [
|
|
548
|
+
{ label: '盈利结构恶化', value: '需确认', tone: 'critical' },
|
|
549
|
+
{ label: '资金安全边际', value: '待补口径', tone: 'warning' },
|
|
550
|
+
{ label: '项目风险', value: '跟进中', tone: 'violet' },
|
|
551
|
+
];
|
|
552
|
+
}
|
|
553
|
+
if (domain === 'marketing') {
|
|
554
|
+
return [
|
|
555
|
+
{ label: '渠道异常', value: '需确认', tone: 'warning' },
|
|
556
|
+
{ label: '线索漏斗', value: '待补口径', tone: 'info' },
|
|
557
|
+
{ label: '竞品动态', value: '跟进中', tone: 'violet' },
|
|
558
|
+
];
|
|
559
|
+
}
|
|
560
|
+
return [
|
|
561
|
+
{ label: '服务异常复核', value: '待处理', tone: 'warning' },
|
|
562
|
+
{ label: '巡检风险项', value: '需确认', tone: 'critical' },
|
|
563
|
+
{ label: '平台通知', value: '跟进中', tone: 'info' },
|
|
564
|
+
];
|
|
565
|
+
}
|
|
566
|
+
if (/资产运营|资产状态/.test(text)) {
|
|
567
|
+
return [
|
|
568
|
+
{ label: '闲置云主机待回收', value: '47 台', tone: 'warning' },
|
|
569
|
+
{ label: 'License 即将到期', value: '12 项', tone: 'critical' },
|
|
570
|
+
{ label: '资产盘点完成率', value: '96%', tone: 'healthy' },
|
|
571
|
+
];
|
|
572
|
+
}
|
|
573
|
+
if (domain === 'hr' && visualKind === 'simpleList') {
|
|
574
|
+
return [
|
|
575
|
+
{ label: '研发中心', value: '1.42', tone: 'healthy' },
|
|
576
|
+
{ label: '营销体系', value: '1.31', tone: 'healthy' },
|
|
577
|
+
{ label: '运营中心', value: '1.18', tone: 'healthy' },
|
|
578
|
+
{ label: '制造体系', value: '0.78', tone: 'critical' },
|
|
579
|
+
];
|
|
580
|
+
}
|
|
581
|
+
if (/成本优化/.test(text)) {
|
|
582
|
+
return [
|
|
583
|
+
{ label: '本月云费用环比', value: '+8.4%', tone: 'warning' },
|
|
584
|
+
{ label: '可释放资源降本空间', value: '128 万', tone: 'healthy' },
|
|
585
|
+
{ label: '预算执行偏差', value: '-4.6%', tone: 'healthy' },
|
|
586
|
+
];
|
|
587
|
+
}
|
|
588
|
+
if (/研发|效能/.test(text)) {
|
|
589
|
+
return [
|
|
590
|
+
{ label: '版本上线频次', value: '34 次/月', tone: 'healthy' },
|
|
591
|
+
{ label: '需求平均交付周期', value: '11.6 天', tone: 'healthy' },
|
|
592
|
+
{ label: '线上 BUG 率', value: '1.8%', tone: 'warning' },
|
|
593
|
+
];
|
|
594
|
+
}
|
|
595
|
+
if (/合规|审计/.test(text)) {
|
|
596
|
+
return [
|
|
597
|
+
{ label: '等保 2.0 整改进度', value: '92%', tone: 'healthy' },
|
|
598
|
+
{ label: '隐私合规检查', value: '通过', tone: 'healthy' },
|
|
599
|
+
{ label: '日志留存覆盖率', value: '88%', tone: 'warning' },
|
|
600
|
+
{ label: '离职未回收账号', value: '7 个', tone: 'critical' },
|
|
601
|
+
{ label: '超权限管理员账号', value: '4 个', tone: 'critical' },
|
|
602
|
+
{ label: '关键操作审计', value: '已归档', tone: 'healthy' },
|
|
603
|
+
];
|
|
604
|
+
}
|
|
605
|
+
return [
|
|
606
|
+
{ label: textValue(block.title, '事项'), value: nestedBlockMetricValue(block), tone: 'neutral' },
|
|
607
|
+
];
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
/**
|
|
611
|
+
* Returns normalized item rows for specialized nested preview renderers.
|
|
612
|
+
* @param block - Nested child card preview.
|
|
613
|
+
* @returns Model-provided rows, or screenshot-reference fallback rows.
|
|
614
|
+
*/
|
|
615
|
+
function nestedBlockItems(block: CustomCanvasNestedBlock): Array<Record<string, unknown>> {
|
|
616
|
+
const visualKind = nestedBlockVisualKind(block);
|
|
617
|
+
const rawItems = nestedBlockRawItems(block);
|
|
618
|
+
if (rawItems.length > 0 && !nestedBlockItemsLookTooWeak(rawItems)) return rawItems;
|
|
619
|
+
return nestedBlockFallbackItems(block, visualKind);
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
/**
|
|
623
|
+
* Returns row items for horizontal bar previews.
|
|
624
|
+
* @param block - Nested child card preview.
|
|
625
|
+
* @returns Bar-compatible item rows.
|
|
626
|
+
*/
|
|
627
|
+
function nestedBlockBarItems(block: CustomCanvasNestedBlock): Array<Record<string, unknown>> {
|
|
628
|
+
return nestedBlockItems(block).slice(0, nestedBlockVisualKind(block) === 'resourceBars' ? 4 : 5);
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
/**
|
|
632
|
+
* Returns tile items for metric, todo, and quick-link previews.
|
|
633
|
+
* @param block - Nested child card preview.
|
|
634
|
+
* @returns Tile-compatible item rows.
|
|
635
|
+
*/
|
|
636
|
+
function nestedBlockTileItems(block: CustomCanvasNestedBlock): Array<Record<string, unknown>> {
|
|
637
|
+
return nestedBlockItems(block).slice(0, 4);
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
/**
|
|
641
|
+
* Displays a primitive value without dropping numeric zeroes.
|
|
642
|
+
* @param value - Unknown value from model render data.
|
|
643
|
+
* @param fallback - Fallback label.
|
|
644
|
+
* @returns Display string.
|
|
645
|
+
*/
|
|
646
|
+
function nestedBlockDisplayValue(value: unknown, fallback = ''): string {
|
|
647
|
+
if (typeof value === 'number' && Number.isFinite(value)) return String(value);
|
|
648
|
+
if (typeof value === 'string' && value.trim()) {
|
|
649
|
+
const normalized = value.trim();
|
|
650
|
+
return nestedBlockInternalSentinelValue(normalized) ? fallback : normalized;
|
|
651
|
+
}
|
|
652
|
+
return fallback;
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
/**
|
|
656
|
+
* Extracts a label from a normalized nested item.
|
|
657
|
+
* @param item - Normalized item record.
|
|
658
|
+
* @param index - Item index for fallback labels.
|
|
659
|
+
* @returns Item label.
|
|
660
|
+
*/
|
|
661
|
+
function nestedBlockItemLabel(item: Record<string, unknown>, index: number): string {
|
|
662
|
+
const direct = textValue(item.label, textValue(item.name, textValue(item.title, textValue(item.metric, textValue(item.dimension)))));
|
|
663
|
+
if (direct && direct !== '--') return direct;
|
|
664
|
+
const cells = Array.isArray(item.cells) ? item.cells : [];
|
|
665
|
+
const firstCell = nestedBlockDisplayValue(cells[0]);
|
|
666
|
+
return firstCell && firstCell !== '--' ? firstCell : `项目 ${index + 1}`;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
/**
|
|
670
|
+
* Extracts the primary value/status from a normalized nested item.
|
|
671
|
+
* @param item - Normalized item record.
|
|
672
|
+
* @returns Item value.
|
|
673
|
+
*/
|
|
674
|
+
function nestedBlockItemValue(item: Record<string, unknown>): string {
|
|
675
|
+
const cells = Array.isArray(item.cells) ? item.cells : [];
|
|
676
|
+
return nestedBlockDisplayValue(
|
|
677
|
+
item.status ?? item.value ?? item.amount ?? item.ratio ?? item.progress ?? cells[1],
|
|
678
|
+
'',
|
|
679
|
+
);
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
/**
|
|
683
|
+
* Extracts secondary detail text from a normalized nested item.
|
|
684
|
+
* @param item - Normalized item record.
|
|
685
|
+
* @returns Detail string.
|
|
686
|
+
*/
|
|
687
|
+
function nestedBlockItemDetail(item: Record<string, unknown>): string {
|
|
688
|
+
return nestedBlockDisplayValue(item.detail ?? item.description ?? item.owner ?? item.subtitle, '');
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
/**
|
|
692
|
+
* Builds a full tooltip title for a compact nested preview row.
|
|
693
|
+
* @param item - Normalized item record.
|
|
694
|
+
* @param index - Item index for fallback labels.
|
|
695
|
+
* @returns Full row text containing label, detail, and value when available.
|
|
696
|
+
*/
|
|
697
|
+
function nestedBlockItemTitle(item: Record<string, unknown>, index: number): string {
|
|
698
|
+
return [
|
|
699
|
+
nestedBlockItemLabel(item, index),
|
|
700
|
+
nestedBlockItemDetail(item),
|
|
701
|
+
nestedBlockItemValue(item),
|
|
702
|
+
].filter(Boolean).join(' · ');
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
/**
|
|
706
|
+
* Extracts incident severity text from a normalized nested item.
|
|
707
|
+
* @param item - Normalized item record.
|
|
708
|
+
* @returns Severity label.
|
|
709
|
+
*/
|
|
710
|
+
function nestedBlockItemSeverity(item: Record<string, unknown>): string {
|
|
711
|
+
return nestedBlockDisplayValue(item.severity ?? item.level ?? item.status, 'P1');
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
/**
|
|
715
|
+
* Extracts time/meta text from a normalized nested item.
|
|
716
|
+
* @param item - Normalized item record.
|
|
717
|
+
* @returns Time or meta label.
|
|
718
|
+
*/
|
|
719
|
+
function nestedBlockItemTime(item: Record<string, unknown>): string {
|
|
720
|
+
return nestedBlockDisplayValue(item.time ?? item.meta ?? item.updatedAt, '');
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
/**
|
|
724
|
+
* Reads a finite number from a primitive value or a percentage-like string.
|
|
725
|
+
* @param value - Unknown numeric value.
|
|
726
|
+
* @param fallback - Fallback number.
|
|
727
|
+
* @returns Parsed number.
|
|
728
|
+
*/
|
|
729
|
+
function nestedBlockNumber(value: unknown, fallback = 0): number {
|
|
730
|
+
if (typeof value === 'number' && Number.isFinite(value)) return value;
|
|
731
|
+
if (typeof value === 'string') {
|
|
732
|
+
const match = value.match(/-?\d+(?:\.\d+)?/);
|
|
733
|
+
if (match) return numberValue(match[0], fallback);
|
|
734
|
+
}
|
|
735
|
+
return fallback;
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
/**
|
|
739
|
+
* Converts a numeric item field into a bounded CSS percentage.
|
|
740
|
+
* @param value - Numeric value, share, or percentage text.
|
|
741
|
+
* @param fallback - Fallback percentage.
|
|
742
|
+
* @returns Percentage string from 0 to 100.
|
|
743
|
+
*/
|
|
744
|
+
function nestedBlockPercent(value: unknown, fallback = 56): string {
|
|
745
|
+
const numeric = nestedBlockNumber(value, fallback);
|
|
746
|
+
return `${Math.max(4, Math.min(100, numeric))}%`;
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
/**
|
|
750
|
+
* Reads the progress field for one bar/tile item.
|
|
751
|
+
* @param item - Normalized item record.
|
|
752
|
+
* @param fallback - Fallback percentage.
|
|
753
|
+
* @returns CSS percentage width.
|
|
754
|
+
*/
|
|
755
|
+
function nestedBlockItemProgress(item: Record<string, unknown>, fallback = 56): string {
|
|
756
|
+
return nestedBlockPercent(item.progress ?? item.share ?? item.value ?? item.amount, fallback);
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
/**
|
|
760
|
+
* Reads a finite numeric value when a model row may contain counts instead of percentages.
|
|
761
|
+
* @param value - Candidate count, amount, or percentage-like string.
|
|
762
|
+
* @returns Parsed finite number, or undefined when no number is available.
|
|
763
|
+
*/
|
|
764
|
+
function nestedBlockOptionalNumber(value: unknown): number | undefined {
|
|
765
|
+
if (typeof value === 'number' && Number.isFinite(value)) return value;
|
|
766
|
+
if (typeof value === 'string') {
|
|
767
|
+
const match = value.match(/-?\d+(?:\.\d+)?/);
|
|
768
|
+
if (match) {
|
|
769
|
+
const parsed = Number(match[0]);
|
|
770
|
+
return Number.isFinite(parsed) ? parsed : undefined;
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
return undefined;
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
/**
|
|
777
|
+
* Reads the trend count for one ops chart bar without treating small counts as percentages.
|
|
778
|
+
* @param item - Normalized trend row from OCR/model output.
|
|
779
|
+
* @returns Count-like numeric value used for relative chart height.
|
|
780
|
+
*/
|
|
781
|
+
function referenceOpsTrendCount(item: Record<string, unknown>): number {
|
|
782
|
+
return nestedBlockOptionalNumber(item.count)
|
|
783
|
+
?? nestedBlockOptionalNumber(item.value)
|
|
784
|
+
?? nestedBlockOptionalNumber(item.amount)
|
|
785
|
+
?? nestedBlockOptionalNumber(item.total)
|
|
786
|
+
?? nestedBlockOptionalNumber(item.progress)
|
|
787
|
+
?? 0;
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
/**
|
|
791
|
+
* Converts one seven-day incident count into a visible bar height relative to the row maximum.
|
|
792
|
+
* @param item - Trend row being rendered.
|
|
793
|
+
* @param items - All trend rows in the same chart.
|
|
794
|
+
* @returns CSS percentage height with a visual floor for low but non-zero counts.
|
|
795
|
+
*/
|
|
796
|
+
function referenceOpsTrendBarHeight(item: Record<string, unknown>, items: Array<Record<string, unknown>>): string {
|
|
797
|
+
const counts = items.map(referenceOpsTrendCount).filter((count) => count > 0);
|
|
798
|
+
const max = Math.max(1, ...counts);
|
|
799
|
+
const count = referenceOpsTrendCount(item);
|
|
800
|
+
if (count <= 0) return '18%';
|
|
801
|
+
const ratio = Math.max(0, Math.min(1, count / max));
|
|
802
|
+
return `${Math.round(35 + ratio * 55)}%`;
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
/**
|
|
806
|
+
* Precomputes relative bar heights for the seven-day ops trend chart.
|
|
807
|
+
* @param data - Custom canvas renderer data.
|
|
808
|
+
* @returns Trend rows with a normalized barHeight field for rendering.
|
|
809
|
+
*/
|
|
810
|
+
function referenceOpsTrendChartItems(data: CustomCanvasData): Array<Record<string, unknown>> {
|
|
811
|
+
const items = referenceOpsTrendItems()(data);
|
|
812
|
+
return items.map((item) => ({
|
|
813
|
+
...item,
|
|
814
|
+
barHeight: referenceOpsTrendBarHeight(item, items),
|
|
815
|
+
}));
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
/**
|
|
819
|
+
* Chooses a semantic tone for nested item chips and bars.
|
|
820
|
+
* @param item - Normalized item record.
|
|
821
|
+
* @returns Tone key.
|
|
822
|
+
*/
|
|
823
|
+
function nestedBlockTone(item: Record<string, unknown>): NestedBlockTone {
|
|
824
|
+
const rawTone = textValue(item.tone, textValue(item.barTone)).toLowerCase();
|
|
825
|
+
if (rawTone === 'healthy' || rawTone === 'success') return 'healthy';
|
|
826
|
+
if (rawTone === 'warning') return 'warning';
|
|
827
|
+
if (rawTone === 'critical' || rawTone === 'danger' || rawTone === 'error') return 'critical';
|
|
828
|
+
if (rawTone === 'info') return 'info';
|
|
829
|
+
if (rawTone === 'violet' || rawTone === 'purple') return 'violet';
|
|
830
|
+
const text = [item.status, item.value, item.severity, item.title, item.label, item.detail].map((value) => String(value ?? '')).join(' ');
|
|
831
|
+
if (/P1|告警|异常|失败|高危|超权|卡点|critical|error/i.test(text)) return 'critical';
|
|
832
|
+
if (/P2|卡顿|延期|中风险|弱口令|即将|warning/i.test(text)) return 'warning';
|
|
833
|
+
if (/正常|通过|已归档|达标|完成|healthy|success/i.test(text)) return 'healthy';
|
|
834
|
+
if (/CPU|内存|info|blue/i.test(text)) return 'info';
|
|
835
|
+
return 'neutral';
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
/**
|
|
839
|
+
* Returns a stable tone class token for specialized nested preview templates.
|
|
840
|
+
* @param item - Normalized item record.
|
|
841
|
+
* @returns Tone class token used by pill, dot, and bar helpers.
|
|
842
|
+
*/
|
|
843
|
+
function nestedBlockToneClass(item: Record<string, unknown>): NestedBlockTone {
|
|
844
|
+
return nestedBlockTone(item);
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
/**
|
|
848
|
+
* Checks whether a customCanvas block is the first-viewport dark risk summary band.
|
|
849
|
+
* @param block - Rendered customCanvas block.
|
|
850
|
+
* @param data - Custom canvas renderer data.
|
|
851
|
+
* @returns True when a risk summary template should be used.
|
|
852
|
+
*/
|
|
853
|
+
function customCanvasRiskSummaryBand(block: WorkbenchBlock, data: CustomCanvasData): boolean {
|
|
854
|
+
if (customCanvasExplicitImageHeaderBlock(block, data)) return false;
|
|
855
|
+
const visual = customCanvasEffectiveVisual(block, data);
|
|
856
|
+
const hasEffectiveRiskMarker = visual.businessSummaryBand === 'risk'
|
|
857
|
+
&& referenceCompositeLooksLikeChairmanRiskDirectContext()(block, data);
|
|
858
|
+
if (hasEffectiveRiskMarker) return true;
|
|
859
|
+
const nestedBlocks = Array.isArray(data.nestedBlocks) ? data.nestedBlocks : [];
|
|
860
|
+
const directText = [block.title, data.sourceLabel, data.narrative].join(' ');
|
|
861
|
+
const riskChildCount = nestedBlocks.filter((nestedBlock) =>
|
|
862
|
+
/经营健康|重大经营风险|预算严重偏差|资金类预警|项目隐患|TODAY MOVEMENT|GLOBAL RISK POSTURE|risk posture|business risk|capital alert|budget deviation/i.test(nestedBlock.title),
|
|
863
|
+
).length;
|
|
864
|
+
if (/安全风险总览|安全风险概览|security risk/i.test(directText)) return false;
|
|
865
|
+
if (!referenceCompositeLooksLikeChairmanRiskContext()(block, data)) return false;
|
|
866
|
+
return /风险总览|风险概览|顶部风险|经营健康|GLOBAL RISK POSTURE|risk posture/i.test(directText) && riskChildCount >= 4;
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
/**
|
|
870
|
+
* Checks whether stable V2 metadata marks a customCanvas card as screenshot page chrome.
|
|
871
|
+
* @param block - Rendered customCanvas block.
|
|
872
|
+
* @param data - Custom canvas renderer data.
|
|
873
|
+
* @returns True when stale business-summary visual markers must be ignored.
|
|
874
|
+
*/
|
|
875
|
+
function customCanvasExplicitImageHeaderBlock(block: WorkbenchBlock, data: CustomCanvasData): boolean {
|
|
876
|
+
const meta = isRecord(block.meta) ? block.meta : {};
|
|
877
|
+
const metaV2 = isRecord(meta.v2) ? meta.v2 : {};
|
|
878
|
+
const record = data as unknown as Record<string, unknown>;
|
|
879
|
+
return [
|
|
880
|
+
block.source?.resourceKey,
|
|
881
|
+
meta.capabilityId,
|
|
882
|
+
metaV2.capabilityId,
|
|
883
|
+
record.themeId,
|
|
884
|
+
].some((value) => typeof value === 'string' && /workbench\.v2\.image\.header|image-header-banner/i.test(value));
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
/**
|
|
888
|
+
* Returns customCanvas visual metadata after stale risk shell markers are filtered.
|
|
889
|
+
* @param block - Rendered customCanvas block.
|
|
890
|
+
* @param data - Custom canvas renderer data.
|
|
891
|
+
* @returns Effective visual options for style and template routing.
|
|
892
|
+
*/
|
|
893
|
+
function customCanvasEffectiveVisual(block: WorkbenchBlock, data: CustomCanvasData): BlockVisualOptions {
|
|
894
|
+
return visualForScene(block, data);
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
/**
|
|
898
|
+
* Counts status rows by tone for the compact service-monitor summary strip.
|
|
899
|
+
* @param block - Nested child card preview.
|
|
900
|
+
* @returns Three stable summary buckets ordered as healthy, warning, and critical.
|
|
901
|
+
*/
|
|
902
|
+
function nestedBlockStatusSummary(block: CustomCanvasNestedBlock): Array<{ tone: NestedBlockTone; count: number }> {
|
|
903
|
+
const counts: Record<NestedBlockTone, number> = {
|
|
904
|
+
healthy: 0,
|
|
905
|
+
warning: 0,
|
|
906
|
+
critical: 0,
|
|
907
|
+
info: 0,
|
|
908
|
+
violet: 0,
|
|
909
|
+
neutral: 0,
|
|
910
|
+
};
|
|
911
|
+
nestedBlockItems(block).forEach((item) => {
|
|
912
|
+
counts[nestedBlockToneClass(item)] += 1;
|
|
913
|
+
});
|
|
914
|
+
return [
|
|
915
|
+
{ tone: 'healthy', count: counts.healthy },
|
|
916
|
+
{ tone: 'warning', count: counts.warning + counts.info + counts.violet },
|
|
917
|
+
{ tone: 'critical', count: counts.critical },
|
|
918
|
+
];
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
/**
|
|
922
|
+
* Maps a status-summary tone to a short product label.
|
|
923
|
+
* @param tone - Tone bucket from the status summary.
|
|
924
|
+
* @returns User-facing summary label.
|
|
925
|
+
*/
|
|
926
|
+
function nestedBlockStatusSummaryLabel(tone: NestedBlockTone): string {
|
|
927
|
+
if (tone === 'healthy') return '正常';
|
|
928
|
+
if (tone === 'critical') return '告警';
|
|
929
|
+
return '关注';
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
/**
|
|
933
|
+
* Builds pill classes for nested status/severity values.
|
|
934
|
+
* @param item - Normalized item record.
|
|
935
|
+
* @returns Tailwind class list.
|
|
936
|
+
*/
|
|
937
|
+
function nestedBlockPillClasses(item: Record<string, unknown>): string[] {
|
|
938
|
+
const base = ['inline-block max-w-[5rem] shrink-0 truncate rounded-full border px-2 py-0.5 text-xs font-semibold leading-5'];
|
|
939
|
+
const tone = nestedBlockToneClass(item);
|
|
940
|
+
if (tone === 'healthy') return [...base, 'border-emerald-200 bg-emerald-50 text-emerald-700'];
|
|
941
|
+
if (tone === 'warning') return [...base, 'border-amber-200 bg-amber-50 text-amber-700'];
|
|
942
|
+
if (tone === 'critical') return [...base, 'border-red-200 bg-red-50 text-red-600'];
|
|
943
|
+
if (tone === 'info') return [...base, 'border-cyan-200 bg-cyan-50 text-cyan-700'];
|
|
944
|
+
if (tone === 'violet') return [...base, 'border-violet-200 bg-violet-50 text-violet-700'];
|
|
945
|
+
return [...base, 'border-slate-200 bg-slate-50 text-slate-600'];
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
/**
|
|
949
|
+
* Builds dot classes for service status rows.
|
|
950
|
+
* @param item - Normalized item record.
|
|
951
|
+
* @returns Tailwind class list.
|
|
952
|
+
*/
|
|
953
|
+
function nestedBlockDotClasses(item: Record<string, unknown>): string[] {
|
|
954
|
+
const base = ['h-2.5 w-2.5 shrink-0 rounded-full'];
|
|
955
|
+
const tone = nestedBlockToneClass(item);
|
|
956
|
+
if (tone === 'healthy') return [...base, 'bg-emerald-500'];
|
|
957
|
+
if (tone === 'warning') return [...base, 'bg-amber-500'];
|
|
958
|
+
if (tone === 'critical') return [...base, 'bg-red-500'];
|
|
959
|
+
if (tone === 'info') return [...base, 'bg-cyan-500'];
|
|
960
|
+
return [...base, 'bg-slate-400'];
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
/**
|
|
964
|
+
* Builds fill classes for nested resource/progress bars.
|
|
965
|
+
* @param item - Normalized item record.
|
|
966
|
+
* @returns Tailwind class list.
|
|
967
|
+
*/
|
|
968
|
+
function nestedBlockBarClasses(item: Record<string, unknown>): string[] {
|
|
969
|
+
const base = ['block h-full rounded-full'];
|
|
970
|
+
const tone = nestedBlockToneClass(item);
|
|
971
|
+
if (tone === 'healthy') return [...base, 'bg-emerald-600'];
|
|
972
|
+
if (tone === 'warning') return [...base, 'bg-amber-600'];
|
|
973
|
+
if (tone === 'critical') return [...base, 'bg-red-500'];
|
|
974
|
+
if (tone === 'violet') return [...base, 'bg-violet-600'];
|
|
975
|
+
return [...base, 'bg-cyan-600'];
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
/**
|
|
979
|
+
* Builds vertical column classes for count-based mini bar charts.
|
|
980
|
+
* @param item - Normalized chart item.
|
|
981
|
+
* @returns Tailwind class list for a vertical rounded-top column.
|
|
982
|
+
*/
|
|
983
|
+
function referenceOpsTrendBarClasses(item: Record<string, unknown>): string[] {
|
|
984
|
+
const base = ['block rounded-t-md rounded-b-sm'];
|
|
985
|
+
const tone = nestedBlockToneClass(item);
|
|
986
|
+
if (tone === 'healthy') return [...base, 'bg-emerald-600'];
|
|
987
|
+
if (tone === 'warning') return [...base, 'bg-amber-600'];
|
|
988
|
+
if (tone === 'critical') return [...base, 'bg-red-500'];
|
|
989
|
+
if (tone === 'violet') return [...base, 'bg-violet-600'];
|
|
990
|
+
if (tone === 'neutral') return [...base, 'bg-slate-400'];
|
|
991
|
+
return [...base, 'bg-cyan-600'];
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
/**
|
|
995
|
+
* Builds CSS width for nested bar fills.
|
|
996
|
+
* @param item - Normalized item record.
|
|
997
|
+
* @param fallback - Fallback percentage.
|
|
998
|
+
* @returns CSS properties for the fill.
|
|
999
|
+
*/
|
|
1000
|
+
function nestedBlockBarStyle(item: Record<string, unknown>, fallback = 56): CSSProperties {
|
|
1001
|
+
return { width: nestedBlockItemProgress(item, fallback) };
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
/**
|
|
1005
|
+
* Derives a compact progress stage label from model rows or fallback rows.
|
|
1006
|
+
* @param item - Normalized progress item.
|
|
1007
|
+
* @param index - Row index for stable fallback.
|
|
1008
|
+
* @returns Short stage/status label rendered beside the progress bar.
|
|
1009
|
+
*/
|
|
1010
|
+
function nestedBlockProgressStage(item: Record<string, unknown>, index: number): string {
|
|
1011
|
+
const stage = nestedBlockDisplayValue(item.stage ?? item.phase ?? item.status, '');
|
|
1012
|
+
if (stage) return stage;
|
|
1013
|
+
const value = nestedBlockItemValue(item);
|
|
1014
|
+
if (value && !/^\d+(?:\.\d+)?%$/.test(value)) return value;
|
|
1015
|
+
return `阶段 ${index + 1}`;
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
/**
|
|
1019
|
+
* Returns the main score for security-score cards.
|
|
1020
|
+
* @param block - Nested child card preview.
|
|
1021
|
+
* @returns Score text.
|
|
1022
|
+
*/
|
|
1023
|
+
function nestedBlockSecurityScore(block: CustomCanvasNestedBlock): string {
|
|
1024
|
+
const data = isRecord(block.data) ? block.data : {};
|
|
1025
|
+
return normalizeNestedBlockSecurityScoreText(
|
|
1026
|
+
nestedBlockDisplayValue(data.value ?? data.primaryValue ?? data.displayValue, '86'),
|
|
1027
|
+
);
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
/**
|
|
1031
|
+
* Returns a short ring label for security-score visuals.
|
|
1032
|
+
* @param block - Nested child card preview.
|
|
1033
|
+
* @returns Numeric percentage label or a compact placeholder.
|
|
1034
|
+
*/
|
|
1035
|
+
function nestedBlockSecurityScoreRingLabel(block: CustomCanvasNestedBlock): string {
|
|
1036
|
+
const score = nestedBlockSecurityScore(block);
|
|
1037
|
+
return /^\d+(?:\.\d+)?$/u.test(score) ? `${score}%` : '待补';
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
/**
|
|
1041
|
+
* Strips model-emitted score units before the template appends "/ 100" and "%".
|
|
1042
|
+
* @param value - Raw score text from image recognition or fallback data.
|
|
1043
|
+
* @returns Numeric score text safe for compact security-score templates.
|
|
1044
|
+
*/
|
|
1045
|
+
function normalizeNestedBlockSecurityScoreText(value: string): string {
|
|
1046
|
+
const normalized = value.replace(/\s+/g, ' ').trim();
|
|
1047
|
+
const ratio = normalized.match(/^(\d+(?:\.\d+)?)\s*\/\s*100(?:\s*分)?$/u);
|
|
1048
|
+
if (ratio?.[1]) return ratio[1];
|
|
1049
|
+
const withUnit = normalized.match(/^(\d+(?:\.\d+)?)\s*(?:%|分)$/u);
|
|
1050
|
+
if (withUnit?.[1]) return withUnit[1];
|
|
1051
|
+
const leadingNumber = normalized.match(/^(\d+(?:\.\d+)?)(?=\s*(?:\/|%|分|$))/u);
|
|
1052
|
+
return leadingNumber?.[1] || normalized || '86';
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
/**
|
|
1056
|
+
* Returns compact metrics for the security score footer.
|
|
1057
|
+
* @param block - Nested child card preview.
|
|
1058
|
+
* @returns Footer metric rows.
|
|
1059
|
+
*/
|
|
1060
|
+
function nestedBlockSecurityMetrics(block: CustomCanvasNestedBlock): Array<Record<string, unknown>> {
|
|
1061
|
+
const data = isRecord(block.data) ? block.data : {};
|
|
1062
|
+
const metrics = nestedBlockItemRecords(data.metrics);
|
|
1063
|
+
if (metrics.length > 0) return metrics.slice(0, 3);
|
|
1064
|
+
return [
|
|
1065
|
+
{ label: '高危漏洞', value: '3' },
|
|
1066
|
+
{ label: '防火墙拦截', value: '21k' },
|
|
1067
|
+
{ label: '账号风险', value: '9' },
|
|
1068
|
+
];
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
/**
|
|
1072
|
+
* Returns cost-analysis donut items.
|
|
1073
|
+
* @param block - Nested child card preview.
|
|
1074
|
+
* @returns Donut legend rows.
|
|
1075
|
+
*/
|
|
1076
|
+
function nestedBlockDonutItems(block: CustomCanvasNestedBlock): Array<Record<string, unknown>> {
|
|
1077
|
+
return nestedBlockNormalizedDonutItems(nestedBlockItems(block).slice(0, 4));
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
/**
|
|
1081
|
+
* Keeps donut chart legend rows and visual slices on the same normalized scale.
|
|
1082
|
+
* @param items - Donut legend items from model data or source-image fallbacks.
|
|
1083
|
+
* @returns Items with normalizedShare used by the rendered conic-gradient.
|
|
1084
|
+
*/
|
|
1085
|
+
function nestedBlockNormalizedDonutItems(items: Array<Record<string, unknown>>): Array<Record<string, unknown>> {
|
|
1086
|
+
if (items.length === 0) return items;
|
|
1087
|
+
const rawShares = items.map((item) => Math.max(0, nestedBlockNumber(item.share ?? item.value ?? item.amount ?? item.ratio ?? item.progress, 0)));
|
|
1088
|
+
const totalShare = rawShares.reduce((sum, share) => sum + share, 0);
|
|
1089
|
+
const fallbackShare = 100 / items.length;
|
|
1090
|
+
return items.map((item, index) => {
|
|
1091
|
+
const normalizedShare = totalShare > 0 ? (rawShares[index] / totalShare) * 100 : fallbackShare;
|
|
1092
|
+
const displayValue = nestedBlockItemValue(item) || `${Math.round(normalizedShare)}%`;
|
|
1093
|
+
return {
|
|
1094
|
+
...item,
|
|
1095
|
+
value: displayValue,
|
|
1096
|
+
normalizedShare,
|
|
1097
|
+
};
|
|
1098
|
+
});
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
/**
|
|
1102
|
+
* Builds conic-gradient style for the compact donut preview.
|
|
1103
|
+
* @param block - Nested child card preview.
|
|
1104
|
+
* @returns CSS properties for the donut ring.
|
|
1105
|
+
*/
|
|
1106
|
+
function nestedBlockDonutStyle(block: CustomCanvasNestedBlock): CSSProperties {
|
|
1107
|
+
const colors = ['#0F8B8D', '#6D4AE6', '#C6851A', '#9AA5B1'];
|
|
1108
|
+
let cursor = 0;
|
|
1109
|
+
const segments = nestedBlockDonutItems(block).map((item, index) => {
|
|
1110
|
+
const share = Math.max(0, Math.min(100, nestedBlockNumber(item.normalizedShare, 25)));
|
|
1111
|
+
const start = cursor;
|
|
1112
|
+
cursor += share;
|
|
1113
|
+
return `${colors[index % colors.length]} ${start}% ${Math.min(100, cursor)}%`;
|
|
1114
|
+
});
|
|
1115
|
+
return {
|
|
1116
|
+
background: `radial-gradient(circle at center, #f8fafc 0 52%, transparent 53%), conic-gradient(${segments.join(', ')})`,
|
|
1117
|
+
};
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1120
|
+
/**
|
|
1121
|
+
* Builds a two-character shortcut icon label from a quick-link row.
|
|
1122
|
+
* @param item - Normalized quick-link item.
|
|
1123
|
+
* @param index - Item index for fallback labels.
|
|
1124
|
+
* @returns Compact icon text for the shortcut tile.
|
|
1125
|
+
*/
|
|
1126
|
+
function nestedBlockQuickIconLabel(item: Record<string, unknown>, index: number): string {
|
|
1127
|
+
const label = nestedBlockItemLabel(item, index).replace(/\s+/g, '');
|
|
1128
|
+
const ascii = label.match(/[A-Za-z0-9]/g);
|
|
1129
|
+
if (ascii && ascii.length > 0) return ascii.slice(0, 2).join('').toUpperCase();
|
|
1130
|
+
return Array.from(label).slice(0, 2).join('') || String(index + 1);
|
|
1131
|
+
}
|
|
1132
|
+
|
|
1133
|
+
/**
|
|
1134
|
+
* Builds an adaptive grid for quick-link tiles so short and wide cards both fill cleanly.
|
|
1135
|
+
* @param block - Nested quick-link child card.
|
|
1136
|
+
* @returns CSS grid style that automatically changes column count from available width.
|
|
1137
|
+
*/
|
|
1138
|
+
function nestedBlockQuickLinksGridStyle(block: CustomCanvasNestedBlock): CSSProperties {
|
|
1139
|
+
const itemCount = nestedBlockTileItems(block).length;
|
|
1140
|
+
return {
|
|
1141
|
+
gridTemplateColumns: itemCount <= 2
|
|
1142
|
+
? 'repeat(auto-fit, minmax(min(10rem, 100%), 1fr))'
|
|
1143
|
+
: 'repeat(auto-fit, minmax(min(8rem, 100%), 1fr))',
|
|
1144
|
+
};
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1147
|
+
function nestedBlockRows(block: CustomCanvasNestedBlock): Array<Record<string, unknown>> {
|
|
1148
|
+
const data = isRecord(block.data) ? block.data : {};
|
|
1149
|
+
const rows = Array.isArray(data.rows) ? data.rows.filter(isRecord) : [];
|
|
1150
|
+
if (rows.length > 0 && !nestedBlockItemsLookTooWeak(rows)) return rows;
|
|
1151
|
+
return nestedBlockItems(block).slice(0, 3).map((item, index) => ({
|
|
1152
|
+
事项: nestedBlockItemLabel(item, index),
|
|
1153
|
+
状态: nestedBlockItemValue(item) || nestedBlockItemDetail(item) || '待确认',
|
|
1154
|
+
}));
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
|
+
function nestedBlockColumns(block: CustomCanvasNestedBlock) {
|
|
1158
|
+
const data = isRecord(block.data) ? block.data : {};
|
|
1159
|
+
const declaredColumns = visibleImageTableColumns(data.columns);
|
|
1160
|
+
if (declaredColumns.length > 0) return declaredColumns.slice(0, 3);
|
|
1161
|
+
const firstRow = nestedBlockRows(block)[0];
|
|
1162
|
+
return firstRow ? Object.keys(firstRow).filter(imageTableColumnVisible).slice(0, 3) : [];
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1165
|
+
function nestedBlockRankingItems(block: CustomCanvasNestedBlock) {
|
|
1166
|
+
const data = isRecord(block.data) ? block.data : {};
|
|
1167
|
+
const items = Array.isArray(data.items) ? data.items.filter(isRecord) : [];
|
|
1168
|
+
if (items.length > 0 && !nestedBlockItemsLookTooWeak(items)) return items.slice(0, 3);
|
|
1169
|
+
const rows = Array.isArray(data.rows) ? data.rows.filter(isRecord) : [];
|
|
1170
|
+
if (rows.length > 0 && !nestedBlockItemsLookTooWeak(rows)) return rows.slice(0, 3);
|
|
1171
|
+
return nestedBlockItems(block).slice(0, 3);
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
function nestedBlockCell(row: Record<string, unknown>, column: string) {
|
|
1175
|
+
const value = row[column];
|
|
1176
|
+
return structuredTableCellText(value, '--');
|
|
1177
|
+
}
|
|
1178
|
+
|
|
1179
|
+
function nestedBlockPreviewKind(block: CustomCanvasNestedBlock) {
|
|
1180
|
+
const rendererKey = nestedBlockRendererKey(block);
|
|
1181
|
+
const data = isRecord(block.data) ? block.data : {};
|
|
1182
|
+
if (block.kind === 'metric' || rendererKey === 'metric' || typeof data.value === 'number' || typeof data.primaryValue === 'number') return 'metric';
|
|
1183
|
+
if (block.kind === 'table' || rendererKey === 'dataTable' || Array.isArray(data.rows)) return 'table';
|
|
1184
|
+
if (block.kind === 'list' || rendererKey === 'ranking' || Array.isArray(data.items)) return 'list';
|
|
1185
|
+
if (block.kind === 'chart' || rendererKey.includes('Echarts') || rendererKey.includes('chart') || Array.isArray(data.series) || typeof data.chartType === 'string') return 'chart';
|
|
1186
|
+
return 'summary';
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
/**
|
|
1190
|
+
* Checks whether a nested preview came from image compose and needs dense rendering.
|
|
1191
|
+
* @param block - Nested child card preview.
|
|
1192
|
+
* @returns True for image-composed nested previews.
|
|
1193
|
+
*/
|
|
1194
|
+
function nestedBlockCompactPreview(block: CustomCanvasNestedBlock): boolean {
|
|
1195
|
+
return nestedBlockComposeSource(block) === 'image'
|
|
1196
|
+
|| recordHasImageComposeSource(block.data)
|
|
1197
|
+
|| recordHasImageComposeSource(block.dataBinding)
|
|
1198
|
+
|| (typeof block.capabilityId === 'string' && block.capabilityId.startsWith('workbench.v2.image.'));
|
|
1199
|
+
}
|
|
1200
|
+
|
|
1201
|
+
/**
|
|
1202
|
+
* Returns a stable grid fallback minimum height for nested image previews.
|
|
1203
|
+
* @param block - Nested child card preview.
|
|
1204
|
+
* @returns Tailwind minimum-height class sized for the preview content type.
|
|
1205
|
+
*/
|
|
1206
|
+
function nestedBlockGridMinHeightClass(block: CustomCanvasNestedBlock, denseStack = false): string {
|
|
1207
|
+
if (!nestedBlockCompactPreview(block)) return 'min-h-[96px]';
|
|
1208
|
+
const previewKind = nestedBlockPreviewKind(block);
|
|
1209
|
+
if (denseStack) return previewKind === 'metric' || previewKind === 'summary' ? 'min-h-[44px]' : 'min-h-[56px]';
|
|
1210
|
+
return previewKind === 'metric' || previewKind === 'summary' ? 'min-h-[64px]' : 'min-h-[88px]';
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
function nestedBlockStatusLabel(block: CustomCanvasNestedBlock) {
|
|
1214
|
+
const status = textValue(block.dataBindingStatus, block.state?.status);
|
|
1215
|
+
return {
|
|
1216
|
+
none: '无绑定',
|
|
1217
|
+
pending: '待问数',
|
|
1218
|
+
running: '问数中',
|
|
1219
|
+
ready: '已问数',
|
|
1220
|
+
error: '问数失败',
|
|
1221
|
+
}[status] || status;
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
/**
|
|
1225
|
+
* Checks whether a nested image container has no user-visible child/body content.
|
|
1226
|
+
* @param block - Nested customCanvas child projected from an image container.
|
|
1227
|
+
* @returns True when the preview should reserve the screenshot region without exposing protocol text.
|
|
1228
|
+
*/
|
|
1229
|
+
function nestedBlockEmptyImageContainer(block: CustomCanvasNestedBlock): boolean {
|
|
1230
|
+
if (!nestedBlockCompactPreview(block)) return false;
|
|
1231
|
+
const data = isRecord(block.data) ? block.data : {};
|
|
1232
|
+
const rendererKey = nestedBlockRendererKey(block);
|
|
1233
|
+
const shape = textValue(data.shape);
|
|
1234
|
+
if (block.kind !== 'container' && rendererKey !== 'customCanvas' && shape !== 'customCanvas') return false;
|
|
1235
|
+
if (Array.isArray(data.nestedBlocks) && data.nestedBlocks.length > 0) return false;
|
|
1236
|
+
if (Array.isArray(data.elements) && data.elements.some((element) => !customCanvasGeneratedElement(element))) return false;
|
|
1237
|
+
return Object.entries(data)
|
|
1238
|
+
.map(([key, value]) => nestedBlockSummaryEntry(key, value))
|
|
1239
|
+
.filter((summary) => summary && summary !== block.title)
|
|
1240
|
+
.length === 0;
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
/**
|
|
1244
|
+
* Reads the visible failed-query reason from a nested child preview.
|
|
1245
|
+
* @param block - Nested child preview projected from a V2 container.
|
|
1246
|
+
* @returns Failure reason with a stable fallback.
|
|
1247
|
+
*/
|
|
1248
|
+
function nestedBlockFailureReason(block: CustomCanvasNestedBlock): string {
|
|
1249
|
+
const intervention = dataBindingHumanInterventionFromRecord(block.humanIntervention)
|
|
1250
|
+
?? dataBindingHumanInterventionFromRecord(block.dataBinding?.humanIntervention);
|
|
1251
|
+
if (intervention) {
|
|
1252
|
+
return businessGapDiagnosticSummary({
|
|
1253
|
+
message: intervention.message,
|
|
1254
|
+
fallback: '需要补充业务口径后再问数',
|
|
1255
|
+
diagnostics: block.dataBinding?.diagnostics,
|
|
1256
|
+
});
|
|
1257
|
+
}
|
|
1258
|
+
return textValue(block.dataBindingError, '问数失败');
|
|
1259
|
+
}
|
|
1260
|
+
|
|
1261
|
+
/**
|
|
1262
|
+
* Reads the backend human-intervention reason from a nested child preview.
|
|
1263
|
+
* @param block - Nested child preview projected from a V2 container.
|
|
1264
|
+
* @returns Stable reason code for browser diagnostics.
|
|
1265
|
+
*/
|
|
1266
|
+
function nestedBlockBusinessGapReason(block: CustomCanvasNestedBlock): string {
|
|
1267
|
+
const intervention = dataBindingHumanInterventionFromRecord(block.humanIntervention)
|
|
1268
|
+
?? dataBindingHumanInterventionFromRecord(block.dataBinding?.humanIntervention);
|
|
1269
|
+
return textValue(intervention?.reason, '');
|
|
1270
|
+
}
|
|
1271
|
+
|
|
1272
|
+
/**
|
|
1273
|
+
* Reads the query intent attached to a nested child preview.
|
|
1274
|
+
* @param block - Nested child preview projected from a V2 container.
|
|
1275
|
+
* @returns Query intent or child title fallback.
|
|
1276
|
+
*/
|
|
1277
|
+
function nestedBlockQueryIntent(block: CustomCanvasNestedBlock): string {
|
|
1278
|
+
return textValue(block.queryIntent, block.title);
|
|
1279
|
+
}
|
|
1280
|
+
|
|
1281
|
+
return {
|
|
1282
|
+
nestedBlockMetricValue,
|
|
1283
|
+
nestedBlockClassifierText,
|
|
1284
|
+
nestedBlockDeclaredVisualKind,
|
|
1285
|
+
nestedBlockVisualKind,
|
|
1286
|
+
nestedBlockItemRecords,
|
|
1287
|
+
nestedBlockItemEmpty,
|
|
1288
|
+
nestedBlockItemLooksWeak,
|
|
1289
|
+
nestedBlockItemsLookTooWeak,
|
|
1290
|
+
nestedBlockItemsLookTooWeakForVisualKind,
|
|
1291
|
+
nestedBlockRawItems,
|
|
1292
|
+
nestedBlockElementItems,
|
|
1293
|
+
nestedBlockToneFromStatus,
|
|
1294
|
+
nestedBlockToneFromProgress,
|
|
1295
|
+
nestedBlockFallbackDomain,
|
|
1296
|
+
nestedBlockFallbackClassifierText,
|
|
1297
|
+
nestedBlockFallbackItems,
|
|
1298
|
+
nestedBlockItems,
|
|
1299
|
+
nestedBlockBarItems,
|
|
1300
|
+
nestedBlockTileItems,
|
|
1301
|
+
nestedBlockDisplayValue,
|
|
1302
|
+
nestedBlockItemLabel,
|
|
1303
|
+
nestedBlockItemValue,
|
|
1304
|
+
nestedBlockItemDetail,
|
|
1305
|
+
nestedBlockItemTitle,
|
|
1306
|
+
nestedBlockItemSeverity,
|
|
1307
|
+
nestedBlockItemTime,
|
|
1308
|
+
nestedBlockNumber,
|
|
1309
|
+
nestedBlockPercent,
|
|
1310
|
+
nestedBlockItemProgress,
|
|
1311
|
+
nestedBlockOptionalNumber,
|
|
1312
|
+
referenceOpsTrendCount,
|
|
1313
|
+
referenceOpsTrendBarHeight,
|
|
1314
|
+
referenceOpsTrendChartItems,
|
|
1315
|
+
nestedBlockTone,
|
|
1316
|
+
nestedBlockToneClass,
|
|
1317
|
+
customCanvasRiskSummaryBand,
|
|
1318
|
+
customCanvasExplicitImageHeaderBlock,
|
|
1319
|
+
customCanvasEffectiveVisual,
|
|
1320
|
+
nestedBlockStatusSummary,
|
|
1321
|
+
nestedBlockStatusSummaryLabel,
|
|
1322
|
+
nestedBlockPillClasses,
|
|
1323
|
+
nestedBlockDotClasses,
|
|
1324
|
+
nestedBlockBarClasses,
|
|
1325
|
+
referenceOpsTrendBarClasses,
|
|
1326
|
+
nestedBlockBarStyle,
|
|
1327
|
+
nestedBlockProgressStage,
|
|
1328
|
+
nestedBlockSecurityScore,
|
|
1329
|
+
nestedBlockSecurityScoreRingLabel,
|
|
1330
|
+
nestedBlockSecurityMetrics,
|
|
1331
|
+
nestedBlockNormalizedDonutItems,
|
|
1332
|
+
nestedBlockDonutItems,
|
|
1333
|
+
nestedBlockDonutStyle,
|
|
1334
|
+
nestedBlockQuickIconLabel,
|
|
1335
|
+
nestedBlockQuickLinksGridStyle,
|
|
1336
|
+
nestedBlockRows,
|
|
1337
|
+
nestedBlockColumns,
|
|
1338
|
+
nestedBlockRankingItems,
|
|
1339
|
+
nestedBlockCell,
|
|
1340
|
+
nestedBlockPreviewKind,
|
|
1341
|
+
nestedBlockCompactPreview,
|
|
1342
|
+
nestedBlockGridMinHeightClass,
|
|
1343
|
+
nestedBlockStatusLabel,
|
|
1344
|
+
nestedBlockEmptyImageContainer,
|
|
1345
|
+
nestedBlockFailureReason,
|
|
1346
|
+
nestedBlockBusinessGapReason,
|
|
1347
|
+
nestedBlockQueryIntent,
|
|
1348
|
+
};
|
|
1349
|
+
}
|