strapi-plugin-tags-custom-field 1.0.0 → 1.0.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 +36 -79
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,103 +1,60 @@
1
- # strapi-plugin-tags-custom-field
1
+ # strapi-plugin-tags-custom-field
2
2
 
3
- Strapi 5 plugin that adds a `tags` custom field to edit a list of tags (`array of strings`) and store it as a native JSON array.
3
+ NPM package: https://www.npmjs.com/package/strapi-plugin-tags-custom-field
4
4
 
5
- ## What this plugin does
5
+ Custom field plugin for Strapi 5 to manage tags as a native JSON array (`string[]`).
6
6
 
7
- - Registers the `tags` custom field on the server (`type: json`).
8
- - Registers the custom field in the admin panel with a tags input component.
9
- - Saves tags as JSON array values (e.g. `["news","featured","tech"]`).
10
- - Uses Strapi Design System components for native admin look and feel.
11
- - Supports keyboard and clipboard workflows for faster data entry.
12
-
13
- ## Requirements
14
-
15
- - Node.js 18+ (recommended: Node.js 20)
16
- - Strapi 5
17
-
18
- ## Local plugin development
19
-
20
- ```bash
21
- npm install
22
- npm run build
23
- npm run test:ts
24
- npm run verify
25
- ```
26
-
27
- ## Install from npm (recommended)
7
+ ## Installation
28
8
 
29
9
  ```bash
30
10
  npm install strapi-plugin-tags-custom-field
31
11
  ```
32
12
 
33
- Then restart your Strapi server and add the field in Content-Type Builder:
13
+ Restart your Strapi server after installation.
34
14
 
35
- - Add a new field.
36
- - Open the Custom fields category.
37
- - Select `Tags`.
38
- - Configure the custom field options if needed (see below).
15
+ ## Usage in Strapi
39
16
 
40
- ## Link locally during development
17
+ 1. Open Content-Type Builder.
18
+ 2. Add a new field.
19
+ 3. Open **Custom fields**.
20
+ 4. Select **Tags**.
21
+ 5. Configure field options if needed.
41
22
 
42
- 1. In the plugin project:
23
+ ## Field options
43
24
 
44
- ```bash
45
- npm install
46
- npm run watch:link
47
- ```
25
+ - `maxTags` (default: `20`): maximum number of tags.
26
+ - `maxTagLength` (default: `40`): maximum characters per tag.
27
+ - `allowDuplicates` (default: `false`): allow repeated tags.
28
+ - `separator` (default: `,`): character used to split typed/pasted values.
29
+ - `normalizeCase` (default: `none`): `none`, `lowercase`, or `UPPERCASE`.
48
30
 
49
- 2. In the Strapi project (in another terminal):
31
+ ## Input behavior
50
32
 
51
- ```bash
52
- npx yalc add --link strapi-plugin-tags-custom-field
53
- npm install
54
- npm run develop
55
- ```
33
+ - `Enter` adds the current tag.
34
+ - The configured separator also adds the current tag.
35
+ - Paste supports multiple tags (newline or configured separator).
36
+ - `Backspace` on empty input removes the last tag.
56
37
 
57
- 3. In the Strapi Content-Type Builder, add the `Tags` custom field.
38
+ ## Data format
58
39
 
59
- ## Input behavior and UX
40
+ The value is stored as native JSON array and returned as array by Strapi APIs.
60
41
 
61
- - Press `Enter` to add the current tag.
62
- - Press the configured separator (default: `,`) to add the current tag.
63
- - Paste multiple tags at once (separated by newline or the configured separator).
64
- - Press `Backspace` on an empty input to remove the last tag.
65
- - Each draft tag has a configurable character limit with a live counter in the UI.
42
+ Example:
66
43
 
67
- ## Custom field options (Content-Type Builder)
68
-
69
- - `maxTags` (number, default: `20`): maximum number of tags allowed.
70
- - `maxTagLength` (number, default: `40`): maximum number of characters per tag.
71
- - `allowDuplicates` (boolean, default: `false`): allows repeated tags.
72
- - `separator` (text, default: `,`): character used for splitting input/paste.
73
- - `normalizeCase` (select, default: `none`): `none`, `lowercase`, or `UPPERCASE`.
74
-
75
- ## Database value format
76
-
77
- The value is stored as a native JSON array. Examples:
78
-
79
- - No tags: `[]`
80
- - With tags: `["javascript","strapi","cms"]`
81
-
82
- ## Main structure
44
+ ```json
45
+ {
46
+ "tags": ["javascript", "strapi", "cms"]
47
+ }
48
+ ```
83
49
 
84
- - `server/src/register.ts`: backend custom field registration.
85
- - `admin/src/index.ts`: admin custom field registration.
86
- - `admin/src/components/TagsInput.tsx`: visual input with add/remove tag behavior.
50
+ ## Compatibility
87
51
 
88
- ## Release checklist
52
+ - Strapi: `v5`
53
+ - Node.js: `>=18`
89
54
 
90
- 1. Update version in `package.json`.
91
- 2. Run:
55
+ ## Local development (plugin repo)
92
56
 
93
57
  ```bash
94
- npm ci
58
+ npm install
95
59
  npm run release:check
96
- ```
97
-
98
- 3. Publish to npm:
99
-
100
- ```bash
101
- npm publish
102
- ```
103
-
60
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "strapi-plugin-tags-custom-field",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Custom field plugin for Strapi 5 to manage tags (array of strings) stored as JSON array.",
5
5
  "keywords": [
6
6
  "strapi",