@sankyu/react-circle-flags 1.6.2 → 1.6.4

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  <div align="center">
2
2
  <a href="https://react-circle-flags.js.org/">
3
- <img src="https://raw.githubusercontent.com/SanKyu-Lab/react-circle-flags/main/.github/assets/favicon.svg" alt="@sankyu/react-circle-flags" width="120" height="120" />
3
+ <img src="https://raw.githubusercontent.com/SanKyu-Lab/circle-flags-ui/main/.github/assets/favicon.svg" alt="@sankyu/react-circle-flags" width="120" height="120" />
4
4
  </a>
5
5
  </div>
6
6
 
@@ -8,11 +8,11 @@
8
8
 
9
9
  # @sankyu/react-circle-flags
10
10
 
11
- [![npm version](https://img.shields.io/npm/v/%40sankyu%2Freact-circle-flags?style=flat-square&label=%40sankyu%2Freact-circle-flags)](https://www.npmjs.com/package/@sankyu/react-circle-flags) [![Bundle Size](https://img.shields.io/bundlephobia/minzip/@sankyu/react-circle-flags?style=flat-square&label=Bundle%20Size)](https://bundlephobia.com/package/@sankyu/react-circle-flags) [![npm downloads](https://img.shields.io/npm/dm/@sankyu/react-circle-flags.svg?style=flat-square&label=NPM%20Downloads)](https://www.npmjs.com/package/@sankyu/react-circle-flags) [![Last Commit](https://img.shields.io/github/last-commit/SanKyu-Lab/react-circle-flags?style=flat-square&label=Last%20Commit)](https://github.com/SanKyu-Lab/react-circle-flags/commits/main)
11
+ [![npm version](https://img.shields.io/npm/v/%40sankyu%2Freact-circle-flags?style=flat-square&label=%40sankyu%2Freact-circle-flags)](https://www.npmjs.com/package/@sankyu/react-circle-flags) [![Bundle Size](https://img.shields.io/bundlephobia/minzip/@sankyu/react-circle-flags?style=flat-square&label=Bundle%20Size)](https://bundlephobia.com/package/@sankyu/react-circle-flags) [![npm downloads](https://img.shields.io/npm/dm/@sankyu/react-circle-flags.svg?style=flat-square&label=NPM%20Downloads)](https://www.npmjs.com/package/@sankyu/react-circle-flags) [![Last Commit](https://img.shields.io/github/last-commit/SanKyu-Lab/circle-flags-ui?style=flat-square&label=Last%20Commit)](https://github.com/SanKyu-Lab/circle-flags-ui/commits/main)
12
12
 
13
13
  <!-- CI/CD & Quality -->
14
14
 
15
- [![CI](https://github.com/SanKyu-Lab/react-circle-flags/actions/workflows/ci.yml/badge.svg)](https://github.com/SanKyu-Lab/react-circle-flags/actions/workflows/ci.yml) [![Release](https://github.com/SanKyu-Lab/react-circle-flags/actions/workflows/release.yml/badge.svg)](https://github.com/SanKyu-Lab/react-circle-flags/actions/workflows/release.yml) [![codecov](https://codecov.io/gh/SanKyu-Lab/react-circle-flags/branch/main/graph/badge.svg?token=YHZ46T51AG)](https://codecov.io/gh/SanKyu-Lab/react-circle-flags)
15
+ [![CI](https://github.com/SanKyu-Lab/circle-flags-ui/actions/workflows/ci.yml/badge.svg)](https://github.com/SanKyu-Lab/circle-flags-ui/actions/workflows/ci.yml) [![Release](https://github.com/SanKyu-Lab/circle-flags-ui/actions/workflows/release.yml/badge.svg)](https://github.com/SanKyu-Lab/circle-flags-ui/actions/workflows/release.yml) [![codecov](https://codecov.io/gh/SanKyu-Lab/circle-flags-ui/branch/main/graph/badge.svg)](https://codecov.io/gh/SanKyu-Lab/circle-flags-ui)
16
16
 
17
17
  [![TypeScript supported](https://img.shields.io/badge/TypeScript-supported-blue?style=flat-square&logo=typescript)](https://www.typescriptlang.org/) [![Tree-shakable](https://badgen.net/bundlephobia/tree-shaking/@sankyu/react-circle-flags)](https://bundlephobia.com/package/@sankyu/react-circle-flags) [![MIT License](https://img.shields.io/badge/License-MIT-green?style=flat-square&logo=opensourceinitiative)](./LICENSE)
18
18
 
@@ -20,7 +20,7 @@
20
20
 
21
21
  English Version | [简体中文](./README.zh.md)
22
22
 
23
- :star: **Star us on [GitHub](https://github.com/Sankyu-Lab/react-circle-flags)** | :bug: **Report Issues [here](https://github.com/Sankyu-Lab/react-circle-flags/issues)**
23
+ :star: **Star us on [GitHub](https://github.com/Sankyu-Lab/circle-flags-ui)** | :bug: **Report Issues [here](https://github.com/Sankyu-Lab/circle-flags-ui/issues)**
24
24
 
25
25
  :rocket: **Explore the [Demo Gallery](https://react-circle-flags.js.org/browse)** | :book: **Read the [Documentation](https://react-circle-flags.js.org/docs/guides/getting-started/)**
26
26
 
@@ -36,7 +36,7 @@ Perfect for applications that need fast, crisp country flags without external im
36
36
 
37
37
  ## :world_map: Live Demo
38
38
 
39
- [![Edit react-circle-flags-demo](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/p/sandbox/nyy6vp) [![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/fork/github/SanKyu-Lab/circle-flags-ui/tree/main/examples/example-react?file=src%2FApp.tsx&terminal=dev)
39
+ [![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/fork/github/SanKyu-Lab/circle-flags-ui/tree/main/examples/example-react?file=src%2FApp.tsx&terminal=dev)
40
40
 
41
41
  ## ✨ Key Features
42
42
 
@@ -66,6 +66,25 @@ bun add @sankyu/react-circle-flags
66
66
  > [!TIP]
67
67
  > For more information, you may refer to the [Installation Guide](https://react-circle-flags.js.org/docs/guides/getting-started/installation/).
68
68
 
69
+ ### 🤖 Are you Vibe Coding?
70
+
71
+ Copy this into your AI Agent (Claude Code, Codex, Cursor ..like) to optimize your flags:
72
+
73
+ <details>
74
+ <summary>AI Agent Prompts</summary>
75
+
76
+ ```txt
77
+ Act as an expert Web Engineer. Reference: https://react-circle-flags.js.org/llms.txt & https://react-circle-flags.js.org/llms-small.txt
78
+
79
+ 1. **Audit my project** to find any flag usage:
80
+ - Raw `<img>` tags pointing to `HatScripts/circle-flags` URLs.
81
+ - Legacy `react-circle-flags` library usage.
82
+ 2. **Propose a migration** to the appropriate `@sankyu/{framework}-circle-flags` package based on my current framework (React/Vue/Solid).
83
+ 3. **Optimize for Tree-shaking**: Replace generic `CircleFlag` components or raw tags with **named imports** (e.g., `import { Us } from '...'`) as per the docs.
84
+ ```
85
+
86
+ </details>
87
+
69
88
  ## 🚀 Usage
70
89
 
71
90
  ### Import individual flags (Recommended)
@@ -154,12 +173,17 @@ All flag components are fully typed with TypeScript, providing autocomplete and
154
173
 
155
174
  Importing individual flags ensures that only the used flags are included in your bundle.
156
175
 
176
+ > [!CAUTION]
177
+ > `DynamicFlag` is offline-first and renders runtime codes synchronously, but it bundles all
178
+ > 400+ flags (~600 KB, no tree-shaking). Prefer named imports when possible. If runtime codes
179
+ > are bounded, use a finite named-import map.
180
+
157
181
  > [!TIP]
158
182
  > For more information, you may refer to the [Bundle Size & Tree-shaking Guide](https://react-circle-flags.js.org/docs/guides/getting-started/bundle-size/).
159
183
 
160
184
  ## 🤝 Contributing
161
185
 
162
- Please see [CONTRIBUTING.md](CONTRIBUTING.md) for contribution guidelines.
186
+ Please see [CONTRIBUTING.md](https://github.com/SanKyu-Lab/circle-flags-ui/blob/main/CONTRIBUTING.md) for contribution guidelines.
163
187
 
164
188
  ## 📄 License
165
189
 
package/README.zh.md CHANGED
@@ -1,6 +1,6 @@
1
1
  <div align="center">
2
2
  <a href="https://react-circle-flags.js.org/">
3
- <img src="https://raw.githubusercontent.com/SanKyu-Lab/react-circle-flags/main/.github/assets/favicon.svg" alt="@sankyu/react-circle-flags" width="120" height="120" />
3
+ <img src="https://raw.githubusercontent.com/SanKyu-Lab/circle-flags-ui/main/.github/assets/favicon.svg" alt="@sankyu/react-circle-flags" width="120" height="120" />
4
4
  </a>
5
5
  </div>
6
6
 
@@ -8,11 +8,11 @@
8
8
 
9
9
  # @sankyu/react-circle-flags
10
10
 
11
- [![npm 版本](https://img.shields.io/npm/v/%40sankyu%2Freact-circle-flags?style=flat-square&label=%40sankyu%2Freact-circle-flags)](https://www.npmjs.com/package/@sankyu/react-circle-flags) [![打包大小](https://img.shields.io/bundlephobia/minzip/@sankyu/react-circle-flags?style=flat-square&label=打包大小)](https://bundlephobia.com/package/@sankyu/react-circle-flags) [![npm 下载量](https://img.shields.io/npm/dm/@sankyu/react-circle-flags.svg?style=flat-square&label=NPM%20下载量)](https://www.npmjs.com/package/@sankyu/react-circle-flags) [![最后提交](https://img.shields.io/github/last-commit/SanKyu-Lab/react-circle-flags?style=flat-square&label=最后提交)](https://github.com/SanKyu-Lab/react-circle-flags/commits/main)
11
+ [![npm 版本](https://img.shields.io/npm/v/%40sankyu%2Freact-circle-flags?style=flat-square&label=%40sankyu%2Freact-circle-flags)](https://www.npmjs.com/package/@sankyu/react-circle-flags) [![打包大小](https://img.shields.io/bundlephobia/minzip/@sankyu/react-circle-flags?style=flat-square&label=打包大小)](https://bundlephobia.com/package/@sankyu/react-circle-flags) [![npm 下载量](https://img.shields.io/npm/dm/@sankyu/react-circle-flags.svg?style=flat-square&label=NPM%20下载量)](https://www.npmjs.com/package/@sankyu/react-circle-flags) [![最后提交](https://img.shields.io/github/last-commit/SanKyu-Lab/circle-flags-ui?style=flat-square&label=最后提交)](https://github.com/SanKyu-Lab/circle-flags-ui/commits/main)
12
12
 
13
13
  <!-- CI/CD 与质量 -->
14
14
 
15
- [![CI](https://github.com/SanKyu-Lab/react-circle-flags/actions/workflows/ci.yml/badge.svg)](https://github.com/SanKyu-Lab/react-circle-flags/actions/workflows/ci.yml) [![发布](https://github.com/SanKyu-Lab/react-circle-flags/actions/workflows/release.yml/badge.svg)](https://github.com/SanKyu-Lab/react-circle-flags/actions/workflows/release.yml) [![codecov](https://codecov.io/gh/SanKyu-Lab/react-circle-flags/branch/main/graph/badge.svg?token=YHZ46T51AG)](https://codecov.io/gh/SanKyu-Lab/react-circle-flags)
15
+ [![CI](https://github.com/SanKyu-Lab/circle-flags-ui/actions/workflows/ci.yml/badge.svg)](https://github.com/SanKyu-Lab/circle-flags-ui/actions/workflows/ci.yml) [![发布](https://github.com/SanKyu-Lab/circle-flags-ui/actions/workflows/release.yml/badge.svg)](https://github.com/SanKyu-Lab/circle-flags-ui/actions/workflows/release.yml) [![codecov](https://codecov.io/gh/SanKyu-Lab/circle-flags-ui/branch/main/graph/badge.svg)](https://codecov.io/gh/SanKyu-Lab/circle-flags-ui)
16
16
 
17
17
  [![支持 TypeScript](https://img.shields.io/badge/TypeScript-支持-blue?style=flat-square&logo=typescript)](https://www.typescriptlang.org/) [![Tree-shakable](https://badgen.net/bundlephobia/tree-shaking/@sankyu/react-circle-flags)](https://bundlephobia.com/package/@sankyu/react-circle-flags) [![MIT 许可证](https://img.shields.io/badge/许可证-MIT-green?style=flat-square&logo=opensourceinitiative)](./LICENSE)
18
18
 
@@ -20,7 +20,7 @@
20
20
 
21
21
  简体中文 | [English Version](./README.md)
22
22
 
23
- :star: **在 [GitHub](https://github.com/Sankyu-Lab/react-circle-flags) 上 Star 我们** | :bug: **在此 [提交问题](https://github.com/Sankyu-Lab/react-circle-flags/issues)**
23
+ :star: **在 [GitHub](https://github.com/Sankyu-Lab/circle-flags-ui) 上 Star 我们** | :bug: **在此 [提交问题](https://github.com/Sankyu-Lab/circle-flags-ui/issues)**
24
24
 
25
25
  :rocket: **探索 [演示图库](https://react-circle-flags.js.org/browse)** | :book: **[阅读文档](https://react-circle-flags.js.org/docs/guides/getting-started/)**
26
26
 
@@ -36,7 +36,7 @@
36
36
 
37
37
  ## :world_map: 在线演示
38
38
 
39
- [![在 CodeSandbox 中编辑 react-circle-flags-demo](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/p/sandbox/nyy6vp) [![在 StackBlitz 中打开](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/fork/github/SanKyu-Lab/circle-flags-ui/tree/main/examples/example-react?file=src%2FApp.tsx&terminal=dev)
39
+ [![在 StackBlitz 中打开](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/fork/github/SanKyu-Lab/circle-flags-ui/tree/main/examples/example-react?file=src%2FApp.tsx&terminal=dev)
40
40
 
41
41
  ## ✨ 核心特性
42
42
 
@@ -66,6 +66,23 @@ bun add @sankyu/react-circle-flags
66
66
  > [!TIP]
67
67
  > 欲了解更多信息,请参阅 [安装指南](https://react-circle-flags.js.org/docs/guides/getting-started/installation/)。
68
68
 
69
+ ### 🤖 正在 Vibe Coding?
70
+
71
+ <details>
72
+ <summary>AI Agent 提示词</summary>
73
+
74
+ ```txt
75
+ 你是一位资深 Web 开发专家。请参考文档:https://react-circle-flags.js.org/llms.txt
76
+
77
+ 1. **项目审计**:检查我项目中的国旗图标使用情况,找出:
78
+ - 指向 `HatScripts/circle-flags` 的原始 `<img>` 标签。
79
+ - 旧版 `react-circle-flags` 第三方库的使用。
80
+ 2. **迁移建议**:根据我当前的框架(React/Vue/Solid),提供向 `@sankyu/{framework}-circle-flags` 家族库迁移的方案。
81
+ 3. **极致优化**:根据文档规范,将通用的 `CircleFlag` 组件或原始 `<img>` 标签替换为**具名导入**(例如 `import { FlagUs, FlagDe } from '...'`),以确保 Tree-shaking 达到最小 Bundle 体积。
82
+ ```
83
+
84
+ </details>
85
+
69
86
  ## 🚀 使用
70
87
 
71
88
  ### 导入单个国旗(推荐)
@@ -154,12 +171,16 @@ console.log(buildMeta.circleFlagsCommitHash) // 例如:<示例-sha256-哈希
154
171
 
155
172
  导入单个国旗可确保只有使用到的国旗被包含在您的打包文件中。
156
173
 
174
+ > [!CAUTION]
175
+ > `DynamicFlag` 适合离线优先且需要同步渲染运行时代码的场景,但会打包全部 400+ 国旗
176
+ > (约 ~600 KB,无法 tree-shaking)。若代码集合有限,优先使用具名导入或“具名导入 + map”。
177
+
157
178
  > [!TIP]
158
179
  > 欲了解更多信息,请参阅 [打包大小与 Tree-shaking 优化指南](https://react-circle-flags.js.org/docs/guides/getting-started/bundle-size/)。
159
180
 
160
181
  ## 🤝 贡献
161
182
 
162
- 请参阅 [CONTRIBUTING.md](CONTRIBUTING.md) 了解贡献指南。
183
+ 请参阅 [CONTRIBUTING.md](https://github.com/SanKyu-Lab/circle-flags-ui/blob/main/CONTRIBUTING.md) 了解贡献指南。
163
184
 
164
185
  ## 📄 许可证
165
186