soma-kit 0.1.14 → 0.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +8 -5
- package/packs/ai/model-card.ts +3 -3
- package/packs/finance/reconcile-desk/compile.ts +1 -1
- package/packs/finance/reconcile-desk/shell.ts +1 -1
- package/packs/ops/error-budget-card.ts +3 -3
- package/packs/ops/release-readiness-card.ts +3 -3
- package/packs/security/control-evidence-card.ts +3 -3
- package/packs/security/finding-card.ts +3 -2
- package/packs/shared/card-util.ts +17 -0
- package/spec/generated/kit-app.schema.json +2148 -338
- package/spec/generated/kit-page.schema.json +1152 -87
- package/spec/kit-grammar.json +1084 -136
- package/spec/kit-grammar.schema.json +167 -26
- package/src/app/app-config.ts +220 -187
- package/src/app/component-gate.ts +2 -2
- package/src/app/compose-apps.ts +5 -2
- package/src/app/define-kit-actions.ts +200 -22
- package/src/app/define-kit-app.ts +54 -8
- package/src/app/define-kit-view.ts +1 -1
- package/src/app/index.ts +12 -7
- package/src/app/kit-view-context.ts +50 -3
- package/src/app/list-page-defaults.ts +14 -0
- package/src/app/server-pages.ts +239 -7
- package/src/app/server.ts +466 -25
- package/src/app/theme-endpoint.ts +68 -24
- package/src/app/theme-runtime.ts +421 -87
- package/src/app/theme-shards.ts +69 -0
- package/src/app/tier-compat.ts +107 -0
- package/src/base/action-busy.ts +215 -38
- package/src/base/affix.ts +137 -0
- package/src/base/alert.ts +107 -59
- package/src/base/anchored-layer.ts +8 -7
- package/src/base/avatar.ts +147 -61
- package/src/base/badge.ts +186 -0
- package/src/base/button-group.ts +227 -0
- package/src/base/button.ts +365 -53
- package/src/base/card.ts +233 -0
- package/src/base/cascader.ts +147 -32
- package/src/base/check-core.ts +196 -33
- package/src/base/checkbox.ts +67 -2
- package/src/base/choice.ts +132 -31
- package/src/base/collapse.ts +249 -0
- package/src/base/color-picker.ts +404 -28
- package/src/base/combobox.ts +6 -2
- package/src/base/command-palette.ts +155 -37
- package/src/base/context-menu.ts +26 -6
- package/src/base/countdown.ts +37 -15
- package/src/base/date-range.ts +115 -94
- package/src/base/date.ts +487 -76
- package/src/base/delta.ts +20 -11
- package/src/base/divider.ts +64 -97
- package/src/base/end-edge.ts +10 -4
- package/src/base/fab.ts +64 -23
- package/src/base/gap-value.ts +35 -16
- package/src/base/hint-tips.ts +100 -30
- package/src/base/identity-cells.ts +839 -0
- package/src/base/illustrations.ts +6 -4
- package/src/base/image.ts +40 -19
- package/src/base/index.ts +92 -24
- package/src/base/inline-error.ts +90 -0
- package/src/base/input.ts +174 -38
- package/src/base/kbd.ts +31 -17
- package/src/base/kit-contract.ts +400 -0
- package/src/base/link.ts +41 -20
- package/src/base/listbox-core.ts +324 -95
- package/src/base/loading-gate.ts +3 -0
- package/src/base/look.ts +197 -0
- package/src/base/mentions.ts +58 -22
- package/src/base/menu-button.ts +129 -42
- package/src/base/menu-core.ts +210 -26
- package/src/base/month-grid.ts +60 -3
- package/src/base/motion/aura.ts +52 -10
- package/src/base/motion/hover-3d.ts +10 -5
- package/src/base/motion/hover-gallery.ts +19 -12
- package/src/base/motion/limits.ts +10 -0
- package/src/base/motion/marquee.ts +18 -11
- package/src/base/motion/text-rotate.ts +34 -16
- package/src/base/notification.ts +292 -0
- package/src/base/number.ts +93 -12
- package/src/base/otp.ts +143 -27
- package/src/base/overlay-runtime.ts +32 -24
- package/src/base/overlay-shell.ts +186 -0
- package/src/base/period-picker.ts +868 -0
- package/src/base/popover.ts +625 -74
- package/src/base/popup.ts +219 -78
- package/src/base/portal-core.ts +99 -2
- package/src/base/price-text.ts +51 -17
- package/src/base/progress.ts +100 -18
- package/src/base/qr-code.ts +64 -17
- package/src/base/qty-stepper.ts +145 -21
- package/src/base/radio.ts +43 -2
- package/src/base/range.ts +194 -39
- package/src/base/rating.ts +117 -31
- package/src/base/reason-tip.ts +60 -18
- package/src/base/relation-cells.ts +541 -0
- package/src/{frames → base}/resize-handle.ts +6 -4
- package/src/base/row-fresh.ts +84 -0
- package/src/base/section-spy.ts +79 -0
- package/src/base/segmented.ts +99 -56
- package/src/base/select.ts +8 -2
- package/src/base/shared.ts +520 -73
- package/src/base/spinner.ts +107 -0
- package/src/base/state-panel.ts +77 -22
- package/src/base/status-tone.ts +1 -1
- package/src/base/sticky-edge.ts +96 -29
- package/src/base/swap.ts +39 -21
- package/src/base/switch.ts +158 -38
- package/src/base/tabs.ts +292 -0
- package/src/base/tag-input.ts +129 -55
- package/src/base/tag.ts +203 -91
- package/src/base/text.ts +491 -77
- package/src/base/textarea.ts +89 -40
- package/src/base/time-picker.ts +341 -57
- package/src/base/time-range.ts +846 -0
- package/src/base/tree-select.ts +346 -89
- package/src/base/upload.ts +612 -158
- package/src/base/view-transition.ts +7 -3
- package/src/base/virtual-list.ts +49 -14
- package/src/biz/approval-desk/compile.ts +98 -6
- package/src/biz/approval-desk/index.ts +2 -0
- package/src/biz/approval-desk/shell.ts +53 -13
- package/src/biz/auth-panel/compile.ts +14 -4
- package/src/biz/auth-panel/shell.ts +28 -8
- package/src/biz/category-crud/compile.ts +64 -13
- package/src/biz/category-crud/index.ts +2 -0
- package/src/biz/category-crud/shell.ts +30 -8
- package/src/biz/checkout-page/compile.ts +38 -4
- package/src/biz/checkout-page/index.ts +1 -0
- package/src/biz/checkout-page/shell.ts +28 -10
- package/src/biz/compose.ts +9 -4
- package/src/biz/data-components.ts +2 -0
- package/src/biz/define.ts +1 -1
- package/src/biz/import-wizard/compile.ts +5 -2
- package/src/biz/import-wizard/index.ts +1 -0
- package/src/biz/import-wizard/shell.ts +36 -20
- package/src/biz/index.ts +5 -4
- package/src/biz/landing-page/compile.ts +4 -3
- package/src/biz/landing-page/shell.ts +25 -5
- package/src/biz/layout-contracts.ts +918 -0
- package/src/biz/link/hub.ts +199 -8
- package/src/biz/link/shared.ts +62 -16
- package/src/biz/master-sub/compile.ts +318 -38
- package/src/biz/master-sub/detail-head.ts +145 -21
- package/src/biz/master-sub/index.ts +6 -3
- package/src/biz/master-sub/shell.ts +232 -66
- package/src/biz/multi-board/compile.ts +89 -38
- package/src/biz/multi-board/composition.ts +7 -20
- package/src/biz/multi-board/index.ts +25 -9
- package/src/biz/multi-board/prose-fold.ts +17 -13
- package/src/biz/multi-board/shell.ts +153 -38
- package/src/biz/names.ts +1 -0
- package/src/biz/notification-center/compile.ts +28 -7
- package/src/biz/notification-center/index.ts +2 -0
- package/src/biz/notification-center/shell.ts +51 -11
- package/src/biz/page-templates/domain-templates.ts +147 -20
- package/src/biz/page-templates/result-page/compile.ts +5 -2
- package/src/biz/page-templates/result-page/index.ts +1 -0
- package/src/biz/page-templates/result-page/shell.ts +20 -6
- package/src/biz/page-templates/shared.ts +1 -1
- package/src/biz/page-templates/sign-in-page/compile.ts +20 -9
- package/src/biz/page-templates/sign-in-page/index.ts +1 -0
- package/src/biz/page-templates/sign-in-page/shell.ts +30 -14
- package/src/biz/record-detail/compile.ts +43 -12
- package/src/biz/record-detail/index.ts +1 -0
- package/src/biz/record-detail/shell.ts +42 -11
- package/src/biz/settings-center/compile.ts +5 -2
- package/src/biz/settings-center/index.ts +1 -0
- package/src/biz/settings-center/shell.ts +33 -9
- package/src/biz/shared/action-host.ts +146 -48
- package/src/biz/shared/compile-helpers.ts +134 -32
- package/src/biz/shared/coordinator.ts +727 -163
- package/src/biz/shared/focus-return.ts +180 -0
- package/src/biz/shared/object-aliases.ts +7 -1
- package/src/biz/shared/overlay-compile.ts +102 -24
- package/src/biz/shared/overlay-shell.ts +97 -116
- package/src/biz/shared/page-form-actions.ts +151 -0
- package/src/biz/shared/page-form.ts +255 -0
- package/src/biz/shared/pipeline.ts +74 -0
- package/src/biz/shared/runtime-hub.ts +101 -8
- package/src/biz/shared/verbs.ts +129 -0
- package/src/biz/single-form/compile.ts +6 -4
- package/src/biz/single-form/index.ts +2 -0
- package/src/biz/single-form/shell.ts +22 -8
- package/src/biz/standard-crud/compile.ts +213 -38
- package/src/biz/standard-crud/index.ts +2 -1
- package/src/biz/standard-crud/shell.ts +90 -13
- package/src/biz/standard-crud/summary.ts +2 -35
- package/src/biz/step-form/compile.ts +13 -4
- package/src/biz/step-form/hub.ts +168 -49
- package/src/biz/step-form/index.ts +1 -0
- package/src/biz/step-form/shell.ts +35 -17
- package/src/biz/types.ts +49 -6
- package/src/cli/app-layer-check.ts +375 -0
- package/src/cli/kit-cli.ts +179 -33
- package/src/cli/kit-init.ts +152 -3
- package/src/cli/migrate/theme-map.ts +35 -28
- package/src/cli/migrate/ts-rules.ts +2 -2
- package/src/cli/migrate/types.ts +3 -3
- package/src/cli/migrate/yaml-rules.ts +11 -9
- package/src/cli/view-writes.ts +13 -0
- package/src/compile/access-gate-attach.ts +1 -1
- package/src/compile/action-host-attach.ts +1 -1
- package/src/compile/closed-set.ts +102 -6
- package/src/compile/compile-page.ts +461 -273
- package/src/compile/component-candidates.ts +58 -5
- package/src/compile/danger-tier.ts +65 -0
- package/src/compile/hints.ts +6 -59
- package/src/compile/index.ts +2 -2
- package/src/compile/info-structure.ts +155 -0
- package/src/compile/layout-lint/index.ts +4 -1
- package/src/compile/layout-lint/rules-composition.ts +44 -13
- package/src/compile/layout-lint/rules-table.ts +4 -19
- package/src/compile/look-page.ts +551 -0
- package/src/compile/look.ts +376 -0
- package/src/compile/page-composition.ts +405 -67
- package/src/compile/page-hierarchy.ts +131 -0
- package/src/compile/page-pipeline-look.ts +156 -0
- package/src/compile/page-pipeline.ts +200 -0
- package/src/compile/parse.ts +12 -11
- package/src/compile/redirect.ts +1 -1
- package/src/compile/relation-render.ts +120 -0
- package/src/compile/remove-guard.ts +115 -41
- package/src/compile/stages.ts +786 -0
- package/src/compile/styles.ts +286 -48
- package/src/compile/types.ts +63 -6
- package/src/compile/view-check.ts +190 -1
- package/src/data/access-gate.ts +17 -9
- package/src/data/amount-breakdown.ts +52 -23
- package/src/data/anchor-nav.ts +77 -16
- package/src/data/approval-flow.ts +217 -126
- package/src/data/assignment-picker.ts +182 -94
- package/src/data/async-result-panel.ts +114 -46
- package/src/data/audit-log.ts +461 -0
- package/src/data/breadcrumbs.ts +150 -24
- package/src/data/calendar.ts +436 -97
- package/src/data/card-grid.ts +319 -0
- package/src/data/carousel.ts +81 -41
- package/src/data/cell-value.ts +253 -0
- package/src/data/chart.ts +1053 -96
- package/src/data/checklist.ts +82 -38
- package/src/data/code-view.ts +296 -44
- package/src/data/comment-thread.ts +611 -86
- package/src/data/compare-view.ts +227 -0
- package/src/data/confirm-dialog.ts +250 -39
- package/src/data/context-menu.ts +95 -21
- package/src/data/d9-limits.ts +2 -0
- package/src/data/d9-util.ts +13 -5
- package/src/data/diff.ts +109 -49
- package/src/data/display-util.ts +9 -4
- package/src/data/dock.ts +38 -18
- package/src/data/embed.ts +143 -8
- package/src/data/engine-ports.ts +135 -0
- package/src/data/field-mapper.ts +116 -54
- package/src/data/file-list.ts +522 -0
- package/src/data/flow-editor.ts +695 -158
- package/src/data/flow-node-options.ts +24 -5
- package/src/data/flow-remote-options.ts +94 -19
- package/src/data/footer.ts +88 -26
- package/src/data/form-draft-registry.ts +183 -12
- package/src/data/gantt.ts +640 -117
- package/src/data/graph-view.ts +51 -0
- package/src/data/heat-calendar.ts +412 -0
- package/src/data/hero.ts +40 -13
- package/src/data/image-viewer.ts +265 -62
- package/src/data/index.ts +75 -6
- package/src/data/item-list.ts +219 -58
- package/src/data/json-view.ts +909 -0
- package/src/data/kanban.ts +346 -91
- package/src/data/kit-contract.ts +230 -0
- package/src/data/leaderboard.ts +343 -0
- package/src/data/level-class.ts +21 -0
- package/src/data/log-stream.ts +347 -0
- package/src/data/markdown-view.ts +597 -0
- package/src/data/matrix.ts +234 -120
- package/src/data/media-grid.ts +165 -38
- package/src/data/mega-menu.ts +43 -26
- package/src/data/menu-bar.ts +254 -0
- package/src/data/menu-dom.ts +55 -19
- package/src/data/menu.ts +138 -48
- package/src/data/mockup.ts +37 -25
- package/src/data/modal-dialog.ts +126 -98
- package/src/data/navbar.ts +152 -66
- package/src/data/notice-list.ts +101 -49
- package/src/data/notify-renderer.ts +80 -15
- package/src/data/object-form.ts +1504 -164
- package/src/data/org-chart.ts +544 -0
- package/src/data/outcome-watch.ts +90 -21
- package/src/data/pager.ts +129 -45
- package/src/data/panel-head.ts +238 -76
- package/src/data/permission-matrix.ts +379 -120
- package/src/data/permission-tree.ts +146 -78
- package/src/data/pricing-table.ts +112 -43
- package/src/data/prompt-dialog.ts +49 -21
- package/src/data/reaction-bar.ts +67 -32
- package/src/data/record-card.ts +245 -72
- package/src/data/record-picker.ts +61 -28
- package/src/data/redirect.ts +39 -15
- package/src/data/request-console.ts +141 -38
- package/src/data/resident.ts +11 -13
- package/src/data/result-panel.ts +65 -27
- package/src/data/rich-text.ts +260 -127
- package/src/data/row-confirm.ts +47 -0
- package/src/data/row-editor.ts +384 -105
- package/src/data/rule-builder.ts +136 -81
- package/src/data/schedule-grid.ts +238 -0
- package/src/data/segment-bar.ts +221 -0
- package/src/data/shape-util.ts +90 -36
- package/src/data/stage-flow.ts +244 -0
- package/src/data/staged-rows.ts +207 -24
- package/src/data/stat-group.ts +493 -100
- package/src/data/static-lazy.ts +21 -0
- package/src/data/static-registry.ts +46 -4
- package/src/data/status-strip.ts +171 -0
- package/src/data/steps.ts +69 -36
- package/src/data/summary-strip.ts +136 -0
- package/src/data/summary-util.ts +116 -0
- package/src/data/survey.ts +134 -47
- package/src/data/system-switcher.ts +53 -24
- package/src/data/target-progress.ts +208 -0
- package/src/data/text-action-button.ts +28 -7
- package/src/data/text-diff.ts +731 -0
- package/src/data/tile-grid.ts +343 -0
- package/src/data/timeline.ts +205 -36
- package/src/data/tour-guide.ts +113 -47
- package/src/data/transfer.ts +204 -47
- package/src/data/tree-table.ts +228 -81
- package/src/data/tree.ts +193 -69
- package/src/data/trend-line.ts +68 -12
- package/src/data/virtual-rows.ts +248 -98
- package/src/data/waterfall.ts +171 -0
- package/src/data/watermark.ts +35 -6
- package/src/data/wrap.ts +28 -6
- package/src/frames/blank-frame.ts +6 -4
- package/src/frames/index.ts +4 -4
- package/src/frames/inherited-shell.ts +219 -0
- package/src/frames/page-bar.ts +208 -28
- package/src/frames/page-status.ts +3 -2
- package/src/frames/resident-components.ts +18 -0
- package/src/frames/shared.ts +73 -26
- package/src/frames/single-frame.ts +20 -4
- package/src/frames/split-frame/shell.ts +27 -17
- package/src/frames/split-frame/wiring.ts +16 -12
- package/src/frames/tabs-frame/shell.ts +14 -7
- package/src/frames/tabs-frame/wiring.ts +2 -1
- package/src/frames/top-main-frame.ts +55 -3
- package/src/frames/types.ts +5 -2
- package/src/frames/workspace-frame/extras.ts +23 -7
- package/src/frames/workspace-frame/index.ts +1 -1
- package/src/frames/workspace-frame/pipeline-key.ts +6 -0
- package/src/frames/workspace-frame/shell.ts +24 -3
- package/src/frames/workspace-frame/state.ts +42 -8
- package/src/frames/workspace-frame/view.ts +773 -194
- package/src/generated/kit-grammar-runtime.ts +1061 -77
- package/src/generated/kit-page.ts +272 -0
- package/src/i18n/index.ts +2 -0
- package/src/i18n/kit-text.ts +210 -5
- package/src/i18n/resolve-text-refs.ts +1 -1
- package/src/object-renderer/action-group.ts +204 -22
- package/src/object-renderer/action-more.ts +66 -19
- package/src/object-renderer/arrange.ts +270 -28
- package/src/object-renderer/category-tone.ts +96 -0
- package/src/object-renderer/collapse-wiring.ts +19 -9
- package/src/object-renderer/collection-expand.ts +3 -3
- package/src/object-renderer/collection-parts.ts +459 -103
- package/src/object-renderer/collection-table.ts +406 -59
- package/src/object-renderer/collection.ts +333 -71
- package/src/object-renderer/compile-data.ts +13 -3
- package/src/object-renderer/defaults.ts +14 -5
- package/src/object-renderer/emit-events.ts +46 -20
- package/src/object-renderer/emit-object.ts +35 -6
- package/src/object-renderer/emit-static.ts +831 -153
- package/src/object-renderer/field-value.ts +12 -239
- package/src/object-renderer/filter-plan.ts +3 -3
- package/src/object-renderer/filter-toolbar.ts +190 -0
- package/src/object-renderer/form-detail.ts +87 -2
- package/src/{compile → object-renderer}/fragment.ts +2 -2
- package/src/object-renderer/index.ts +1 -1
- package/src/object-renderer/key-field.ts +21 -0
- package/src/object-renderer/layout-facts.ts +55 -7
- package/src/object-renderer/layout-plan.ts +6 -3
- package/src/object-renderer/overlay-decide.ts +124 -0
- package/src/object-renderer/pick-component.ts +8 -2
- package/src/object-renderer/pipeline-mode.ts +6 -0
- package/src/object-renderer/relation-field.ts +79 -0
- package/src/object-renderer/render-object.ts +72 -27
- package/src/object-renderer/request-actions.ts +119 -21
- package/src/object-renderer/table-actions.ts +479 -111
- package/src/object-renderer/table-gap.ts +2 -1
- package/src/object-renderer/table-reorder.ts +237 -0
- package/src/object-renderer/table-summary.ts +26 -12
- package/src/object-renderer/table-tools.ts +437 -130
- package/src/object-renderer/types.ts +100 -17
- package/src/object-renderer/value-present.ts +49 -0
- package/src/page-target/ai-surface.ts +15 -22
- package/src/page-target/compile.ts +5 -6
- package/src/page-target/drift.ts +0 -7
- package/src/page-target/intent-schema.ts +46 -43
- package/src/page-target/target.ts +4 -5
- package/src/page-target/writer-policy.ts +4 -5
- package/src/recipes/app-blocks.ts +66 -0
- package/src/recipes/chrome-surface.ts +20 -0
- package/src/recipes/code-view.ts +57 -0
- package/src/recipes/color-role.ts +442 -0
- package/src/recipes/compact-group.ts +32 -0
- package/src/recipes/composition-projector.ts +321 -0
- package/src/recipes/container.ts +93 -26
- package/src/recipes/control.ts +85 -8
- package/src/recipes/desc-list.ts +108 -0
- package/src/recipes/divider.ts +74 -0
- package/src/recipes/emphasis.ts +102 -13
- package/src/recipes/field-text.ts +72 -0
- package/src/recipes/form-section.ts +177 -0
- package/src/recipes/frame-bleed.ts +6 -5
- package/src/recipes/index.ts +39 -5
- package/src/recipes/inherited-shell.ts +43 -0
- package/src/recipes/json-view.ts +50 -0
- package/src/recipes/look.ts +56 -0
- package/src/recipes/mark.ts +138 -0
- package/src/recipes/markdown.ts +96 -0
- package/src/recipes/overlay.ts +151 -37
- package/src/recipes/page-width.ts +51 -0
- package/src/recipes/pipeline-runtime.ts +366 -0
- package/src/recipes/placeholder.ts +38 -20
- package/src/recipes/rail-grid.ts +6 -3
- package/src/recipes/self-owned.ts +59 -0
- package/src/recipes/slot-align.ts +5 -3
- package/src/recipes/stat-state.ts +6 -6
- package/src/recipes/state.ts +64 -11
- package/src/recipes/status.ts +21 -20
- package/src/recipes/strip.ts +114 -0
- package/src/recipes/surface-edge.ts +3 -1
- package/src/recipes/surface.ts +40 -7
- package/src/recipes/table-gap.ts +4 -3
- package/src/recipes/table-native-edit.ts +25 -12
- package/src/recipes/table-row.ts +56 -20
- package/src/recipes/tabs.ts +140 -31
- package/src/recipes/text-diff.ts +97 -0
- package/src/recipes/text-fit.ts +132 -0
- package/src/recipes/title-row.ts +72 -5
- package/src/recipes/typography.ts +2 -2
- package/src/shared/action-func.ts +106 -0
- package/src/shared/color-scheme.ts +127 -0
- package/src/shared/confirm-decl.ts +5 -2
- package/src/shared/danger-facts.ts +55 -0
- package/src/shared/diagnostics.ts +16 -0
- package/src/shared/dom-attrs-registry.ts +1009 -0
- package/src/shared/dom-attrs.ts +743 -0
- package/src/shared/envelope.ts +1 -1
- package/src/shared/field-kind.ts +49 -0
- package/src/shared/field-value-format.ts +292 -0
- package/src/shared/focus-ring.ts +8 -0
- package/src/shared/glyphs.ts +127 -0
- package/src/shared/hints.ts +56 -0
- package/src/{base → shared}/icons.ts +40 -1
- package/src/shared/identifier-field.ts +66 -0
- package/src/shared/kit-error.ts +1 -1
- package/src/shared/list-pager.ts +23 -0
- package/src/shared/list-title.ts +29 -0
- package/src/{object-renderer → shared}/merge-class.ts +3 -2
- package/src/shared/order-value.ts +15 -0
- package/src/shared/page-attrs-runtime.ts +327 -0
- package/src/shared/page-attrs.ts +262 -0
- package/src/shared/path-guard.ts +1 -1
- package/src/shared/pipeline-mode.ts +64 -0
- package/src/shared/primitives-types.ts +8 -0
- package/src/shared/row-key.ts +15 -0
- package/src/shared/theme-runtime-shared.ts +181 -21
- package/src/shared/theme-usage.ts +16 -0
- package/src/shared/value-table-contract.ts +68 -0
- package/src/spatial/action-func.ts +4 -0
- package/src/spatial/declared-actions.ts +116 -0
- package/src/spatial/emit.ts +660 -0
- package/src/spatial/expand.ts +1482 -0
- package/src/spatial/field-types.ts +48 -0
- package/src/spatial/index.ts +82 -0
- package/src/spatial/layout.ts +697 -0
- package/src/spatial/look-apply.ts +206 -0
- package/src/spatial/page-decl.ts +44 -0
- package/src/spatial/page-object.ts +349 -0
- package/src/spatial/recognize.ts +491 -0
- package/src/spatial/self-report.ts +571 -0
- package/src/spatial/shape.ts +205 -0
- package/src/spatial/spatial-map.ts +136 -0
- package/src/spatial/tone.ts +145 -0
- package/src/theme/index.ts +11 -2
- package/src/theme/kit-theme-text.ts +1 -1
- package/src/theme/kit-theme.css +563 -28
- package/src/theme/kit-theme.tpl +527 -28
- package/src/theme/look-carrier.ts +65 -0
- package/src/theme/nine-dim-structure.ts +538 -176
- package/src/theme/private-vars.ts +153 -0
- package/src/theme/surface-layers.ts +12 -3
- package/src/theme/theme-tokens.ts +1602 -90
- package/src/theme/theme-types.ts +38 -59
- package/src/theme/value-table.ts +2379 -0
- package/src/app/envelope.ts +0 -1
- package/src/app/notify-renderer.ts +0 -1
- package/src/app/paged-list-adapter.ts +0 -1
- package/src/app/theme-runtime-shared.ts +0 -1
- package/src/compile/kit-error.ts +0 -1
- package/src/frames/list-summary.ts +0 -100
- package/src/recipes/nowrap.ts +0 -16
- package/src/theme/block-theme.ts +0 -202
- /package/src/{base → shared}/class-candidates.ts +0 -0
|
@@ -4,9 +4,40 @@
|
|
|
4
4
|
|
|
5
5
|
import { SOMA_PIPELINE_FIELD_ROLES } from 'soma-foundation/data/generated';
|
|
6
6
|
import type { KitPanelKind } from 'soma-foundation/kit-layout';
|
|
7
|
-
import type { KitPageDecl, KitProductDecl, KitTabDecl } from '../compile/types';
|
|
8
7
|
import { normalizeRef } from './arrange';
|
|
9
8
|
import type { KitFieldRef, KitType, KitViewSlot } from './types';
|
|
9
|
+
import { kitActionFunctionOfDecl, kitActionItemTone } from './table-actions';
|
|
10
|
+
import type { KitActionFunction } from '../recipes/emphasis';
|
|
11
|
+
|
|
12
|
+
/** 布局事实提取所需的产品声明结构(结构子类型兼容 compile/types.ts 的 KitProductDecl,避免数据层反向依赖编译层) */
|
|
13
|
+
export interface KitFactProductInput {
|
|
14
|
+
kind: string;
|
|
15
|
+
objects: Record<string, unknown>;
|
|
16
|
+
class?: string;
|
|
17
|
+
areaClass?: Record<string, string>;
|
|
18
|
+
surface?: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** 布局事实提取所需的页签项结构(结构子类型兼容 KitTabDecl) */
|
|
22
|
+
export interface KitFactTabInput {
|
|
23
|
+
product: KitFactProductInput;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** 布局事实提取所需的页面声明结构(结构子类型兼容 KitPageDecl) */
|
|
27
|
+
export interface KitFactPageInput {
|
|
28
|
+
page: {
|
|
29
|
+
url: string;
|
|
30
|
+
title: string;
|
|
31
|
+
subtitle?: string;
|
|
32
|
+
maxWidth?: string;
|
|
33
|
+
};
|
|
34
|
+
frame: {
|
|
35
|
+
kind: string;
|
|
36
|
+
class?: string;
|
|
37
|
+
slotClass?: Record<string, string>;
|
|
38
|
+
slots: Record<string, KitFactProductInput | KitFactTabInput[]>;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
10
41
|
|
|
11
42
|
type Rec = Record<string, unknown>;
|
|
12
43
|
const isRec = (v: unknown): v is Rec => v !== null && typeof v === 'object' && !Array.isArray(v);
|
|
@@ -77,6 +108,10 @@ export interface KitFactView {
|
|
|
77
108
|
readonly collection: 'table' | 'treeTable' | 'cards' | 'stack' | 'compact-list' | null;
|
|
78
109
|
readonly rowActionIds: readonly string[];
|
|
79
110
|
readonly select: boolean;
|
|
111
|
+
/** 序号列(collection.index,仅普通表格):与勾选框同槽,槽宽取两者之和 */
|
|
112
|
+
readonly serial?: boolean;
|
|
113
|
+
/** 行拖拽柄(collection.reorder,仅普通表格):占前导槽,槽宽再加柄步长 */
|
|
114
|
+
readonly reorder?: boolean;
|
|
80
115
|
readonly hasFixedColumn: boolean;
|
|
81
116
|
readonly hasColumnsTool: boolean;
|
|
82
117
|
readonly hasExpand: boolean;
|
|
@@ -124,6 +159,8 @@ export interface KitPageFacts {
|
|
|
124
159
|
readonly url: string;
|
|
125
160
|
readonly frameKind: string;
|
|
126
161
|
readonly maxWidth: string | null;
|
|
162
|
+
/** 页面作者自己写的 page.max_width(不含页面模式推导与应用默认补上的版心);编译期由 analyzeKitPageLayout 的 declaredMaxWidth 覆写 */
|
|
163
|
+
readonly maxWidthDeclared: string | null;
|
|
127
164
|
readonly products: readonly KitFactProduct[];
|
|
128
165
|
readonly tabsDepth: number;
|
|
129
166
|
readonly frameClasses: ReadonlyArray<{ readonly key: string; readonly value: string; readonly path: string }>;
|
|
@@ -264,6 +301,8 @@ function viewFact(slot: KitViewSlot, raw: Rec, schema: Rec, at: string): KitFact
|
|
|
264
301
|
collection: collectionType === undefined ? null : collectionType,
|
|
265
302
|
rowActionIds: rowActionsRaw.filter((x): x is string => typeof x === 'string').map((x) => (x.startsWith('@') ? x.slice(1) : x)),
|
|
266
303
|
select: select === 'single' || select === 'multi' || (isRec(select) && (select.mode === 'single' || select.mode === 'multi')),
|
|
304
|
+
serial: collection?.index === true && collectionType !== 'treeTable' && collection.virtual === undefined,
|
|
305
|
+
reorder: typeof collection?.reorder === 'string' && collection.reorder !== '' && collectionType !== 'treeTable' && collection.virtual === undefined,
|
|
267
306
|
hasFixedColumn: allFields.some((f) => f.fixed),
|
|
268
307
|
hasColumnsTool: toolbar.includes('columns'),
|
|
269
308
|
hasExpand: collection?.expand !== undefined,
|
|
@@ -282,14 +321,22 @@ function actionFacts(behavior: unknown, at: string): KitFactAction[] {
|
|
|
282
321
|
behavior.actions.forEach((a, i) => {
|
|
283
322
|
if (!isRec(a) || typeof a.id !== 'string') return;
|
|
284
323
|
const tone = str(a.tone) ?? null;
|
|
324
|
+
// 主 / 危险与 KitTableActions、操作列估宽同一判据(SCON-169):显式 tone 优先,否则按功能名(声明的或按 builtin / id 推断的)取角色;
|
|
325
|
+
// builtin: remove 恒属危险
|
|
326
|
+
const fn = kitActionFunctionOfDecl({
|
|
327
|
+
id: a.id,
|
|
328
|
+
...(typeof a.builtin === 'string' ? { builtin: a.builtin } : {}),
|
|
329
|
+
...(typeof a.function === 'string' ? { function: a.function as KitActionFunction } : {}),
|
|
330
|
+
});
|
|
331
|
+
const itemTone = kitActionItemTone(a.tone, fn);
|
|
285
332
|
out.push({
|
|
286
333
|
id: a.id,
|
|
287
334
|
name: str(a.name) ?? a.id,
|
|
288
335
|
on: str(a.on) ?? '',
|
|
289
336
|
tone,
|
|
290
337
|
more: a.more === true,
|
|
291
|
-
danger:
|
|
292
|
-
primary:
|
|
338
|
+
danger: itemTone === 'danger' || a.builtin === 'remove',
|
|
339
|
+
primary: itemTone === 'primary',
|
|
293
340
|
path: `${at}.behavior.actions[${i}]`,
|
|
294
341
|
});
|
|
295
342
|
});
|
|
@@ -342,7 +389,7 @@ function objectFact(raw: Rec, role: string, name: string | null, isPanel: boolea
|
|
|
342
389
|
};
|
|
343
390
|
}
|
|
344
391
|
|
|
345
|
-
function productFact(product:
|
|
392
|
+
function productFact(product: KitFactProductInput, at: string, slot: string): KitFactProduct {
|
|
346
393
|
const objects: KitFactObject[] = [];
|
|
347
394
|
for (const [role, value] of Object.entries(product.objects ?? {})) {
|
|
348
395
|
if (!isRec(value)) continue;
|
|
@@ -365,16 +412,16 @@ function productFact(product: KitProductDecl, at: string, slot: string): KitFact
|
|
|
365
412
|
}
|
|
366
413
|
|
|
367
414
|
/** 页面声明 → 布局事实。声明形状不对的部分跳过,不抛。 */
|
|
368
|
-
export function extractKitPageFacts(decl:
|
|
415
|
+
export function extractKitPageFacts(decl: KitFactPageInput): KitPageFacts {
|
|
369
416
|
const products: KitFactProduct[] = [];
|
|
370
417
|
let tabsDepth = 0;
|
|
371
418
|
for (const [slot, val] of Object.entries(decl.frame.slots)) {
|
|
372
419
|
if (Array.isArray(val)) {
|
|
373
420
|
tabsDepth = Math.max(tabsDepth, 1);
|
|
374
|
-
(val as
|
|
421
|
+
(val as KitFactTabInput[]).forEach((tab, i) => products.push(productFact(tab.product, `frame.slots.${slot}[${i}].product`, slot)));
|
|
375
422
|
} else {
|
|
376
423
|
// 路径与 view-check 的 viewUsageOf 同口径(main 槽的产品在 YAML 里是顶层 product:),compile/locate 才定位得到行列
|
|
377
|
-
products.push(productFact(val as
|
|
424
|
+
products.push(productFact(val as KitFactProductInput, slot === 'main' ? 'product' : `frame.slots.${slot}`, slot));
|
|
378
425
|
}
|
|
379
426
|
}
|
|
380
427
|
const frameClasses: Array<{ key: string; value: string; path: string }> = classSites(decl.frame as unknown as Rec, 'frame', ['class']);
|
|
@@ -387,6 +434,7 @@ export function extractKitPageFacts(decl: KitPageDecl): KitPageFacts {
|
|
|
387
434
|
url: decl.page.url,
|
|
388
435
|
frameKind: decl.frame.kind,
|
|
389
436
|
maxWidth: decl.page.maxWidth ?? null,
|
|
437
|
+
maxWidthDeclared: decl.page.maxWidth ?? null,
|
|
390
438
|
products,
|
|
391
439
|
tabsDepth,
|
|
392
440
|
frameClasses,
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
} from 'soma-foundation/kit-layout';
|
|
23
23
|
import { arrangeFilter, arrangeForm, arrangeTierAtLeastRem, arrangeTiers, textWidthEm } from 'soma-foundation/arrange';
|
|
24
24
|
import { columnClassOfType } from 'soma-foundation/arrange/table';
|
|
25
|
-
import { columnTrackPlan, dateContentEm, type ColumnTrackColumn } from './collection-table';
|
|
25
|
+
import { columnTrackPlan, dateContentEm, leadStepOf, type ColumnTrackColumn } from './collection-table';
|
|
26
26
|
import { KIT_TABLE_EXT } from './defaults';
|
|
27
27
|
import { splitRowActions } from './table-actions';
|
|
28
28
|
import type { KitFactField, KitFactObject, KitFactView, KitPageFacts } from './layout-facts';
|
|
@@ -94,14 +94,17 @@ function planTable(object: KitFactObject, view: KitFactView, fields: readonly Ki
|
|
|
94
94
|
}));
|
|
95
95
|
const track = columnTrackPlan({
|
|
96
96
|
columns,
|
|
97
|
-
hasSelect: view.select,
|
|
97
|
+
hasSelect: view.select || view.serial === true || view.reorder === true,
|
|
98
|
+
leadSelect: view.select,
|
|
99
|
+
leadSerial: view.serial === true,
|
|
100
|
+
leadHandle: view.reorder === true,
|
|
98
101
|
actionLabelEms: split === null ? [] : split.inline.map((a) => textWidthEm(a.name)),
|
|
99
102
|
actionHasMore: split !== null && split.folded.length > 0,
|
|
100
103
|
actionCount: rowActions.length,
|
|
101
104
|
tier: kitRowActionsNarrowTier(),
|
|
102
105
|
});
|
|
103
106
|
const container = kitReferenceContainerRem();
|
|
104
|
-
const selectRem = view.select
|
|
107
|
+
const selectRem = leadStepOf(KIT_TABLE_EXT.narrowGrid, view.select, view.serial === true, view.reorder === true) * 0.25;
|
|
105
108
|
const actionsRem = track.actionsRem ?? 0;
|
|
106
109
|
const allExplicit = columns.length > 0 && columns.every((c) => (c.explicitWidth ?? 0) > 0);
|
|
107
110
|
const gapsRem = track.columns.reduce((s, c) => s + c.gapAfterRem, 0);
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
// 浮层决定(编译段):读页面声明里的浮层内容 -> 抽出「事实」(栏数、组件名)-> 调引擎 arrangeOverlay 拿决定(类型 / 宽度档)。
|
|
2
|
+
// 只做事实抽取与调引擎,不含任何取值、类名、阈值(规则在 kit-arrange#overlay,数字在 kit-limits);外壳(overlay-shell)只接收这里给出的档名去渲染。
|
|
3
|
+
// 流水线位置:真源 -> 引擎(soma-foundation/arrange)-> 本文件(读声明的一层,在 object-renderer,业务编译与外壳都在它之上)-> 外壳 / 配方。
|
|
4
|
+
// 不 import biz:下层不认识上层,窗口宽度档的类型在这里定义,外壳从这里取。
|
|
5
|
+
|
|
6
|
+
import { arrangeEditContainer, arrangeOverlay, arrangeOverlayFooter, type ArrangeOverlayFooterPlan } from 'soma-foundation/arrange';
|
|
7
|
+
import type { KitDrawerWidth } from '../recipes/overlay';
|
|
8
|
+
|
|
9
|
+
/** 表单窗口宽度档:default 480 / wide 640 / xwide 800(px 在 kit-limits#overlay.dialogPx) */
|
|
10
|
+
export type KitDialogWidth = 'default' | 'wide' | 'xwide';
|
|
11
|
+
|
|
12
|
+
/** 字段声明所在的 schema(只读 edit / component 两个键:字段控件常常写在 schema 里,而不是视图字段项里) */
|
|
13
|
+
export type SchemaLike = Readonly<Record<string, { edit?: unknown; component?: unknown; type?: unknown; key?: unknown; readonly?: unknown; hidden?: unknown; permission?: unknown; access?: unknown } | undefined>>;
|
|
14
|
+
|
|
15
|
+
/** 浮层内容声明(事实来源):form 视图、写死形状组件名、列表是否表格形态 */
|
|
16
|
+
export interface OverlayContent {
|
|
17
|
+
form?: unknown;
|
|
18
|
+
staticComponent?: unknown;
|
|
19
|
+
schema?: SchemaLike;
|
|
20
|
+
tableList?: boolean;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** 字段声明用的控件名:字段项自己写的 component 优先,其次 schema 里该字段的 edit / component */
|
|
24
|
+
function componentOfField(decl: unknown, schema: SchemaLike | undefined): string {
|
|
25
|
+
const name = typeof decl === 'string' ? decl : decl !== null && typeof decl === 'object' ? (decl as { name?: unknown }).name : undefined;
|
|
26
|
+
const own = decl !== null && typeof decl === 'object' ? (decl as { component?: unknown }).component : undefined;
|
|
27
|
+
if (typeof own === 'string' && own !== '') return own;
|
|
28
|
+
const fromSchema = typeof name === 'string' ? schema?.[name] : undefined;
|
|
29
|
+
const c = fromSchema?.edit ?? fromSchema?.component;
|
|
30
|
+
return typeof c === 'string' ? c : '';
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** form 视图的全部字段声明:顶层 fields 与 groups[].fields 合并 */
|
|
34
|
+
function formFieldsOf(formView: unknown): unknown[] {
|
|
35
|
+
if (formView === null || typeof formView !== 'object') return [];
|
|
36
|
+
const v = formView as { fields?: unknown; groups?: unknown };
|
|
37
|
+
const out: unknown[] = Array.isArray(v.fields) ? [...v.fields] : [];
|
|
38
|
+
if (Array.isArray(v.groups)) {
|
|
39
|
+
for (const g of v.groups) {
|
|
40
|
+
const gf = g !== null && typeof g === 'object' ? (g as { fields?: unknown }).fields : undefined;
|
|
41
|
+
if (Array.isArray(gf)) out.push(...gf);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return out;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** form 视图的栏数事实:作者显式写的 arrange(cols / matrix 的列数 / rows 的最长行),没写按单列(字段数不参与) */
|
|
48
|
+
function formColsOf(formView: unknown): number {
|
|
49
|
+
const a = formView !== null && typeof formView === 'object' ? (formView as { arrange?: unknown }).arrange : undefined;
|
|
50
|
+
if (Array.isArray(a) && typeof a[1] === 'number') return a[1];
|
|
51
|
+
if (a === null || typeof a !== 'object') return 1;
|
|
52
|
+
const o = a as { cols?: unknown; matrix?: unknown; rows?: unknown };
|
|
53
|
+
if (typeof o.cols === 'number') return o.cols;
|
|
54
|
+
if (Array.isArray(o.matrix) && typeof o.matrix[1] === 'number') return o.matrix[1];
|
|
55
|
+
if (Array.isArray(o.rows)) return o.rows.reduce<number>((m, r) => Math.max(m, Array.isArray(r) ? r.length : 0), 1);
|
|
56
|
+
return 1;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** 浮层内容里出现的组件名事实(字段控件 + 静态组件 + 表格形态的列表) */
|
|
60
|
+
function componentsOf(content: OverlayContent): string[] {
|
|
61
|
+
const names = formFieldsOf(content.form).map((f) => componentOfField(f, content.schema)).filter((c) => c !== '');
|
|
62
|
+
if (typeof content.staticComponent === 'string' && content.staticComponent !== '') names.push(content.staticComponent);
|
|
63
|
+
if (content.tableList === true) names.push('Table');
|
|
64
|
+
return names;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** 表单窗口的宽度档:事实 -> 引擎决定(规则见 kit-arrange#overlay);字段数不参与 */
|
|
68
|
+
export function dialogWidthOf(content: OverlayContent): KitDialogWidth {
|
|
69
|
+
const plan = arrangeOverlay({ submits: true, cols: formColsOf(content.form), components: componentsOf(content) });
|
|
70
|
+
return plan.tier === 'xwide' ? 'xwide' : plan.tier === 'wide' ? 'wide' : 'default';
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** 窗口底栏的排法判定:事实(表单声明的底栏动作数;提交 + 取消由外壳固定给出)-> 引擎 arrangeOverlayFooter;ok 为否时 reason 给出越限项(规则在 kit-arrange#overlay.footer) */
|
|
74
|
+
export function footerPlanOf(formView: unknown): ArrangeOverlayFooterPlan {
|
|
75
|
+
const acts = formView !== null && typeof formView === 'object' ? (formView as { footerActions?: unknown }).footerActions : undefined;
|
|
76
|
+
return arrangeOverlayFooter({ hasPrimary: true, secondary: Array.isArray(acts) ? acts.length : 0 });
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** 新建 / 编辑表单的容器(KT-P-window,引擎 arrangeEditContainer,规则与阈值在 kit-arrange#editContainer):dialog = 居中对话框;page = 同页切换的整页表单视图 */
|
|
80
|
+
export type KitEditContainer = 'dialog' | 'page';
|
|
81
|
+
|
|
82
|
+
/** schema 里一个字段的只读事实:主键、permission / access 为只读、readonly、隐藏字段(hidden: true,不画)都不计入加权字段数 */
|
|
83
|
+
function readonlyInSchema(name: string, schema: SchemaLike | undefined): boolean {
|
|
84
|
+
const f = schema?.[name] as Record<string, unknown> | undefined;
|
|
85
|
+
if (f === undefined) return false;
|
|
86
|
+
if (f.key === true || f.readonly === true || f.hidden === true) return true;
|
|
87
|
+
const p = f.permission ?? f.access;
|
|
88
|
+
return p === 'r' || p === 'read';
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/** schema 里一个字段的类型(权重表按类型查:longtext 多行、rows 重型) */
|
|
92
|
+
function typeInSchema(name: string, schema: SchemaLike | undefined): string {
|
|
93
|
+
const t = (schema?.[name] as { type?: unknown } | undefined)?.type;
|
|
94
|
+
return typeof t === 'string' ? t : '';
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/** 表单容器的事实:每个字段(类型、编辑组件、是否只读)与分组数(没有分组 = 1;顶层字段与分组并存时顶层字段自成一组) */
|
|
98
|
+
export function editFactsOf(content: OverlayContent): { fields: Array<{ type: string; component: string; readonly: boolean }>; groups: number } {
|
|
99
|
+
const v = content.form !== null && typeof content.form === 'object' ? (content.form as { fields?: unknown; groups?: unknown }) : {};
|
|
100
|
+
const fields = formFieldsOf(content.form).map((decl) => {
|
|
101
|
+
const name = typeof decl === 'string' ? decl : decl !== null && typeof decl === 'object' ? (decl as { name?: unknown }).name : undefined;
|
|
102
|
+
const key = typeof name === 'string' ? name : '';
|
|
103
|
+
const own = decl !== null && typeof decl === 'object' ? (decl as { readonly?: unknown }).readonly : undefined;
|
|
104
|
+
return { type: typeInSchema(key, content.schema), component: componentOfField(decl, content.schema), readonly: own === true || readonlyInSchema(key, content.schema) };
|
|
105
|
+
});
|
|
106
|
+
const groupCount = Array.isArray(v.groups) ? v.groups.length : 0;
|
|
107
|
+
const topLevel = Array.isArray(v.fields) && v.fields.length > 0 ? 1 : 0;
|
|
108
|
+
return { fields, groups: Math.max(1, groupCount + topLevel) };
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* 新建 / 编辑表单的容器:事实 -> 引擎决定。编辑永不分步(引擎按 edit 降为整页);
|
|
113
|
+
* 本批「整页分步」一律渲染为分节的整页表单(分步布局未做,裁决 2026-11-24),所以 kit 只认 dialog / page 两种。
|
|
114
|
+
*/
|
|
115
|
+
export function editContainerOf(content: OverlayContent, opts: { edit?: boolean } = {}): { container: KitEditContainer; weight: number; reason: string } {
|
|
116
|
+
const facts = editFactsOf(content);
|
|
117
|
+
const plan = arrangeEditContainer({ fields: facts.fields, groups: facts.groups, edit: opts.edit === true });
|
|
118
|
+
return { container: plan.container === 'dialog' ? 'dialog' : 'page', weight: plan.weight, reason: plan.reason };
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/** 只读抽屉的宽度档:事实 -> 引擎决定 */
|
|
122
|
+
export function drawerWidthOf(content: OverlayContent): KitDrawerWidth {
|
|
123
|
+
return arrangeOverlay({ cols: formColsOf(content.form), components: componentsOf(content) }).tier === 'wide' ? 'wide' : 'default';
|
|
124
|
+
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
//
|
|
1
|
+
// 字段组件选择:四级优先级(view 的 ref.component > schema 的 show/edit > relation 关联形态 > types 表)。
|
|
2
2
|
|
|
3
3
|
import { KIT_TYPES, type KitTypeEntry } from './defaults';
|
|
4
|
+
import { relationPick } from './relation-field';
|
|
4
5
|
import type { KitBaseName, KitFieldRef, KitFieldSchema, KitMode } from './types';
|
|
5
6
|
|
|
6
7
|
export interface KitPick {
|
|
7
8
|
component: string;
|
|
8
|
-
source: 'view' | 'schema' | 'types';
|
|
9
|
+
source: 'view' | 'schema' | 'relation' | 'types';
|
|
9
10
|
/** 选出的名字不在已登记集合里(调用方报 KIT-COMP-001);type 未登记时也为 true 并回退 Text。 */
|
|
10
11
|
unregistered: boolean;
|
|
11
12
|
/** type 未在 types 表登记(调用方报 KIT-TYPE-001)。 */
|
|
@@ -27,6 +28,11 @@ export function pickComponent(
|
|
|
27
28
|
if (bySchema) {
|
|
28
29
|
return { component: bySchema, source: 'schema', unregistered: !registered.has(bySchema), unknownType: false };
|
|
29
30
|
}
|
|
31
|
+
// 关联类属性(relation):只读三处与编辑态由闭集映射自动选数据组件(relation-field.ts);没写 relation 或该形态在此态不换组件时落到 type 缺省
|
|
32
|
+
const byRelation = relationPick(field, mode);
|
|
33
|
+
if (byRelation) {
|
|
34
|
+
return { component: byRelation, source: 'relation', unregistered: !registered.has(byRelation), unknownType: false };
|
|
35
|
+
}
|
|
30
36
|
const entry = types[field.type];
|
|
31
37
|
if (!entry) {
|
|
32
38
|
return { component: 'Text', source: 'types', unregistered: false, unknownType: true };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// 对象渲染的「新旧流水线」模式:编译期写进页面产物的新增属性与结构只在 next 下输出,legacy(缺省)下产物逐字节不变。
|
|
2
|
+
//
|
|
3
|
+
// 实现已下沉到 shared/pipeline-mode.ts(配方层在本层之下,也要在编译期读同一个模式,不能反向 import 本文件);
|
|
4
|
+
// 这里按原导出名 re-export,compile-page、biz、emit-object 等既有引用不变。
|
|
5
|
+
|
|
6
|
+
export { kitIsNextPipeline, kitRenderPipeline, kitWithCompilePipeline, setKitCompilePipeline, type KitRenderPipeline } from '../shared/pipeline-mode';
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// 关联类属性 → 数据组件(SCON-118):schema 字段写 `relation: <形态>`,编译器在 list / summary / form 三处自动选组件并接好取值键,
|
|
2
|
+
// 页面不写组件名、不拼基础组件。闭集、组件对照与取值键映射读 spec/kit-grammar.json#fieldRelation(一处真源,这里不手抄)。
|
|
3
|
+
// · 只读(list / summary):person / people = PersonCell,record = Identifier(名称 + 标识块),records = RecordsCell(计数徽标 + 浮层清单),
|
|
4
|
+
// tags = TagGroup,parent = PathCell(路径),file / files = FileCell,link = LinkCell;
|
|
5
|
+
// · 编辑(form):有候选项(options,静态或远程)的 person / record = Select,people / tags = Combobox 多选;parent = TreeSelect;file / files = Upload;
|
|
6
|
+
// records / link 沿用字段 type 的缺省控件(子表由 RowEditor 编辑、链接由 Input 编辑);没有候选项的 person / people / record / tags 沿用 type 缺省;
|
|
7
|
+
// · 选取优先级:视图字段项 component > schema 的 show / edit > relation > type 缺省(pick-component.ts)。
|
|
8
|
+
// 值的形状(接口逐行返回,页面不回查、不算):person = { name, sub?, avatar? } 或姓名字符串;people / tags / records / files = 对应的数组;
|
|
9
|
+
// record = { id, name } 或名称字符串;parent = 从根到本节点的路径(数组或「A / B」串);link = 地址字符串或 { url, text? }。`display` 改键名,缺省按约定键。
|
|
10
|
+
|
|
11
|
+
import { KIT_GRAMMAR } from './defaults';
|
|
12
|
+
import type { KitFieldSchema, KitMode } from './types';
|
|
13
|
+
|
|
14
|
+
interface RelationEntry {
|
|
15
|
+
show: string;
|
|
16
|
+
edit: string;
|
|
17
|
+
editNeedsOptions: boolean;
|
|
18
|
+
multiple: boolean;
|
|
19
|
+
displayDefault?: string;
|
|
20
|
+
}
|
|
21
|
+
interface RelationGrammar {
|
|
22
|
+
values: readonly string[];
|
|
23
|
+
pick: Readonly<Record<string, RelationEntry>>;
|
|
24
|
+
displayProp: Readonly<Record<string, string>>;
|
|
25
|
+
displayObjectProps: Readonly<Record<string, string>>;
|
|
26
|
+
titleProp: Readonly<Record<string, string>>;
|
|
27
|
+
forbiddenShow: readonly string[];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const R = (KIT_GRAMMAR as Record<string, unknown>).fieldRelation as RelationGrammar;
|
|
31
|
+
|
|
32
|
+
const isRec = (v: unknown): v is Record<string, unknown> => v !== null && typeof v === 'object' && !Array.isArray(v);
|
|
33
|
+
|
|
34
|
+
/** 关联形态闭集 */
|
|
35
|
+
export const KIT_RELATION_VALUES: readonly string[] = R.values;
|
|
36
|
+
/** 关联字段的只读展示里不许显式写的基础组件(写了 → KIT-REL-001 错误) */
|
|
37
|
+
export const KIT_RELATION_FORBIDDEN_SHOW: ReadonlySet<string> = new Set(R.forbiddenShow);
|
|
38
|
+
|
|
39
|
+
/** 字段声明的关联形态;未写或不在闭集(由 closed-set 报错)时为 undefined */
|
|
40
|
+
export function relationOf(field: Pick<KitFieldSchema, 'relation'>): string | undefined {
|
|
41
|
+
const rel = field.relation;
|
|
42
|
+
return typeof rel === 'string' && Object.hasOwn(R.pick, rel) ? rel : undefined;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** 编辑态:该形态是否在这个字段上换控件(需要候选项的形态没写 options 时不换,沿用 type 缺省) */
|
|
46
|
+
function editComponentOf(field: KitFieldSchema, entry: RelationEntry): string | undefined {
|
|
47
|
+
if (entry.edit === '') return undefined;
|
|
48
|
+
if (entry.editNeedsOptions && field.options === undefined) return undefined;
|
|
49
|
+
return entry.edit;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** 关联形态选出的组件;没写 relation、或该形态在这个态不换组件 → undefined(由 type 缺省接手) */
|
|
53
|
+
export function relationPick(field: KitFieldSchema, mode: KitMode): string | undefined {
|
|
54
|
+
const rel = relationOf(field);
|
|
55
|
+
if (rel === undefined) return undefined;
|
|
56
|
+
const entry = R.pick[rel]!;
|
|
57
|
+
return mode === 'show' ? entry.show : editComponentOf(field, entry);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** 关联形态给选出组件的 props:只读 = 取值键映射(display)与浮层标题;编辑 = 多选 */
|
|
61
|
+
export function relationProps(field: KitFieldSchema, mode: KitMode): Record<string, unknown> {
|
|
62
|
+
const rel = relationOf(field);
|
|
63
|
+
if (rel === undefined) return {};
|
|
64
|
+
const entry = R.pick[rel]!;
|
|
65
|
+
if (mode === 'edit') return editComponentOf(field, entry) !== undefined && entry.multiple ? { multiple: true } : {};
|
|
66
|
+
const out: Record<string, unknown> = {};
|
|
67
|
+
const display = field.display ?? entry.displayDefault;
|
|
68
|
+
const prop = R.displayProp[rel];
|
|
69
|
+
if (typeof display === 'string' && display !== '' && prop !== undefined) out[prop] = display;
|
|
70
|
+
else if (isRec(display)) {
|
|
71
|
+
for (const [k, p] of Object.entries(R.displayObjectProps)) {
|
|
72
|
+
const v = (display as Record<string, unknown>)[k];
|
|
73
|
+
if (typeof v === 'string' && v !== '') out[p] = v;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
const title = R.titleProp[rel];
|
|
77
|
+
if (title !== undefined && field.name !== '') out[title] = field.name;
|
|
78
|
+
return out;
|
|
79
|
+
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
// KitObject -> KitObjectIR:纯函数,不碰 DOM,输入同则输出同。
|
|
2
2
|
// 只渲染 obj.view 里声明了的槽位;槽位内未写的项取 KIT_OBJECT_DEFAULTS。
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { kitRenderPipeline, kitWithCompilePipeline } from './pipeline-mode';
|
|
5
|
+
import { arrange, arrangeFormByEngine, arrangeFormGroupsByEngine, normalizeRef, unifyShortFieldWidths, type KitCellEnv } from './arrange';
|
|
6
|
+
import { KIT_FIELD_WIDTH_CLASS } from '../recipes/strip';
|
|
5
7
|
import { collection, resolveContextMenuItems } from './collection';
|
|
6
8
|
import {
|
|
7
9
|
KIT_FIELD_COMPONENT_NAMES,
|
|
@@ -18,15 +20,6 @@ import {
|
|
|
18
20
|
} from './defaults';
|
|
19
21
|
import { resultSlotOf } from './action-gate';
|
|
20
22
|
import {
|
|
21
|
-
KIT_PART_CARD,
|
|
22
|
-
KIT_PART_PANEL,
|
|
23
|
-
KIT_PART_SECTION,
|
|
24
|
-
KIT_PART_STAT_VALUE,
|
|
25
|
-
KIT_PART_TITLE_DIALOG,
|
|
26
|
-
KIT_PART_TITLE_PAGE,
|
|
27
|
-
KIT_PART_TITLE_SECTION,
|
|
28
|
-
KIT_PART_WELL,
|
|
29
|
-
kitTypographyRecipe,
|
|
30
23
|
KIT_VIEW_HIGHLIGHT_CLASS,
|
|
31
24
|
resolveContainerEmphasisClass,
|
|
32
25
|
resolveSurfaceRecipeClass,
|
|
@@ -37,7 +30,8 @@ import { checkEnumOptionsAndEditCompatibility, checkFieldRules, checkFlowFields,
|
|
|
37
30
|
import { validateRequestAction } from './request-actions';
|
|
38
31
|
import { hasBehaviorFrom, readStatePathsOf } from './crud-bridge';
|
|
39
32
|
import { KIT_ACTION_TONES } from './emit-events';
|
|
40
|
-
import { checkClasses, mergeClass, splitClasses } from '
|
|
33
|
+
import { checkClasses, mergeClass, splitClasses } from '../shared/merge-class';
|
|
34
|
+
import { KIT_OVERLAY_FIELD_FILL_CLASS } from '../recipes/overlay';
|
|
41
35
|
import { filterPlanOf, filterProjectionClasses, KIT_FILTER_DIVIDER, projectFilter, type KitFilterOverride } from './filter-plan';
|
|
42
36
|
import type { ArrangeFilterPlan } from 'soma-foundation/arrange';
|
|
43
37
|
import { slotModeOf } from './mode';
|
|
@@ -254,12 +248,15 @@ function layoutClasses(l: KitLayoutIR, out: string[]): void {
|
|
|
254
248
|
}
|
|
255
249
|
for (const c of layoutCells(l)) {
|
|
256
250
|
out.push(c.cellClass, c.labelClass, c.valueClass, c.errorClass);
|
|
251
|
+
// 控件槽的档宽类(max-w-[Npx])由样式注入器按闭集放行、随表单组件候选类并入,不进 IR 候选;只收窗口内占满的变体类(KT-K-form-8)
|
|
252
|
+
if (c.bodyClass?.includes(KIT_OVERLAY_FIELD_FILL_CLASS) === true) out.push(KIT_OVERLAY_FIELD_FILL_CLASS);
|
|
257
253
|
if (c.required !== undefined) out.push(KIT_REQUIRED_STAR_CLASS[c.required]);
|
|
258
254
|
}
|
|
259
255
|
}
|
|
260
256
|
|
|
261
257
|
/** view.props 不许覆盖的键(这些由 emitStatic 自己写) */
|
|
262
|
-
|
|
258
|
+
// look = 界面规则编译出的部件外观表(保留 prop,页面不直接写;外观改写规则 page.look / 就地 look:)
|
|
259
|
+
const RESERVED_STATIC_PROPS: ReadonlySet<string> = new Set(['data', 'map', 'chart', 'class', 'value', 'look']);
|
|
263
260
|
const STATIC_PROP_KEY = /^[a-z][A-Za-z0-9_]*$/;
|
|
264
261
|
|
|
265
262
|
/** view.props(配置类 prop 透传)与 view.value(值绑定路径)的校验;违规的键丢弃并记 KIT-STATIC-001 */
|
|
@@ -297,7 +294,7 @@ function staticProps(
|
|
|
297
294
|
const kept: Record<string, unknown> = {};
|
|
298
295
|
for (const [k, v] of Object.entries(form.props)) {
|
|
299
296
|
if (RESERVED_STATIC_PROPS.has(k) || !STATIC_PROP_KEY.test(k)) {
|
|
300
|
-
diags.push({ code: 'KIT-STATIC-001', path: `${path}.props.${k}`, message: `props 的键 ${k} 不合法或属保留键(data / map / chart / class / value
|
|
297
|
+
diags.push({ code: 'KIT-STATIC-001', path: `${path}.props.${k}`, message: `props 的键 ${k} 不合法或属保留键(data / map / chart / class / value / look 由编译器写;外观写界面规则 look)` });
|
|
301
298
|
continue;
|
|
302
299
|
}
|
|
303
300
|
// 闭集:组件契约登记了 props 时,键必须是契约里的 prop(已删除的写法 / 手误的键不静默透传给组件)
|
|
@@ -472,7 +469,7 @@ function formOptsOf(slot: KitViewSlot, form: KitViewForm, path: string, diags: K
|
|
|
472
469
|
const result = resultSlotOf(raw.result, `${path}.result`, diags);
|
|
473
470
|
if (result !== null) out.result = result;
|
|
474
471
|
}
|
|
475
|
-
// filter
|
|
472
|
+
// filter:折叠与触发参数校验与显式覆盖提取
|
|
476
473
|
if (slot === 'filter') {
|
|
477
474
|
// 档位由排布引擎按可筛选字段数选定(1–3 即时 / 4–6 提交 / 7+ 钉住前 N 个 + 更多筛选),页面键只做显式覆盖(见 filterOverrideOf):
|
|
478
475
|
// trigger: change → 即时;collapsible: true 或写了 defaultCollapsedCount(= 钉住个数)→ 更多;collapsible: false → 提交(不折叠);trigger: submit → 不取即时档
|
|
@@ -705,6 +702,8 @@ function renderSlot(
|
|
|
705
702
|
requiredMark,
|
|
706
703
|
...(ctx.locale !== undefined ? { locale: ctx.locale } : {}),
|
|
707
704
|
...(emptyEnv !== undefined ? { empty: emptyEnv } : {}),
|
|
705
|
+
// 主题流水线模式:显式给的优先,否则取页面编译设置的(pipeline-mode.ts)
|
|
706
|
+
pipeline: kitRenderPipeline(ctx.pipeline),
|
|
708
707
|
staticPropKeys: (component: string) => ctx.staticComponents?.[component]?.props,
|
|
709
708
|
actions: obj.behavior.actions ?? [],
|
|
710
709
|
...(ctx.expandHosts !== undefined ? { expandHosts: ctx.expandHosts } : {}),
|
|
@@ -728,6 +727,9 @@ function renderSlot(
|
|
|
728
727
|
modeFor: (f: KitFieldSchema) => slotModeOf('summary', f, ctx.formCtx),
|
|
729
728
|
diagnostics: diags,
|
|
730
729
|
path: 'view.summary',
|
|
730
|
+
slot: 'summary',
|
|
731
|
+
pipeline: env.pipeline,
|
|
732
|
+
...(ctx.locale !== undefined ? { locale: ctx.locale } : {}),
|
|
731
733
|
...(sEmpty !== undefined ? { empty: sEmpty } : {}),
|
|
732
734
|
} satisfies KitCellEnv;
|
|
733
735
|
const inner = sf.collection === undefined ? arrange(sf.arrange ?? sd.arrange!, srefs, sf, senv) : null;
|
|
@@ -825,7 +827,10 @@ function renderSlot(
|
|
|
825
827
|
* 返回 summary 的 env.empty(hide 与 text 二选一生效),非 summary 槽位返回 undefined。
|
|
826
828
|
*/
|
|
827
829
|
function summaryEmpty(slot: KitViewSlot, form: KitViewForm, path: string, diags: KitDiagnostic[]): { hide: boolean; text: string } | undefined {
|
|
828
|
-
const written = (['hideEmpty', 'emptyText', 'groups'] as const).filter((k) => form[k] !== undefined);
|
|
830
|
+
const written = (['hideEmpty', 'emptyText', 'groups', 'bordered'] as const).filter((k) => form[k] !== undefined);
|
|
831
|
+
if (slot === 'summary' && form.bordered !== undefined && typeof form.bordered !== 'boolean') {
|
|
832
|
+
diags.push({ code: 'KIT-OBJ-008', path: `${path}.bordered`, message: 'bordered 必须是布尔' });
|
|
833
|
+
}
|
|
829
834
|
// 分组相关键:summary 与 form 都许写(form 的分组由 KitObjectForm 平铺成标题行 + 字段格);没有 groups 时单写它们没有意义
|
|
830
835
|
for (const k of ['collapsible', 'defaultOpen', 'accordion', 'marker'] as const) {
|
|
831
836
|
if (form[k] === undefined) continue;
|
|
@@ -891,7 +896,18 @@ function groupsLayout(form: KitViewForm, env: KitCellEnv, fallbackArrange: KitAr
|
|
|
891
896
|
return null;
|
|
892
897
|
}
|
|
893
898
|
const seen = new Set<string>();
|
|
894
|
-
const
|
|
899
|
+
const parsedGroups: Array<{
|
|
900
|
+
title: string;
|
|
901
|
+
description: string;
|
|
902
|
+
refs: KitFieldRef[];
|
|
903
|
+
path: string;
|
|
904
|
+
index: number;
|
|
905
|
+
collapsible: boolean;
|
|
906
|
+
open: boolean;
|
|
907
|
+
divider: string | false;
|
|
908
|
+
grpEmphasis: 'primary' | 'normal' | 'subtle' | undefined;
|
|
909
|
+
grpSurface: 'card' | 'flush' | 'plain' | undefined;
|
|
910
|
+
}> = [];
|
|
895
911
|
let openTaken = false;
|
|
896
912
|
groups.forEach((g, i) => {
|
|
897
913
|
const at = `${path}[${i}]`;
|
|
@@ -941,21 +957,42 @@ function groupsLayout(form: KitViewForm, env: KitCellEnv, fallbackArrange: KitAr
|
|
|
941
957
|
if (g.surface === 'card' || g.surface === 'flush' || g.surface === 'plain') grpSurface = g.surface;
|
|
942
958
|
else env.diagnostics.push({ code: 'KIT-OBJ-008', path: `${at}.surface`, message: 'groups[i].surface 只许 card / flush / plain' });
|
|
943
959
|
}
|
|
944
|
-
|
|
945
|
-
|
|
960
|
+
// 节说明:字符串;空串 / 全空白视同没写
|
|
961
|
+
let description = '';
|
|
962
|
+
if (g.description !== undefined) {
|
|
963
|
+
if (typeof g.description !== 'string') env.diagnostics.push({ code: 'KIT-OBJ-008', path: `${at}.description`, message: 'groups[i].description 必须是字符串' });
|
|
964
|
+
else description = g.description.trim();
|
|
965
|
+
}
|
|
966
|
+
parsedGroups.push({ title: g.title, description, refs, path: at, index: i, collapsible, open, divider, grpEmphasis, grpSurface });
|
|
967
|
+
});
|
|
968
|
+
if (parsedGroups.length === 0) return null;
|
|
969
|
+
// form.groups 未显式声明 arrange:跨全部组由排布引擎按总字段数求解分栏(如 8 字段 2 分组宽屏升格 2 列);显式 arrange 仍照写的来
|
|
970
|
+
const engineGroups = slot === 'form' && form.arrange === undefined
|
|
971
|
+
? arrangeFormGroupsByEngine(parsedGroups.map((g) => ({ refs: g.refs, path: g.path })), form, env)
|
|
972
|
+
: null;
|
|
973
|
+
const out: Extract<KitLayoutIR, { kind: 'groups' }>['groups'] = parsedGroups.map((g, idx) => {
|
|
974
|
+
const grpLayout = engineGroups !== null
|
|
975
|
+
? engineGroups.layouts[idx]!
|
|
976
|
+
: arrange(form.arrange ?? fallbackArrange, g.refs, form, { ...env, path: g.path });
|
|
977
|
+
const grpExtra = [g.grpSurface ? resolveSurfaceRecipeClass(g.grpSurface) : '', g.grpEmphasis ? resolveContainerEmphasisClass(g.grpEmphasis) : ''].filter(Boolean).join(' ');
|
|
946
978
|
applyWrapKnobClass(grpLayout, grpExtra);
|
|
947
|
-
|
|
979
|
+
return {
|
|
948
980
|
title: g.title,
|
|
981
|
+
...(g.description !== '' ? { description: g.description } : {}),
|
|
949
982
|
layout: grpLayout,
|
|
950
|
-
id: `${objectName}__${slot}__g${
|
|
951
|
-
collapsible,
|
|
952
|
-
open,
|
|
953
|
-
divider,
|
|
954
|
-
...(grpEmphasis !== undefined ? { emphasis: grpEmphasis } : {}),
|
|
955
|
-
...(grpSurface !== undefined ? { surface: grpSurface } : {}),
|
|
956
|
-
}
|
|
983
|
+
id: `${objectName}__${slot}__g${g.index}`,
|
|
984
|
+
collapsible: g.collapsible,
|
|
985
|
+
open: g.open,
|
|
986
|
+
divider: g.divider,
|
|
987
|
+
...(g.grpEmphasis !== undefined ? { emphasis: g.grpEmphasis } : {}),
|
|
988
|
+
...(g.grpSurface !== undefined ? { surface: g.grpSurface } : {}),
|
|
989
|
+
};
|
|
957
990
|
});
|
|
958
|
-
|
|
991
|
+
// 右缘公式(裁决 8「同一表单至多两条右缘」):跨分组在整张表单维度统一短档字段宽度,双栏表单下保底 md 宽避免锯齿感
|
|
992
|
+
if (slot === 'form') {
|
|
993
|
+
const floorClass = engineGroups !== null && engineGroups.maxCols >= 2 ? KIT_FIELD_WIDTH_CLASS.md : undefined;
|
|
994
|
+
unifyShortFieldWidths(out.flatMap((g) => layoutCells(g.layout)), floorClass);
|
|
995
|
+
}
|
|
959
996
|
if (accordion && !out.some((g) => g.collapsible)) {
|
|
960
997
|
env.diagnostics.push({ code: 'KIT-OBJ-008', path: `${env.path}.accordion`, message: 'accordion 需要至少一节可折叠' });
|
|
961
998
|
}
|
|
@@ -1008,7 +1045,15 @@ function viewTexts(slot: KitViewSlot, form: KitViewForm, path: string, diags: Ki
|
|
|
1008
1045
|
return out;
|
|
1009
1046
|
}
|
|
1010
1047
|
|
|
1048
|
+
/**
|
|
1049
|
+
* 显式给了 ctx.pipeline 时在该模式的编译段里渲染(kitWithCompilePipeline):渲染里按显式模式写的属性与按 kitIsNextRuntime 判断的配方 / 帮手同一模式;
|
|
1050
|
+
* 没给时不动现状(页面编译段内跟随 compile-page 设置的模式)。
|
|
1051
|
+
*/
|
|
1011
1052
|
export function renderObject(obj: KitObject, ctx: KitRenderContext): KitObjectIR {
|
|
1053
|
+
return kitWithCompilePipeline(ctx.pipeline, () => renderObjectIn(obj, ctx));
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
function renderObjectIn(obj: KitObject, ctx: KitRenderContext): KitObjectIR {
|
|
1012
1057
|
const diags: KitDiagnostic[] = [];
|
|
1013
1058
|
const schema = resolveSchema(obj, ctx, diags);
|
|
1014
1059
|
|