soma-kit 0.1.15 → 0.1.17
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/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 -340
- package/spec/generated/kit-page.schema.json +1134 -139
- package/spec/kit-grammar.json +935 -93
- package/spec/kit-grammar.schema.json +167 -2
- package/src/app/app-config.ts +219 -186
- package/src/app/define-kit-actions.ts +126 -20
- package/src/app/define-kit-app.ts +49 -4
- package/src/app/index.ts +5 -0
- package/src/app/kit-view-context.ts +39 -1
- 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 +67 -23
- package/src/app/theme-runtime.ts +414 -85
- 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 +104 -59
- package/src/base/anchored-layer.ts +7 -6
- 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 +347 -50
- package/src/base/card.ts +233 -0
- package/src/base/cascader.ts +143 -32
- package/src/base/check-core.ts +193 -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 +399 -27
- package/src/base/combobox.ts +6 -2
- package/src/base/command-palette.ts +148 -36
- package/src/base/context-menu.ts +23 -6
- package/src/base/countdown.ts +37 -15
- package/src/base/date-range.ts +114 -96
- package/src/base/date.ts +481 -74
- package/src/base/delta.ts +16 -9
- package/src/base/divider.ts +51 -33
- package/src/base/end-edge.ts +10 -4
- package/src/base/fab.ts +57 -21
- package/src/base/gap-value.ts +34 -15
- package/src/base/hint-tips.ts +99 -29
- 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 +79 -22
- package/src/base/inline-error.ts +13 -7
- package/src/base/input.ts +135 -35
- package/src/base/kbd.ts +30 -17
- package/src/base/kit-contract.ts +400 -0
- package/src/base/link.ts +41 -20
- package/src/base/listbox-core.ts +282 -101
- package/src/base/loading-gate.ts +3 -0
- package/src/base/look.ts +197 -0
- package/src/base/mentions.ts +55 -22
- package/src/base/menu-button.ts +73 -22
- package/src/base/menu-core.ts +201 -24
- package/src/base/month-grid.ts +60 -3
- package/src/base/motion/aura.ts +52 -10
- package/src/base/motion/hover-3d.ts +7 -5
- package/src/base/motion/hover-gallery.ts +16 -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 +139 -27
- package/src/base/overlay-runtime.ts +30 -23
- package/src/base/overlay-shell.ts +59 -14
- package/src/base/period-picker.ts +868 -0
- package/src/base/popover.ts +624 -73
- package/src/base/popup.ts +187 -52
- 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 +141 -22
- 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 +58 -16
- package/src/base/relation-cells.ts +541 -0
- package/src/base/resize-handle.ts +5 -3
- package/src/base/row-fresh.ts +84 -0
- package/src/base/section-spy.ts +79 -0
- package/src/base/segmented.ts +70 -26
- package/src/base/select.ts +8 -3
- package/src/base/shared.ts +482 -71
- package/src/base/spinner.ts +107 -0
- package/src/base/state-panel.ts +77 -22
- 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 +123 -54
- package/src/base/tag.ts +184 -66
- package/src/base/text.ts +461 -71
- package/src/base/textarea.ts +88 -39
- package/src/base/time-picker.ts +335 -55
- package/src/base/time-range.ts +846 -0
- package/src/base/tree-select.ts +342 -88
- package/src/base/upload.ts +604 -158
- package/src/base/view-transition.ts +7 -3
- package/src/base/virtual-list.ts +49 -14
- package/src/biz/approval-desk/compile.ts +70 -5
- package/src/biz/approval-desk/index.ts +2 -0
- package/src/biz/approval-desk/shell.ts +52 -12
- package/src/biz/auth-panel/compile.ts +13 -3
- package/src/biz/auth-panel/shell.ts +27 -7
- package/src/biz/category-crud/compile.ts +51 -13
- package/src/biz/category-crud/index.ts +2 -0
- package/src/biz/category-crud/shell.ts +29 -9
- package/src/biz/checkout-page/compile.ts +37 -3
- package/src/biz/checkout-page/index.ts +1 -0
- package/src/biz/checkout-page/shell.ts +26 -9
- package/src/biz/compose.ts +6 -1
- package/src/biz/data-components.ts +2 -0
- package/src/biz/import-wizard/compile.ts +4 -1
- package/src/biz/import-wizard/index.ts +1 -0
- package/src/biz/import-wizard/shell.ts +32 -18
- package/src/biz/index.ts +1 -1
- package/src/biz/landing-page/compile.ts +3 -2
- package/src/biz/landing-page/shell.ts +22 -3
- package/src/biz/layout-contracts.ts +918 -0
- package/src/biz/link/hub.ts +199 -8
- package/src/biz/link/shared.ts +54 -15
- package/src/biz/master-sub/compile.ts +194 -57
- package/src/biz/master-sub/detail-head.ts +141 -18
- package/src/biz/master-sub/index.ts +3 -0
- package/src/biz/master-sub/shell.ts +188 -62
- package/src/biz/multi-board/compile.ts +87 -36
- package/src/biz/multi-board/composition.ts +7 -20
- package/src/biz/multi-board/index.ts +3 -2
- package/src/biz/multi-board/prose-fold.ts +15 -11
- package/src/biz/multi-board/shell.ts +148 -37
- package/src/biz/notification-center/compile.ts +20 -6
- package/src/biz/notification-center/index.ts +2 -0
- package/src/biz/notification-center/shell.ts +43 -10
- package/src/biz/page-templates/domain-templates.ts +145 -22
- package/src/biz/page-templates/result-page/compile.ts +4 -1
- package/src/biz/page-templates/result-page/index.ts +1 -0
- package/src/biz/page-templates/result-page/shell.ts +17 -4
- package/src/biz/page-templates/sign-in-page/compile.ts +19 -8
- package/src/biz/page-templates/sign-in-page/index.ts +1 -0
- package/src/biz/page-templates/sign-in-page/shell.ts +28 -12
- package/src/biz/record-detail/compile.ts +39 -11
- package/src/biz/record-detail/index.ts +1 -0
- package/src/biz/record-detail/shell.ts +41 -10
- package/src/biz/settings-center/compile.ts +4 -1
- package/src/biz/settings-center/index.ts +1 -0
- package/src/biz/settings-center/shell.ts +30 -9
- package/src/biz/shared/action-host.ts +137 -46
- package/src/biz/shared/compile-helpers.ts +152 -28
- package/src/biz/shared/coordinator.ts +628 -147
- 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 +58 -10
- package/src/biz/shared/overlay-shell.ts +40 -10
- 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 +4 -2
- package/src/biz/single-form/index.ts +2 -0
- package/src/biz/single-form/shell.ts +21 -11
- package/src/biz/standard-crud/compile.ts +206 -38
- package/src/biz/standard-crud/index.ts +2 -1
- package/src/biz/standard-crud/shell.ts +82 -22
- package/src/biz/standard-crud/summary.ts +2 -37
- package/src/biz/step-form/compile.ts +12 -3
- package/src/biz/step-form/hub.ts +165 -50
- package/src/biz/step-form/index.ts +1 -0
- package/src/biz/step-form/shell.ts +31 -15
- package/src/biz/types.ts +40 -4
- package/src/cli/kit-cli.ts +145 -26
- package/src/cli/kit-init.ts +3 -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/closed-set.ts +102 -6
- package/src/compile/compile-page.ts +446 -53
- package/src/compile/component-candidates.ts +56 -4
- package/src/compile/danger-tier.ts +65 -0
- package/src/compile/hints.ts +1 -1
- package/src/compile/info-structure.ts +155 -0
- package/src/compile/layout-lint/rules-composition.ts +2 -1
- 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 +382 -46
- 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/relation-render.ts +120 -0
- package/src/compile/remove-guard.ts +115 -41
- package/src/compile/stages.ts +645 -28
- package/src/compile/styles.ts +226 -26
- package/src/compile/types.ts +62 -5
- package/src/compile/view-check.ts +190 -1
- package/src/data/access-gate.ts +17 -9
- package/src/data/amount-breakdown.ts +49 -22
- package/src/data/anchor-nav.ts +73 -15
- package/src/data/approval-flow.ts +210 -124
- package/src/data/assignment-picker.ts +163 -85
- package/src/data/async-result-panel.ts +110 -46
- package/src/data/audit-log.ts +461 -0
- package/src/data/breadcrumbs.ts +141 -19
- package/src/data/calendar.ts +434 -96
- package/src/data/card-grid.ts +319 -0
- package/src/data/carousel.ts +72 -38
- package/src/data/cell-value.ts +253 -0
- package/src/data/chart.ts +904 -77
- package/src/data/checklist.ts +78 -35
- package/src/data/code-view.ts +106 -48
- package/src/data/comment-thread.ts +607 -87
- package/src/data/compare-view.ts +227 -0
- package/src/data/confirm-dialog.ts +198 -30
- 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 +107 -50
- package/src/data/display-util.ts +9 -4
- package/src/data/dock.ts +33 -17
- package/src/data/embed.ts +142 -7
- package/src/data/engine-ports.ts +13 -4
- package/src/data/field-mapper.ts +104 -48
- package/src/data/file-list.ts +522 -0
- package/src/data/flow-editor.ts +603 -142
- package/src/data/flow-node-options.ts +24 -5
- package/src/data/flow-remote-options.ts +94 -19
- package/src/data/footer.ts +85 -27
- package/src/data/form-draft-registry.ts +183 -12
- package/src/data/gantt.ts +637 -117
- package/src/data/graph-view.ts +51 -0
- package/src/data/heat-calendar.ts +412 -0
- package/src/data/hero.ts +38 -15
- package/src/data/image-viewer.ts +261 -62
- package/src/data/index.ts +63 -1
- package/src/data/item-list.ts +217 -57
- package/src/data/json-view.ts +165 -100
- package/src/data/kanban.ts +339 -87
- 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 +155 -45
- package/src/data/matrix.ts +217 -112
- package/src/data/media-grid.ts +162 -38
- package/src/data/mega-menu.ts +39 -23
- package/src/data/menu-bar.ts +254 -0
- package/src/data/menu-dom.ts +50 -15
- package/src/data/menu.ts +131 -47
- package/src/data/mockup.ts +30 -22
- package/src/data/modal-dialog.ts +90 -13
- package/src/data/navbar.ts +143 -61
- package/src/data/notice-list.ts +100 -48
- package/src/data/notify-renderer.ts +61 -7
- package/src/data/object-form.ts +1389 -130
- package/src/data/org-chart.ts +544 -0
- package/src/data/outcome-watch.ts +90 -21
- package/src/data/pager.ts +122 -42
- package/src/data/panel-head.ts +237 -75
- package/src/data/permission-matrix.ts +371 -119
- package/src/data/permission-tree.ts +135 -80
- package/src/data/pricing-table.ts +106 -42
- package/src/data/prompt-dialog.ts +49 -21
- package/src/data/reaction-bar.ts +63 -31
- package/src/data/record-card.ts +239 -70
- package/src/data/record-picker.ts +56 -27
- package/src/data/redirect.ts +39 -15
- package/src/data/request-console.ts +131 -41
- package/src/data/resident.ts +11 -1
- package/src/data/result-panel.ts +65 -27
- package/src/data/rich-text.ts +206 -35
- package/src/data/row-confirm.ts +47 -0
- package/src/data/row-editor.ts +376 -102
- package/src/data/rule-builder.ts +129 -80
- package/src/data/schedule-grid.ts +238 -0
- package/src/data/segment-bar.ts +221 -0
- package/src/data/shape-util.ts +86 -43
- package/src/data/stage-flow.ts +244 -0
- package/src/data/staged-rows.ts +207 -24
- package/src/data/stat-group.ts +438 -86
- package/src/data/static-lazy.ts +18 -0
- package/src/data/static-registry.ts +38 -2
- package/src/data/status-strip.ts +171 -0
- package/src/data/steps.ts +63 -34
- package/src/data/summary-strip.ts +136 -0
- package/src/data/summary-util.ts +116 -0
- package/src/data/survey.ts +128 -47
- package/src/data/system-switcher.ts +40 -20
- package/src/data/target-progress.ts +208 -0
- package/src/data/text-action-button.ts +28 -7
- package/src/data/text-diff.ts +99 -31
- package/src/data/tile-grid.ts +343 -0
- package/src/data/timeline.ts +205 -36
- package/src/data/tour-guide.ts +110 -47
- package/src/data/transfer.ts +195 -47
- package/src/data/tree-table.ts +194 -112
- package/src/data/tree.ts +191 -70
- package/src/data/trend-line.ts +68 -12
- package/src/data/virtual-rows.ts +242 -102
- package/src/data/waterfall.ts +171 -0
- package/src/data/watermark.ts +35 -6
- package/src/data/wrap.ts +26 -4
- package/src/frames/blank-frame.ts +6 -4
- package/src/frames/index.ts +1 -2
- package/src/frames/inherited-shell.ts +54 -13
- package/src/frames/page-bar.ts +205 -27
- package/src/frames/page-status.ts +3 -2
- package/src/frames/resident-components.ts +0 -2
- package/src/frames/shared.ts +64 -21
- package/src/frames/single-frame.ts +20 -4
- package/src/frames/split-frame/shell.ts +11 -7
- package/src/frames/split-frame/wiring.ts +14 -10
- package/src/frames/tabs-frame/shell.ts +3 -2
- package/src/frames/tabs-frame/wiring.ts +2 -1
- package/src/frames/top-main-frame.ts +55 -3
- package/src/frames/types.ts +2 -0
- package/src/frames/workspace-frame/extras.ts +5 -3
- 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 +22 -2
- package/src/frames/workspace-frame/state.ts +42 -14
- package/src/frames/workspace-frame/view.ts +697 -167
- package/src/generated/kit-grammar-runtime.ts +1016 -54
- package/src/generated/kit-page.ts +272 -0
- package/src/i18n/index.ts +2 -0
- package/src/i18n/kit-text.ts +96 -3
- package/src/object-renderer/action-group.ts +175 -23
- package/src/object-renderer/action-more.ts +48 -17
- package/src/object-renderer/arrange.ts +241 -29
- 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 +432 -107
- package/src/object-renderer/collection-table.ts +347 -45
- package/src/object-renderer/collection.ts +291 -62
- package/src/object-renderer/compile-data.ts +12 -2
- package/src/object-renderer/defaults.ts +6 -5
- package/src/object-renderer/emit-events.ts +45 -19
- package/src/object-renderer/emit-object.ts +35 -9
- package/src/object-renderer/emit-static.ts +734 -159
- package/src/object-renderer/filter-plan.ts +3 -3
- package/src/object-renderer/filter-toolbar.ts +105 -18
- package/src/object-renderer/form-detail.ts +87 -2
- package/src/object-renderer/key-field.ts +21 -0
- package/src/object-renderer/layout-facts.ts +18 -2
- package/src/object-renderer/layout-plan.ts +6 -3
- package/src/object-renderer/overlay-decide.ts +44 -2
- 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 +71 -26
- package/src/object-renderer/request-actions.ts +119 -21
- package/src/object-renderer/table-actions.ts +423 -104
- 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 +428 -128
- package/src/object-renderer/types.ts +91 -2
- 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/chrome-surface.ts +20 -0
- package/src/recipes/code-view.ts +15 -14
- package/src/recipes/color-role.ts +442 -0
- package/src/recipes/compact-group.ts +3 -2
- package/src/recipes/composition-projector.ts +321 -0
- package/src/recipes/container.ts +76 -19
- package/src/recipes/control.ts +64 -5
- package/src/recipes/desc-list.ts +101 -7
- package/src/recipes/divider.ts +30 -9
- package/src/recipes/emphasis.ts +90 -5
- package/src/recipes/field-text.ts +72 -0
- package/src/recipes/form-section.ts +177 -0
- package/src/recipes/frame-bleed.ts +3 -2
- package/src/recipes/index.ts +28 -4
- package/src/recipes/inherited-shell.ts +21 -15
- package/src/recipes/json-view.ts +6 -5
- package/src/recipes/look.ts +56 -0
- package/src/recipes/mark.ts +138 -0
- package/src/recipes/markdown.ts +16 -6
- package/src/recipes/overlay.ts +47 -19
- package/src/recipes/page-width.ts +31 -0
- package/src/recipes/pipeline-runtime.ts +366 -0
- package/src/recipes/placeholder.ts +37 -19
- 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 +5 -5
- package/src/recipes/state.ts +54 -3
- package/src/recipes/status.ts +14 -14
- package/src/recipes/strip.ts +47 -5
- package/src/recipes/surface-edge.ts +3 -1
- package/src/recipes/surface.ts +33 -4
- package/src/recipes/table-gap.ts +3 -2
- package/src/recipes/table-native-edit.ts +22 -9
- package/src/recipes/table-row.ts +45 -12
- package/src/recipes/tabs.ts +54 -22
- package/src/recipes/text-diff.ts +15 -8
- package/src/recipes/text-fit.ts +132 -0
- package/src/recipes/title-row.ts +68 -3
- 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/dom-attrs-registry.ts +1009 -0
- package/src/shared/dom-attrs.ts +743 -0
- package/src/shared/field-kind.ts +49 -0
- package/src/shared/field-value-format.ts +58 -12
- package/src/shared/glyphs.ts +127 -0
- package/src/shared/icons.ts +28 -1
- package/src/shared/identifier-field.ts +66 -0
- package/src/shared/list-pager.ts +23 -0
- package/src/shared/list-title.ts +29 -0
- 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/pipeline-mode.ts +64 -0
- package/src/shared/row-key.ts +15 -0
- package/src/shared/theme-runtime-shared.ts +165 -24
- 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 +527 -16
- package/src/theme/kit-theme.tpl +491 -16
- package/src/theme/look-carrier.ts +65 -0
- package/src/theme/nine-dim-structure.ts +522 -185
- package/src/theme/private-vars.ts +153 -0
- package/src/theme/surface-layers.ts +3 -2
- package/src/theme/theme-tokens.ts +1601 -93
- package/src/theme/theme-types.ts +38 -59
- package/src/theme/value-table.ts +2379 -0
- package/src/frames/list-summary.ts +0 -123
- package/src/recipes/nowrap.ts +0 -16
- package/src/theme/block-theme.ts +0 -202
package/src/data/context-menu.ts
CHANGED
|
@@ -14,23 +14,31 @@
|
|
|
14
14
|
// 菜单项点击抛槽位事件 `row_action_<序号>`,载荷与 KitTableActions 完全一致(带整行),页面 `_event` 给每个菜单项各绑一条管道,组件不直连数据写入。
|
|
15
15
|
// 条件显隐 `when`、权限 `permission` 沿用行操作;危险项(tone: danger)红字;`confirm` 尾段在 `_event` 管道里,沿用。
|
|
16
16
|
|
|
17
|
+
import { kitApplyLevelClass } from './level-class';
|
|
17
18
|
import type { SomaComponentDefinition } from 'soma-core';
|
|
18
19
|
import { classCandidates, createKitController, str } from '../base/shared';
|
|
19
|
-
import {
|
|
20
|
+
import { isKitActionBusy, onKitActionBusy } from '../base/action-busy';
|
|
21
|
+
import { permissionCheckerOf, registerLivePermissionGate } from '../base/permission-gate';
|
|
20
22
|
import { wireMenu, type MenuHandle, type MenuItemSpec } from '../base/menu-core';
|
|
21
23
|
import {
|
|
22
24
|
CONTEXT_POINT_PANEL, CONTEXT_SHOWN, KIT_CONTEXT_MENU_CLASS_CANDIDATES, wireContextTrigger, type Corner,
|
|
23
25
|
} from '../base/context-menu';
|
|
24
|
-
import {
|
|
26
|
+
import { menuOrderDangerLast } from '../object-renderer/action-group';
|
|
27
|
+
import { MORE_MENU_CLASSES, emitRowAction, itemsOf, removeKeyOf, rowBusyName, type KitTableActionItem } from '../object-renderer/table-actions';
|
|
25
28
|
import { disabledReasonOf, rowActionState } from '../object-renderer/view-binding';
|
|
26
29
|
import { KIT_ACTION_SLOT_BASE, actionSlotEmits } from '../base/action-slots';
|
|
30
|
+
import { kitActionPropsOf, kitMarkLevel } from './kit-contract';
|
|
31
|
+
import { createKitRowConfirm } from './row-confirm';
|
|
32
|
+
import {
|
|
33
|
+
KIT_ATTR_CTX, KIT_ATTR_CTXHOST, KIT_ATTR_EDITING, KIT_ATTR_INDEX, KIT_ATTR_ITEM, KIT_ATTR_KEY, KIT_ATTR_MAIN, KIT_ATTR_VSCROLL, kitAttrSel,
|
|
34
|
+
} from '../shared/dom-attrs';
|
|
27
35
|
|
|
28
36
|
const ROOT_CLASS = 'absolute size-0';
|
|
29
37
|
const MENU_HIDDEN = 'hidden';
|
|
30
38
|
/** 写死形状组件的宿主壳(emit-static 写在组件外,display: contents 不影响版面) */
|
|
31
39
|
const HOST_WRAP_CLASS = 'contents';
|
|
32
|
-
const HOST_ATTR =
|
|
33
|
-
const HOST_KEY_SELECTOR =
|
|
40
|
+
const HOST_ATTR = KIT_ATTR_CTXHOST;
|
|
41
|
+
const HOST_KEY_SELECTOR = `${kitAttrSel(KIT_ATTR_KEY)}, ${kitAttrSel(KIT_ATTR_ITEM)}`;
|
|
34
42
|
|
|
35
43
|
type CtxRowResolver = (key: string) => Record<string, unknown> | undefined;
|
|
36
44
|
const hostResolvers = new WeakMap<Element, CtxRowResolver>();
|
|
@@ -46,7 +54,7 @@ export function provideCtxRows(root: Element | null, resolve: CtxRowResolver): (
|
|
|
46
54
|
return () => { if (hostResolvers.get(host) === resolve) hostResolvers.delete(host); };
|
|
47
55
|
}
|
|
48
56
|
/** 点在这些元素里不拦截:保留系统菜单(输入控件、可编辑区、就地编辑中的格) */
|
|
49
|
-
const EDITABLE =
|
|
57
|
+
const EDITABLE = `input, textarea, select, [contenteditable]:not([contenteditable="false"]), ${kitAttrSel(KIT_ATTR_EDITING)}`;
|
|
50
58
|
|
|
51
59
|
export const KIT_CONTEXT_MENU_DATA_CLASS_CANDIDATES: readonly string[] = classCandidates(
|
|
52
60
|
ROOT_CLASS, MENU_HIDDEN, HOST_WRAP_CLASS, Object.values(MORE_MENU_CLASSES), KIT_CONTEXT_MENU_CLASS_CANDIDATES,
|
|
@@ -70,6 +78,9 @@ export function createKitContextMenu(): SomaComponentDefinition {
|
|
|
70
78
|
rows: { type: 'array', default: [], desc: 'mode: virtual 时的行数组(与 KitVirtualRows 同源,按 data-kit-index 取行)' },
|
|
71
79
|
mode: { type: 'string', default: 'row', desc: 'row(行实例,监听 [data-kit-ctx])、virtual(监听 [data-kit-vscroll],按下标取行)或 host(监听 [data-kit-ctxhost] 宿主壳,按行主键经组件登记的取行函数取行)' },
|
|
72
80
|
long_press: { type: 'boolean', default: true, desc: '触屏长按 500ms 打开' },
|
|
81
|
+
removeScope: { type: 'string', default: '', desc: '行在途键用(与 KitTableActions 同一套):协调组件的作用域 id;与 removeObject 都非空时,菜单动作的载荷带 kit_row_busy,与列表行的同一行同一动作同键互拦;空 = 不带' },
|
|
82
|
+
removeObject: { type: 'string', default: '', desc: '行在途键用:对象名(同 KitTableActions.removeObject);同时作为载荷 kit_object' },
|
|
83
|
+
removeKeyField: { type: 'string', default: '', desc: '行在途键用:行主键字段名(同 KitTableActions.removeKeyField)' },
|
|
73
84
|
},
|
|
74
85
|
emits: {
|
|
75
86
|
...actionSlotEmits(KIT_ACTION_SLOT_BASE.row, {
|
|
@@ -78,6 +89,7 @@ export function createKitContextMenu(): SomaComponentDefinition {
|
|
|
78
89
|
name: { type: 'string', desc: '动作显示名' },
|
|
79
90
|
builtin: { type: 'string', desc: '内置动作名' },
|
|
80
91
|
target: { type: 'string', desc: '目标浮层' },
|
|
92
|
+
kit_row_busy: { type: 'string', desc: '本行在途通道名(removeScope 与 removeObject 都非空时带;同列表行同一套)' },
|
|
81
93
|
row: { type: 'object', desc: '当前行' },
|
|
82
94
|
}, '点击某个菜单项;载荷自带整行,与行操作同形,序号 = 该动作在 menu 数组里的位置'),
|
|
83
95
|
},
|
|
@@ -85,15 +97,16 @@ export function createKitContextMenu(): SomaComponentDefinition {
|
|
|
85
97
|
services: ['permission'],
|
|
86
98
|
templateHtml: `<div data-soma-id="root" class="${ROOT_CLASS}"></div>`,
|
|
87
99
|
controllerFactory: createKitController((api) => {
|
|
88
|
-
|
|
100
|
+
// 页面线对危险动作下发的二次确认(props.kit.actions[动作].confirm):确认通过才抛 row_action,没有判定时同步触发
|
|
101
|
+
const rowConfirm = createKitRowConfirm(() => api.isCurrent());
|
|
89
102
|
return {
|
|
90
103
|
attach(root) {
|
|
91
104
|
const modeName = str(api.props().mode, 'row');
|
|
92
105
|
const virtual = modeName === 'virtual';
|
|
93
106
|
const hosted = modeName === 'host';
|
|
94
107
|
const area = virtual
|
|
95
|
-
? root.closest<HTMLElement>(
|
|
96
|
-
: hosted ? root.closest<HTMLElement>(`[${HOST_ATTR}]`) : root.closest<HTMLElement>(
|
|
108
|
+
? root.closest<HTMLElement>(kitAttrSel(KIT_ATTR_VSCROLL))
|
|
109
|
+
: hosted ? root.closest<HTMLElement>(`[${HOST_ATTR}]`) : root.closest<HTMLElement>(kitAttrSel(KIT_ATTR_CTX));
|
|
97
110
|
if (area === null) return;
|
|
98
111
|
let current: Hit | null = null;
|
|
99
112
|
let corner: Corner = 'tl';
|
|
@@ -106,29 +119,57 @@ export function createKitContextMenu(): SomaComponentDefinition {
|
|
|
106
119
|
if (hosted) {
|
|
107
120
|
const el = (target as HTMLElement | null)?.closest<HTMLElement>(HOST_KEY_SELECTOR) ?? null;
|
|
108
121
|
if (el === null || !area.contains(el)) return null;
|
|
109
|
-
const key = el.getAttribute(
|
|
122
|
+
const key = el.getAttribute(KIT_ATTR_KEY) ?? el.getAttribute(KIT_ATTR_ITEM);
|
|
110
123
|
const row = key === null ? undefined : hostResolvers.get(area)?.(key);
|
|
111
124
|
return row === undefined || key === null ? null : { row, el, key };
|
|
112
125
|
}
|
|
113
126
|
if (!virtual) return { row: isRec(api.props().row) ? api.props().row as Record<string, unknown> : {}, el: area };
|
|
114
|
-
const el = (target as HTMLElement | null)?.closest<HTMLElement>(
|
|
127
|
+
const el = (target as HTMLElement | null)?.closest<HTMLElement>(kitAttrSel(KIT_ATTR_INDEX)) ?? null;
|
|
115
128
|
if (el === null || !area.contains(el)) return null;
|
|
116
|
-
const index = Number(el.getAttribute(
|
|
129
|
+
const index = Number(el.getAttribute(KIT_ATTR_INDEX));
|
|
117
130
|
const list = Array.isArray(api.props().rows) ? (api.props().rows as unknown[]).filter(isRec) : [];
|
|
118
131
|
const row = Number.isInteger(index) ? list[index] : undefined;
|
|
119
132
|
return row === undefined ? null : { row, el };
|
|
120
133
|
};
|
|
121
134
|
|
|
135
|
+
/**
|
|
136
|
+
* 动作是否属危险类(页面线判定 tone=danger 只升不降;或动作项语气为 danger)。动作项的 tone 已由 itemsOf 经
|
|
137
|
+
* kitActionItemTone 定好(显式 tone 优先于 function,SCON-169),这里不再按 function 二次判定,免得显式 tone: neutral 被功能名翻成危险
|
|
138
|
+
*/
|
|
139
|
+
const isDangerAction = (a: KitTableActionItem): boolean =>
|
|
140
|
+
kitActionPropsOf(api.props(), a.id).tone === 'danger' || a.tone === 'danger';
|
|
141
|
+
/** 本行在途状态(与 KitTableActions / KitTreeTable / KitVirtualRows 共用同一行在途通道键) */
|
|
142
|
+
const rowBusy = (row: Record<string, unknown>): boolean => {
|
|
143
|
+
const own = api.props();
|
|
144
|
+
const scope = str(own.removeScope);
|
|
145
|
+
const object = str(own.removeObject);
|
|
146
|
+
return scope !== '' && object !== '' && isKitActionBusy(rowBusyName(scope, object, removeKeyOf(row, str(own.removeKeyField))));
|
|
147
|
+
};
|
|
122
148
|
/** 当前命中行下可见的动作(权限) */
|
|
123
|
-
const visibleActions = (): ReturnType<typeof itemsOf> =>
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
149
|
+
const visibleActions = (): ReturnType<typeof itemsOf> => {
|
|
150
|
+
const check = permissionCheckerOf(api as unknown as any);
|
|
151
|
+
return itemsOf(api.props().menu).filter((a) => !(a.permission !== undefined && check !== null && !check(a.permission)) && !rowActionState(api.props().actionState, a.id).hidden);
|
|
152
|
+
};
|
|
153
|
+
const specsFor = (hit: Hit | null): MenuItemSpec[] => {
|
|
154
|
+
const busy = hit !== null && rowBusy(hit.row);
|
|
155
|
+
return menuOrderDangerLast(visibleActions().map((a) => ({
|
|
156
|
+
key: a.id,
|
|
157
|
+
label: a.name,
|
|
158
|
+
icon: '',
|
|
159
|
+
disabled: busy || rowActionState(api.props().actionState, a.id).disabled,
|
|
160
|
+
danger: isDangerAction(a),
|
|
161
|
+
divider: false,
|
|
162
|
+
reason: disabledReasonOf(api.props().actionState, a),
|
|
163
|
+
})));
|
|
164
|
+
};
|
|
165
|
+
const specs = (): MenuItemSpec[] => specsFor(current);
|
|
127
166
|
|
|
128
167
|
const ensure = (): MenuHandle => {
|
|
129
168
|
if (handle !== null) return handle;
|
|
130
169
|
menuEl = root.ownerDocument.createElement('div');
|
|
131
170
|
menuEl.className = MENU_HIDDEN;
|
|
171
|
+
// 浮出的右键菜单面板:层级角色「浮起」(菜单项由 base/menu-core 的 wireMenu 画,项的自报在那里)
|
|
172
|
+
kitMarkLevel(menuEl, 'float'); kitApplyLevelClass(menuEl);
|
|
132
173
|
root.appendChild(menuEl);
|
|
133
174
|
// 关闭后焦点回到触发行:行本身需要可程序化聚焦
|
|
134
175
|
if (!virtual && !hosted && !area.hasAttribute('tabindex')) {
|
|
@@ -148,10 +189,33 @@ export function createKitContextMenu(): SomaComponentDefinition {
|
|
|
148
189
|
locked: () => false,
|
|
149
190
|
clickOpens: () => false,
|
|
150
191
|
onPick: (item) => {
|
|
151
|
-
const hit = visibleActions().find((a) => a.id === item.key && !rowActionState(api.props().actionState, a.id).disabled);
|
|
152
192
|
const picked = current;
|
|
153
|
-
if (
|
|
154
|
-
|
|
193
|
+
if (picked === null || rowBusy(picked.row)) return;
|
|
194
|
+
const own = api.props();
|
|
195
|
+
const hit = visibleActions().find((a) => a.id === item.key && !rowActionState(own.actionState, a.id).disabled);
|
|
196
|
+
if (hit !== undefined) {
|
|
197
|
+
const index = itemsOf(own.menu).findIndex((a) => a.id === hit.id);
|
|
198
|
+
const anchorEl = picked.el.isConnected ? picked.el : (area.isConnected ? area : api.host);
|
|
199
|
+
const rowKey = removeKeyOf(picked.row, str(own.removeKeyField));
|
|
200
|
+
const rowScope = rowKey !== '' ? rowKey : (picked.key ?? (picked.el.getAttribute(KIT_ATTR_INDEX) ?? ''));
|
|
201
|
+
rowConfirm.guard(
|
|
202
|
+
own,
|
|
203
|
+
hit.id,
|
|
204
|
+
anchorEl,
|
|
205
|
+
hit.name,
|
|
206
|
+
// 行载荷带上与列表行同一套行在途字段(removeScope / removeObject / removeKeyField),动作执行器据此取同一把 kit_row_busy
|
|
207
|
+
() => {
|
|
208
|
+
if (rowBusy(picked.row)) return;
|
|
209
|
+
emitRowAction({
|
|
210
|
+
emit: (n, p) => api.emit(n, p),
|
|
211
|
+
props: () => {
|
|
212
|
+
const latest = api.props();
|
|
213
|
+
return { row: picked.row, removeScope: latest.removeScope, removeObject: latest.removeObject, removeKeyField: latest.removeKeyField };
|
|
214
|
+
},
|
|
215
|
+
}, hit, index);
|
|
216
|
+
},
|
|
217
|
+
rowScope,
|
|
218
|
+
);
|
|
155
219
|
}
|
|
156
220
|
},
|
|
157
221
|
onToggle: (open) => {
|
|
@@ -161,14 +225,20 @@ export function createKitContextMenu(): SomaComponentDefinition {
|
|
|
161
225
|
else if (hosted) {
|
|
162
226
|
const key = current.key ?? '';
|
|
163
227
|
const el = current.el.isConnected ? current.el
|
|
164
|
-
: Array.from(area.querySelectorAll<HTMLElement>(HOST_KEY_SELECTOR)).find((n) => (n.getAttribute(
|
|
165
|
-
(el?.querySelector<HTMLElement>(
|
|
228
|
+
: Array.from(area.querySelectorAll<HTMLElement>(HOST_KEY_SELECTOR)).find((n) => (n.getAttribute(KIT_ATTR_KEY) ?? n.getAttribute(KIT_ATTR_ITEM)) === key) ?? null;
|
|
229
|
+
(el?.querySelector<HTMLElement>(kitAttrSel(KIT_ATTR_MAIN)) ?? el)?.focus();
|
|
166
230
|
}
|
|
167
231
|
},
|
|
168
232
|
});
|
|
169
233
|
return handle;
|
|
170
234
|
};
|
|
171
235
|
|
|
236
|
+
const offBusy = onKitActionBusy(() => {
|
|
237
|
+
if (handle?.isOpen()) handle.sync();
|
|
238
|
+
});
|
|
239
|
+
const offPerm = registerLivePermissionGate(() => {
|
|
240
|
+
if (handle?.isOpen()) handle.sync();
|
|
241
|
+
});
|
|
172
242
|
const offContext = wireContextTrigger({
|
|
173
243
|
area,
|
|
174
244
|
active: () => true,
|
|
@@ -177,8 +247,9 @@ export function createKitContextMenu(): SomaComponentDefinition {
|
|
|
177
247
|
if ((event.target as HTMLElement | null)?.closest(EDITABLE) != null) return false;
|
|
178
248
|
const hit = rowOf(event.target);
|
|
179
249
|
if (hit === null) return false;
|
|
250
|
+
if (specsFor(hit).length === 0) return false;
|
|
180
251
|
current = hit;
|
|
181
|
-
return
|
|
252
|
+
return true;
|
|
182
253
|
},
|
|
183
254
|
keyAnchor: () => current?.el ?? null,
|
|
184
255
|
openAt: (c, point) => {
|
|
@@ -191,6 +262,9 @@ export function createKitContextMenu(): SomaComponentDefinition {
|
|
|
191
262
|
},
|
|
192
263
|
});
|
|
193
264
|
return () => {
|
|
265
|
+
rowConfirm.dispose();
|
|
266
|
+
offBusy();
|
|
267
|
+
offPerm();
|
|
194
268
|
offContext();
|
|
195
269
|
handle?.destroy();
|
|
196
270
|
handle = null;
|
package/src/data/d9-limits.ts
CHANGED
|
@@ -22,6 +22,8 @@ export const MEDIA_ASPECTS: readonly string[] = L.mediaGrid.aspects;
|
|
|
22
22
|
export const MEDIA_MAX: number = N.mediaGrid.maxItems;
|
|
23
23
|
export const CHAT_MAX_LENGTH: number = N.chat.maxLength;
|
|
24
24
|
export const CHAT_MAX_MESSAGES: number = N.chat.maxMessages;
|
|
25
|
+
/** 消息流「跟到底」的距底阈值 = 列表可视高 × 此比例(design kit-limits#dataLimits.chat.followViewportRatio,0.5 = 半屏) */
|
|
26
|
+
export const CHAT_FOLLOW_RATIO: number = N.chat.followViewportRatio;
|
|
25
27
|
export const CHAT_STATUSES: readonly string[] = L.chat.statuses;
|
|
26
28
|
export const REACTION_PALETTE: readonly string[] = L.reactions.palette;
|
|
27
29
|
export const REACTION_MAX_KINDS: number = N.reactions.maxKinds;
|
package/src/data/d9-util.ts
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
// 全是无状态纯函数或 DOM 小工具:日期算术(民用日,UTC 零点,不受本地时区影响)、头像、安全图片地址、焦点序。
|
|
3
3
|
|
|
4
4
|
import { mk } from './shape-util';
|
|
5
|
+
import { kitDecorFillRecipe, kitDecorToneOf } from '../recipes/field-text';
|
|
6
|
+
import { KIT_LOOK_TONE_ATTR } from '../recipes/look';
|
|
5
7
|
|
|
6
8
|
// ── 日期(民用日算术):唯一实现在 base/month-grid,这里只再导出给 data 层各组件用 ────────────────
|
|
7
9
|
|
|
@@ -19,21 +21,26 @@ export function timeTail(text: unknown): string {
|
|
|
19
21
|
|
|
20
22
|
// ── 头像 / 图片 ──────────────────────────────────────────────
|
|
21
23
|
|
|
22
|
-
const SAFE_IMG = /^(https?:|\/|\.\/|\.\.\/|data:image\/)/i;
|
|
24
|
+
const SAFE_IMG = /^(?:https?:|\/|\.\/|\.\.\/|blob:|data:image\/(?:png|jpe?g|gif|webp|avif|bmp|ico)[;,])/i;
|
|
23
25
|
|
|
24
|
-
/** 图片地址只认 http(s) /
|
|
26
|
+
/** 图片地址只认 http(s) / 站内相对(拦 // 协议相对外链)/ blob: / 安全位图 data:image/*(防 svg+xml 内嵌脚本),其余一律拒绝 */
|
|
25
27
|
export function safeImgSrc(raw: unknown): string {
|
|
26
|
-
|
|
28
|
+
if (typeof raw !== 'string') return '';
|
|
29
|
+
const t = raw.trim();
|
|
30
|
+
if (t.startsWith('//')) return '';
|
|
31
|
+
return SAFE_IMG.test(t) ? t : '';
|
|
27
32
|
}
|
|
28
33
|
|
|
29
|
-
|
|
30
|
-
const
|
|
34
|
+
// 首字母徽标 = 装饰底(一色一义:主色不做装饰):按名字散列取分类色淡底,元素另打色调载体属性
|
|
35
|
+
const AVATAR_BADGE = 'flex shrink-0 items-center justify-center rounded-full text-xs font-semibold ' + kitDecorFillRecipe();
|
|
36
|
+
const AVATAR_IMG = 'shrink-0 rounded-full object-cover';
|
|
31
37
|
export const AVATAR_SIZE = { sm: 'size-6', md: 'size-8', lg: 'size-10' } as const;
|
|
32
38
|
export type AvatarSize = keyof typeof AVATAR_SIZE;
|
|
33
39
|
|
|
34
40
|
export const AVATAR_CLASS_TOKENS: readonly string[] = Object.freeze([
|
|
35
41
|
...AVATAR_BADGE.split(' '), ...AVATAR_IMG.split(' '), ...Object.values(AVATAR_SIZE),
|
|
36
42
|
]);
|
|
43
|
+
export { AVATAR_CLASS_TOKENS as D9_AVATAR_CLASS_TOKENS };
|
|
37
44
|
|
|
38
45
|
/** 头像:有安全地址用图片,否则首字母徽标 */
|
|
39
46
|
export function avatarNode(name: string, src: unknown, size: AvatarSize = 'md'): HTMLElement {
|
|
@@ -46,6 +53,7 @@ export function avatarNode(name: string, src: unknown, size: AvatarSize = 'md'):
|
|
|
46
53
|
}
|
|
47
54
|
const badge = mk('span', `${AVATAR_SIZE[size]} ${AVATAR_BADGE}`, [...name.trim()][0] ?? '?');
|
|
48
55
|
badge.setAttribute('aria-hidden', 'true');
|
|
56
|
+
badge.setAttribute(KIT_LOOK_TONE_ATTR, kitDecorToneOf(name));
|
|
49
57
|
return badge;
|
|
50
58
|
}
|
|
51
59
|
|
package/src/data/diff.ts
CHANGED
|
@@ -9,34 +9,47 @@
|
|
|
9
9
|
|
|
10
10
|
import type { SomaComponentDefinition } from 'soma-core';
|
|
11
11
|
import { KIT_STATIC_COMPONENT_LIMITS } from 'soma-foundation/kit-limits';
|
|
12
|
-
import { kitText } from '../i18n/kit-text';
|
|
12
|
+
import { kitKey, kitText } from '../i18n/kit-text';
|
|
13
13
|
import { setKitFace } from '../recipes';
|
|
14
14
|
import { createKitController, joinClass, str } from '../base/shared';
|
|
15
|
+
import { KIT_ICON_CLASS_CANDIDATES } from '../shared/icons';
|
|
16
|
+
import { kitGlyph } from '../shared/glyphs';
|
|
15
17
|
import { classTokens, mk, recOf, textOf, type Rec } from './shape-util';
|
|
16
|
-
import { clampInt,
|
|
18
|
+
import { clampInt, imageUrlOf, singleOf } from './display-util';
|
|
17
19
|
import { kitShellRecipe } from '../recipes/container';
|
|
20
|
+
import { kitMarkRecipe } from '../recipes/mark';
|
|
21
|
+
import { KIT_FOCUS_DELEGATED_INPUT } from '../recipes/state';
|
|
22
|
+
import { mergeClass } from '../shared/merge-class';
|
|
23
|
+
import { kitMarkDragging, kitMarkPart } from './kit-contract';
|
|
24
|
+
import { KIT_ATTR_BEFORE_BOX, KIT_ATTR_BEFORE_INNER, KIT_ATTR_HANDLE, KIT_ATTR_TIPS, kitAttrSel } from '../shared/dom-attrs';
|
|
18
25
|
|
|
19
26
|
export const KIT_DIFF_STEP: number = KIT_STATIC_COMPONENT_LIMITS.display.Diff.positionStep;
|
|
20
27
|
export const KIT_DIFF_STEPS = 20;
|
|
21
28
|
|
|
22
|
-
// 外缘 = 壳配方(容器边,KT-B2
|
|
29
|
+
// 外缘 = 壳配方(容器边,KT-B2);min-w-48 min-h-30 提供弹性容器下的固有最小宽与舒适纵高,防止 flex shrink-to-fit 塌陷为 3.5×2px 或在 touch-pill 撑超 300px 窄舞台
|
|
23
30
|
const ROOT_EDGE = kitShellRecipe({ tone: 'base', shadow: false });
|
|
24
|
-
const ROOT_CLASS = `relative aspect-16/9 w-full select-none overflow-hidden ${ROOT_EDGE} touch-none`;
|
|
25
|
-
const LAYER_CLASS = 'absolute inset-0';
|
|
31
|
+
const ROOT_CLASS = `relative aspect-16/9 w-full min-w-48 min-h-30 select-none overflow-hidden ${ROOT_EDGE} touch-none`;
|
|
32
|
+
const LAYER_CLASS = 'absolute inset-0 overflow-hidden';
|
|
26
33
|
const BEFORE_BOX_BASE = 'absolute inset-y-0 left-0 overflow-hidden';
|
|
27
|
-
const INNER_CLASS = 'relative h-full shrink-0';
|
|
34
|
+
const INNER_CLASS = 'relative h-full shrink-0 overflow-hidden';
|
|
28
35
|
const FILL_CLASS = 'block size-full object-cover';
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
-
const
|
|
36
|
-
const
|
|
36
|
+
// 对照面:前 = 节的淡底带(surface-band),后 = 语气标记的主色淡底(kitMarkRecipe tone,经出口取,不直写 primary-soft);
|
|
37
|
+
// 左右两侧文本栈分别收束于各自 2/5(40%)宽度并沉底排布,且向中轴一侧留内距(pe-4 / ps-4)避开 45–50% 中轴手柄圆钮不遮末字
|
|
38
|
+
const TEXT_PANE_BASE = 'flex size-full flex-col justify-end rounded-none pt-10 pb-2.5 px-2.5 whitespace-normal overflow-hidden';
|
|
39
|
+
const TEXT_STACK_CLASS = 'flex w-2/5 min-w-0 flex-col gap-0.5';
|
|
40
|
+
const TEXT_STACK_BEFORE_EXTRA = 'pe-4';
|
|
41
|
+
const TEXT_STACK_AFTER_EXTRA = 'ps-4';
|
|
42
|
+
const TEXT_BEFORE_CLASS = `${TEXT_PANE_BASE} items-start text-start bg-surface-band text-fg`;
|
|
43
|
+
const TEXT_AFTER_CLASS = mergeClass(kitMarkRecipe('tone', 'primary'), `${TEXT_PANE_BASE} items-end text-end`);
|
|
44
|
+
const TITLE_CLASS = 'w-full min-w-0 truncate text-sm font-semibold';
|
|
45
|
+
const TEXT_CLASS = 'w-full line-clamp-2 text-xs';
|
|
46
|
+
const LABEL_CLASS = 'absolute top-2 max-w-24 min-w-0 truncate rounded-item bg-surface px-2 py-0.5 text-xs font-medium text-fg shadow-sm';
|
|
47
|
+
const LABEL_LEFT = 'left-2';
|
|
48
|
+
const LABEL_RIGHT = 'right-2';
|
|
49
|
+
// 滑块手柄将焦点环委托给圆形旋钮,避免把整条 32×H 竖向分隔带框进矩形焦点环
|
|
50
|
+
const HANDLE_BASE = `group absolute inset-y-0 z-10 flex w-8 -translate-x-1/2 cursor-ew-resize items-center justify-center ${KIT_FOCUS_DELEGATED_INPUT}`;
|
|
37
51
|
const LINE_CLASS = 'absolute inset-y-0 w-0.5 bg-primary';
|
|
38
|
-
|
|
39
|
-
const KNOB_CLASS = 'relative flex size-8 items-center justify-center rounded-full bg-primary text-sm text-primary-fg shadow-md group-focus-visible:ring-2 group-focus-visible:ring-ring';
|
|
52
|
+
const KNOB_CLASS = 'relative flex size-8 items-center justify-center rounded-full bg-primary text-sm text-primary-fg shadow-md group-focus-visible:outline-2 group-focus-visible:outline-offset-2 group-focus-visible:outline-ring';
|
|
40
53
|
|
|
41
54
|
/** 露出的 before 盒宽:位置 n(0–20 档)-> 完整类串 */
|
|
42
55
|
const BOX_W: readonly string[] = Object.freeze([
|
|
@@ -54,9 +67,13 @@ const HANDLE_LEFT: readonly string[] = Object.freeze([
|
|
|
54
67
|
'left-11/20', 'left-12/20', 'left-13/20', 'left-14/20', 'left-15/20', 'left-16/20', 'left-17/20', 'left-18/20', 'left-19/20', 'left-full',
|
|
55
68
|
]);
|
|
56
69
|
|
|
70
|
+
const STEP_TRANSITION = 'motion-safe:transition-all';
|
|
71
|
+
const IMG_FAIL_CLASS = 'text-fg-subtle';
|
|
72
|
+
|
|
57
73
|
export const KIT_DIFF_CLASS_CANDIDATES: readonly string[] = classTokens(
|
|
58
|
-
ROOT_CLASS, LAYER_CLASS, BEFORE_BOX_BASE, INNER_CLASS, FILL_CLASS, TEXT_BEFORE_CLASS, TEXT_AFTER_CLASS, TITLE_CLASS, TEXT_CLASS,
|
|
74
|
+
ROOT_CLASS, LAYER_CLASS, BEFORE_BOX_BASE, INNER_CLASS, FILL_CLASS, TEXT_STACK_CLASS, TEXT_STACK_BEFORE_EXTRA, TEXT_STACK_AFTER_EXTRA, TEXT_BEFORE_CLASS, TEXT_AFTER_CLASS, TITLE_CLASS, TEXT_CLASS,
|
|
59
75
|
LABEL_CLASS, LABEL_LEFT, LABEL_RIGHT, HANDLE_BASE, LINE_CLASS, KNOB_CLASS, BOX_W, INNER_W, HANDLE_LEFT,
|
|
76
|
+
STEP_TRANSITION, IMG_FAIL_CLASS, KIT_ICON_CLASS_CANDIDATES,
|
|
60
77
|
);
|
|
61
78
|
|
|
62
79
|
/** 位置吸附:夹到 0–100,取最近的 5% 档,返回档号 0–20 */
|
|
@@ -76,7 +93,7 @@ export interface KitDiffSide {
|
|
|
76
93
|
|
|
77
94
|
export function diffSideOf(raw: unknown): KitDiffSide {
|
|
78
95
|
const r: Rec = recOf(raw);
|
|
79
|
-
return { image:
|
|
96
|
+
return { image: imageUrlOf(r.image), alt: textOf(r.alt), title: textOf(r.title), text: textOf(r.text), label: textOf(r.label) };
|
|
80
97
|
}
|
|
81
98
|
|
|
82
99
|
export function diffSidesOf(data: unknown, props: Rec): { before: KitDiffSide; after: KitDiffSide } {
|
|
@@ -84,17 +101,34 @@ export function diffSidesOf(data: unknown, props: Rec): { before: KitDiffSide; a
|
|
|
84
101
|
return { before: diffSideOf(src.before), after: diffSideOf(src.after) };
|
|
85
102
|
}
|
|
86
103
|
|
|
87
|
-
function fillSide(side: KitDiffSide, textClass: string): HTMLElement {
|
|
104
|
+
function fillSide(side: KitDiffSide, textClass: string, stackExtra: string, root: HTMLElement): HTMLElement {
|
|
105
|
+
const stackCls = `${TEXT_STACK_CLASS} ${stackExtra}`;
|
|
88
106
|
if (side.image !== '') {
|
|
89
107
|
const img = mk('img', FILL_CLASS);
|
|
90
108
|
img.setAttribute('src', side.image);
|
|
91
109
|
img.setAttribute('alt', side.alt);
|
|
92
110
|
img.setAttribute('draggable', 'false');
|
|
111
|
+
img.addEventListener('error', () => {
|
|
112
|
+
const fallback = mk('div', `${textClass} ${IMG_FAIL_CLASS}`);
|
|
113
|
+
const stack = mk('div', stackCls);
|
|
114
|
+
if (side.title !== '') stack.appendChild(mk('p', TITLE_CLASS, side.title));
|
|
115
|
+
const msg = side.text !== '' ? side.text : side.alt !== '' ? side.alt : kitText('soma.kit.img_failed', undefined, root);
|
|
116
|
+
stack.appendChild(mk('p', TEXT_CLASS, msg));
|
|
117
|
+
fallback.appendChild(stack);
|
|
118
|
+
img.replaceWith(fallback);
|
|
119
|
+
}, { once: true });
|
|
93
120
|
return img;
|
|
94
121
|
}
|
|
95
122
|
const box = mk('div', textClass);
|
|
96
|
-
|
|
97
|
-
|
|
123
|
+
box.setAttribute(KIT_ATTR_TIPS, '');
|
|
124
|
+
const stack = mk('div', stackCls);
|
|
125
|
+
if (side.title !== '') {
|
|
126
|
+
const p = mk('p', TITLE_CLASS, side.title);
|
|
127
|
+
p.setAttribute('title', side.title);
|
|
128
|
+
stack.appendChild(p);
|
|
129
|
+
}
|
|
130
|
+
if (side.text !== '') stack.appendChild(mk('p', TEXT_CLASS, side.text));
|
|
131
|
+
box.appendChild(stack);
|
|
98
132
|
return box;
|
|
99
133
|
}
|
|
100
134
|
|
|
@@ -106,15 +140,16 @@ const stateOf = (root: HTMLElement): State => {
|
|
|
106
140
|
return s;
|
|
107
141
|
};
|
|
108
142
|
|
|
109
|
-
/** 把档号写到现有节点(盒宽 / 内层宽 / 柄偏移 / aria
|
|
110
|
-
function applyStep(root: HTMLElement, step: number): void {
|
|
111
|
-
const box = root.querySelector<HTMLElement>(
|
|
112
|
-
const inner = root.querySelector<HTMLElement>(
|
|
113
|
-
const handle = root.querySelector<HTMLElement>(
|
|
114
|
-
|
|
115
|
-
if (
|
|
143
|
+
/** 把档号写到现有节点(盒宽 / 内层宽 / 柄偏移 / aria;非拖拽态带柔和微过渡,拖拽态实时跟手无延迟),不重建内容 */
|
|
144
|
+
function applyStep(root: HTMLElement, step: number, dragging = false): void {
|
|
145
|
+
const box = root.querySelector<HTMLElement>(kitAttrSel(KIT_ATTR_BEFORE_BOX));
|
|
146
|
+
const inner = root.querySelector<HTMLElement>(kitAttrSel(KIT_ATTR_BEFORE_INNER));
|
|
147
|
+
const handle = root.querySelector<HTMLElement>(kitAttrSel(KIT_ATTR_HANDLE));
|
|
148
|
+
const trans = dragging ? '' : ` ${STEP_TRANSITION}`;
|
|
149
|
+
if (box) box.className = `${BEFORE_BOX_BASE}${trans} ${BOX_W[step]}`;
|
|
150
|
+
if (inner) inner.className = `${INNER_CLASS}${trans} ${INNER_W[step]}`;
|
|
116
151
|
if (handle) {
|
|
117
|
-
handle.className = `${HANDLE_BASE} ${HANDLE_LEFT[step]}`;
|
|
152
|
+
handle.className = `${HANDLE_BASE}${trans} ${HANDLE_LEFT[step]}`;
|
|
118
153
|
handle.setAttribute('aria-valuenow', String(step * KIT_DIFF_STEP));
|
|
119
154
|
handle.setAttribute('aria-valuetext', `${step * KIT_DIFF_STEP}%`);
|
|
120
155
|
}
|
|
@@ -142,22 +177,28 @@ export function createDiff(): SomaComponentDefinition {
|
|
|
142
177
|
controllerFactory: createKitController(() => ({
|
|
143
178
|
attach(root, api) {
|
|
144
179
|
const s = stateOf(root);
|
|
145
|
-
const setStep = (next: number): void => {
|
|
180
|
+
const setStep = (next: number, dragging = false): void => {
|
|
146
181
|
const step = clampInt(next, 0, KIT_DIFF_STEPS, s.step);
|
|
147
|
-
if (step === s.step)
|
|
182
|
+
if (step === s.step) {
|
|
183
|
+
applyStep(root, step, dragging);
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
148
186
|
s.step = step;
|
|
149
|
-
applyStep(root, step);
|
|
187
|
+
applyStep(root, step, dragging);
|
|
150
188
|
api.emit('change', { position: step * KIT_DIFF_STEP });
|
|
151
189
|
};
|
|
152
190
|
const fromPointer = (event: PointerEvent): void => {
|
|
153
191
|
const rect = root.getBoundingClientRect();
|
|
154
192
|
if (rect.width <= 0) return;
|
|
155
|
-
setStep(Math.round(((event.clientX - rect.left) / rect.width) * KIT_DIFF_STEPS));
|
|
193
|
+
setStep(Math.round(((event.clientX - rect.left) / rect.width) * KIT_DIFF_STEPS), true);
|
|
156
194
|
};
|
|
157
195
|
const disabled = (): boolean => api.props().disabled === true || api.props().disabled === 'true';
|
|
158
196
|
const onDown = (event: PointerEvent): void => {
|
|
159
197
|
if (disabled() || event.button > 0) return;
|
|
160
198
|
s.dragging = true;
|
|
199
|
+
// 拖动分割柄期间自报「拖拽中」(柄每次重画都会重建,按标记现找)
|
|
200
|
+
const grip = root.querySelector(kitAttrSel(KIT_ATTR_HANDLE));
|
|
201
|
+
if (grip !== null) kitMarkDragging(grip, true);
|
|
161
202
|
try { root.setPointerCapture?.(event.pointerId); } catch { /* 不支持捕获的环境 */ }
|
|
162
203
|
fromPointer(event);
|
|
163
204
|
};
|
|
@@ -165,18 +206,23 @@ export function createDiff(): SomaComponentDefinition {
|
|
|
165
206
|
if (s.dragging) fromPointer(event);
|
|
166
207
|
};
|
|
167
208
|
const onUp = (event: PointerEvent): void => {
|
|
209
|
+
if (!s.dragging) return;
|
|
168
210
|
s.dragging = false;
|
|
211
|
+
const grip = root.querySelector(kitAttrSel(KIT_ATTR_HANDLE));
|
|
212
|
+
if (grip !== null) kitMarkDragging(grip, false);
|
|
213
|
+
applyStep(root, s.step, false);
|
|
169
214
|
try { root.releasePointerCapture?.(event.pointerId); } catch { /* 同上 */ }
|
|
170
215
|
};
|
|
171
216
|
const onKey = (event: KeyboardEvent): void => {
|
|
172
|
-
if (disabled() || !(event.target as HTMLElement | null)?.closest(
|
|
173
|
-
const unit =
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
else if (event.key === '
|
|
177
|
-
else if (event.key === '
|
|
178
|
-
else if (event.key === '
|
|
179
|
-
else if (event.key === '
|
|
217
|
+
if (disabled() || !(event.target as HTMLElement | null)?.closest(kitAttrSel(KIT_ATTR_HANDLE))) return;
|
|
218
|
+
const unit = 1;
|
|
219
|
+
const key = kitKey(event.key, root);
|
|
220
|
+
if (key === 'ArrowLeft' || event.key === 'ArrowDown') setStep(s.step - unit, false);
|
|
221
|
+
else if (key === 'ArrowRight' || event.key === 'ArrowUp') setStep(s.step + unit, false);
|
|
222
|
+
else if (event.key === 'PageDown') setStep(s.step - 2 * unit, false);
|
|
223
|
+
else if (event.key === 'PageUp') setStep(s.step + 2 * unit, false);
|
|
224
|
+
else if (event.key === 'Home') setStep(0, false);
|
|
225
|
+
else if (event.key === 'End') setStep(KIT_DIFF_STEPS, false);
|
|
180
226
|
else return;
|
|
181
227
|
event.preventDefault();
|
|
182
228
|
};
|
|
@@ -208,20 +254,30 @@ export function createDiff(): SomaComponentDefinition {
|
|
|
208
254
|
s.sig = sig;
|
|
209
255
|
root.textContent = '';
|
|
210
256
|
const under = mk('div', LAYER_CLASS);
|
|
211
|
-
under.appendChild(fillSide(after, TEXT_AFTER_CLASS));
|
|
212
|
-
if (after.label !== '')
|
|
257
|
+
under.appendChild(fillSide(after, TEXT_AFTER_CLASS, TEXT_STACK_AFTER_EXTRA, root));
|
|
258
|
+
if (after.label !== '') {
|
|
259
|
+
const afterLbl = mk('span', `${LABEL_CLASS} ${LABEL_RIGHT}`, after.label);
|
|
260
|
+
afterLbl.title = after.label;
|
|
261
|
+
under.appendChild(afterLbl);
|
|
262
|
+
}
|
|
213
263
|
const box = mk('div', BEFORE_BOX_BASE);
|
|
214
|
-
box.setAttribute(
|
|
264
|
+
box.setAttribute(KIT_ATTR_BEFORE_BOX, '');
|
|
215
265
|
const inner = mk('div', INNER_CLASS);
|
|
216
|
-
inner.setAttribute(
|
|
266
|
+
inner.setAttribute(KIT_ATTR_BEFORE_INNER, '');
|
|
217
267
|
const top = mk('div', 'absolute inset-0');
|
|
218
|
-
top.appendChild(fillSide(before, TEXT_BEFORE_CLASS));
|
|
268
|
+
top.appendChild(fillSide(before, TEXT_BEFORE_CLASS, TEXT_STACK_BEFORE_EXTRA, root));
|
|
219
269
|
inner.appendChild(top);
|
|
220
|
-
if (before.label !== '')
|
|
270
|
+
if (before.label !== '') {
|
|
271
|
+
const beforeLbl = mk('span', `${LABEL_CLASS} ${LABEL_LEFT}`, before.label);
|
|
272
|
+
beforeLbl.title = before.label;
|
|
273
|
+
inner.appendChild(beforeLbl);
|
|
274
|
+
}
|
|
221
275
|
box.appendChild(inner);
|
|
222
276
|
const handle = mk('div', HANDLE_BASE);
|
|
223
|
-
handle.setAttribute(
|
|
277
|
+
handle.setAttribute(KIT_ATTR_HANDLE, '');
|
|
224
278
|
handle.setAttribute('role', 'slider');
|
|
279
|
+
// 分割柄是滑杆:元素部件「控件」
|
|
280
|
+
kitMarkPart(handle, 'control');
|
|
225
281
|
handle.setAttribute('aria-label', str(p.label, kitText('soma.kit.nav_diff', undefined, root)));
|
|
226
282
|
handle.setAttribute('aria-orientation', 'horizontal');
|
|
227
283
|
handle.setAttribute('aria-valuemin', '0');
|
|
@@ -229,15 +285,16 @@ export function createDiff(): SomaComponentDefinition {
|
|
|
229
285
|
handle.tabIndex = p.disabled === true || p.disabled === 'true' ? -1 : 0;
|
|
230
286
|
if (handle.tabIndex === -1) handle.setAttribute('aria-disabled', 'true');
|
|
231
287
|
handle.appendChild(mk('span', LINE_CLASS));
|
|
232
|
-
const knob = mk('span', KNOB_CLASS
|
|
288
|
+
const knob = mk('span', KNOB_CLASS);
|
|
233
289
|
knob.setAttribute('aria-hidden', 'true');
|
|
290
|
+
knob.appendChild(kitGlyph('arrows-horizontal', 'sm'));
|
|
234
291
|
setKitFace(knob, 'raised'); // 实心把手有 shadow-md,质感经合成槽叠进去
|
|
235
292
|
handle.appendChild(knob);
|
|
236
293
|
root.appendChild(under);
|
|
237
294
|
root.appendChild(box);
|
|
238
295
|
root.appendChild(handle);
|
|
239
296
|
}
|
|
240
|
-
applyStep(root, s.step);
|
|
297
|
+
applyStep(root, s.step, s.dragging);
|
|
241
298
|
},
|
|
242
299
|
})),
|
|
243
300
|
};
|
package/src/data/display-util.ts
CHANGED
|
@@ -8,7 +8,9 @@
|
|
|
8
8
|
import { createKeyboardWiring } from 'soma-core/keyboard';
|
|
9
9
|
import { SOMA_SIZE_UNITS } from 'soma-foundation/theme';
|
|
10
10
|
import { safeHref } from '../base/link';
|
|
11
|
+
import { safeImgSrc } from './d9-util';
|
|
11
12
|
import { recOf, textOf, type Rec } from './shape-util';
|
|
13
|
+
import { KIT_ATTR_KEY } from '../shared/dom-attrs';
|
|
12
14
|
|
|
13
15
|
/** 单对象形状:props 当默认值,`data` 里的非空字段覆盖它;只取 keys 列出的键 */
|
|
14
16
|
export function singleOf(data: unknown, props: Rec, keys: readonly string[]): Rec {
|
|
@@ -37,11 +39,14 @@ export function listOf(data: unknown, itemsProp: unknown): Rec[] {
|
|
|
37
39
|
return pick(itemsProp) ?? [];
|
|
38
40
|
}
|
|
39
41
|
|
|
40
|
-
/**
|
|
42
|
+
/** 链接地址:只放行相对地址、锚点、http(s)、mailto、tel;其余视为空 */
|
|
41
43
|
export function urlOf(raw: unknown): string {
|
|
42
44
|
return safeHref(textOf(raw));
|
|
43
45
|
}
|
|
44
46
|
|
|
47
|
+
/** 图片地址:走 safeImgSrc(禁 // 协议相对外链与 data:image/svg+xml,放行安全位图与 blob:) */
|
|
48
|
+
export const imageUrlOf = (v: unknown): string => safeImgSrc(v);
|
|
49
|
+
|
|
45
50
|
/** 非空文本;空值回 fallback */
|
|
46
51
|
export function textOr(raw: unknown, fallback = ''): string {
|
|
47
52
|
const t = textOf(raw);
|
|
@@ -88,7 +93,7 @@ export function wireRovingRow(root: HTMLElement, opts: RovingRowOptions): () =>
|
|
|
88
93
|
let cursor: string | null = null;
|
|
89
94
|
const itemsOf = (): HTMLElement[] =>
|
|
90
95
|
Array.from(root.querySelectorAll<HTMLElement>(opts.itemSelector)).filter((el) => !el.hasAttribute('disabled'));
|
|
91
|
-
const keyOf = (el: Element): string => el.getAttribute(
|
|
96
|
+
const keyOf = (el: Element): string => el.getAttribute(KIT_ATTR_KEY) ?? '';
|
|
92
97
|
const wiring = createKeyboardWiring({
|
|
93
98
|
host: root,
|
|
94
99
|
contract: { layout: 'list', orientation: 'horizontal', wrap: true, typeahead: false, focus_model: 'roving', space: 'activate' },
|
|
@@ -127,9 +132,9 @@ export function wireRovingRow(root: HTMLElement, opts: RovingRowOptions): () =>
|
|
|
127
132
|
|
|
128
133
|
/** roving tabindex:current 项 0,其余 -1;current 不在条目里则首项 0 */
|
|
129
134
|
export function rovingTabIndex(items: readonly HTMLElement[], currentKey: string | null): void {
|
|
130
|
-
const has = items.some((el) => el.getAttribute(
|
|
135
|
+
const has = items.some((el) => el.getAttribute(KIT_ATTR_KEY) === currentKey);
|
|
131
136
|
items.forEach((el, i) => {
|
|
132
|
-
const on = has ? el.getAttribute(
|
|
137
|
+
const on = has ? el.getAttribute(KIT_ATTR_KEY) === currentKey : i === 0;
|
|
133
138
|
el.tabIndex = on ? 0 : -1;
|
|
134
139
|
});
|
|
135
140
|
}
|