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
|
@@ -13,19 +13,21 @@ import type { JsonSchemaObject, PageDiagnostic } from 'soma-core/page-target';
|
|
|
13
13
|
import { keyHint } from '../compile/hints';
|
|
14
14
|
import { resolveBiz, resolveFrame } from '../compile/registry';
|
|
15
15
|
import type { KitAppContext } from '../compile/types';
|
|
16
|
-
import { blockThemeDomain } from '../theme/block-theme';
|
|
17
16
|
import {
|
|
18
17
|
aiActionOn,
|
|
19
18
|
aiFieldAccess,
|
|
20
19
|
aiFieldEmphasis,
|
|
20
|
+
aiFieldRoles,
|
|
21
|
+
aiFieldRelations,
|
|
21
22
|
aiKeysOf,
|
|
22
23
|
aiPermissions,
|
|
23
24
|
aiTones,
|
|
24
|
-
blockThemeAitIssues,
|
|
25
25
|
fieldHintKeys,
|
|
26
26
|
hintSlots,
|
|
27
27
|
isThemeKey,
|
|
28
28
|
kitAiDisplayMap,
|
|
29
|
+
kitAiDisplayOpen,
|
|
30
|
+
kitAiListLayouts,
|
|
29
31
|
kitAiWriter,
|
|
30
32
|
kitDisplayWords,
|
|
31
33
|
kitFieldTypes,
|
|
@@ -64,6 +66,10 @@ export interface KitIntentField {
|
|
|
64
66
|
readonly access?: string;
|
|
65
67
|
readonly emphasis?: 'strong' | 'muted';
|
|
66
68
|
readonly highlight?: boolean;
|
|
69
|
+
/** 字段角色(闭集 kit-grammar.json#fieldRole.values):status = 状态字段,只有它的选项许用告警色调(KIT-IA-003) */
|
|
70
|
+
readonly role?: string;
|
|
71
|
+
/** 关联类属性形态(闭集 kit-grammar.json#fieldRelation.values):写了它编译器自动选展示与选择组件(SCON-118),AI 不写组件名 */
|
|
72
|
+
readonly relation?: string;
|
|
67
73
|
}
|
|
68
74
|
|
|
69
75
|
export interface KitIntentObject {
|
|
@@ -91,13 +97,8 @@ export interface KitIntentAction {
|
|
|
91
97
|
/** 视图槽位 → 字段 id 数组(顺序即排列) */
|
|
92
98
|
export type KitIntentSlots = Readonly<Record<string, readonly string[]>>;
|
|
93
99
|
|
|
94
|
-
/**
|
|
95
|
-
export type KitIntentTheme = string | { readonly mode?: string; readonly color?: string };
|
|
96
|
-
|
|
97
|
-
/** 一个页面模式(页面框的一个槽位里放的东西) */
|
|
100
|
+
/** 一个页面模式(页面框的一个槽位里放的东西);块级主题已删除(主题只有应用级,AI 不写) */
|
|
98
101
|
export interface KitIntentSection {
|
|
99
|
-
/** 该块的块级主题(top / tabs[i]);蓝图根上的 theme 是整页内容区主题(page.theme) */
|
|
100
|
-
readonly theme?: KitIntentTheme;
|
|
101
102
|
/** 页面模式意图词(crud / master-detail / form …),由 KIT_INTENT_MAP 映射到业务组件 */
|
|
102
103
|
readonly product: string;
|
|
103
104
|
readonly objects: Readonly<Record<string, KitIntentObject>>;
|
|
@@ -106,6 +107,8 @@ export interface KitIntentSection {
|
|
|
106
107
|
/** 角色 → 槽位 → 字段 id 数组;对象表角色改为 对象名 → 槽位 → 字段 id 数组 */
|
|
107
108
|
readonly views?: Readonly<Record<string, KitIntentSlots | Readonly<Record<string, KitIntentSlots>>>>;
|
|
108
109
|
readonly actions?: readonly KitIntentAction[];
|
|
110
|
+
/** 列表窗格形态(有列表窗格的页面模式可写;缺省 side):side 列表在侧栏 / top 上方条件框 + 下方整宽列表(列多、字段宽、条目多时选 top) */
|
|
111
|
+
readonly list_layout?: 'side' | 'top';
|
|
109
112
|
}
|
|
110
113
|
|
|
111
114
|
export interface KitIntentTab extends KitIntentSection {
|
|
@@ -139,11 +142,9 @@ export interface KitIntentOptions {
|
|
|
139
142
|
|
|
140
143
|
// ───────────────────────── 键表(写给模型看的契约,全部是蓝图自己的键) ─────────────────────────
|
|
141
144
|
|
|
142
|
-
export const KIT_INTENT_SECTION_KEYS = ['product', 'objects', 'roles', 'views', 'actions'] as const;
|
|
143
|
-
|
|
144
|
-
export const
|
|
145
|
-
export const KIT_INTENT_TOP_KEYS = ['title', 'subtitle', 'frame', ...KIT_INTENT_SECTION_KEYS, 'top', 'tabs', 'locale', 'notes', KIT_INTENT_THEME_KEY] as const;
|
|
146
|
-
export const KIT_INTENT_TAB_KEYS = ['id', 'title', ...KIT_INTENT_SECTION_KEYS, KIT_INTENT_THEME_KEY] as const;
|
|
145
|
+
export const KIT_INTENT_SECTION_KEYS = ['product', 'objects', 'roles', 'views', 'actions', 'list_layout'] as const;
|
|
146
|
+
export const KIT_INTENT_TOP_KEYS = ['title', 'subtitle', 'frame', ...KIT_INTENT_SECTION_KEYS, 'top', 'tabs', 'locale', 'notes'] as const;
|
|
147
|
+
export const KIT_INTENT_TAB_KEYS = ['id', 'title', ...KIT_INTENT_SECTION_KEYS] as const;
|
|
147
148
|
export const KIT_INTENT_OBJECT_KEYS = ['api', 'write_api', 'delete_api', 'fields'] as const;
|
|
148
149
|
|
|
149
150
|
/**
|
|
@@ -154,7 +155,8 @@ export const KIT_INTENT_OBJECT_KEYS = ['api', 'write_api', 'delete_api', 'fields
|
|
|
154
155
|
export function deriveIntentFieldKeys(): readonly string[] {
|
|
155
156
|
const w = kitAiWriter();
|
|
156
157
|
const schemaKeys = aiKeysOf(w.schema).filter((k) => k !== 'rules' && k !== 'name');
|
|
157
|
-
|
|
158
|
+
// 展示词键只在真源 aiDisplayMap.level 为 ai 时进写面(裁决 Q7:本期 human-only,不向模型暴露;写了由 checkKeys 报越权 KIT-AIT-002)
|
|
159
|
+
return [...new Set(['name', ...aiKeysOf(w.fieldRef), ...schemaKeys, ...w.aiRuleKeys, ...(kitAiDisplayOpen() ? [kitAiDisplayMap().key] : [])])];
|
|
158
160
|
}
|
|
159
161
|
export const KIT_INTENT_FIELD_KEYS: readonly string[] = deriveIntentFieldKeys();
|
|
160
162
|
export const KIT_INTENT_OPTION_KEYS = ['value', 'label', 'tone'] as const;
|
|
@@ -170,25 +172,6 @@ const COLOR_LITERAL = /^(#[0-9a-f]{3,8}|(rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|okl
|
|
|
170
172
|
|
|
171
173
|
const STR = { type: 'string' } as const;
|
|
172
174
|
|
|
173
|
-
/** 块级 theme 的结构化输出 schema:值域读 blockThemeDomain(),不手抄词条 */
|
|
174
|
-
function themeSchema(): Record<string, unknown> {
|
|
175
|
-
const d = blockThemeDomain();
|
|
176
|
-
return {
|
|
177
|
-
anyOf: [
|
|
178
|
-
{ type: 'string', enum: [...d.shorthands] },
|
|
179
|
-
{
|
|
180
|
-
type: 'object',
|
|
181
|
-
additionalProperties: false,
|
|
182
|
-
minProperties: 1,
|
|
183
|
-
properties: {
|
|
184
|
-
mode: { type: 'string', enum: [...d.modeWritable] },
|
|
185
|
-
color: { type: 'string', enum: [...d.colorWritable] },
|
|
186
|
-
},
|
|
187
|
-
},
|
|
188
|
-
],
|
|
189
|
-
description: '块级主题(只收词条):简写,或 mode(昼夜光感)/ color(主色意向)对象;不写颜色值',
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
175
|
|
|
193
176
|
/** 每个蓝图字段键的取值 schema(键集合由 `KIT_INTENT_FIELD_KEYS` 决定,缺项 → `checkIntentSurface` 报装配错误) */
|
|
194
177
|
const FIELD_PROP_SCHEMAS: Readonly<Record<string, () => Record<string, unknown>>> = {
|
|
@@ -205,6 +188,8 @@ const FIELD_PROP_SCHEMAS: Readonly<Record<string, () => Record<string, unknown>>
|
|
|
205
188
|
access: () => ({ type: 'string', enum: [...aiFieldAccess()], description: '字段访问权限(只读 read / 可写 write / 仅创建 create)' }),
|
|
206
189
|
emphasis: () => ({ type: 'string', enum: [...aiFieldEmphasis()], description: '字段视觉强调(strong 强显 / muted 弱化)' }),
|
|
207
190
|
highlight: () => ({ type: 'boolean', description: '字段视觉高亮' }),
|
|
191
|
+
role: () => ({ type: 'string', enum: [...aiFieldRoles()], description: '字段角色:status = 状态字段(值会随时间变好 / 变坏);只有状态字段的选项许用 warning / danger 色调,分类字段不写 tone' }),
|
|
192
|
+
relation: () => ({ type: 'string', enum: [...aiFieldRelations()], description: '关联类属性:值指向人 / 记录 / 标签 / 上级 / 附件 / 链接时写它(person 单人、people 多人、record 引用一条记录、records 多条关联记录、tags 多对多标签、parent 上下级归属、file / files 附件、link 来源或去向链接);编译器据此自动选展示与选择组件,不写组件名;展示的名称键用约定键(name / sub / avatar)' }),
|
|
208
193
|
options: () => {
|
|
209
194
|
const w = kitAiWriter();
|
|
210
195
|
return {
|
|
@@ -248,6 +233,7 @@ function sectionProperties(): Record<string, unknown> {
|
|
|
248
233
|
const w = kitAiWriter();
|
|
249
234
|
return {
|
|
250
235
|
product: { type: 'string', enum: [...kitProductIntents()], description: '页面模式意图词' },
|
|
236
|
+
list_layout: { type: 'string', enum: [...kitAiListLayouts()], description: '列表窗格形态(仅有列表窗格的页面模式:master-detail 等):side = 列表在侧栏(缺省);top = 上方条件框 + 下方整宽列表,列表列多、字段宽、条目多时用' },
|
|
251
237
|
objects: {
|
|
252
238
|
type: 'object',
|
|
253
239
|
maxProperties: w.limits.objectsMax,
|
|
@@ -309,8 +295,7 @@ export function kitIntentSchema(locales?: readonly string[]): JsonSchemaObject {
|
|
|
309
295
|
subtitle: STR,
|
|
310
296
|
frame: { type: 'string', enum: [...kitFrameIntents()], description: '页面框意图词' },
|
|
311
297
|
...section,
|
|
312
|
-
|
|
313
|
-
top: { type: 'object', additionalProperties: false, required: ['product', 'objects', 'roles'], properties: { ...section, theme: themeSchema() }, description: '带顶部概览的页面框用' },
|
|
298
|
+
top: { type: 'object', additionalProperties: false, required: ['product', 'objects', 'roles'], properties: { ...section }, description: '带顶部概览的页面框用' },
|
|
314
299
|
tabs: {
|
|
315
300
|
type: 'array',
|
|
316
301
|
minItems: 1,
|
|
@@ -319,7 +304,7 @@ export function kitIntentSchema(locales?: readonly string[]): JsonSchemaObject {
|
|
|
319
304
|
type: 'object',
|
|
320
305
|
additionalProperties: false,
|
|
321
306
|
required: ['id', 'title', 'product', 'objects', 'roles'],
|
|
322
|
-
properties: { id: { type: 'string', pattern: ID_PATTERN }, title: STR, ...section
|
|
307
|
+
properties: { id: { type: 'string', pattern: ID_PATTERN }, title: STR, ...section },
|
|
323
308
|
},
|
|
324
309
|
description: '页签页面框用:每个页签一个页面模式',
|
|
325
310
|
},
|
|
@@ -412,7 +397,19 @@ function checkField(f: unknown, at: string, out: PageDiagnostic[]): void {
|
|
|
412
397
|
if (f.highlight !== undefined && typeof f.highlight !== 'boolean') {
|
|
413
398
|
shape(out, `${at}.highlight`, 'highlight 须是布尔', '改成 true / false');
|
|
414
399
|
}
|
|
415
|
-
if (f.
|
|
400
|
+
if (f.role !== undefined) {
|
|
401
|
+
const roles = aiFieldRoles();
|
|
402
|
+
if (typeof f.role !== 'string' || !roles.includes(f.role)) {
|
|
403
|
+
out.push(issue(CODE_UNKNOWN, `${at}.role`, `role ${String(f.role)} 不在允许的取值内`, `改用 ${roles.join(' / ')},或删去(分类字段不写 role)`));
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
if (f.relation !== undefined) {
|
|
407
|
+
const relations = aiFieldRelations();
|
|
408
|
+
if (typeof f.relation !== 'string' || !relations.includes(f.relation)) {
|
|
409
|
+
out.push(issue(CODE_UNKNOWN, `${at}.relation`, `relation ${String(f.relation)} 不在允许的取值内`, `改用 ${relations.join(' / ')},或删去(不是关联属性的字段不写 relation)`));
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
if (f.display !== undefined && kitAiDisplayOpen()) {
|
|
416
413
|
const words = kitDisplayWords();
|
|
417
414
|
const word = typeof f.display === 'string' && words.includes(f.display) ? kitAiDisplayMap().words[f.display] : undefined;
|
|
418
415
|
if (word === undefined) {
|
|
@@ -697,7 +694,7 @@ function parseSection(raw: Record<string, unknown>, at: string, env: Env, out: P
|
|
|
697
694
|
}
|
|
698
695
|
|
|
699
696
|
// 展示词只作用于 list / summary 视图:字段带了 display(非默认的 text),却不在任何角色的这类视图里 → 不会生效
|
|
700
|
-
checkDisplayUsage(objects, roleObjects, isRecord(raw.views) ? raw.views : {}, p('objects'), out);
|
|
697
|
+
if (kitAiDisplayOpen()) checkDisplayUsage(objects, roleObjects, isRecord(raw.views) ? raw.views : {}, p('objects'), out);
|
|
701
698
|
checkHintUsage(objects, roleObjects, isRecord(raw.views) ? raw.views : {}, p('objects'), out);
|
|
702
699
|
|
|
703
700
|
// 写死模板禁止的对象键(roleShape.omit):该角色的视图由模板写死,蓝图不得为它写 views
|
|
@@ -756,6 +753,16 @@ function parseSection(raw: Record<string, unknown>, at: string, env: Env, out: P
|
|
|
756
753
|
});
|
|
757
754
|
}
|
|
758
755
|
}
|
|
756
|
+
|
|
757
|
+
// 列表窗格形态(list_layout):取值闭集 side / top;只有有列表窗格的页面模式可写
|
|
758
|
+
if (raw.list_layout !== undefined) {
|
|
759
|
+
const layouts = kitAiListLayouts();
|
|
760
|
+
if (typeof raw.list_layout !== 'string' || !layouts.includes(raw.list_layout)) {
|
|
761
|
+
out.push(issue(CODE_UNKNOWN, p('list_layout'), `list_layout ${String(raw.list_layout)} 不在闭集`, `改用 ${layouts.join(' / ')}`));
|
|
762
|
+
} else if (def !== undefined && def.listLayout !== true) {
|
|
763
|
+
shape(out, p('list_layout'), `页面模式 ${String(productIntent)} 没有列表窗格,不收 list_layout`, '删去 list_layout');
|
|
764
|
+
}
|
|
765
|
+
}
|
|
759
766
|
}
|
|
760
767
|
|
|
761
768
|
/**
|
|
@@ -771,8 +778,6 @@ export function parseKitIntentBlueprint(raw: unknown, options: KitIntentOptions
|
|
|
771
778
|
|
|
772
779
|
checkKeys(raw, KIT_INTENT_TOP_KEYS, '', out);
|
|
773
780
|
scanColors(raw, '', out);
|
|
774
|
-
// 块级主题(D1'):根 = page.theme;只收词条,由 checkBlockTheme 判
|
|
775
|
-
if (raw.theme !== undefined) out.push(...blockThemeAitIssues(raw.theme, 'theme'));
|
|
776
781
|
checkString(raw.title, 'title', out);
|
|
777
782
|
if (raw.subtitle !== undefined && typeof raw.subtitle !== 'string') shape(out, 'subtitle', 'subtitle 须是字符串', '改成字符串');
|
|
778
783
|
if (raw.locale !== undefined && (typeof raw.locale !== 'string' || !LOCALE_RE.test(raw.locale))) shape(out, 'locale', 'locale 须是语言标签(如 zh-CN / en)', '改成语言标签');
|
|
@@ -804,8 +809,7 @@ export function parseKitIntentBlueprint(raw: unknown, options: KitIntentOptions
|
|
|
804
809
|
} else if (!isRecord(raw.top)) {
|
|
805
810
|
shape(out, 'top', 'top 须是对象', '写成 { product, objects, roles }');
|
|
806
811
|
} else {
|
|
807
|
-
checkKeys(raw.top, [...KIT_INTENT_SECTION_KEYS
|
|
808
|
-
if (raw.top.theme !== undefined) out.push(...blockThemeAitIssues(raw.top.theme, 'top.theme'));
|
|
812
|
+
checkKeys(raw.top, [...KIT_INTENT_SECTION_KEYS], 'top', out);
|
|
809
813
|
parseSection(raw.top, 'top', env, out);
|
|
810
814
|
}
|
|
811
815
|
} else if (hasTop) {
|
|
@@ -832,7 +836,6 @@ export function parseKitIntentBlueprint(raw: unknown, options: KitIntentOptions
|
|
|
832
836
|
ids.add(t.id);
|
|
833
837
|
}
|
|
834
838
|
checkString(t.title, `${tat}.title`, out);
|
|
835
|
-
if (t.theme !== undefined) out.push(...blockThemeAitIssues(t.theme, `${tat}.theme`));
|
|
836
839
|
parseSection(t, tat, env, out);
|
|
837
840
|
});
|
|
838
841
|
}
|
|
@@ -56,7 +56,6 @@ import { aiActionOn, aiTones, fieldHintKeys, KitAiSurfaceError, kitAiDisplayMap,
|
|
|
56
56
|
import { compileKitIntentBlueprint } from './compile';
|
|
57
57
|
import { kitReviseDriftIssues, splitKitReviseScope } from './drift';
|
|
58
58
|
import { checkDisplayMap, checkIntentMap, frameKindOfIntent, kitFrameIntents, kitProductIntents, productKindOfIntent, type KitIntentMapApp } from './intent-map';
|
|
59
|
-
import { blockThemeDomain } from '../theme/block-theme';
|
|
60
59
|
import { checkIntentSurface, kitIntentSchema, parseKitIntentBlueprint, type KitIntentBlueprint } from './intent-schema';
|
|
61
60
|
import { checkKitWriterSurface } from './writer-policy';
|
|
62
61
|
|
|
@@ -110,7 +109,7 @@ const REVISE_SCOPE_SCHEMA: JsonSchemaObject = Object.freeze({
|
|
|
110
109
|
additionalProperties: false,
|
|
111
110
|
required: ['touched', 'added', 'removed'],
|
|
112
111
|
properties: {
|
|
113
|
-
touched: { type: 'array', items: { type: 'string' }, description: '改动了的条目:object:<对象名> / view:<角色> / title / frame / product / actions / tabs / locale
|
|
112
|
+
touched: { type: 'array', items: { type: 'string' }, description: '改动了的条目:object:<对象名> / view:<角色> / title / frame / product / actions / tabs / locale' },
|
|
114
113
|
added: { type: 'array', items: { type: 'string' }, description: '新增的条目,写法同 touched' },
|
|
115
114
|
removed: { type: 'array', items: { type: 'string' }, description: '删除的条目,写法同 touched' },
|
|
116
115
|
},
|
|
@@ -214,7 +213,7 @@ function composePrompt(registry: KitIntentMapApp, ctx: PageTargetContext, mode:
|
|
|
214
213
|
const frames = kitFrameIntents().map((k) => describeFrameIntent(k, registry));
|
|
215
214
|
const w = kitAiWriter();
|
|
216
215
|
const lines = [
|
|
217
|
-
'你是页面意图编排器:只输出单个严格的页面意图蓝图 JSON 对象(顶层允许键:title / subtitle / frame / product / objects / roles / views / actions / top / tabs / locale /
|
|
216
|
+
'你是页面意图编排器:只输出单个严格的页面意图蓝图 JSON 对象(顶层允许键:title / subtitle / frame / product / objects / roles / views / actions / top / tabs / locale / notes),',
|
|
218
217
|
'模板、版式、组件、样式、事件、主题、信封都由 kit 的写死模板与确定性编译器给出,你不写任何样式类名、颜色值、组件名或布局数字。',
|
|
219
218
|
'',
|
|
220
219
|
'页面框 frame 的意图词与放置规则:',
|
|
@@ -234,7 +233,7 @@ function composePrompt(registry: KitIntentMapApp, ctx: PageTargetContext, mode:
|
|
|
234
233
|
' 行内删除用 remove(on 写 row,只用于 crud 页面模式):所属对象须另给 delete_api(取授权接口里方法为 DELETE 的接口;删除以 DELETE 发出,主键由系统拼进查询串);确认弹窗由系统恒加,可用 confirm_text 写一句纯文本确认语(缺省用默认文案;文案里可写 {name} 占位,运行时换成被删条目的标题字段 title / name / label,对象没有这类字段就不要写 {name}),不能关掉确认。',
|
|
235
234
|
'5) 字段可写 display 展示语义词(只对 list / summary 视图生效,须与字段类型匹配):',
|
|
236
235
|
...displayLines(),
|
|
237
|
-
|
|
236
|
+
'6) 不写任何主题(theme):主题只在应用级由人选定,页面与区块都没有主题键。',
|
|
238
237
|
...roleShapeLines(),
|
|
239
238
|
'',
|
|
240
239
|
'授权接口字典:',
|
|
@@ -244,7 +243,7 @@ function composePrompt(registry: KitIntentMapApp, ctx: PageTargetContext, mode:
|
|
|
244
243
|
lines.push(
|
|
245
244
|
'',
|
|
246
245
|
'修订模式:在给出的底稿上做最小增量修改,输出完整蓝图;未提及的部分必须与底稿逐字相同。',
|
|
247
|
-
'必须在顶层 notes 数组第一条写范围申报字符串:revise_scope {"touched":[...],"added":[...],"removed":[...]},条目写 object:<对象名> / view:<角色> / title / frame / product / actions / tabs / locale
|
|
246
|
+
'必须在顶层 notes 数组第一条写范围申报字符串:revise_scope {"touched":[...],"added":[...],"removed":[...]},条目写 object:<对象名> / view:<角色> / title / frame / product / actions / tabs / locale;范围外的任何差异都会被判为漂移并要求重来。',
|
|
248
247
|
);
|
|
249
248
|
} else if (mode === 'preview' || mode === 'visualize') {
|
|
250
249
|
lines.push('', '本次只用于预览:照常输出完整蓝图。');
|
|
@@ -16,13 +16,13 @@ import {
|
|
|
16
16
|
aiKeysOf,
|
|
17
17
|
aiPermissions,
|
|
18
18
|
aiTones,
|
|
19
|
-
blockThemeAitIssues,
|
|
20
19
|
compilerKeysOf,
|
|
21
20
|
fieldHintKeys,
|
|
22
21
|
hintSlots,
|
|
23
22
|
isThemeKey,
|
|
24
23
|
KIT_REMOVE_CONFIRM_REF,
|
|
25
24
|
kitAiDisplayMap,
|
|
25
|
+
kitAiDisplayOpen,
|
|
26
26
|
kitAiWriter,
|
|
27
27
|
kitViewSlots,
|
|
28
28
|
kitFieldTypes,
|
|
@@ -192,6 +192,8 @@ const aiSlotBodyKeysOf = (): string[] => aiKeysOf(kitAiWriter().view).filter((k)
|
|
|
192
192
|
/** 视图字段引用若是对象,只认编译器按 aiDisplayMap 写的形状:{ name, component, props? },组件与固定 props 必须是某个展示词的映射,且只在 display 起作用的槽位 */
|
|
193
193
|
function isCompilerDisplayRef(ref: unknown, slot: string): boolean {
|
|
194
194
|
const map = kitAiDisplayMap();
|
|
195
|
+
// 展示词本期不对 AI 开放(真源 level human-only,裁决 Q7):AI 页里不会有编译器代写的展示映射,出现即越权
|
|
196
|
+
if (!kitAiDisplayOpen()) return false;
|
|
195
197
|
if (!map.slots.includes(slot) || !isRecord(ref) || typeof ref.name !== 'string' || typeof ref.component !== 'string') return false;
|
|
196
198
|
if (!Object.keys(ref).every((k) => k === 'name' || k === 'component' || k === 'props')) return false;
|
|
197
199
|
const props = ref.props === undefined ? {} : ref.props;
|
|
@@ -224,7 +226,7 @@ function checkView(view: unknown, at: string, actionIds: ReadonlySet<string>, ou
|
|
|
224
226
|
} else {
|
|
225
227
|
body.fields.forEach((f, i) => {
|
|
226
228
|
if (typeof f === 'string' || isCompilerDisplayRef(f, slot) || isCompilerHintRef(f, slot)) return;
|
|
227
|
-
out.push(issue(CODE_OVERREACH, `${sat}.fields[${i}]`, '字段引用只许字段 id 字符串(展示词映射出的 { name, component, props } 由编译器按 aiDisplayMap 写,form / filter 的 { name, placeholder, help } 由编译器按 fieldRef 的 ai 键写;其余 component / width / class … 属人写)', '写成字段 id 字符串;要换展示,在蓝图字段上写 display;要加提示,写 placeholder / help'));
|
|
229
|
+
out.push(issue(CODE_OVERREACH, `${sat}.fields[${i}]`, '字段引用只许字段 id 字符串(展示词映射出的 { name, component, props } 由编译器按 aiDisplayMap 写,form / filter 的 { name, placeholder, help } 由编译器按 fieldRef 的 ai 键写;其余 component / width / class … 属人写)', kitAiDisplayOpen() ? '写成字段 id 字符串;要换展示,在蓝图字段上写 display;要加提示,写 placeholder / help' : '写成字段 id 字符串;展示由字段类型缺省与应用级界面规则(kit.app.yaml#look)给出;要加提示,写 placeholder / help'));
|
|
228
230
|
});
|
|
229
231
|
}
|
|
230
232
|
}
|
|
@@ -252,7 +254,6 @@ function checkProduct(product: unknown, at: string, map: KitIntentMap, out: Page
|
|
|
252
254
|
const w = kitAiWriter();
|
|
253
255
|
if (!isRecord(product)) return void out.push(issue(CODE_SHAPE, at, '产品须是对象 { kind, objects }', '按编译器输出'));
|
|
254
256
|
checkKeys(product, [...aiKeysOf(w.product), ...compilerKeysOf(w.product)], at, out);
|
|
255
|
-
if (product.theme !== undefined) out.push(...blockThemeAitIssues(product.theme, `${at}.theme`));
|
|
256
257
|
if (typeof product.kind !== 'string' || !productKindsOfMap(map).has(product.kind)) {
|
|
257
258
|
out.push(issue(CODE_OVERREACH, `${at}.kind`, `业务组件 ${String(product.kind)} 不是意图映射给出的件`, '页面模式只由意图映射确定,不要手写业务组件名'));
|
|
258
259
|
}
|
|
@@ -284,8 +285,6 @@ export function checkKitWriterSurface(page: unknown, options: KitWriterPolicyOpt
|
|
|
284
285
|
|
|
285
286
|
if (isRecord(page.page)) {
|
|
286
287
|
checkKeys(page.page, [...aiKeysOf(w.page), ...compilerKeysOf(w.page)], 'page', out);
|
|
287
|
-
// 块级主题(D1'):只收词条,与人写页共用 checkBlockTheme
|
|
288
|
-
if (page.page.theme !== undefined) out.push(...blockThemeAitIssues(page.page.theme, 'page.theme'));
|
|
289
288
|
if (page.page.url !== KIT_PLACEHOLDER_URL) {
|
|
290
289
|
out.push(issue(CODE_FOREIGN, 'page.url', `page.url 须是占位值 ${KIT_PLACEHOLDER_URL}(地址由提交给定);传入的不是本目标 accept 出的源`, '用本目标 accept 出的源,不要自带地址'));
|
|
291
290
|
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// 应用组件的版式配方出口(重构工单 P15,工序 3):区块纵向栈 / 并排区块 / 节标题 / 元信息行。
|
|
2
|
+
// 应用组件(kit 应用的 components/App*.ts)自己拼版时只取这四个名字,不自写 gap-N / text-N / @md: 断点:
|
|
3
|
+
// · 节奏 = 间距角色类(gap-stack / gap-region / gap-section,随密度同比走,真源 kit-nine-dim 的区块级间距角色);
|
|
4
|
+
// · 字阶 = 字阶角色(kitTypographyRecipe,真源 kit-type#roles);
|
|
5
|
+
// · 断点 = 排布引擎按两侧最小宽求出的容器档(arrangeSplit,真源 kit-arrange#split),不是作者挑的 @md。
|
|
6
|
+
// 运行时不测量:并排 / 堆叠只切换这里写出的容器查询类;宿主必须是查询容器(kitAppSideBySideRecipe 的 host 类)。
|
|
7
|
+
import { KIT_ARRANGE, arrangeSplit } from 'soma-foundation/arrange';
|
|
8
|
+
import { classCandidates } from '../shared/class-candidates';
|
|
9
|
+
import { mergeClass } from '../shared/merge-class';
|
|
10
|
+
import { kitTypographyRecipe } from './typography';
|
|
11
|
+
|
|
12
|
+
/** 区块之间的节奏档:stack = 同一块里的上下行;region = 同一面板里的区块;section = 面板 / 分组之间 */
|
|
13
|
+
export type KitAppRhythm = 'stack' | 'region' | 'section';
|
|
14
|
+
|
|
15
|
+
const RHYTHM_GAP: Readonly<Record<KitAppRhythm, string>> = Object.freeze({
|
|
16
|
+
stack: 'gap-stack',
|
|
17
|
+
region: 'gap-region',
|
|
18
|
+
section: 'gap-section',
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
/** 区块纵向栈:子块自上而下,间距取节奏档(缺省 region) */
|
|
22
|
+
export function kitAppStackRecipe(rhythm: KitAppRhythm = 'region'): string {
|
|
23
|
+
return `flex min-w-0 flex-col ${RHYTHM_GAP[rhythm]}`;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** 并排区块的类:host 打在外层(查询容器),row 打在内层(窄于并排档时上下堆叠,到档后左右并排、两侧等分) */
|
|
27
|
+
export interface KitAppSideBySide {
|
|
28
|
+
readonly host: string;
|
|
29
|
+
readonly row: string;
|
|
30
|
+
/** 并排线所在的容器档名(排布引擎求出,供单测与诊断) */
|
|
31
|
+
readonly tier: string | null;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* 并排区块:两侧各自的最小宽(rem)由调用方按内容给出(如「报告头结论列 22rem、日期列 10rem」),
|
|
36
|
+
* 引擎求出两侧都放得下的最窄容器档作并排线;节奏档缺省 region。
|
|
37
|
+
*/
|
|
38
|
+
export function kitAppSideBySideRecipe(input: { startMinRem: number; endMinRem: number; rhythm?: KitAppRhythm }): KitAppSideBySide {
|
|
39
|
+
// 两侧等分:左侧占栅格总份数的一半(真源 kit-arrange#split.total)
|
|
40
|
+
const plan = arrangeSplit({ aMinRem: input.startMinRem, bMinRem: input.endMinRem, aSpans: [KIT_ARRANGE.split.total / 2] });
|
|
41
|
+
const gap = RHYTHM_GAP[input.rhythm ?? 'region'];
|
|
42
|
+
const tier = plan.fits && plan.tier !== '' ? plan.tier : null;
|
|
43
|
+
// grid-cols-2 = repeat(2, minmax(0, 1fr)):两侧等分且各自可收缩,长内容不撑破并排
|
|
44
|
+
const row = tier === null
|
|
45
|
+
? `grid min-w-0 grid-cols-1 ${gap}`
|
|
46
|
+
: `grid min-w-0 grid-cols-1 ${gap} @${tier}:grid-cols-2`;
|
|
47
|
+
return { host: '@container min-w-0', row, tier };
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** 节标题(面板 / 分组内的小标题):字阶角色 sectionTitle */
|
|
51
|
+
export function kitAppSectionTitleRecipe(): string {
|
|
52
|
+
return kitTypographyRecipe('sectionTitle');
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** 元信息行(时间、作者、口径、计数这类辅助文字的一行):可换行、项间节奏 stack、字阶 caption(次要色) */
|
|
56
|
+
export function kitAppMetaRowRecipe(): string {
|
|
57
|
+
return mergeClass('flex min-w-0 flex-wrap items-center gap-stack', kitTypographyRecipe('caption'));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** 本文件会写出的类(容器档逐档的并排类由调用方的 kitAppSideBySideRecipe 结果并入其组件候选) */
|
|
61
|
+
export const KIT_APP_BLOCK_CLASS_CANDIDATES: readonly string[] = classCandidates(
|
|
62
|
+
Object.values(RHYTHM_GAP).map((g) => kitAppStackRecipe(g.replace('gap-', '') as KitAppRhythm)),
|
|
63
|
+
kitAppSectionTitleRecipe(),
|
|
64
|
+
kitAppMetaRowRecipe(),
|
|
65
|
+
'@container',
|
|
66
|
+
);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// 画布、外壳、顶栏三个层级角色的底色唯一出口(《Kit主题规则与算法》§3.9 KT-HB-F)。页面框只引这里,不直接写底色类。
|
|
2
|
+
// 画布:页面内容区的底。类必须是井色类(kitWellRecipe 的返回值)——编译期层级标注靠它把最外层认作画布层(data-kit-layer="0"),
|
|
3
|
+
// 层 0 规则再把底色换成画布令牌 --soma-surface-canvas(各层级档的画布色)。
|
|
4
|
+
// 外壳:侧栏等外壳件的底。类是 bg-surface;外壳的实际着色由结构规则按外壳标记换成 --soma-shell-bg(层级档 × 外壳维)。
|
|
5
|
+
// 顶栏:底 = --soma-layer-top,下缘一条顶栏线 --soma-layer-top-line。
|
|
6
|
+
|
|
7
|
+
import { kitDividerRecipe } from './divider';
|
|
8
|
+
import { kitWellRecipe } from './surface';
|
|
9
|
+
|
|
10
|
+
/** 画布底(只许页面框最外层用) */
|
|
11
|
+
export const KIT_CANVAS_CLASS = kitWellRecipe();
|
|
12
|
+
/** 外壳底(侧栏、外壳列) */
|
|
13
|
+
export const KIT_SHELL_CLASS = 'bg-surface';
|
|
14
|
+
/** 顶栏底(不含下缘线:页签操作区等贴在顶栏里的件用) */
|
|
15
|
+
export const KIT_TOPBAR_FILL_CLASS = 'bg-layer-top';
|
|
16
|
+
/** 顶栏:底 + 下缘顶栏线 */
|
|
17
|
+
export const KIT_TOPBAR_CLASS = `${KIT_TOPBAR_FILL_CLASS} ${kitDividerRecipe('bottom', 'top')}`;
|
|
18
|
+
|
|
19
|
+
/** 本文件写出的类(样式闭集登记用) */
|
|
20
|
+
export const KIT_CHROME_SURFACE_CLASS_CANDIDATES: readonly string[] = Object.freeze([...new Set(`${KIT_CANVAS_CLASS} ${KIT_SHELL_CLASS} ${KIT_TOPBAR_CLASS}`.split(' '))]);
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// 代码展示配方(CodeView 高亮形态,内容展示批次 ③):记号色、行号槽、高亮行、折叠条、双向字符警告的类串只从这里取。
|
|
2
|
+
// 依据:参考文本差异组件笔记 C.4。
|
|
3
|
+
// 记号色(暂行,待令牌):规格要求 14 个 `--tok-*` 令牌、亮暗各一套、每个对代码底 ≥ 4.5:1(R20);令牌在主题单链上,
|
|
4
|
+
// 主题 tpl 归视觉工具线(handoff 需对方 N-2)。令牌到位前暂取已有的 on-soft 文字色(都是按 ≥ 4.5:1 配对过的文字色),
|
|
5
|
+
// 只在本文件的 TOKEN_CLASS 一张表;到位后只改这张表。
|
|
6
|
+
|
|
7
|
+
import { classCandidates } from '../shared/class-candidates';
|
|
8
|
+
|
|
9
|
+
export type KitCodeTokenKind =
|
|
10
|
+
| 'plain' | 'comment' | 'keyword' | 'string' | 'number' | 'constant' | 'function' | 'type'
|
|
11
|
+
| 'variable' | 'property' | 'operator' | 'punctuation' | 'tag' | 'attribute';
|
|
12
|
+
|
|
13
|
+
const TOKEN_CLASS: Readonly<Record<KitCodeTokenKind, string>> = Object.freeze({
|
|
14
|
+
plain: '',
|
|
15
|
+
comment: 'text-syntax-comment italic',
|
|
16
|
+
keyword: 'text-syntax-keyword',
|
|
17
|
+
string: 'text-syntax-string',
|
|
18
|
+
number: 'text-syntax-number',
|
|
19
|
+
constant: 'text-syntax-number',
|
|
20
|
+
function: 'text-syntax-fn',
|
|
21
|
+
type: 'text-syntax-type',
|
|
22
|
+
variable: 'text-fg',
|
|
23
|
+
property: 'text-syntax-op',
|
|
24
|
+
operator: 'text-syntax-op',
|
|
25
|
+
punctuation: 'text-syntax-op',
|
|
26
|
+
tag: 'text-syntax-tag',
|
|
27
|
+
attribute: 'text-syntax-fn',
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export function kitCodeTokenClass(kind: string): string {
|
|
31
|
+
return (TOKEN_CLASS as Record<string, string>)[kind] ?? '';
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** 代码区:每行一个块;横滚 / 换行两种 */
|
|
35
|
+
// 行高:规格建议 1.6(中文注释是常态);主题头没有 leading 尺度,暂随 text-xs 档的行高(需对方 N-2 一并给出)
|
|
36
|
+
export const KIT_CODE_LINES_SCROLL_CLASS = 'm-0 overflow-x-auto font-mono text-xs text-fg whitespace-pre';
|
|
37
|
+
export const KIT_CODE_LINES_WRAP_CLASS = 'm-0 font-mono text-xs text-fg whitespace-pre-wrap break-words';
|
|
38
|
+
/** 一行:行号槽 + 正文;高亮行带浅底 + 左边条(第二线索,不只靠颜色) */
|
|
39
|
+
export const KIT_CODE_LINE_CLASS = 'flex min-w-max gap-3';
|
|
40
|
+
export const KIT_CODE_LINE_WRAP_CLASS = 'flex gap-3';
|
|
41
|
+
// 标记行 = 搜索命中底(bg-highlight)+ 起始侧强调竖条
|
|
42
|
+
export const KIT_CODE_LINE_MARKED_CLASS = 'flex min-w-max gap-3 bg-highlight border-s-emphasis border-primary';
|
|
43
|
+
export const KIT_CODE_LINE_MARKED_WRAP_CLASS = 'flex gap-3 bg-highlight border-s-emphasis border-primary';
|
|
44
|
+
/** 行号:右对齐、不可选、读屏隐藏 */
|
|
45
|
+
export const KIT_CODE_GUTTER_CLASS = 'w-8 shrink-0 select-none text-end tabular-nums text-fg-subtle';
|
|
46
|
+
export const KIT_CODE_TEXT_CLASS = 'min-w-0';
|
|
47
|
+
/** 头部:语言 / 文件名标签 */
|
|
48
|
+
export const KIT_CODE_LANG_CLASS = 'text-xs font-medium text-fg-muted';
|
|
49
|
+
/** 双向控制字符警告标记(行首) */
|
|
50
|
+
export const KIT_CODE_BIDI_CLASS = 'inline-flex shrink-0 items-center select-none text-warning-on-soft';
|
|
51
|
+
export const KIT_CODE_NOTE_CLASS = 'text-xs text-fg-subtle';
|
|
52
|
+
|
|
53
|
+
export const KIT_CODE_VIEW_RECIPE_CLASS_CANDIDATES: readonly string[] = classCandidates(
|
|
54
|
+
Object.values(TOKEN_CLASS), KIT_CODE_LINES_SCROLL_CLASS, KIT_CODE_LINES_WRAP_CLASS, KIT_CODE_LINE_CLASS, KIT_CODE_LINE_WRAP_CLASS,
|
|
55
|
+
KIT_CODE_LINE_MARKED_CLASS, KIT_CODE_LINE_MARKED_WRAP_CLASS, KIT_CODE_GUTTER_CLASS, KIT_CODE_TEXT_CLASS, KIT_CODE_LANG_CLASS,
|
|
56
|
+
KIT_CODE_BIDI_CLASS, KIT_CODE_NOTE_CLASS,
|
|
57
|
+
);
|