open-grid 1.2.1 → 1.3.1
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 +388 -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/FilterSelect.d.ts +26 -5
- package/dist/types/core/FormulaEngine.d.ts +15 -4
- package/dist/types/core/GridRenderer.d.ts +143 -10
- package/dist/types/core/GridShuttle.d.ts +26 -10
- package/dist/types/core/GroupEngine.d.ts +68 -10
- package/dist/types/core/IconRegistry.d.ts +31 -13
- 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 +401 -122
- package/dist/types/core/OrgChart.d.ts +32 -11
- 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 +86 -19
- package/dist/types/core/TreeEngine.d.ts +60 -6
- package/dist/types/core/VirtualScroll.d.ts +64 -0
- package/dist/types/core/XmlConverter.d.ts +40 -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/chart/types.d.ts +102 -21
- 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/LocaleRegistry.d.ts +0 -0
- package/dist/types/core/i18n/types.d.ts +67 -11
- 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 +511 -226
- 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,94 @@
|
|
|
1
|
+
/** 외관 축 식별자. 이름공간(prefix)이 물리 직교의 열쇠. / Appearance axis id; the token prefix is the key to physical orthogonality. */
|
|
2
|
+
export type AxisId = 'theme' | 'skin' | 'density' | 'texture' | 'icon';
|
|
3
|
+
/** 한 축의 CSS 변수 델타(자기 이름공간만). / A CSS-var delta for one axis (own namespace only). */
|
|
4
|
+
export type TokenDelta = Readonly<Record<string, string>>;
|
|
5
|
+
/** 컨테이너에 붙일 data-* 속성. / A data-* attribute to place on the container. */
|
|
6
|
+
export interface AxisAttr {
|
|
7
|
+
readonly name: string;
|
|
8
|
+
readonly value: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* 한 축의 선택 결과 = 토큰 델타 + 컨테이너 속성 + relayout 플래그.
|
|
12
|
+
* / One axis's selection = token delta + container attribute + relayout flag.
|
|
13
|
+
*/
|
|
14
|
+
export interface AxisResolution {
|
|
15
|
+
/** 이 축이 발행하는 CSS 변수 델타(자기 이름공간만). default → 빈 객체. / CSS var delta (own namespace only); empty for default. */
|
|
16
|
+
readonly tokens: TokenDelta;
|
|
17
|
+
/** 컨테이너 data-* 속성. default/신설 축이면 생략(byte-identical). / Container data-* attr; omitted for default/new-axis. */
|
|
18
|
+
readonly attr?: AxisAttr;
|
|
19
|
+
/** 이 선택이 재계산을 요구하는가(밀도 = 행높이 relayout). / Does this selection require recompute (density → row-height relayout)? */
|
|
20
|
+
readonly requiresRelayout?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/** 축 정의 결과 — 등록된(가드레일 반영) 델타 + 경고. / Axis-definition result — registered (clamped) delta + warnings. */
|
|
23
|
+
export interface AxisDefineResult {
|
|
24
|
+
readonly delta: TokenDelta;
|
|
25
|
+
readonly warnings: string[];
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* IAppearanceAxis — 한 외관 축의 등록·검증·해소를 소유하는 동형 SPI(§2.1).
|
|
29
|
+
* 불변식: resolve(id)는 **자기 이름공간 토큰만** 낸다(축 오염 금지). default id 는 빈 델타(byte-identical).
|
|
30
|
+
* / IAppearanceAxis — the isomorphic SPI owning one axis's registration/validation/resolution.
|
|
31
|
+
*/
|
|
32
|
+
export interface IAppearanceAxis {
|
|
33
|
+
readonly id: AxisId;
|
|
34
|
+
/** 이 축이 소유하는 토큰 이름공간(검증용). / Token namespace this axis owns (for validation). */
|
|
35
|
+
readonly namespace: ReadonlySet<string>;
|
|
36
|
+
/** 값 등록(사용자 확장). 축 오염·정직성 위반 시 throw 또는 클램프+경고. / Register a value; throws on axis-pollution, clamps+warns on honesty violations. */
|
|
37
|
+
define(id: string, delta: TokenDelta): AxisDefineResult;
|
|
38
|
+
/** 등록 여부. / Whether registered. */
|
|
39
|
+
has(id: string): boolean;
|
|
40
|
+
/** 축값 → 해소(토큰·속성·relayout 플래그). 미등록/default → 빈 델타. / Value id → resolution; unknown/default → empty delta. */
|
|
41
|
+
resolve(valueId: string): AxisResolution;
|
|
42
|
+
/** 등록된 값 id 목록(카탈로그·인스펙터용). / Registered value ids (for catalog/inspector). */
|
|
43
|
+
list(): string[];
|
|
44
|
+
}
|
|
45
|
+
/** 축값이 default 인가(빈-델타·attr 생략 경로). / Is a value id the default (empty-delta / attr-omitted path)? */
|
|
46
|
+
export declare const DEFAULT_AXIS_VALUE = "default";
|
|
47
|
+
/** 빈 해소(default/미등록) — attr·relayout 없음. / Empty resolution (default/unknown) — no attr, no relayout. */
|
|
48
|
+
export declare const EMPTY_RESOLUTION: AxisResolution;
|
|
49
|
+
/** TokenAxis 구성. / TokenAxis configuration. */
|
|
50
|
+
export interface TokenAxisConfig {
|
|
51
|
+
readonly id: AxisId;
|
|
52
|
+
/** 컨테이너 data-* 속성명(예: 'data-og-density'). / Container data-* attribute name. */
|
|
53
|
+
readonly attrName: string;
|
|
54
|
+
/** 이 축이 소유하는 토큰 이름공간(자기 prefix 집합). / The token namespace (own prefix set). */
|
|
55
|
+
readonly namespace: ReadonlySet<string>;
|
|
56
|
+
/** named 값이 relayout 을 요구하는가(density=true). 기본 false. / Do named values require relayout (density=true)? Default false. */
|
|
57
|
+
readonly requiresRelayout?: boolean;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* 이름공간 검증 — 델타의 모든 토큰이 이 축 소유인지(축 오염 거부). throw on violation.
|
|
61
|
+
* / Namespace validation — every token must be owned by this axis (rejects axis-pollution).
|
|
62
|
+
*
|
|
63
|
+
* @param axisId - 축 id / Axis id
|
|
64
|
+
* @param namespace - 소유 토큰 집합 / Owned token set
|
|
65
|
+
* @param delta - 검사할 델타 / Delta to validate
|
|
66
|
+
* @throws 이름공간 밖 토큰이 있으면 Error / Throws if a token is outside the namespace
|
|
67
|
+
*/
|
|
68
|
+
export declare function assertNamespace(axisId: AxisId, namespace: ReadonlySet<string>, delta: TokenDelta): void;
|
|
69
|
+
/**
|
|
70
|
+
* TokenAxis — 델타-등록형 축(density·texture)의 재사용 기반 구현.
|
|
71
|
+
* define 은 이름공간 검증 + (서브클래스) 가드레일 후 등록. resolve 는 default/미등록 → 빈 델타(+attr 생략),
|
|
72
|
+
* named → 델타 + `{name:attrName, value:id}` (+ requiresRelayout).
|
|
73
|
+
* / TokenAxis — reusable base for delta-registered axes (density·texture). Headless, pure.
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* const ax = new TokenAxis({ id: 'density', attrName: 'data-og-density', namespace: DENSITY_TOKENS, requiresRelayout: true });
|
|
77
|
+
* ax.resolve('default'); // { tokens:{} } — byte-identical
|
|
78
|
+
*/
|
|
79
|
+
export declare class TokenAxis implements IAppearanceAxis {
|
|
80
|
+
readonly id: AxisId;
|
|
81
|
+
readonly namespace: ReadonlySet<string>;
|
|
82
|
+
protected readonly _attrName: string;
|
|
83
|
+
protected readonly _requiresRelayout: boolean;
|
|
84
|
+
protected readonly _values: Map<string, Readonly<Record<string, string>>>;
|
|
85
|
+
constructor(cfg: TokenAxisConfig);
|
|
86
|
+
/** 내장 값 등록(가드레일만, 경고는 삼킴 — CSS 는 정적 번들 소유). / Register a built-in value (guardrails only). */
|
|
87
|
+
registerBuiltin(id: string, delta: TokenDelta): void;
|
|
88
|
+
/** 서브클래스 가드레일 훅(기본 no-op). / Subclass guardrail hook (default no-op). */
|
|
89
|
+
protected _guardrails(_id: string, delta: TokenDelta): AxisDefineResult;
|
|
90
|
+
define(id: string, delta: TokenDelta): AxisDefineResult;
|
|
91
|
+
has(id: string): boolean;
|
|
92
|
+
resolve(valueId: string): AxisResolution;
|
|
93
|
+
list(): string[];
|
|
94
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Appearance, AppearanceFinding } from './Appearance.js';
|
|
2
|
+
import { AxisAttr, IAppearanceAxis, TokenDelta } from './AppearanceAxis.js';
|
|
3
|
+
import { ThemeMetaRegistry } from './ThemeMetaRegistry.js';
|
|
4
|
+
/** 다섯 축 레지스트리 묶음(컴포저 주입). / The five axis registries (injected into composer). */
|
|
5
|
+
export interface AppearanceRegistrySet {
|
|
6
|
+
readonly theme: ThemeMetaRegistry;
|
|
7
|
+
readonly skin: IAppearanceAxis;
|
|
8
|
+
readonly density: IAppearanceAxis;
|
|
9
|
+
readonly texture: IAppearanceAxis;
|
|
10
|
+
readonly icon: IAppearanceAxis;
|
|
11
|
+
}
|
|
12
|
+
/** 합성 결과 = 컨테이너에 적용할 속성·토큰·relayout 필요 여부·판정. / Composition output. */
|
|
13
|
+
export interface ComposedAppearance {
|
|
14
|
+
readonly appearance: Appearance;
|
|
15
|
+
/** data-og-theme/skin/density/texture — 순서 결정론. default/신설 축은 생략. / Container attrs (deterministic order). */
|
|
16
|
+
readonly attrs: ReadonlyArray<AxisAttr>;
|
|
17
|
+
/** 병합된 최종 델타(옵트인 시만 비어있지 않음). / Merged final delta (non-empty only under opt-in). */
|
|
18
|
+
readonly tokens: TokenDelta;
|
|
19
|
+
/** 밀도가 바뀌었나(DD-02 relayout 위임 트리거). / Did density change (triggers DD-02 relayout)? */
|
|
20
|
+
readonly requiresRelayout: boolean;
|
|
21
|
+
/** 위험/불가 플래그(데모 배지·API 공유). / Risky/invalid flags (shared by demo/API). */
|
|
22
|
+
readonly findings: AppearanceFinding[];
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* AppearanceComposer — N축을 단일 cascade 로 결합하는 컴포지션 루트(순수·상태 없음).
|
|
26
|
+
* / AppearanceComposer — the pure, stateless composition root.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* const composer = new AppearanceComposer(regs);
|
|
30
|
+
* composer.compose(new Appearance()); // { attrs:[theme,skin], tokens:{}, requiresRelayout:false } — byte-identical
|
|
31
|
+
* composer.compose(new Appearance('dark','sharp','compact','linen'));
|
|
32
|
+
*/
|
|
33
|
+
export declare class AppearanceComposer {
|
|
34
|
+
private readonly _reg;
|
|
35
|
+
constructor(_reg: AppearanceRegistrySet);
|
|
36
|
+
/**
|
|
37
|
+
* 4축 선택 → 합성 결과. cascade 순서: theme → skin → density → texture(→ icon: 속성/토큰 없음).
|
|
38
|
+
* default 조합은 tokens={} + theme/skin 속성만(density/texture attr 생략 = byte-identical, 불변식 3).
|
|
39
|
+
* / 4-axis selection → composition. Default composition yields tokens={} + only theme/skin attrs.
|
|
40
|
+
*
|
|
41
|
+
* @param a - 4축 외관 값 / The 4-axis appearance value
|
|
42
|
+
* @returns 속성·토큰·relayout·판정 / Attrs, tokens, relayout flag, findings
|
|
43
|
+
*/
|
|
44
|
+
compose(a: Appearance): ComposedAppearance;
|
|
45
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ComposedAppearance } from './AppearanceComposer.js';
|
|
2
|
+
import { AppearanceSnapshotBridge } from './ResolvedAppearanceSnapshot.js';
|
|
3
|
+
/** 외관 변경 구독자(부속 컴포넌트·서브그리드·캔버스 리드로우). / Appearance-change subscriber. */
|
|
4
|
+
export type AppearanceListener = (composed: ComposedAppearance) => void;
|
|
5
|
+
/**
|
|
6
|
+
* AppearanceProvider — 확정 외관의 단일 발행 채널.
|
|
7
|
+
* / AppearanceProvider — the single publish channel for resolved appearance.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* const provider = new AppearanceProvider(snapshotBridge);
|
|
11
|
+
* const off = provider.subscribe((c) => chart.redraw(c));
|
|
12
|
+
* provider.publish(composer.compose(appearance)); // bridge.invalidate() + 전 구독자 통지
|
|
13
|
+
* off();
|
|
14
|
+
*/
|
|
15
|
+
export declare class AppearanceProvider {
|
|
16
|
+
private readonly _bridge?;
|
|
17
|
+
private _listeners;
|
|
18
|
+
private _last;
|
|
19
|
+
/**
|
|
20
|
+
* @param _bridge - publish 시 무효화할 스냅샷 브리지(선택 — 없으면 통지만). / Snapshot bridge to invalidate on publish (optional).
|
|
21
|
+
*/
|
|
22
|
+
constructor(_bridge?: AppearanceSnapshotBridge | undefined);
|
|
23
|
+
/**
|
|
24
|
+
* 부속 DOM 요소에 확정 외관 속성 복제(data-og-theme/skin 을 한 번에 — 기존 propagateAppearance).
|
|
25
|
+
* / Clone appearance attrs onto detached DOM (data-og-theme/skin together).
|
|
26
|
+
*
|
|
27
|
+
* @param fromEl - 외관 속성을 상속받을 원본(그리드 컨테이너 등) / Source to inherit appearance from
|
|
28
|
+
* @param toEl - 속성을 받을 대상(다이얼로그·서브그리드) / Target to receive the attributes
|
|
29
|
+
*/
|
|
30
|
+
propagateTo(fromEl: Element | null, toEl: Element): void;
|
|
31
|
+
/**
|
|
32
|
+
* 비-DOM 표면(캔버스차트·스파크·인쇄버퍼) 구독. 반환 = 해지 함수.
|
|
33
|
+
* / Subscribe a non-DOM surface; returns an unsubscribe function.
|
|
34
|
+
*
|
|
35
|
+
* @param fn - 외관 변경 리스너 / Appearance-change listener
|
|
36
|
+
* @returns 구독 해지 함수 / Unsubscribe function
|
|
37
|
+
*/
|
|
38
|
+
subscribe(fn: AppearanceListener): () => void;
|
|
39
|
+
/**
|
|
40
|
+
* 외관 확정 → 스냅샷 무효화 + 전 구독자 통지(낡은 색 0, REQ-T6-813).
|
|
41
|
+
* / Publish → invalidate snapshot + notify all subscribers.
|
|
42
|
+
*
|
|
43
|
+
* @param composed - 확정된 합성 외관 / The resolved composed appearance
|
|
44
|
+
*/
|
|
45
|
+
publish(composed: ComposedAppearance): void;
|
|
46
|
+
/** 마지막 발행 외관(늦게 구독한 표면의 초기 동기화용). / The last published appearance (for late subscribers). */
|
|
47
|
+
get last(): ComposedAppearance | null;
|
|
48
|
+
/** 활성 구독자 수(진단/테스트). / Active subscriber count (diagnostics/tests). */
|
|
49
|
+
get subscriberCount(): number;
|
|
50
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ResolvedAppearanceSnapshot } from './ResolvedAppearanceSnapshot.js';
|
|
2
|
+
import { Appearance } from './Appearance.js';
|
|
3
|
+
/** 의미색(상태) 역할. / Semantic (status) color role. */
|
|
4
|
+
export type SemanticRole = 'error' | 'warning' | 'success' | 'info';
|
|
5
|
+
/**
|
|
6
|
+
* AppearanceView — 외관 읽기 전용 좁은 포트(DD-11 소유·export).
|
|
7
|
+
* / AppearanceView — the narrow read-only appearance port (owned/exported by DD-11).
|
|
8
|
+
*/
|
|
9
|
+
export interface AppearanceView {
|
|
10
|
+
/** 현재 확정 외관(값 애그리게이트). / Current resolved appearance. */
|
|
11
|
+
readonly appearance: Appearance;
|
|
12
|
+
/** 데이터색 램프(키 고정 — 시리즈·히트맵·데이터바 공유 단일 소스). / Data-color ramp (key-stable, single source). */
|
|
13
|
+
rampFrom(key: string): readonly string[];
|
|
14
|
+
/** 의미색(상태) 토큰 조회 — 상태색을 데이터색으로 재사용 금지(컨텍스트 분리). / Semantic (status) color lookup. */
|
|
15
|
+
semanticInk(role: SemanticRole): string;
|
|
16
|
+
/** 비-DOM 표면용 해소 스냅샷(§2.4). / Resolved snapshot for non-DOM surfaces. */
|
|
17
|
+
snapshot(): ResolvedAppearanceSnapshot;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* CF(DD-05) 좁은 포트 형태 — cf/appearance.ts 의 rampFrom(seed):string 와 정합(재선언 없이 어댑터).
|
|
21
|
+
* / The CF (DD-05) narrow-port shape — matches cf/appearance.ts's rampFrom(seed):string.
|
|
22
|
+
*/
|
|
23
|
+
export interface CFAppearancePort {
|
|
24
|
+
rampFrom(seed: 'primary' | 'graphite'): string;
|
|
25
|
+
radius?(px: number): string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* cfPortFrom — DD-11 AppearanceView → DD-05 CF 좁은 포트 어댑터(통합 배선용).
|
|
29
|
+
* CF 는 시드색 1개를 물어본다 → view.rampFrom('primary'|'graphite') 램프의 대표색(첫 항목)을 반환.
|
|
30
|
+
* / cfPortFrom — adapts a DD-11 AppearanceView to the DD-05 CF narrow port (integration wiring).
|
|
31
|
+
*
|
|
32
|
+
* @param view - DD-11 외관 읽기 포트 / A DD-11 appearance read port
|
|
33
|
+
* @returns CF 가 소비하는 좁은 포트 / The narrow port CF consumes
|
|
34
|
+
*/
|
|
35
|
+
export declare function cfPortFrom(view: AppearanceView): CFAppearancePort;
|
|
36
|
+
/** 기본 의미색(상태) — themes.css 상태색과 정합하는 폴백. / Default semantic (status) colors. */
|
|
37
|
+
export declare const DEFAULT_SEMANTIC_INK: Readonly<Record<SemanticRole, string>>;
|
|
38
|
+
/**
|
|
39
|
+
* staticAppearanceView — 테스트·기본용 정적 읽기 포트(순수·DOM 무의존).
|
|
40
|
+
* rampFrom 은 시드 램프를, semanticInk 는 기본 상태색을 반환(데이터색↔의미색 분리 유지).
|
|
41
|
+
* / staticAppearanceView — a static read port for tests/defaults (pure, DOM-free).
|
|
42
|
+
*
|
|
43
|
+
* @param cfg - 외관·스냅샷·램프 override(선택) / Appearance/snapshot/ramp overrides
|
|
44
|
+
* @returns 정적 읽기 포트 / A static read port
|
|
45
|
+
*/
|
|
46
|
+
export declare function staticAppearanceView(cfg: {
|
|
47
|
+
appearance: Appearance;
|
|
48
|
+
snapshot: ResolvedAppearanceSnapshot;
|
|
49
|
+
ramps?: Readonly<Record<string, readonly string[]>>;
|
|
50
|
+
semantic?: Readonly<Record<SemanticRole, string>>;
|
|
51
|
+
}): AppearanceView;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { TokenAxis, TokenDelta } from './AppearanceAxis.js';
|
|
2
|
+
/** 밀도 축 이름공간(자기 소유 토큰 — 축 오염 검증용). / Density namespace (own tokens — for pollution check). */
|
|
3
|
+
export declare const DENSITY_TOKENS: ReadonlySet<string>;
|
|
4
|
+
/** 터치 히트타깃 하한(px, REQ-T2-018). / Touch hit-target floor (px). */
|
|
5
|
+
export declare const TOUCH_MIN_PX = 44;
|
|
6
|
+
/**
|
|
7
|
+
* DensityRegistry — 밀도 축(4값 + 터치). named 값은 relayout 을 요구한다(density 전용).
|
|
8
|
+
* 터치 부스트는 row/header/footer 를 44px 하한으로 클램프하고 그 사실을 경고로 알린다(silent 아님).
|
|
9
|
+
* / DensityRegistry — the density axis (4 values + touch). Named values require relayout.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* densityRegistry.resolve('compact'); // { tokens:{'--og-density-row-height':'28px',…}, attr:{name:'data-og-density',value:'compact'}, requiresRelayout:true }
|
|
13
|
+
* densityRegistry.resolve('default'); // { tokens:{} } — byte-identical, attr 생략
|
|
14
|
+
*/
|
|
15
|
+
export declare class DensityRegistry extends TokenAxis {
|
|
16
|
+
constructor();
|
|
17
|
+
/** 터치 부스트: row/header/footer 픽셀을 44px 하한으로 클램프(가시 히트타깃 비협상, REQ-T2-018). */
|
|
18
|
+
protected _guardrails(_id: string, delta: TokenDelta): {
|
|
19
|
+
delta: TokenDelta;
|
|
20
|
+
warnings: string[];
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
/** Compact — 고밀도 엔터프라이즈(28px, 12px). / Compact — high-density enterprise. */
|
|
24
|
+
export declare const DENSITY_COMPACT: TokenDelta;
|
|
25
|
+
/** Comfortable — 균형(36px, 13px). / Comfortable — balanced. */
|
|
26
|
+
export declare const DENSITY_COMFORTABLE: TokenDelta;
|
|
27
|
+
/** Spacious — 여백 넉넉(40px, 14px). / Spacious — roomy. */
|
|
28
|
+
export declare const DENSITY_SPACIOUS: TokenDelta;
|
|
29
|
+
/** Gallery — 카드형 대형(56px, 15px). / Gallery — card-like large. */
|
|
30
|
+
export declare const DENSITY_GALLERY: TokenDelta;
|
|
31
|
+
/** Compact-touch — compact 지만 44px 하한(터치, §3.3·REQ-T2-018). / Compact but 44px-floored (touch). */
|
|
32
|
+
export declare const DENSITY_COMPACT_TOUCH: TokenDelta;
|
|
33
|
+
/** 내장 밀도 카탈로그(default 제외 — default 는 빈 델타). id → 델타. / Built-in density catalog (default excluded). */
|
|
34
|
+
export declare const BUILTIN_DENSITIES: ReadonlyArray<readonly [string, TokenDelta]>;
|
|
35
|
+
/** 프로세스 전역 기본 밀도 레지스트리(내장 부트스트랩). / Process-global default density registry. */
|
|
36
|
+
export declare const densityRegistry: DensityRegistry;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { Appearance } from './Appearance.js';
|
|
2
|
+
/** 캔버스/오프스크린이 소비하는 해소된 외관값(색은 리터럴로 확정). / Resolved appearance for canvas (colors as literals). */
|
|
3
|
+
export interface ResolvedAppearanceSnapshot {
|
|
4
|
+
/** 본문 잉크(전경). / Body ink (foreground). */
|
|
5
|
+
readonly ink: string;
|
|
6
|
+
/** 표면(배경). / Surface (background). */
|
|
7
|
+
readonly surface: string;
|
|
8
|
+
/** 보더/구획선 색. / Line/divider color. */
|
|
9
|
+
readonly line: string;
|
|
10
|
+
/** 강조(프라이머리). / Accent (primary). */
|
|
11
|
+
readonly accent: string;
|
|
12
|
+
/** 격자선. / Grid line. */
|
|
13
|
+
readonly gridLine: string;
|
|
14
|
+
/** 오버레이 스크림. / Overlay scrim. */
|
|
15
|
+
readonly overlayScrim: string;
|
|
16
|
+
/** 그림자 잉크(rgb 채널). / Shadow ink (rgb channels). */
|
|
17
|
+
readonly shadowInk: string;
|
|
18
|
+
/** 데이터색 램프(시리즈/히트맵 공유 키 기반). / Data-color ramp (shared key-based). */
|
|
19
|
+
readonly seriesColors: readonly string[];
|
|
20
|
+
/** 폰트 메트릭(캔버스 measureText 대체용 해소값). / Font metrics (resolved for canvas). */
|
|
21
|
+
readonly font: {
|
|
22
|
+
readonly family: string;
|
|
23
|
+
readonly size: number;
|
|
24
|
+
readonly lineHeight: number;
|
|
25
|
+
};
|
|
26
|
+
/** 이 스냅샷을 만든 외관 + 로케일(무효화 키). / The appearance + locale that produced this (invalidation key). */
|
|
27
|
+
readonly key: {
|
|
28
|
+
readonly appearance: Appearance;
|
|
29
|
+
readonly locale: string;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/** 스냅샷 해소 함수(DOM 조회를 격리하는 주입 지점). / Snapshot-resolve function (the injected DOM-read boundary). */
|
|
33
|
+
export type SnapshotResolveFn = () => ResolvedAppearanceSnapshot;
|
|
34
|
+
/**
|
|
35
|
+
* AppearanceSnapshotBridge — 주입된 resolve 로 스냅샷을 만들고 무효화까지 캐시한다(Humble Object).
|
|
36
|
+
* DOM 조회는 resolve 안에만 — 브리지는 순수 캐시·무효화 로직이라 결정론·테스트 가능.
|
|
37
|
+
* / AppearanceSnapshotBridge — caches the snapshot from an injected resolve until invalidated.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* const bridge = new AppearanceSnapshotBridge(() => snapshotFromComputedStyle(container, ctx));
|
|
41
|
+
* bridge.get(); // 1회 해소 후 캐시
|
|
42
|
+
* bridge.invalidate(); // 외관/로케일 변경 시
|
|
43
|
+
* bridge.get(); // 재해소
|
|
44
|
+
*/
|
|
45
|
+
export declare class AppearanceSnapshotBridge {
|
|
46
|
+
private readonly _resolve;
|
|
47
|
+
private _cache;
|
|
48
|
+
constructor(_resolve: SnapshotResolveFn);
|
|
49
|
+
/** 유효 스냅샷 반환(dirty/미캐시면 재계산 후 캐시). / Return a valid snapshot (recompute if dirty). */
|
|
50
|
+
get(): ResolvedAppearanceSnapshot;
|
|
51
|
+
/** 무효화 — 외관/로케일 변경 시 호출. 다음 get() 이 재해소. / Invalidate; next get() re-resolves. */
|
|
52
|
+
invalidate(): void;
|
|
53
|
+
/** 현재 캐시가 유효한가(테스트/진단). / Whether a valid cache is present (test/diagnostics). */
|
|
54
|
+
get isValid(): boolean;
|
|
55
|
+
}
|
|
56
|
+
/** 스냅샷 토큰 매핑(컨테이너 계산 스타일 → 스냅샷 필드). / Token map (container computed style → snapshot fields). */
|
|
57
|
+
export interface SnapshotTokenMap {
|
|
58
|
+
readonly ink: string;
|
|
59
|
+
readonly surface: string;
|
|
60
|
+
readonly line: string;
|
|
61
|
+
readonly accent: string;
|
|
62
|
+
readonly gridLine: string;
|
|
63
|
+
readonly overlayScrim: string;
|
|
64
|
+
readonly shadowInk: string;
|
|
65
|
+
readonly fontFamily: string;
|
|
66
|
+
readonly fontSize: string;
|
|
67
|
+
}
|
|
68
|
+
/** 기본 토큰 매핑(현 og 토큰 이름). / Default token map (current og token names). */
|
|
69
|
+
export declare const DEFAULT_SNAPSHOT_TOKEN_MAP: SnapshotTokenMap;
|
|
70
|
+
/**
|
|
71
|
+
* snapshotFromComputedStyle — **유일한 DOM 조회 지점**: 컨테이너 계산 스타일 1회로 스냅샷 투영.
|
|
72
|
+
* document/window 없으면(헤드리스) 폴백 스냅샷 반환(never-throw). getComputedStyle 은 컨테이너에만.
|
|
73
|
+
* / snapshotFromComputedStyle — the single DOM-read site: one computed-style read → snapshot projection.
|
|
74
|
+
*
|
|
75
|
+
* @param container - 그리드 컨테이너(호스트 아님) / The grid container (not the host)
|
|
76
|
+
* @param ctx - 외관/로케일 키 + seriesColors + 토큰 매핑(선택) / Appearance/locale key + series colors + token map
|
|
77
|
+
* @returns 해소된 스냅샷 / A resolved snapshot
|
|
78
|
+
*/
|
|
79
|
+
export declare function snapshotFromComputedStyle(container: Element | null, ctx: {
|
|
80
|
+
appearance: Appearance;
|
|
81
|
+
locale: string;
|
|
82
|
+
seriesColors?: readonly string[];
|
|
83
|
+
map?: SnapshotTokenMap;
|
|
84
|
+
}): ResolvedAppearanceSnapshot;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { TokenAxis, TokenDelta } from './AppearanceAxis.js';
|
|
2
|
+
/** 질감 축 이름공간(자기 소유 shape 토큰 — 색 `--og-texture-ink` 는 theme 축 소유이므로 제외). / Texture namespace (shape tokens only; the color `--og-texture-ink` belongs to the theme axis). */
|
|
3
|
+
export declare const TEXTURE_TOKENS: ReadonlySet<string>;
|
|
4
|
+
/** `--og-texture-opacity` 정직 상한(§9.5, AA 안전). / Honest cap on texture-opacity (§9.5, AA-safe). */
|
|
5
|
+
export declare const TEXTURE_OPACITY_CAP = 0.1;
|
|
6
|
+
/**
|
|
7
|
+
* TextureRegistry — 질감 제3축. 등록 게이트가 texture-opacity 를 0.1 상한으로 클램프한다.
|
|
8
|
+
* named 값은 relayout 을 요구하지 않는다(질감은 배경 페인트만 — 좌표 불변).
|
|
9
|
+
* / TextureRegistry — the 3rd texture axis. The registration gate clamps texture-opacity to ≤0.1.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* textureRegistry.resolve('linen'); // { tokens:{'--og-texture-bg':…,'--og-texture-opacity':'0.06',…}, attr:{name:'data-og-texture',value:'linen'} }
|
|
13
|
+
* textureRegistry.resolve('default'); // { tokens:{} } — byte-identical
|
|
14
|
+
*/
|
|
15
|
+
export declare class TextureRegistry extends TokenAxis {
|
|
16
|
+
constructor();
|
|
17
|
+
/** 정직 상한: --og-texture-opacity > 0.1 → 0.1 클램프(AA 비협상, §9.5). */
|
|
18
|
+
protected _guardrails(_id: string, delta: TokenDelta): {
|
|
19
|
+
delta: TokenDelta;
|
|
20
|
+
warnings: string[];
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
/** Linen — 리넨 결(교차 해칭 대신 미세 수직/수평 결). / Linen — fine woven grain. */
|
|
24
|
+
export declare const TEXTURE_LINEN: TokenDelta;
|
|
25
|
+
/** Paper-grain — 종이 그레인(부드러운 점묘 결). / Paper-grain — soft speckle. */
|
|
26
|
+
export declare const TEXTURE_PAPER_GRAIN: TokenDelta;
|
|
27
|
+
/** Graph — 모눈(엔지니어링 도면 격자). / Graph — engineering grid. */
|
|
28
|
+
export declare const TEXTURE_GRAPH: TokenDelta;
|
|
29
|
+
/** 내장 질감 카탈로그(default 제외). id → 델타. / Built-in texture catalog (default excluded). */
|
|
30
|
+
export declare const BUILTIN_TEXTURES: ReadonlyArray<readonly [string, TokenDelta]>;
|
|
31
|
+
/** 프로세스 전역 기본 질감 레지스트리(내장 부트스트랩). / Process-global default texture registry. */
|
|
32
|
+
export declare const textureRegistry: TextureRegistry;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { AxisId, AxisResolution, IAppearanceAxis, TokenDelta, AxisDefineResult } from './AppearanceAxis.js';
|
|
2
|
+
/** 감정 온도 — 색이 실어 나르는 정서 축(§9.6 재질 서사). / Emotional temperature the color carries. */
|
|
3
|
+
export type EmotionalTemperature = 'cool' | 'neutral' | 'warm';
|
|
4
|
+
/**
|
|
5
|
+
* ThemeMeta — 한 테마의 도메인 속성(색 값이 아니라 **조합 판정용 메타**).
|
|
6
|
+
* / ThemeMeta — a theme's domain attributes (not color values — metadata for combination verdicts).
|
|
7
|
+
*/
|
|
8
|
+
export interface ThemeMeta {
|
|
9
|
+
/** 테마 id. / Theme id. */
|
|
10
|
+
readonly id: string;
|
|
11
|
+
/** 다크 테마인가(neumorph/stitch 위험 판정의 1차 축). / Is this a dark theme (primary axis for risk verdicts)? */
|
|
12
|
+
readonly dark: boolean;
|
|
13
|
+
/** 질감 테마인가(textureZone 을 chrome 이상으로 의도). / Is this a textured theme? */
|
|
14
|
+
readonly textured: boolean;
|
|
15
|
+
/** 이 테마가 의도하는 텍스처 존('chrome'|'all'|'off'). / Intended texture zone. */
|
|
16
|
+
readonly textureZone?: 'chrome' | 'all' | 'off';
|
|
17
|
+
/** 다크 짝 테마 id(있으면). / Paired dark theme id (if any). */
|
|
18
|
+
readonly darkPair?: string;
|
|
19
|
+
/** 감정 온도. / Emotional temperature. */
|
|
20
|
+
readonly temperature?: EmotionalTemperature;
|
|
21
|
+
/** 색 델타(선택 — 사용자 defineTheme 산출; 내장은 themes.css 소유라 비움). / Color delta (optional; built-ins live in themes.css). */
|
|
22
|
+
readonly delta?: TokenDelta;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* assertColorOnly — 테마 델타가 형태/밀도/질감 shape 토큰을 담지 않는지 검사(색⊥형태 대칭 강제).
|
|
26
|
+
* `assertFormOnly` 의 거울상: 스킨은 색을, 테마는 형태를 담을 수 없다(불변식 1, REQ-T1-013).
|
|
27
|
+
* / assertColorOnly — the mirror of assertFormOnly: a theme delta may not carry shape tokens.
|
|
28
|
+
*
|
|
29
|
+
* @param id - 테마 id / Theme id
|
|
30
|
+
* @param delta - 검사할 색 델타 / Color delta to validate
|
|
31
|
+
* @throws shape 토큰(FORM/DENSITY/TEXTURE)이 있으면 Error / Throws if a shape token is present
|
|
32
|
+
*/
|
|
33
|
+
export declare function assertColorOnly(id: string, delta: TokenDelta): void;
|
|
34
|
+
/**
|
|
35
|
+
* ThemeMetaRegistry — 테마 메타 도메인 레지스트리(theme 축, IAppearanceAxis 정합).
|
|
36
|
+
* theme 축은 **속성만** 발행한다(color 는 CSS var 라 브라우저가 런타임 재계산 = zero-rerender):
|
|
37
|
+
* resolve(id) 는 사용자 defineTheme 델타가 있으면 그 델타를, 없으면 빈 델타 + `data-og-theme` 속성.
|
|
38
|
+
* / ThemeMetaRegistry — the theme metadata domain registry (theme axis, IAppearanceAxis-conformant).
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* themeMetaRegistry.meta('dark')?.dark; // true
|
|
42
|
+
* themeMetaRegistry.resolve('dark'); // { tokens:{}, attr:{name:'data-og-theme', value:'dark'} }
|
|
43
|
+
*/
|
|
44
|
+
export declare class ThemeMetaRegistry implements IAppearanceAxis {
|
|
45
|
+
readonly id: AxisId;
|
|
46
|
+
/** 색 축은 개방 이름공간(themes.css 소유) — 검증은 denylist(assertColorOnly)로. namespace 는 참조용 빈 집합. */
|
|
47
|
+
readonly namespace: ReadonlySet<string>;
|
|
48
|
+
private _metas;
|
|
49
|
+
/** 내장 테마 메타 등록(검증만 — CSS 는 themes.css). / Register a built-in theme meta (validation only). */
|
|
50
|
+
registerBuiltin(meta: ThemeMeta): void;
|
|
51
|
+
/** 테마 메타 조회(없으면 undefined). / Look up a theme meta (undefined if absent). */
|
|
52
|
+
meta(id: string): ThemeMeta | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* 사용자 테마 등록(defineTheme 산출 델타). 색⊥형태 검증 후 등록.
|
|
55
|
+
* IAppearanceAxis.define 시그니처 정합: delta 는 색 델타, 메타는 delta 로부터 최소 추론(dark/textured 기본 false).
|
|
56
|
+
* 풍부한 메타가 필요하면 registerBuiltin(ThemeMeta) 를 사용한다.
|
|
57
|
+
* / Register a user theme (defineTheme output delta). Minimal meta inferred; use registerBuiltin for rich meta.
|
|
58
|
+
*/
|
|
59
|
+
define(id: string, delta: TokenDelta): AxisDefineResult;
|
|
60
|
+
has(id: string): boolean;
|
|
61
|
+
resolve(valueId: string): AxisResolution;
|
|
62
|
+
list(): string[];
|
|
63
|
+
}
|
|
64
|
+
/** 내장 테마 메타 카탈로그(대표). / Built-in theme meta catalog (representative). */
|
|
65
|
+
export declare const BUILTIN_THEME_METAS: ReadonlyArray<ThemeMeta>;
|
|
66
|
+
/** 프로세스 전역 기본 테마 메타 레지스트리(내장 부트스트랩). / Process-global default theme-meta registry. */
|
|
67
|
+
export declare const themeMetaRegistry: ThemeMetaRegistry;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { SkinRegistry } from '../SkinRegistry.js';
|
|
2
|
+
import { IconRegistry } from '../IconRegistry.js';
|
|
3
|
+
import { AxisId, AxisResolution, IAppearanceAxis, TokenDelta, AxisDefineResult } from './AppearanceAxis.js';
|
|
4
|
+
/**
|
|
5
|
+
* SkinAxisAdapter — SkinRegistry(기존)를 skin 축(IAppearanceAxis)으로 정합.
|
|
6
|
+
* resolve 는 default → 빈 델타(+속성 유지, 오늘의 data-og-skin), named → 등록 델타 + `data-og-skin`.
|
|
7
|
+
* 토큰은 skins.css 정적 번들이 실제 CSS 를 전달하므로 델타는 카탈로그/검증용(컴포저는 속성만 적용).
|
|
8
|
+
* / SkinAxisAdapter — conforms the existing SkinRegistry to the skin axis.
|
|
9
|
+
*/
|
|
10
|
+
export declare class SkinAxisAdapter implements IAppearanceAxis {
|
|
11
|
+
private readonly _reg;
|
|
12
|
+
readonly id: AxisId;
|
|
13
|
+
/** FORM 이름공간은 SkinRegistry.assertFormOnly 가 소유·강제(어댑터는 위임). 참조용 빈 집합. */
|
|
14
|
+
readonly namespace: ReadonlySet<string>;
|
|
15
|
+
constructor(_reg: SkinRegistry);
|
|
16
|
+
define(id: string, delta: TokenDelta): AxisDefineResult;
|
|
17
|
+
has(id: string): boolean;
|
|
18
|
+
resolve(valueId: string): AxisResolution;
|
|
19
|
+
list(): string[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* IconAxisAdapter — IconRegistry(기존)를 icon 축(IAppearanceAxis)으로 정합.
|
|
23
|
+
* 아이콘 축은 컨테이너 토큰 델타·data-* 속성을 발행하지 않는다(role→glyph 결합은 렌더 시점 소유).
|
|
24
|
+
* has/list 는 role 존재/목록으로 위임. resolve 는 항상 빈 델타(컴포저 속성 적용 대상 아님).
|
|
25
|
+
* / IconAxisAdapter — conforms the existing IconRegistry to the icon axis (no container tokens/attrs).
|
|
26
|
+
*/
|
|
27
|
+
export declare class IconAxisAdapter implements IAppearanceAxis {
|
|
28
|
+
private readonly _reg;
|
|
29
|
+
readonly id: AxisId;
|
|
30
|
+
readonly namespace: ReadonlySet<string>;
|
|
31
|
+
constructor(_reg: IconRegistry);
|
|
32
|
+
/** 아이콘 축의 define 은 role→glyph 등록으로 위임(delta 의 첫 항목을 role/glyph 로 해석하지 않음 — 명시 API 사용 권장). */
|
|
33
|
+
define(_id: string, _delta: TokenDelta): AxisDefineResult;
|
|
34
|
+
has(id: string): boolean;
|
|
35
|
+
resolve(_valueId: string): AxisResolution;
|
|
36
|
+
list(): string[];
|
|
37
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AppearanceComposer, AppearanceRegistrySet } from './AppearanceComposer.js';
|
|
2
|
+
/**
|
|
3
|
+
* 기본 5축 레지스트리 묶음(전역 레지스트리 + skin/icon 어댑터).
|
|
4
|
+
* / The default 5-axis registry set (global registries + skin/icon adapters).
|
|
5
|
+
*
|
|
6
|
+
* @returns 컴포저 주입용 레지스트리 묶음 / A registry set for composer injection
|
|
7
|
+
*/
|
|
8
|
+
export declare function defaultAppearanceRegistrySet(): AppearanceRegistrySet;
|
|
9
|
+
/** 프로세스 공유 기본 컴포저(전역 레지스트리 기반). / Process-shared default composer. */
|
|
10
|
+
export declare const defaultAppearanceComposer: AppearanceComposer;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type { AxisId, TokenDelta, AxisAttr, AxisResolution, AxisDefineResult, IAppearanceAxis, TokenAxisConfig } from './AppearanceAxis.js';
|
|
2
|
+
export { DEFAULT_AXIS_VALUE, EMPTY_RESOLUTION, assertNamespace, TokenAxis } from './AppearanceAxis.js';
|
|
3
|
+
export { DensityRegistry, densityRegistry, DENSITY_TOKENS, TOUCH_MIN_PX, BUILTIN_DENSITIES, DENSITY_COMPACT, DENSITY_COMFORTABLE, DENSITY_SPACIOUS, DENSITY_GALLERY, DENSITY_COMPACT_TOUCH, } from './DensityRegistry.js';
|
|
4
|
+
export { TextureRegistry, textureRegistry, TEXTURE_TOKENS, TEXTURE_OPACITY_CAP, BUILTIN_TEXTURES, TEXTURE_LINEN, TEXTURE_PAPER_GRAIN, TEXTURE_GRAPH, } from './TextureRegistry.js';
|
|
5
|
+
export type { ThemeMeta, EmotionalTemperature } from './ThemeMetaRegistry.js';
|
|
6
|
+
export { ThemeMetaRegistry, themeMetaRegistry, assertColorOnly, BUILTIN_THEME_METAS, } from './ThemeMetaRegistry.js';
|
|
7
|
+
export { SkinAxisAdapter, IconAxisAdapter } from './axisAdapters.js';
|
|
8
|
+
export type { AppearanceVerdict, AppearanceFinding, AppearanceMetaLookup, MaterialPreset } from './Appearance.js';
|
|
9
|
+
export { Appearance, worstVerdict, MATERIAL_PRESETS } from './Appearance.js';
|
|
10
|
+
export type { AppearanceRegistrySet, ComposedAppearance } from './AppearanceComposer.js';
|
|
11
|
+
export { AppearanceComposer } from './AppearanceComposer.js';
|
|
12
|
+
export type { ResolvedAppearanceSnapshot, SnapshotResolveFn, SnapshotTokenMap } from './ResolvedAppearanceSnapshot.js';
|
|
13
|
+
export { AppearanceSnapshotBridge, snapshotFromComputedStyle, DEFAULT_SNAPSHOT_TOKEN_MAP, } from './ResolvedAppearanceSnapshot.js';
|
|
14
|
+
export type { AppearanceView, SemanticRole, CFAppearancePort } from './AppearanceView.js';
|
|
15
|
+
export { cfPortFrom, staticAppearanceView, DEFAULT_SEMANTIC_INK } from './AppearanceView.js';
|
|
16
|
+
export type { AppearanceListener } from './AppearanceProvider.js';
|
|
17
|
+
export { AppearanceProvider } from './AppearanceProvider.js';
|
|
18
|
+
export type { TokenCatalogEntry, ColorContext } from './tokenCatalog.js';
|
|
19
|
+
export { TOKEN_CATALOG, SEMANTIC_ALIASES, tokensByAxis, catalogEntry } from './tokenCatalog.js';
|
|
20
|
+
export { defaultAppearanceRegistrySet, defaultAppearanceComposer } from './defaults.js';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { AxisId } from './AppearanceAxis.js';
|
|
2
|
+
/** 색 바운디드 컨텍스트(REQ-T1-806) — 의미 빨강을 시리즈 색으로 재사용 금지. / Color bounded context. */
|
|
3
|
+
export type ColorContext = 'semantic' | 'data' | 'decorative' | 'chrome';
|
|
4
|
+
/** 토큰 카탈로그 1건 — 인스펙터가 소비하는 데이터 모델. / One token catalog entry — the inspector's data model. */
|
|
5
|
+
export interface TokenCatalogEntry {
|
|
6
|
+
/** 토큰 이름(예: '--og-ink'). / Token name. */
|
|
7
|
+
readonly name: string;
|
|
8
|
+
/** 소속 축(이름공간이 강제). / Owning axis (enforced by namespace). */
|
|
9
|
+
readonly axis: AxisId;
|
|
10
|
+
/** 기본값(오늘의 리터럴/참조). / Default value (today's literal/reference). */
|
|
11
|
+
readonly default: string;
|
|
12
|
+
/** 설명(인스펙터 툴팁). / Description (inspector tooltip). */
|
|
13
|
+
readonly desc: string;
|
|
14
|
+
/** 색 토큰이면 바운디드 컨텍스트. / Bounded context for color tokens. */
|
|
15
|
+
readonly context?: ColorContext;
|
|
16
|
+
/** semantic alias 가 가리키는 실토큰(있으면). / The concrete token a semantic alias points to (if any). */
|
|
17
|
+
readonly aliasOf?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* 공개 토큰 카탈로그(SSOT). 이름만 보고 소유 축을 안다(§9.1 직교 증거).
|
|
21
|
+
* 대표 집합 — 신규 컴포넌트/인스펙터가 축·컨텍스트·기본값을 조회하는 단일 소스.
|
|
22
|
+
* / The public token catalog (SSOT). Representative set.
|
|
23
|
+
*/
|
|
24
|
+
export declare const TOKEN_CATALOG: ReadonlyArray<TokenCatalogEntry>;
|
|
25
|
+
/** semantic alias 목록(구 토큰 보존 매핑). / Semantic alias list (legacy-token-preserving map). */
|
|
26
|
+
export declare const SEMANTIC_ALIASES: ReadonlyArray<TokenCatalogEntry>;
|
|
27
|
+
/** 축별 토큰 조회(인스펙터 그룹핑). / Look up tokens by axis (inspector grouping). */
|
|
28
|
+
export declare function tokensByAxis(axis: AxisId): TokenCatalogEntry[];
|
|
29
|
+
/** 이름 → 카탈로그 항목(축·기본값·컨텍스트). / Name → catalog entry. */
|
|
30
|
+
export declare function catalogEntry(name: string): TokenCatalogEntry | undefined;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { CFRule } from './CFRule.js';
|
|
2
|
+
import { CellInput, ColumnStats, EvalCtx, StatKind } from './eval-types.js';
|
|
3
|
+
import { CellRect } from '../coordinate/index.js';
|
|
4
|
+
import { AppearanceView } from './appearance.js';
|
|
5
|
+
import { CFEvaluator } from './CFEvaluator.js';
|
|
6
|
+
import { CFRuleTypeRegistry } from './predicates.js';
|
|
7
|
+
import { CFEncoderRegistry, VisualSpec } from './encoders.js';
|
|
8
|
+
import { CFLineageQuery, RuleLineage } from './lineage.js';
|
|
9
|
+
/** 스코프별 규칙 인덱스(컬럼→규칙). 직렬화·상태는 DD-09 소유; 여기선 조회 인덱스만. / Scope-indexed rule store. */
|
|
10
|
+
export declare class CFRuleStore {
|
|
11
|
+
private readonly byColumn;
|
|
12
|
+
private readonly all;
|
|
13
|
+
constructor(rules?: readonly CFRule[]);
|
|
14
|
+
/** 규칙 추가(컬럼 인덱스 갱신). / Add a rule (updates the column index). */
|
|
15
|
+
add(rule: CFRule): void;
|
|
16
|
+
/** 이 컬럼에 걸린 규칙(스코프 1차 필터). / Rules scoped to this column. */
|
|
17
|
+
rulesFor(columnId: string): readonly CFRule[];
|
|
18
|
+
/** 전 규칙. / All rules. */
|
|
19
|
+
list(): readonly CFRule[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* CF 하위도메인 파사드. 평가기·인코더·규칙 저장소·술어 레지스트리를 조율한다.
|
|
23
|
+
* / CF subdomain facade — orchestrates evaluator, encoders, rule store, and predicate registry.
|
|
24
|
+
*/
|
|
25
|
+
export declare class CFEngine implements CFLineageQuery {
|
|
26
|
+
private readonly rules;
|
|
27
|
+
private readonly encoders;
|
|
28
|
+
private readonly ruleTypes;
|
|
29
|
+
private readonly evaluator;
|
|
30
|
+
constructor(rules: CFRuleStore, encoders?: CFEncoderRegistry, ruleTypes?: CFRuleTypeRegistry, evaluator?: CFEvaluator);
|
|
31
|
+
/** 계보 조회 파사드(인스펙터·디버그·회귀). / Lineage query facade. */
|
|
32
|
+
get lineage(): CFLineageQuery;
|
|
33
|
+
/**
|
|
34
|
+
* 셀 하나의 시각 스펙(배경/데코) 산출 — 순수 파이프: 평가 → 인코딩 → 잉크.
|
|
35
|
+
* 미지 인코더는 skip(하위호환). 배경 승자 1 + 데코 다중을 VisualSpec[] 로 반환.
|
|
36
|
+
* / Produce a cell's visual specs (background/decorator) — pure: evaluate → encode → ink.
|
|
37
|
+
*
|
|
38
|
+
* @param input - 셀 평가 입력 / Cell evaluation input
|
|
39
|
+
* @param stats - 컬럼 통계 스냅샷 / Column stats snapshot
|
|
40
|
+
* @param appearance - 외관 읽기 포트(색 시드) / Appearance read port (color seed)
|
|
41
|
+
* @param rect - DD-02 셀 사각형 / DD-02 cell rect
|
|
42
|
+
* @param ctx - 평가 컨텍스트(now 주입) / Evaluation context (now injected)
|
|
43
|
+
* @returns 배경(최대 1) + 데코 VisualSpec 배열 / Background (≤1) + decorator VisualSpecs
|
|
44
|
+
*/
|
|
45
|
+
paintFor(input: CellInput, stats: ColumnStats, appearance: AppearanceView, rect: CellRect, ctx: EvalCtx): VisualSpec[];
|
|
46
|
+
/**
|
|
47
|
+
* 이 컬럼에 걸린 전 규칙의 통계 needs 합집합(엔진→DD-02 스캔 계약, REQ-T5-803). 미지 술어는 무시.
|
|
48
|
+
* / Union of stats needs across all rules scoped to this column (engine → DD-02 scan contract).
|
|
49
|
+
*
|
|
50
|
+
* @param columnId - 컬럼 식별자 / Column id
|
|
51
|
+
* @returns 결정론 정렬된 StatKind 배열 / A deterministically-sorted StatKind array
|
|
52
|
+
*/
|
|
53
|
+
statsNeedsFor(columnId: string): StatKind[];
|
|
54
|
+
/** 발화한 규칙들의 계보를 우선순위 순으로 반환(툴팁 재계산 금지). / Fired rules' lineage in priority order. */
|
|
55
|
+
explain(input: CellInput, rules: readonly CFRule[], stats: ColumnStats, ctx: EvalCtx): RuleLineage[];
|
|
56
|
+
}
|