zerocodejs 1.0.1-beta.5 → 1.0.1-beta.6

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.ja.md ADDED
@@ -0,0 +1,174 @@
1
+ # ZeroCode.js
2
+
3
+ [![npm](https://img.shields.io/npm/v/zerocodejs)](https://www.npmjs.com/package/zerocodejs)
4
+ [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
5
+ [![GitHub Pages](https://img.shields.io/website?down_message=offline&label=Demo&up_message=online&url=https%3A%2F%2Fatsumi-code.github.io%2Fzerocodejs%2F)](https://atsumi-code.github.io/zerocodejs/)
6
+
7
+ 🌐 [English](./README.md)
8
+
9
+ フレームワーク非依存のWeb ComponentsベースのCMSエディターライブラリ
10
+
11
+ > **Status: Beta**
12
+ >
13
+ > ZeroCode.js は現在ベータ版です。仕様・API・データ形式は予告なく変更される可能性があります(破壊的変更を含む)。
14
+ > 不具合報告・改善提案・ユースケース共有・ドキュメントのズレの指摘を歓迎します。
15
+ >
16
+ > - **GitHub**: https://github.com/atsumi-code/zerocodejs
17
+ > - **Issue**: [https://github.com/atsumi-code/zerocodejs/issues](https://github.com/atsumi-code/zerocodejs/issues)
18
+ > - **Discussion**: [https://github.com/atsumi-code/zerocodejs/discussions](https://github.com/atsumi-code/zerocodejs/discussions)(運用していない場合は Issue でOK)
19
+ > - **Contributing**: [./CONTRIBUTING.md](./CONTRIBUTING.md)
20
+
21
+ > ⭐ **スターをお願いします**
22
+ > このプロジェクトに共感していただけたら、[GitHub でスター](https://github.com/atsumi-code/zerocodejs)をいただけると励みになります。
23
+
24
+ ## 特徴
25
+
26
+ - **フレームワーク非依存**: Web Componentsとして実装されているため、どのフレームワークでも使用可能
27
+ - **視覚的編集**: クリック操作でコンテンツを編集・追加・削除・並べ替え
28
+ - **パーツ管理**: 再利用可能なパーツを作成・管理
29
+ - **画像管理**: 画像のアップロード・管理機能
30
+ - **柔軟なテンプレート**: カスタムHTMLテンプレート構文で動的なコンテンツを定義
31
+ - **高速**: Vue 3とViteによる高速な開発体験
32
+
33
+ ## インストール
34
+
35
+ ```bash
36
+ npm install zerocodejs
37
+ ```
38
+
39
+ ZeroCode.jsは内部でVue 3を使用しています。npm 7以降では、peer dependenciesが自動的にインストールされるため、`npm install zerocodejs`だけでVueも一緒にインストールされます。
40
+
41
+ > **注意:** npm 6以前を使用している場合は、明示的に`npm install zerocodejs vue`を実行してください。
42
+
43
+ ## クイックスタート
44
+
45
+ ### 基本的な使用例
46
+
47
+ ```html
48
+ <!DOCTYPE html>
49
+ <html lang="ja">
50
+ <head>
51
+ <meta charset="UTF-8">
52
+ <title>ZeroCode.js Example</title>
53
+ <link rel="stylesheet" href="node_modules/zerocodejs/dist/style.css">
54
+ </head>
55
+ <body>
56
+ <zcode-cms id="cms" locale="ja">
57
+ <link slot="css" rel="stylesheet" href="/css/common.css" />
58
+ <script slot="script" src="/js/accordion.js"></script>
59
+ </zcode-cms>
60
+
61
+ <script type="module">
62
+ import 'zerocodejs';
63
+
64
+ const cms = document.getElementById('cms');
65
+ cms.setAttribute('page', JSON.stringify([]));
66
+ cms.setAttribute('parts-common', JSON.stringify([]));
67
+ cms.setAttribute('parts-individual', JSON.stringify([]));
68
+ cms.setAttribute('parts-special', JSON.stringify([]));
69
+ cms.setAttribute('images-common', JSON.stringify([]));
70
+ cms.setAttribute('images-individual', JSON.stringify([]));
71
+ cms.setAttribute('images-special', JSON.stringify([]));
72
+ </script>
73
+ </body>
74
+ </html>
75
+ ```
76
+
77
+ ### Reactでの使用例
78
+
79
+ ```bash
80
+ npm install zerocodejs
81
+ ```
82
+
83
+ ```jsx
84
+ import { useEffect } from 'react';
85
+ import 'zerocodejs';
86
+ import 'zerocodejs/style.css';
87
+
88
+ function App() {
89
+ useEffect(() => {
90
+ const cms = document.getElementById('cms');
91
+ if (cms) {
92
+ cms.setAttribute('page', JSON.stringify([]));
93
+ cms.setAttribute('parts-common', JSON.stringify([]));
94
+ cms.setAttribute('parts-individual', JSON.stringify([]));
95
+ cms.setAttribute('parts-special', JSON.stringify([]));
96
+ cms.setAttribute('images-common', JSON.stringify([]));
97
+ cms.setAttribute('images-individual', JSON.stringify([]));
98
+ cms.setAttribute('images-special', JSON.stringify([]));
99
+ }
100
+ }, []);
101
+
102
+ return <zcode-cms id="cms" locale="ja" />;
103
+ }
104
+ ```
105
+
106
+ ### Vueでの使用例
107
+
108
+ ```bash
109
+ npm install zerocodejs
110
+ # Vueは既にインストール済み
111
+ ```
112
+
113
+ ```vue
114
+ <template>
115
+ <zcode-cms id="cms" locale="ja" />
116
+ </template>
117
+
118
+ <script setup>
119
+ import 'zerocodejs';
120
+ import 'zerocodejs/style.css';
121
+ </script>
122
+ ```
123
+
124
+ ### エンジニア用管理画面
125
+
126
+ ```html
127
+ <zcode-editor id="editor" locale="ja">
128
+ <link slot="css" rel="stylesheet" href="/css/common.css" />
129
+ <script slot="script" src="/js/accordion.js"></script>
130
+ </zcode-editor>
131
+ ```
132
+
133
+ ### CDN経由で使用する場合
134
+
135
+ ```html
136
+ <!-- Vueを先に読み込む -->
137
+ <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
138
+ <!-- ZeroCode.jsを読み込む -->
139
+ <script src="https://unpkg.com/zerocodejs/dist/zerocode.umd.js"></script>
140
+ <link rel="stylesheet" href="https://unpkg.com/zerocodejs/dist/style.css">
141
+ ```
142
+
143
+ ## ドキュメント
144
+
145
+ - [技術仕様書](./TECHNICAL_SPECIFICATION.md)
146
+ - [実装TODO](./TODO.md)
147
+ - [AI向けガイドライン](./AGENTS.md)
148
+
149
+ ## 日本語コミュニティ
150
+
151
+ - GitHub Issues での日本語での質問・議論を歓迎します
152
+ - Issue は日本語でも英語でもOKです
153
+ - PR のコミットメッセージは英語推奨ですが、日本語の説明も歓迎します
154
+
155
+ ## セキュリティ
156
+
157
+ ZeroCode.jsはフロントエンドライブラリのため、クライアント側での完全なセキュリティ保証はできません。
158
+
159
+ ### 推奨事項
160
+
161
+ - **サーバー側での検証を必須とする**: データ保存前にサーバー側で検証してください
162
+ - **認証・認可の実装**: パーツデータの変更は認証されたユーザーのみ許可してください
163
+ - **送信元の検証**: `save-request`イベントの`source`フィールドを確認してください
164
+ - **パーツテンプレートの管理**: パーツテンプレートは信頼できるソースからのみ使用してください
165
+
166
+ 詳細は[技術仕様書](./TECHNICAL_SPECIFICATION.md)のセキュリティセクションを参照してください。
167
+
168
+ ## ライセンス
169
+
170
+ MIT License
171
+
172
+ ---
173
+
174
+ **最終更新日**: 2025年1月
package/README.md CHANGED
@@ -1,58 +1,57 @@
1
1
  # ZeroCode.js
2
2
 
3
- [![GitHub Pages](https://img.shields.io/website?down_message=offline&label=GitHub%20Pages&up_message=open&url=https%3A%2F%2Fatsumi-code.github.io%2Fzerocodejs%2F)](https://atsumi-code.github.io/zerocodejs/)
4
- **🌐 GitHub Pages:** https://atsumi-code.github.io/zerocodejs/
3
+ [![npm](https://img.shields.io/npm/v/zerocodejs)](https://www.npmjs.com/package/zerocodejs)
4
+ [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
5
+ [![GitHub Pages](https://img.shields.io/website?down_message=offline&label=Demo&up_message=online&url=https%3A%2F%2Fatsumi-code.github.io%2Fzerocodejs%2F)](https://atsumi-code.github.io/zerocodejs/)
5
6
 
6
- フレームワーク非依存のWeb ComponentsベースのCMSエディターライブラリ
7
+ 🇯🇵 [日本語ドキュメント](./README.ja.md)
8
+
9
+ **Framework-agnostic Visual CMS Editor Library built with Web Components**
7
10
 
8
11
  > **Status: Beta**
9
12
  >
10
- > ZeroCode.js は現在ベータ版です。仕様・API・データ形式は予告なく変更される可能性があります(破壊的変更を含む)。
11
- > 不具合報告・改善提案・ユースケース共有・ドキュメントのズレの指摘を歓迎します。
12
- >
13
- > - **GitHub**: https://github.com/atsumi-code/zerocodejs
14
- > - **Issue**: [https://github.com/atsumi-code/zerocodejs/issues](https://github.com/atsumi-code/zerocodejs/issues)
15
- > - **Discussion**: [https://github.com/atsumi-code/zerocodejs/discussions](https://github.com/atsumi-code/zerocodejs/discussions)(運用していない場合は Issue でOK)
16
- > - **Contributing**: [./CONTRIBUTING.md](./CONTRIBUTING.md)
13
+ > ZeroCode.js is currently in beta. APIs, specifications, and data formats may change without notice (including breaking changes).
14
+ > Bug reports, feature requests, use case sharing, and documentation feedback are welcome.
17
15
 
18
- > ⭐ **スターをお願いします**
19
- > このプロジェクトに共感していただけたら、[GitHub でスター](https://github.com/atsumi-code/zerocodejs)をいただけると励みになります。
16
+ ## Features
20
17
 
21
- ## 特徴
18
+ - **Framework Agnostic** - Works with React, Vue, Svelte, Angular, or Vanilla JS via Web Components
19
+ - **Visual Editor** - Click to edit, drag to reorder, no coding required for content editing
20
+ - **Parts Management** - Create and manage reusable content blocks
21
+ - **Image Management** - Built-in image upload and management
22
+ - **Flexible Templates** - Custom HTML template syntax for dynamic content
23
+ - **Lightweight** - Only ~260KB gzipped
24
+ - **i18n Ready** - Built-in Japanese & English UI support
22
25
 
23
- - **フレームワーク非依存**: Web Componentsとして実装されているため、どのフレームワークでも使用可能
24
- - **視覚的編集**: クリック操作でコンテンツを編集・追加・削除・並べ替え
25
- - **パーツ管理**: 再利用可能なパーツを作成・管理
26
- - **画像管理**: 画像のアップロード・管理機能
27
- - **柔軟なテンプレート**: カスタムHTMLテンプレート構文で動的なコンテンツを定義
28
- - **高速**: Vue 3とViteによる高速な開発体験
26
+ ## Demo
29
27
 
30
- ## インストール
28
+ **Live Demo:** https://atsumi-code.github.io/zerocodejs/
29
+
30
+ ## Installation
31
31
 
32
32
  ```bash
33
33
  npm install zerocodejs
34
34
  ```
35
35
 
36
- ZeroCode.jsは内部でVue 3を使用しています。npm 7以降では、peer dependenciesが自動的にインストールされるため、`npm install zerocodejs`だけでVueも一緒にインストールされます。
36
+ ZeroCode.js uses Vue 3 internally. With npm 7+, peer dependencies are installed automatically.
37
37
 
38
- > **注意:** npm 6以前を使用している場合は、明示的に`npm install zerocodejs vue`を実行してください。
38
+ > **Note:** If using npm 6 or earlier, run `npm install zerocodejs vue` explicitly.
39
39
 
40
- ## クイックスタート
40
+ ## Quick Start
41
41
 
42
- ### 基本的な使用例
42
+ ### Basic Usage (Vanilla JS)
43
43
 
44
44
  ```html
45
45
  <!DOCTYPE html>
46
- <html lang="ja">
46
+ <html lang="en">
47
47
  <head>
48
48
  <meta charset="UTF-8">
49
49
  <title>ZeroCode.js Example</title>
50
50
  <link rel="stylesheet" href="node_modules/zerocodejs/dist/style.css">
51
51
  </head>
52
52
  <body>
53
- <zcode-cms id="cms" locale="ja">
53
+ <zcode-cms id="cms" locale="en">
54
54
  <link slot="css" rel="stylesheet" href="/css/common.css" />
55
- <script slot="script" src="/js/accordion.js"></script>
56
55
  </zcode-cms>
57
56
 
58
57
  <script type="module">
@@ -71,11 +70,7 @@ ZeroCode.jsは内部でVue 3を使用しています。npm 7以降では、peer
71
70
  </html>
72
71
  ```
73
72
 
74
- ### Reactでの使用例
75
-
76
- ```bash
77
- npm install zerocodejs
78
- ```
73
+ ### React
79
74
 
80
75
  ```jsx
81
76
  import { useEffect } from 'react';
@@ -96,20 +91,15 @@ function App() {
96
91
  }
97
92
  }, []);
98
93
 
99
- return <zcode-cms id="cms" locale="ja" />;
94
+ return <zcode-cms id="cms" locale="en" />;
100
95
  }
101
96
  ```
102
97
 
103
- ### Vueでの使用例
104
-
105
- ```bash
106
- npm install zerocodejs
107
- # Vueは既にインストール済み
108
- ```
98
+ ### Vue
109
99
 
110
100
  ```vue
111
101
  <template>
112
- <zcode-cms id="cms" locale="ja" />
102
+ <zcode-cms id="cms" locale="en" />
113
103
  </template>
114
104
 
115
105
  <script setup>
@@ -118,48 +108,72 @@ import 'zerocodejs/style.css';
118
108
  </script>
119
109
  ```
120
110
 
121
- ### エンジニア用管理画面
111
+ ### CDN
122
112
 
123
113
  ```html
124
- <zcode-editor id="editor" locale="ja">
125
- <link slot="css" rel="stylesheet" href="/css/common.css" />
126
- <script slot="script" src="/js/accordion.js"></script>
127
- </zcode-editor>
114
+ <!-- Load Vue first -->
115
+ <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
116
+ <!-- Load ZeroCode.js -->
117
+ <script src="https://unpkg.com/zerocodejs/dist/zerocode.umd.js"></script>
118
+ <link rel="stylesheet" href="https://unpkg.com/zerocodejs/dist/style.css">
128
119
  ```
129
120
 
130
- ### CDN経由で使用する場合
121
+ ## Components
122
+
123
+ ### `<zcode-cms>`
124
+
125
+ User-facing CMS editor for content management.
131
126
 
132
127
  ```html
133
- <!-- Vueを先に読み込む -->
134
- <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
135
- <!-- ZeroCode.jsを読み込む -->
136
- <script src="https://unpkg.com/zerocodejs/dist/zerocode.umd.js"></script>
137
- <link rel="stylesheet" href="https://unpkg.com/zerocodejs/dist/style.css">
128
+ <zcode-cms id="cms" locale="en" />
129
+ ```
130
+
131
+ ### `<zcode-editor>`
132
+
133
+ Developer-facing editor with parts management, image management, and data viewer.
134
+
135
+ ```html
136
+ <zcode-editor id="editor" locale="en" />
138
137
  ```
139
138
 
140
- ## ドキュメント
139
+ ## Documentation
140
+
141
+ - [Technical Specification](./TECHNICAL_SPECIFICATION.md)
142
+ - [日本語ドキュメント](./README.ja.md)
143
+
144
+ ## Why ZeroCode.js?
145
+
146
+ | Feature | ZeroCode.js | GrapesJS | Builder.io | Craft.js |
147
+ |---------|-------------|----------|------------|----------|
148
+ | Framework Agnostic | Yes | Yes | No | No (React) |
149
+ | Web Components | Yes | No | No | No |
150
+ | Free & Open Source | Yes | Yes | Partial | Yes |
151
+ | Japanese Support | Yes | No | No | No |
152
+ | Bundle Size | ~260KB | ~500KB | - | ~150KB |
153
+
154
+ ## Contributing
155
+
156
+ Contributions are welcome! Please see [CONTRIBUTING.md](./CONTRIBUTING.md).
141
157
 
142
- - [技術仕様書](./TECHNICAL_SPECIFICATION.md)
143
- - [実装TODO](./TODO.md)
144
- - [AI向けガイドライン](./AGENTS.md)
158
+ We welcome contributions in both **English and Japanese**.
145
159
 
146
- ## セキュリティ
160
+ ## Security
147
161
 
148
- ZeroCode.jsはフロントエンドライブラリのため、クライアント側での完全なセキュリティ保証はできません。
162
+ ZeroCode.js is a frontend library. Complete security cannot be guaranteed on the client side.
149
163
 
150
- ### 推奨事項
164
+ ### Recommendations
151
165
 
152
- - **サーバー側での検証を必須とする**: データ保存前にサーバー側で検証してください
153
- - **認証・認可の実装**: パーツデータの変更は認証されたユーザーのみ許可してください
154
- - **送信元の検証**: `save-request`イベントの`source`フィールドを確認してください
155
- - **パーツテンプレートの管理**: パーツテンプレートは信頼できるソースからのみ使用してください
166
+ - **Server-side validation is required**: Validate data before saving on the server
167
+ - **Implement authentication/authorization**: Only allow authenticated users to modify parts data
168
+ - **Verify the source**: Check the `source` field in `save-request` events
169
+ - **Template management**: Only use templates from trusted sources
156
170
 
157
- 詳細は[技術仕様書](./TECHNICAL_SPECIFICATION.md)のセキュリティセクションを参照してください。
171
+ See the [Technical Specification](./TECHNICAL_SPECIFICATION.md) for security details.
158
172
 
159
- ## ライセンス
173
+ ## License
160
174
 
161
175
  MIT License
162
176
 
163
177
  ---
164
178
 
165
- **最終更新日**: 2025年1月
179
+ **Last Updated**: January 2025