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.
- package/CHANGELOG.md +59 -0
- package/README.md +18 -1
- package/dist/{OpenGrid-BOtTt5aI.cjs → OpenGrid-CT9bV6On.cjs} +7 -7
- package/dist/OpenGrid-CT9bV6On.cjs.map +1 -0
- package/dist/{OpenGrid-sI_vdHQw.js → OpenGrid-DACnZdEy.js} +7 -7
- package/dist/OpenGrid-DACnZdEy.js.map +1 -0
- package/dist/Registry-CPJYOqCn.js.map +1 -0
- package/dist/Registry-D74ZmdDz.cjs.map +1 -0
- package/dist/{index-D1l3XFCM.cjs → index-Brfso4Ry.cjs} +2 -2
- package/dist/index-Brfso4Ry.cjs.map +1 -0
- package/dist/index-CeJ-0-80.cjs.map +1 -0
- package/dist/index-DnarQ4eR.js.map +1 -0
- package/dist/{index-B3fKi43v.js → index-al9Mbv3E.js} +2 -2
- package/dist/index-al9Mbv3E.js.map +1 -0
- package/dist/open-grid-base.css +98 -35
- package/dist/open-grid-header.cjs +188 -0
- package/dist/open-grid-header.cjs.map +1 -0
- package/dist/open-grid-header.css +386 -0
- package/dist/open-grid-header.js +197 -0
- package/dist/open-grid-header.js.map +1 -0
- package/dist/open-grid-react.cjs +1 -1
- package/dist/open-grid-react.cjs.map +1 -0
- package/dist/open-grid-react.js +1 -1
- package/dist/open-grid-react.js.map +1 -0
- package/dist/open-grid-themes.css +774 -1
- package/dist/open-grid-typography.cjs +97 -0
- package/dist/open-grid-typography.cjs.map +1 -0
- package/dist/open-grid-typography.css +181 -0
- package/dist/open-grid-typography.js +105 -0
- package/dist/open-grid-typography.js.map +1 -0
- package/dist/open-grid-vue.cjs +1 -1
- package/dist/open-grid-vue.cjs.map +1 -0
- package/dist/open-grid-vue.js +1 -1
- package/dist/open-grid-vue.js.map +1 -0
- package/dist/open-grid.cjs +1 -1
- package/dist/open-grid.cjs.map +1 -0
- package/dist/open-grid.js +2 -2
- package/dist/open-grid.js.map +1 -0
- package/dist/types/core/DetailManager.d.ts +2 -2
- package/dist/types/core/FormulaController.d.ts +2 -2
- package/dist/types/core/MutationService.d.ts +2 -2
- package/dist/types/core/OpenGrid.d.ts +4 -4
- package/dist/types/core/appearance/AppearanceAxis.d.ts +1 -1
- package/dist/types/core/appearance/HeaderRegistry.d.ts +236 -0
- package/dist/types/core/appearance/ThemeMetaRegistry.d.ts +1 -1
- package/dist/types/core/appearance/TypographyRegistry.d.ts +122 -0
- package/dist/types/core/appearance/index.d.ts +1 -0
- package/dist/types/core/detail/DetailState.d.ts +1 -1
- package/dist/types/core/detail/SubgridCache.d.ts +2 -2
- package/dist/types/header/index.d.ts +144 -0
- package/dist/types/typography/index.d.ts +128 -0
- package/dist/xlsx.min-BQ1o3sB6.cjs.map +1 -0
- package/dist/xlsx.min-Bbz2ZypC.js.map +1 -0
- package/package.json +126 -114
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { TokenDelta } from '../core/appearance/AppearanceAxis.js';
|
|
2
|
+
export { TypographyRegistry, typographyRegistry, TYPOGRAPHY_TOKENS, TYPOGRAPHY_ATTR, assertTypographyOnly, } from '../core/appearance/TypographyRegistry.js';
|
|
3
|
+
export type { TokenDelta } from '../core/appearance/AppearanceAxis.js';
|
|
4
|
+
/**
|
|
5
|
+
* 내장 프리셋 7종 — id → 토큰 델타.
|
|
6
|
+
*
|
|
7
|
+
* 값의 정본은 `src/styles/typography.css` 의 프리셋 블록과 같다. 요소 경로에서는 CSS 가,
|
|
8
|
+
* 그리드 경로에서는 이 델타가 같은 결과를 낸다(§'두 경로' 참조).
|
|
9
|
+
*
|
|
10
|
+
* The seven built-in presets — id → token delta.
|
|
11
|
+
*
|
|
12
|
+
* These values mirror the preset blocks in `src/styles/typography.css`: the element path is
|
|
13
|
+
* driven by CSS, the grid path by this delta, and both land on the same tokens.
|
|
14
|
+
*/
|
|
15
|
+
export declare const TYPOGRAPHY_PRESETS: Readonly<Record<string, TokenDelta>>;
|
|
16
|
+
/**
|
|
17
|
+
* `applyTypography` 가 어느 경로로 적용했는지.
|
|
18
|
+
*
|
|
19
|
+
* Which path `applyTypography` took.
|
|
20
|
+
*
|
|
21
|
+
* - `'element'` — 컨테이너 요소에 `data-og-typography` 를 붙였다. CSS 프리셋이 전부 작동한다(완전 적용).
|
|
22
|
+
* - `'grid-vars'` — 그리드 공개 API 로 CSS 변수만 주입했다. 속성이 없어 **속성 조건부 규칙은 비활성**이다.
|
|
23
|
+
*/
|
|
24
|
+
export type TypographyApplyMode = 'element' | 'grid-vars';
|
|
25
|
+
/** `applyTypography` 결과. / Result of `applyTypography`. */
|
|
26
|
+
export interface TypographyApplyResult {
|
|
27
|
+
/** 적용 경로. / The path taken. */
|
|
28
|
+
readonly mode: TypographyApplyMode;
|
|
29
|
+
/** 정직 고지(경로 제약·미등록 id 등). 빈 배열이면 완전 적용. / Honest notices; empty means fully applied. */
|
|
30
|
+
readonly warnings: string[];
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* 그리드 경로가 요구하는 최소 구조 — `OpenGrid` 가 구조적으로 만족한다.
|
|
34
|
+
*
|
|
35
|
+
* `OpenGrid` 를 타입으로 import 하지 않는 이유는 플러그인 번들이 코어 타입 그래프에 묶이지 않게
|
|
36
|
+
* 하기 위함이다. `setThemeVar(k, v)` 는 컨테이너 인라인 CSS 변수를 세팅하는 공개 메서드다.
|
|
37
|
+
*
|
|
38
|
+
* The minimal shape the grid path needs — `OpenGrid` satisfies it structurally.
|
|
39
|
+
*
|
|
40
|
+
* `OpenGrid` is not imported as a type so the plugin bundle stays untangled from the core type
|
|
41
|
+
* graph. `setThemeVar(k, v)` is the public method that sets an inline CSS variable on the container.
|
|
42
|
+
*/
|
|
43
|
+
export interface TypographyGridTarget {
|
|
44
|
+
setThemeVar(name: string, value: string): void;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* 프리셋을 적용한다. 코어 무수정 경로.
|
|
48
|
+
*
|
|
49
|
+
* **두 경로가 있고, 능력이 다르다. 정직하게 밝힌다.**
|
|
50
|
+
*
|
|
51
|
+
* 1. `target` 이 **HTMLElement**(그리드 컨테이너 = `.og-container`)이면 `data-og-typography`
|
|
52
|
+
* 속성을 붙인다. `typography.css` 의 프리셋 블록·밀도 복합 셀렉터(광학 크기)·`:lang()` 한자
|
|
53
|
+
* 분기까지 전부 살아난다. **이 경로가 완전판이며, `open-grid-typography.css` 로드가 전제다**
|
|
54
|
+
* (값을 인라인하지 않는 이유: 인라인은 복합 셀렉터 보정을 덮어버린다).
|
|
55
|
+
* 2. `target` 이 **그리드 인스턴스**이면 공개 `setThemeVar()` 로 9개 토큰을 인라인 주입한다.
|
|
56
|
+
* `OpenGrid` 는 컨테이너 요소를 반환하는 공개 접근자를 제공하지 않으므로(2026-08 조사 결과:
|
|
57
|
+
* `_container` 는 private, 공개 표면에 getter 없음) **속성을 붙일 방법이 없다.** 따라서
|
|
58
|
+
* `[data-og-typography="dense-scan"][data-og-density="compact"]` 같은 속성 조건부 규칙과
|
|
59
|
+
* `cjk-doc` 의 `:lang()` 분기는 **작동하지 않는다.** 그 사실을 경고로 반환한다.
|
|
60
|
+
*
|
|
61
|
+
* 완전 적용이 필요하면 컨테이너 요소를 직접 넘겨라(`document.querySelector('#myGrid')`).
|
|
62
|
+
*
|
|
63
|
+
* Apply a preset. Requires no core modification.
|
|
64
|
+
*
|
|
65
|
+
* **There are two paths and they are not equally capable — stated plainly.**
|
|
66
|
+
*
|
|
67
|
+
* 1. An **HTMLElement** target (the grid container, `.og-container`) gets the
|
|
68
|
+
* `data-og-typography` attribute, so every CSS rule works, including density compound
|
|
69
|
+
* selectors (optical sizing) and the `:lang()` Han-unification split. **This is the full path.**
|
|
70
|
+
* 2. A **grid instance** target gets the nine tokens injected inline via the public
|
|
71
|
+
* `setThemeVar()`. `OpenGrid` exposes no public accessor for its container element (verified
|
|
72
|
+
* 2026-08: `_container` is private with no public getter), so the attribute cannot be set.
|
|
73
|
+
* Attribute-conditional rules therefore do not apply; this is returned as a warning.
|
|
74
|
+
*
|
|
75
|
+
* @param target - 그리드 컨테이너 요소 또는 그리드 인스턴스
|
|
76
|
+
*
|
|
77
|
+
* The grid container element, or a grid instance
|
|
78
|
+
* @param id - 프리셋 id(`'default'` 는 축 해제)
|
|
79
|
+
*
|
|
80
|
+
* Preset id (`'default'` clears the axis)
|
|
81
|
+
* @returns 적용 경로 + 정직 고지
|
|
82
|
+
*
|
|
83
|
+
* The path taken plus honest notices
|
|
84
|
+
* @throws target 이 요소도 그리드도 아니면 Error
|
|
85
|
+
*
|
|
86
|
+
* Throws when the target is neither an element nor a grid
|
|
87
|
+
* @example
|
|
88
|
+
* import { applyTypography } from 'open-grid/typography';
|
|
89
|
+
* import 'open-grid/dist/open-grid-typography.css';
|
|
90
|
+
*
|
|
91
|
+
* applyTypography(document.querySelector('#grid .og-container')!, 'ledger'); // 완전 적용
|
|
92
|
+
* applyTypography(grid, 'ledger'); // 변수만 — 경고 1건 반환
|
|
93
|
+
*/
|
|
94
|
+
export declare function applyTypography(target: HTMLElement | TypographyGridTarget, id: string): TypographyApplyResult;
|
|
95
|
+
/**
|
|
96
|
+
* 사용자 정의 프리셋 등록.
|
|
97
|
+
*
|
|
98
|
+
* 색·형태·밀도·질감 토큰이 섞여 있으면 등록 게이트가 즉시 throw 한다(축 오염 금지). 웹폰트
|
|
99
|
+
* 선언(`url(`/`@font-face`)도 throw. 음수 자간 × CJK 스택은 `normal` 로 클램프하고 경고한다.
|
|
100
|
+
*
|
|
101
|
+
* Register a user-defined preset.
|
|
102
|
+
*
|
|
103
|
+
* The registration gate throws immediately on color/form/density/texture tokens (axis pollution)
|
|
104
|
+
* and on web-font declarations. A negative tracking value on a CJK stack is clamped to `normal`
|
|
105
|
+
* with a warning.
|
|
106
|
+
*
|
|
107
|
+
* @param id - 프리셋 id
|
|
108
|
+
*
|
|
109
|
+
* Preset id
|
|
110
|
+
* @param delta - 타이포 토큰 델타
|
|
111
|
+
*
|
|
112
|
+
* Typography token delta
|
|
113
|
+
* @returns 클램프 반영된 델타 + 경고
|
|
114
|
+
*
|
|
115
|
+
* The clamped delta plus warnings
|
|
116
|
+
* @example
|
|
117
|
+
* defineTypography('brand', { '--og-font-family': '"My Sans", sans-serif', '--og-font-weight': '450' });
|
|
118
|
+
*/
|
|
119
|
+
export declare function defineTypography(id: string, delta: TokenDelta): {
|
|
120
|
+
delta: TokenDelta;
|
|
121
|
+
warnings: string[];
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* 등록된 프리셋 id 목록(피커 UI·인스펙터용).
|
|
125
|
+
*
|
|
126
|
+
* Registered preset ids (for picker UIs and inspectors).
|
|
127
|
+
*/
|
|
128
|
+
export declare function listTypography(): string[];
|