open-grid 1.2.1 → 1.3.0
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/CHANGELOG.md +376 -365
- package/dist/{OpenGrid-0r_543Kj.cjs → OpenGrid-B7m7ei7f.cjs} +1222 -1029
- package/dist/{OpenGrid-HmhGVC2V.js → OpenGrid-CeUdO_fM.js} +1613 -1418
- package/dist/index-CeJ-0-80.cjs +260 -0
- package/dist/index-DnarQ4eR.js +266 -0
- package/dist/index-DrCPRuYi.js +548 -0
- package/dist/index-JjfWY3Bt.cjs +520 -0
- package/dist/open-grid-base.css +12 -1
- package/dist/open-grid-react.cjs +1 -1
- package/dist/open-grid-react.js +1 -1
- package/dist/open-grid-vue.cjs +7 -7
- package/dist/open-grid-vue.js +2 -2
- package/dist/open-grid.cjs +1 -1
- package/dist/open-grid.js +2 -2
- package/dist/types/bench/perf.d.ts +14 -8
- package/dist/types/core/AppearanceResolver.d.ts +98 -11
- package/dist/types/core/CFRenderBridge.d.ts +13 -0
- package/dist/types/core/CellTypeRegistry.d.ts +24 -0
- package/dist/types/core/ColumnLayout.d.ts +100 -2
- package/dist/types/core/CrossGridMapper.d.ts +43 -5
- package/dist/types/core/DataLayer.d.ts +210 -15
- package/dist/types/core/DragVisuals.d.ts +33 -4
- package/dist/types/core/EventEmitter.d.ts +54 -0
- package/dist/types/core/FormulaEngine.d.ts +15 -4
- package/dist/types/core/GridRenderer.d.ts +143 -10
- package/dist/types/core/GroupEngine.d.ts +68 -10
- package/dist/types/core/MathUtils.d.ts +58 -5
- package/dist/types/core/MergeEngine.d.ts +45 -10
- package/dist/types/core/OGDecimal.d.ts +144 -13
- package/dist/types/core/OpenGrid.d.ts +99 -0
- package/dist/types/core/PivotEngine.d.ts +37 -0
- package/dist/types/core/RowDragDrop.d.ts +52 -6
- package/dist/types/core/SkinRegistry.d.ts +4 -0
- package/dist/types/core/TreeEngine.d.ts +60 -6
- package/dist/types/core/VirtualScroll.d.ts +64 -0
- package/dist/types/core/a11y/AccessibilityAdapter.d.ts +103 -0
- package/dist/types/core/a11y/AriaIntent.d.ts +34 -0
- package/dist/types/core/a11y/KeyboardInteractionModel.d.ts +64 -0
- package/dist/types/core/a11y/LiveRegionController.d.ts +89 -0
- package/dist/types/core/a11y/OverlayStack.d.ts +36 -0
- package/dist/types/core/a11y/VisualEquivRegistry.d.ts +37 -0
- package/dist/types/core/a11y/index.d.ts +13 -0
- package/dist/types/core/a11y/ports.d.ts +24 -0
- package/dist/types/core/appearance/Appearance.d.ts +68 -0
- package/dist/types/core/appearance/AppearanceAxis.d.ts +94 -0
- package/dist/types/core/appearance/AppearanceComposer.d.ts +45 -0
- package/dist/types/core/appearance/AppearanceProvider.d.ts +50 -0
- package/dist/types/core/appearance/AppearanceView.d.ts +51 -0
- package/dist/types/core/appearance/DensityRegistry.d.ts +36 -0
- package/dist/types/core/appearance/ResolvedAppearanceSnapshot.d.ts +84 -0
- package/dist/types/core/appearance/TextureRegistry.d.ts +32 -0
- package/dist/types/core/appearance/ThemeMetaRegistry.d.ts +67 -0
- package/dist/types/core/appearance/axisAdapters.d.ts +37 -0
- package/dist/types/core/appearance/defaults.d.ts +10 -0
- package/dist/types/core/appearance/index.d.ts +20 -0
- package/dist/types/core/appearance/tokenCatalog.d.ts +30 -0
- package/dist/types/core/cf/CFEngine.d.ts +56 -0
- package/dist/types/core/cf/CFEvaluator.d.ts +24 -0
- package/dist/types/core/cf/CFRule.d.ts +127 -0
- package/dist/types/core/cf/ColorScale.d.ts +49 -0
- package/dist/types/core/cf/InkResolver.d.ts +33 -0
- package/dist/types/core/cf/appearance.d.ts +20 -0
- package/dist/types/core/cf/encoders.d.ts +61 -0
- package/dist/types/core/cf/eval-types.d.ts +93 -0
- package/dist/types/core/cf/index.d.ts +21 -0
- package/dist/types/core/cf/lineage.d.ts +32 -0
- package/dist/types/core/cf/predicates.d.ts +27 -0
- package/dist/types/core/cf/serialize.d.ts +46 -0
- package/dist/types/core/chart/CanvasAdapter.d.ts +50 -1
- package/dist/types/core/chart/DataExtractor.d.ts +53 -12
- package/dist/types/core/chart/a11y.d.ts +22 -0
- package/dist/types/core/chart/chart-type-registry.d.ts +53 -0
- package/dist/types/core/chart/downsample-report.d.ts +36 -0
- package/dist/types/core/chart/downsample.d.ts +26 -1
- package/dist/types/core/chart/engine/ChartEngineRegistry.d.ts +52 -0
- package/dist/types/core/chart/geometry.d.ts +96 -0
- package/dist/types/core/chart/hittest.d.ts +21 -3
- package/dist/types/core/chart/palette.d.ts +96 -12
- package/dist/types/core/chart/parity.d.ts +12 -0
- package/dist/types/core/chart/provenance.d.ts +47 -0
- package/dist/types/core/chart/scales.d.ts +28 -1
- package/dist/types/core/chart/scene.d.ts +102 -0
- package/dist/types/core/chart/server.d.ts +36 -0
- package/dist/types/core/chart/surfaces/CanvasSurface.d.ts +48 -0
- package/dist/types/core/chart/surfaces/ServerRasterSurface.d.ts +26 -0
- package/dist/types/core/chart/surfaces/SvgSurface.d.ts +24 -0
- package/dist/types/core/chart/surfaces/pattern-overlay.d.ts +24 -0
- package/dist/types/core/command/CommandBus.d.ts +51 -0
- package/dist/types/core/command/CommandRegistry.d.ts +43 -0
- package/dist/types/core/command/CommandStack.d.ts +38 -0
- package/dist/types/core/command/ICommand.d.ts +110 -0
- package/dist/types/core/command/commands/CellWriteCommand.d.ts +32 -0
- package/dist/types/core/command/commands/CompositeCommand.d.ts +17 -0
- package/dist/types/core/command/commands/RowCommands.d.ts +39 -0
- package/dist/types/core/command/index.d.ts +9 -0
- package/dist/types/core/command/support.d.ts +51 -0
- package/dist/types/core/coordinate/ColumnMetrics.d.ts +30 -0
- package/dist/types/core/coordinate/CoordinateKernel.d.ts +88 -0
- package/dist/types/core/coordinate/FrozenPanes.d.ts +29 -0
- package/dist/types/core/coordinate/MergeSourceAdapter.d.ts +18 -0
- package/dist/types/core/coordinate/NodeBudget.d.ts +33 -0
- package/dist/types/core/coordinate/ResizeGovernor.d.ts +50 -0
- package/dist/types/core/coordinate/RowMetrics.d.ts +37 -0
- package/dist/types/core/coordinate/ViewPermutation.d.ts +23 -0
- package/dist/types/core/coordinate/index.d.ts +10 -0
- package/dist/types/core/coordinate/ports.d.ts +45 -0
- package/dist/types/core/coordinate/types.d.ts +76 -0
- package/dist/types/core/detail/DetailGlyph.d.ts +42 -7
- package/dist/types/core/detail/DetailSplice.d.ts +42 -11
- package/dist/types/core/detail/DetailState.d.ts +80 -11
- package/dist/types/core/detail/SubgridCache.d.ts +72 -10
- package/dist/types/core/detail/index.d.ts +8 -0
- package/dist/types/core/domain/AggregateResult.d.ts +54 -0
- package/dist/types/core/domain/CellAddress.d.ts +61 -0
- package/dist/types/core/domain/CellValueAccess.d.ts +29 -0
- package/dist/types/core/domain/Delta.d.ts +37 -0
- package/dist/types/core/domain/DomainValue.d.ts +80 -0
- package/dist/types/core/domain/Missing.d.ts +65 -0
- package/dist/types/core/domain/Money.d.ts +42 -0
- package/dist/types/core/domain/NormalizationBasis.d.ts +47 -0
- package/dist/types/core/domain/Plain.d.ts +45 -0
- package/dist/types/core/domain/Quantity.d.ts +32 -0
- package/dist/types/core/domain/Ratios.d.ts +100 -0
- package/dist/types/core/domain/ThresholdSet.d.ts +46 -0
- package/dist/types/core/domain/ValueType.d.ts +71 -0
- package/dist/types/core/domain/rounding.d.ts +25 -0
- package/dist/types/core/domain/strategies.d.ts +38 -0
- package/dist/types/core/editors/DateEditor.d.ts +18 -0
- package/dist/types/core/editors/SelectEditor.d.ts +29 -0
- package/dist/types/core/export/ChannelRegistry.d.ts +18 -0
- package/dist/types/core/export/ExportManifest.d.ts +13 -0
- package/dist/types/core/export/GridArtifactSource.d.ts +62 -0
- package/dist/types/core/export/Provenance.d.ts +34 -0
- package/dist/types/core/export/StreamPump.d.ts +28 -0
- package/dist/types/core/export/channels/CsvChannel.d.ts +20 -0
- package/dist/types/core/export/channels/JsonChannel.d.ts +18 -0
- package/dist/types/core/export/channels/XlsxChannel.d.ts +53 -0
- package/dist/types/core/export/channels/XmlChannel.d.ts +21 -0
- package/dist/types/core/export/channels/capabilities.d.ts +13 -0
- package/dist/types/core/export/index.d.ts +24 -0
- package/dist/types/core/export/print/OutputChannelAdapter.d.ts +61 -0
- package/dist/types/core/export/print/Paginator.d.ts +48 -0
- package/dist/types/core/export/print/PrintRenderTarget.d.ts +36 -0
- package/dist/types/core/export/sinks.d.ts +40 -0
- package/dist/types/core/export/types.d.ts +211 -0
- package/dist/types/core/extension/DeprecationManager.d.ts +42 -0
- package/dist/types/core/extension/IExtension.d.ts +90 -0
- package/dist/types/core/extension/Registry.d.ts +142 -0
- package/dist/types/core/extension/SlotRegistry.d.ts +46 -0
- package/dist/types/core/extension/adapters.d.ts +44 -0
- package/dist/types/core/extension/conformance.d.ts +47 -0
- package/dist/types/core/extension/index.d.ts +16 -0
- package/dist/types/core/extension/registries.d.ts +31 -0
- package/dist/types/core/extension/reserved.d.ts +10 -0
- package/dist/types/core/format/DisplayFormatter.d.ts +47 -0
- package/dist/types/core/format/FormatCache.d.ts +20 -0
- package/dist/types/core/format/FormatterRegistry.d.ts +22 -0
- package/dist/types/core/format/grammar/AstRenderer.d.ts +10 -0
- package/dist/types/core/format/grammar/FormatCompiler.d.ts +16 -0
- package/dist/types/core/format/index.d.ts +55 -0
- package/dist/types/core/format/pipeline/DomainTypeResolver.d.ts +8 -0
- package/dist/types/core/format/pipeline/LocaleFormat.d.ts +11 -0
- package/dist/types/core/format/pipeline/ValueInterpreter.d.ts +8 -0
- package/dist/types/core/format/policy/MaskPolicy.d.ts +8 -0
- package/dist/types/core/format/policy/NegativePolicy.d.ts +12 -0
- package/dist/types/core/format/policy/NullPolicy.d.ts +10 -0
- package/dist/types/core/format/policy/TruncatePolicy.d.ts +11 -0
- package/dist/types/core/format/types.d.ts +292 -0
- package/dist/types/core/formula/CalcCacheStore.d.ts +89 -0
- package/dist/types/core/formula/CalcProvenance.d.ts +44 -0
- package/dist/types/core/formula/CalcService.d.ts +137 -0
- package/dist/types/core/formula/CyclePathReporter.d.ts +28 -0
- package/dist/types/core/formula/FormulaEvaluator.d.ts +35 -1
- package/dist/types/core/formula/FormulaGraph.d.ts +84 -7
- package/dist/types/core/formula/FormulaParser.d.ts +9 -0
- package/dist/types/core/formula/FormulaStore.d.ts +63 -1
- package/dist/types/core/formula/FunctionRegistry.d.ts +138 -0
- package/dist/types/core/formula/Generation.d.ts +86 -0
- package/dist/types/core/formula/RecalcCoordinator.d.ts +151 -9
- package/dist/types/core/formula/ReferenceRewriter.d.ts +81 -0
- package/dist/types/core/formula/functions/essential.d.ts +3 -0
- package/dist/types/core/formula/functions/extended/index.d.ts +10 -0
- package/dist/types/core/formula/normalizeRefs.d.ts +34 -3
- package/dist/types/core/formula/numericLiteral.d.ts +11 -1
- package/dist/types/core/formula/serializeFormula.d.ts +10 -1
- package/dist/types/core/host/CapabilityRegistry.d.ts +61 -0
- package/dist/types/core/host/GridHostDriver.d.ts +27 -0
- package/dist/types/core/host/GridHostPort.d.ts +37 -0
- package/dist/types/core/host/SliceOwnershipGuard.d.ts +27 -0
- package/dist/types/core/host/archCheck.d.ts +26 -0
- package/dist/types/core/host/index.d.ts +6 -0
- package/dist/types/core/host/reconcile.d.ts +22 -0
- package/dist/types/core/i18n/LocaleContext.d.ts +40 -0
- package/dist/types/core/i18n/types.d.ts +26 -1
- package/dist/types/core/icons/bootstrap-icons.d.ts +4 -2
- package/dist/types/core/quality/ContrastAuditor.d.ts +64 -0
- package/dist/types/core/quality/DeterminismKernel.d.ts +68 -0
- package/dist/types/core/quality/PerfBaseline.d.ts +23 -0
- package/dist/types/core/quality/PerfSpec.d.ts +95 -0
- package/dist/types/core/quality/RealBrowserGate.d.ts +69 -0
- package/dist/types/core/quality/RegressionJudge.d.ts +35 -0
- package/dist/types/core/quality/ReleaseGate.d.ts +94 -0
- package/dist/types/core/quality/VisualRegression.d.ts +74 -0
- package/dist/types/core/quality/hooks.d.ts +53 -0
- package/dist/types/core/quality/index.d.ts +20 -0
- package/dist/types/core/quality/pixelMetrics.d.ts +24 -0
- package/dist/types/core/range/ClipboardCodec.d.ts +46 -4
- package/dist/types/core/range/FillEngine.d.ts +69 -9
- package/dist/types/core/range/RangeModel.d.ts +100 -13
- package/dist/types/core/range/types.d.ts +27 -11
- package/dist/types/core/realtime/BackpressureScheduler.d.ts +0 -0
- package/dist/types/core/realtime/FreshnessClock.d.ts +34 -0
- package/dist/types/core/realtime/IRealtimeSource.d.ts +82 -0
- package/dist/types/core/realtime/LiveStateGuard.d.ts +23 -0
- package/dist/types/core/realtime/PollingSource.d.ts +42 -0
- package/dist/types/core/realtime/RealtimeController.d.ts +54 -0
- package/dist/types/core/realtime/RtAnnouncePolicy.d.ts +53 -0
- package/dist/types/core/realtime/RtApplyCommand.d.ts +29 -0
- package/dist/types/core/realtime/RtChartTargetTrigger.d.ts +26 -0
- package/dist/types/core/realtime/StreamingSource.d.ts +47 -0
- package/dist/types/core/realtime/backoff.d.ts +12 -0
- package/dist/types/core/realtime/index.d.ts +13 -0
- package/dist/types/core/realtime/ports.d.ts +80 -0
- package/dist/types/core/render/CellApplier.d.ts +18 -0
- package/dist/types/core/render/CellErrorBoundary.d.ts +65 -0
- package/dist/types/core/render/CellPipeline.d.ts +39 -0
- package/dist/types/core/render/CellRenderRequest.d.ts +209 -0
- package/dist/types/core/render/CellStageRegistry.d.ts +53 -0
- package/dist/types/core/render/OverlayCompositor.d.ts +38 -0
- package/dist/types/core/render/RenderBudget.d.ts +67 -0
- package/dist/types/core/render/contrast.d.ts +33 -0
- package/dist/types/core/render/index.d.ts +35 -0
- package/dist/types/core/render/stages/BackgroundStage.d.ts +14 -0
- package/dist/types/core/render/stages/DecoratorStage.d.ts +12 -0
- package/dist/types/core/render/stages/OverlayStage.d.ts +12 -0
- package/dist/types/core/render/stages/ValueRendererStage.d.ts +15 -0
- package/dist/types/core/render/stages/index.d.ts +14 -0
- package/dist/types/core/state/AutosaveController.d.ts +63 -0
- package/dist/types/core/state/IStatePersistence.d.ts +59 -0
- package/dist/types/core/state/MultiTabGuard.d.ts +33 -0
- package/dist/types/core/state/SchemaMigrator.d.ts +33 -0
- package/dist/types/core/state/SemVerPolicy.d.ts +39 -0
- package/dist/types/core/state/StateCodec.d.ts +75 -0
- package/dist/types/core/state/index.d.ts +6 -0
- package/dist/types/core/types.d.ts +17 -0
- package/dist/types/react/OpenGrid.d.ts +54 -0
- package/dist/types/react/index.d.ts +5 -0
- package/dist/types/realtime/index.d.ts +1 -0
- package/dist/types/vue/index.d.ts +5 -0
- package/dist/types/vue/types.d.ts +35 -0
- package/package.json +112 -111
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { CellRect } from '../coordinate/index.js';
|
|
2
|
+
import { Delta } from '../domain/Delta.js';
|
|
3
|
+
import { AppearanceResolver } from '../AppearanceResolver.js';
|
|
4
|
+
import { ColumnDef } from '../types.js';
|
|
5
|
+
/** 등록 해제 토큰. / A registration-disposal token. */
|
|
6
|
+
export interface Disposable {
|
|
7
|
+
dispose(): void;
|
|
8
|
+
}
|
|
9
|
+
/** DD-05 조건부서식 규칙 판정(임시 최소형). 배경/데코 단계가 페인트로 옮긴다. */
|
|
10
|
+
export interface RuleVerdict {
|
|
11
|
+
/** 판정이 겨냥하는 시각 채널. / Visual channel the verdict targets. */
|
|
12
|
+
readonly kind: 'background' | 'text' | 'databar' | 'icon' | 'marker';
|
|
13
|
+
/** 색(배경/텍스트/아이콘). / Color (background/text/icon). */
|
|
14
|
+
readonly color?: string;
|
|
15
|
+
/** 데이터바 채움 비율 0..1(클램프 고지는 상류 소유). / Data-bar fill ratio 0..1. */
|
|
16
|
+
readonly ratio?: number;
|
|
17
|
+
/** 아이콘 role/key. / Icon role/key. */
|
|
18
|
+
readonly icon?: string;
|
|
19
|
+
/** Stop-If-True 승자 표식(병합은 DD-05 상류 확정). / Stop-If-True winner marker. */
|
|
20
|
+
readonly stopIfTrue?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/** DD-05/T5-810 검증 판정(임시 최소형) — 데코 단계 마커. */
|
|
23
|
+
export interface ValidationVerdict {
|
|
24
|
+
/** 검증 통과 여부. / Whether validation passed. */
|
|
25
|
+
readonly ok: boolean;
|
|
26
|
+
/** 검증기 식별자. / Validator identifier. */
|
|
27
|
+
readonly validatorId: string;
|
|
28
|
+
/** 실패 메시지(로케일 인지, 접근성 쌍둥이). / Failure message. */
|
|
29
|
+
readonly message?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* 상류 서브시스템(DD-04/05/08)이 이미 평가해 넣는 판정. 파이프라인은 '적용'만(평가 로직 0).
|
|
33
|
+
* / Upstream verdicts already evaluated by DD-04/05/08; the pipeline only applies them.
|
|
34
|
+
*/
|
|
35
|
+
export interface CellVerdicts {
|
|
36
|
+
/** DD-05 조건부서식 판정 — 배열 순서대로 적용만(승자 병합은 상류 확정). / CF verdicts, applied in order. */
|
|
37
|
+
readonly cf?: readonly RuleVerdict[];
|
|
38
|
+
/** DD-05/T5-810 검증 판정 — 데코 단계 마커. / Validation verdict — decorator marker. */
|
|
39
|
+
readonly validation?: ValidationVerdict | null;
|
|
40
|
+
/** DD-01 Delta 값 객체(T5-813) — 값/데코 단계 부호·방향·크기. / DD-01 Delta value object. */
|
|
41
|
+
readonly delta?: Delta | null;
|
|
42
|
+
/** DD-04 표시 문자열(displayFormatter 결과) — 값 단계 소비. null=기본 포맷 폴백. / DD-04 display string. */
|
|
43
|
+
readonly display?: string | null;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* 파이프라인 입력(읽기 전용 투영). 모든 필드 readonly = 순수성·결정론 보증(불변식 §1.2).
|
|
47
|
+
* 파이프라인은 자기 좌표를 계산하지 않는다 — DD-02 rect + 상류 판정을 주입받는다.
|
|
48
|
+
* / Pipeline input (read-only projection). All fields readonly → purity & determinism.
|
|
49
|
+
*
|
|
50
|
+
* @typeParam T - 행 데이터 타입 / Row data type
|
|
51
|
+
*/
|
|
52
|
+
export interface CellRenderRequest<T = any> {
|
|
53
|
+
/** flat 행 인덱스(DD-02 model→view 확정치). / Flat row index. */
|
|
54
|
+
readonly ri: number;
|
|
55
|
+
/** 리프 컬럼 인덱스. / Leaf column index. */
|
|
56
|
+
readonly ci: number;
|
|
57
|
+
/** DD-02 계산 사각형(merge span·frozen 반영 완료). / DD-02 rect (merge/frozen applied). */
|
|
58
|
+
readonly rect: CellRect;
|
|
59
|
+
/** 원시 값(DD-01 3계층 중 raw). / Raw value. */
|
|
60
|
+
readonly value: unknown;
|
|
61
|
+
/** 행 데이터. / Row data. */
|
|
62
|
+
readonly row: T;
|
|
63
|
+
/** 컬럼 정의. / Column definition. */
|
|
64
|
+
readonly column: ColumnDef<T>;
|
|
65
|
+
/** 행 변경 상태. / Row mutation state. */
|
|
66
|
+
readonly rowState: 'none' | 'added' | 'edited' | 'removed';
|
|
67
|
+
/** 선택 여부. / Selected. */
|
|
68
|
+
readonly isSelected: boolean;
|
|
69
|
+
/** 포커스 여부. / Focused. */
|
|
70
|
+
readonly isFocused: boolean;
|
|
71
|
+
/** 편집 가능 여부. / Editable. */
|
|
72
|
+
readonly isEditable: boolean;
|
|
73
|
+
/** merge 스팬(없으면 null). / Merge span (null if none). */
|
|
74
|
+
readonly merge: {
|
|
75
|
+
readonly rowSpan: number;
|
|
76
|
+
readonly colSpan: number;
|
|
77
|
+
readonly hidden: boolean;
|
|
78
|
+
} | null;
|
|
79
|
+
/** 상류 판정(있을 때만). / Upstream verdicts (when present). */
|
|
80
|
+
readonly verdicts?: CellVerdicts;
|
|
81
|
+
/** 형태 값 질의 초크포인트(DD-11). / Shape-value chokepoint (DD-11). */
|
|
82
|
+
readonly appearance: AppearanceResolver;
|
|
83
|
+
/** i18n 로케일 해석기. / i18n locale resolver. */
|
|
84
|
+
readonly t: (key: string, params?: Record<string, string | number>) => string;
|
|
85
|
+
}
|
|
86
|
+
/** 4레인 식별. / The four lane identifiers. */
|
|
87
|
+
export type StageKind = 'background' | 'value' | 'decorator' | 'overlay';
|
|
88
|
+
/**
|
|
89
|
+
* 단계 계약(Stage SPI, 순수 변환). DOM 을 만들지 않고 페인트 지시(StagePaint)만 반환.
|
|
90
|
+
* / Stage SPI (pure transform). Returns paint instructions only; never touches DOM.
|
|
91
|
+
*/
|
|
92
|
+
export interface ICellStage {
|
|
93
|
+
/** 등록 식별자(중복 거부 — 우회 금지, REQ-T6-823). / Registration id (dedup-rejected). */
|
|
94
|
+
readonly id: string;
|
|
95
|
+
/** 어느 레인에 기여하는가. / Which lane this contributes to. */
|
|
96
|
+
readonly kind: StageKind;
|
|
97
|
+
/** 같은 레인 내 정렬(작을수록 먼저). 미지정=100. / Order within lane (lower first). Default 100. */
|
|
98
|
+
readonly order?: number;
|
|
99
|
+
/** O(1) 게이트 — false 면 contribute 미호출(제로코스트). / O(1) gate — no contribute when false. */
|
|
100
|
+
appliesTo(req: CellRenderRequest): boolean;
|
|
101
|
+
/** 순수 변환: 외부 상태 읽기/쓰기·DOM 접근 0. null=기여 없음. acc=앞 레인 누적(읽기전용). / Pure transform. */
|
|
102
|
+
contribute(req: CellRenderRequest, acc: Readonly<PaintAccumulator>): StagePaint | null;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* 값 렌더러 SPI(값 레인). DOM 을 만들지 않고 값 노드 '팩토리'만 반환 = 순수·헤드리스 테스트가능.
|
|
106
|
+
* DD-10 §2.5 는 이를 import 해 `extends IExtension` 만 부여(정본 소유 = DD-03).
|
|
107
|
+
* / Value renderer SPI (value lane). Returns a node factory, not DOM — pure & headless-testable.
|
|
108
|
+
*
|
|
109
|
+
* @typeParam T - 행 데이터 타입 / Row data type
|
|
110
|
+
*/
|
|
111
|
+
export interface ICellRenderer<T = any> {
|
|
112
|
+
/** 등록 식별자(레거시 renderer type 과 동일 키공간). / Registration id (shares legacy renderer keyspace). */
|
|
113
|
+
readonly type: string;
|
|
114
|
+
/** CellView=CellRenderRequest, RenderOutput=()=>Node 정합. null=기여 없음. / Returns a node factory or null. */
|
|
115
|
+
render(req: CellRenderRequest<T>): (() => Node) | null;
|
|
116
|
+
}
|
|
117
|
+
/** 배경 레이어 역할. / Background layer role. */
|
|
118
|
+
export type BgRole = 'base' | 'zebra' | 'state' | 'selection' | 'databar' | 'heatmap' | 'texture';
|
|
119
|
+
/** 배경 레이어(데이터바·히트맵·텍스처 등). z 는 배경 팬 내부 상대순서. / Background layer. */
|
|
120
|
+
export interface BgLayer {
|
|
121
|
+
readonly fill: string;
|
|
122
|
+
readonly z: number;
|
|
123
|
+
readonly role: BgRole;
|
|
124
|
+
}
|
|
125
|
+
/** 절대배치 자식 팩토리(데코/값 노드). Applier 가 호출해 DOM 물질화. / Absolutely-placed child factory. */
|
|
126
|
+
export interface PaintNode {
|
|
127
|
+
readonly build: () => Node;
|
|
128
|
+
readonly z: number;
|
|
129
|
+
readonly role: string;
|
|
130
|
+
}
|
|
131
|
+
/** 오버레이 역할(z 는 compositor 가 role→rank 로 배정, 하드코딩 0). / Overlay role. */
|
|
132
|
+
export type OverlayRole = 'databar-fill' | 'heatmap' | 'validation-marker' | 'selection' | 'range' | 'edit-border' | 'marching-ants' | 'annotation' | 'floating';
|
|
133
|
+
/** 오버레이 레이어 — z 는 compositor 가 role 로 배정(REQ-T5-806). / Overlay layer. */
|
|
134
|
+
export interface OverlayLayer {
|
|
135
|
+
readonly role: OverlayRole;
|
|
136
|
+
readonly build: () => Node;
|
|
137
|
+
readonly ownsHit: boolean;
|
|
138
|
+
}
|
|
139
|
+
/** 단계 1개의 산출(병합적). 미지정 필드는 '기여 없음'. / A single stage's (mergeable) output. */
|
|
140
|
+
export interface StagePaint {
|
|
141
|
+
/** 셀 컨테이너 배경 단일값(base/zebra/state). / Single container background. */
|
|
142
|
+
readonly background?: string;
|
|
143
|
+
/** 다중 배경(데이터바/히트맵/텍스처). / Multi-layer backgrounds. */
|
|
144
|
+
readonly bgLayers?: readonly BgLayer[];
|
|
145
|
+
/** 값 노드 팩토리(값 레인 전용, 단일). / Value node factory (value lane only). */
|
|
146
|
+
readonly content?: () => Node;
|
|
147
|
+
/** 데코 노드(코너폴드/마커/스파크). / Decorator nodes. */
|
|
148
|
+
readonly decorations?: readonly PaintNode[];
|
|
149
|
+
/** 오버레이(선택/포커스/마칭앤츠). / Overlays. */
|
|
150
|
+
readonly overlays?: readonly OverlayLayer[];
|
|
151
|
+
/** 컨테이너 스타일 기여(병합). / Container style contribution (merged). */
|
|
152
|
+
readonly cellStyle?: Readonly<Record<string, string>>;
|
|
153
|
+
/** 클래스 기여(병합). / Class contribution (merged). */
|
|
154
|
+
readonly classes?: readonly string[];
|
|
155
|
+
/** aria 기여(병합, 접근성 쌍둥이). / aria contribution (merged). */
|
|
156
|
+
readonly aria?: Readonly<Record<string, string>>;
|
|
157
|
+
/** 값 단계에 넘길 AA-safe 텍스트 색 힌트. / AA-safe text color hint for the value stage. */
|
|
158
|
+
readonly contentColorHint?: string;
|
|
159
|
+
}
|
|
160
|
+
/** 단계 진단·계보 항목(T5-809 계보 조회 토대). / Stage trace entry. */
|
|
161
|
+
export interface StageTraceEntry {
|
|
162
|
+
readonly stageId: string;
|
|
163
|
+
readonly kind: StageKind;
|
|
164
|
+
readonly contributed: boolean;
|
|
165
|
+
readonly ms: number;
|
|
166
|
+
/** 이 단계가 격리된 예외로 실패했는가. / Whether the stage failed via an isolated exception. */
|
|
167
|
+
readonly failed?: boolean;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* 레인 간 합성 상태(읽기전용 전달). 값 단계가 배경 명도를 읽어 AA 텍스트색을 선택하는 이음새.
|
|
171
|
+
* / Cross-lane composition state (passed read-only). The seam where the value stage reads background
|
|
172
|
+
* luminance to pick an AA text color.
|
|
173
|
+
*/
|
|
174
|
+
export interface PaintAccumulator {
|
|
175
|
+
/** 배경 레인 합성 결과(값 단계 대비계산 입력). / Composed background (contrast input for value stage). */
|
|
176
|
+
readonly background: string | null;
|
|
177
|
+
readonly bgLayers: readonly BgLayer[];
|
|
178
|
+
readonly content: (() => Node) | null;
|
|
179
|
+
readonly decorations: readonly PaintNode[];
|
|
180
|
+
readonly overlays: readonly OverlayLayer[];
|
|
181
|
+
readonly cellStyle: Readonly<Record<string, string>>;
|
|
182
|
+
readonly classes: ReadonlySet<string>;
|
|
183
|
+
readonly aria: Readonly<Record<string, string>>;
|
|
184
|
+
/** AA-safe 텍스트 색 힌트(배경 명도 유도). / AA-safe text color hint (derived from background). */
|
|
185
|
+
readonly contentColorHint?: string;
|
|
186
|
+
/** 어느 단계가 무엇을 기여했나(결정론 스냅샷·계보). / Which stage contributed what. */
|
|
187
|
+
readonly trace: readonly StageTraceEntry[];
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* 렌더 인터셉터(before/after). 예산 안에서만 실행·계측(REQ-TX-889). 가시행 한정.
|
|
191
|
+
* / Render interceptor (before/after). Runs within the budget; visible-rows only.
|
|
192
|
+
*/
|
|
193
|
+
export interface RenderInterceptor {
|
|
194
|
+
readonly id: string;
|
|
195
|
+
beforeRow?(ri: number): void;
|
|
196
|
+
beforeCell?(req: CellRenderRequest): void;
|
|
197
|
+
afterCell?(req: CellRenderRequest, el: HTMLElement): void;
|
|
198
|
+
afterRow?(ri: number): void;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* buildRequest — DD-02 rect + 상류 판정을 CellRenderRequest 로 조립하는 경계 어댑터(§5).
|
|
202
|
+
* 경계에서 1회만 조립하고 이후는 읽기 전용으로 흐른다(내부 좌표 재산술 금지, DD-02 §4.4).
|
|
203
|
+
* / buildRequest — the boundary adapter that assembles a CellRenderRequest from a DD-02 rect and
|
|
204
|
+
* upstream verdicts. Assembled once at the boundary; flows read-only thereafter.
|
|
205
|
+
*
|
|
206
|
+
* @param init - 조립 입력 / Assembly input
|
|
207
|
+
* @returns 동결된 읽기 전용 요청 / A frozen read-only request
|
|
208
|
+
*/
|
|
209
|
+
export declare function buildRequest<T = any>(init: CellRenderRequest<T>): CellRenderRequest<T>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Disposable, ICellStage, StageKind } from './CellRenderRequest.js';
|
|
2
|
+
/**
|
|
3
|
+
* 단계 등록 레지스트리. register/unregister/stagesFor + 중복 id 거부 + order 정렬 캐시.
|
|
4
|
+
* / Cell-stage registry. register/unregister/stagesFor + duplicate-id rejection + order-sorted cache.
|
|
5
|
+
*/
|
|
6
|
+
export declare class CellStageRegistry {
|
|
7
|
+
/** id → 단계(단일 디스패치·중복 거부의 근거). / id → stage (basis of single-dispatch dedup). */
|
|
8
|
+
private _byId;
|
|
9
|
+
/** kind → 정렬된 단계 배열 캐시(무효화 시 재계산). / kind → sorted-stage cache. */
|
|
10
|
+
private _cache;
|
|
11
|
+
/**
|
|
12
|
+
* 단계 등록. 같은 id 재등록은 거부(우회 0 — REQ-T6-823). 해제 토큰 반환.
|
|
13
|
+
* / Register a stage; rejects duplicate id (no bypass — REQ-T6-823). Returns a disposal token.
|
|
14
|
+
*
|
|
15
|
+
* @param def - 단계 정의 / Stage definition
|
|
16
|
+
* @returns 등록 해제 토큰 / A disposal token
|
|
17
|
+
*/
|
|
18
|
+
register(def: ICellStage): Disposable;
|
|
19
|
+
/**
|
|
20
|
+
* id 로 단계 해제(없으면 no-op). / Unregister a stage by id (no-op if absent).
|
|
21
|
+
*
|
|
22
|
+
* @param id - 단계 id / Stage id
|
|
23
|
+
*/
|
|
24
|
+
unregister(id: string): void;
|
|
25
|
+
/** id 등록 여부. / Whether an id is registered. */
|
|
26
|
+
has(id: string): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* 해당 레인의 단계를 order 오름차순으로 반환(캐시). 동률 order 는 등록 순서 안정 정렬.
|
|
29
|
+
* / Stages for a lane, ascending by order (cached). Ties keep registration order (stable sort).
|
|
30
|
+
*
|
|
31
|
+
* @param kind - 레인 / Lane
|
|
32
|
+
* @returns order 정렬된 단계(불변) / Order-sorted stages (immutable)
|
|
33
|
+
*/
|
|
34
|
+
stagesFor(kind: StageKind): readonly ICellStage[];
|
|
35
|
+
/** 전체 등록 수(진단). / Total registered count (diagnostics). */
|
|
36
|
+
get size(): number;
|
|
37
|
+
}
|
|
38
|
+
/** 프로세스 전역 기본 레지스트리(파사드 대상). / Process-global default registry. */
|
|
39
|
+
export declare const defaultCellStageRegistry: CellStageRegistry;
|
|
40
|
+
/**
|
|
41
|
+
* 코어 파이프라인 소스 미편집으로 단계 삽입(OCP). 다음 프레임부터 자동 합성.
|
|
42
|
+
* / Insert a stage without editing core pipeline source (OCP). Composed from the next frame.
|
|
43
|
+
*
|
|
44
|
+
* @param def - 단계 정의 / Stage definition
|
|
45
|
+
* @returns 등록 해제 토큰 / A disposal token
|
|
46
|
+
*/
|
|
47
|
+
export declare function registerCellStage(def: ICellStage): Disposable;
|
|
48
|
+
/**
|
|
49
|
+
* 전역 파사드에서 단계 해제. / Unregister a stage from the global facade.
|
|
50
|
+
*
|
|
51
|
+
* @param id - 단계 id / Stage id
|
|
52
|
+
*/
|
|
53
|
+
export declare function unregisterCellStage(id: string): void;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { OverlayLayer, OverlayRole } from './CellRenderRequest.js';
|
|
2
|
+
/**
|
|
3
|
+
* 오버레이 합성기. role→rank→z 를 단일 소유하고, compose 시 rank 순으로 z-index 를 부여한다.
|
|
4
|
+
* z-index 하드코딩을 어디에서도 하지 않는다(REQ-T5-806).
|
|
5
|
+
* / Overlay compositor. Single owner of role→rank→z; assigns z-index by rank on compose. No z-index
|
|
6
|
+
* is hardcoded anywhere (REQ-T5-806).
|
|
7
|
+
*/
|
|
8
|
+
export declare class OverlayCompositor {
|
|
9
|
+
private _ranks;
|
|
10
|
+
constructor();
|
|
11
|
+
/**
|
|
12
|
+
* role 의 z 랭크 설정(코어 편집 없이 스택 위치 조정 — §4.2 seam). / Set a role's z-rank (OCP seam).
|
|
13
|
+
*
|
|
14
|
+
* @param role - 오버레이 role / Overlay role
|
|
15
|
+
* @param rank - 랭크(클수록 위) / Rank (higher = above)
|
|
16
|
+
*/
|
|
17
|
+
setRoleRank(role: OverlayRole, rank: number): void;
|
|
18
|
+
/** role 의 현재 랭크 조회. / Current rank for a role. */
|
|
19
|
+
rankOf(role: OverlayRole): number;
|
|
20
|
+
/**
|
|
21
|
+
* 오버레이 레이어를 rank 순으로 cellEl 에 합성(z-index 부여). 각 레이어는 자체 z-context 로 격리
|
|
22
|
+
* (position 이 미지정이면 absolute 로 승격 — 오버레이는 값 baseline 위 절대배치, §9.4).
|
|
23
|
+
* / Compose overlay layers onto cellEl in rank order (assigns z-index). Each layer is isolated in
|
|
24
|
+
* its own z-context (position promoted to absolute if unset).
|
|
25
|
+
*
|
|
26
|
+
* @param cellEl - 대상 셀 엘리먼트 / Target cell element
|
|
27
|
+
* @param layers - 오버레이 레이어들 / Overlay layers
|
|
28
|
+
*/
|
|
29
|
+
compose(cellEl: HTMLElement, layers: readonly OverlayLayer[]): void;
|
|
30
|
+
/**
|
|
31
|
+
* 해당 role 의 오버레이가 히트테스트를 소유하는가(포인터 이벤트 수신). / Whether a role owns hit-testing.
|
|
32
|
+
* 기본: edit-border·marching-ants·annotation·floating 은 소유 안 함(값 클릭 투과).
|
|
33
|
+
*
|
|
34
|
+
* @param role - 오버레이 role / Overlay role
|
|
35
|
+
* @returns 히트 소유 여부 / Whether it owns hit-testing
|
|
36
|
+
*/
|
|
37
|
+
hitOwner(role: OverlayRole): boolean;
|
|
38
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { CellRenderRequest, Disposable, RenderInterceptor } from './CellRenderRequest.js';
|
|
2
|
+
/** 예산 옵션. / Budget options. */
|
|
3
|
+
export interface RenderBudgetOptions {
|
|
4
|
+
/** 프레임 예산(ms). / Frame budget (ms). */
|
|
5
|
+
frameMs: number;
|
|
6
|
+
/** 셀당 예산(ms) — 초과 인터셉터 계측 임계. / Per-cell budget (ms). */
|
|
7
|
+
perCellMs: number;
|
|
8
|
+
/** 시간 소스(테스트 주입용, 기본 Date.now). / Time source (injectable for tests). */
|
|
9
|
+
now?: () => number;
|
|
10
|
+
}
|
|
11
|
+
/** report() 집계 항목. / A report() aggregation entry. */
|
|
12
|
+
export interface OverBudgetEntry {
|
|
13
|
+
readonly id: string;
|
|
14
|
+
readonly ms: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 렌더 예산·인터셉터 러너. 인터셉터 훅을 예산 안에서 실행하고 초과분을 계측·경고한다.
|
|
18
|
+
* / Render-budget & interceptor runner. Runs interceptor hooks within budget; measures/warns on overrun.
|
|
19
|
+
*/
|
|
20
|
+
export declare class RenderBudget {
|
|
21
|
+
private _interceptors;
|
|
22
|
+
private _over;
|
|
23
|
+
private _warned;
|
|
24
|
+
private readonly _frameMs;
|
|
25
|
+
private readonly _perCellMs;
|
|
26
|
+
private readonly _now;
|
|
27
|
+
constructor(opts: RenderBudgetOptions);
|
|
28
|
+
/** 프레임 예산(ms). / Frame budget (ms). */
|
|
29
|
+
get frameMs(): number;
|
|
30
|
+
/** 셀당 예산(ms). / Per-cell budget (ms). */
|
|
31
|
+
get perCellMs(): number;
|
|
32
|
+
/**
|
|
33
|
+
* 인터셉터 등록. 해제 토큰 반환. / Add an interceptor. Returns a disposal token.
|
|
34
|
+
*
|
|
35
|
+
* @param i - 인터셉터 / Interceptor
|
|
36
|
+
* @returns 등록 해제 토큰 / A disposal token
|
|
37
|
+
*/
|
|
38
|
+
addInterceptor(i: RenderInterceptor): Disposable;
|
|
39
|
+
/** 등록된 인터셉터 수. / Number of registered interceptors. */
|
|
40
|
+
get interceptorCount(): number;
|
|
41
|
+
/**
|
|
42
|
+
* 인터셉터 함수 1개를 계측하며 실행. perCellMs 초과 시 계측·1회 경고. 예외는 호출측(파이프라인
|
|
43
|
+
* 오류 경계)이 격리하므로 여기서 삼키지 않는다 — 단, 계측은 finally 로 보장.
|
|
44
|
+
* / Run one interceptor fn while measuring. Over perCellMs → record + warn-once. Does not swallow
|
|
45
|
+
* exceptions (the caller's error boundary isolates); measurement is guaranteed in finally.
|
|
46
|
+
*
|
|
47
|
+
* @param id - 인터셉터 식별자 / Interceptor id
|
|
48
|
+
* @param fn - 실행 함수 / Function to run
|
|
49
|
+
*/
|
|
50
|
+
runInterceptor(id: string, fn: () => void): void;
|
|
51
|
+
/** 등록된 모든 인터셉터의 beforeRow 훅 실행(예산 내). / Run beforeRow of all interceptors (within budget). */
|
|
52
|
+
runBeforeRow(ri: number): void;
|
|
53
|
+
/** 등록된 모든 인터셉터의 beforeCell 훅 실행(예산 내). / Run beforeCell of all interceptors. */
|
|
54
|
+
runBeforeCell(req: CellRenderRequest): void;
|
|
55
|
+
/** 등록된 모든 인터셉터의 afterCell 훅 실행(예산 내). / Run afterCell of all interceptors. */
|
|
56
|
+
runAfterCell(req: CellRenderRequest, el: HTMLElement): void;
|
|
57
|
+
/** 등록된 모든 인터셉터의 afterRow 훅 실행(예산 내). / Run afterRow of all interceptors. */
|
|
58
|
+
runAfterRow(ri: number): void;
|
|
59
|
+
/**
|
|
60
|
+
* 예산 초과 계측 보고. / Over-budget measurement report.
|
|
61
|
+
*
|
|
62
|
+
* @returns 초과 인터셉터 목록(ms 내림차순) / Over-budget interceptors (desc by ms)
|
|
63
|
+
*/
|
|
64
|
+
report(): {
|
|
65
|
+
overBudget: readonly OverBudgetEntry[];
|
|
66
|
+
};
|
|
67
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 리터럴 색 문자열(#rgb·#rrggbb·rgb()/rgba())을 [r,g,b] 로 파싱. 실패/비리터럴 → null.
|
|
3
|
+
* / Parse a literal color string into [r,g,b]; null for non-literal (var()/none/keyword).
|
|
4
|
+
*/
|
|
5
|
+
export declare function parseColor(input: string): [number, number, number] | null;
|
|
6
|
+
/** AA 대비 임계(일반 텍스트). / AA contrast threshold (normal text). */
|
|
7
|
+
export declare const AA_CONTRAST = 4.5;
|
|
8
|
+
/**
|
|
9
|
+
* 배경색에 대해 AA(≥4.5:1)를 만족하는 텍스트색을 고른다(흑/백 중 대비 큰 쪽).
|
|
10
|
+
* 배경이 비리터럴(var()/none)이면 null → 렌더 레이어가 기존 텍스트색 유지(회귀 0).
|
|
11
|
+
* / Pick an AA-safe (≥4.5:1) text color for a background (black/white, whichever contrasts more).
|
|
12
|
+
* Returns null for non-literal backgrounds so the render layer keeps today's text color.
|
|
13
|
+
*
|
|
14
|
+
* @param background - 배경색(리터럴 또는 var()) / Background color (literal or var())
|
|
15
|
+
* @returns '#000'|'#fff'|null / '#000'|'#fff'|null
|
|
16
|
+
*/
|
|
17
|
+
export declare function contrastText(background: string | null | undefined): '#000' | '#fff' | null;
|
|
18
|
+
/** AAA 대비 임계(강화 텍스트). / AAA contrast threshold (enhanced text). */
|
|
19
|
+
export declare const AAA_CONTRAST = 7;
|
|
20
|
+
/**
|
|
21
|
+
* 자동 선택 텍스트색(흑/백 중 더 대비 큰 쪽)이 목표 임계를 못 넘기는 중간명도 배경(REQ-T5-807 R3)에서
|
|
22
|
+
* 외곽선(text-shadow)/명도반전 폴백이 필요한가. 흑·백 모두 <threshold 이면 true.
|
|
23
|
+
* ※ AA(4.5)에서는 임의 배경도 흑 또는 백 중 하나가 항상 충족하므로 리터럴은 사실상 항상 false(정직한
|
|
24
|
+
* 구조적 성질). 폴백은 강화 임계(AAA 7:1) 또는 색이 제약된 경로에서 의미가 생긴다.
|
|
25
|
+
* / Whether a text-outline/inversion fallback is needed: both black & white text fall below the target
|
|
26
|
+
* threshold on a mid-luminance background. At AA (4.5) one of black/white always suffices for any
|
|
27
|
+
* background, so literals are effectively always false — a fallback becomes meaningful at AAA (7:1).
|
|
28
|
+
*
|
|
29
|
+
* @param background - 배경색 / Background color
|
|
30
|
+
* @param threshold - 목표 대비 임계(기본 AA 4.5) / Target contrast threshold (default AA 4.5)
|
|
31
|
+
* @returns 외곽선 폴백 필요 여부 / Whether an outline fallback is needed
|
|
32
|
+
*/
|
|
33
|
+
export declare function needsOutlineFallback(background: string | null | undefined, threshold?: number): boolean;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { CellStageRegistry } from './CellStageRegistry.js';
|
|
2
|
+
import { RenderBudget } from './RenderBudget.js';
|
|
3
|
+
import { OverlayCompositor } from './OverlayCompositor.js';
|
|
4
|
+
import { CellErrorBoundary, StageCircuitBreaker } from './CellErrorBoundary.js';
|
|
5
|
+
import { CellPipeline } from './CellPipeline.js';
|
|
6
|
+
export type { Disposable, RuleVerdict, ValidationVerdict, CellVerdicts, CellRenderRequest, StageKind, ICellStage, ICellRenderer, BgRole, BgLayer, PaintNode, OverlayRole, OverlayLayer, StagePaint, StageTraceEntry, PaintAccumulator, RenderInterceptor, } from './CellRenderRequest.js';
|
|
7
|
+
export { buildRequest } from './CellRenderRequest.js';
|
|
8
|
+
export { CellStageRegistry, defaultCellStageRegistry, registerCellStage, unregisterCellStage, } from './CellStageRegistry.js';
|
|
9
|
+
export { RenderBudget, type RenderBudgetOptions, type OverBudgetEntry } from './RenderBudget.js';
|
|
10
|
+
export { CellApplier } from './CellApplier.js';
|
|
11
|
+
export { OverlayCompositor } from './OverlayCompositor.js';
|
|
12
|
+
export { CellErrorBoundary, StageCircuitBreaker, type StageScope } from './CellErrorBoundary.js';
|
|
13
|
+
export { CellPipeline } from './CellPipeline.js';
|
|
14
|
+
export { contrastText, needsOutlineFallback, parseColor, AA_CONTRAST, } from './contrast.js';
|
|
15
|
+
export { BackgroundStage, ValueRendererStage, DecoratorStage, OverlayStage, registerBootstrapStages, } from './stages/index.js';
|
|
16
|
+
/** createDefaultPipeline 결과(파이프라인 + 협력자 핸들). / Result of createDefaultPipeline. */
|
|
17
|
+
export interface DefaultPipeline {
|
|
18
|
+
readonly pipeline: CellPipeline;
|
|
19
|
+
readonly registry: CellStageRegistry;
|
|
20
|
+
readonly budget: RenderBudget;
|
|
21
|
+
readonly compositor: OverlayCompositor;
|
|
22
|
+
readonly boundary: CellErrorBoundary;
|
|
23
|
+
readonly breaker: StageCircuitBreaker;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* 부트스트랩 4단계 + 기본 협력자로 완성된 파이프라인을 조립한다(자체 레지스트리 — 전역과 격리).
|
|
27
|
+
* / Assemble a pipeline with the 4 bootstrap stages and default collaborators (own registry).
|
|
28
|
+
*
|
|
29
|
+
* @param opts - 예산 옵션(선택, 기본 frameMs 16·perCellMs 2) / Budget options
|
|
30
|
+
* @returns 파이프라인과 협력자 핸들 / Pipeline plus collaborator handles
|
|
31
|
+
*/
|
|
32
|
+
export declare function createDefaultPipeline(opts?: {
|
|
33
|
+
frameMs?: number;
|
|
34
|
+
perCellMs?: number;
|
|
35
|
+
}): DefaultPipeline;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ICellStage, CellRenderRequest, StagePaint } from '../CellRenderRequest.js';
|
|
2
|
+
/**
|
|
3
|
+
* 배경 레인 부트스트랩 단계. 선택 > 상태 > zebra > base 우선순위로 배경색 1개를 기여한다.
|
|
4
|
+
* COLOR 축(테마)만 질의 — 형태(스킨)는 만지지 않아 두 축이 간섭 없이 겹친다(§9.1).
|
|
5
|
+
* / Background lane bootstrap stage. Contributes one background color (selection > state > zebra >
|
|
6
|
+
* base). Touches only the COLOR axis so it stays orthogonal to the FORM axis.
|
|
7
|
+
*/
|
|
8
|
+
export declare class BackgroundStage implements ICellStage {
|
|
9
|
+
readonly id = "core.background";
|
|
10
|
+
readonly kind: "background";
|
|
11
|
+
readonly order = 10;
|
|
12
|
+
appliesTo(): boolean;
|
|
13
|
+
contribute(req: CellRenderRequest): StagePaint;
|
|
14
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ICellStage, CellRenderRequest, StagePaint } from '../CellRenderRequest.js';
|
|
2
|
+
/**
|
|
3
|
+
* 데코 레인 부트스트랩 단계. 검증 실패 마커 + delta 화살표를 기여한다(있을 때만).
|
|
4
|
+
* / Decorator lane bootstrap stage. Contributes a validation-fail marker and a delta arrow when present.
|
|
5
|
+
*/
|
|
6
|
+
export declare class DecoratorStage implements ICellStage {
|
|
7
|
+
readonly id = "core.decorator";
|
|
8
|
+
readonly kind: "decorator";
|
|
9
|
+
readonly order = 100;
|
|
10
|
+
appliesTo(req: CellRenderRequest): boolean;
|
|
11
|
+
contribute(req: CellRenderRequest): StagePaint | null;
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ICellStage, CellRenderRequest, StagePaint } from '../CellRenderRequest.js';
|
|
2
|
+
/**
|
|
3
|
+
* 오버레이 레인 부트스트랩 단계. 포커스·선택·편집보더 오버레이를 기여한다(있을 때만).
|
|
4
|
+
* / Overlay lane bootstrap stage. Contributes focus/selection/edit-border overlays when applicable.
|
|
5
|
+
*/
|
|
6
|
+
export declare class OverlayStage implements ICellStage {
|
|
7
|
+
readonly id = "core.overlay";
|
|
8
|
+
readonly kind: "overlay";
|
|
9
|
+
readonly order = 100;
|
|
10
|
+
appliesTo(req: CellRenderRequest): boolean;
|
|
11
|
+
contribute(req: CellRenderRequest): StagePaint | null;
|
|
12
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ICellStage, CellRenderRequest, StagePaint } from '../CellRenderRequest.js';
|
|
2
|
+
/**
|
|
3
|
+
* 값 레인 부트스트랩 단계(Adapter). createRenderer 로 컬럼의 값 렌더러를 해석하고, 그 render(ctx)
|
|
4
|
+
* 호출을 지연 팩토리로 감싸 content 로 기여한다. 렌더러 예외는 파이프라인 오류경계가 셀단위로
|
|
5
|
+
* 격리(REQ-TX-840) → content 미기여 시 Applier 가 raw 폴백.
|
|
6
|
+
* / Value lane bootstrap stage (Adapter). Resolves the column's value renderer via createRenderer and
|
|
7
|
+
* contributes its render(ctx) as a deferred content factory.
|
|
8
|
+
*/
|
|
9
|
+
export declare class ValueRendererStage implements ICellStage {
|
|
10
|
+
readonly id = "core.value";
|
|
11
|
+
readonly kind: "value";
|
|
12
|
+
readonly order = 100;
|
|
13
|
+
appliesTo(): boolean;
|
|
14
|
+
contribute(req: CellRenderRequest): StagePaint;
|
|
15
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CellStageRegistry } from '../CellStageRegistry.js';
|
|
2
|
+
import { Disposable } from '../CellRenderRequest.js';
|
|
3
|
+
export { BackgroundStage } from './BackgroundStage.js';
|
|
4
|
+
export { ValueRendererStage } from './ValueRendererStage.js';
|
|
5
|
+
export { DecoratorStage } from './DecoratorStage.js';
|
|
6
|
+
export { OverlayStage } from './OverlayStage.js';
|
|
7
|
+
/**
|
|
8
|
+
* 부트스트랩 4단계를 레지스트리에 등록(배경·값·데코·오버레이). 각 해제 토큰을 반환한다.
|
|
9
|
+
* / Register the 4 bootstrap stages onto a registry. Returns their disposal tokens.
|
|
10
|
+
*
|
|
11
|
+
* @param registry - 대상 레지스트리 / Target registry
|
|
12
|
+
* @returns 등록 해제 토큰 배열 / Disposal tokens
|
|
13
|
+
*/
|
|
14
|
+
export declare function registerBootstrapStages(registry: CellStageRegistry): Disposable[];
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { StateCodec } from './StateCodec.js';
|
|
2
|
+
import { IStatePersistence, PersistedRecord } from './IStatePersistence.js';
|
|
3
|
+
import { MultiTabGuard, TabConflictNotice } from './MultiTabGuard.js';
|
|
4
|
+
/** RPO 수치 계약. / RPO numeric contract. */
|
|
5
|
+
export interface AutosavePolicy {
|
|
6
|
+
/** ≤ 30_000 (수용기준). / Max interval between saves (acceptance: ≤ 30s). */
|
|
7
|
+
readonly maxIntervalMs: number;
|
|
8
|
+
/** N 조작마다 저장. / Save every N ops. */
|
|
9
|
+
readonly maxOpsBetweenSaves: number;
|
|
10
|
+
}
|
|
11
|
+
/** 초안↔현재 충돌 해소(조용히 덮지 않음 — 복원/버림/비교). / Draft-vs-current resolution (never silent overwrite). */
|
|
12
|
+
export interface DraftStatus {
|
|
13
|
+
readonly hasDraft: boolean;
|
|
14
|
+
readonly draftSavedAt?: number;
|
|
15
|
+
readonly loadedRevision?: number;
|
|
16
|
+
/** 초안 채택(setState). / Adopt the draft. */
|
|
17
|
+
restore(): void;
|
|
18
|
+
/** 초안 버림. / Discard the draft. */
|
|
19
|
+
discard(): void;
|
|
20
|
+
/** 비교(무엇이 다른지 — 섹션 키). / Diff (which sections differ). */
|
|
21
|
+
diff(): DraftDiff;
|
|
22
|
+
}
|
|
23
|
+
export interface DraftDiff {
|
|
24
|
+
readonly changedSections: string[];
|
|
25
|
+
}
|
|
26
|
+
export interface AutosaveControllerConfig {
|
|
27
|
+
readonly docId: string;
|
|
28
|
+
readonly codec: StateCodec;
|
|
29
|
+
readonly store: IStatePersistence;
|
|
30
|
+
readonly policy: AutosavePolicy;
|
|
31
|
+
readonly tabId?: string;
|
|
32
|
+
readonly guard?: MultiTabGuard;
|
|
33
|
+
readonly now?: () => number;
|
|
34
|
+
/** 저장 전 충돌 시 호출(조용한 클로버 대신 표면화). / Called on pre-save conflict (surface instead of clobber). */
|
|
35
|
+
readonly onConflict?: (notice: PersistedRecord) => void;
|
|
36
|
+
}
|
|
37
|
+
/** RPO 계약을 강제하는 자동저장 스케줄러. / Autosave scheduler enforcing the RPO contract. */
|
|
38
|
+
export declare class AutosaveController {
|
|
39
|
+
private readonly _cfg;
|
|
40
|
+
private readonly _now;
|
|
41
|
+
private readonly _tabId;
|
|
42
|
+
private _opsSinceSave;
|
|
43
|
+
private _lastSaveAt;
|
|
44
|
+
private _baseRevision;
|
|
45
|
+
private _saveCount;
|
|
46
|
+
constructor(cfg: AutosaveControllerConfig);
|
|
47
|
+
/** CommandBus 'command' 구독점: 임계 도달 시 저장. / Subscription point for CommandBus 'command'. */
|
|
48
|
+
onCommand(): void;
|
|
49
|
+
private _shouldSave;
|
|
50
|
+
/** 강제 저장(언로드 직전 beforeunload 등). 충돌 시 저장 생략 + onConflict. / Force a save; skip on conflict. */
|
|
51
|
+
flush(): Promise<boolean>;
|
|
52
|
+
/**
|
|
53
|
+
* 크래시 복구: 초안 존재 시 로드하지 않고 '초안 발견' 보고(자동 덮어쓰기 금지).
|
|
54
|
+
* restore()/discard()/diff() 로 호스트가 결정한다.
|
|
55
|
+
* / Crash recovery: reports a found draft without loading it (no auto-overwrite).
|
|
56
|
+
*/
|
|
57
|
+
detectDraft(): Promise<DraftStatus>;
|
|
58
|
+
/** 다른 탭 저장 통지 처리(멀티탭 §2.7). / Handle another tab's save notice (multi-tab §2.7). */
|
|
59
|
+
onExternalSave(rec: PersistedRecord): TabConflictNotice | null;
|
|
60
|
+
get saveCount(): number;
|
|
61
|
+
get opsSinceSave(): number;
|
|
62
|
+
get baseRevision(): number;
|
|
63
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { StateEnvelope } from './StateCodec.js';
|
|
2
|
+
/** 저장 레코드 — 봉투 + 탭/리비전 메타. / Persisted record — envelope plus tab/revision metadata. */
|
|
3
|
+
export interface PersistedRecord {
|
|
4
|
+
readonly env: StateEnvelope;
|
|
5
|
+
readonly tabId: string;
|
|
6
|
+
readonly revision: number;
|
|
7
|
+
readonly savedAt: number;
|
|
8
|
+
}
|
|
9
|
+
/** 저장 매체 추상화 포트(구현은 호스트 주입). / Persistence port (host-injected implementation). */
|
|
10
|
+
export interface IStatePersistence {
|
|
11
|
+
load(docId: string): Promise<PersistedRecord | null>;
|
|
12
|
+
save(docId: string, rec: PersistedRecord): Promise<void>;
|
|
13
|
+
/** 멀티탭: 다른 탭의 저장 통지 구독. 해제 함수 반환. / Multi-tab: subscribe to other tabs' saves; returns an unsubscribe fn. */
|
|
14
|
+
subscribe(docId: string, cb: (rec: PersistedRecord) => void): () => void;
|
|
15
|
+
}
|
|
16
|
+
/** 인메모리 어댑터(테스트·헤드리스 기본). 같은 인스턴스 내 subscribe 는 즉시 동기 통지. / In-memory adapter (test/headless default). */
|
|
17
|
+
export declare class InMemoryStatePersistence implements IStatePersistence {
|
|
18
|
+
private readonly _store;
|
|
19
|
+
private readonly _subs;
|
|
20
|
+
load(docId: string): Promise<PersistedRecord | null>;
|
|
21
|
+
save(docId: string, rec: PersistedRecord): Promise<void>;
|
|
22
|
+
subscribe(docId: string, cb: (rec: PersistedRecord) => void): () => void;
|
|
23
|
+
/** 테스트 편의: 동기 조회. / Test convenience: synchronous peek. */
|
|
24
|
+
peek(docId: string): PersistedRecord | null;
|
|
25
|
+
}
|
|
26
|
+
interface StorageLike {
|
|
27
|
+
getItem(key: string): string | null;
|
|
28
|
+
setItem(key: string, value: string): void;
|
|
29
|
+
}
|
|
30
|
+
interface WindowLike {
|
|
31
|
+
addEventListener(type: 'storage', cb: (e: {
|
|
32
|
+
key: string | null;
|
|
33
|
+
newValue: string | null;
|
|
34
|
+
}) => void): void;
|
|
35
|
+
removeEventListener(type: 'storage', cb: (e: {
|
|
36
|
+
key: string | null;
|
|
37
|
+
newValue: string | null;
|
|
38
|
+
}) => void): void;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* localStorage 어댑터 — 브라우저 전용. `storage` 이벤트로 다른 탭의 저장을 자연 통지받는다(멀티탭 §2.7).
|
|
42
|
+
* 헤드리스/서버에는 매체가 없으므로 load/save 는 무해히 no-op(주입 매체가 없으면).
|
|
43
|
+
* / localStorage adapter (browser-only). Receives other tabs' saves via the native `storage` event.
|
|
44
|
+
*/
|
|
45
|
+
export declare class LocalStorageStatePersistence implements IStatePersistence {
|
|
46
|
+
private readonly _storage;
|
|
47
|
+
private readonly _win;
|
|
48
|
+
private readonly _prefix;
|
|
49
|
+
constructor(opts?: {
|
|
50
|
+
storage?: StorageLike;
|
|
51
|
+
win?: WindowLike;
|
|
52
|
+
prefix?: string;
|
|
53
|
+
});
|
|
54
|
+
private _key;
|
|
55
|
+
load(docId: string): Promise<PersistedRecord | null>;
|
|
56
|
+
save(docId: string, rec: PersistedRecord): Promise<void>;
|
|
57
|
+
subscribe(docId: string, cb: (rec: PersistedRecord) => void): () => void;
|
|
58
|
+
}
|
|
59
|
+
export {};
|