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
|
@@ -15,21 +15,26 @@
|
|
|
15
15
|
// 限制:record.from 的接口必须直接返回记录对象(不带响应外壳 / 列表信封);写了 behavior.into 或非字符串 from 报 KIT-BIZ-003。
|
|
16
16
|
// 子对象的关联键写 from[].require(core 的 CORE-DATA-REQUIRE):记录尚未取回、关联键为空时子对象不发请求(状态 idle),不再依赖后端「缺关联键返回空」。
|
|
17
17
|
|
|
18
|
+
import { isNextPipeline, kitEditAnchor } from '../shared/pipeline';
|
|
18
19
|
import type { SomaScopeMirrorDecl } from 'soma-core';
|
|
19
20
|
import { kitText } from '../../i18n/kit-text';
|
|
20
21
|
import { KIT_GRAMMAR_RUNTIME } from '../../generated/kit-grammar-runtime';
|
|
22
|
+
import { kitFuncOfAction } from '../../shared/action-func';
|
|
21
23
|
import { KIT_CLASS_DEFAULTS, KIT_VIEW_FORM_KEYS } from '../../object-renderer/defaults';
|
|
22
24
|
import { emitObject } from '../../object-renderer/emit-object';
|
|
23
25
|
import { groupTabsFrame, toolbarAnchor, viewAnchor } from '../../object-renderer/emit-static';
|
|
24
26
|
import type { KitAction, KitObject } from '../../object-renderer/types';
|
|
25
|
-
import type { KitFragment } from '../../
|
|
27
|
+
import type { KitFragment } from '../../object-renderer/fragment';
|
|
26
28
|
import type { KitBizContext, KitBizInput } from '../types';
|
|
27
29
|
import { KIT_COORD_EVENTS, KIT_COORD_MIRRORS } from '../shared/coordinator';
|
|
28
30
|
import {
|
|
29
31
|
bizObjectName, checkRoleAllowedViews, finishBizCompile, validateBizAreaClass,
|
|
30
32
|
} from '../shared/compile-helpers';
|
|
31
33
|
import { pipeTails, wireDialogForm } from '../shared/pipes';
|
|
32
|
-
import { OVERLAY_SHELL_CLASS, dialogHtml, dialogIds, dialogTitles
|
|
34
|
+
import { OVERLAY_SHELL_CLASS, dialogHtml, dialogIds, dialogTitles } from '../shared/overlay-shell';
|
|
35
|
+
import { adviseDialogFooter } from '../shared/overlay-compile';
|
|
36
|
+
import { dialogWidthOf, editContainerOf } from '../../object-renderer/overlay-decide';
|
|
37
|
+
import { PAGE_FORM_FOCUS_INITIAL, pageBrowsingMirror, wireMainPageForm } from '../shared/page-form';
|
|
33
38
|
import {
|
|
34
39
|
IDENT, classesIn, emitMember, isRec, keyFieldOf, linkRemoveProps, mirrorPath, newParts, normalizeMember,
|
|
35
40
|
patchProps, semanticPipe, sortMirrors, type Rec,
|
|
@@ -81,17 +86,17 @@ export function compileRecordDetail(input: KitBizInput, ctx: KitBizContext): Kit
|
|
|
81
86
|
if (rawRecord.behavior.from !== undefined && typeof rawRecord.behavior.from !== 'string') {
|
|
82
87
|
fail('KIT-BIZ-003', 'RecordDetail 的 record.behavior.from 必须是接口路径字符串(接口直接返回记录对象)', 'product.objects.record.behavior.from');
|
|
83
88
|
}
|
|
84
|
-
// E5
|
|
89
|
+
// E5:关联子对象的布局(未写时:子对象数 ≥ 2 缺省 tabs 页签收敛,仅 1 个子对象单块直出;显式写 stack 逐块堆叠,tabs 合成一块页签条切换)。键在 record 上,不开 product.config
|
|
85
90
|
const subsLayoutRaw = (rawRecord as unknown as Rec).subsLayout;
|
|
86
91
|
if (subsLayoutRaw !== undefined && (typeof subsLayoutRaw !== 'string' || !SUBS_LAYOUT_VALUES.includes(subsLayoutRaw))) {
|
|
87
92
|
fail('KIT-BIZ-003', `subsLayout 取值 ${String(subsLayoutRaw)} 不在 ${SUBS_LAYOUT_VALUES.join(' / ')} 内`, 'product.objects.record.subsLayout');
|
|
88
93
|
}
|
|
89
|
-
const subsAsTabs = subsLayoutRaw === 'tabs';
|
|
90
94
|
if (rawGroups !== undefined && !isRec(rawGroups)) fail('KIT-BIZ-001', 'groups 必须是 { 名字: 分组声明 }', 'product.objects.groups');
|
|
91
95
|
if (rawSubs !== undefined && !isRec(rawSubs)) fail('KIT-BIZ-001', 'subs 必须是 { 名字: 对象声明 }', 'product.objects.subs');
|
|
92
96
|
validateBizAreaClass(input, 'RecordDetail', RECORD_DETAIL_AREAS, out.diagnostics);
|
|
93
97
|
const groupNames = isRec(rawGroups) ? Object.keys(rawGroups) : [];
|
|
94
98
|
const subNames = isRec(rawSubs) ? Object.keys(rawSubs) : [];
|
|
99
|
+
const subsAsTabs = subsLayoutRaw === 'tabs' || (subsLayoutRaw === undefined && subNames.length >= 2);
|
|
95
100
|
for (const n of groupNames) {
|
|
96
101
|
if (!IDENT.test(n)) fail('KIT-PAGE-001', `分组名 "${n}" 必须是标识符(字母数字下划线)`, `product.objects.groups.${n}`);
|
|
97
102
|
if (n === 'record') fail('KIT-BIZ-001', `分组名 "${n}" 与保留角色名撞名,禁止静默覆盖主记录对象`, `product.objects.groups.${n}`);
|
|
@@ -117,6 +122,8 @@ export function compileRecordDetail(input: KitBizInput, ctx: KitBizContext): Kit
|
|
|
117
122
|
const areaClass = input.areaClass ?? {};
|
|
118
123
|
const link = ids.link;
|
|
119
124
|
const recName = recordDetailObjectName(ctx.pageId, 'record');
|
|
125
|
+
// 主题流水线新模式:模板只出中性结构容器与锚点(biz/shared/pipeline.ts)
|
|
126
|
+
const next = isNextPipeline(ctx);
|
|
120
127
|
const recScope = `${recName}_scope`;
|
|
121
128
|
const recPath = `page.data.${recName}`;
|
|
122
129
|
|
|
@@ -147,8 +154,10 @@ export function compileRecordDetail(input: KitBizInput, ctx: KitBizContext): Kit
|
|
|
147
154
|
if (a.builtin === 'openCreate') fail('KIT-BIZ-003', `record 的动作 ${a.id}:详情台不能新增,builtin 只许 openEdit / reload`, `product.objects.record.behavior.actions[${i}].builtin`);
|
|
148
155
|
});
|
|
149
156
|
if (out.diagnostics.length > 0) return finishBizCompile(out, '');
|
|
150
|
-
|
|
151
|
-
|
|
157
|
+
// 缺省「编辑」补不补:声明里已有「功能为编辑」的动作(builtin: openEdit、id: edit、写了 function: edit …)就不补,
|
|
158
|
+
// 判据是页面线展开补缺省动作用的同一个纯函数(shared/action-func.ts#kitFuncOfAction),两边结论一致
|
|
159
|
+
if (hasWrite && !actions.some((a) => a.builtin === 'openEdit' || kitFuncOfAction(a as unknown as Record<string, unknown>) === 'edit')) {
|
|
160
|
+
actions.unshift({ id: 'edit', name: EDIT_LABEL, on: 'toolbar', builtin: 'openEdit', function: 'edit' });
|
|
152
161
|
}
|
|
153
162
|
record.behavior = { ...record.behavior, actions };
|
|
154
163
|
if (hasWrite) record.view = { ...record.view, form: isRec(formView) ? (formView as KitObject['view'] & Rec as never) : {} };
|
|
@@ -223,7 +232,7 @@ export function compileRecordDetail(input: KitBizInput, ctx: KitBizContext): Kit
|
|
|
223
232
|
for (const c of r.components) out.components.add(c);
|
|
224
233
|
for (const c of r.candidates) out.candidates.add(c);
|
|
225
234
|
out.diagnostics.push(...r.diagnostics.map((d) => ({ ...d, path: `${object}:${d.path}` })));
|
|
226
|
-
groups.push({ title: typeof raw.title === 'string' ? raw.title : '', html: r.parts.summary ?? '' });
|
|
235
|
+
groups.push({ title: typeof raw.title === 'string' ? raw.title : '', html: r.parts.summary ?? '', ...(next ? { object } : {}) });
|
|
227
236
|
}
|
|
228
237
|
|
|
229
238
|
const subBlocks: DetailBlock[] = [];
|
|
@@ -232,6 +241,7 @@ export function compileRecordDetail(input: KitBizInput, ctx: KitBizContext): Kit
|
|
|
232
241
|
subBlocks.push({
|
|
233
242
|
title: s.title,
|
|
234
243
|
html: [sm.r.parts.toolbar ?? '', sm.r.parts.filter ?? '', sm.listHtml, sm.r.parts.summary ?? ''].filter((x) => x !== '').join('\n'),
|
|
244
|
+
...(next ? { object: s.object } : {}),
|
|
235
245
|
});
|
|
236
246
|
}
|
|
237
247
|
// 页签呈现:与视图 groups as: tabs 同一个实现(emit-static 的 groupTabsFrame,面板显隐与键盘都由 KitTabsWiring 接,没有页签事件)
|
|
@@ -254,20 +264,25 @@ export function compileRecordDetail(input: KitBizInput, ctx: KitBizContext): Kit
|
|
|
254
264
|
// ---- 链接作用域:focus 归协调组件
|
|
255
265
|
const mirrors: SomaScopeMirrorDecl[] = [];
|
|
256
266
|
for (const x of [mk.openForm, mk.creating, mk.editing]) mirrors.push({ key: x.key, slice: 'focus', path: x.path, as: x.as });
|
|
267
|
+
// 编辑表单的容器(KT-P-window;只有编辑,永不分步):对话框,或同页切换的整页表单视图(详情区让位)
|
|
268
|
+
const pageForm = hasWrite && record.view?.form !== undefined && editContainerOf({ form: record.view.form, schema: record.schema }, { edit: true }).container === 'page';
|
|
269
|
+
if (pageForm) mirrors.push(pageBrowsingMirror());
|
|
257
270
|
out.scopes[link] = {
|
|
258
271
|
id: link,
|
|
259
272
|
object: recName,
|
|
260
|
-
slices: [{ name: 'focus', owner: ids.coord }],
|
|
273
|
+
slices: [{ name: 'focus', owner: ids.coord, ...(pageForm ? { initial: PAGE_FORM_FOCUS_INITIAL } : {}) }],
|
|
261
274
|
mirrors: sortMirrors(mirrors),
|
|
262
275
|
};
|
|
263
276
|
out.show[ids.coord] = {
|
|
264
277
|
props: {
|
|
265
278
|
scope: link, object: recName, keyField: recKey ?? '', reloads: subs.map((s) => s.object), overlays: {}, record: recPath,
|
|
279
|
+
...(pageForm ? { pageForm: true } : {}),
|
|
266
280
|
...linkRemoveProps(out),
|
|
267
281
|
},
|
|
268
282
|
};
|
|
283
|
+
if (pageForm) out.show[`${ids.root}_browse`] = { when: mirrorPath(link, KIT_COORD_MIRRORS.browsing.key) };
|
|
269
284
|
|
|
270
|
-
// ----
|
|
285
|
+
// ---- 编辑表单
|
|
271
286
|
let dialog = '';
|
|
272
287
|
if (hasWrite && record.view?.form !== undefined) {
|
|
273
288
|
const formId = viewAnchor(recName, 'form');
|
|
@@ -276,19 +291,35 @@ export function compileRecordDetail(input: KitBizInput, ctx: KitBizContext): Kit
|
|
|
276
291
|
patchProps(out.show, formId, { scope: `${recName}__form`, cancelLabel: CANCEL_LABEL });
|
|
277
292
|
wireDialogForm(out.events, formId, link);
|
|
278
293
|
}
|
|
294
|
+
}
|
|
295
|
+
const editName = actions.find((a) => a.builtin === 'openEdit')?.name ?? EDIT_LABEL;
|
|
296
|
+
if (pageForm && record.view?.form !== undefined) {
|
|
297
|
+
const t = dialogTitles(record.view.form.title, { create: editName, edit: editName });
|
|
298
|
+
const given = (record.view.form as { submitLabel?: unknown }).submitLabel;
|
|
299
|
+
const SAVE_LABEL = typeof given === 'string' && given !== '' ? given : kitText('soma.kit.save', undefined, ctx.locale);
|
|
300
|
+
dialog = wireMainPageForm(out, {
|
|
301
|
+
object: recName, scope: link, formId: viewAnchor(recName, 'form'), formHtml: m.r.parts.form ?? '',
|
|
302
|
+
...(next ? { bodyAnchor: kitEditAnchor(recName) } : {}),
|
|
303
|
+
copy: { create: t.create, edit: t.edit, submitCreate: SAVE_LABEL, submitEdit: SAVE_LABEL },
|
|
304
|
+
...(ctx.locale !== undefined ? { locale: ctx.locale } : {}),
|
|
305
|
+
schema: record.schema, weight: editContainerOf({ form: record.view!.form, schema: record.schema }, { edit: true }).weight,
|
|
306
|
+
});
|
|
307
|
+
} else if (hasWrite && record.view?.form !== undefined) {
|
|
279
308
|
const d = dialogIds(recName);
|
|
280
309
|
out.show[d.dialogLayer] = { when: mirrorPath(link, mk.openForm.key) };
|
|
281
310
|
out.show[d.dialogTitleCreate] = { when: mirrorPath(link, mk.creating.key) };
|
|
282
311
|
out.show[d.dialogTitleEdit] = { when: mirrorPath(link, mk.editing.key) };
|
|
283
312
|
out.events[`${d.dialogClose}.click`] = semanticPipe(link, KIT_COORD_EVENTS.close);
|
|
284
|
-
|
|
285
|
-
|
|
313
|
+
dialog = next
|
|
314
|
+
? dialogHtml(d, dialogTitles(record.view.form.title, { create: editName, edit: editName }), m.r.parts.form ?? '', { dialog: areaClass.dialog ?? '' }, CLOSE_LABEL, '', dialogWidthOf({ form: record.view.form, schema: record.schema }), kitEditAnchor(recName))
|
|
315
|
+
: dialogHtml(d, dialogTitles(record.view.form.title, { create: editName, edit: editName }), m.r.parts.form ?? '', { dialog: areaClass.dialog ?? '' }, CLOSE_LABEL, '', dialogWidthOf({ form: record.view.form, schema: record.schema }));
|
|
316
|
+
adviseDialogFooter(ctx, record.view.form, 'product.objects.record.view.form.footerActions');
|
|
286
317
|
for (const c of Object.values(OVERLAY_SHELL_CLASS)) for (const t of c.split(/\s+/)) if (t !== '') out.candidates.add(t);
|
|
287
318
|
}
|
|
288
319
|
|
|
289
320
|
const html = recordDetailHtml(
|
|
290
321
|
ids,
|
|
291
|
-
{ summary: m.r.parts.summary ?? '', actions: m.r.parts.toolbar ?? '', groups, subs: subBlocks, dialog, ...(subsTabs !== undefined ? { subsTabs } : {}) },
|
|
322
|
+
{ summary: m.r.parts.summary ?? '', actions: m.r.parts.toolbar ?? '', groups, subs: subBlocks, dialog, ...(subsTabs !== undefined ? { subsTabs } : {}), ...(pageForm ? { browseId: `${ids.root}_browse` } : {}), ...(next ? { next: { record: recName } } : {}) },
|
|
292
323
|
areaClass,
|
|
293
324
|
input.class,
|
|
294
325
|
);
|
|
@@ -25,6 +25,7 @@ export const RecordDetail = defineKitBizComponent({
|
|
|
25
25
|
subs: { required: false, views: ['list', 'summary'], many: true },
|
|
26
26
|
},
|
|
27
27
|
areas: [...RECORD_DETAIL_AREAS],
|
|
28
|
+
envelope: { surface: 'detail', overlayFormRoles: ['record'] },
|
|
28
29
|
compile: compileRecordDetail,
|
|
29
30
|
});
|
|
30
31
|
|
|
@@ -2,25 +2,34 @@
|
|
|
2
2
|
// 只有结构与 Tailwind 类(语义色名 + utilityScales 里有的尺度),不写原生 CSS。分栏靠容器查询变体 `@md:`。
|
|
3
3
|
// 弹窗壳复用 StandardCrud 的(同一套浮层基准)。
|
|
4
4
|
|
|
5
|
+
import { kitNeutralClass, kitObjectAnchor, kitSummaryStripAnchor } from '../shared/pipeline';
|
|
5
6
|
import { KIT_TIPS_SCOPE_ATTR } from '../../base/hint-tips';
|
|
6
|
-
import { mergeClass } from '../../
|
|
7
|
+
import { mergeClass } from '../../shared/merge-class';
|
|
8
|
+
import { KIT_ATTR_CONTAINER } from '../../shared/dom-attrs';
|
|
9
|
+
import { kitSelfAttrs } from '../../shared/page-attrs-runtime';
|
|
7
10
|
import { KIT_SHELL_FLAT_MARK, kitShellRecipe } from '../../recipes/container';
|
|
8
11
|
import { kitTypographyRecipe } from '../../recipes/typography';
|
|
9
12
|
import { cls, esc, host } from '../link/shared';
|
|
13
|
+
import { browsingWrapHtml } from '../shared/page-form';
|
|
10
14
|
|
|
11
15
|
/** 壳的内部区域名(`areaClass` 的合法键) */
|
|
12
16
|
export const RECORD_DETAIL_AREAS = ['root', 'header', 'actions', 'groups', 'group', 'sub', 'dialog'] as const;
|
|
13
17
|
export type RecordDetailArea = (typeof RECORD_DETAIL_AREAS)[number];
|
|
14
18
|
|
|
15
19
|
export const RECORD_DETAIL_CLASS = {
|
|
16
|
-
root: '@container flex flex-col gap-section',
|
|
17
|
-
|
|
20
|
+
root: '@container flex w-full min-w-0 flex-col gap-section',
|
|
21
|
+
/** 整页编辑表单打开时让位的详情区(显隐外层的内层,与根同一条纵向节奏) */
|
|
22
|
+
browse: 'flex min-w-0 flex-col gap-section',
|
|
23
|
+
header: mergeClass('flex flex-wrap items-center justify-between gap-section p-card', kitShellRecipe()),
|
|
24
|
+
/** next 模式下头部摘要条带行:外层 section 已承载 face 卡片(底/框/内边距),内层条带锚点保持零盒叠、零内边距与透明底,消除细线档与暗色下卡中卡双框 */
|
|
25
|
+
headerRowNext: 'flex flex-wrap items-center justify-between gap-section bg-transparent border-0 p-0',
|
|
18
26
|
summary: 'min-w-0 flex-1',
|
|
19
27
|
actions: 'flex shrink-0 flex-nowrap items-center gap-cluster',
|
|
20
28
|
groups: 'grid grid-cols-12 gap-section',
|
|
21
29
|
group: mergeClass('col-span-12 @md:col-span-6 flex min-w-0 flex-col gap-region p-card', kitShellRecipe()),
|
|
30
|
+
groupFull: mergeClass('col-span-12 flex min-w-0 flex-col gap-region p-card', kitShellRecipe()),
|
|
22
31
|
sub: mergeClass('flex min-w-0 flex-col gap-region p-card', kitShellRecipe()),
|
|
23
|
-
blockTitle: mergeClass('min-w-0 truncate
|
|
32
|
+
blockTitle: mergeClass(kitTypographyRecipe('sectionTitle'), 'min-w-0 truncate tracking-tight'),
|
|
24
33
|
} as const;
|
|
25
34
|
|
|
26
35
|
export function recordDetailIds(pageId: string): {
|
|
@@ -37,31 +46,53 @@ export interface DetailTabs {
|
|
|
37
46
|
export interface DetailBlock {
|
|
38
47
|
title: string;
|
|
39
48
|
html: string;
|
|
49
|
+
/** 新模式下这一块对应对象的运行期名(容器锚点据它拼);旧版不给 */
|
|
50
|
+
object?: string;
|
|
40
51
|
}
|
|
41
52
|
|
|
42
53
|
export function recordDetailHtml(
|
|
43
54
|
ids: ReturnType<typeof recordDetailIds>,
|
|
44
|
-
parts: { summary: string; actions: string; groups: DetailBlock[]; subs: DetailBlock[]; dialog: string; subsTabs?: DetailTabs
|
|
55
|
+
parts: { summary: string; actions: string; groups: DetailBlock[]; subs: DetailBlock[]; dialog: string; subsTabs?: DetailTabs; /** 整页编辑表单打开时详情区让位的显隐外层 id(缺省不包) */ browseId?: string;
|
|
56
|
+
/** 新模式(主题流水线 next):主记录对象的运行期名(记录面与头部摘要条带的锚点据它拼);旧版不给 */ next?: { readonly record: string } },
|
|
45
57
|
areaClass: Record<string, string>,
|
|
46
58
|
extra: string | undefined,
|
|
47
59
|
): string {
|
|
48
60
|
const actions = parts.actions === ''
|
|
49
61
|
? ''
|
|
50
62
|
: `<div${cls(mergeClass(RECORD_DETAIL_CLASS.actions, areaClass.actions))}>${parts.actions}</div>`;
|
|
51
|
-
const
|
|
63
|
+
const nx = parts.next;
|
|
64
|
+
// 新模式:记录面是主记录对象的容器(补对象锚点);有操作组时里面的「摘要 + 操作组」一行是组件树上的头部摘要条带(补条带锚点)。
|
|
65
|
+
// 旧版的一层 section 同时承担面与这一行的排布,新模式拆成两层:面只留内边距,这一行带原来的排布类。不写容器形态与外观类
|
|
66
|
+
const header = nx !== undefined
|
|
67
|
+
? `<section data-soma-id="${esc(kitObjectAnchor(nx.record))}"${cls(kitNeutralClass(mergeClass('p-card', areaClass.header)))}>`
|
|
68
|
+
+ `<div${parts.actions === '' ? '' : ` data-soma-id="${esc(kitSummaryStripAnchor(nx.record))}"`}${cls(RECORD_DETAIL_CLASS.headerRowNext)}><div${cls(RECORD_DETAIL_CLASS.summary)}>${parts.summary}</div>${actions}</div></section>`
|
|
69
|
+
: `<section ${KIT_ATTR_CONTAINER}="card"${cls(mergeClass(RECORD_DETAIL_CLASS.header, areaClass.header))}>`
|
|
52
70
|
+ `<div${cls(RECORD_DETAIL_CLASS.summary)}>${parts.summary}</div>${actions}</section>`;
|
|
53
71
|
const block = (b: DetailBlock, base: string, area: string | undefined): string => {
|
|
54
72
|
const title = b.title === '' ? '' : `<h3${cls(RECORD_DETAIL_CLASS.blockTitle)} ${KIT_TIPS_SCOPE_ATTR}="">${esc(b.title)}</h3>`;
|
|
55
|
-
|
|
73
|
+
// 新模式:分组 / 从属块是对象的容器,补对象锚点;不写容器形态与外观类,保留 12 栏栅格跨度(RecordDetail 排法为 stack,布局不下发 data-kit-span)
|
|
74
|
+
if (nx !== undefined) {
|
|
75
|
+
const mark = b.object !== undefined ? ` data-soma-id="${esc(kitObjectAnchor(b.object))}"` : '';
|
|
76
|
+
// 标题行自报「块标题」(容器的直接子元素),取值表按容器上的标题隐去标记收起它
|
|
77
|
+
const titleNext = b.title === '' ? '' : `<h3${kitSelfAttrs({ part: 'block-title' })}${cls(RECORD_DETAIL_CLASS.blockTitle)} ${KIT_TIPS_SCOPE_ATTR}="">${esc(b.title)}</h3>`;
|
|
78
|
+
return `<section${mark}${cls(kitNeutralClass(mergeClass(base, area)))}>${titleNext}${b.html}</section>`;
|
|
79
|
+
}
|
|
80
|
+
return `<section ${KIT_ATTR_CONTAINER}="card"${cls(mergeClass(base, area))}${KIT_SHELL_FLAT_MARK}>${title}${b.html}</section>`;
|
|
56
81
|
};
|
|
82
|
+
const oddGroups = parts.groups.length % 2 === 1;
|
|
57
83
|
const groups = parts.groups.length === 0
|
|
58
84
|
? ''
|
|
59
|
-
: `<div${cls(mergeClass(RECORD_DETAIL_CLASS.groups, areaClass.groups))}>\n${parts.groups.map((g) => block(g, RECORD_DETAIL_CLASS.group, areaClass.group)).join('\n')}\n</div>`;
|
|
85
|
+
: `<div${cls(mergeClass(RECORD_DETAIL_CLASS.groups, areaClass.groups))}>\n${parts.groups.map((g, i) => block(g, oddGroups && i === parts.groups.length - 1 ? RECORD_DETAIL_CLASS.groupFull : RECORD_DETAIL_CLASS.group, areaClass.group)).join('\n')}\n</div>`;
|
|
60
86
|
const subs = parts.subs.map((s) => block(s, RECORD_DETAIL_CLASS.sub, areaClass.sub));
|
|
61
|
-
if (parts.subsTabs !== undefined) {
|
|
62
|
-
|
|
87
|
+
if (parts.subsTabs !== undefined && nx !== undefined) {
|
|
88
|
+
// 新模式:从属合成的页签面不对应单个对象(每个从属是其中一签),不补对象锚点、不写容器形态,自报「面」层级由取值表恢复卡片外观,类只留结构类
|
|
89
|
+
subs.push(`<section${kitSelfAttrs({ level: 'face' })}${cls(kitNeutralClass(mergeClass(RECORD_DETAIL_CLASS.sub, areaClass.sub)))}>${parts.subsTabs.html}</section>`);
|
|
90
|
+
} else if (parts.subsTabs !== undefined) {
|
|
91
|
+
subs.push(`<section ${KIT_ATTR_CONTAINER}="card"${cls(mergeClass(RECORD_DETAIL_CLASS.sub, areaClass.sub))}${KIT_SHELL_FLAT_MARK}>${parts.subsTabs.html}</section>`);
|
|
63
92
|
}
|
|
64
93
|
const root = mergeClass(mergeClass(RECORD_DETAIL_CLASS.root, areaClass.root), extra);
|
|
94
|
+
const detail = [header, groups, ...subs].filter((x) => x !== '').join('\n');
|
|
95
|
+
const body = parts.browseId === undefined || parts.browseId === '' ? detail : browsingWrapHtml(parts.browseId, detail, RECORD_DETAIL_CLASS.browse);
|
|
65
96
|
return `<div data-soma-id="${esc(ids.root)}"${cls(root)}>\n${host('KitCrudBridge', ids.coord)}\n`
|
|
66
|
-
+ `${[
|
|
97
|
+
+ `${[body, parts.dialog].filter((x) => x !== '').join('\n')}\n</div>`;
|
|
67
98
|
}
|
|
@@ -5,12 +5,13 @@
|
|
|
5
5
|
// 导航 页内锚点链接,不写脚本;不做滚动联动高亮
|
|
6
6
|
// 与 SingleObjectForm 的区别:多个分区同页、各存各的;与 StepForm 的区别:分区之间无先后、不合并提交。
|
|
7
7
|
|
|
8
|
+
import { isNextPipeline } from '../shared/pipeline';
|
|
8
9
|
import { kitText } from '../../i18n/kit-text';
|
|
9
10
|
import { emitObject } from '../../object-renderer/emit-object';
|
|
10
11
|
import { savedNoticePipe } from '../../object-renderer/form-notify';
|
|
11
12
|
import { viewAnchor } from '../../object-renderer/emit-static';
|
|
12
13
|
import type { KitObject, KitViewForm } from '../../object-renderer/types';
|
|
13
|
-
import type { KitFragment } from '../../
|
|
14
|
+
import type { KitFragment } from '../../object-renderer/fragment';
|
|
14
15
|
import type { KitBizContext, KitBizInput } from '../types';
|
|
15
16
|
import { IDENT, addEmit, classesIn, isRec, newParts, patchProps, type Rec } from '../link/shared';
|
|
16
17
|
import {
|
|
@@ -85,6 +86,8 @@ export function compileSettingsCenter(input: KitBizInput, ctx: KitBizContext): K
|
|
|
85
86
|
submitLabel,
|
|
86
87
|
resetLabel: RESET_LABEL,
|
|
87
88
|
classes: { ...classes, actions: SETTINGS_CENTER_CLASS.footer },
|
|
89
|
+
// 独立的可编辑表单:草稿有改动时拦截刷新 / 关闭与站内链接点击(尊重页面显式关闭 false / 'none')
|
|
90
|
+
...(target.behavior.leaveGuard === undefined ? { leaveGuard: true } : {}),
|
|
88
91
|
});
|
|
89
92
|
if ((r.parts.form ?? '').includes(`data-soma-id="${formId}"`)) {
|
|
90
93
|
out.events[`${formId}.saved`] = savedNoticePipe(formView, SAVED_NOTICE);
|
|
@@ -97,7 +100,7 @@ export function compileSettingsCenter(input: KitBizInput, ctx: KitBizContext): K
|
|
|
97
100
|
blocks.push({ name: n, title, form: r.parts.form ?? '' });
|
|
98
101
|
}
|
|
99
102
|
|
|
100
|
-
const html = settingsCenterHtml(ids, blocks, areaClass, input.class, ctx.locale);
|
|
103
|
+
const html = isNextPipeline(ctx) ? settingsCenterHtml(ids, blocks, areaClass, input.class, ctx.locale, true) : settingsCenterHtml(ids, blocks, areaClass, input.class, ctx.locale);
|
|
101
104
|
for (const c of classesIn(html)) out.candidates.add(c);
|
|
102
105
|
addClassTokens(out, SETTINGS_CENTER_CLASS);
|
|
103
106
|
return finishTemplate(out, html);
|
|
@@ -11,6 +11,7 @@ export const SettingsCenter = defineKitBizComponent({
|
|
|
11
11
|
sections: { required: true, views: ['form'], many: true },
|
|
12
12
|
},
|
|
13
13
|
areas: [...SETTINGS_CENTER_AREAS],
|
|
14
|
+
envelope: { surface: 'form', hasSideNav: true, railWidthRem: 14 },
|
|
14
15
|
compile: compileSettingsCenter,
|
|
15
16
|
});
|
|
16
17
|
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
// SettingsCenter 的 HTML 代码壳:左侧分区导航(锚点链接)+ 右侧逐区表单卡。只有结构与 Tailwind 类,分栏靠容器查询变体 `@md:`。
|
|
2
2
|
// 导航是页内锚点(`<a href="#锚点">`),不写脚本;每个分区卡自带一条保存栏(表单的 actions 区经 classes.actions 传入)。
|
|
3
3
|
|
|
4
|
+
import { kitNeutralClass } from '../shared/pipeline';
|
|
5
|
+
import { kitSelfAttrs } from '../../shared/page-attrs-runtime';
|
|
6
|
+
import { KIT_ATTR_CONTAINER } from '../../shared/dom-attrs';
|
|
4
7
|
import { KIT_TIPS_SCOPE_ATTR } from '../../base/hint-tips';
|
|
5
|
-
import {
|
|
8
|
+
import { KIT_FOCUS_RING } from '../../recipes/state';
|
|
9
|
+
import { mergeClass } from '../../shared/merge-class';
|
|
6
10
|
import { kitShellRecipe } from '../../recipes/container';
|
|
11
|
+
import { KIT_DIVIDER_FOOT_CLASS } from '../../recipes/divider';
|
|
7
12
|
import { kitTypographyRecipe } from '../../recipes/typography';
|
|
8
13
|
import { cls, esc } from '../link/shared';
|
|
9
14
|
import { kitText } from '../../i18n/kit-text';
|
|
@@ -13,14 +18,20 @@ export const SETTINGS_CENTER_AREAS = ['root', 'nav', 'content', 'section'] as co
|
|
|
13
18
|
export type SettingsCenterArea = (typeof SETTINGS_CENTER_AREAS)[number];
|
|
14
19
|
|
|
15
20
|
export const SETTINGS_CENTER_CLASS = {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
21
|
+
// 外层只做容器查询宿主(@container 不能自查询,@md:flex-row 放在内层布局容器上);补 min-w-0 防弹性容器内宽度坍缩
|
|
22
|
+
root: '@container w-full min-w-0',
|
|
23
|
+
layout: 'flex min-w-0 flex-col gap-stack @md:flex-row @md:items-start',
|
|
24
|
+
nav: mergeClass('flex w-full shrink-0 flex-col gap-1 p-inset-compact @md:sticky @md:top-4 @md:w-[224px]', kitShellRecipe()),
|
|
25
|
+
navLink: mergeClass(
|
|
26
|
+
'flex h-9 min-w-0 items-center truncate rounded-item px-3 transition-colors hover:bg-state-layer-hover active:bg-state-layer-press hover:text-fg ' + KIT_FOCUS_RING.item,
|
|
27
|
+
mergeClass(kitTypographyRecipe('menuItem'), 'text-fg-muted'),
|
|
28
|
+
),
|
|
29
|
+
// 去掉内层 max-w-3xl 硬夹紧:由外层 frame__width(form-with-rail wide 960px 或页面 DSL page.max_width)唯一承接版心,避免右侧死留白
|
|
19
30
|
content: 'flex min-w-0 flex-1 flex-col gap-stack',
|
|
20
|
-
section: mergeClass('flex flex-col gap-section p-inset-roomy', kitShellRecipe()),
|
|
21
|
-
title: mergeClass('min-w-0 truncate
|
|
31
|
+
section: mergeClass('flex min-w-0 scroll-mt-4 flex-col gap-section p-inset-roomy', kitShellRecipe()),
|
|
32
|
+
title: mergeClass(kitTypographyRecipe('sectionTitle'), 'min-w-0 truncate tracking-tight'),
|
|
22
33
|
/** 分区保存栏:贴卡内底部,上方分隔线;动作组恒单行不折行(排布引擎动作组规则) */
|
|
23
|
-
footer:
|
|
34
|
+
footer: `mt-2 flex flex-nowrap items-center gap-cluster ${KIT_DIVIDER_FOOT_CLASS} pt-4`,
|
|
24
35
|
} as const;
|
|
25
36
|
|
|
26
37
|
export function settingsCenterIds(pageId: string): { root: string; nav: string; section(name: string): string } {
|
|
@@ -39,16 +50,29 @@ export function settingsCenterHtml(
|
|
|
39
50
|
areaClass: Record<string, string>,
|
|
40
51
|
extra: string | undefined,
|
|
41
52
|
locale?: string,
|
|
53
|
+
/** 新模式(主题流水线 next);旧版不给 */
|
|
54
|
+
next = false,
|
|
42
55
|
): string {
|
|
43
56
|
const links = blocks
|
|
44
57
|
.map((b) => `<a href="#${esc(ids.section(b.name))}"${cls(SETTINGS_CENTER_CLASS.navLink)}>${esc(b.title)}</a>`)
|
|
45
58
|
.join('\n');
|
|
59
|
+
if (next) {
|
|
60
|
+
// 新模式:分节已有锚点(<页>__sc_<名>),版式契约直接用它;不写容器形态与外观类。页内导航不是对象(不在组件树上),自报层级角色「对象面」
|
|
61
|
+
const navNext = `<nav aria-label="${esc(kitText('soma.kit.nav_sections', undefined, locale ?? ''))}" data-soma-id="${esc(ids.nav)}"${kitSelfAttrs({ level: 'face' })}${cls(kitNeutralClass(mergeClass(SETTINGS_CENTER_CLASS.nav, areaClass.nav)))}>\n${links}\n</nav>`;
|
|
62
|
+
const sectionsNext = blocks
|
|
63
|
+
.map((b) => `<section id="${esc(ids.section(b.name))}" data-soma-id="${esc(ids.section(b.name))}"${cls(kitNeutralClass(mergeClass(SETTINGS_CENTER_CLASS.section, areaClass.section)))}>`
|
|
64
|
+
// 标题行自报「块标题」(分节容器的直接子元素),取值表按容器上的标题隐去标记收起它
|
|
65
|
+
+ `<h2${kitSelfAttrs({ part: 'block-title' })}${cls(SETTINGS_CENTER_CLASS.title)} ${KIT_TIPS_SCOPE_ATTR}="">${esc(b.title)}</h2>${b.form}</section>`)
|
|
66
|
+
.join('\n');
|
|
67
|
+
const contentNext = `<div${cls(mergeClass(SETTINGS_CENTER_CLASS.content, areaClass.content))}>\n${sectionsNext}\n</div>`;
|
|
68
|
+
return `<div data-soma-id="${esc(ids.root)}"${cls(mergeClass(mergeClass(SETTINGS_CENTER_CLASS.root, areaClass.root), extra))}>\n<div${cls(SETTINGS_CENTER_CLASS.layout)}>\n${navNext}\n${contentNext}\n</div>\n</div>`;
|
|
69
|
+
}
|
|
46
70
|
const nav = `<nav aria-label="${esc(kitText('soma.kit.nav_sections', undefined, locale ?? ''))}" data-soma-id="${esc(ids.nav)}"${cls(mergeClass(SETTINGS_CENTER_CLASS.nav, areaClass.nav))}>\n${links}\n</nav>`;
|
|
47
71
|
const sections = blocks
|
|
48
|
-
.map((b) => `<section id="${esc(ids.section(b.name))}" data-soma-id="${esc(ids.section(b.name))}"${cls(mergeClass(SETTINGS_CENTER_CLASS.section, areaClass.section))}>`
|
|
72
|
+
.map((b) => `<section ${KIT_ATTR_CONTAINER}="card" id="${esc(ids.section(b.name))}" data-soma-id="${esc(ids.section(b.name))}"${cls(mergeClass(SETTINGS_CENTER_CLASS.section, areaClass.section))}>`
|
|
49
73
|
+ `<h2${cls(SETTINGS_CENTER_CLASS.title)} ${KIT_TIPS_SCOPE_ATTR}="">${esc(b.title)}</h2>${b.form}</section>`)
|
|
50
74
|
.join('\n');
|
|
51
75
|
const content = `<div${cls(mergeClass(SETTINGS_CENTER_CLASS.content, areaClass.content))}>\n${sections}\n</div>`;
|
|
52
76
|
const root = mergeClass(mergeClass(SETTINGS_CENTER_CLASS.root, areaClass.root), extra);
|
|
53
|
-
return `<div data-soma-id="${esc(ids.root)}"${cls(root)}>\n${nav}\n${content}\n</div>`;
|
|
77
|
+
return `<div data-soma-id="${esc(ids.root)}"${cls(root)}>\n<div${cls(SETTINGS_CENTER_CLASS.layout)}>\n${nav}\n${content}\n</div>\n</div>`;
|
|
54
78
|
}
|