@fses/workbench-app 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/WORKBENCH-CLOSURE.json +80 -0
- 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 +33731 -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 +2002 -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 +82 -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.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 +1081 -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 +3205 -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 +2487 -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
|
@@ -0,0 +1,660 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview 自定义画布布局绑定 - 提供 customCanvas 子卡片布局、绝对定位和外壳样式 helper。
|
|
3
|
+
* @author seadon
|
|
4
|
+
* @created 2026-05-20
|
|
5
|
+
*/
|
|
6
|
+
import type { CSSProperties } from 'vue';
|
|
7
|
+
import { workbenchCardShellStyle, workbenchShellDensityClasses } from '../../shell/workbenchVisualShell';
|
|
8
|
+
import type { CustomCanvasData, CustomCanvasNestedBlock, WorkbenchBlock } from '../../types';
|
|
9
|
+
import type { WorkbenchBlockRendererProps } from '../useWorkbenchBlockRendererBindings';
|
|
10
|
+
|
|
11
|
+
type CanvasLayoutContext = Record<string, any> & { props: WorkbenchBlockRendererProps };
|
|
12
|
+
|
|
13
|
+
type NestedStackTailPlacement = {
|
|
14
|
+
start: number;
|
|
15
|
+
span: number;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Creates layout helpers for customCanvas and nested previews.
|
|
20
|
+
* @param context - Shared renderer helpers and state.
|
|
21
|
+
* @returns Layout and shell helper functions.
|
|
22
|
+
*/
|
|
23
|
+
export function createCanvasLayoutBindings(context: CanvasLayoutContext) {
|
|
24
|
+
const {
|
|
25
|
+
props,
|
|
26
|
+
isRecord,
|
|
27
|
+
numberValue,
|
|
28
|
+
visualFor,
|
|
29
|
+
nestedBlockStyle,
|
|
30
|
+
nestedBlockGridMinHeightClass,
|
|
31
|
+
customCanvasEffectiveVisual,
|
|
32
|
+
customCanvasUsesStackNestedBlocks,
|
|
33
|
+
customCanvasNestedBlockGroups,
|
|
34
|
+
customCanvasDenseNestedStack,
|
|
35
|
+
customCanvasShowsStructureLabels,
|
|
36
|
+
customCanvasHeaderBannerBlock,
|
|
37
|
+
customCanvasPageHeaderBlock,
|
|
38
|
+
customCanvasEmptyPageHeaderPlaceholder,
|
|
39
|
+
recordHasImageComposeSource,
|
|
40
|
+
} = context;
|
|
41
|
+
|
|
42
|
+
const CUSTOM_CANVAS_NESTED_STACK_OUTLIER_WEIGHT_RATIO = 0.5;
|
|
43
|
+
const CUSTOM_CANVAS_SPARSE_ABSOLUTE_ROW_MAX_CHILDREN = 3;
|
|
44
|
+
const CUSTOM_CANVAS_SPARSE_ABSOLUTE_ROW_MIN_WIDTH_COVERAGE = 0.72;
|
|
45
|
+
const CUSTOM_CANVAS_SPARSE_ABSOLUTE_ROW_MAX_HEIGHT_COVERAGE = 0.62;
|
|
46
|
+
const CUSTOM_CANVAS_SPARSE_ABSOLUTE_ROW_MAX_TOP_RATIO = 0.18;
|
|
47
|
+
const CUSTOM_CANVAS_SPARSE_ABSOLUTE_ROW_ALIGNMENT_RATIO = 0.18;
|
|
48
|
+
const CUSTOM_CANVAS_ABSOLUTE_GRID_MIN_CHILDREN = 5;
|
|
49
|
+
const CUSTOM_CANVAS_ABSOLUTE_GRID_MAX_CHILDREN = 9;
|
|
50
|
+
const CUSTOM_CANVAS_ABSOLUTE_GRID_ROW_TOLERANCE_RATIO = 0.35;
|
|
51
|
+
const CUSTOM_CANVAS_ABSOLUTE_GRID_SIZE_TOLERANCE_RATIO = 0.35;
|
|
52
|
+
const CUSTOM_CANVAS_STACK_TAIL_FILL_MAX_CHILDREN = 4;
|
|
53
|
+
|
|
54
|
+
function customCanvasNestedStackContainerStyle(data: CustomCanvasData): CSSProperties | undefined {
|
|
55
|
+
if (!customCanvasUsesStackNestedBlocks(data)) return undefined;
|
|
56
|
+
const weights = customCanvasReadableNestedStackColumnWeights(customCanvasNestedStackColumnWeights(data));
|
|
57
|
+
const style: CSSProperties = {
|
|
58
|
+
gridTemplateColumns: weights.map((weight) => `minmax(0, ${weight}fr)`).join(' '),
|
|
59
|
+
};
|
|
60
|
+
if (customCanvasDenseNestedStack(data)) {
|
|
61
|
+
style.gridAutoRows = 'minmax(0, 1fr)';
|
|
62
|
+
}
|
|
63
|
+
return style;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Builds proportional column weights for inferred nested stacks.
|
|
68
|
+
* @param data - Custom canvas renderer data.
|
|
69
|
+
* @returns Column weights derived from child width hints, with one column fallback.
|
|
70
|
+
*/
|
|
71
|
+
function customCanvasNestedStackColumnWeights(data: CustomCanvasData): number[] {
|
|
72
|
+
const groups = customCanvasNestedBlockGroups(data);
|
|
73
|
+
if (groups.length === 0) return [1];
|
|
74
|
+
return groups.map((group: { blocks: CustomCanvasNestedBlock[] }) => Math.max(
|
|
75
|
+
1,
|
|
76
|
+
...group.blocks.map((block: CustomCanvasNestedBlock) => customCanvasNestedLayoutItem(block.id, data).columnSpan),
|
|
77
|
+
));
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Lifts one-off narrow OCR stack weights so nested cards stay readable in the browser.
|
|
82
|
+
* @param weights - Column weights derived from V2 child width hints.
|
|
83
|
+
* @returns Weights with very narrow outliers raised to the common readable width.
|
|
84
|
+
*/
|
|
85
|
+
function customCanvasReadableNestedStackColumnWeights(weights: number[]): number[] {
|
|
86
|
+
if (weights.length < 2) return weights;
|
|
87
|
+
const finiteWeights = weights.filter((weight) => Number.isFinite(weight) && weight > 0).sort((left, right) => left - right);
|
|
88
|
+
if (finiteWeights.length < 2) return weights;
|
|
89
|
+
const maxWeight = finiteWeights[finiteWeights.length - 1] ?? 0;
|
|
90
|
+
const minWeight = finiteWeights[0] ?? 0;
|
|
91
|
+
if (maxWeight <= 0 || minWeight / maxWeight >= CUSTOM_CANVAS_NESTED_STACK_OUTLIER_WEIGHT_RATIO) return weights;
|
|
92
|
+
if (finiteWeights.length === 2) {
|
|
93
|
+
return weights.map((weight) => (weight === minWeight ? maxWeight : weight));
|
|
94
|
+
}
|
|
95
|
+
const readableWeight = finiteWeights.find((weight) => weight / maxWeight >= CUSTOM_CANVAS_NESTED_STACK_OUTLIER_WEIGHT_RATIO) ?? maxWeight;
|
|
96
|
+
return weights.map((weight) => (weight / maxWeight < CUSTOM_CANVAS_NESTED_STACK_OUTLIER_WEIGHT_RATIO ? readableWeight : weight));
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Builds the visual style for one nested preview in grid/stack/absolute modes.
|
|
101
|
+
* @param block - Nested child card preview.
|
|
102
|
+
* @param data - Custom canvas renderer data.
|
|
103
|
+
* @param usesAbsolute - Whether the current container is using absolute positioning.
|
|
104
|
+
* @returns CSS properties for the nested child card.
|
|
105
|
+
*/
|
|
106
|
+
function nestedBlockCanvasStyle(
|
|
107
|
+
block: CustomCanvasNestedBlock,
|
|
108
|
+
data: CustomCanvasData,
|
|
109
|
+
usesAbsolute: boolean,
|
|
110
|
+
): CSSProperties {
|
|
111
|
+
if (usesAbsolute) return nestedBlockAbsoluteStyle(block, data);
|
|
112
|
+
return {
|
|
113
|
+
...nestedBlockStyle(block),
|
|
114
|
+
...nestedBlockStackGridStyle(block, data),
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Positions a nested child inside the inferred stack grid.
|
|
120
|
+
* @param block - Nested child card preview.
|
|
121
|
+
* @param data - Custom canvas renderer data.
|
|
122
|
+
* @returns CSS grid placement for stack mode.
|
|
123
|
+
*/
|
|
124
|
+
function nestedBlockStackGridStyle(block: CustomCanvasNestedBlock, data: CustomCanvasData): CSSProperties {
|
|
125
|
+
if (!customCanvasUsesStackNestedBlocks(data)) return {};
|
|
126
|
+
const groups = customCanvasNestedBlockGroups(data);
|
|
127
|
+
const item = customCanvasNestedLayoutItem(block.id, data);
|
|
128
|
+
for (let columnIndex = 0; columnIndex < groups.length; columnIndex += 1) {
|
|
129
|
+
const rowIndex = groups[columnIndex].blocks.findIndex((item: CustomCanvasNestedBlock) => item.id === block.id);
|
|
130
|
+
if (rowIndex >= 0) {
|
|
131
|
+
return {
|
|
132
|
+
gridColumn: `${columnIndex + 1}`,
|
|
133
|
+
gridRow: item.rowSpan > 1 ? `${rowIndex + 1} / span ${item.rowSpan}` : `${rowIndex + 1}`,
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return {};
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Detects regular multi-column stack grids that have only a sparse final row.
|
|
142
|
+
* @param data - Custom canvas renderer data containing stack groups.
|
|
143
|
+
* @returns Tail-row placement metadata when the stack represents a regular grid.
|
|
144
|
+
*/
|
|
145
|
+
function customCanvasRegularNestedStackGrid(data: CustomCanvasData): { tailRowIndex: number; placements: Map<string, NestedStackTailPlacement> } | undefined {
|
|
146
|
+
if (!customCanvasUsesStackNestedBlocks(data)) return undefined;
|
|
147
|
+
const columns = customCanvasNestedBlockGroups(data).map((group: { blocks: CustomCanvasNestedBlock[] }) => group.blocks).filter((blocks: CustomCanvasNestedBlock[]) => blocks.length > 0);
|
|
148
|
+
const childCount = columns.reduce((sum: number, column: CustomCanvasNestedBlock[]) => sum + column.length, 0);
|
|
149
|
+
if (childCount > CUSTOM_CANVAS_STACK_TAIL_FILL_MAX_CHILDREN) return undefined;
|
|
150
|
+
if (columns.length < 2 || columns.length > 4) return undefined;
|
|
151
|
+
const lengths = columns.map((column: CustomCanvasNestedBlock[]) => column.length);
|
|
152
|
+
const minRows = Math.min(...lengths);
|
|
153
|
+
const maxRows = Math.max(...lengths);
|
|
154
|
+
if (minRows < 1 || maxRows <= 1 || maxRows - minRows !== 1) return undefined;
|
|
155
|
+
const tailColumnIndexes = lengths
|
|
156
|
+
.map((length: number, index: number) => (length === maxRows ? index : -1))
|
|
157
|
+
.filter((index: number) => index >= 0);
|
|
158
|
+
if (tailColumnIndexes.length === 0 || tailColumnIndexes.length >= columns.length) return undefined;
|
|
159
|
+
if (!tailColumnIndexes.every((columnIndex: number, index: number) => columnIndex === index)) return undefined;
|
|
160
|
+
const tailRowIndex = maxRows - 1;
|
|
161
|
+
const baseSpan = Math.floor(columns.length / tailColumnIndexes.length);
|
|
162
|
+
const remainder = columns.length % tailColumnIndexes.length;
|
|
163
|
+
const placements = new Map<string, NestedStackTailPlacement>();
|
|
164
|
+
let start = 0;
|
|
165
|
+
tailColumnIndexes.forEach((columnIndex: number, order: number) => {
|
|
166
|
+
const span = baseSpan + (order >= tailColumnIndexes.length - remainder ? 1 : 0);
|
|
167
|
+
const block = columns[columnIndex][tailRowIndex];
|
|
168
|
+
if (block?.id) {
|
|
169
|
+
placements.set(block.id, { start, span });
|
|
170
|
+
}
|
|
171
|
+
start += span;
|
|
172
|
+
});
|
|
173
|
+
return placements.size > 0 ? { tailRowIndex, placements } : undefined;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Expands sparse tail rows in inferred stack grids so the row fills the parent width.
|
|
178
|
+
* @param block - Nested child card preview.
|
|
179
|
+
* @param data - Custom canvas renderer data containing stack groups.
|
|
180
|
+
* @returns CSS grid placement override for sparse stack tail children.
|
|
181
|
+
*/
|
|
182
|
+
function nestedBlockStackTailPlacementStyle(block: CustomCanvasNestedBlock, data: CustomCanvasData): CSSProperties {
|
|
183
|
+
const grid = customCanvasRegularNestedStackGrid(data);
|
|
184
|
+
const placement = grid?.placements.get(block.id);
|
|
185
|
+
if (!grid || !placement) return {};
|
|
186
|
+
return {
|
|
187
|
+
gridColumn: `${placement.start + 1} / span ${placement.span}`,
|
|
188
|
+
gridRow: `${grid.tailRowIndex + 1}`,
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Reads per-child stack sizing hints emitted by the V2 image adapter.
|
|
194
|
+
* @param blockId - Nested child id.
|
|
195
|
+
* @param data - Custom canvas renderer data.
|
|
196
|
+
* @returns Safe row/column spans for stack grid placement.
|
|
197
|
+
*/
|
|
198
|
+
function customCanvasNestedLayoutItem(blockId: string, data: CustomCanvasData): { rowSpan: number; columnSpan: number } {
|
|
199
|
+
const items = (isRecord(data.nestedLayoutItems) ? data.nestedLayoutItems : {}) as Record<string, unknown>;
|
|
200
|
+
const item = (isRecord(items[blockId]) ? items[blockId] : {}) as Record<string, unknown>;
|
|
201
|
+
return {
|
|
202
|
+
rowSpan: Math.max(1, Math.round(numberValue(item.rowSpan, 1))),
|
|
203
|
+
columnSpan: Math.max(1, Math.round(numberValue(item.columnSpan, 1))),
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Checks whether a nested preview has a complete layout box.
|
|
209
|
+
* @param block - Nested child card preview.
|
|
210
|
+
* @returns True when x/y/w/h can be converted into percentages.
|
|
211
|
+
*/
|
|
212
|
+
function nestedBlockHasLayout(block: CustomCanvasNestedBlock): boolean {
|
|
213
|
+
return ['x', 'y', 'w', 'h'].every((key) => Number.isFinite(numberValue((block.layout as unknown as Record<string, unknown> | undefined)?.[key], Number.NaN)));
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Converts a nested preview layout to parent-local coordinates for runtime safety checks.
|
|
218
|
+
* @param block - Nested child card preview.
|
|
219
|
+
* @param data - Custom canvas renderer data containing parent basis.
|
|
220
|
+
* @returns Parent-local layout box, or undefined when layout data is incomplete.
|
|
221
|
+
*/
|
|
222
|
+
function customCanvasAbsoluteNestedBox(block: CustomCanvasNestedBlock, data: CustomCanvasData): { x: number; y: number; w: number; h: number } | undefined {
|
|
223
|
+
const layout = (isRecord(block.layout) ? block.layout : {}) as Record<string, unknown>;
|
|
224
|
+
if (!nestedBlockHasLayout(block)) return undefined;
|
|
225
|
+
const basis = (isRecord(data.nestedLayoutBasis) ? data.nestedLayoutBasis : {}) as Record<string, unknown>;
|
|
226
|
+
const usesGlobalCoordinates = nestedBlockUsesGlobalCoordinates(layout, basis);
|
|
227
|
+
return {
|
|
228
|
+
x: nestedBlockLocalCoordinate(numberValue(layout['x']), numberValue(basis.x), usesGlobalCoordinates),
|
|
229
|
+
y: nestedBlockLocalCoordinate(numberValue(layout['y']), numberValue(basis.y), usesGlobalCoordinates),
|
|
230
|
+
w: Math.max(1, numberValue(layout['w'])),
|
|
231
|
+
h: Math.max(1, numberValue(layout['h'])),
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Calculates pairwise overlap area for nested preview boxes.
|
|
237
|
+
* @param boxes - Parent-local nested preview boxes.
|
|
238
|
+
* @returns Summed pairwise overlap area.
|
|
239
|
+
*/
|
|
240
|
+
function customCanvasAbsoluteNestedOverlapArea(boxes: Array<{ x: number; y: number; w: number; h: number }>): number {
|
|
241
|
+
let overlapArea = 0;
|
|
242
|
+
for (let leftIndex = 0; leftIndex < boxes.length; leftIndex += 1) {
|
|
243
|
+
for (let rightIndex = leftIndex + 1; rightIndex < boxes.length; rightIndex += 1) {
|
|
244
|
+
const left = boxes[leftIndex];
|
|
245
|
+
const right = boxes[rightIndex];
|
|
246
|
+
const overlapW = Math.max(0, Math.min(left.x + left.w, right.x + right.w) - Math.max(left.x, right.x));
|
|
247
|
+
const overlapH = Math.max(0, Math.min(left.y + left.h, right.y + right.h) - Math.max(left.y, right.y));
|
|
248
|
+
overlapArea += overlapW * overlapH;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
return overlapArea;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Finds the horizontal span covered by absolute nested child cards.
|
|
256
|
+
* @param boxes - Parent-local nested preview boxes.
|
|
257
|
+
* @returns Combined horizontal coverage span.
|
|
258
|
+
*/
|
|
259
|
+
function customCanvasAbsoluteNestedWidthSpan(boxes: Array<{ x: number; y: number; w: number; h: number }>): number {
|
|
260
|
+
if (boxes.length === 0) return 0;
|
|
261
|
+
const left = Math.min(...boxes.map((box) => box.x));
|
|
262
|
+
const right = Math.max(...boxes.map((box) => box.x + box.w));
|
|
263
|
+
return Math.max(0, right - left);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* Detects source-image child cards that form one sparse row inside a tall parent panel.
|
|
268
|
+
* @param block - Nested child card preview.
|
|
269
|
+
* @param data - Custom canvas renderer data containing all sibling previews.
|
|
270
|
+
* @returns True when this child should fill the parent body height.
|
|
271
|
+
*/
|
|
272
|
+
function customCanvasSparseAbsoluteNestedRowFill(block: CustomCanvasNestedBlock, data: CustomCanvasData): boolean {
|
|
273
|
+
const children = Array.isArray(data.nestedBlocks) ? data.nestedBlocks : [];
|
|
274
|
+
if (children.length < 2 || children.length > CUSTOM_CANVAS_SPARSE_ABSOLUTE_ROW_MAX_CHILDREN) return false;
|
|
275
|
+
if (!children.some((child) => child.id === block.id)) return false;
|
|
276
|
+
const boxes = children
|
|
277
|
+
.map((child) => customCanvasAbsoluteNestedBox(child, data))
|
|
278
|
+
.filter((box): box is { x: number; y: number; w: number; h: number } => Boolean(box));
|
|
279
|
+
if (boxes.length !== children.length) return false;
|
|
280
|
+
const basis = (isRecord(data.nestedLayoutBasis) ? data.nestedLayoutBasis : {}) as Record<string, unknown>;
|
|
281
|
+
const basisW = Math.max(1, numberValue(basis.w, 24));
|
|
282
|
+
const basisH = Math.max(1, numberValue(basis.h, 1));
|
|
283
|
+
const top = Math.min(...boxes.map((box) => box.y));
|
|
284
|
+
const bottom = Math.max(...boxes.map((box) => box.y + box.h));
|
|
285
|
+
const maxTopDelta = Math.max(1, basisH * CUSTOM_CANVAS_SPARSE_ABSOLUTE_ROW_ALIGNMENT_RATIO);
|
|
286
|
+
const sameVisualRow = boxes.every((box) => Math.abs(box.y - top) <= maxTopDelta);
|
|
287
|
+
const widthCoverage = customCanvasAbsoluteNestedWidthSpan(boxes) / basisW;
|
|
288
|
+
const heightCoverage = Math.max(0, bottom - top) / basisH;
|
|
289
|
+
if (!sameVisualRow) return false;
|
|
290
|
+
if (top / basisH > CUSTOM_CANVAS_SPARSE_ABSOLUTE_ROW_MAX_TOP_RATIO) return false;
|
|
291
|
+
if (widthCoverage < CUSTOM_CANVAS_SPARSE_ABSOLUTE_ROW_MIN_WIDTH_COVERAGE) return false;
|
|
292
|
+
return heightCoverage < CUSTOM_CANVAS_SPARSE_ABSOLUTE_ROW_MAX_HEIGHT_COVERAGE;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Groups absolute child boxes into source rows when the model produced a grid-like layout.
|
|
297
|
+
* @param data - Custom canvas renderer data containing sibling preview boxes.
|
|
298
|
+
* @returns Ordered rows of child boxes, or an empty list when the layout is not grid-like.
|
|
299
|
+
*/
|
|
300
|
+
function customCanvasAbsoluteNestedRows(
|
|
301
|
+
data: CustomCanvasData,
|
|
302
|
+
): Array<Array<{ block: CustomCanvasNestedBlock; box: { x: number; y: number; w: number; h: number } }>> {
|
|
303
|
+
const children = Array.isArray(data.nestedBlocks) ? data.nestedBlocks : [];
|
|
304
|
+
if (children.length < CUSTOM_CANVAS_ABSOLUTE_GRID_MIN_CHILDREN || children.length > CUSTOM_CANVAS_ABSOLUTE_GRID_MAX_CHILDREN) return [];
|
|
305
|
+
const entries = children
|
|
306
|
+
.map((block) => {
|
|
307
|
+
const box = customCanvasAbsoluteNestedBox(block, data);
|
|
308
|
+
return box ? { block, box } : undefined;
|
|
309
|
+
})
|
|
310
|
+
.filter((entry): entry is { block: CustomCanvasNestedBlock; box: { x: number; y: number; w: number; h: number } } => Boolean(entry))
|
|
311
|
+
.sort((left, right) => left.box.y - right.box.y || left.box.x - right.box.x);
|
|
312
|
+
if (entries.length !== children.length) return [];
|
|
313
|
+
const medianHeight = medianPositive(entries.map((entry) => entry.box.h));
|
|
314
|
+
const medianWidth = medianPositive(entries.map((entry) => entry.box.w));
|
|
315
|
+
if (medianHeight <= 0 || medianWidth <= 0) return [];
|
|
316
|
+
const rowTolerance = Math.max(1, medianHeight * CUSTOM_CANVAS_ABSOLUTE_GRID_ROW_TOLERANCE_RATIO);
|
|
317
|
+
const rows: Array<Array<{ block: CustomCanvasNestedBlock; box: { x: number; y: number; w: number; h: number } }>> = [];
|
|
318
|
+
entries.forEach((entry) => {
|
|
319
|
+
const row = rows.find((candidate) => Math.abs(candidate[0].box.y - entry.box.y) <= rowTolerance);
|
|
320
|
+
if (row) {
|
|
321
|
+
row.push(entry);
|
|
322
|
+
} else {
|
|
323
|
+
rows.push([entry]);
|
|
324
|
+
}
|
|
325
|
+
});
|
|
326
|
+
rows.forEach((row) => row.sort((left, right) => left.box.x - right.box.x));
|
|
327
|
+
if (rows.length < 2) return [];
|
|
328
|
+
const fullRowSize = Math.max(...rows.map((row) => row.length));
|
|
329
|
+
if (fullRowSize < 2) return [];
|
|
330
|
+
const fullRows = rows.filter((row) => row.length === fullRowSize);
|
|
331
|
+
if (fullRows.length === 0) return [];
|
|
332
|
+
const gridLikeSizes = entries.every((entry) => (
|
|
333
|
+
Math.abs(entry.box.w - medianWidth) / medianWidth <= CUSTOM_CANVAS_ABSOLUTE_GRID_SIZE_TOLERANCE_RATIO
|
|
334
|
+
&& Math.abs(entry.box.h - medianHeight) / medianHeight <= CUSTOM_CANVAS_ABSOLUTE_GRID_SIZE_TOLERANCE_RATIO
|
|
335
|
+
));
|
|
336
|
+
return gridLikeSizes ? rows : [];
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* Returns the median of positive finite numbers.
|
|
341
|
+
* @param values - Candidate numeric values.
|
|
342
|
+
* @returns Median positive value, or zero when no usable value exists.
|
|
343
|
+
*/
|
|
344
|
+
function medianPositive(values: number[]): number {
|
|
345
|
+
const sorted = values.filter((value) => Number.isFinite(value) && value > 0).sort((left, right) => left - right);
|
|
346
|
+
if (sorted.length === 0) return 0;
|
|
347
|
+
return sorted[Math.floor(sorted.length / 2)] ?? 0;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* Expands a single sparse absolute-grid tail child to the row end.
|
|
352
|
+
* @param block - Nested child card preview.
|
|
353
|
+
* @param data - Custom canvas renderer data containing sibling preview boxes.
|
|
354
|
+
* @returns Adjusted absolute box for tail-row fill, or undefined when no adjustment is needed.
|
|
355
|
+
*/
|
|
356
|
+
function absoluteNestedBlockGridTailPlacementStyle(
|
|
357
|
+
block: CustomCanvasNestedBlock,
|
|
358
|
+
data: CustomCanvasData,
|
|
359
|
+
): { x: number; y: number; w: number; h: number } | undefined {
|
|
360
|
+
const rows = customCanvasAbsoluteNestedRows(data);
|
|
361
|
+
if (rows.length === 0) return undefined;
|
|
362
|
+
const tailBlocks = rows[rows.length - 1] ?? [];
|
|
363
|
+
if (tailBlocks.length === 0) return undefined;
|
|
364
|
+
const fullRowSize = Math.max(...rows.slice(0, -1).map((row) => row.length), 0);
|
|
365
|
+
if (fullRowSize < 2 || tailBlocks.length >= fullRowSize) return undefined;
|
|
366
|
+
if (tailBlocks.length === 1 && tailBlocks[0].block.id !== block.id) return undefined;
|
|
367
|
+
const basis = (isRecord(data.nestedLayoutBasis) ? data.nestedLayoutBasis : {}) as Record<string, unknown>;
|
|
368
|
+
const basisW = Math.max(1, numberValue(basis.w, 24));
|
|
369
|
+
const baseBox = tailBlocks.find((entry) => entry.block.id === block.id)?.box;
|
|
370
|
+
if (!baseBox) return undefined;
|
|
371
|
+
const tailBox = tailBlocks[0].box;
|
|
372
|
+
const adjustedWidth = tailBlocks.length === 1
|
|
373
|
+
? basisW - tailBox.x
|
|
374
|
+
: baseBox.w;
|
|
375
|
+
return {
|
|
376
|
+
...baseBox,
|
|
377
|
+
w: Math.max(baseBox.w, adjustedWidth),
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* Removes excessive leading whitespace from sparse absolute nested previews.
|
|
383
|
+
* @param data - Custom canvas renderer data containing sibling preview boxes.
|
|
384
|
+
* @returns Parent-local row offset that should be subtracted from every sparse child.
|
|
385
|
+
*/
|
|
386
|
+
function customCanvasSparseAbsoluteNestedTopOffset(data: CustomCanvasData): number {
|
|
387
|
+
const children = Array.isArray(data.nestedBlocks) ? data.nestedBlocks : [];
|
|
388
|
+
if (children.length === 0 || children.length > CUSTOM_CANVAS_SPARSE_ABSOLUTE_ROW_MAX_CHILDREN) return 0;
|
|
389
|
+
if (customCanvasAbsoluteNestedRows(data).length > 0) return 0;
|
|
390
|
+
const boxes = children
|
|
391
|
+
.map((child) => customCanvasAbsoluteNestedBox(child, data))
|
|
392
|
+
.filter((box): box is { x: number; y: number; w: number; h: number } => Boolean(box));
|
|
393
|
+
if (boxes.length !== children.length) return 0;
|
|
394
|
+
const basis = (isRecord(data.nestedLayoutBasis) ? data.nestedLayoutBasis : {}) as Record<string, unknown>;
|
|
395
|
+
const basisH = Math.max(1, numberValue(basis.h, 1));
|
|
396
|
+
const top = Math.min(...boxes.map((box) => box.y));
|
|
397
|
+
return top / basisH > CUSTOM_CANVAS_SPARSE_ABSOLUTE_ROW_MAX_TOP_RATIO ? top : 0;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
/**
|
|
401
|
+
* Converts a layout number to a bounded percentage.
|
|
402
|
+
* @param value - Raw ratio value.
|
|
403
|
+
* @returns Percentage string clamped to the container.
|
|
404
|
+
*/
|
|
405
|
+
function layoutPercent(value: number): string {
|
|
406
|
+
return `${Math.max(0, Math.min(100, value))}%`;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
/**
|
|
410
|
+
* Checks whether a nested child layout looks like global screenshot coordinates.
|
|
411
|
+
* @param layout - Child layout emitted by image recognition.
|
|
412
|
+
* @param basis - Parent layout basis in the same V2 coordinate space.
|
|
413
|
+
* @returns True when the child's x/y are outside the parent-local range.
|
|
414
|
+
*/
|
|
415
|
+
function nestedBlockUsesGlobalCoordinates(layout: Record<string, unknown>, basis: Record<string, unknown>): boolean {
|
|
416
|
+
const x = numberValue(layout['x']);
|
|
417
|
+
const y = numberValue(layout['y']);
|
|
418
|
+
const w = Math.max(1, numberValue(layout['w']));
|
|
419
|
+
const h = Math.max(1, numberValue(layout['h']));
|
|
420
|
+
const basisW = Math.max(1, numberValue(basis.w, 24));
|
|
421
|
+
const basisH = Math.max(1, numberValue(basis.h, 1));
|
|
422
|
+
return x + w > basisW || y + h > basisH;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
/**
|
|
426
|
+
* Converts a child coordinate into the parent-local coordinate space.
|
|
427
|
+
* @param value - Child x or y coordinate.
|
|
428
|
+
* @param offset - Parent x or y coordinate.
|
|
429
|
+
* @param usesGlobalCoordinates - Whether the child coordinate is global.
|
|
430
|
+
* @returns Parent-local coordinate.
|
|
431
|
+
*/
|
|
432
|
+
function nestedBlockLocalCoordinate(value: number, offset: number, usesGlobalCoordinates: boolean): number {
|
|
433
|
+
return usesGlobalCoordinates ? Math.max(0, value - offset) : value;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
/**
|
|
437
|
+
* Builds screenshot-relative positioning for a nested child preview.
|
|
438
|
+
* @param block - Nested child card preview.
|
|
439
|
+
* @param data - Custom canvas renderer data containing parent basis.
|
|
440
|
+
* @returns CSS properties combining child shell style and absolute layout.
|
|
441
|
+
*/
|
|
442
|
+
function nestedBlockAbsoluteStyle(block: CustomCanvasNestedBlock, data: CustomCanvasData): CSSProperties {
|
|
443
|
+
const style = nestedBlockStyle(block);
|
|
444
|
+
const layout = (isRecord(block.layout) ? block.layout : {}) as Record<string, unknown>;
|
|
445
|
+
const basis = (isRecord(data.nestedLayoutBasis) ? data.nestedLayoutBasis : {}) as Record<string, unknown>;
|
|
446
|
+
const usesGlobalCoordinates = nestedBlockUsesGlobalCoordinates(layout, basis);
|
|
447
|
+
const basisW = Math.max(1, numberValue(basis.w, 24));
|
|
448
|
+
const basisH = Math.max(1, numberValue(basis.h, 1));
|
|
449
|
+
const x = nestedBlockLocalCoordinate(numberValue(layout['x']), numberValue(basis.x), usesGlobalCoordinates);
|
|
450
|
+
const y = nestedBlockLocalCoordinate(numberValue(layout['y']), numberValue(basis.y), usesGlobalCoordinates);
|
|
451
|
+
const w = Math.max(1, numberValue(layout['w'], basisW));
|
|
452
|
+
const h = Math.max(1, numberValue(layout['h'], basisH));
|
|
453
|
+
const baseBox = { x, y, w, h };
|
|
454
|
+
const adjustedBox = absoluteNestedBlockGridTailPlacementStyle(block, data) ?? baseBox;
|
|
455
|
+
const sparseRowFill = customCanvasSparseAbsoluteNestedRowFill(block, data);
|
|
456
|
+
const sparseTopOffset = customCanvasSparseAbsoluteNestedTopOffset(data);
|
|
457
|
+
const top = Math.max(0, adjustedBox.y - sparseTopOffset);
|
|
458
|
+
return {
|
|
459
|
+
...style,
|
|
460
|
+
position: 'absolute',
|
|
461
|
+
left: layoutPercent((adjustedBox.x / basisW) * 100),
|
|
462
|
+
top: sparseRowFill ? '0%' : layoutPercent((top / basisH) * 100),
|
|
463
|
+
width: layoutPercent((adjustedBox.w / basisW) * 100),
|
|
464
|
+
height: sparseRowFill ? '100%' : layoutPercent((h / basisH) * 100),
|
|
465
|
+
overflow: 'hidden',
|
|
466
|
+
};
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
function nestedBlockAccentStyle(block: CustomCanvasNestedBlock): CSSProperties | undefined {
|
|
470
|
+
const visual = (isRecord(block.visual) ? block.visual : {}) as Record<string, unknown>;
|
|
471
|
+
return typeof visual.accentColor === 'string' ? { color: visual.accentColor } : undefined;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
/**
|
|
475
|
+
* Converts a finite number into a bounded percentage for positioned screenshot elements.
|
|
476
|
+
* @param value - Raw coordinate or dimension from image recognition.
|
|
477
|
+
* @returns Percentage string when the value is finite.
|
|
478
|
+
*/
|
|
479
|
+
function customCanvasPercent(value: unknown): string | undefined {
|
|
480
|
+
if (typeof value !== 'number' || !Number.isFinite(value)) return undefined;
|
|
481
|
+
return `${Math.max(0, Math.min(100, value))}%`;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* Reads safe CSS properties from an image-recognized customCanvas element.
|
|
486
|
+
* @param style - Raw model style object.
|
|
487
|
+
* @returns CSS properties allowed for screenshot text/badge fidelity.
|
|
488
|
+
*/
|
|
489
|
+
function customCanvasSafeElementStyle(style: unknown): CSSProperties {
|
|
490
|
+
if (!isRecord(style)) return {};
|
|
491
|
+
const allowedKeys = new Set([
|
|
492
|
+
'background',
|
|
493
|
+
'backgroundColor',
|
|
494
|
+
'borderColor',
|
|
495
|
+
'borderRadius',
|
|
496
|
+
'color',
|
|
497
|
+
'fontSize',
|
|
498
|
+
'fontWeight',
|
|
499
|
+
'lineHeight',
|
|
500
|
+
'opacity',
|
|
501
|
+
'textAlign',
|
|
502
|
+
]);
|
|
503
|
+
return Object.fromEntries(
|
|
504
|
+
Object.entries(style as Record<string, unknown>).filter(([key, value]) =>
|
|
505
|
+
allowedKeys.has(key) && (typeof value === 'string' || typeof value === 'number'),
|
|
506
|
+
),
|
|
507
|
+
) as CSSProperties;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
/**
|
|
511
|
+
* Builds absolute-position CSS for OCR/header customCanvas elements.
|
|
512
|
+
* @param element - Model-recognized customCanvas element with optional x/y/w/h.
|
|
513
|
+
* @returns CSS properties used to place the element within its screenshot container.
|
|
514
|
+
*/
|
|
515
|
+
function customCanvasElementStyle(element: CustomCanvasData['elements'][number]): CSSProperties {
|
|
516
|
+
const style: CSSProperties = {
|
|
517
|
+
...customCanvasSafeElementStyle(element.style),
|
|
518
|
+
left: customCanvasPercent(element.x) ?? '0%',
|
|
519
|
+
top: customCanvasPercent(element.y) ?? '0%',
|
|
520
|
+
};
|
|
521
|
+
const width = customCanvasPercent(element.w);
|
|
522
|
+
const height = customCanvasPercent(element.h);
|
|
523
|
+
if (width) style.width = width;
|
|
524
|
+
if (height) style.minHeight = height;
|
|
525
|
+
return style;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
/**
|
|
529
|
+
* Builds classes for absolute-position customCanvas elements.
|
|
530
|
+
* @param element - Model-recognized customCanvas element.
|
|
531
|
+
* @returns Tailwind class list for text, badge, metric, and divider elements.
|
|
532
|
+
*/
|
|
533
|
+
function customCanvasElementClasses(element: CustomCanvasData['elements'][number]): string[] {
|
|
534
|
+
const base = ['absolute', 'min-w-0', 'overflow-hidden'];
|
|
535
|
+
if (element.kind === 'badge') {
|
|
536
|
+
return [...base, 'inline-flex', 'items-center', 'justify-center', 'rounded', 'border', 'border-white/20', 'bg-white/12', 'px-2', 'py-1', 'text-xs', 'font-medium', 'leading-5'];
|
|
537
|
+
}
|
|
538
|
+
if (element.kind === 'metric') {
|
|
539
|
+
return [...base, 'text-sm', 'font-semibold', 'leading-5'];
|
|
540
|
+
}
|
|
541
|
+
if (element.kind === 'divider') {
|
|
542
|
+
return [...base, 'border-t', 'border-white/25'];
|
|
543
|
+
}
|
|
544
|
+
return [...base, 'text-sm', 'font-semibold', 'leading-5'];
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
function customCanvasStyle(block: WorkbenchBlock, data: CustomCanvasData): CSSProperties {
|
|
548
|
+
if (typeof customCanvasEmptyPageHeaderPlaceholder === 'function' && customCanvasEmptyPageHeaderPlaceholder(block, data)) {
|
|
549
|
+
return {
|
|
550
|
+
background: 'transparent',
|
|
551
|
+
borderColor: 'transparent',
|
|
552
|
+
boxShadow: 'none',
|
|
553
|
+
color: 'transparent',
|
|
554
|
+
};
|
|
555
|
+
}
|
|
556
|
+
const visual = customCanvasEffectiveVisual()(block, data);
|
|
557
|
+
const background = typeof data.background === 'string' && data.background.trim()
|
|
558
|
+
? data.background
|
|
559
|
+
: visual.backgroundColor || '#f8fafc';
|
|
560
|
+
const style = workbenchCardShellStyle(visual, { background });
|
|
561
|
+
if (recordHasImageComposeSource()(block.meta) && !style.color && /^#?(0f172a|111827|141414|1f2937)$/i.test(String(background).replace(/\s+/g, ''))) {
|
|
562
|
+
style.color = '#F8FAFC';
|
|
563
|
+
}
|
|
564
|
+
return style;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
/**
|
|
568
|
+
* Invokes the page-header detector regardless of whether the caller passed it directly
|
|
569
|
+
* or through the same lazy helper wrapper used by sibling canvas bindings.
|
|
570
|
+
* @param block - Custom canvas block being rendered.
|
|
571
|
+
* @param data - Custom canvas data for the block.
|
|
572
|
+
* @returns True when the canvas should render as source-image page chrome.
|
|
573
|
+
*/
|
|
574
|
+
function callCustomCanvasPageHeaderBlock(block: WorkbenchBlock, data: CustomCanvasData): boolean {
|
|
575
|
+
if (typeof customCanvasPageHeaderBlock !== 'function') return false;
|
|
576
|
+
try {
|
|
577
|
+
const directResult = customCanvasPageHeaderBlock(block, data);
|
|
578
|
+
if (typeof directResult === 'boolean') return directResult;
|
|
579
|
+
if (typeof directResult === 'function') return Boolean(directResult(block, data));
|
|
580
|
+
return Boolean(directResult);
|
|
581
|
+
} catch {
|
|
582
|
+
const wrapped = customCanvasPageHeaderBlock();
|
|
583
|
+
return typeof wrapped === 'function' ? Boolean(wrapped(block, data)) : Boolean(wrapped);
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
/**
|
|
588
|
+
* Builds density-aware classes for a V2 container projected as customCanvas.
|
|
589
|
+
* @param block - Container block carrying screenshot appearance metadata.
|
|
590
|
+
* @returns Tailwind class list for customCanvas spacing.
|
|
591
|
+
*/
|
|
592
|
+
function customCanvasShellClasses(block: WorkbenchBlock): string[] {
|
|
593
|
+
const densityValue = visualFor(block).density || props.density;
|
|
594
|
+
const data = block.data as CustomCanvasData | undefined;
|
|
595
|
+
const headerBanner = customCanvasHeaderBannerBlock()(block)
|
|
596
|
+
|| (data ? callCustomCanvasPageHeaderBlock(block, data) : false);
|
|
597
|
+
return [
|
|
598
|
+
headerBanner
|
|
599
|
+
? 'flex h-full min-h-0 w-full flex-col overflow-hidden border-0'
|
|
600
|
+
: 'relative flex h-full min-h-0 w-full flex-col overflow-hidden border border-slate-100',
|
|
601
|
+
customCanvasShowsStructureLabels()(block) ? 'workbench-custom-canvas-show-structure' : 'workbench-custom-canvas-image',
|
|
602
|
+
headerBanner
|
|
603
|
+
? 'p-0'
|
|
604
|
+
: workbenchShellDensityClasses(densityValue, { compact: 'space-y-2 p-3', standard: 'space-y-3 p-4' }),
|
|
605
|
+
];
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
/**
|
|
609
|
+
* Builds density-aware classes for a nested child preview.
|
|
610
|
+
* @param block - Nested preview block carrying child appearance metadata.
|
|
611
|
+
* @returns Tailwind class list for nested preview spacing.
|
|
612
|
+
*/
|
|
613
|
+
function nestedBlockShellClasses(block: CustomCanvasNestedBlock, absoluteLayout = false, denseStack = false, naturalGrid = false): string[] {
|
|
614
|
+
const densityValue = block.visual?.density || props.density;
|
|
615
|
+
return [
|
|
616
|
+
'workbench-nested-card-preview-shell flex flex-col min-w-0 rounded-md border border-slate-300 bg-white text-left shadow-[inset_0_0_0_1px_rgba(76,120,252,0.08)] transition hover:border-[#4C78FC] hover:bg-[#f8fbff] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#4C78FC] focus-visible:ring-offset-2',
|
|
617
|
+
absoluteLayout ? 'ring-1 ring-slate-200/80' : '',
|
|
618
|
+
absoluteLayout || naturalGrid ? `overflow-hidden ${nestedBlockGridMinHeightClass(block, denseStack)}` : `h-full overflow-hidden ${nestedBlockGridMinHeightClass(block, denseStack)}`,
|
|
619
|
+
workbenchShellDensityClasses(densityValue, { compact: 'px-2 py-2', standard: 'px-3 py-2' }),
|
|
620
|
+
];
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
/**
|
|
624
|
+
* Applies screenshot-level visual appearance to a manual placeholder shell.
|
|
625
|
+
* @param block - Placeholder block projected from image compose.
|
|
626
|
+
* @returns CSS properties for the placeholder container.
|
|
627
|
+
*/
|
|
628
|
+
|
|
629
|
+
return {
|
|
630
|
+
customCanvasNestedStackContainerStyle,
|
|
631
|
+
customCanvasNestedStackColumnWeights,
|
|
632
|
+
customCanvasReadableNestedStackColumnWeights,
|
|
633
|
+
nestedBlockCanvasStyle,
|
|
634
|
+
nestedBlockStackGridStyle,
|
|
635
|
+
customCanvasNestedLayoutItem,
|
|
636
|
+
customCanvasRegularNestedStackGrid,
|
|
637
|
+
nestedBlockStackTailPlacementStyle,
|
|
638
|
+
nestedBlockHasLayout,
|
|
639
|
+
customCanvasAbsoluteNestedBox,
|
|
640
|
+
customCanvasAbsoluteNestedOverlapArea,
|
|
641
|
+
customCanvasAbsoluteNestedWidthSpan,
|
|
642
|
+
customCanvasSparseAbsoluteNestedRowFill,
|
|
643
|
+
customCanvasAbsoluteNestedRows,
|
|
644
|
+
absoluteNestedBlockGridTailPlacementStyle,
|
|
645
|
+
customCanvasSparseAbsoluteNestedTopOffset,
|
|
646
|
+
layoutPercent,
|
|
647
|
+
nestedBlockUsesGlobalCoordinates,
|
|
648
|
+
nestedBlockLocalCoordinate,
|
|
649
|
+
nestedBlockAbsoluteStyle,
|
|
650
|
+
nestedBlockAccentStyle,
|
|
651
|
+
customCanvasPercent,
|
|
652
|
+
customCanvasSafeElementStyle,
|
|
653
|
+
customCanvasElementStyle,
|
|
654
|
+
customCanvasElementClasses,
|
|
655
|
+
customCanvasStyle,
|
|
656
|
+
callCustomCanvasPageHeaderBlock,
|
|
657
|
+
customCanvasShellClasses,
|
|
658
|
+
nestedBlockShellClasses,
|
|
659
|
+
};
|
|
660
|
+
}
|