open-grid 1.4.0 → 1.5.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.
Files changed (54) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/README.md +18 -1
  3. package/dist/{OpenGrid-BOtTt5aI.cjs → OpenGrid-CT9bV6On.cjs} +7 -7
  4. package/dist/OpenGrid-CT9bV6On.cjs.map +1 -0
  5. package/dist/{OpenGrid-sI_vdHQw.js → OpenGrid-DACnZdEy.js} +7 -7
  6. package/dist/OpenGrid-DACnZdEy.js.map +1 -0
  7. package/dist/Registry-CPJYOqCn.js.map +1 -0
  8. package/dist/Registry-D74ZmdDz.cjs.map +1 -0
  9. package/dist/{index-D1l3XFCM.cjs → index-Brfso4Ry.cjs} +2 -2
  10. package/dist/index-Brfso4Ry.cjs.map +1 -0
  11. package/dist/index-CeJ-0-80.cjs.map +1 -0
  12. package/dist/index-DnarQ4eR.js.map +1 -0
  13. package/dist/{index-B3fKi43v.js → index-al9Mbv3E.js} +2 -2
  14. package/dist/index-al9Mbv3E.js.map +1 -0
  15. package/dist/open-grid-base.css +98 -35
  16. package/dist/open-grid-header.cjs +188 -0
  17. package/dist/open-grid-header.cjs.map +1 -0
  18. package/dist/open-grid-header.css +386 -0
  19. package/dist/open-grid-header.js +197 -0
  20. package/dist/open-grid-header.js.map +1 -0
  21. package/dist/open-grid-react.cjs +1 -1
  22. package/dist/open-grid-react.cjs.map +1 -0
  23. package/dist/open-grid-react.js +1 -1
  24. package/dist/open-grid-react.js.map +1 -0
  25. package/dist/open-grid-themes.css +774 -1
  26. package/dist/open-grid-typography.cjs +97 -0
  27. package/dist/open-grid-typography.cjs.map +1 -0
  28. package/dist/open-grid-typography.css +181 -0
  29. package/dist/open-grid-typography.js +105 -0
  30. package/dist/open-grid-typography.js.map +1 -0
  31. package/dist/open-grid-vue.cjs +1 -1
  32. package/dist/open-grid-vue.cjs.map +1 -0
  33. package/dist/open-grid-vue.js +1 -1
  34. package/dist/open-grid-vue.js.map +1 -0
  35. package/dist/open-grid.cjs +1 -1
  36. package/dist/open-grid.cjs.map +1 -0
  37. package/dist/open-grid.js +2 -2
  38. package/dist/open-grid.js.map +1 -0
  39. package/dist/types/core/DetailManager.d.ts +2 -2
  40. package/dist/types/core/FormulaController.d.ts +2 -2
  41. package/dist/types/core/MutationService.d.ts +2 -2
  42. package/dist/types/core/OpenGrid.d.ts +4 -4
  43. package/dist/types/core/appearance/AppearanceAxis.d.ts +1 -1
  44. package/dist/types/core/appearance/HeaderRegistry.d.ts +236 -0
  45. package/dist/types/core/appearance/ThemeMetaRegistry.d.ts +1 -1
  46. package/dist/types/core/appearance/TypographyRegistry.d.ts +122 -0
  47. package/dist/types/core/appearance/index.d.ts +1 -0
  48. package/dist/types/core/detail/DetailState.d.ts +1 -1
  49. package/dist/types/core/detail/SubgridCache.d.ts +2 -2
  50. package/dist/types/header/index.d.ts +144 -0
  51. package/dist/types/typography/index.d.ts +128 -0
  52. package/dist/xlsx.min-BQ1o3sB6.cjs.map +1 -0
  53. package/dist/xlsx.min-Bbz2ZypC.js.map +1 -0
  54. package/package.json +126 -114
@@ -0,0 +1,236 @@
1
+ import { TokenAxis, TokenDelta, AxisDefineResult } from './AppearanceAxis.js';
2
+ import { RegisterOptions, RegisterResult, RegistryEntry } from '../extension/Registry.js';
3
+ /**
4
+ * 헤더 축 이름공간(자기 소유 **형태** 토큰 8개 — 축 오염 검증용).
5
+ *
6
+ * 색(`--og-header-bg`·`--og-header-color` …)과 조판(`--og-header-font-weight` …)은
7
+ * **의도적으로 빠져 있다.** 각각 theme 축·typography 축 소유다. 접두사가 같다고 같은 축이 아니다.
8
+ *
9
+ * The header axis namespace — the 8 own **shape** tokens (used for the axis-pollution check).
10
+ *
11
+ * Color and typography `--og-header-*` tokens are deliberately absent: they belong to the theme
12
+ * and typography axes respectively. A shared prefix does not mean a shared axis.
13
+ */
14
+ export declare const HEADER_TOKENS: ReadonlySet<string>;
15
+ /**
16
+ * 컨테이너에 붙는 축 속성명.
17
+ *
18
+ * The container attribute name for this axis.
19
+ */
20
+ export declare const HEADER_ATTR = "data-og-header";
21
+ /**
22
+ * assertHeaderOnly — 헤더 델타가 색/조판/밀도/질감 토큰을 담지 않는지 검사(축 대칭).
23
+ *
24
+ * `assertColorOnly`(ThemeMetaRegistry)·`assertFormOnly`(SkinRegistry)·
25
+ * `assertTypographyOnly`(TypographyRegistry)의 네 번째 대칭항이다. 불변식 1(각 축은 자기
26
+ * 이름공간만 낸다)을 헤더 방향으로도 기계강제한다.
27
+ *
28
+ * assertHeaderOnly — rejects color/typography/density/texture tokens in a header delta.
29
+ *
30
+ * The fourth symmetric counterpart to `assertColorOnly`, `assertFormOnly` and
31
+ * `assertTypographyOnly`, enforcing invariant 1 in the header direction.
32
+ *
33
+ * @param id - 헤더 프리셋 id
34
+ *
35
+ * Header preset id
36
+ * @param delta - 검사할 헤더 델타
37
+ *
38
+ * Header delta to validate
39
+ * @throws 이름공간 밖 토큰이 있으면 Error
40
+ *
41
+ * Throws if a token outside the namespace is present
42
+ * @example
43
+ * assertHeaderOnly('my-header', { '--og-header-bg': 'red' }); // throws — 색은 theme 축 소유
44
+ */
45
+ export declare function assertHeaderOnly(id: string, delta: TokenDelta): void;
46
+ /**
47
+ * 프리셋 1건의 등록 메타 — `TypedRegistry` 에 실리는 값.
48
+ *
49
+ * 델타 자체는 `TokenAxis` 가 갖는다. 여기 담기는 것은 **정책·진단에 쓰는 정보**뿐이라
50
+ * 두 저장소가 같은 것을 두 벌 갖지 않는다.
51
+ *
52
+ * Registration metadata for one preset — the value stored in the `TypedRegistry`.
53
+ *
54
+ * The delta itself lives in `TokenAxis`; this carries only policy/diagnostic information, so the
55
+ * two stores never hold duplicate copies of the same thing.
56
+ */
57
+ export interface HeaderPresetMeta {
58
+ /** 이 프리셋이 CSS 규칙을 요구하는가. 내장 5종 중 `default` 만 false. / Does this preset need CSS rules? Only `default` is false. */
59
+ readonly needsCss: boolean;
60
+ /** 사람이 읽는 한 줄 설명(피커 UI·인스펙터용). / One-line human label (for picker UIs and inspectors). */
61
+ readonly label?: string;
62
+ }
63
+ /**
64
+ * HeaderAxis — 헤더 제6축. **상속으로 SPI 를, 합성으로 등록 정책을** 얻는다.
65
+ *
66
+ * ```
67
+ * IAppearanceAxis (5축 공통 SPI)
68
+ * ▲ implements
69
+ * TokenAxis (기존 — 한 글자도 안 고쳤다)
70
+ * ▲ extends ← ① 축 불변식은 상속으로. 형제 축과 리스코프 치환 가능
71
+ * HeaderAxis
72
+ * │ has-a ← ② 등록 정책은 합성으로. is-a 가 아니다
73
+ * ▼
74
+ * TypedRegistry<HeaderPresetMeta> (v1.4.0 공개 확장점)
75
+ * ```
76
+ *
77
+ * **왜 `extends TokenAxis` 인가(상속을 쓰는 자리).** `assertNamespace` · `resolve` 의 never-throw
78
+ * 폴백 · `default` → 빈 델타(byte-identical) · `attr` 생략 규칙 — 이 넷은 **여섯 축이 똑같아야 하는
79
+ * 불변식**이다. 베끼면 여섯 벌이 갈라진다. 상속이 정확한 도구다.
80
+ *
81
+ * **왜 `TypedRegistry` 를 상속하지 않고 안에 두는가(합성을 쓰는 자리).** `TypedRegistry<V>` 는
82
+ * **키→값 저장소**고 `HeaderAxis` 는 **축**이다. is-a 가 아니다. 그리고 `TokenAxis` 를 고쳐
83
+ * 저장소를 갈아끼우면 **기존 5축의 코드 경로가 바뀐다** — 「기본값 불변」 금지선에 직접 닿는다.
84
+ * 합성이면 **헤더 축만** 새 정책을 갖고 나머지 다섯은 한 바이트도 안 변한다(개방-폐쇄 원칙).
85
+ *
86
+ * **이 축이 형제 축보다 더 갖는 것** — 기존 축들은 생 `Map` 이라 아래가 전부 없다:
87
+ * 내장 보호(`protect-builtin`) · 출처(`origin`) · 플러그인 수명(`disposePlugin`) ·
88
+ * SPI 버전 검증 · `og:*` 예약 대역 보호 · never-throw 등록 결과.
89
+ * 그래서 이 축에서는 사용자가 `define('rule', …)` 해도 **내장 프리셋이 조용히 사라지지 않는다.**
90
+ *
91
+ * HeaderAxis — the 6th (header) axis: **SPI conformance by inheritance, registration policy by
92
+ * composition.** `TokenAxis` supplies the six-axis invariants; a composed `TypedRegistry` supplies
93
+ * built-in protection, origin tracking, plugin lifecycle and SPI checks that the sibling axes lack.
94
+ * Composition (not inheritance) is used because a registry is not a kind of axis, and because
95
+ * swapping `TokenAxis`'s store would change the code path of the five existing axes.
96
+ *
97
+ * @example
98
+ * headerRegistry.resolve('rule'); // { tokens:{'--og-header-rule-width':'2px',…}, attr:{name:'data-og-header',value:'rule'} }
99
+ * headerRegistry.resolve('default'); // { tokens:{} } — 속성 미부착, byte-identical
100
+ * headerRegistry.define('rule', {}); // kept — 내장 보호. registration.ok === false
101
+ */
102
+ export declare class HeaderAxis extends TokenAxis {
103
+ /**
104
+ * 등록 정책·출처·수명을 소유하는 합성 레지스트리.
105
+ *
106
+ * 값(`HeaderPresetMeta`)은 정책 판정에 필요한 것만 담는다 — 토큰 델타는 `TokenAxis` 소유다.
107
+ */
108
+ private readonly _policy;
109
+ constructor();
110
+ /** 등록 게이트에 축 오염 검사를 선행시킨다(`assertTypographyOnly` 와 동형 배선). */
111
+ registerBuiltin(id: string, delta: TokenDelta): void;
112
+ /**
113
+ * 내장 `default` 를 정책 레지스트리에만 올린다(델타는 등록하지 않는다).
114
+ *
115
+ * `resolve('default')` 는 `TokenAxis` 가 `_values` 를 보기 **전에** 빈 델타로 되돌리므로
116
+ * 델타를 넣을 필요가 없고, 넣으면 `list()` 에 default 가 섞여 카탈로그가 흐려진다.
117
+ * 그런데 **보호는 필요하다** — 사용자가 `define('default', …)` 로 축 해제 경로를 점유하면
118
+ * "축을 껐는데 안 꺼진다" 가 된다. 그래서 정책 층에만 자리를 잡아 둔다.
119
+ *
120
+ * Reserves `default` in the policy registry only (no delta). `resolve('default')` short-circuits
121
+ * to an empty delta before consulting `_values`, so no delta is needed — but the id still must be
122
+ * protected, or a user could hijack the axis-off path.
123
+ */
124
+ protected _reserveDefault(): void;
125
+ /**
126
+ * 사용자 정의 프리셋 등록.
127
+ *
128
+ * `TokenAxis.define` 과 달리 **조용히 안 덮는다.** 내장 5종(`default`·`rule`·`quiet`·`band`·`pill`)은
129
+ * `origin:'builtin'` 으로 등록돼 있어 `{ override: true }` 없이는 교체되지 않고, 거부 사유가
130
+ * `registration` 으로 돌아온다(never-throw).
131
+ *
132
+ * 축 오염(색·조판 토큰)은 **상속받은 검사가 throw** 한다 — 정책보다 먼저 걸린다.
133
+ * 순서가 중요하다: 오염된 델타는 애초에 등록 후보가 아니므로 정책 판정까지 갈 이유가 없다.
134
+ *
135
+ * Registers a user-defined preset. Unlike `TokenAxis.define`, built-ins are **not silently
136
+ * replaced**: without `{ override: true }` the registration is rejected and the reason is
137
+ * returned in `registration` (never throws). Axis pollution throws first, before policy runs.
138
+ *
139
+ * @param id - 프리셋 id / Preset id
140
+ * @param delta - 헤더 형태 토큰 델타 / Header shape-token delta
141
+ * @param opts - 등록 정책 옵션(+ 프리셋 메타) / Registration policy options (plus preset meta)
142
+ * @returns 클램프 반영 델타 + 경고 + 등록 판정 / Clamped delta, warnings, and the registration verdict
143
+ * @throws 색·조판 등 이름공간 밖 토큰이 있으면 Error / Throws on out-of-namespace tokens
144
+ */
145
+ define(id: string, delta: TokenDelta, opts?: RegisterOptions & {
146
+ meta?: HeaderPresetMeta;
147
+ }): AxisDefineResult & {
148
+ registration: RegisterResult;
149
+ };
150
+ /**
151
+ * 등록 기록(출처·플러그인·우선순위·SPI 버전). 진단·카탈로그용.
152
+ *
153
+ * Registration records (origin, plugin, priority, SPI version) — for diagnostics and catalogs.
154
+ */
155
+ entries(): ReadonlyArray<RegistryEntry<HeaderPresetMeta>>;
156
+ /**
157
+ * 한 플러그인이 넣은 프리셋만 골라 해제한다 — **등록의 대칭**.
158
+ *
159
+ * 형제 축들에는 이 대칭이 없다(생 `Map` 이라 누가 넣었는지 모른다). 해제 건수를 반환한다.
160
+ *
161
+ * Disposes only the presets registered by one plugin — the symmetric counterpart to registration,
162
+ * which the sibling axes lack. Returns the number of entries removed.
163
+ *
164
+ * @param pluginId - 해제할 플러그인 id / The plugin id to dispose
165
+ * @returns 해제된 건수 / Number of entries removed
166
+ */
167
+ disposePlugin(pluginId: string): number;
168
+ /**
169
+ * 형태 가드 2종.
170
+ *
171
+ * ① **불투명도 0~1 클램프 + 경고.** 힌트(정렬 화살표)·그립(리사이즈 손잡이)의 불투명도다.
172
+ * 1 을 넘으면 CSS 가 조용히 1 로 자르고, 음수는 조용히 0 으로 잘라 **요소가 사라진다** —
173
+ * "안 보이는데 값은 들어갔다" 는 디버깅이 비싼 종류의 실패라 등록 시점에 잡는다.
174
+ * silent override 가 아니라 경고를 남긴다(TextureRegistry 의 opacity 클램프와 동형).
175
+ * ② **음수 길이 거부(0 으로 클램프) + 경고.** 규칙선 폭·알약 여백에 음수가 들어가면
176
+ * 브라우저가 선언 전체를 무효로 버려 **폴백조차 안 걸리고 프리셋의 그 줄만 죽는다.**
177
+ * 0 은 "그리지 않음" 이라는 유효한 뜻이므로 0 으로 내린다.
178
+ *
179
+ * 단위 없는 숫자·`calc()`·`var()` 는 파싱 실패(NaN)로 통과시킨다 — CSS 가 최종 심판이고,
180
+ * 등록 게이트가 표현식을 재구현하면 그게 더 큰 결함이다(정직한 한계).
181
+ */
182
+ protected _guardrails(_id: string, delta: TokenDelta): {
183
+ delta: TokenDelta;
184
+ warnings: string[];
185
+ };
186
+ }
187
+ /**
188
+ * rule — 규칙선. 머리글의 배경을 지우고 아래로 굵은 선 하나만 남긴다.
189
+ *
190
+ * rule — a single heavy rule under a background-less header.
191
+ */
192
+ export declare const HEADER_RULE: TokenDelta;
193
+ /**
194
+ * quiet — 조용한 머리글. 선도 배경도 거의 없애고 글자만 남긴다.
195
+ *
196
+ * quiet — nearly no rule and no fill; the label alone carries the header.
197
+ */
198
+ export declare const HEADER_QUIET: TokenDelta;
199
+ /**
200
+ * band — 띠. 머리글을 채워 표의 지붕으로 세운다(오늘의 기본형에 가장 가깝다).
201
+ *
202
+ * band — a filled band; the closest of the four to today's default header.
203
+ */
204
+ export declare const HEADER_BAND: TokenDelta;
205
+ /**
206
+ * pill — 알약. 각 머리글 칸을 떠 있는 알약으로 만든다.
207
+ *
208
+ * pill — each header cell floats as a rounded pill.
209
+ */
210
+ export declare const HEADER_PILL: TokenDelta;
211
+ /**
212
+ * 내장 헤더 카탈로그(default 제외 — default 는 빈 델타).
213
+ *
214
+ * Built-in header catalog (default excluded — default is an empty delta).
215
+ */
216
+ export declare const BUILTIN_HEADERS: ReadonlyArray<readonly [string, TokenDelta]>;
217
+ /**
218
+ * 프로세스 전역 기본 헤더 축(내장 부트스트랩).
219
+ *
220
+ * 타이포 실물(`typographyRegistry`)과 같은 꼴이다 — 모듈 전역 싱글턴 + 자유함수 경계.
221
+ * `dispose()` 있는 인스턴스 핸들을 쓰지 않는 이유는 `OpenGrid` 가 컨테이너 요소를 돌려주는
222
+ * 공개 접근자를 제공하지 않기 때문이다(`_container` 는 private). 그 전제 위에 세운 설계는
223
+ * 컨테이너를 못 얻어 조용히 반쪽만 작동한다 — 타이포 트랙이 실측으로 확인한 것이다.
224
+ *
225
+ * Process-global default header axis (built-ins bootstrapped) — same shape as `typographyRegistry`.
226
+ */
227
+ declare class BootstrappedHeaderAxis extends HeaderAxis {
228
+ constructor();
229
+ }
230
+ export declare const headerRegistry: BootstrappedHeaderAxis;
231
+ /**
232
+ * `HeaderAxis` 의 별칭 — 파일명·형제 축 이름(`TypographyRegistry`·`TextureRegistry`)과 맞춘다.
233
+ *
234
+ * Alias of `HeaderAxis`, matching the file name and the sibling axes' naming.
235
+ */
236
+ export { HeaderAxis as HeaderRegistry };
@@ -61,7 +61,7 @@ export declare class ThemeMetaRegistry implements IAppearanceAxis {
61
61
  resolve(valueId: string): AxisResolution;
62
62
  list(): string[];
63
63
  }
64
- /** 내장 테마 메타 카탈로그(대표). / Built-in theme meta catalog (representative). */
64
+ /** 내장 테마 메타 카탈로그. / Built-in theme meta catalog. */
65
65
  export declare const BUILTIN_THEME_METAS: ReadonlyArray<ThemeMeta>;
66
66
  /** 프로세스 전역 기본 테마 메타 레지스트리(내장 부트스트랩). / Process-global default theme-meta registry. */
67
67
  export declare const themeMetaRegistry: ThemeMetaRegistry;
@@ -0,0 +1,122 @@
1
+ import { TokenAxis, TokenDelta } from './AppearanceAxis.js';
2
+ /**
3
+ * 타이포그래피 축 이름공간(자기 소유 토큰 9개 — 축 오염 검증용).
4
+ *
5
+ * `--og-font-size`·`--og-line-height` 는 **의도적으로 빠져 있다**. 둘은 density 축 소유다.
6
+ *
7
+ * Typography namespace (the 9 own tokens — used for the axis-pollution check).
8
+ *
9
+ * `--og-font-size` and `--og-line-height` are deliberately absent: they belong to the density axis.
10
+ */
11
+ export declare const TYPOGRAPHY_TOKENS: ReadonlySet<string>;
12
+ /**
13
+ * 컨테이너에 붙는 축 속성명.
14
+ *
15
+ * The container attribute name for this axis.
16
+ */
17
+ export declare const TYPOGRAPHY_ATTR = "data-og-typography";
18
+ /**
19
+ * assertTypographyOnly — 타이포 델타가 색/형태/밀도/질감 토큰을 담지 않는지 검사(4축 대칭).
20
+ *
21
+ * `assertColorOnly`(ThemeMetaRegistry)·`assertFormOnly`(SkinRegistry)의 세 번째 대칭항이다.
22
+ * 각 축은 자기 이름공간만 낸다는 불변식 1 을 타이포 방향으로도 기계강제한다.
23
+ *
24
+ * assertTypographyOnly — rejects color/form/density/texture tokens in a typography delta.
25
+ *
26
+ * The third symmetric counterpart to `assertColorOnly` and `assertFormOnly`: invariant 1
27
+ * (each axis emits only its own namespace) is now mechanically enforced in the typography
28
+ * direction too.
29
+ *
30
+ * @param id - 타이포 프리셋 id
31
+ *
32
+ * Typography preset id
33
+ * @param delta - 검사할 타이포 델타
34
+ *
35
+ * Typography delta to validate
36
+ * @throws 이름공간 밖 토큰이 있으면 Error
37
+ *
38
+ * Throws if a token outside the namespace is present
39
+ * @example
40
+ * assertTypographyOnly('my-typo', { '--og-font-size': '12px' }); // throws — --og-font-size 는 density 소유
41
+ */
42
+ export declare function assertTypographyOnly(id: string, delta: TokenDelta): void;
43
+ /**
44
+ * TypographyRegistry — 타이포그래피 제5축. 등록 게이트가 정직 가드 2종을 집행한다.
45
+ *
46
+ * named 값은 relayout 을 요구하지 않는다(서체 교체는 CSS 재페인트 — 행높이는 density 소유라 좌표 불변).
47
+ *
48
+ * TypographyRegistry — the 5th (typography) axis. The registration gate enforces two honesty guards.
49
+ *
50
+ * Named values do not require relayout: swapping a face only repaints, and row height belongs to density.
51
+ *
52
+ * @example
53
+ * typographyRegistry.resolve('ledger'); // { tokens:{'--og-font-family':…,'--og-font-variant-numeric':'tabular-nums slashed-zero'}, attr:{name:'data-og-typography',value:'ledger'} }
54
+ * typographyRegistry.resolve('default'); // { tokens:{} } — 속성 미부착, byte-identical
55
+ */
56
+ export declare class TypographyRegistry extends TokenAxis {
57
+ constructor();
58
+ /** 등록 게이트에 축 오염 검사를 선행시킨다(`assertFormOnly`·`assertColorOnly` 와 동형 배선). */
59
+ registerBuiltin(id: string, delta: TokenDelta): void;
60
+ /** 사용자 정의 등록. 축 오염은 throw, 정직 가드는 클램프+경고. */
61
+ define(id: string, delta: TokenDelta): {
62
+ delta: TokenDelta;
63
+ warnings: string[];
64
+ };
65
+ /**
66
+ * 정직 가드 2종(SPEC §2.4).
67
+ *
68
+ * ① `url(`/`@font-face` 가 섞인 서체 스택 → **throw**. 축은 "시스템에 이미 있는 서체를 고르는 일"만
69
+ * 소유한다. 웹폰트를 내려받는 순간 제로 의존성 약속이 깨지고, 폰트가 뜨기 전 렌더가 흔들린다.
70
+ * ② 음수 자간 × CJK 스택 → `normal` 클램프 + 경고. 음수 트래킹은 라틴에서는 멀쩡해 보이지만
71
+ * 한글 음절과 한자 자소를 겹쳐 뭉갠다 — 개발 중에는 보이지 않는 종류의 손상이다.
72
+ * silent override 가 아니라 경고를 남긴다(TextureRegistry 의 opacity 클램프와 동형).
73
+ */
74
+ protected _guardrails(_id: string, delta: TokenDelta): {
75
+ delta: TokenDelta;
76
+ warnings: string[];
77
+ };
78
+ }
79
+ /** ui — UI 그로테스크(권장 기본). / ui — UI grotesque (recommended default). */
80
+ export declare const TYPOGRAPHY_UI: TokenDelta;
81
+ /** ledger — 회계 원장(0↔O 오독 차단). / ledger — accounting ledger (blocks 0↔O misreads). */
82
+ export declare const TYPOGRAPHY_LEDGER: TokenDelta;
83
+ /** terminal — 터미널/코드. / terminal — terminal & code. */
84
+ export declare const TYPOGRAPHY_TERMINAL: TokenDelta;
85
+ /**
86
+ * dense-scan — 고밀도 스캔(compact 밀도의 짝).
87
+ *
88
+ * 광학 크기 보정(밀도별 웨이트·자간 재조정)은 CSS 복합 셀렉터가 소유한다 — 이 델타는 기준값만 담는다.
89
+ *
90
+ * dense-scan — high-density scanning (partner of the compact density).
91
+ *
92
+ * Optical-size correction per density lives in CSS compound selectors; this delta carries the base values only.
93
+ */
94
+ export declare const TYPOGRAPHY_DENSE_SCAN: TokenDelta;
95
+ /** humanist — 휴머니스트(장시간·저시력). 7종 중 유일하게 헤더 서체를 분리한다. / humanist — long-session & low-vision; the only preset that splits the header face. */
96
+ export declare const TYPOGRAPHY_HUMANIST: TokenDelta;
97
+ /** hangul-first — 한글 우선(국문 헤더에 트래킹을 주지 않는다). / hangul-first — Korean-first; no tracking on Korean headers. */
98
+ export declare const TYPOGRAPHY_HANGUL_FIRST: TokenDelta;
99
+ /**
100
+ * cjk-doc — CJK 문서(한·일·중).
101
+ *
102
+ * 한자 통합(直·骨·類 의 자형이 ko/ja/zh 에서 다름) 분기는 `:lang()` CSS 규칙이 소유한다.
103
+ * `lang` 이 없으면 한국어 자형으로 통일된다 — 예측 가능한 실패.
104
+ *
105
+ * cjk-doc — CJK documents (ko/ja/zh).
106
+ *
107
+ * Han-unification splitting is owned by `:lang()` CSS rules; without a `lang` tag everything
108
+ * falls back to Korean glyph shapes — a predictable failure.
109
+ */
110
+ export declare const TYPOGRAPHY_CJK_DOC: TokenDelta;
111
+ /**
112
+ * 내장 타이포 카탈로그(default 제외 — default 는 빈 델타).
113
+ *
114
+ * Built-in typography catalog (default excluded — default is an empty delta).
115
+ */
116
+ export declare const BUILTIN_TYPOGRAPHIES: ReadonlyArray<readonly [string, TokenDelta]>;
117
+ /**
118
+ * 프로세스 전역 기본 타이포 레지스트리(내장 부트스트랩).
119
+ *
120
+ * Process-global default typography registry (built-ins bootstrapped).
121
+ */
122
+ export declare const typographyRegistry: TypographyRegistry;
@@ -2,6 +2,7 @@ export type { AxisId, TokenDelta, AxisAttr, AxisResolution, AxisDefineResult, IA
2
2
  export { DEFAULT_AXIS_VALUE, EMPTY_RESOLUTION, assertNamespace, TokenAxis } from './AppearanceAxis.js';
3
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
4
  export { TextureRegistry, textureRegistry, TEXTURE_TOKENS, TEXTURE_OPACITY_CAP, BUILTIN_TEXTURES, TEXTURE_LINEN, TEXTURE_PAPER_GRAIN, TEXTURE_GRAPH, } from './TextureRegistry.js';
5
+ export { TypographyRegistry, typographyRegistry, TYPOGRAPHY_TOKENS, TYPOGRAPHY_ATTR, assertTypographyOnly, BUILTIN_TYPOGRAPHIES, TYPOGRAPHY_UI, TYPOGRAPHY_LEDGER, TYPOGRAPHY_TERMINAL, TYPOGRAPHY_DENSE_SCAN, TYPOGRAPHY_HUMANIST, TYPOGRAPHY_HANGUL_FIRST, TYPOGRAPHY_CJK_DOC, } from './TypographyRegistry.js';
5
6
  export type { ThemeMeta, EmotionalTemperature } from './ThemeMetaRegistry.js';
6
7
  export { ThemeMetaRegistry, themeMetaRegistry, assertColorOnly, BUILTIN_THEME_METAS, } from './ThemeMetaRegistry.js';
7
8
  export { SkinAxisAdapter, IconAxisAdapter } from './axisAdapters.js';
@@ -14,7 +14,7 @@
14
14
  * principle), C5.2 (event names `<subject><Verb>` camelCase)
15
15
  *
16
16
  * 책임 경계: 이 파일은 **펼침 상태(Set<rowId>)와 규칙**만 다룬다. DOM/서브그리드 생명주기는
17
- * SubgridCache, flat 배열 스플라이스는 DetailSplice 가 담당한다(관심사 분리, Booch 경계).
17
+ * SubgridCache, flat 배열 스플라이스는 DetailSplice 가 담당한다(관심사 분리, 객체설계 경계).
18
18
  * / Responsibility boundary: this file handles **only the expansion state (Set<rowId>) and its rules**. DOM /
19
19
  * subgrid lifecycle belongs to SubgridCache; flat-array splicing belongs to DetailSplice (separation of concerns).
20
20
  *
@@ -4,11 +4,11 @@
4
4
  *
5
5
  * 계약 근거:
6
6
  * - docs/design/grid-features-2026-07/11_design_F2_v2.md §3.1(DetailEntry: host/instance/built),
7
- * §5(Mount-once + detached 캐시 + 편집중 skip-rebuild — MCCONNELL-04 해소),
7
+ * §5(Mount-once + detached 캐시 + 편집중 skip-rebuild — REVIEW-04 해소),
8
8
  * §5(5)(collapse: cache!==true 면 destroy, cache:true 면 host 캐시 유지)
9
9
  * / Contract basis:
10
10
  * - 11_design_F2_v2.md §3.1 (DetailEntry: host/instance/built), §5 (mount-once + detached cache +
11
- * skip-rebuild while editing — resolves review item MCCONNELL-04), §5(5) (collapse: destroy when cache!==true,
11
+ * skip-rebuild while editing — resolves review item REVIEW-04), §5(5) (collapse: destroy when cache!==true,
12
12
  * keep host cached when cache:true)
13
13
  *
14
14
  * 핵심 의미론(§5 "핵심 통찰"): `_body.innerHTML=''`(GridRenderer 매 렌더 teardown, CON-2)는
@@ -0,0 +1,144 @@
1
+ import { HeaderPresetMeta } from '../core/appearance/HeaderRegistry.js';
2
+ import { TokenDelta, AxisDefineResult } from '../core/appearance/AppearanceAxis.js';
3
+ import { RegisterOptions, RegisterResult } from '../core/extension/Registry.js';
4
+ export { HeaderAxis, HeaderRegistry, headerRegistry, HEADER_TOKENS, HEADER_ATTR, assertHeaderOnly, } from '../core/appearance/HeaderRegistry.js';
5
+ export type { HeaderPresetMeta } from '../core/appearance/HeaderRegistry.js';
6
+ export type { TokenDelta, AxisDefineResult } from '../core/appearance/AppearanceAxis.js';
7
+ export type { RegisterOptions, RegisterResult, RegistryEntry } from '../core/extension/Registry.js';
8
+ /**
9
+ * 내장 프리셋 4종 — id → 형태 토큰 델타.
10
+ *
11
+ * 값의 정본은 `src/styles/header.css` 의 프리셋 블록 폴백과 같다. 요소 경로에서는 CSS 가,
12
+ * 그리드 경로에서는 이 델타가 같은 형태로 수렴한다.
13
+ *
14
+ * The four built-in presets — id → shape-token delta.
15
+ *
16
+ * These mirror the fallbacks in the preset blocks of `src/styles/header.css`.
17
+ */
18
+ export declare const HEADER_PRESETS: Readonly<Record<string, TokenDelta>>;
19
+ /**
20
+ * `applyHeader` 가 어느 경로로 적용했는지.
21
+ *
22
+ * Which path `applyHeader` took.
23
+ *
24
+ * - `'element'` — 컨테이너 요소에 `data-og-header` 를 붙였다. CSS 프리셋이 전부 작동한다(완전 적용).
25
+ * - `'grid-vars'` — 그리드 공개 API 로 형태 토큰만 주입했다. 속성이 없어 **프리셋 규칙은 비활성**이다.
26
+ */
27
+ export type HeaderApplyMode = 'element' | 'grid-vars';
28
+ /** `applyHeader` 결과. / Result of `applyHeader`. */
29
+ export interface HeaderApplyResult {
30
+ /** 적용 경로. / The path taken. */
31
+ readonly mode: HeaderApplyMode;
32
+ /** 정직 고지(경로 제약·미등록 id 등). 빈 배열이면 완전 적용. / Honest notices; empty means fully applied. */
33
+ readonly warnings: string[];
34
+ }
35
+ /**
36
+ * 그리드 경로가 요구하는 최소 구조 — `OpenGrid` 가 구조적으로 만족한다.
37
+ *
38
+ * `OpenGrid` 를 타입으로 import 하지 않는 이유는 플러그인 번들이 코어 타입 그래프에 묶이지 않게
39
+ * 하기 위함이다. `setThemeVar(k, v)` 는 컨테이너 인라인 CSS 변수를 세팅하는 공개 메서드다.
40
+ *
41
+ * The minimal shape the grid path needs — `OpenGrid` satisfies it structurally.
42
+ */
43
+ export interface HeaderGridTarget {
44
+ setThemeVar(name: string, value: string): void;
45
+ }
46
+ /**
47
+ * 머리글 프리셋을 적용한다. 코어 무수정 경로.
48
+ *
49
+ * **두 경로가 있고, 능력 차이가 타이포 축보다 훨씬 크다. 정직하게 밝힌다.**
50
+ *
51
+ * 1. `target` 이 **HTMLElement**(그리드 컨테이너 = `.og-container`)이면 `data-og-header` 속성을
52
+ * 붙인다. `header.css` 의 프리셋 블록이 전부 살아난다. **이 경로가 완전판이며
53
+ * `open-grid/header.css` 로드가 전제다.** 값을 인라인하지 않는 이유는 인라인 스타일이
54
+ * 프리셋의 T1(토큰 재정의) 규칙보다 강해 프리셋을 덮어버리기 때문이다.
55
+ * 2. `target` 이 **그리드 인스턴스**이면 공개 `setThemeVar()` 로 형태 토큰 8개만 인라인 주입한다.
56
+ * `OpenGrid` 는 컨테이너 요소를 반환하는 공개 접근자를 제공하지 않으므로(`_container` 는
57
+ * private) **속성을 붙일 방법이 없다.** 헤더 축은 프리셋의 거의 전부가 속성 조건부 셀렉터라
58
+ * **이 경로로는 사실상 아무 변화가 없다** — 타이포 축과 달리 "반쪽" 이 아니라 "거의 무동작" 이다.
59
+ * 그 사실을 경고로 반환한다.
60
+ *
61
+ * 완전 적용이 필요하면 컨테이너 요소를 직접 넘겨라(`document.querySelector('.og-container')`).
62
+ *
63
+ * Apply a header preset. Requires no core modification.
64
+ *
65
+ * **There are two paths and the capability gap is much wider than the typography axis's.**
66
+ *
67
+ * 1. An **HTMLElement** target gets the `data-og-header` attribute and every CSS preset rule works.
68
+ * 2. A **grid instance** target gets only the 8 shape tokens injected inline. Because virtually all
69
+ * preset rules are attribute-conditional, this path produces almost no visible change — this is
70
+ * returned as a warning rather than failing silently.
71
+ *
72
+ * @param target - 그리드 컨테이너 요소 또는 그리드 인스턴스
73
+ *
74
+ * The grid container element, or a grid instance
75
+ * @param id - 프리셋 id(`'default'` 는 축 해제 = 오늘의 머리글)
76
+ *
77
+ * Preset id (`'default'` clears the axis)
78
+ * @returns 적용 경로 + 정직 고지
79
+ *
80
+ * The path taken plus honest notices
81
+ * @throws target 이 요소도 그리드도 아니면 Error
82
+ *
83
+ * Throws when the target is neither an element nor a grid
84
+ * @example
85
+ * import { applyHeader } from 'open-grid/header';
86
+ * import 'open-grid/header.css';
87
+ *
88
+ * applyHeader(document.querySelector('.og-container')!, 'rule'); // 완전 적용
89
+ * applyHeader(grid, 'rule'); // 토큰만 — 경고 1건 반환(사실상 무동작)
90
+ */
91
+ export declare function applyHeader(target: HTMLElement | HeaderGridTarget, id: string): HeaderApplyResult;
92
+ /**
93
+ * 사용자 정의 프리셋 등록.
94
+ *
95
+ * 색·조판·밀도·질감 토큰이 섞여 있으면 등록 게이트가 즉시 throw 한다(축 오염 금지).
96
+ * 특히 `--og-header-bg` 처럼 **접두사가 같아 헤더 것처럼 보이는 색 토큰**도 거부한다 —
97
+ * 그것은 테마 축 소유다. 불투명도는 0~1 로, 음수 길이는 0 으로 클램프하고 경고한다.
98
+ *
99
+ * Register a user-defined preset.
100
+ *
101
+ * The registration gate throws on color/typography/density/texture tokens — including
102
+ * `--og-header-*` color tokens, which merely share the prefix but belong to the theme axis.
103
+ *
104
+ * **내장 5종은 조용히 안 덮인다.** `{ override: true }` 없이 `'rule'` 을 다시 등록하면 거부되고
105
+ * 사유가 `registration` 으로 돌아온다(throw 하지 않는다). 형제 축(밀도·질감·타이포)에는 이 보호가
106
+ * 없어 내장값이 소리 없이 사라진다 — 헤더 축이 처음으로 갖는 안전장치다.
107
+ *
108
+ * Built-ins are protected: re-registering `'rule'` without `{ override: true }` is rejected and the
109
+ * reason comes back in `registration` — it never throws. The sibling axes lack this protection.
110
+ *
111
+ * @param id - 프리셋 id
112
+ *
113
+ * Preset id
114
+ * @param delta - 헤더 형태 토큰 델타
115
+ *
116
+ * Header shape-token delta
117
+ * @param opts - 등록 정책 옵션(`override`·`pluginId`·`priority`) + 프리셋 메타
118
+ *
119
+ * Registration policy options plus preset metadata
120
+ * @returns 클램프 반영된 델타 + 경고 + 등록 판정
121
+ *
122
+ * The clamped delta, warnings, and the registration verdict
123
+ * @example
124
+ * defineHeader('hairline', { '--og-header-rule-width': '1px', '--og-header-hint-opacity': '0.3' });
125
+ *
126
+ * // 내장 보호 — 덮으려면 명시해야 한다
127
+ * defineHeader('rule', d).registration.ok; // false (kept)
128
+ * defineHeader('rule', d, { override: true }).registration.ok; // true (replaced)
129
+ *
130
+ * // 플러그인이 넣은 것만 골라 해제 — 등록의 대칭
131
+ * defineHeader('mine', d, { pluginId: 'acme' });
132
+ * headerRegistry.disposePlugin('acme'); // 1
133
+ */
134
+ export declare function defineHeader(id: string, delta: TokenDelta, opts?: RegisterOptions & {
135
+ meta?: HeaderPresetMeta;
136
+ }): AxisDefineResult & {
137
+ registration: RegisterResult;
138
+ };
139
+ /**
140
+ * 등록된 프리셋 id 목록(피커 UI·인스펙터용).
141
+ *
142
+ * Registered preset ids (for picker UIs and inspectors).
143
+ */
144
+ export declare function listHeader(): string[];