@tunghtml/strapi-plugin-composite-field 1.1.10 → 1.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tunghtml/strapi-plugin-composite-field",
3
- "version": "1.1.10",
3
+ "version": "1.2.1",
4
4
  "description": "A Strapi v5 plugin to create composite display fields by combining multiple text, string, and enum fields with auto-generate support",
5
5
  "keywords": [
6
6
  "strapi",
@@ -19,45 +19,12 @@
19
19
  },
20
20
  "license": "MIT",
21
21
  "author": "Tung Le <tunghtml@gmail.com>",
22
- "type": "commonjs",
23
- "exports": {
24
- "./package.json": "./package.json",
25
- "./strapi-admin": {
26
- "source": "./admin/src/index.js",
27
- "import": "./dist/admin/index.mjs",
28
- "require": "./dist/admin/index.js",
29
- "default": "./dist/admin/index.js"
30
- },
31
- "./strapi-server": {
32
- "source": "./server/src/index.js",
33
- "import": "./dist/server/index.mjs",
34
- "require": "./dist/server/index.js",
35
- "default": "./dist/server/index.js"
36
- }
37
- },
38
- "files": [
39
- "dist",
40
- "README.md"
41
- ],
42
- "scripts": {
43
- "build": "strapi-plugin build",
44
- "watch": "strapi-plugin watch",
45
- "verify": "strapi-plugin verify"
46
- },
47
22
  "dependencies": {
48
23
  "@strapi/design-system": "^2.0.0-rc.11",
49
24
  "@strapi/icons": "^2.0.0-rc.11"
50
25
  },
51
- "devDependencies": {
52
- "@strapi/sdk-plugin": "^5.2.6",
53
- "@strapi/strapi": "^5.0.0",
54
- "react": "^18.3.1",
55
- "react-dom": "^18.3.1",
56
- "react-router-dom": "^6.26.2",
57
- "styled-components": "^6.1.13"
58
- },
59
26
  "peerDependencies": {
60
- "@strapi/strapi": "^5.0.0",
27
+ "@strapi/strapi": "^5.33.2",
61
28
  "react": "^18.3.1",
62
29
  "react-dom": "^18.3.1",
63
30
  "react-router-dom": "^6.26.2",
@@ -68,5 +35,9 @@
68
35
  "name": "composite-field",
69
36
  "displayName": "Composite Field",
70
37
  "description": "Create composite display fields by combining multiple text fields"
38
+ },
39
+ "engines": {
40
+ "node": ">=18.0.0 <=22.x.x",
41
+ "npm": ">=6.0.0"
71
42
  }
72
43
  }
@@ -1,24 +1,27 @@
1
- import React__default from "react";
2
- const CompositeIcon = () => React__default.createElement(
3
- "div",
4
- {
5
- style: {
6
- display: "flex",
7
- justifyContent: "center",
8
- alignItems: "center",
9
- width: "32px",
10
- height: "24px",
11
- borderRadius: "4px",
12
- border: "1px solid #b8e1ff",
13
- background: "#eafbff",
14
- fontSize: "14px",
15
- fontWeight: "600",
16
- color: "#0c75af"
17
- }
18
- },
19
- "Aa"
20
- );
21
- const index = {
1
+ import React from "react";
2
+
3
+ const CompositeIcon = () =>
4
+ React.createElement(
5
+ "div",
6
+ {
7
+ style: {
8
+ display: "flex",
9
+ justifyContent: "center",
10
+ alignItems: "center",
11
+ width: "32px",
12
+ height: "24px",
13
+ borderRadius: "4px",
14
+ border: "1px solid #b8e1ff",
15
+ background: "#eafbff",
16
+ fontSize: "14px",
17
+ fontWeight: "600",
18
+ color: "#0c75af",
19
+ },
20
+ },
21
+ "Aa"
22
+ );
23
+
24
+ export default {
22
25
  register(app) {
23
26
  app.customFields.register({
24
27
  name: "composite",
@@ -27,21 +30,21 @@ const index = {
27
30
  icon: CompositeIcon,
28
31
  intlLabel: {
29
32
  id: "composite-field.label",
30
- defaultMessage: "Composite"
33
+ defaultMessage: "Composite",
31
34
  },
32
35
  intlDescription: {
33
36
  id: "composite-field.description",
34
- defaultMessage: "Combine multiple fields into one display value"
37
+ defaultMessage: "Combine multiple fields into one display value",
35
38
  },
36
39
  components: {
37
- Input: async () => import("../_chunks/CompositeInput-yW3aLiyf.mjs")
40
+ Input: async () => import("./components/CompositeInput"),
38
41
  },
39
42
  options: {
40
43
  base: [
41
44
  {
42
45
  sectionTitle: {
43
46
  id: "composite-field.section.title",
44
- defaultMessage: "Settings"
47
+ defaultMessage: "Settings",
45
48
  },
46
49
  items: [
47
50
  {
@@ -49,41 +52,42 @@ const index = {
49
52
  type: "textarea",
50
53
  intlLabel: {
51
54
  id: "composite-field.fields.label",
52
- defaultMessage: "Fields to combine"
55
+ defaultMessage: "Fields to combine",
53
56
  },
54
57
  description: {
55
58
  id: "composite-field.fields.description",
56
- defaultMessage: "Enter field names (one per line). Only text/string fields are supported."
59
+ defaultMessage:
60
+ "Enter field names (one per line). Only text/string fields are supported.",
57
61
  },
58
62
  placeholder: {
59
63
  id: "composite-field.fields.placeholder",
60
- defaultMessage: "salutation\nfirstName\nlastName\nemail"
61
- }
64
+ defaultMessage: "salutation\nfirstName\nlastName\nemail",
65
+ },
62
66
  },
63
67
  {
64
68
  name: "options.separator",
65
69
  type: "text",
66
70
  intlLabel: {
67
71
  id: "composite-field.separator.label",
68
- defaultMessage: "Separator"
72
+ defaultMessage: "Separator",
69
73
  },
70
74
  description: {
71
75
  id: "composite-field.separator.description",
72
- defaultMessage: 'Separator between fields (default: " - ")'
76
+ defaultMessage: 'Separator between fields (default: " - ")',
73
77
  },
74
78
  placeholder: {
75
79
  id: "composite-field.separator.placeholder",
76
- defaultMessage: " - "
77
- }
78
- }
79
- ]
80
- }
80
+ defaultMessage: " - ",
81
+ },
82
+ },
83
+ ],
84
+ },
81
85
  ],
82
86
  advanced: [
83
87
  {
84
88
  sectionTitle: {
85
89
  id: "composite-field.advanced.title",
86
- defaultMessage: "Settings"
90
+ defaultMessage: "Settings",
87
91
  },
88
92
  items: [
89
93
  {
@@ -91,34 +95,31 @@ const index = {
91
95
  type: "checkbox",
92
96
  intlLabel: {
93
97
  id: "composite-field.editable.label",
94
- defaultMessage: "Editable"
98
+ defaultMessage: "Editable",
95
99
  },
96
100
  description: {
97
101
  id: "composite-field.editable.description",
98
- defaultMessage: "Allow manual editing of the composite field value"
99
- }
102
+ defaultMessage:
103
+ "Allow manual editing of the composite field value",
104
+ },
100
105
  },
101
106
  {
102
107
  name: "options.autoGenerate",
103
108
  type: "checkbox",
104
109
  intlLabel: {
105
110
  id: "composite-field.autoGenerate.label",
106
- defaultMessage: "Auto-generate"
111
+ defaultMessage: "Auto-generate",
107
112
  },
108
113
  description: {
109
114
  id: "composite-field.autoGenerate.description",
110
- defaultMessage: "Automatically generate value when source fields change"
111
- }
112
- }
113
- ]
114
- }
115
- ]
116
- }
115
+ defaultMessage:
116
+ "Automatically generate value when source fields change",
117
+ },
118
+ },
119
+ ],
120
+ },
121
+ ],
122
+ },
117
123
  });
118
124
  },
119
- bootstrap() {
120
- }
121
- };
122
- export {
123
- index as default
124
125
  };
@@ -0,0 +1 @@
1
+ module.exports = require("./server/src/index");