@deenruv/facet-harmonica-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.
Files changed (48) hide show
  1. package/LICENSE +23 -0
  2. package/README.md +40 -0
  3. package/dist/plugin-server/index.d.ts +4 -0
  4. package/dist/plugin-server/index.js +128 -0
  5. package/dist/plugin-server/zeus/const.d.ts +6 -0
  6. package/dist/plugin-server/zeus/const.js +3706 -0
  7. package/dist/plugin-server/zeus/index.d.ts +18922 -0
  8. package/dist/plugin-server/zeus/index.js +1093 -0
  9. package/dist/plugin-server/zeus/typedDocumentNode.d.ts +3 -0
  10. package/dist/plugin-server/zeus/typedDocumentNode.js +16 -0
  11. package/dist/plugin-ui/components/CheckboxAccordion.d.ts +10 -0
  12. package/dist/plugin-ui/components/CheckboxAccordion.js +14 -0
  13. package/dist/plugin-ui/components/DedicatedButtons.d.ts +2 -0
  14. package/dist/plugin-ui/components/DedicatedButtons.js +54 -0
  15. package/dist/plugin-ui/components/FacetHarmonica.d.ts +2 -0
  16. package/dist/plugin-ui/components/FacetHarmonica.js +59 -0
  17. package/dist/plugin-ui/components/index.d.ts +1 -0
  18. package/dist/plugin-ui/components/index.js +1 -0
  19. package/dist/plugin-ui/graphql/index.d.ts +1 -0
  20. package/dist/plugin-ui/graphql/index.js +1 -0
  21. package/dist/plugin-ui/graphql/mutations.d.ts +18 -0
  22. package/dist/plugin-ui/graphql/mutations.js +9 -0
  23. package/dist/plugin-ui/graphql/queries.d.ts +122 -0
  24. package/dist/plugin-ui/graphql/queries.js +11 -0
  25. package/dist/plugin-ui/graphql/scalars.d.ts +13 -0
  26. package/dist/plugin-ui/graphql/scalars.js +14 -0
  27. package/dist/plugin-ui/graphql/selectors.d.ts +69 -0
  28. package/dist/plugin-ui/graphql/selectors.js +27 -0
  29. package/dist/plugin-ui/index.d.ts +1 -0
  30. package/dist/plugin-ui/index.js +23 -0
  31. package/dist/plugin-ui/locales/en/accordion.json +5 -0
  32. package/dist/plugin-ui/locales/en/index.d.ts +6 -0
  33. package/dist/plugin-ui/locales/en/index.js +2 -0
  34. package/dist/plugin-ui/locales/pl/accordion.json +5 -0
  35. package/dist/plugin-ui/locales/pl/index.d.ts +6 -0
  36. package/dist/plugin-ui/locales/pl/index.js +2 -0
  37. package/dist/plugin-ui/tables.d.ts +5 -0
  38. package/dist/plugin-ui/tables.js +55 -0
  39. package/dist/plugin-ui/translation-ns.d.ts +1 -0
  40. package/dist/plugin-ui/translation-ns.js +1 -0
  41. package/dist/plugin-ui/tsconfig.json +18 -0
  42. package/dist/plugin-ui/zeus/const.d.ts +6 -0
  43. package/dist/plugin-ui/zeus/const.js +3703 -0
  44. package/dist/plugin-ui/zeus/index.d.ts +18922 -0
  45. package/dist/plugin-ui/zeus/index.js +1085 -0
  46. package/dist/plugin-ui/zeus/typedDocumentNode.d.ts +3 -0
  47. package/dist/plugin-ui/zeus/typedDocumentNode.js +9 -0
  48. package/package.json +48 -0
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,40 @@
1
+ # @deenruv/facet-harmonica-plugin
2
+
3
+ Plugin that extends Facet and FacetValue entities with additional custom fields for enhanced product filtering. It adds color support, visibility controls, product creation flags, and image associations to facet values, enabling rich filter UI components like color swatches and accordion-style facet navigation.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pnpm add @deenruv/facet-harmonica-plugin
9
+ ```
10
+
11
+ ## Configuration
12
+
13
+ ```typescript
14
+ import { FacetHarmonicaServerPlugin } from '@deenruv/facet-harmonica-plugin';
15
+
16
+ // In your Deenruv server config:
17
+ plugins: [
18
+ FacetHarmonicaServerPlugin.init({}),
19
+ ]
20
+ ```
21
+
22
+ ## Features
23
+
24
+ - **Facet custom fields:**
25
+ - `usedForColors` — Boolean flag to mark facets representing color attributes
26
+ - `usedForProductCreations` — Boolean flag for facets used in product creation flows
27
+ - `colorsCollection` — Boolean flag for color collection grouping (e.g., "BLAT/CORPUS" paths)
28
+ - **FacetValue custom fields:**
29
+ - `hexColor` — Hex color string with a color picker UI component
30
+ - `isNew` — Boolean flag to mark new facet values
31
+ - `isHidden` — Boolean flag to hide facet values from the storefront
32
+ - `image` — Relation to an Asset for visual representation
33
+
34
+ ## Admin UI
35
+
36
+ This plugin extends the admin UI with an accordion-style facet management interface, including a color picker input for hex colors, checkbox accordion components, and dedicated action buttons for facet operations.
37
+
38
+ ## API Extensions
39
+
40
+ This plugin does not add any GraphQL API extensions. It registers custom fields on Facet and FacetValue entities, which are automatically exposed through the standard Deenruv GraphQL API.
@@ -0,0 +1,4 @@
1
+ export declare class FacetHarmonicaServerPlugin {
2
+ static config: {};
3
+ static init(config: {}): typeof FacetHarmonicaServerPlugin;
4
+ }
@@ -0,0 +1,128 @@
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.FacetHarmonicaServerPlugin = void 0;
10
+ const core_1 = require("@deenruv/core");
11
+ const FacetCustomFields = [
12
+ {
13
+ name: "usedForColors",
14
+ type: "boolean",
15
+ label: [
16
+ { languageCode: core_1.LanguageCode.en, value: "Used for colors" },
17
+ { languageCode: core_1.LanguageCode.pl, value: "Używany dla kolorów" },
18
+ ],
19
+ description: [
20
+ {
21
+ languageCode: core_1.LanguageCode.en,
22
+ value: "Use this attribute for guys that are colours",
23
+ },
24
+ {
25
+ languageCode: core_1.LanguageCode.pl,
26
+ value: "Użyj tego atrybutu dla facetów, którzy mają kolory",
27
+ },
28
+ ],
29
+ defaultValue: false,
30
+ public: true,
31
+ },
32
+ {
33
+ name: "usedForProductCreations",
34
+ type: "boolean",
35
+ ui: { component: "product-creations-input" },
36
+ defaultValue: false,
37
+ label: [
38
+ { languageCode: core_1.LanguageCode.en, value: "Used for product creations" },
39
+ { languageCode: core_1.LanguageCode.pl, value: "Używany przy kreacji" },
40
+ ],
41
+ description: [
42
+ { languageCode: core_1.LanguageCode.en, value: "" },
43
+ { languageCode: core_1.LanguageCode.pl, value: "" },
44
+ ],
45
+ },
46
+ {
47
+ name: "colorsCollection",
48
+ type: "boolean",
49
+ label: [
50
+ { languageCode: core_1.LanguageCode.en, value: "Color collection" },
51
+ { languageCode: core_1.LanguageCode.pl, value: "Kolekcja kolorów" },
52
+ ],
53
+ description: [
54
+ {
55
+ languageCode: core_1.LanguageCode.en,
56
+ value: "Use this for the product paths in COLOUR (BLATH/CORPUS)",
57
+ },
58
+ {
59
+ languageCode: core_1.LanguageCode.pl,
60
+ value: "Użyj tej opcji dla ścieżek produktu w KOLORZE (BLAT/CORPUS)",
61
+ },
62
+ ],
63
+ defaultValue: false,
64
+ public: true,
65
+ },
66
+ ];
67
+ const FacetValueCustomFields = [
68
+ {
69
+ name: "hexColor",
70
+ type: "string",
71
+ label: [
72
+ { languageCode: core_1.LanguageCode.en, value: "Color" },
73
+ { languageCode: core_1.LanguageCode.pl, value: "Kolor" },
74
+ ],
75
+ public: true,
76
+ defaultValue: "---",
77
+ nullable: true,
78
+ ui: { component: "color-picker-input" },
79
+ },
80
+ {
81
+ name: "isNew",
82
+ type: "boolean",
83
+ label: [
84
+ { languageCode: core_1.LanguageCode.en, value: "New" },
85
+ { languageCode: core_1.LanguageCode.pl, value: "Nowy" },
86
+ ],
87
+ defaultValue: false,
88
+ public: true,
89
+ },
90
+ {
91
+ name: "isHidden",
92
+ type: "boolean",
93
+ label: [
94
+ { languageCode: core_1.LanguageCode.en, value: "Hidden" },
95
+ { languageCode: core_1.LanguageCode.pl, value: "Ukryty" },
96
+ ],
97
+ defaultValue: false,
98
+ public: true,
99
+ },
100
+ {
101
+ name: "image",
102
+ type: "relation",
103
+ label: [
104
+ { languageCode: core_1.LanguageCode.en, value: "Image" },
105
+ { languageCode: core_1.LanguageCode.pl, value: "Obraz" },
106
+ ],
107
+ entity: core_1.Asset,
108
+ public: true,
109
+ },
110
+ ];
111
+ let FacetHarmonicaServerPlugin = class FacetHarmonicaServerPlugin {
112
+ static init(config) {
113
+ this.config = config;
114
+ return this;
115
+ }
116
+ };
117
+ exports.FacetHarmonicaServerPlugin = FacetHarmonicaServerPlugin;
118
+ exports.FacetHarmonicaServerPlugin = FacetHarmonicaServerPlugin = __decorate([
119
+ (0, core_1.DeenruvPlugin)({
120
+ compatibility: "^0.0.20",
121
+ imports: [core_1.PluginCommonModule],
122
+ configuration: (config) => {
123
+ config.customFields.Facet.push(...FacetCustomFields);
124
+ config.customFields.FacetValue.push(...FacetValueCustomFields);
125
+ return config;
126
+ },
127
+ })
128
+ ], FacetHarmonicaServerPlugin);
@@ -0,0 +1,6 @@
1
+ export declare const AllTypesProps: Record<string, any>;
2
+ export declare const ReturnTypes: Record<string, any>;
3
+ export declare const Ops: {
4
+ query: "Query";
5
+ mutation: "Mutation";
6
+ };