@oddmash/juliya 0.4.0 → 0.4.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 (2) hide show
  1. package/README.md +34 -37
  2. package/package.json +38 -63
package/README.md CHANGED
@@ -1,59 +1,56 @@
1
- # 줄이야 (Juliya)
1
+ # Juliya (줄이야)
2
2
 
3
- 한국어, 영어, 일본어, 중국어 간체의 줄바꿈 경계와 실제 화면 폭을 함께 고려하는 라이브러리입니다. 기존 Kowrap의 공개 API와 한국어 기본 동작을 유지합니다.
3
+ [English](https://github.com/Oddmash/juliya#readme) · [한국어](https://github.com/Oddmash/juliya/blob/main/docs/readme/ko.md) · [日本語](https://github.com/Oddmash/juliya/blob/main/docs/readme/ja.md) · [简体中文](https://github.com/Oddmash/juliya/blob/main/docs/readme/zh.md)
4
4
 
5
- 한국어 어절, 영어 수식 관계, 일본어·중국어의 연속 텍스트와 문장부호를 고려합니다. 언어별 규칙은 휴리스틱이며 모든 문장의 의미를 완벽하게 분석한다는 보장은 없습니다.
5
+ Juliya is a locale-aware text wrapping library for readable headings and short passages in Korean, English, Japanese, and Simplified Chinese. It combines language-specific break boundaries with measured layout width instead of relying on character counts alone.
6
6
 
7
- [체험하기](https://oddmash.github.io/kowrap/#playground) | [문서](https://oddmash.github.io/kowrap/docs/) | [npm](https://www.npmjs.com/package/@oddmash/kowrap)
7
+ [Playground](https://oddmash.github.io/juliya/en/#editor) | [Documentation](https://oddmash.github.io/juliya/en/docs/) | [npm](https://www.npmjs.com/package/@oddmash/juliya)
8
8
 
9
- 랜딩에서는 선택한 언어의 다양한 예제를 표시하고 폭에 따라 실제 줄바꿈 위치가 변화하는 모습을 시연합니다.
9
+ ## Choose a language
10
10
 
11
- ## 언어 선택
12
-
13
- 신규 언어 진입점이 포함된 버전에서는 하나의 패키지에서 원하는 언어를 선택합니다.
11
+ | Language | Entry point | Locale |
12
+ | --- | --- | --- |
13
+ | Korean | `@oddmash/juliya/ko` | `ko` |
14
+ | English | `@oddmash/juliya/en` | `en` |
15
+ | Japanese | `@oddmash/juliya/ja` | `ja` |
16
+ | Simplified Chinese | `@oddmash/juliya/zh` | `zh`, `zh-Hans` |
14
17
 
15
18
  ```ts
16
- import { wrap } from '@oddmash/kowrap/ja';
19
+ import { wrap } from '@oddmash/juliya/en';
17
20
 
18
- const lines = wrap('読みやすい文章を、もっと自然に。', {
19
- width: 10,
20
- measure: text => [...text].length,
21
+ const lines = wrap('Read every line naturally.', {
22
+ width: 12,
23
+ measure: (text) => [...text].length,
21
24
  });
22
25
  ```
23
26
 
24
- 지원 경로는 `/ko`, `/en`, `/ja`, `/zh`입니다. 기존 루트의 `wrap(text, { width, measure })`는 한국어를 유지하며, `locale` 옵션으로 명시적으로 변경할 수 있습니다. React, DOM, Vue, Svelte의 기존 진입점은 유지합니다.
25
-
26
- 새 브랜드 패키지 `@oddmash/juliya`는 동일한 구현과 언어별 진입점으로 발행할 예정입니다. 신규 패키지가 발행되면 `@oddmash/juliya/ko`, `@oddmash/juliya/en`, `@oddmash/juliya/ja`, `@oddmash/juliya/zh`로 가져올 수 있습니다. 기존 패키지는 삭제하거나 덮어쓰지 않습니다.
27
+ This example uses character counts for illustration. The DOM and framework adapters measure actual font and container width. The default root entry point uses Korean unless a locale is selected explicitly.
27
28
 
28
- ## React에서 언어 선택
29
-
30
- 신규 버전의 `JuliyaProvider`로 애플리케이션 언어를 한 번 설정하면 그 하위의 `JuliyaText`와 `useJuliya`가 언어를 공유합니다.
29
+ ## React and Next.js
31
30
 
32
31
  ```tsx
33
32
  import { JuliyaProvider, JuliyaText } from '@oddmash/juliya/react';
34
33
 
35
- <JuliyaProvider locale="ja">
36
- <JuliyaText as="h1">読みやすい文章を、もっと自然に。</JuliyaText>
37
- <JuliyaText as="p">画面の幅に合わせて改行します。</JuliyaText>
34
+ <JuliyaProvider locale="en">
35
+ <JuliyaText as="h1">Read every line naturally.</JuliyaText>
36
+ <JuliyaText as="p">Wrap text based on the available space.</JuliyaText>
38
37
  </JuliyaProvider>
39
38
  ```
40
39
 
41
- 개별 문장에 다른 언어를 적용하려면 `locale`을 직접 지정할 수 있습니다. Provider를 사용하지 않으면 기본 언어는 한국어입니다. 기존 `WrapText`, `useKowrap` 이름은 계속 사용할 수 있습니다. 예제의 새 패키지명은 신규 패키지가 발행된 뒤 사용할 수 있습니다.
42
-
43
- 두 패키지를 함께 사용하는 경우 Provider와 하위 컴포넌트는 동일한 패키지에서 가져오세요. [React 및 i18n 연동 예제](docs/guide/react.md)를 참고하세요.
40
+ The provider shares its locale with child components and hooks. An explicit locale on a child takes precedence. See the [React guide](https://oddmash.github.io/juliya/en/docs/react/).
44
41
 
45
- ## HTML에서 바로 실행하기
42
+ ## Try in a browser
46
43
 
47
- 아래 코드를 `index.html`로 저장하고 인터넷에 연결된 브라우저에서 열면 jsDelivr가 Kowrap `0.3.0`을 불러옵니다.
44
+ Save this Korean example as `index.html` and open it in a browser with an internet connection. The standalone example uses the verified Juliya 0.4.0 CDN entry point.
48
45
 
49
46
  ```html
50
47
  <!doctype html>
51
48
  <html lang="ko">
52
49
  <meta charset="utf-8">
53
- <title>Kowrap 예제</title>
50
+ <title>Juliya 예제</title>
54
51
  <p id="title" style="max-width: 220px; font-size: 24px">팀의 모든 문서를 한곳에서 관리하세요</p>
55
52
  <script type="module">
56
- import { mountKowrap } from 'https://cdn.jsdelivr.net/npm/@oddmash/kowrap@0.3.0/dist/dom/index.js/+esm';
53
+ import { mountKowrap } from 'https://cdn.jsdelivr.net/npm/@oddmash/juliya@0.4.0/dist/dom/index.js/+esm';
57
54
 
58
55
  const title = document.getElementById('title');
59
56
  mountKowrap(title, { text: title.textContent });
@@ -61,16 +58,16 @@ import { JuliyaProvider, JuliyaText } from '@oddmash/juliya/react';
61
58
  </html>
62
59
  ```
63
60
 
64
- ## 특징
61
+ ## Features
65
62
 
66
- - 한국어 어절을 보존하는 균형 잡힌 줄바꿈
67
- - 화면 폭 변화에 따른 자동 재계산
68
- - 의도적인 개행 위치 지정
69
- - 강조, 링크 등 인라인 마크업 유지
70
- - React, Next.js, Vue, Svelte 및 일반 HTML 지원
63
+ - Language-specific line breaking and balanced line widths.
64
+ - Automatic recalculation when the container or font changes.
65
+ - Explicit line breaks and nested inline markup preservation.
66
+ - React, Next.js, Vue, Svelte, and plain HTML support.
67
+ - Heuristic language rules, not comprehensive natural-language analysis. Best suited to headings and short passages.
71
68
 
72
- ## 지원 범위
69
+ ## Migrating from Kowrap
73
70
 
74
- kowrap은 제목과 짧은 문장에 적합합니다. 강조와 링크를 포함한 중첩 인라인 텍스트도 지원합니다.
71
+ `@oddmash/kowrap@0.4.0` is the final legacy release. All future updates and fixes are published exclusively as `@oddmash/juliya`. Existing versions remain available. Switch the package name while retaining the public API and subpath imports. Compatibility names such as `mountKowrap`, `WrapText`, and `useKowrap` remain available in Juliya.
75
72
 
76
- [기여 안내](CONTRIBUTING.md)
73
+ [Migration and usage](https://oddmash.github.io/juliya/en/docs/) | [Contributing](CONTRIBUTING.md) | [MIT License](LICENSE)
package/package.json CHANGED
@@ -1,78 +1,53 @@
1
1
  {
2
2
  "name": "@oddmash/juliya",
3
3
  "license": "MIT",
4
- "version": "0.4.0",
4
+ "version": "0.4.1",
5
5
  "description": "Locale-aware text wrapping for Korean, English, Japanese and Simplified Chinese",
6
6
  "type": "module",
7
+ "packageManager": "pnpm@11.25.0",
7
8
  "exports": {
8
- ".": {
9
- "types": "./dist/index.d.ts",
10
- "import": "./dist/index.js"
11
- },
12
- "./ko": {
13
- "types": "./dist/core/locales/ko.d.ts",
14
- "import": "./dist/core/locales/ko.js"
15
- },
16
- "./en": {
17
- "types": "./dist/core/locales/en.d.ts",
18
- "import": "./dist/core/locales/en.js"
19
- },
20
- "./ja": {
21
- "types": "./dist/core/locales/ja.d.ts",
22
- "import": "./dist/core/locales/ja.js"
23
- },
24
- "./zh": {
25
- "types": "./dist/core/locales/zh.d.ts",
26
- "import": "./dist/core/locales/zh.js"
27
- },
28
- "./browser": {
29
- "types": "./dist/dom/index.d.ts",
30
- "import": "./dist/dom/index.js"
31
- },
32
- "./dom": {
33
- "types": "./dist/dom/index.d.ts",
34
- "import": "./dist/dom/index.js"
35
- },
36
- "./react": {
37
- "types": "./dist/adapters/react/index.d.ts",
38
- "import": "./dist/adapters/react/index.js"
39
- },
40
- "./react/server": {
41
- "types": "./dist/adapters/react/server.d.ts",
42
- "import": "./dist/adapters/react/server.js"
43
- },
44
- "./vue": {
45
- "types": "./dist/adapters/vue/index.d.ts",
46
- "import": "./dist/adapters/vue/index.js"
47
- },
48
- "./svelte": {
49
- "types": "./dist/adapters/svelte/index.d.ts",
50
- "import": "./dist/adapters/svelte/index.js"
51
- }
9
+ ".": { "types": "./dist/index.d.ts", "import": "./dist/index.js" },
10
+ "./ko": { "types": "./dist/core/locales/ko.d.ts", "import": "./dist/core/locales/ko.js" },
11
+ "./en": { "types": "./dist/core/locales/en.d.ts", "import": "./dist/core/locales/en.js" },
12
+ "./ja": { "types": "./dist/core/locales/ja.d.ts", "import": "./dist/core/locales/ja.js" },
13
+ "./zh": { "types": "./dist/core/locales/zh.d.ts", "import": "./dist/core/locales/zh.js" },
14
+ "./browser": { "types": "./dist/dom/index.d.ts", "import": "./dist/dom/index.js" },
15
+ "./dom": { "types": "./dist/dom/index.d.ts", "import": "./dist/dom/index.js" },
16
+ "./react": { "types": "./dist/adapters/react/index.d.ts", "import": "./dist/adapters/react/index.js" },
17
+ "./react/server": { "types": "./dist/adapters/react/server.d.ts", "import": "./dist/adapters/react/server.js" },
18
+ "./vue": { "types": "./dist/adapters/vue/index.d.ts", "import": "./dist/adapters/vue/index.js" },
19
+ "./svelte": { "types": "./dist/adapters/svelte/index.d.ts", "import": "./dist/adapters/svelte/index.js" }
52
20
  },
53
- "files": [
54
- "dist",
55
- "README.md",
56
- "NOTICE.md"
57
- ],
21
+ "files": ["dist", "README.md", "NOTICE.md"],
58
22
  "publishConfig": {
59
23
  "access": "public",
60
24
  "registry": "https://registry.npmjs.org/"
61
25
  },
62
26
  "sideEffects": false,
63
- "engines": {
64
- "node": ">=20"
27
+ "scripts": {
28
+ "lint": "eslint . --max-warnings 0",
29
+ "lint:fix": "eslint . --fix --max-warnings 0",
30
+ "build": "node scripts/clean-dist.mjs && tsc -p tsconfig.json",
31
+ "test": "pnpm run build && node --test test/*.test.mjs",
32
+ "test:next": "pnpm run build && pnpm --dir test/next-app run build",
33
+ "test:hydration": "pnpm run build && pnpm --dir test/next-app run test:hydration",
34
+ "test:frameworks": "pnpm run build && pnpm --dir test/framework-app test",
35
+ "test:browser": "pnpm run test:next && pnpm --dir test/next-app run test:browser",
36
+ "test:package": "pnpm run build && node --test test/package.mjs",
37
+ "build:site": "pnpm run build && pnpm --dir site run build",
38
+ "test:site": "pnpm run build:site && node --test test/site.mjs",
39
+ "prepack": "pnpm run build"
65
40
  },
66
- "peerDependencies": {
67
- "react": "^18.2.0 || ^19.0.0"
41
+ "engines": { "node": ">=20" },
42
+ "peerDependencies": { "react": "^18.2.0 || ^19.0.0" },
43
+ "peerDependenciesMeta": { "react": { "optional": true } },
44
+ "devDependencies": {
45
+ "eslint": "10.14.0",
46
+ "typescript-eslint": "8.72.2",
47
+ "@types/react": "19.3.0",
48
+ "react": "19.3.1",
49
+ "react-dom": "19.3.1",
50
+ "typescript": "6.0.3"
68
51
  },
69
- "peerDependenciesMeta": {
70
- "react": {
71
- "optional": true
72
- }
73
- },
74
- "repository": {
75
- "type": "git",
76
- "url": "https://github.com/Oddmash/kowrap.git"
77
- }
52
+ "repository": { "type": "git", "url": "git+https://github.com/Oddmash/juliya.git" }
78
53
  }