soma-kit 0.1.13 → 0.1.15
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/package.json +3 -3
- package/packs/finance/reconcile-desk/compile.ts +1 -1
- package/packs/finance/reconcile-desk/shell.ts +1 -1
- package/spec/generated/kit-app.schema.json +18 -2
- package/spec/generated/kit-page.schema.json +95 -0
- package/spec/kit-grammar.json +332 -75
- package/spec/kit-grammar.schema.json +1 -27
- package/src/app/app-config.ts +11 -5
- package/src/app/component-gate.ts +2 -2
- package/src/app/compose-apps.ts +5 -2
- package/src/app/define-kit-actions.ts +82 -10
- package/src/app/define-kit-app.ts +6 -5
- package/src/app/define-kit-view.ts +1 -1
- package/src/app/index.ts +20 -8
- package/src/app/kit-view-context.ts +30 -4
- package/src/app/server-pages.ts +5 -1
- package/src/app/server.ts +15 -5
- package/src/app/theme-endpoint.ts +1 -1
- package/src/app/theme-runtime.ts +7 -2
- package/src/base/alert.ts +23 -20
- package/src/base/anchored-layer.ts +1 -1
- package/src/base/button.ts +34 -17
- package/src/base/cascader.ts +8 -4
- package/src/base/check-core.ts +9 -6
- package/src/base/color-picker.ts +10 -6
- package/src/base/command-palette.ts +10 -4
- package/src/base/context-menu.ts +5 -2
- package/src/base/date-range.ts +9 -6
- package/src/base/date.ts +10 -6
- package/src/base/delta.ts +4 -2
- package/src/base/divider.ts +15 -66
- package/src/base/end-edge.ts +14 -2
- package/src/base/fab.ts +11 -6
- package/src/base/gap-value.ts +25 -5
- package/src/base/hint-tips.ts +1 -1
- package/src/base/illustrations.ts +2 -1
- package/src/base/index.ts +20 -4
- package/src/base/inline-error.ts +84 -0
- package/src/base/input.ts +54 -18
- package/src/base/kbd.ts +4 -3
- package/src/base/link.ts +1 -1
- package/src/base/listbox-core.ts +70 -22
- package/src/base/mentions.ts +6 -3
- package/src/base/menu-button.ts +73 -50
- package/src/base/menu-core.ts +9 -2
- package/src/base/motion/hover-3d.ts +4 -1
- package/src/base/motion/hover-gallery.ts +4 -1
- package/src/base/otp.ts +7 -3
- package/src/base/overlay-runtime.ts +3 -2
- package/src/base/overlay-shell.ts +141 -0
- package/src/base/popover.ts +7 -6
- package/src/base/popup.ts +47 -41
- package/src/base/qty-stepper.ts +14 -9
- package/src/base/reason-tip.ts +2 -2
- package/src/{frames → base}/resize-handle.ts +1 -1
- package/src/base/segmented.ts +44 -35
- package/src/base/select.ts +1 -0
- package/src/base/shared.ts +52 -18
- package/src/base/state-panel.ts +34 -13
- package/src/base/status-tone.ts +1 -1
- package/src/base/tag-input.ts +13 -8
- package/src/base/tag.ts +56 -57
- package/src/base/text.ts +38 -14
- package/src/base/textarea.ts +1 -1
- package/src/base/time-picker.ts +9 -5
- package/src/base/tree-select.ts +12 -9
- package/src/base/upload.ts +26 -17
- package/src/biz/approval-desk/compile.ts +28 -1
- package/src/biz/approval-desk/shell.ts +10 -9
- package/src/biz/auth-panel/compile.ts +1 -1
- package/src/biz/auth-panel/shell.ts +7 -6
- package/src/biz/category-crud/compile.ts +20 -6
- package/src/biz/category-crud/shell.ts +10 -7
- package/src/biz/checkout-page/compile.ts +1 -1
- package/src/biz/checkout-page/shell.ts +15 -13
- package/src/biz/compose.ts +5 -5
- package/src/biz/data-components.ts +4 -0
- package/src/biz/define.ts +1 -1
- package/src/biz/import-wizard/compile.ts +1 -1
- package/src/biz/import-wizard/shell.ts +17 -13
- package/src/biz/index.ts +4 -3
- package/src/biz/landing-page/compile.ts +1 -1
- package/src/biz/landing-page/shell.ts +6 -5
- package/src/biz/link/shared.ts +8 -1
- package/src/biz/master-sub/compile.ts +269 -27
- package/src/biz/master-sub/detail-head.ts +62 -0
- package/src/biz/master-sub/index.ts +5 -4
- package/src/biz/master-sub/shell.ts +138 -69
- package/src/biz/multi-board/compile.ts +166 -11
- package/src/biz/multi-board/composition.ts +58 -0
- package/src/biz/multi-board/index.ts +25 -10
- package/src/biz/multi-board/prose-fold.ts +143 -0
- package/src/biz/multi-board/shell.ts +96 -24
- package/src/biz/names.ts +1 -0
- package/src/biz/notification-center/compile.ts +9 -2
- package/src/biz/notification-center/shell.ts +15 -7
- package/src/biz/page-templates/domain-templates.ts +7 -3
- package/src/biz/page-templates/result-page/compile.ts +1 -1
- package/src/biz/page-templates/result-page/shell.ts +5 -4
- package/src/biz/page-templates/shared.ts +1 -1
- package/src/biz/page-templates/sign-in-page/compile.ts +1 -1
- package/src/biz/page-templates/sign-in-page/shell.ts +18 -18
- package/src/biz/record-detail/compile.ts +5 -2
- package/src/biz/record-detail/shell.ts +12 -11
- package/src/biz/settings-center/compile.ts +1 -1
- package/src/biz/settings-center/shell.ts +14 -10
- package/src/biz/shared/action-host.ts +12 -5
- package/src/biz/shared/compile-helpers.ts +83 -4
- package/src/biz/shared/coordinator.ts +104 -21
- package/src/biz/shared/overlay-compile.ts +76 -4
- package/src/biz/shared/overlay-shell.ts +65 -112
- package/src/biz/single-form/compile.ts +2 -2
- package/src/biz/single-form/shell.ts +13 -7
- package/src/biz/standard-crud/compile.ts +24 -4
- package/src/biz/standard-crud/shell.ts +38 -30
- package/src/biz/standard-crud/summary.ts +42 -0
- package/src/biz/step-form/compile.ts +1 -1
- package/src/biz/step-form/hub.ts +4 -0
- package/src/biz/step-form/shell.ts +16 -12
- package/src/biz/types.ts +15 -3
- package/src/cli/app-layer-check.ts +375 -0
- package/src/cli/kit-cli.ts +35 -8
- package/src/cli/kit-init.ts +149 -0
- package/src/cli/layout-cli.ts +7 -7
- package/src/compile/access-gate-attach.ts +27 -0
- package/src/compile/action-host-attach.ts +1 -1
- package/src/compile/compile-page.ts +36 -230
- package/src/compile/component-candidates.ts +4 -1
- package/src/compile/hints.ts +5 -58
- package/src/compile/index.ts +2 -2
- package/src/compile/layout-lint/index.ts +4 -1
- package/src/compile/layout-lint/rules-composition.ts +97 -18
- package/src/compile/layout-lint/rules-form.ts +6 -7
- package/src/compile/layout-lint/rules-table.ts +98 -14
- package/src/compile/page-composition.ts +191 -0
- package/src/compile/parse.ts +4 -0
- package/src/compile/producer-fingerprint.ts +56 -0
- package/src/compile/redirect.ts +1 -1
- package/src/compile/stages.ts +169 -0
- package/src/compile/styles.ts +80 -32
- package/src/compile/types.ts +5 -3
- package/src/data/access-gate.ts +112 -0
- package/src/data/amount-breakdown.ts +6 -2
- package/src/data/anchor-nav.ts +4 -1
- package/src/data/approval-flow.ts +13 -5
- package/src/data/assignment-picker.ts +35 -20
- package/src/data/async-result-panel.ts +7 -3
- package/src/data/breadcrumbs.ts +13 -9
- package/src/data/calendar.ts +10 -4
- package/src/data/carousel.ts +13 -5
- package/src/data/chart.ts +745 -48
- package/src/data/checklist.ts +9 -5
- package/src/data/code-view.ts +220 -26
- package/src/data/comment-thread.ts +9 -3
- package/src/data/confirm-dialog.ts +57 -20
- package/src/data/diff.ts +4 -1
- package/src/data/dock.ts +5 -1
- package/src/data/embed.ts +1 -1
- package/src/data/engine-ports.ts +126 -0
- package/src/data/field-mapper.ts +16 -7
- package/src/data/flow-editor.ts +106 -29
- package/src/data/footer.ts +8 -2
- package/src/data/gantt.ts +192 -27
- package/src/data/hero.ts +8 -2
- package/src/data/image-viewer.ts +7 -3
- package/src/data/index.ts +22 -8
- package/src/data/item-list.ts +11 -3
- package/src/data/json-view.ts +844 -0
- package/src/data/kanban.ts +13 -8
- package/src/data/markdown-view.ts +487 -0
- package/src/data/matrix.ts +400 -0
- package/src/data/media-grid.ts +5 -2
- package/src/data/mega-menu.ts +4 -3
- package/src/data/menu-dom.ts +9 -8
- package/src/data/menu.ts +35 -17
- package/src/data/mockup.ts +12 -8
- package/src/data/modal-dialog.ts +108 -57
- package/src/data/navbar.ts +13 -7
- package/src/data/notice-list.ts +53 -20
- package/src/data/notify-renderer.ts +21 -10
- package/src/data/object-form.ts +248 -151
- package/src/data/pager.ts +15 -10
- package/src/data/panel-head.ts +406 -0
- package/src/data/permission-matrix.ts +19 -9
- package/src/data/permission-tree.ts +30 -13
- package/src/data/pricing-table.ts +10 -4
- package/src/data/reaction-bar.ts +6 -3
- package/src/data/record-card.ts +30 -14
- package/src/data/record-picker.ts +8 -4
- package/src/data/redirect.ts +1 -1
- package/src/data/request-console.ts +20 -7
- package/src/data/resident.ts +6 -10
- package/src/data/result-panel.ts +2 -2
- package/src/data/rich-text.ts +58 -96
- package/src/data/row-editor.ts +12 -7
- package/src/data/rule-builder.ts +22 -11
- package/src/data/shape-util.ts +26 -14
- package/src/data/stat-group.ts +369 -84
- package/src/data/static-lazy.ts +7 -0
- package/src/data/static-registry.ts +14 -2
- package/src/data/steps.ts +6 -2
- package/src/data/survey.ts +13 -4
- package/src/data/system-switcher.ts +17 -7
- package/src/data/text-diff.ts +663 -0
- package/src/data/timeline.ts +1 -1
- package/src/data/tour-guide.ts +8 -4
- package/src/data/transfer.ts +24 -11
- package/src/data/tree-table.ts +84 -17
- package/src/data/tree.ts +6 -3
- package/src/data/virtual-rows.ts +22 -11
- package/src/data/wrap.ts +2 -2
- package/src/data/wrapped-candidates.ts +22 -1
- package/src/frames/index.ts +4 -2
- package/src/frames/inherited-shell.ts +178 -0
- package/src/frames/list-summary.ts +123 -0
- package/src/frames/page-bar.ts +10 -16
- package/src/frames/resident-components.ts +20 -0
- package/src/frames/shared.ts +37 -17
- package/src/frames/split-frame/shell.ts +17 -11
- package/src/frames/split-frame/wiring.ts +2 -2
- package/src/frames/tabs-frame/shell.ts +17 -9
- package/src/frames/top-main-frame.ts +1 -1
- package/src/frames/types.ts +6 -3
- package/src/frames/workspace-frame/extras.ts +19 -5
- package/src/frames/workspace-frame/shell.ts +4 -3
- package/src/frames/workspace-frame/state.ts +8 -2
- package/src/frames/workspace-frame/tab-scroll.ts +28 -0
- package/src/frames/workspace-frame/view.ts +156 -91
- package/src/generated/kit-grammar-runtime.ts +227 -58
- package/src/i18n/kit-text.ts +141 -2
- package/src/i18n/resolve-text-refs.ts +1 -1
- package/src/object-renderer/action-group.ts +169 -0
- package/src/object-renderer/action-more.ts +160 -0
- package/src/object-renderer/arrange.ts +86 -26
- package/src/object-renderer/candidates.ts +4 -0
- package/src/object-renderer/collection-parts.ts +72 -20
- package/src/object-renderer/collection-table.ts +178 -65
- package/src/object-renderer/collection.ts +129 -83
- package/src/object-renderer/compile-data.ts +1 -1
- package/src/object-renderer/defaults.ts +10 -5
- package/src/object-renderer/emit-events.ts +1 -1
- package/src/object-renderer/emit-object.ts +7 -0
- package/src/object-renderer/emit-static.ts +243 -87
- package/src/object-renderer/field-value.ts +12 -239
- package/src/object-renderer/filter-plan.ts +84 -0
- package/src/object-renderer/filter-toolbar.ts +103 -0
- package/src/{compile → object-renderer}/fragment.ts +13 -2
- package/src/object-renderer/index.ts +6 -1
- package/src/object-renderer/layout-facts.ts +46 -6
- package/src/object-renderer/layout-plan.ts +136 -43
- package/src/object-renderer/layout-plan.types.ts +42 -5
- package/src/object-renderer/overlay-decide.ts +82 -0
- package/src/object-renderer/parts.ts +7 -259
- package/src/object-renderer/render-object.ts +60 -47
- package/src/object-renderer/table-actions.ts +135 -56
- package/src/object-renderer/table-gap.ts +37 -0
- package/src/object-renderer/table-tools.ts +63 -25
- package/src/object-renderer/types.ts +16 -22
- package/src/recipes/app-blocks.ts +66 -0
- package/src/recipes/code-view.ts +56 -0
- package/src/recipes/compact-group.ts +31 -0
- package/src/recipes/container.ts +54 -13
- package/src/recipes/control.ts +77 -157
- package/src/recipes/desc-list.ts +14 -0
- package/src/recipes/divider.ts +53 -0
- package/src/recipes/emphasis.ts +60 -0
- package/src/recipes/frame-bleed.ts +33 -0
- package/src/recipes/index.ts +34 -1
- package/src/recipes/inherited-shell.ts +37 -0
- package/src/recipes/json-view.ts +49 -0
- package/src/recipes/markdown.ts +86 -0
- package/src/recipes/overlay.ts +149 -18
- package/src/recipes/page-width.ts +20 -0
- package/src/recipes/placeholder.ts +21 -5
- package/src/recipes/rail-grid.ts +3 -0
- package/src/recipes/stat-state.ts +65 -0
- package/src/recipes/state.ts +20 -28
- package/src/recipes/status.ts +17 -8
- package/src/recipes/strip.ts +72 -0
- package/src/recipes/surface-edge.ts +16 -0
- package/src/recipes/surface.ts +10 -6
- package/src/recipes/table-gap.ts +80 -0
- package/src/recipes/table-native-edit.ts +242 -0
- package/src/recipes/table-row.ts +120 -11
- package/src/recipes/tabs.ts +126 -0
- package/src/recipes/text-diff.ts +90 -0
- package/src/recipes/title-row.ts +7 -5
- package/src/recipes/typography.ts +24 -43
- package/src/shared/diagnostics.ts +16 -0
- package/src/shared/envelope.ts +1 -1
- package/src/shared/field-value-format.ts +246 -0
- package/src/shared/focus-ring.ts +8 -0
- package/src/shared/hints.ts +56 -0
- package/src/{base → shared}/icons.ts +12 -0
- package/src/shared/kit-error.ts +1 -1
- package/src/{object-renderer → shared}/merge-class.ts +3 -2
- package/src/shared/path-guard.ts +1 -1
- package/src/shared/primitives-types.ts +8 -0
- package/src/shared/theme-runtime-shared.ts +19 -0
- package/src/theme/kit-theme-text.ts +1 -1
- package/src/theme/kit-theme.css +49 -14
- package/src/theme/kit-theme.tpl +49 -14
- package/src/theme/nine-dim-structure.ts +129 -37
- package/src/theme/surface-layers.ts +17 -4
- package/src/theme/theme-tokens.ts +16 -5
- package/src/theme/typography.ts +21 -17
- package/src/app/envelope.ts +0 -1
- package/src/app/notify-renderer.ts +0 -1
- package/src/app/paged-list-adapter.ts +0 -1
- package/src/app/theme-runtime-shared.ts +0 -1
- package/src/compile/kit-error.ts +0 -1
- /package/src/{base → shared}/class-candidates.ts +0 -0
package/src/compile/styles.ts
CHANGED
|
@@ -25,6 +25,7 @@ import { KIT_TRANSFER_CLASS_CANDIDATES } from '../data/transfer';
|
|
|
25
25
|
import { KIT_PERMISSION_MATRIX_CLASS_CANDIDATES } from '../data/permission-matrix';
|
|
26
26
|
import { KIT_FIELD_MAPPER_CLASS_CANDIDATES } from '../data/field-mapper';
|
|
27
27
|
import { KIT_GANTT_CLASS_CANDIDATES } from '../data/gantt';
|
|
28
|
+
import { KIT_MATRIX_CLASS_CANDIDATES } from '../data/matrix';
|
|
28
29
|
import { KIT_KANBAN_CLASS_CANDIDATES } from '../data/kanban';
|
|
29
30
|
import { KIT_PERMISSION_TREE_CLASS_CANDIDATES } from '../data/permission-tree';
|
|
30
31
|
import { KIT_ASSIGNMENT_PICKER_CLASS_CANDIDATES } from '../data/assignment-picker';
|
|
@@ -32,12 +33,16 @@ import { KIT_HERO_CLASS_CANDIDATES } from '../data/hero';
|
|
|
32
33
|
import { KIT_CAROUSEL_CLASS_CANDIDATES } from '../data/carousel';
|
|
33
34
|
import { KIT_DOCK_CLASS_CANDIDATES } from '../data/dock';
|
|
34
35
|
import { KIT_DIFF_CLASS_CANDIDATES } from '../data/diff';
|
|
36
|
+
import { KIT_TEXT_DIFF_CLASS_CANDIDATES } from '../data/text-diff';
|
|
35
37
|
import { KIT_MOCKUP_CLASS_CANDIDATES } from '../data/mockup';
|
|
36
38
|
import { KIT_FOOTER_CLASS_CANDIDATES } from '../data/footer';
|
|
37
39
|
import { KIT_PRICING_TABLE_CLASS_CANDIDATES } from '../data/pricing-table';
|
|
38
40
|
import { KIT_CODE_VIEW_CLASS_CANDIDATES } from '../data/code-view';
|
|
41
|
+
import { KIT_JSON_VIEW_CLASS_CANDIDATES } from '../data/json-view';
|
|
42
|
+
import { KIT_MARKDOWN_VIEW_CLASS_CANDIDATES } from '../data/markdown-view';
|
|
39
43
|
import { KIT_ITEM_LIST_CLASS_CANDIDATES } from '../data/item-list';
|
|
40
44
|
import { KIT_NOTICE_LIST_CLASS_CANDIDATES } from '../data/notice-list';
|
|
45
|
+
import { KIT_PANEL_HEAD_CLASS_CANDIDATES } from '../data/panel-head';
|
|
41
46
|
import { KIT_SYSTEM_SWITCHER_CLASS_CANDIDATES } from '../data/system-switcher';
|
|
42
47
|
import { KIT_CALENDAR_CLASS_CANDIDATES } from '../data/calendar';
|
|
43
48
|
import { KIT_IMAGE_VIEWER_CLASS_CANDIDATES } from '../data/image-viewer';
|
|
@@ -55,23 +60,29 @@ import { KIT_REQUEST_CONSOLE_CLASS_CANDIDATES } from '../data/request-console';
|
|
|
55
60
|
import { KIT_RULE_BUILDER_CLASS_CANDIDATES } from '../data/rule-builder';
|
|
56
61
|
import { KIT_FLOW_EDITOR_CLASS_CANDIDATES } from '../data/flow-editor';
|
|
57
62
|
import { classesInHtml } from '../object-renderer/candidates';
|
|
58
|
-
import { checkClasses } from '../
|
|
63
|
+
import { checkClasses } from '../shared/merge-class';
|
|
59
64
|
import { KIT_TABLE_ACTIONS_CLASS_CANDIDATES } from '../object-renderer/table-actions';
|
|
60
65
|
import { KIT_COLLECTION_STATE_CLASS_CANDIDATES, KIT_TABLE_HEAD_CLASS_CANDIDATES } from '../object-renderer/collection-parts';
|
|
61
66
|
import { KIT_TABLE_TOOLS_CLASS_CANDIDATES } from '../object-renderer/table-tools';
|
|
67
|
+
import { KIT_TABLE_GAP_CLASS_CANDIDATES } from '../recipes/table-gap';
|
|
68
|
+
import { KIT_ACTION_MORE_CLASS_CANDIDATES } from '../object-renderer/action-more';
|
|
62
69
|
import type { KitDiagnostic } from '../object-renderer/types';
|
|
63
70
|
import { wrappedCandidateSource } from '../data/wrapped-candidates';
|
|
64
71
|
import type { SomaComponentDefinition } from 'soma-core';
|
|
65
72
|
import type { SomaStyleEngine } from 'soma-core/server/style-engine';
|
|
66
|
-
import type { KitFragment } from '
|
|
73
|
+
import type { KitFragment } from '../object-renderer/fragment';
|
|
67
74
|
import type { KitAppContext } from './types';
|
|
68
|
-
import { KIT_OVERLAY_LIMITS, KIT_WORKSPACE_FRAME_LIMITS } from 'soma-foundation/kit-limits';
|
|
75
|
+
import { KIT_DROPDOWN_LIMITS, KIT_OVERLAY_LIMITS, KIT_SIZE_SPEC, KIT_WORKSPACE_FRAME_LIMITS } from 'soma-foundation/kit-limits';
|
|
76
|
+
import { arrangeTiers } from 'soma-foundation/arrange';
|
|
77
|
+
import { KIT_FORM_FIELD_WIDTH_STEPS } from 'soma-foundation/kit-layout';
|
|
69
78
|
|
|
70
79
|
/** 内置数据组件名 -> 自带候选类(用到才并入) */
|
|
71
80
|
const DATA_COMPONENT_CANDIDATES: Readonly<Record<string, readonly string[]>> = {
|
|
72
81
|
KitObjectForm: KIT_FORM_CLASS_CANDIDATES,
|
|
73
82
|
KitTableActions: KIT_TABLE_ACTIONS_CLASS_CANDIDATES,
|
|
83
|
+
KitActionMore: KIT_ACTION_MORE_CLASS_CANDIDATES,
|
|
74
84
|
KitTableHead: KIT_TABLE_HEAD_CLASS_CANDIDATES,
|
|
85
|
+
KitTableGap: KIT_TABLE_GAP_CLASS_CANDIDATES,
|
|
75
86
|
KitTableTools: KIT_TABLE_TOOLS_CLASS_CANDIDATES,
|
|
76
87
|
KitCollectionState: KIT_COLLECTION_STATE_CLASS_CANDIDATES,
|
|
77
88
|
KitTreeTable: KIT_TREE_TABLE_CLASS_CANDIDATES,
|
|
@@ -93,6 +104,7 @@ const DATA_COMPONENT_CANDIDATES: Readonly<Record<string, readonly string[]>> = {
|
|
|
93
104
|
PermissionMatrix: KIT_PERMISSION_MATRIX_CLASS_CANDIDATES,
|
|
94
105
|
FieldMapper: KIT_FIELD_MAPPER_CLASS_CANDIDATES,
|
|
95
106
|
Gantt: KIT_GANTT_CLASS_CANDIDATES,
|
|
107
|
+
Matrix: KIT_MATRIX_CLASS_CANDIDATES,
|
|
96
108
|
Kanban: KIT_KANBAN_CLASS_CANDIDATES,
|
|
97
109
|
PermissionTree: KIT_PERMISSION_TREE_CLASS_CANDIDATES,
|
|
98
110
|
AssignmentPicker: KIT_ASSIGNMENT_PICKER_CLASS_CANDIDATES,
|
|
@@ -100,10 +112,13 @@ const DATA_COMPONENT_CANDIDATES: Readonly<Record<string, readonly string[]>> = {
|
|
|
100
112
|
Carousel: KIT_CAROUSEL_CLASS_CANDIDATES,
|
|
101
113
|
Dock: KIT_DOCK_CLASS_CANDIDATES,
|
|
102
114
|
Diff: KIT_DIFF_CLASS_CANDIDATES,
|
|
115
|
+
TextDiff: KIT_TEXT_DIFF_CLASS_CANDIDATES,
|
|
103
116
|
Mockup: KIT_MOCKUP_CLASS_CANDIDATES,
|
|
104
117
|
Footer: KIT_FOOTER_CLASS_CANDIDATES,
|
|
105
118
|
PricingTable: KIT_PRICING_TABLE_CLASS_CANDIDATES,
|
|
106
119
|
CodeView: KIT_CODE_VIEW_CLASS_CANDIDATES,
|
|
120
|
+
JsonView: KIT_JSON_VIEW_CLASS_CANDIDATES,
|
|
121
|
+
MarkdownView: KIT_MARKDOWN_VIEW_CLASS_CANDIDATES,
|
|
107
122
|
ItemList: KIT_ITEM_LIST_CLASS_CANDIDATES,
|
|
108
123
|
SystemSwitcher: KIT_SYSTEM_SWITCHER_CLASS_CANDIDATES,
|
|
109
124
|
Calendar: KIT_CALENDAR_CLASS_CANDIDATES,
|
|
@@ -117,6 +132,9 @@ const DATA_COMPONENT_CANDIDATES: Readonly<Record<string, readonly string[]>> = {
|
|
|
117
132
|
RowEditor: KIT_ROW_EDITOR_CLASS_CANDIDATES,
|
|
118
133
|
RecordPicker: KIT_RECORD_PICKER_CLASS_CANDIDATES,
|
|
119
134
|
NoticeList: KIT_NOTICE_LIST_CLASS_CANDIDATES,
|
|
135
|
+
SegmentedSwitch: KIT_PANEL_HEAD_CLASS_CANDIDATES,
|
|
136
|
+
MetaAction: KIT_PANEL_HEAD_CLASS_CANDIDATES,
|
|
137
|
+
ScopeSwitch: KIT_PANEL_HEAD_CLASS_CANDIDATES,
|
|
120
138
|
AsyncResultPanel: KIT_ASYNC_RESULT_CLASS_CANDIDATES,
|
|
121
139
|
ResultPanel: KIT_RESULT_PANEL_CLASS_CANDIDATES,
|
|
122
140
|
RequestConsole: KIT_REQUEST_CONSOLE_CLASS_CANDIDATES,
|
|
@@ -228,7 +246,6 @@ const SCOPE_CLASS = /^soma-scope-[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
|
228
246
|
* 只放行真源里的闭集宽度(档位、收起、抽屉,外加继承侧栏的最窄归档 176),其余 w-[Npx] 照旧交引擎拒收,
|
|
229
247
|
* 不给「任意值禁用」开口子。
|
|
230
248
|
*/
|
|
231
|
-
const SIDEBAR_PX_CLASS = /^w-\[(\d+)px\]$/;
|
|
232
249
|
const SIDEBAR_LEGACY_MIN_PX = 176;
|
|
233
250
|
const SIDEBAR_PX_ALLOWED: ReadonlySet<number> = new Set<number>([
|
|
234
251
|
...Object.values(KIT_WORKSPACE_FRAME_LIMITS.sidebarTiers.widthPx as Record<string, number>),
|
|
@@ -238,24 +255,59 @@ const SIDEBAR_PX_ALLOWED: ReadonlySet<number> = new Set<number>([
|
|
|
238
255
|
]);
|
|
239
256
|
|
|
240
257
|
/**
|
|
241
|
-
*
|
|
242
|
-
*
|
|
258
|
+
* 通用尺寸阶梯上的固定 px 类(kit-limits#sizeSpec):宽度模数阶梯上的宽 w-[Npx] / max-w-[Npx]、条带阶梯上的高 h-[Npx]、面内边距 p-[Npx] / px-[Npx];
|
|
259
|
+
* 注入器只认识「阶梯允许的值」,不认识是哪个构件在用(窗口、抽屉、侧栏、面板读的是同一份阶梯);闭集外的值照旧交引擎拒收。
|
|
260
|
+
* 可带任意 `group-data-<属性>:` 变体(选择器 = 带该属性的 group 祖先之内,同 Tailwind 的 group-data 变体语义)。
|
|
243
261
|
*/
|
|
244
|
-
|
|
245
|
-
const
|
|
246
|
-
|
|
262
|
+
// 表单控件宽度档(content-layout#formFieldWidth 阶梯换算 px,KT-K-form-8)同属闭集
|
|
263
|
+
const WIDTH_PX_ALLOWED: ReadonlySet<number> = new Set<number>([...SIDEBAR_PX_ALLOWED, ...(KIT_SIZE_SPEC.ladders.width as readonly number[]), KIT_SIZE_SPEC.field.labelColPx, ...KIT_FORM_FIELD_WIDTH_STEPS.map((s) => s.px)]);
|
|
264
|
+
/** 上偏移(top):只有页边距闭集(sizeSpec.inset.pageMarginPx,轻提示与页头标题行顶对齐,KT-K-feedback-2) */
|
|
265
|
+
const TOP_PX_ALLOWED: ReadonlySet<number> = new Set<number>(Object.values(KIT_SIZE_SPEC.inset.pageMarginPx as Record<string, number>));
|
|
266
|
+
const STRIP_H_PX_ALLOWED: ReadonlySet<number> = new Set<number>(
|
|
267
|
+
Object.values(KIT_SIZE_SPEC.strip).flatMap((v) => (typeof v === 'number' ? [v] : Object.values(v as Record<string, number>))),
|
|
268
|
+
);
|
|
269
|
+
const INSET_PX_ALLOWED: ReadonlySet<number> = new Set<number>([
|
|
270
|
+
KIT_SIZE_SPEC.inset.surfacePx, ...Object.values(KIT_SIZE_SPEC.inset.groupPx as Record<string, number>),
|
|
271
|
+
]);
|
|
247
272
|
|
|
248
|
-
/**
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
273
|
+
/** 上 / 下留白(pt / pb):间距阶梯 + 浮层顶边(overlay.topPx,窗口顶边固定在内容面上沿下的距离;底部留白 bottomGapPx 在间距阶梯上) */
|
|
274
|
+
const GAP_PX_ALLOWED: ReadonlySet<number> = new Set<number>([...(KIT_SIZE_SPEC.ladders.spacing as readonly number[]), KIT_OVERLAY_LIMITS.topPx]);
|
|
275
|
+
|
|
276
|
+
/** 最大高(max-h):只有下拉 / 菜单面板的最大高闭集(kit-limits#dropdown.clamps:内边距 + (整数行 + 半行) × 菜单项行高,AR42) */
|
|
277
|
+
const MAX_H_PX_ALLOWED: ReadonlySet<number> = new Set<number>(KIT_DROPDOWN_LIMITS.clamps.map((c) => c.px as number));
|
|
278
|
+
|
|
279
|
+
type FixedPxProp = 'width' | 'max-width' | 'height' | 'min-height' | 'max-height' | 'padding' | 'padding-inline' | 'padding-top' | 'padding-bottom' | 'top';
|
|
280
|
+
const FIXED_PX_CLASS = /^(?:group-data-([a-z][a-z0-9-]*):)?(?:@([a-z0-9]+):)?(w|max-w|h|min-h|max-h|p|px|pt|pb|top)-\[(\d+)px\]$/;
|
|
281
|
+
const FIXED_PX_CSS: Readonly<Record<string, FixedPxProp>> = { w: 'width', 'max-w': 'max-width', h: 'height', 'min-h': 'min-height', 'max-h': 'max-height', p: 'padding', px: 'padding-inline', pt: 'padding-top', pb: 'padding-bottom', top: 'top' };
|
|
282
|
+
const FIXED_PX_PREFIX: Readonly<Record<FixedPxProp, string>> = { width: 'w', 'max-width': 'max-w', height: 'h', 'min-height': 'min-h', 'max-height': 'max-h', padding: 'p', 'padding-inline': 'px', 'padding-top': 'pt', 'padding-bottom': 'pb', top: 'top' };
|
|
283
|
+
/** 容器档名 → rem(adaptive#/containerTiers,经排布引擎):`@<档>:` 变体只认这些档名,与 Tailwind 容器查询变体同一组断点 */
|
|
284
|
+
const CONTAINER_TIER_REM: ReadonlyMap<string, number> = new Map(arrangeTiers().map((t) => [t.name, t.rem]));
|
|
285
|
+
|
|
286
|
+
type FixedPxHit = { prop: FixedPxProp; px: number; variantAttr: string | null; tier: string | null };
|
|
287
|
+
|
|
288
|
+
/** 是 kit 自注入的闭集 px 类则回 `{ prop, px }`(prop 为 CSS 属性名),否则 null。可带 `@<容器档>:` 变体(容器宽不小于该档时生效)。 */
|
|
289
|
+
export function fixedPxClassOf(candidate: string): FixedPxHit | null {
|
|
290
|
+
const m = FIXED_PX_CLASS.exec(candidate);
|
|
256
291
|
if (m === null) return null;
|
|
257
|
-
const
|
|
258
|
-
|
|
292
|
+
const tier = m[2] ?? null;
|
|
293
|
+
if (tier !== null && !CONTAINER_TIER_REM.has(tier)) return null;
|
|
294
|
+
const prop = FIXED_PX_CSS[m[3]!]!;
|
|
295
|
+
const px = Number(m[4]);
|
|
296
|
+
const ok = prop === 'width' || prop === 'max-width' ? WIDTH_PX_ALLOWED.has(px)
|
|
297
|
+
: prop === 'height' || prop === 'min-height' ? STRIP_H_PX_ALLOWED.has(px)
|
|
298
|
+
: prop === 'max-height' ? MAX_H_PX_ALLOWED.has(px)
|
|
299
|
+
: prop === 'padding-top' || prop === 'padding-bottom' ? GAP_PX_ALLOWED.has(px)
|
|
300
|
+
: prop === 'top' ? TOP_PX_ALLOWED.has(px)
|
|
301
|
+
: INSET_PX_ALLOWED.has(px);
|
|
302
|
+
return ok ? { prop, px, variantAttr: m[1] ?? null, tier } : null;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/** 一条自注入规则:类名按 CSS 转义(`:` `@` `[` `]`),group-data 变体落在祖先属性选择器下,容器档变体包一层容器查询 */
|
|
306
|
+
function fixedPxRule(hit: FixedPxHit): string {
|
|
307
|
+
const { prop, px, variantAttr, tier } = hit;
|
|
308
|
+
const cls = `${variantAttr === null ? '' : `group-data-${variantAttr}\\:`}${tier === null ? '' : `\\@${tier}\\:`}${FIXED_PX_PREFIX[prop]}-\\[${px}px\\]`;
|
|
309
|
+
const rule = `${variantAttr === null ? '' : `:where(.group)[data-${variantAttr}] `}.${cls} { ${prop}: ${px}px; }`;
|
|
310
|
+
return tier === null ? rule : `@container (width >= ${CONTAINER_TIER_REM.get(tier)!}rem) { ${rule} }`;
|
|
259
311
|
}
|
|
260
312
|
|
|
261
313
|
let defaultStyleEngine: SomaStyleEngine | undefined;
|
|
@@ -283,7 +335,7 @@ export async function compileStyles(candidates: readonly string[], app: KitAppCo
|
|
|
283
335
|
// group / peer(含具名 group/x、peer/x)只是变体锚点标记,本身不产生任何样式规则;
|
|
284
336
|
// 它们留在 HTML 上给 group-hover: / peer-checked: 等变体用,不交样式引擎(否则按 no-rule 拒收)。
|
|
285
337
|
// 侧栏闭集 px 宽度类(w-[Npx])不交样式引擎(core 禁任意值),由 kit 自行注入;闭集外的任意值仍交引擎拒收。
|
|
286
|
-
const fixedPx = new Map<string,
|
|
338
|
+
const fixedPx = new Map<string, FixedPxHit>();
|
|
287
339
|
for (const c of candidates) {
|
|
288
340
|
const hit = fixedPxClassOf(c);
|
|
289
341
|
if (hit !== null) fixedPx.set(c, hit);
|
|
@@ -294,20 +346,16 @@ export async function compileStyles(candidates: readonly string[], app: KitAppCo
|
|
|
294
346
|
// 块级主题的作用域变量块紧跟整站令牌块(同为令牌层),在主题头之前
|
|
295
347
|
const res = await engine.compile({ themeCss: `${app.themeTokensCss ?? ''}${blockThemeCss}${app.themeCss}`, candidates: styled, allow: allowCandidate });
|
|
296
348
|
if (sidebarPx.length === 0) return { css: res.css, digest: res.digest, diagnostics: [] };
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
//
|
|
302
|
-
const
|
|
303
|
-
|
|
304
|
-
return pxs.length === 0 ? '' : `${tag}${pxs.join('-')}`;
|
|
305
|
-
};
|
|
306
|
-
// 摘要是样式表的注入键(同键只落一张 <style>)与页面版本的一部分:自注入的规则必须算进去,
|
|
307
|
-
// 否则两张页引擎候选类相同、侧栏宽度不同时会共用一个键,后到的那张拿不到自己的宽度规则。
|
|
349
|
+
// 无变体的规则在前、容器档变体在后(同特异度,后者在容器够宽时覆盖前者)
|
|
350
|
+
const sidebarCss = sidebarPx.map((c) => fixedPx.get(c)!).sort((a, b) => Number(a.tier !== null) - Number(b.tier !== null)).map(fixedPxRule).join('\n');
|
|
351
|
+
// 摘要是样式表的注入键(同键只落一张 <style>,core 要求 key 为 1..128 位字符串)与页面版本的一部分:自注入的规则必须算进去,
|
|
352
|
+
// 否则两张页引擎候选类相同、固定尺寸不同时会共用一个键,后到的那张拿不到自己的规则。
|
|
353
|
+
// 后缀取自注入规则文本的短哈希:定长、稳定,不随类数量增长(旧做法把每个 px 值拼进键里,类一多键就超 128)。
|
|
354
|
+
const { createHash } = await import('node:crypto');
|
|
355
|
+
const fixedDigest = createHash('sha256').update(sidebarCss).digest('hex').slice(0, 8);
|
|
308
356
|
return {
|
|
309
357
|
css: res.css ? `${res.css}\n${sidebarCss}` : sidebarCss,
|
|
310
|
-
digest: `${res.digest}
|
|
358
|
+
digest: `${res.digest}-f${fixedDigest}`,
|
|
311
359
|
diagnostics: [],
|
|
312
360
|
};
|
|
313
361
|
} catch (error) {
|
package/src/compile/types.ts
CHANGED
|
@@ -48,13 +48,15 @@ export interface KitTabDecl {
|
|
|
48
48
|
|
|
49
49
|
/** 解析后的页面声明 */
|
|
50
50
|
export interface KitPageDecl {
|
|
51
|
-
page: { url: string; title: string; subtitle?: string; eyebrow?: string; roles?: string[]; breadcrumbs?: Array<{ label: string; href?: string }>; redirect?: KitRedirectDecl; params?: Record<string, Record<string, unknown>>; query?: Record<string, Record<string, unknown>>; locale?: string; dir?: 'ltr' | 'rtl'; theme?: string | Record<string, unknown>; envelope?: import('../
|
|
51
|
+
page: { url: string; title: string; subtitle?: string; eyebrow?: string; roles?: string[]; breadcrumbs?: Array<{ label: string; href?: string }>; redirect?: KitRedirectDecl; params?: Record<string, Record<string, unknown>>; query?: Record<string, Record<string, unknown>>; locale?: string; dir?: 'ltr' | 'rtl'; theme?: string | Record<string, unknown>; envelope?: import('../shared/envelope').KitEnvelope; inheritLayout?: boolean; view?: string } & Pick<import('../frames/types').KitPageMeta, 'actions' | 'back' | 'status' | 'statusFollow' | 'maxWidth' | 'sticky'>;
|
|
52
52
|
frame: {
|
|
53
53
|
kind: string;
|
|
54
54
|
/** 页面是否显式声明了 frame.kind(未显式声明时可继承 kit.app.yaml#layout.frame) */
|
|
55
55
|
explicitKind?: boolean;
|
|
56
56
|
class?: string;
|
|
57
57
|
slotClass?: Record<string, string>;
|
|
58
|
+
/** 内容区通栏(`frame.bleed`,缺省 false;未写时可继承 `kit.app.yaml#layout.bleed`) */
|
|
59
|
+
bleed?: boolean;
|
|
58
60
|
/** 页面框自己的配置(目前只有 workspace-frame 用);键与限值见真源 workspaceFrame */
|
|
59
61
|
config?: Record<string, unknown>;
|
|
60
62
|
/** 槽名 -> 产品;tabs 槽是页签数组 */
|
|
@@ -69,13 +71,13 @@ export interface KitAppContext {
|
|
|
69
71
|
/** 已登记基础组件名:内置 13 + 应用 App* */
|
|
70
72
|
registeredComponents: ReadonlySet<string>;
|
|
71
73
|
/** 写死形状数据组件契约:内置 Tree / StatGroup / Pager + 应用 App* */
|
|
72
|
-
staticComponents: Record<string, { accept: 'single' | 'list'; emits?: readonly string[]; props?: readonly string[]; propTypes?: Readonly<Record<string, string
|
|
74
|
+
staticComponents: Record<string, { accept: 'single' | 'list'; emits?: readonly string[]; props?: readonly string[]; propTypes?: Readonly<Record<string, string>>; composition?: 'summary' | 'subject' | 'control' | 'note' }>;
|
|
73
75
|
/** 主题头 CSS(kit.app.yaml 的 style: 或内置 kit-theme.css) */
|
|
74
76
|
themeCss: string;
|
|
75
77
|
/** 令牌 CSS(soma-foundation 求解的 `:root` 亮色 + 暗色块),拼在主题头前面;缺省不拼(测试可不给) */
|
|
76
78
|
themeTokensCss?: string;
|
|
77
79
|
/** 业务信封约定(规整后的 kit.app.yaml#envelope):页面 page.envelope 可覆写;编进 core 数据声明的 failWhen / messagePath,也交给详情预取 */
|
|
78
|
-
envelope?: import('../
|
|
80
|
+
envelope?: import('../shared/envelope').KitEnvelope;
|
|
79
81
|
/** 整站主题声明(规整后的 kit.app.yaml#theme):块级主题求解以它为页面基底;缺省走 foundation 默认 */
|
|
80
82
|
themeConfig?: import('../theme/theme-tokens').KitThemeConfig;
|
|
81
83
|
/** 整站 9 维正交主题声明(规整后的 kit.app.yaml#theme) */
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
// KitAccessGate:页面级「无权访问」聚合(layer: data,常驻;编译器给带读接口的页面补一个宿主,见 compile/access-gate-attach.ts)。
|
|
2
|
+
//
|
|
3
|
+
// 规则(状态码集合真源 kit-limits#accessState,分流判据 foundation arrangeReadFailure):
|
|
4
|
+
// · 页面任一读接口返回 403 → 整页收成一个「无权访问」状态:一个标题 + 一句需要什么权限(服务端给的原文,去掉 HTTP 状态码前缀);
|
|
5
|
+
// 无重试、无主操作(页面框整块隐藏)、不出现状态码字样,不再逐面板报错;
|
|
6
|
+
// · 401 不在这里聚合(沿用现有登录流程);其它读错误(5xx / 网络 / 404)各面板自己给重试。
|
|
7
|
+
// 只读数据对象上 core 挂的读状态(readState / errorStatus / errorMessage)决定呈现,不改任何权限判定、不碰会话与鉴权。
|
|
8
|
+
// 只在首次读取期间判:全部读接口都落定一次后「关闸」,之后(如抽屉里懒读的详情 403)不再把整页收起。
|
|
9
|
+
|
|
10
|
+
import type { SomaComponentDefinition } from 'soma-core';
|
|
11
|
+
import { arrangeReadFailure } from 'soma-foundation/arrange/table';
|
|
12
|
+
import { KIT_ACCESS_STATE_LIMITS } from 'soma-foundation/kit-limits';
|
|
13
|
+
import { splitHttpErrorPrefix, kitStatePanel } from '../base/state-panel';
|
|
14
|
+
import { CLASS_PROP, createKitController } from '../base/shared';
|
|
15
|
+
import { kitText } from '../i18n/kit-text';
|
|
16
|
+
import { KIT_STATE_DENIED_PAGE, KIT_STATE_DENIED_TITLE, KIT_STATE_DENIED_WRAP } from '../recipes/placeholder';
|
|
17
|
+
|
|
18
|
+
/** 状态码集合真源(kit-limits#accessState):这里再导出,供编译期 / 测试对账;判据本身在 foundation arrangeReadFailure */
|
|
19
|
+
export { KIT_ACCESS_STATE_LIMITS };
|
|
20
|
+
|
|
21
|
+
interface ReadMeta { readState?: unknown; errorStatus?: unknown; errorMessage?: unknown }
|
|
22
|
+
interface DataPortLike { getObject?: (name: string) => unknown }
|
|
23
|
+
|
|
24
|
+
const FRAME_SELECTOR = ':scope > [data-soma-id$="frame__root"]';
|
|
25
|
+
const SHOWN_ATTR = 'data-kit-access-denied';
|
|
26
|
+
|
|
27
|
+
/** 数据对象上 core 挂的读状态(没有 = 还没落定) */
|
|
28
|
+
function metaOf(port: DataPortLike | undefined, name: string): ReadMeta | null {
|
|
29
|
+
const v = port?.getObject?.(name);
|
|
30
|
+
if (Array.isArray(v)) return { readState: 'ready' }; // 读成功的行数组(读状态挂不到数组上):已落定且没失败
|
|
31
|
+
return v !== null && typeof v === 'object' ? v as ReadMeta : null;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** 判定(纯函数):被读状态判成「整页无权访问」的对象的错误原文;没有 = null。unsettled = 仍有读接口没落定 */
|
|
35
|
+
export function accessDeniedOf(metas: ReadonlyArray<ReadMeta | null>): { message: string | null; unsettled: boolean } {
|
|
36
|
+
const unsettled = metas.some((m) => m === null || m.readState === 'loading');
|
|
37
|
+
for (const m of metas) {
|
|
38
|
+
if (m === null || m.readState !== 'forbidden') continue;
|
|
39
|
+
const status = typeof m.errorStatus === 'number' ? m.errorStatus : undefined;
|
|
40
|
+
// core 的 forbidden 同时装 401 与 403:没有状态码按 403 记(core 同口径:errorStatus ?? 403)
|
|
41
|
+
if (arrangeReadFailure(status ?? 403) === 'denied') return { message: typeof m.errorMessage === 'string' ? m.errorMessage : '', unsettled };
|
|
42
|
+
}
|
|
43
|
+
return { message: null, unsettled };
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function createKitAccessGate(): SomaComponentDefinition {
|
|
47
|
+
return {
|
|
48
|
+
contract: {
|
|
49
|
+
name: 'KitAccessGate',
|
|
50
|
+
layer: 'data',
|
|
51
|
+
props: {
|
|
52
|
+
objects: { type: 'array', default: [], desc: '本页带读接口的数据对象名(编译器写入)' },
|
|
53
|
+
class: CLASS_PROP,
|
|
54
|
+
},
|
|
55
|
+
emits: {},
|
|
56
|
+
},
|
|
57
|
+
services: ['data'],
|
|
58
|
+
templateHtml: '<div data-soma-id="root" hidden></div>',
|
|
59
|
+
controllerFactory: createKitController((api) => {
|
|
60
|
+
let armed = true;
|
|
61
|
+
let hiddenFrame: HTMLElement | null = null;
|
|
62
|
+
let rootEl: HTMLElement | null = null;
|
|
63
|
+
const port = (): DataPortLike | undefined => (api.services as { data?: DataPortLike } | undefined)?.data;
|
|
64
|
+
|
|
65
|
+
const restore = (root: HTMLElement): void => {
|
|
66
|
+
if (hiddenFrame !== null) { hiddenFrame.hidden = false; hiddenFrame = null; }
|
|
67
|
+
root.hidden = true;
|
|
68
|
+
root.className = '';
|
|
69
|
+
root.removeAttribute(SHOWN_ATTR);
|
|
70
|
+
root.textContent = '';
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
const evaluate = (root: HTMLElement): void => {
|
|
74
|
+
const raw = api.props().objects;
|
|
75
|
+
const names = Array.isArray(raw) ? raw.filter((x): x is string => typeof x === 'string') : [];
|
|
76
|
+
const verdict = accessDeniedOf(names.map((n) => metaOf(port(), n)));
|
|
77
|
+
if (verdict.message !== null && armed) {
|
|
78
|
+
const doc = root.ownerDocument;
|
|
79
|
+
const text = splitHttpErrorPrefix(verdict.message).text;
|
|
80
|
+
const title = kitText('soma.kit.result_403', undefined, root);
|
|
81
|
+
const hint = text !== '' ? text : kitText('soma.kit.result_403_hint', undefined, root);
|
|
82
|
+
const panel = kitStatePanel(doc, 'denied', { text: `${title}\n${hint}` });
|
|
83
|
+
panel.className = KIT_STATE_DENIED_PAGE;
|
|
84
|
+
// 标题 + 说明两级字号(标题走区块标题字阶,说明沿用次要色小字),标题不带句号
|
|
85
|
+
const head = panel.firstElementChild;
|
|
86
|
+
if (head instanceof HTMLElement) { head.className = KIT_STATE_DENIED_TITLE; head.textContent = (head.textContent ?? '').replace(/[。.\s]+$/, ''); }
|
|
87
|
+
root.className = KIT_STATE_DENIED_WRAP;
|
|
88
|
+
root.replaceChildren(panel);
|
|
89
|
+
root.setAttribute(SHOWN_ATTR, '');
|
|
90
|
+
root.hidden = false;
|
|
91
|
+
const frame = api.host.parentElement?.querySelector<HTMLElement>(FRAME_SELECTOR) ?? null;
|
|
92
|
+
if (frame !== null) { frame.hidden = true; hiddenFrame = frame; }
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
if (verdict.message === null) {
|
|
96
|
+
if (!verdict.unsettled) armed = false;
|
|
97
|
+
if (root.hasAttribute(SHOWN_ATTR)) restore(root);
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
return {
|
|
102
|
+
attach(root) {
|
|
103
|
+
rootEl = root;
|
|
104
|
+
evaluate(root);
|
|
105
|
+
return () => { if (hiddenFrame !== null) hiddenFrame.hidden = false; rootEl = null; };
|
|
106
|
+
},
|
|
107
|
+
render(root) { evaluate(root); },
|
|
108
|
+
onDataObjectsChange() { if (rootEl !== null) evaluate(rootEl); },
|
|
109
|
+
};
|
|
110
|
+
}),
|
|
111
|
+
};
|
|
112
|
+
}
|
|
@@ -9,6 +9,9 @@ import type { SomaComponentDefinition } from 'soma-core';
|
|
|
9
9
|
import { kitText } from '../i18n/kit-text';
|
|
10
10
|
import { createKitController, formatValue, joinClass, num, str } from '../base/shared';
|
|
11
11
|
import { applyKitReadState, KIT_READ_STATE_EMIT_DEFS, KIT_READ_STATE_PROP_DEFS } from '../base/state-panel';
|
|
12
|
+
import { kitTypographyRecipe } from '../recipes/typography';
|
|
13
|
+
import { mergeClass } from '../shared/merge-class';
|
|
14
|
+
import { KIT_DIVIDER_FOOT_CLASS } from '../recipes/divider';
|
|
12
15
|
import {
|
|
13
16
|
actionButton, BUTTON_CLASS_TOKENS, classTokens, emptyNode, keyMap, mk, recOf, rowsOf, shapeToneOf, textOf, TONE_SOFT,
|
|
14
17
|
type ShapeTone,
|
|
@@ -17,9 +20,10 @@ import {
|
|
|
17
20
|
export const KIT_AMOUNT_DEFAULT_MAP = Object.freeze({ id: 'id', label: 'label', amount: 'amount', level: 'level', tone: 'tone', note: 'note', total: 'total' });
|
|
18
21
|
|
|
19
22
|
const ROOT_CLASS = 'flex flex-col gap-1 text-sm text-fg';
|
|
20
|
-
const TITLE_CLASS = 'pb-1
|
|
23
|
+
const TITLE_CLASS = mergeClass('pb-1', kitTypographyRecipe('sectionTitle'));
|
|
21
24
|
const ROW_CLASS = 'flex items-start justify-between gap-4 py-1';
|
|
22
|
-
|
|
25
|
+
// 合计行上方的线 = 分隔线出口(KT-B5)
|
|
26
|
+
const ROW_TOTAL = `flex items-start justify-between gap-4 ${KIT_DIVIDER_FOOT_CLASS} pt-2 text-base font-semibold`;
|
|
23
27
|
const LEFT_CLASS = 'flex flex-col gap-0.5';
|
|
24
28
|
const INDENT: readonly string[] = Object.freeze(['ps-0', 'ps-4', 'ps-8', 'ps-12']);
|
|
25
29
|
const LABEL_CLASS = 'text-fg';
|
package/src/data/anchor-nav.ts
CHANGED
|
@@ -11,10 +11,13 @@ import { KIT_STATIC_COMPONENT_LIMITS } from 'soma-foundation/kit-limits';
|
|
|
11
11
|
import { kitText } from '../i18n/kit-text';
|
|
12
12
|
import { createKitController, joinClass, num, str } from '../base/shared';
|
|
13
13
|
import { classSet, FOCUS_INSET, h, recList, textOf, type Rec } from './menu-dom';
|
|
14
|
+
import { kitDividerRecipe } from '../recipes/divider';
|
|
14
15
|
|
|
15
16
|
const ROOT_CLASS = 'flex flex-col gap-2 text-sm';
|
|
16
17
|
const TITLE_CLASS = 'text-xs font-semibold text-fg-subtle';
|
|
17
|
-
|
|
18
|
+
// 锚点列表的导轨线 = 分隔线出口(发丝宽、分隔灰);当前项竖条是强调指示(border-primary)
|
|
19
|
+
const RAIL_LINE = kitDividerRecipe('start');
|
|
20
|
+
const LIST_CLASS = `flex flex-col ${RAIL_LINE}`;
|
|
18
21
|
const LINK_CLASS = `-ms-px block cursor-pointer truncate border-s-2 border-transparent py-1 ps-3 text-fg-muted transition-colors hover:text-fg ${FOCUS_INSET}`;
|
|
19
22
|
const LINK_L2_CLASS = `-ms-px block cursor-pointer truncate border-s-2 border-transparent py-1 ps-6 text-fg-muted transition-colors hover:text-fg ${FOCUS_INSET}`;
|
|
20
23
|
const LINK_ACTIVE_CLASS = `-ms-px block cursor-pointer truncate border-s-2 border-primary py-1 ps-3 font-medium text-primary-on-soft ${FOCUS_INSET}`;
|
|
@@ -10,8 +10,12 @@
|
|
|
10
10
|
|
|
11
11
|
import type { SomaComponentDefinition } from 'soma-core';
|
|
12
12
|
import { bool, createKitController, formatValue, joinClass, str } from '../base/shared';
|
|
13
|
-
import { kitIcon, type KitIconName } from '../
|
|
13
|
+
import { kitIcon, type KitIconName } from '../shared/icons';
|
|
14
14
|
import { kitText, type KitTextKey } from '../i18n/kit-text';
|
|
15
|
+
import { markKitEdge } from '../recipes/surface-edge';
|
|
16
|
+
import { kitShellRecipe } from '../recipes/container';
|
|
17
|
+
import { kitControlEdgeRecipe } from '../recipes/control';
|
|
18
|
+
import { kitTypographyRecipe } from '../recipes/typography';
|
|
15
19
|
import {
|
|
16
20
|
actionButton, actionsOf, BADGE_BASE, classTokens, BUTTON_CLASS_TOKENS, emptyNode, keyMap, mk, recOf, rowsOf, textOf,
|
|
17
21
|
TONE_DOT, TONE_SOFT, TONE_SOLID, type ShapeTone,
|
|
@@ -55,10 +59,13 @@ const BLOCKED_TONE: Readonly<Record<string, ShapeTone>> = Object.freeze({
|
|
|
55
59
|
/** 缺原因要显式说「未说明原因」的步骤状态;rejected 不在内(存量口径:只在给了原因时才显示) */
|
|
56
60
|
const NEEDS_REASON: readonly KitApprovalStatus[] = Object.freeze(['blocked', 'returned', 'withdrawn']);
|
|
57
61
|
|
|
58
|
-
|
|
62
|
+
// 外缘 = 壳配方(容器边,KT-B2);待办节点圆点外圈 = 控件轮廓(KT-B1)
|
|
63
|
+
const ROOT_EDGE = kitShellRecipe({ tone: 'base', shadow: false });
|
|
64
|
+
const DOT_EDGE = kitControlEdgeRecipe({ wrapper: true, hover: false });
|
|
65
|
+
const ROOT_CLASS = `flex flex-col gap-4 ${ROOT_EDGE} p-5 text-sm text-fg`;
|
|
59
66
|
const HEAD_CLASS = 'flex flex-col gap-1';
|
|
60
67
|
const HEAD_ROW = 'flex flex-wrap items-center gap-2';
|
|
61
|
-
const TITLE_CLASS = '
|
|
68
|
+
const TITLE_CLASS = kitTypographyRecipe('sectionTitle');
|
|
62
69
|
const META_CLASS = 'text-fg-muted';
|
|
63
70
|
const SUMMARY_CLASS = 'text-fg';
|
|
64
71
|
const BANNER_BASE = 'flex flex-col gap-1 rounded-md px-3 py-2';
|
|
@@ -67,7 +74,7 @@ const LIST_CLASS = 'flex flex-col';
|
|
|
67
74
|
const ITEM_CLASS = 'flex gap-3';
|
|
68
75
|
const RAIL_CLASS = 'flex flex-col items-center gap-1';
|
|
69
76
|
const DOT_CLASS = 'flex size-6 shrink-0 items-center justify-center rounded-full text-xs font-semibold';
|
|
70
|
-
const PENDING_DOT =
|
|
77
|
+
const PENDING_DOT = `${DOT_EDGE} bg-surface text-fg-subtle`;
|
|
71
78
|
const LINE_CLASS = 'min-h-4 w-0.5 flex-1 rounded-full bg-border-subtle';
|
|
72
79
|
const BODY_CLASS = 'flex flex-1 flex-col gap-1 pb-4';
|
|
73
80
|
const NAME_ROW = 'flex flex-wrap items-center gap-x-2 gap-y-1';
|
|
@@ -149,7 +156,7 @@ export function createApprovalFlow(): SomaComponentDefinition {
|
|
|
149
156
|
step: { payload: { id: { type: 'string' } }, desc: '点步骤名(selectable 时),供页面打开详情' },
|
|
150
157
|
},
|
|
151
158
|
},
|
|
152
|
-
templateHtml: `<section data-soma-id="root" class="${ROOT_CLASS}"></section>`,
|
|
159
|
+
templateHtml: `<section data-kit-container="card" data-soma-id="root" class="${ROOT_CLASS}"></section>`,
|
|
153
160
|
controllerFactory: createKitController(() => ({
|
|
154
161
|
attach(root, api) {
|
|
155
162
|
const onClick = (event: Event): void => {
|
|
@@ -170,6 +177,7 @@ export function createApprovalFlow(): SomaComponentDefinition {
|
|
|
170
177
|
},
|
|
171
178
|
render(root, p) {
|
|
172
179
|
root.className = joinClass(ROOT_CLASS, p.class);
|
|
180
|
+
markKitEdge(root);
|
|
173
181
|
root.textContent = '';
|
|
174
182
|
const m = keyMap(KIT_APPROVAL_DEFAULT_MAP, p.map);
|
|
175
183
|
const data = recOf(p.data);
|
|
@@ -26,10 +26,15 @@ import type { SomaComponentDefinition } from 'soma-core';
|
|
|
26
26
|
import { createKeyboardWiring, type CollectionItem } from 'soma-core/keyboard';
|
|
27
27
|
import { SOMA_SIZE_UNITS } from 'soma-foundation/theme';
|
|
28
28
|
import { bool, createKitController, joinClass, num, str } from '../base/shared';
|
|
29
|
-
import { kitIcon } from '../
|
|
29
|
+
import { kitIcon } from '../shared/icons';
|
|
30
30
|
import { markCheckBox } from '../base/check-core';
|
|
31
31
|
import { kitText, type KitTextKey } from '../i18n/kit-text';
|
|
32
32
|
import { kitControlRecipe, setKitFace } from '../recipes';
|
|
33
|
+
import { kitControlEdgeRecipe } from '../recipes/control';
|
|
34
|
+
import { kitDivideRecipe, kitDividerRecipe } from '../recipes/divider';
|
|
35
|
+
import { kitShellRecipe } from '../recipes/container';
|
|
36
|
+
import { kitEmphasisButtonRecipe } from '../recipes/emphasis';
|
|
37
|
+
import { mergeClass } from '../shared/merge-class';
|
|
33
38
|
import {
|
|
34
39
|
KIT_OVERLAY_FOOT_ATTR, KIT_OVERLAY_FORM_FOOTER_CLASS, KIT_OVERLAY_FORM_SCROLL_ATTR, KIT_OVERLAY_ROOT_FILL_CLASS, kitOverlayFormScrollClass,
|
|
35
40
|
} from '../recipes/overlay';
|
|
@@ -37,37 +42,46 @@ import { kitBusyOf, KIT_BUSY_PROP_DEFS } from '../base/action-busy';
|
|
|
37
42
|
import { classTokens, keyMap, mk, recOf } from './shape-util';
|
|
38
43
|
import { envelopeOf } from './permission-tree';
|
|
39
44
|
import { attrEsc } from './d9-util';
|
|
45
|
+
import { markKitEdge } from '../recipes/surface-edge';
|
|
46
|
+
import { kitTypographyRecipe } from '../recipes/typography';
|
|
40
47
|
|
|
41
48
|
// ── 类串表:全部完整写死,不拼接片段 ──
|
|
42
49
|
|
|
43
|
-
const ROOT_CLASS = `@container flex h-full flex-col gap-
|
|
50
|
+
const ROOT_CLASS = `@container flex h-full flex-col gap-3 text-sm text-fg ${KIT_OVERLAY_ROOT_FILL_CLASS}`;
|
|
44
51
|
const HELP_CLASS = 'text-sm text-fg-muted';
|
|
45
52
|
const SUBJECT_CLASS = 'flex flex-wrap items-center gap-4';
|
|
46
53
|
const SUBJECT_ITEM_CLASS = 'flex items-center gap-2';
|
|
47
54
|
const CAPTION_CLASS = 'text-sm text-fg-muted';
|
|
48
55
|
const STRONG_CLASS = 'text-sm font-semibold text-fg';
|
|
49
56
|
const ALERT_CLASS = 'rounded-md bg-danger-soft px-3 py-2 text-sm text-danger-on-soft';
|
|
50
|
-
const GRID_CLASS = 'grid grid-cols-12 gap-
|
|
57
|
+
const GRID_CLASS = 'grid grid-cols-12 gap-3';
|
|
51
58
|
const MAIN_FULL_CLASS = 'col-span-12';
|
|
52
|
-
|
|
53
|
-
const
|
|
59
|
+
// 间距只取 4 的倍数阶梯(尺寸规格 §1;接入核对 C2:10 / 6px 收回 8 / 12)
|
|
60
|
+
const MAIN_INNER_CLASS = 'flex flex-col gap-2';
|
|
61
|
+
const SIDE_TOP_LINE = kitDividerRecipe('top');
|
|
62
|
+
const ROWS_DIVIDE = kitDivideRecipe('y');
|
|
63
|
+
const BOX_EDGE = kitControlEdgeRecipe({ wrapper: true });
|
|
64
|
+
const SIDE_INNER_CLASS = `flex flex-col gap-2 ${SIDE_TOP_LINE} pt-3`;
|
|
54
65
|
const HEAD_CLASS = 'flex items-center justify-between gap-3';
|
|
55
|
-
const TITLE_CLASS = '
|
|
66
|
+
const TITLE_CLASS = kitTypographyRecipe('sectionTitle');
|
|
56
67
|
const SUMMARY_CLASS = 'text-sm text-fg-muted';
|
|
57
68
|
const CHANGES_CLASS = 'text-sm text-fg-muted';
|
|
58
69
|
const TOOLS_CLASS = 'flex flex-wrap items-center gap-2';
|
|
59
|
-
|
|
60
|
-
const
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
const
|
|
65
|
-
const
|
|
66
|
-
const
|
|
67
|
-
const
|
|
68
|
-
const
|
|
70
|
+
// 搜索框 = 标准输入(控件配方,KT-B1 / §4 C6),工具钮与它同高(控件档)
|
|
71
|
+
const SEARCH_CLASS = mergeClass(kitControlRecipe(), 'min-w-40 flex-1');
|
|
72
|
+
const TOOL_BTN_CLASS = kitEmphasisButtonRecipe('button.toolbar');
|
|
73
|
+
// 列表框外缘 = 壳配方(容器边,KT-B2);条目之间的线由父出(kitDivideRecipe,KT-B5);
|
|
74
|
+
// 分组:灰底组头与条目之间、组与组之间已有面差,不再画线(D-30)
|
|
75
|
+
const LIST_CLASS = mergeClass('flex max-h-36 flex-col overflow-y-auto focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring', `${kitShellRecipe({ tone: 'base', shadow: false })} ${kitDivideRecipe('y')}`);
|
|
76
|
+
const GROUP_CLASS = `flex flex-col border-b-0 ${ROWS_DIVIDE}`;
|
|
77
|
+
const GROUP_HEAD_CLASS = 'flex items-center justify-between gap-2 rounded-md bg-surface-sunken px-3 py-1.5 text-xs font-medium text-fg-muted border-b-0';
|
|
78
|
+
const GROUP_BTN_CLASS = kitEmphasisButtonRecipe('button.quiet', { size: 'sm' });
|
|
79
|
+
const ITEM_CLASS = 'flex cursor-pointer items-center gap-3 bg-surface px-3 py-2 text-fg transition-colors state-layer';
|
|
80
|
+
const ITEM_OFF_CLASS = 'flex cursor-not-allowed items-center gap-3 bg-surface px-3 py-2 text-fg-subtle';
|
|
81
|
+
const ITEM_ADDED_CLASS = 'flex cursor-pointer items-center gap-3 bg-success-soft px-3 py-2 text-success-on-soft transition-colors';
|
|
82
|
+
const ITEM_REMOVED_CLASS = 'flex cursor-pointer items-center gap-3 bg-danger-soft px-3 py-2 text-danger-on-soft transition-colors';
|
|
69
83
|
const CURSOR_CLASS = 'ring-2 ring-inset ring-ring';
|
|
70
|
-
const BOX_OFF_CLASS =
|
|
84
|
+
const BOX_OFF_CLASS = `inline-flex size-4 shrink-0 items-center justify-center rounded-md ${BOX_EDGE} bg-surface text-xs`;
|
|
71
85
|
const BOX_ON_CLASS = 'inline-flex size-4 shrink-0 items-center justify-center rounded-md border border-primary bg-primary text-xs text-primary-fg';
|
|
72
86
|
const TEXT_CLASS = 'flex min-w-0 flex-1 flex-col';
|
|
73
87
|
const LABEL_CLASS = 'truncate text-sm';
|
|
@@ -79,13 +93,13 @@ const CHIP_REMOVED_CLASS = 'bg-danger-soft text-danger-on-soft';
|
|
|
79
93
|
const EMPTY_CLASS = 'px-2 py-3 text-sm text-fg-muted';
|
|
80
94
|
const FIELD_LABEL_CLASS = 'flex items-center gap-1 text-sm text-fg';
|
|
81
95
|
const STAR_CLASS = 'text-danger-on-soft';
|
|
82
|
-
const AREA_CLASS =
|
|
96
|
+
const AREA_CLASS = mergeClass(kitControlRecipe({ multiline: true }), 'resize-none');
|
|
83
97
|
const FIELD_ERROR_CLASS = 'text-xs text-danger-on-soft';
|
|
84
98
|
// mt-auto:根随容器拉高时按钮区贴在面板底部,不悬在中间
|
|
85
99
|
const FOOT_CLASS = 'mt-auto flex items-center justify-end gap-2 pt-1';
|
|
86
100
|
// 保存 / 取消(返回):标准高度(32)的实心 / 描边按钮,与对话框底栏、授权树同一配方(原手写 h-9 = 36)
|
|
87
101
|
const SAVE_CLASS = kitControlRecipe({ variant: 'primary' });
|
|
88
|
-
const CANCEL_CLASS =
|
|
102
|
+
const CANCEL_CLASS = kitEmphasisButtonRecipe('button.toolbar');
|
|
89
103
|
|
|
90
104
|
export const KIT_ASSIGNMENT_PICKER_CLASS_CANDIDATES: readonly string[] = classTokens(
|
|
91
105
|
ROOT_CLASS, HELP_CLASS, SUBJECT_CLASS, SUBJECT_ITEM_CLASS, CAPTION_CLASS, STRONG_CLASS, ALERT_CLASS, GRID_CLASS, MAIN_FULL_CLASS,
|
|
@@ -586,6 +600,7 @@ export function createAssignmentPicker(): SomaComponentDefinition {
|
|
|
586
600
|
tools.append(searchBox, allBtn, clearBtn);
|
|
587
601
|
groupBarEl = mk('div', 'hidden');
|
|
588
602
|
listEl = mk('div', LIST_CLASS);
|
|
603
|
+
markKitEdge(listEl);
|
|
589
604
|
listEl.setAttribute('role', 'listbox');
|
|
590
605
|
listEl.tabIndex = 0;
|
|
591
606
|
const mainInner = mk('div', MAIN_INNER_CLASS);
|
|
@@ -595,7 +610,7 @@ export function createAssignmentPicker(): SomaComponentDefinition {
|
|
|
595
610
|
fieldLabel = mk('label', FIELD_LABEL_CLASS);
|
|
596
611
|
area = mk('textarea', AREA_CLASS);
|
|
597
612
|
setKitFace(area, 'field');
|
|
598
|
-
area.rows =
|
|
613
|
+
area.rows = 2;
|
|
599
614
|
const areaId = `${uid}-reason`;
|
|
600
615
|
area.id = areaId;
|
|
601
616
|
fieldLabel.htmlFor = areaId;
|
|
@@ -23,6 +23,10 @@ import { watchKitOutcome, type KitOutcome } from './outcome-watch';
|
|
|
23
23
|
import { KIT_MS_ASIDE_IDLE_ATTR, KIT_MS_ROOT_ATTR } from '../recipes/container';
|
|
24
24
|
import { kitText } from '../i18n/kit-text';
|
|
25
25
|
import { setKitFace } from '../recipes';
|
|
26
|
+
import { kitControlEdgeRecipe } from '../recipes/control';
|
|
27
|
+
|
|
28
|
+
/** 多行输入的边 = 控件轮廓出口(KT-B1 / §4 C6) */
|
|
29
|
+
const AREA_EDGE = kitControlEdgeRecipe();
|
|
26
30
|
import { KIT_BUSY_PROP_DEFS, cancelKitAction, kitBusyOf } from '../base/action-busy';
|
|
27
31
|
import {
|
|
28
32
|
actionButton, BADGE_BASE, BUTTON_CLASS_TOKENS, classTokens, mk, recOf, rowsOf, shapeToneOf, textOf, TONE_SOFT,
|
|
@@ -35,7 +39,7 @@ const TITLE_CLASS = 'text-sm font-semibold text-fg';
|
|
|
35
39
|
const SUBTITLE_CLASS = 'text-xs text-fg-subtle';
|
|
36
40
|
const LABEL_WRAP = 'flex flex-col gap-1';
|
|
37
41
|
const LABEL_CLASS = 'text-xs font-medium text-fg-muted';
|
|
38
|
-
const AREA_CLASS = 'block w-full appearance-none autofill-clear resize-none rounded-md
|
|
42
|
+
const AREA_CLASS = 'block w-full appearance-none autofill-clear resize-none rounded-md ' + AREA_EDGE + ' bg-surface px-3 py-2 text-sm text-fg transition-colors placeholder:text-fg-subtle focus-visible:outline-none focus-visible:border-primary focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-60';
|
|
39
43
|
const BUTTONS_CLASS = 'flex flex-wrap items-center gap-2';
|
|
40
44
|
const MESSAGE_CLASS = 'text-xs text-fg-subtle';
|
|
41
45
|
const MESSAGE_FAILED = 'text-xs text-danger-on-soft';
|
|
@@ -198,7 +202,7 @@ export function createAsyncResultPanel(): SomaComponentDefinition {
|
|
|
198
202
|
},
|
|
199
203
|
},
|
|
200
204
|
services: ['data'],
|
|
201
|
-
templateHtml: `<section data-soma-id="root" class="${ROOT_CLASS}"></section>`,
|
|
205
|
+
templateHtml: `<section data-kit-container="card" data-soma-id="root" class="${ROOT_CLASS}"></section>`,
|
|
202
206
|
controllerFactory: createKitController(() => ({
|
|
203
207
|
busyAware: true,
|
|
204
208
|
attach(root, api) {
|
|
@@ -395,7 +399,7 @@ export function createAsyncResultPanel(): SomaComponentDefinition {
|
|
|
395
399
|
if (quiet) {
|
|
396
400
|
const text = kitText('soma.kit.async_idle', undefined, root);
|
|
397
401
|
if (st.idle === null) {
|
|
398
|
-
st.idle = kitEmptyPanel(document, text
|
|
402
|
+
st.idle = kitEmptyPanel(document, text);
|
|
399
403
|
root.appendChild(st.idle);
|
|
400
404
|
} else if (st.idle.textContent !== text) {
|
|
401
405
|
st.idle.textContent = text;
|