@tunghtml/strapi-plugin-composite-field 1.0.0

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.
@@ -0,0 +1,91 @@
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 = {
22
+ register(app) {
23
+ app.customFields.register({
24
+ name: "composite",
25
+ pluginId: "composite-field",
26
+ type: "string",
27
+ icon: CompositeIcon,
28
+ intlLabel: {
29
+ id: "composite-field.label",
30
+ defaultMessage: "Composite"
31
+ },
32
+ intlDescription: {
33
+ id: "composite-field.description",
34
+ defaultMessage: "Combine multiple fields into one display value"
35
+ },
36
+ components: {
37
+ Input: async () => import("../_chunks/CompositeInput-DZSaB0Rv.mjs")
38
+ },
39
+ options: {
40
+ base: [
41
+ {
42
+ sectionTitle: {
43
+ id: "composite-field.section.title",
44
+ defaultMessage: "Settings"
45
+ },
46
+ items: [
47
+ {
48
+ name: "options.fields",
49
+ type: "textarea",
50
+ intlLabel: {
51
+ id: "composite-field.fields.label",
52
+ defaultMessage: "Fields to combine"
53
+ },
54
+ description: {
55
+ id: "composite-field.fields.description",
56
+ defaultMessage: "Enter field names (one per line). Only text/string fields are supported."
57
+ },
58
+ placeholder: {
59
+ id: "composite-field.fields.placeholder",
60
+ defaultMessage: "salutation\nfirstName\nlastName\nemail"
61
+ }
62
+ },
63
+ {
64
+ name: "options.separator",
65
+ type: "text",
66
+ intlLabel: {
67
+ id: "composite-field.separator.label",
68
+ defaultMessage: "Separator"
69
+ },
70
+ description: {
71
+ id: "composite-field.separator.description",
72
+ defaultMessage: 'Separator between fields (default: " - ")'
73
+ },
74
+ placeholder: {
75
+ id: "composite-field.separator.placeholder",
76
+ defaultMessage: " - "
77
+ }
78
+ }
79
+ ]
80
+ }
81
+ ],
82
+ advanced: []
83
+ }
84
+ });
85
+ },
86
+ bootstrap() {
87
+ }
88
+ };
89
+ export {
90
+ index as default
91
+ };
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ function getDefaultExportFromCjs(x) {
3
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
4
+ }
5
+ var register$1 = ({ strapi }) => {
6
+ console.log("🔌 Composite Field Plugin: Registering custom field...");
7
+ strapi.customFields.register({
8
+ name: "composite",
9
+ plugin: "composite-field",
10
+ type: "string"
11
+ });
12
+ console.log(
13
+ "✅ Composite Field Plugin: Custom field registered successfully"
14
+ );
15
+ };
16
+ const register = register$1;
17
+ var src = {
18
+ register
19
+ };
20
+ const index = /* @__PURE__ */ getDefaultExportFromCjs(src);
21
+ module.exports = index;
@@ -0,0 +1,22 @@
1
+ function getDefaultExportFromCjs(x) {
2
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
3
+ }
4
+ var register$1 = ({ strapi }) => {
5
+ console.log("🔌 Composite Field Plugin: Registering custom field...");
6
+ strapi.customFields.register({
7
+ name: "composite",
8
+ plugin: "composite-field",
9
+ type: "string"
10
+ });
11
+ console.log(
12
+ "✅ Composite Field Plugin: Custom field registered successfully"
13
+ );
14
+ };
15
+ const register = register$1;
16
+ var src = {
17
+ register
18
+ };
19
+ const index = /* @__PURE__ */ getDefaultExportFromCjs(src);
20
+ export {
21
+ index as default
22
+ };
package/package.json ADDED
@@ -0,0 +1,72 @@
1
+ {
2
+ "name": "@tunghtml/strapi-plugin-composite-field",
3
+ "version": "1.0.0",
4
+ "description": "A Strapi v5 plugin to create composite display fields by combining multiple text fields",
5
+ "keywords": [
6
+ "strapi",
7
+ "strapi-plugin",
8
+ "custom-fields",
9
+ "composite",
10
+ "strapi-v5"
11
+ ],
12
+ "homepage": "https://github.com/finnwasabi/strapi-plugin-composite-field#readme",
13
+ "bugs": {
14
+ "url": "https://github.com/finnwasabi/strapi-plugin-composite-field/issues"
15
+ },
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/finnwasabi/strapi-plugin-composite-field.git"
19
+ },
20
+ "license": "MIT",
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
+ "dependencies": {
48
+ "@strapi/design-system": "^2.0.0-rc.11",
49
+ "@strapi/icons": "^2.0.0-rc.11"
50
+ },
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
+ "peerDependencies": {
60
+ "@strapi/strapi": "^5.0.0",
61
+ "react": "^18.3.1",
62
+ "react-dom": "^18.3.1",
63
+ "react-router-dom": "^6.26.2",
64
+ "styled-components": "^6.1.13"
65
+ },
66
+ "strapi": {
67
+ "kind": "plugin",
68
+ "name": "composite-field",
69
+ "displayName": "Composite Field",
70
+ "description": "Create composite display fields by combining multiple text fields"
71
+ }
72
+ }