@deenruv/method-modal-plugin 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.
package/LICENSE ADDED
@@ -0,0 +1,23 @@
1
+ # License 1
2
+
3
+ The MIT License
4
+
5
+ Copyright (c) 2025-present Aexol
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
8
+
9
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
10
+
11
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
12
+
13
+ # License 2
14
+
15
+ The MIT License
16
+
17
+ Copyright (c) 2018-2025 Michael Bromley
18
+
19
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
20
+
21
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
22
+
23
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,36 @@
1
+ # @deenruv/method-modal-plugin
2
+
3
+ Plugin that adds localized modal content fields to both PaymentMethod and ShippingMethod entities. This enables storefronts to display informational modals with custom title, description, and additional description for each payment and shipping method.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pnpm add @deenruv/method-modal-plugin
9
+ ```
10
+
11
+ ## Configuration
12
+
13
+ ```typescript
14
+ import { MethodModalServerPlugin } from '@deenruv/method-modal-plugin';
15
+
16
+ // In your Deenruv server config:
17
+ plugins: [
18
+ MethodModalServerPlugin,
19
+ ]
20
+ ```
21
+
22
+ ## Features
23
+
24
+ - Adds `modalTitle` (localeString) custom field to PaymentMethod and ShippingMethod
25
+ - Adds `modalDescription` (localeText with rich text) custom field to PaymentMethod and ShippingMethod
26
+ - Adds `modalAdditionalDescription` (localeText with rich text) custom field to PaymentMethod and ShippingMethod
27
+ - Full-width rich text editor support in the admin UI
28
+ - All fields are public and accessible from the Shop API
29
+
30
+ ## Admin UI
31
+
32
+ This plugin is server-only and does not add any admin UI extensions. The custom fields are editable through the standard PaymentMethod and ShippingMethod detail pages in the admin panel.
33
+
34
+ ## API Extensions
35
+
36
+ This plugin does not add any GraphQL API extensions. It registers localized custom fields on PaymentMethod and ShippingMethod entities, which are automatically exposed through the standard Deenruv GraphQL API.
@@ -0,0 +1,2 @@
1
+ export declare class MethodModalServerPlugin {
2
+ }
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.MethodModalServerPlugin = void 0;
10
+ const core_1 = require("@deenruv/core");
11
+ const MethodModalFields = [
12
+ {
13
+ name: "modalTitle",
14
+ type: "localeString",
15
+ label: [{ languageCode: core_1.LanguageCode.en, value: "Modal title" }],
16
+ public: true,
17
+ },
18
+ {
19
+ name: "modalDescription",
20
+ type: "localeText",
21
+ label: [{ languageCode: core_1.LanguageCode.en, value: "Modal description" }],
22
+ ui: { richText: true, fullWidth: true },
23
+ public: true,
24
+ },
25
+ {
26
+ name: "modalAdditionalDescription",
27
+ type: "localeText",
28
+ label: [
29
+ { languageCode: core_1.LanguageCode.en, value: "Modal additional description" },
30
+ ],
31
+ ui: { richText: true, fullWidth: true },
32
+ public: true,
33
+ },
34
+ ];
35
+ let MethodModalServerPlugin = class MethodModalServerPlugin {
36
+ };
37
+ exports.MethodModalServerPlugin = MethodModalServerPlugin;
38
+ exports.MethodModalServerPlugin = MethodModalServerPlugin = __decorate([
39
+ (0, core_1.DeenruvPlugin)({
40
+ compatibility: "^0.0.20",
41
+ imports: [core_1.PluginCommonModule],
42
+ configuration: (config) => {
43
+ config.customFields.PaymentMethod.push(...MethodModalFields);
44
+ config.customFields.ShippingMethod.push(...MethodModalFields);
45
+ return config;
46
+ },
47
+ })
48
+ ], MethodModalServerPlugin);
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "@deenruv/method-modal-plugin",
3
+ "version": "1.0.0",
4
+ "homepage": "https://deenruv.com/",
5
+ "license": "MIT",
6
+ "files": [
7
+ "dist/**/*"
8
+ ],
9
+ "main": "./dist/plugin-server/index.js",
10
+ "exports": {
11
+ ".": "./dist/plugin-server/index.js",
12
+ "./plugin-server": "./dist/plugin-server/index.js"
13
+ },
14
+ "dependencies": {
15
+ "@deenruv/common": "^1.0.0",
16
+ "@deenruv/react-ui-devkit": "^1.0.0"
17
+ },
18
+ "peerDependencies": {
19
+ "@deenruv/core": "^0.1.0"
20
+ },
21
+ "devDependencies": {
22
+ "rimraf": "^5.0.10",
23
+ "typescript": "5.3.3",
24
+ "@deenruv/core": "^1.0.0"
25
+ },
26
+ "scripts": {
27
+ "build": "rimraf dist && tsc --build",
28
+ "watch": "tsc --build --watch",
29
+ "lint": "eslint .",
30
+ "lint:fix": "eslint --fix .",
31
+ "zeus": "zeus http://localhost:3000/admin-api ./src/plugin-server && zeus http://localhost:3000/admin-api ./src/plugin-ui"
32
+ }
33
+ }