soma-kit 0.1.15 → 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/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 +934 -92
- 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 +186 -57
- 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 +130 -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 +1015 -53
- 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 +424 -103
- 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/base/popup.ts
CHANGED
|
@@ -8,9 +8,26 @@
|
|
|
8
8
|
import { createKeyboardWiring, type CollectionItem } from 'soma-core/keyboard';
|
|
9
9
|
import { SOMA_SIZE_UNITS } from 'soma-foundation/theme';
|
|
10
10
|
import { kitDirAt } from '../i18n/kit-text';
|
|
11
|
+
import { mergeClass } from '../shared/merge-class';
|
|
12
|
+
import { KIT_ATTR_BOUNDARY, KIT_ATTR_QUIET } from '../shared/dom-attrs';
|
|
13
|
+
import { KIT_INVERSE_TOOLTIP_SURFACE_CLASS } from '../recipes/color-role';
|
|
11
14
|
import { kitSurfaceRecipe } from '../recipes/surface';
|
|
12
|
-
import {
|
|
15
|
+
import { kitSelectedRecipe } from '../recipes/state';
|
|
16
|
+
import { KIT_MENU_ITEM_HEIGHT_TOKEN, KIT_STRIP_MENU_ITEM_CLASS } from '../recipes/strip';
|
|
13
17
|
import { leaveAnchored, markAnchored, unmarkAnchored } from './anchored-layer';
|
|
18
|
+
import { kitReportSelf } from './kit-contract';
|
|
19
|
+
import { kitLevelClassFor } from '../recipes/pipeline-runtime';
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* 锚定浮起面板(下拉、联想、菜单、气泡、提示)的层级角色自报:「浮起」。全部锚定面板都经本文件的落位出口显示,
|
|
23
|
+
* 所以在落位出口统一自报,各组件不必各写一遍;不覆盖面板上已有的层级角色(组件自己报了更准的就以它为准)。
|
|
24
|
+
*/
|
|
25
|
+
function reportFloat(panel: HTMLElement): void {
|
|
26
|
+
// 反色提示气泡(role="tooltip")是成对的 bg-surface-inverse + text-fg-inverse,不自报 float,
|
|
27
|
+
// 避免 next 模式取值表覆写浮起面底色/边框/阴影导致字底撞色
|
|
28
|
+
if (panel.getAttribute('role') === 'tooltip') return;
|
|
29
|
+
kitReportSelf(panel, { level: 'float' });
|
|
30
|
+
}
|
|
14
31
|
import type { KitLeaveHandle } from './overlay-runtime';
|
|
15
32
|
import {
|
|
16
33
|
createPanelPortalWith, KIT_PANEL_PORTAL_CLASS_CANDIDATES, showAtPoint,
|
|
@@ -23,13 +40,15 @@ import { KIT_GRAMMAR_RUNTIME as grammarJson } from '../generated/kit-grammar-run
|
|
|
23
40
|
type WiringOptions = Parameters<typeof createKeyboardWiring>[0];
|
|
24
41
|
|
|
25
42
|
// 下拉面板高度与浮层阴影档的真源:阴影 / 描边类读 spec/kit-grammar.json#dropdown;行高 = 条带阶梯的菜单项行高 sizeSpec.strip.menuItemPx(AR42),
|
|
26
|
-
//
|
|
43
|
+
// 内边距与行数档读 design 的 kit-limits.json#dropdown(最大高 = 内边距 + (整数行 + 半行) × 项高;行数从大到小)。
|
|
44
|
+
// 项高随密度(令牌 --soma-menu-item-height = R2(8 · u),主题公式 F1),所以类按行数写成 max-h-menu-rows-<行数>,规则由 compile/styles 注入、在 CSS 里按项高令牌算;
|
|
45
|
+
// px 是标准密度下的标称值(真源 clamps),运行期挑档时按面板上读到的项高重算(见 clampDropdownClass)
|
|
27
46
|
type DropdownRules = { panelShadowClass: string; panelBorderClass: string };
|
|
28
47
|
const DD = (grammarJson as unknown as { dropdown: DropdownRules }).dropdown;
|
|
29
48
|
|
|
30
49
|
/** 空间不足时面板内部滚动的 max-h 闭集档位,从大到小;每档都是「整数行 + 半行」(真源 dropdown.clamps),空间不够也不腰斩一行 */
|
|
31
|
-
export const DROPDOWN_CLAMPS: readonly { cls: string; px: number }[] = Object.freeze(
|
|
32
|
-
KIT_DROPDOWN_LIMITS.clamps.map((c) => ({ cls: `max-h-
|
|
50
|
+
export const DROPDOWN_CLAMPS: readonly { cls: string; px: number; rows: number }[] = Object.freeze(
|
|
51
|
+
KIT_DROPDOWN_LIMITS.clamps.map((c) => ({ cls: `max-h-menu-rows-${c.rows}`, px: c.px, rows: c.rows })),
|
|
33
52
|
);
|
|
34
53
|
/** 下拉面板的默认最大高(最大一档:visibleRows 行 + 半行) */
|
|
35
54
|
export const KIT_DROPDOWN_PANEL_MAX_CLASS: string = DROPDOWN_CLAMPS[0]!.cls;
|
|
@@ -96,8 +115,9 @@ export function createListNav(o: ListNavOptions): ListNav {
|
|
|
96
115
|
};
|
|
97
116
|
}
|
|
98
117
|
|
|
99
|
-
/**
|
|
118
|
+
/** 点组件之外的地方时收起;监听归属 scope.ownerDocument(兼容 iframe 工作区),返回摘除函数 */
|
|
100
119
|
export function onOutsidePress(scope: HTMLElement, isOpen: () => boolean, close: () => void, alsoInside?: (node: Node) => boolean): () => void {
|
|
120
|
+
const doc = scope.ownerDocument ?? document;
|
|
101
121
|
const handler = (event: Event): void => {
|
|
102
122
|
if (!isOpen()) return;
|
|
103
123
|
const target = event.target as Node | null;
|
|
@@ -105,8 +125,8 @@ export function onOutsidePress(scope: HTMLElement, isOpen: () => boolean, close:
|
|
|
105
125
|
if (target && (scope.contains(target) || alsoInside?.(target) === true || inDropdownPortalOf(scope, target))) return;
|
|
106
126
|
close();
|
|
107
127
|
};
|
|
108
|
-
|
|
109
|
-
return () =>
|
|
128
|
+
doc.addEventListener('pointerdown', handler, true);
|
|
129
|
+
return () => doc.removeEventListener('pointerdown', handler, true);
|
|
110
130
|
}
|
|
111
131
|
|
|
112
132
|
export function cssEscape(value: string): string {
|
|
@@ -124,10 +144,10 @@ export function scrollIntoViewIfAny(el: Element | null): void {
|
|
|
124
144
|
// 记最近一次交互是不是指针(文档级捕获监听只装一次);是指针则落点标 data-kit-quiet,
|
|
125
145
|
// 类串里的 data-kit-quiet:focus-visible:ring-0 把环压掉;键盘一动由面板的 keydown 摘掉标记。
|
|
126
146
|
let lastInputIsPointer = false;
|
|
127
|
-
|
|
147
|
+
const trackedModalityDocs = new WeakSet<Document>();
|
|
128
148
|
export function trackInputModality(doc: Document): void {
|
|
129
|
-
if (
|
|
130
|
-
|
|
149
|
+
if (trackedModalityDocs.has(doc)) return;
|
|
150
|
+
trackedModalityDocs.add(doc);
|
|
131
151
|
doc.addEventListener('pointerdown', () => { lastInputIsPointer = true; }, true);
|
|
132
152
|
doc.addEventListener('mousedown', () => { lastInputIsPointer = true; }, true);
|
|
133
153
|
doc.addEventListener('keydown', () => { lastInputIsPointer = false; }, true);
|
|
@@ -136,8 +156,8 @@ export function trackInputModality(doc: Document): void {
|
|
|
136
156
|
/** 程序化落焦:最近交互是鼠标则压掉焦点环;键盘操作照常显示。落焦不滚动页面 */
|
|
137
157
|
export function focusCellQuiet(node: HTMLElement | null | undefined): void {
|
|
138
158
|
if (!node) return;
|
|
139
|
-
if (lastInputIsPointer) node.setAttribute(
|
|
140
|
-
else node.removeAttribute(
|
|
159
|
+
if (lastInputIsPointer) node.setAttribute(KIT_ATTR_QUIET, '');
|
|
160
|
+
else node.removeAttribute(KIT_ATTR_QUIET);
|
|
141
161
|
node.focus({ preventScroll: true });
|
|
142
162
|
}
|
|
143
163
|
|
|
@@ -147,18 +167,21 @@ const MENU_MAX_WIDTH_CLASS = `max-w-[${KIT_OVERLAY_LIMITS.menuMaxPx}px]`;
|
|
|
147
167
|
/** 默认的整串面板类:显隐只换整串,`hidden` 不与布局类并存 */
|
|
148
168
|
export const PANEL_HIDDEN_CLASS = 'hidden';
|
|
149
169
|
export const PANEL_SHOWN_CLASS =
|
|
150
|
-
`absolute start-0 top-full z-10 mt-1 ${KIT_DROPDOWN_PANEL_MAX_CLASS} w-max min-w-full ${MENU_MAX_WIDTH_CLASS} overflow-auto ${SURFACE_RAISED}
|
|
170
|
+
`absolute start-0 top-full z-10 mt-1 ${KIT_DROPDOWN_PANEL_MAX_CLASS} w-max min-w-full ${MENU_MAX_WIDTH_CLASS} overflow-auto ${SURFACE_RAISED} p-1`;
|
|
151
171
|
|
|
152
172
|
// 选项行高固定(条带阶梯的菜单项行高 strip.menuItemPx),面板最大高才能算成「整数行 + 半行」
|
|
153
173
|
const ROW = KIT_STRIP_MENU_ITEM_CLASS;
|
|
154
174
|
export const OPTION_CLASS = {
|
|
155
|
-
idle: `flex ${ROW} cursor-pointer items-center whitespace-nowrap gap-2 px-3 text-sm text-fg transition-colors hover:bg-state-layer-hover active:bg-state-layer-press`,
|
|
175
|
+
idle: `flex ${ROW} cursor-pointer items-center whitespace-nowrap rounded-item gap-2 px-3 text-sm text-fg transition-colors hover:bg-state-layer-hover active:bg-state-layer-press`,
|
|
156
176
|
// 键盘当前项与鼠标悬停同一层;选中项 = 主色淡底,选中项上的悬停 / 当前 = tonal 层(第三级,KT-K0-2 / KT-K-select-3)
|
|
157
|
-
active: `flex ${ROW} cursor-pointer items-center whitespace-nowrap gap-2 bg-state-layer-hover px-3 text-sm text-fg transition-colors`,
|
|
158
|
-
selected:
|
|
159
|
-
|
|
177
|
+
active: `flex ${ROW} cursor-pointer items-center whitespace-nowrap rounded-item gap-2 bg-state-layer-hover px-3 text-sm text-fg transition-colors`,
|
|
178
|
+
selected: mergeClass(
|
|
179
|
+
mergeClass(`flex ${ROW} cursor-pointer items-center whitespace-nowrap rounded-item gap-2`, kitSelectedRecipe()),
|
|
180
|
+
'px-3 text-sm transition-colors hover:bg-state-layer-tonal-hover active:bg-state-layer-tonal-press',
|
|
181
|
+
),
|
|
182
|
+
selectedActive: `flex ${ROW} cursor-pointer items-center whitespace-nowrap rounded-item gap-2 bg-state-layer-tonal-hover px-3 text-sm font-medium text-primary-on-soft transition-colors`,
|
|
160
183
|
// 置灰项 = 禁用字色令牌(KT-K-select-5 / KT-K0-4),不降透明度
|
|
161
|
-
disabled: `flex ${ROW} cursor-not-allowed items-center whitespace-nowrap gap-2 px-3 text-sm text-fg-disabled`,
|
|
184
|
+
disabled: `flex ${ROW} cursor-not-allowed items-center whitespace-nowrap rounded-item gap-2 px-3 text-sm text-fg-disabled`,
|
|
162
185
|
} as const;
|
|
163
186
|
|
|
164
187
|
export const EMPTY_ROW_CLASS = `flex ${ROW} items-center whitespace-nowrap px-3 text-sm text-fg-subtle`;
|
|
@@ -171,12 +194,19 @@ export function optionClass(selected: boolean, active: boolean, disabled: boolea
|
|
|
171
194
|
|
|
172
195
|
/** 本文件自带的类(供各组件并入候选类清单) */
|
|
173
196
|
export const KIT_POPUP_CLASS_CANDIDATES: readonly string[] = Object.freeze([
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
197
|
+
...new Set([
|
|
198
|
+
'hidden', 'absolute', 'start-0', 'top-full', 'z-10', 'mt-1', KIT_DROPDOWN_PANEL_MAX_CLASS, KIT_STRIP_MENU_ITEM_CLASS, 'w-full', 'w-max', 'min-w-full', MENU_MAX_WIDTH_CLASS, 'overflow-auto',
|
|
199
|
+
'rounded-float', 'rounded-item', 'border', 'border-border', 'border-border-subtle', 'bg-surface-raised', 'p-1', 'py-1', DD.panelShadowClass, 'shadow-sm',
|
|
200
|
+
...SURFACE_RAISED.split(/\s+/),
|
|
201
|
+
...PANEL_SHOWN_CLASS.split(/\s+/),
|
|
202
|
+
...Object.values(OPTION_CLASS).flatMap((s) => s.split(/\s+/)),
|
|
203
|
+
...EMPTY_ROW_CLASS.split(/\s+/),
|
|
204
|
+
'px-3', 'py-2',
|
|
205
|
+
// Popover / Popconfirm / 行内气泡确认在未静态声明 Popover 的页面命令式挂载时也需保留默认宽高约束(PW2-Biz P2-6)
|
|
206
|
+
'min-w-52', 'min-w-60', 'w-64', 'w-80', 'max-w-80',
|
|
207
|
+
...kitSelectedRecipe().split(/\s+/),
|
|
208
|
+
...KIT_INVERSE_TOOLTIP_SURFACE_CLASS.split(/\s+/),
|
|
209
|
+
].filter(Boolean)),
|
|
180
210
|
]);
|
|
181
211
|
|
|
182
212
|
/**
|
|
@@ -184,8 +214,10 @@ export const KIT_POPUP_CLASS_CANDIDATES: readonly string[] = Object.freeze([
|
|
|
184
214
|
* 通用 `tooltip` prop(shared.ts 的 withTooltip)取用;Popover / Popconfirm 的面板另用 PANEL_*。
|
|
185
215
|
*/
|
|
186
216
|
export const POPUP_TIP_HIDDEN_CLASS = PANEL_HIDDEN_CLASS;
|
|
187
|
-
export const POPUP_TIP_BASE =
|
|
188
|
-
'absolute z-10 w-max max-w-
|
|
217
|
+
export const POPUP_TIP_BASE = mergeClass(
|
|
218
|
+
'absolute z-10 w-max max-w-60 rounded-float px-2 py-1 text-sm font-normal pointer-events-none',
|
|
219
|
+
KIT_INVERSE_TOOLTIP_SURFACE_CLASS,
|
|
220
|
+
);
|
|
189
221
|
|
|
190
222
|
// ── 贴边自动翻转 ──────────────────────────────────────────────
|
|
191
223
|
//
|
|
@@ -283,12 +315,40 @@ export function showPopupFitted(
|
|
|
283
315
|
classFor: (place: PopPlace) => string,
|
|
284
316
|
gapPx = ANCHORED_GAP_PX,
|
|
285
317
|
): PopPlace {
|
|
318
|
+
// 先自报、后落类:贴边翻转里的类由调用方的 classFor 经 kitLevelClassFor 按面板上的层级角色出(气泡提示是反色面,取值表给不了,调用方不剥)
|
|
319
|
+
reportFloat(panel);
|
|
286
320
|
const place = fitPopupPlace(panel, anchor, pref, classFor, gapPx);
|
|
287
321
|
// 锚定浮层统一标记(anchored-layer.ts):落位后的实际方向,重定位 / 翻转时随之更新
|
|
288
322
|
markAnchored(panel, place);
|
|
289
323
|
return place;
|
|
290
324
|
}
|
|
291
325
|
|
|
326
|
+
/** 定位边界标记(KT-D9-5):窗格、窗口正文、页面内容区由各自的配方打;浮层不跨出锚点所在的这一块 */
|
|
327
|
+
export { KIT_ATTR_BOUNDARY as KIT_BOUNDARY_ATTR } from '../shared/dom-attrs';
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* 浮层落位的边界(封闭清单 ②,只读矩形):锚点最近的 `[data-kit-boundary]` 祖先与视口的交集(横向;纵向取视口);没有标记取视口。
|
|
331
|
+
* 返回边界矩形与「把锚点矩形换算到边界坐标系」后的锚点——resolvePopPlace / resolveDropdown 的纯函数只认「原点在 0 的视口」,
|
|
332
|
+
* 换算后同一份翻转 / 对齐判定就以窗格为界,不另写第二套。视口宽高为 0(无布局环境)返回 null。
|
|
333
|
+
*/
|
|
334
|
+
export function placementFrame(anchor: HTMLElement): { anchor: { left: number; right: number; top: number; bottom: number }; viewport: { width: number; height: number } } | null {
|
|
335
|
+
const doc = anchor.ownerDocument ?? document;
|
|
336
|
+
const win = doc.defaultView;
|
|
337
|
+
const vw = doc.documentElement.clientWidth || win?.innerWidth || (typeof window !== 'undefined' ? window.innerWidth : 0);
|
|
338
|
+
const vh = doc.documentElement.clientHeight || win?.innerHeight || (typeof window !== 'undefined' ? window.innerHeight : 0);
|
|
339
|
+
if (vw === 0 || vh === 0) return null;
|
|
340
|
+
let left = 0; let top = 0; let right = vw; let bottom = vh;
|
|
341
|
+
const box = anchor.closest(`[${KIT_ATTR_BOUNDARY}]`);
|
|
342
|
+
if (box !== null) {
|
|
343
|
+
const r = box.getBoundingClientRect();
|
|
344
|
+
// 只收行内方向(左右):「不盖住相邻窗格」是横向的事;纵向仍以视口为界(窗口正文 / 窗格底部离触发器很近时,下拉照常越过它,不被压成一两行)
|
|
345
|
+
if (r.width > 0 && r.height > 0) { left = Math.max(left, r.left); right = Math.min(right, r.right); }
|
|
346
|
+
}
|
|
347
|
+
if (right - left <= 0 || bottom - top <= 0) { left = 0; top = 0; right = vw; bottom = vh; }
|
|
348
|
+
const a = anchor.getBoundingClientRect();
|
|
349
|
+
return { anchor: { left: a.left - left, right: a.right - left, top: a.top - top, bottom: a.bottom - top }, viewport: { width: right - left, height: bottom - top } };
|
|
350
|
+
}
|
|
351
|
+
|
|
292
352
|
function fitPopupPlace(
|
|
293
353
|
panel: HTMLElement,
|
|
294
354
|
anchor: HTMLElement,
|
|
@@ -298,12 +358,10 @@ function fitPopupPlace(
|
|
|
298
358
|
): PopPlace {
|
|
299
359
|
panel.className = classFor(pref);
|
|
300
360
|
if (typeof panel.getBoundingClientRect !== 'function') return pref;
|
|
301
|
-
const
|
|
361
|
+
const frame = placementFrame(anchor);
|
|
362
|
+
if (frame === null) return pref;
|
|
302
363
|
const b = panel.getBoundingClientRect();
|
|
303
|
-
const
|
|
304
|
-
const vh = document.documentElement.clientHeight || (typeof window !== 'undefined' ? window.innerHeight : 0);
|
|
305
|
-
if (vw === 0 || vh === 0) return pref;
|
|
306
|
-
const place = resolvePopPlace(a, { width: b.width, height: b.height }, { width: vw, height: vh }, pref, gapPx, kitDirAt(anchor) === 'rtl');
|
|
364
|
+
const place = resolvePopPlace(frame.anchor, { width: b.width, height: b.height }, frame.viewport, pref, gapPx, kitDirAt(anchor) === 'rtl');
|
|
307
365
|
if (place.side !== pref.side || place.align !== pref.align) panel.className = classFor(place);
|
|
308
366
|
return place;
|
|
309
367
|
}
|
|
@@ -322,7 +380,7 @@ export const POPUP_TIP_SHOWN_CLASS = popupTipClass(POPUP_TIP_PREF);
|
|
|
322
380
|
|
|
323
381
|
/** 下拉面板外观类(不含位置类):与 PANEL_SHOWN_CLASS 同一份外观 */
|
|
324
382
|
export const PANEL_BASE_CLASS =
|
|
325
|
-
`absolute z-10 ${KIT_DROPDOWN_PANEL_MAX_CLASS} w-max min-w-full ${MENU_MAX_WIDTH_CLASS} overflow-auto ${SURFACE_RAISED}
|
|
383
|
+
`absolute z-10 ${KIT_DROPDOWN_PANEL_MAX_CLASS} w-max min-w-full ${MENU_MAX_WIDTH_CLASS} overflow-auto ${SURFACE_RAISED} p-1`;
|
|
326
384
|
|
|
327
385
|
/** 下拉翻转用到的全部类(位置类、间距类、max-h 档位、滚动) */
|
|
328
386
|
export const KIT_DROPDOWN_CLASS_CANDIDATES: readonly string[] = Object.freeze([
|
|
@@ -365,9 +423,11 @@ export function resolveDropdown(
|
|
|
365
423
|
}
|
|
366
424
|
|
|
367
425
|
/** 去掉 max-h-* 后按档位加上放得下的一档(内部滚动);没有 overflow 类时补 overflow-y-auto */
|
|
368
|
-
export function clampDropdownClass(cls: string, clampPx: number): string {
|
|
426
|
+
export function clampDropdownClass(cls: string, clampPx: number, itemPx: number | null = null): string {
|
|
369
427
|
const tokens = cls.split(/\s+/).filter((t) => t !== '' && !t.startsWith('max-h-'));
|
|
370
|
-
|
|
428
|
+
// 每档的实际最大高:给了当前项高就按「内边距 + (行数 + 半行) × 项高」现算(随密度),没给取标准密度的标称值
|
|
429
|
+
const pxOf = (c: { px: number; rows: number }): number => (itemPx === null ? c.px : KIT_DROPDOWN_LIMITS.panelPadYPx + (c.rows + KIT_DROPDOWN_LIMITS.partialRow) * itemPx);
|
|
430
|
+
const step = DROPDOWN_CLAMPS.find((c) => pxOf(c) <= clampPx) ?? DROPDOWN_CLAMPS[DROPDOWN_CLAMPS.length - 1]!;
|
|
371
431
|
tokens.push(step.cls);
|
|
372
432
|
if (!tokens.some((t) => t.startsWith('overflow-'))) tokens.push('overflow-y-auto');
|
|
373
433
|
return tokens.join(' ');
|
|
@@ -383,6 +443,8 @@ export function showDropdownFitted(
|
|
|
383
443
|
base: string,
|
|
384
444
|
prefAlign: PopAlign = 'start',
|
|
385
445
|
): PopPlace {
|
|
446
|
+
// 先自报、后落类:下拉面板的类经 kitLevelClassFor 按面板上实际的层级角色出(新模式剥掉取值表负责的外观类)
|
|
447
|
+
reportFloat(panel);
|
|
386
448
|
const place = fitDropdownPlace(panel, anchor, base, prefAlign);
|
|
387
449
|
markAnchored(panel, place);
|
|
388
450
|
return place;
|
|
@@ -394,21 +456,26 @@ function fitDropdownPlace(
|
|
|
394
456
|
base: string,
|
|
395
457
|
prefAlign: PopAlign,
|
|
396
458
|
): PopPlace {
|
|
397
|
-
const classFor = (place: PopPlace): string => `${base} ${popPlaceClass(place)}
|
|
459
|
+
const classFor = (place: PopPlace): string => kitLevelClassFor(panel, `${base} ${popPlaceClass(place)}`);
|
|
398
460
|
const pref: PopPlace = { side: 'bottom', align: prefAlign };
|
|
399
461
|
panel.className = classFor(pref);
|
|
400
462
|
if (typeof panel.getBoundingClientRect !== 'function') return pref;
|
|
401
|
-
const
|
|
402
|
-
|
|
403
|
-
if (vw === 0 || vh === 0) return pref;
|
|
404
|
-
const a = anchor.getBoundingClientRect();
|
|
463
|
+
const frame = placementFrame(anchor);
|
|
464
|
+
if (frame === null) return pref;
|
|
405
465
|
const b = panel.getBoundingClientRect();
|
|
406
|
-
const { place, clampPx } = resolveDropdown(
|
|
407
|
-
const next = clampPx === null ? classFor(place) : `${clampDropdownClass(base, clampPx)} ${popPlaceClass(place)}
|
|
466
|
+
const { place, clampPx } = resolveDropdown(frame.anchor, { width: b.width, height: b.height }, frame.viewport, prefAlign, ANCHORED_GAP_PX, kitDirAt(anchor) === 'rtl');
|
|
467
|
+
const next = clampPx === null ? classFor(place) : kitLevelClassFor(panel, `${clampDropdownClass(base, clampPx, menuItemPxAt(panel))} ${popPlaceClass(place)}`);
|
|
408
468
|
if (panel.className !== next) panel.className = next;
|
|
409
469
|
return place;
|
|
410
470
|
}
|
|
411
471
|
|
|
472
|
+
/** 面板所在处的菜单项高(px,读令牌 --soma-menu-item-height);读不到(无 DOM、令牌表没有它)回 null,挑档退回标称值 */
|
|
473
|
+
function menuItemPxAt(panel: HTMLElement): number | null {
|
|
474
|
+
if (typeof getComputedStyle !== 'function') return null;
|
|
475
|
+
const px = Number.parseFloat(getComputedStyle(panel).getPropertyValue(KIT_MENU_ITEM_HEIGHT_TOKEN));
|
|
476
|
+
return Number.isFinite(px) && px > 0 ? px : null;
|
|
477
|
+
}
|
|
478
|
+
|
|
412
479
|
// ── 浮层端口挂载(下拉 / 菜单默认走这里,只此一份实现)──
|
|
413
480
|
//
|
|
414
481
|
// 下拉面板默认挂到 core 的浮层挂载点(body 下专用根),不再受触发器祖先的 overflow / transform 裁切。
|
|
@@ -425,6 +492,7 @@ export function createPanelPortal(owner: Element | null): PanelPortal {
|
|
|
425
492
|
* 几何只在 portal-core 的 placeAtPoint 写一次。端口不可用返回 null(调用方走就地绝对定位,不写 CSSOM)。
|
|
426
493
|
*/
|
|
427
494
|
export function showMenuAtPoint(panel: HTMLElement, point: PointXY, opts: Omit<PointPanelOptions, 'resolve' | 'rtl'> & { anchor: Element }): PointPanel | null {
|
|
495
|
+
reportFloat(panel);
|
|
428
496
|
return showAtPoint(panel, point, { ...opts, rtl: kitDirAt(opts.anchor) === 'rtl', resolve: resolvePopPlace });
|
|
429
497
|
}
|
|
430
498
|
|
|
@@ -493,6 +561,23 @@ export function queryWithDropdowns(scope: Element, selector: string): HTMLElemen
|
|
|
493
561
|
return null;
|
|
494
562
|
}
|
|
495
563
|
|
|
564
|
+
/** scope 内锚点挂出去的、当前在浮层里的面板中全部匹配 selector 的节点(含面板本身);不含 scope 自己后代里的匹配 */
|
|
565
|
+
export function queryAllWithDropdowns(scope: Element, selector: string): HTMLElement[] {
|
|
566
|
+
const out: HTMLElement[] = [];
|
|
567
|
+
for (const panel of livePanelsIn(scope)) {
|
|
568
|
+
if (panel.matches(selector)) out.push(panel);
|
|
569
|
+
out.push(...Array.from(panel.querySelectorAll<HTMLElement>(selector)));
|
|
570
|
+
}
|
|
571
|
+
return out;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
/** 面板新挂到浮层端口时的回调(组件骨架据此补写面板里的自报,见 base/shared.ts#ensurePanelHook);返回撤销函数 */
|
|
575
|
+
const PANEL_MOUNT_HOOKS = new Set<(anchor: HTMLElement, panel: HTMLElement) => void>();
|
|
576
|
+
export function onKitPanelMounted(hook: (anchor: HTMLElement, panel: HTMLElement) => void): () => void {
|
|
577
|
+
PANEL_MOUNT_HOOKS.add(hook);
|
|
578
|
+
return () => { PANEL_MOUNT_HOOKS.delete(hook); };
|
|
579
|
+
}
|
|
580
|
+
|
|
496
581
|
/** 焦点是否落在 scope 内或它挂出去的下拉面板里;是则返回聚焦元素 */
|
|
497
582
|
export function activeWithDropdowns(scope: Element): HTMLElement | null {
|
|
498
583
|
const active = scope.ownerDocument.activeElement as HTMLElement | null;
|
|
@@ -506,6 +591,15 @@ export function releaseDropdownsIn(scope: Element): void {
|
|
|
506
591
|
for (const m of [...DROPDOWN_LIVE]) if (scope.contains(m.anchor)) releaseDropdown(m.panel, false);
|
|
507
592
|
}
|
|
508
593
|
|
|
594
|
+
/** 端口被销毁时要通知的属主(一次性面板登记:整树重画的 releaseDropdownsIn 直接销毁端口,属主据此按取消收口、摘监听) */
|
|
595
|
+
const DESTROY_HOOKS = new WeakMap<HTMLElement, () => void>();
|
|
596
|
+
|
|
597
|
+
/** 登记 / 撤销面板端口被销毁时的回调(cb 为 null 撤销);回调只触发一次,触发前先撤销登记 */
|
|
598
|
+
export function onDropdownDestroyed(panel: HTMLElement, cb: (() => void) | null): void {
|
|
599
|
+
if (cb === null) DESTROY_HOOKS.delete(panel);
|
|
600
|
+
else DESTROY_HOOKS.set(panel, cb);
|
|
601
|
+
}
|
|
602
|
+
|
|
509
603
|
/** 收起并放回原位(restore)或直接销毁(组件卸载) */
|
|
510
604
|
export function releaseDropdown(panel: HTMLElement, restore = true): void {
|
|
511
605
|
cancelLeave(panel);
|
|
@@ -514,7 +608,11 @@ export function releaseDropdown(panel: HTMLElement, restore = true): void {
|
|
|
514
608
|
DROPDOWN_MOUNTS.delete(panel);
|
|
515
609
|
DROPDOWN_LIVE.delete(m);
|
|
516
610
|
if (restore) m.portal.hide(true);
|
|
517
|
-
else
|
|
611
|
+
else {
|
|
612
|
+
m.portal.destroy();
|
|
613
|
+
const hook = DESTROY_HOOKS.get(panel);
|
|
614
|
+
if (hook !== undefined) { DESTROY_HOOKS.delete(panel); hook(); }
|
|
615
|
+
}
|
|
518
616
|
}
|
|
519
617
|
|
|
520
618
|
// ── 锚定面板的出场 ──
|
|
@@ -527,8 +625,15 @@ function cancelLeave(panel: HTMLElement): void {
|
|
|
527
625
|
LEAVING.delete(panel);
|
|
528
626
|
}
|
|
529
627
|
|
|
530
|
-
/**
|
|
531
|
-
function retireAnchored(panel: HTMLElement): void {
|
|
628
|
+
/** 收起锚定面板:已挂出且有退场动画(且非 immediate) -> 播完再放回 + hidden;否则立即放回 + hidden */
|
|
629
|
+
function retireAnchored(panel: HTMLElement, immediate = false): void {
|
|
630
|
+
if (immediate) {
|
|
631
|
+
cancelLeave(panel);
|
|
632
|
+
releaseDropdown(panel);
|
|
633
|
+
panel.className = PANEL_HIDDEN_CLASS;
|
|
634
|
+
unmarkAnchored(panel);
|
|
635
|
+
return;
|
|
636
|
+
}
|
|
532
637
|
if (LEAVING.has(panel)) return;
|
|
533
638
|
const finish = (): void => {
|
|
534
639
|
LEAVING.delete(panel);
|
|
@@ -544,13 +649,29 @@ function retireAnchored(panel: HTMLElement): void {
|
|
|
544
649
|
if (handle !== null) LEAVING.set(panel, handle);
|
|
545
650
|
}
|
|
546
651
|
|
|
652
|
+
export interface SyncOverlayOptions {
|
|
653
|
+
/** Esc 回调(走层栈栈顶:多浮层叠放时只关栈顶一层) */
|
|
654
|
+
onEscape?: () => void;
|
|
655
|
+
/** 收起时立即释放浮层端口与隐藏(选定提交 / Esc 关闭等避免残留半透明残影或滞留层栈) */
|
|
656
|
+
immediate?: boolean;
|
|
657
|
+
}
|
|
658
|
+
|
|
547
659
|
/** 挂到端口并落位;返回实际锚点,端口不可用返回 null(调用方走原位) */
|
|
548
|
-
function mountAnchored(
|
|
660
|
+
function mountAnchored(
|
|
661
|
+
panel: HTMLElement,
|
|
662
|
+
anchor: HTMLElement | undefined,
|
|
663
|
+
pref: PopPlace,
|
|
664
|
+
fit: (p: HTMLElement, box: HTMLElement) => PopPlace,
|
|
665
|
+
onEscape?: () => void,
|
|
666
|
+
): HTMLElement | null {
|
|
549
667
|
const prev = DROPDOWN_MOUNTS.get(panel);
|
|
550
668
|
const at = anchor ?? prev?.anchor ?? panel.parentElement ?? panel;
|
|
551
669
|
const portal = prev?.portal ?? createPanelPortal(at);
|
|
552
670
|
// 端口给的 box 是内部零宽高包裹盒,不能当锚点测视口空间;贴边翻转一律用真实触发器
|
|
553
|
-
const placed = portal.show(panel, at, pref, () => '', {
|
|
671
|
+
const placed = portal.show(panel, at, pref, () => '', {
|
|
672
|
+
fit: (p) => fit(p, at),
|
|
673
|
+
...(onEscape ? { onEscape } : {}),
|
|
674
|
+
});
|
|
554
675
|
if (placed === null) {
|
|
555
676
|
if (prev) DROPDOWN_LIVE.delete(prev);
|
|
556
677
|
DROPDOWN_MOUNTS.delete(panel);
|
|
@@ -560,6 +681,7 @@ function mountAnchored(panel: HTMLElement, anchor: HTMLElement | undefined, pref
|
|
|
560
681
|
const m: DropdownMount = { portal, anchor: at, panel };
|
|
561
682
|
DROPDOWN_MOUNTS.set(panel, m);
|
|
562
683
|
DROPDOWN_LIVE.add(m);
|
|
684
|
+
for (const hook of PANEL_MOUNT_HOOKS) hook(at, panel);
|
|
563
685
|
}
|
|
564
686
|
return at;
|
|
565
687
|
}
|
|
@@ -568,14 +690,21 @@ function mountAnchored(panel: HTMLElement, anchor: HTMLElement | undefined, pref
|
|
|
568
690
|
* 下拉显隐一步到位:收起 = 放回原位 + 整串 hidden;展开 = 挂到浮层端口并贴边翻转(锚点缺省取面板的父盒,
|
|
569
691
|
* 面板已挂出时取上次的锚点)。端口不可用时退回原位绝对定位。
|
|
570
692
|
*/
|
|
571
|
-
export function syncDropdown(
|
|
693
|
+
export function syncDropdown(
|
|
694
|
+
panel: HTMLElement,
|
|
695
|
+
open: boolean,
|
|
696
|
+
base: string = PANEL_BASE_CLASS,
|
|
697
|
+
anchor?: HTMLElement,
|
|
698
|
+
prefAlign: PopAlign = 'start',
|
|
699
|
+
opts?: SyncOverlayOptions,
|
|
700
|
+
): void {
|
|
572
701
|
if (!open) {
|
|
573
|
-
retireAnchored(panel);
|
|
702
|
+
retireAnchored(panel, opts?.immediate === true);
|
|
574
703
|
return;
|
|
575
704
|
}
|
|
576
705
|
cancelLeave(panel);
|
|
577
706
|
const live = `${base} ${DROPDOWN_LIVE_CLASS}`;
|
|
578
|
-
const at = mountAnchored(panel, anchor, { side: 'bottom', align: prefAlign }, (p, box) => showDropdownFitted(p, box, live, prefAlign));
|
|
707
|
+
const at = mountAnchored(panel, anchor, { side: 'bottom', align: prefAlign }, (p, box) => showDropdownFitted(p, box, live, prefAlign), opts?.onEscape);
|
|
579
708
|
if (at === null) showDropdownFitted(panel, anchor ?? panel.parentElement ?? panel, base, prefAlign);
|
|
580
709
|
}
|
|
581
710
|
|
|
@@ -584,15 +713,21 @@ export function syncDropdown(panel: HTMLElement, open: boolean, base: string = P
|
|
|
584
713
|
* classFor 给位置类 + 外观类。端口不可用时退回原位。
|
|
585
714
|
*/
|
|
586
715
|
export function syncAnchored(
|
|
587
|
-
panel: HTMLElement,
|
|
716
|
+
panel: HTMLElement,
|
|
717
|
+
open: boolean,
|
|
718
|
+
anchor: HTMLElement,
|
|
719
|
+
pref: PopPlace,
|
|
720
|
+
classFor: (place: PopPlace) => string,
|
|
721
|
+
gapPx?: number,
|
|
722
|
+
opts?: SyncOverlayOptions,
|
|
588
723
|
): void {
|
|
589
724
|
if (!open) {
|
|
590
|
-
retireAnchored(panel);
|
|
725
|
+
retireAnchored(panel, opts?.immediate === true);
|
|
591
726
|
return;
|
|
592
727
|
}
|
|
593
728
|
cancelLeave(panel);
|
|
594
729
|
const live = (place: PopPlace): string => `${classFor(place)} ${DROPDOWN_LIVE_CLASS}`;
|
|
595
|
-
const at = mountAnchored(panel, anchor, pref, (p, box) => showPopupFitted(p, box, pref, live, gapPx));
|
|
730
|
+
const at = mountAnchored(panel, anchor, pref, (p, box) => showPopupFitted(p, box, pref, live, gapPx), opts?.onEscape);
|
|
596
731
|
if (at === null) showPopupFitted(panel, anchor, pref, classFor, gapPx);
|
|
597
732
|
}
|
|
598
733
|
|
package/src/base/portal-core.ts
CHANGED
|
@@ -13,6 +13,7 @@ import { getOverlayHost } from 'soma-core/behavior';
|
|
|
13
13
|
import type { OverlayMount } from 'soma-core/behavior';
|
|
14
14
|
import type { PopPlace } from './popup';
|
|
15
15
|
import { markAnchored, unmarkAnchored } from './anchored-layer';
|
|
16
|
+
import { KIT_ATTR_LAYER, KIT_ATTR_LEVEL, KIT_ATTR_OVERLAY_OWNER, KIT_ATTR_SCOPE, KIT_ATTR_SCRIM } from '../shared/dom-attrs';
|
|
16
17
|
|
|
17
18
|
export interface KitOverlayOptions {
|
|
18
19
|
/** 逻辑所有者(组件宿主 / 触发元素):作用域属性从它取,它脱离文档后浮层自动卸载 */
|
|
@@ -36,14 +37,97 @@ export function mountKitOverlay(content: HTMLElement, opts: KitOverlayOptions =
|
|
|
36
37
|
if (!doc) return null;
|
|
37
38
|
if (opts.anchor) {
|
|
38
39
|
OVERLAY_OWNERS.set(content, opts.anchor);
|
|
39
|
-
content.setAttribute(
|
|
40
|
+
content.setAttribute(KIT_ATTR_OVERLAY_OWNER, '');
|
|
40
41
|
}
|
|
41
42
|
const handle = getOverlayHost(doc).mount(content, {
|
|
42
43
|
anchor: opts.anchor ?? null,
|
|
43
44
|
...(opts.releaseWithAnchor !== undefined ? { releaseWithAnchor: opts.releaseWithAnchor } : {}),
|
|
44
45
|
...(opts.onEscape ? { onEscape: () => opts.onEscape!() } : {}),
|
|
45
46
|
});
|
|
46
|
-
|
|
47
|
+
if (!handle.mounted) return null;
|
|
48
|
+
// 宿主身份 / 明暗类 / 作用域属性严格镜像到每个浮层自己的 layer(handle.host),
|
|
49
|
+
// 严禁改写共享单例 [data-soma-overlay-root],杜绝多宿主(如亮色主宿主 + 局部暗色宿主)浮层并存时串扰。
|
|
50
|
+
const layer: HTMLElement = (handle.host instanceof HTMLElement ? handle.host : null)
|
|
51
|
+
?? (content.parentElement instanceof HTMLElement && content.parentElement !== doc.body && content.parentElement !== doc.documentElement
|
|
52
|
+
? content.parentElement
|
|
53
|
+
: content);
|
|
54
|
+
const prevHostAttr = layer.hasAttribute('data-soma-host') ? layer.getAttribute('data-soma-host') : null;
|
|
55
|
+
const prevScopeAttr = layer.hasAttribute(KIT_ATTR_SCOPE) ? layer.getAttribute(KIT_ATTR_SCOPE) : null;
|
|
56
|
+
const prevDark = layer.classList.contains('soma-scheme-dark');
|
|
57
|
+
const prevLight = layer.classList.contains('soma-scheme-light');
|
|
58
|
+
let unmounted = false;
|
|
59
|
+
|
|
60
|
+
const syncAnchorScope = (): void => {
|
|
61
|
+
if (unmounted || !handle.mounted) return;
|
|
62
|
+
const anchor = opts.anchor ?? null;
|
|
63
|
+
const hostAncestor = anchor?.closest('[data-soma-host]') ?? null;
|
|
64
|
+
const hostVal = hostAncestor !== null ? (hostAncestor.getAttribute('data-soma-host') ?? '') : (prevHostAttr ?? '');
|
|
65
|
+
if (!layer.hasAttribute('data-soma-host') || layer.getAttribute('data-soma-host') !== hostVal) {
|
|
66
|
+
layer.setAttribute('data-soma-host', hostVal);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const schemeAncestor = anchor?.closest('.soma-scheme-dark, .soma-scheme-light') ?? null;
|
|
70
|
+
if (schemeAncestor !== null && schemeAncestor !== doc.documentElement && schemeAncestor !== doc.body) {
|
|
71
|
+
const dark = schemeAncestor.classList.contains('soma-scheme-dark');
|
|
72
|
+
layer.classList.toggle('soma-scheme-dark', dark);
|
|
73
|
+
layer.classList.toggle('soma-scheme-light', !dark);
|
|
74
|
+
} else {
|
|
75
|
+
layer.classList.toggle('soma-scheme-dark', prevDark);
|
|
76
|
+
layer.classList.toggle('soma-scheme-light', prevLight);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const scopeAncestor = anchor?.closest(`[${KIT_ATTR_SCOPE}]`) ?? null;
|
|
80
|
+
if (scopeAncestor !== null) {
|
|
81
|
+
const scopeVal = scopeAncestor.getAttribute(KIT_ATTR_SCOPE) ?? '';
|
|
82
|
+
if (layer.getAttribute(KIT_ATTR_SCOPE) !== scopeVal) layer.setAttribute(KIT_ATTR_SCOPE, scopeVal);
|
|
83
|
+
} else if (prevScopeAttr === null) {
|
|
84
|
+
if (layer.hasAttribute(KIT_ATTR_SCOPE)) layer.removeAttribute(KIT_ATTR_SCOPE);
|
|
85
|
+
} else if (layer.getAttribute(KIT_ATTR_SCOPE) !== prevScopeAttr) {
|
|
86
|
+
layer.setAttribute(KIT_ATTR_SCOPE, prevScopeAttr);
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
syncAnchorScope();
|
|
90
|
+
const isShellWrapper = content.classList.contains('contents')
|
|
91
|
+
|| content.hasAttribute(KIT_ATTR_SCRIM)
|
|
92
|
+
|| content.getAttribute('role') === 'tooltip'
|
|
93
|
+
|| content.querySelector(`[${KIT_ATTR_LAYER}]`) !== null
|
|
94
|
+
|| content.querySelector(`[${KIT_ATTR_LEVEL}="overlay"]`) !== null;
|
|
95
|
+
const addedLayer = !isShellWrapper && !content.hasAttribute(KIT_ATTR_LAYER);
|
|
96
|
+
if (addedLayer) content.setAttribute(KIT_ATTR_LAYER, 'float');
|
|
97
|
+
const rawUnmount = handle.unmount.bind(handle);
|
|
98
|
+
const rawSync = handle.sync.bind(handle);
|
|
99
|
+
return new Proxy(handle, {
|
|
100
|
+
get(target, prop) {
|
|
101
|
+
if (prop === 'sync') {
|
|
102
|
+
return (): void => {
|
|
103
|
+
rawSync();
|
|
104
|
+
syncAnchorScope();
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
if (prop === 'unmount') {
|
|
108
|
+
return (): void => {
|
|
109
|
+
if (unmounted) return;
|
|
110
|
+
unmounted = true;
|
|
111
|
+
rawUnmount();
|
|
112
|
+
if (prevHostAttr === null) {
|
|
113
|
+
if (layer.hasAttribute('data-soma-host')) layer.removeAttribute('data-soma-host');
|
|
114
|
+
} else if (layer.getAttribute('data-soma-host') !== prevHostAttr) {
|
|
115
|
+
layer.setAttribute('data-soma-host', prevHostAttr);
|
|
116
|
+
}
|
|
117
|
+
if (prevScopeAttr === null) {
|
|
118
|
+
if (layer.hasAttribute(KIT_ATTR_SCOPE)) layer.removeAttribute(KIT_ATTR_SCOPE);
|
|
119
|
+
} else if (layer.getAttribute(KIT_ATTR_SCOPE) !== prevScopeAttr) {
|
|
120
|
+
layer.setAttribute(KIT_ATTR_SCOPE, prevScopeAttr);
|
|
121
|
+
}
|
|
122
|
+
layer.classList.toggle('soma-scheme-dark', prevDark);
|
|
123
|
+
layer.classList.toggle('soma-scheme-light', prevLight);
|
|
124
|
+
if (addedLayer) content.removeAttribute(KIT_ATTR_LAYER);
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
const val = Reflect.get(target, prop, target);
|
|
128
|
+
return typeof val === 'function' ? val.bind(target) : val;
|
|
129
|
+
},
|
|
130
|
+
});
|
|
47
131
|
}
|
|
48
132
|
|
|
49
133
|
// ── 按点定位(右键菜单)──
|
|
@@ -202,6 +286,7 @@ export function createPanelPortalWith(owner: Element | null, defaultFit: PortalF
|
|
|
202
286
|
let offBind: (() => void) | null = null;
|
|
203
287
|
let offMove: Array<() => void> = [];
|
|
204
288
|
let panelEl: HTMLElement | null = null;
|
|
289
|
+
let panelAddedLayer = false;
|
|
205
290
|
let origin: { parent: Node; next: Node | null } | null = null;
|
|
206
291
|
let escape: (() => void) | undefined;
|
|
207
292
|
let last: {
|
|
@@ -239,6 +324,10 @@ export function createPanelPortalWith(owner: Element | null, defaultFit: PortalF
|
|
|
239
324
|
|
|
240
325
|
const hide = (restore = true): void => {
|
|
241
326
|
const el = panelEl;
|
|
327
|
+
if (el && panelAddedLayer) {
|
|
328
|
+
el.removeAttribute(KIT_ATTR_LAYER);
|
|
329
|
+
}
|
|
330
|
+
panelAddedLayer = false;
|
|
242
331
|
if (el && restore && origin && origin.parent.isConnected !== false) {
|
|
243
332
|
origin.parent.insertBefore(el, origin.next && origin.next.parentNode === origin.parent ? origin.next : null);
|
|
244
333
|
}
|
|
@@ -288,9 +377,17 @@ export function createPanelPortalWith(owner: Element | null, defaultFit: PortalF
|
|
|
288
377
|
];
|
|
289
378
|
}
|
|
290
379
|
if (panel.parentNode !== box) {
|
|
380
|
+
if (panelEl !== null && panelEl !== panel && panelAddedLayer) {
|
|
381
|
+
panelEl.removeAttribute(KIT_ATTR_LAYER);
|
|
382
|
+
panelAddedLayer = false;
|
|
383
|
+
}
|
|
291
384
|
if (panelEl === null && panel.parentNode) origin = { parent: panel.parentNode, next: panel.nextSibling };
|
|
292
385
|
box!.replaceChildren(panel);
|
|
293
386
|
}
|
|
387
|
+
if (panelEl !== panel) {
|
|
388
|
+
panelAddedLayer = panel.getAttribute('role') !== 'tooltip' && !panel.hasAttribute(KIT_ATTR_LAYER);
|
|
389
|
+
if (panelAddedLayer) panel.setAttribute(KIT_ATTR_LAYER, 'float');
|
|
390
|
+
}
|
|
294
391
|
panelEl = panel;
|
|
295
392
|
last = { anchor, pref, classFor, gapPx: opts.gapPx, fit: opts.fit };
|
|
296
393
|
return place();
|