@lodashventure/medusa-product-content 1.2.19 → 1.2.21
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/.medusa/server/index.d.ts +1 -0
- package/.medusa/server/index.js +7 -0
- package/.medusa/server/modules/product-content/index.d.ts +21 -0
- package/.medusa/server/modules/product-content/index.js +13 -0
- package/.medusa/server/modules/product-content/models/product-content.d.ts +7 -0
- package/.medusa/server/modules/product-content/models/product-content.js +19 -0
- package/.medusa/server/modules/product-content/service.d.ts +12 -0
- package/.medusa/server/modules/product-content/service.js +10 -0
- package/.medusa/server/src/admin/index.js +1597 -0
- package/.medusa/server/src/admin/index.mjs +1595 -0
- package/.medusa/server/types/index.d.ts +173 -0
- package/.medusa/server/types/index.js +6 -0
- package/package.json +8 -7
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type definitions for Product Content Manager plugin
|
|
3
|
+
*/
|
|
4
|
+
import type { ReactNode } from "react";
|
|
5
|
+
export interface LongDescription {
|
|
6
|
+
html: string;
|
|
7
|
+
richjson?: Record<string, any>;
|
|
8
|
+
locale: string;
|
|
9
|
+
updated_by?: string;
|
|
10
|
+
updated_at?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface LongDescriptionVersion extends LongDescription {
|
|
13
|
+
version: number;
|
|
14
|
+
created_at: string;
|
|
15
|
+
}
|
|
16
|
+
export interface SpecI18n {
|
|
17
|
+
key: string;
|
|
18
|
+
value: string;
|
|
19
|
+
}
|
|
20
|
+
export interface SpecItem {
|
|
21
|
+
position: number;
|
|
22
|
+
i18n: Record<string, SpecI18n>;
|
|
23
|
+
visible: boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface SpecGroupI18n {
|
|
26
|
+
label: string;
|
|
27
|
+
}
|
|
28
|
+
export interface SpecGroup {
|
|
29
|
+
key: string;
|
|
30
|
+
position: number;
|
|
31
|
+
i18n: Record<string, SpecGroupI18n>;
|
|
32
|
+
items: SpecItem[];
|
|
33
|
+
}
|
|
34
|
+
export interface ProductSpecs {
|
|
35
|
+
default_locale: string;
|
|
36
|
+
groups: SpecGroup[];
|
|
37
|
+
}
|
|
38
|
+
export interface ProductContentMetadata {
|
|
39
|
+
long_description?: LongDescription;
|
|
40
|
+
long_description_versions?: LongDescriptionVersion[];
|
|
41
|
+
specs?: ProductSpecs;
|
|
42
|
+
content_last_updated?: string;
|
|
43
|
+
content_updated_by?: string;
|
|
44
|
+
}
|
|
45
|
+
export interface EnhancedProduct {
|
|
46
|
+
id: string;
|
|
47
|
+
title: string;
|
|
48
|
+
subtitle?: string | null;
|
|
49
|
+
handle: string;
|
|
50
|
+
description?: string | null;
|
|
51
|
+
status: string;
|
|
52
|
+
type?: {
|
|
53
|
+
id: string;
|
|
54
|
+
value: string;
|
|
55
|
+
} | null;
|
|
56
|
+
variants?: any[];
|
|
57
|
+
options?: any[];
|
|
58
|
+
images?: any[];
|
|
59
|
+
collection?: any;
|
|
60
|
+
categories?: any[];
|
|
61
|
+
tags?: any[];
|
|
62
|
+
metadata: ProductContentMetadata;
|
|
63
|
+
}
|
|
64
|
+
export interface ImportExportConfig {
|
|
65
|
+
format: "csv" | "json";
|
|
66
|
+
encoding?: string;
|
|
67
|
+
delimiter?: string;
|
|
68
|
+
includeHeaders?: boolean;
|
|
69
|
+
}
|
|
70
|
+
export interface SpecImportRow {
|
|
71
|
+
product_id?: string;
|
|
72
|
+
group: string;
|
|
73
|
+
[key: `key.${string}`]: string;
|
|
74
|
+
[key: `value.${string}`]: string;
|
|
75
|
+
position?: number;
|
|
76
|
+
visible?: boolean;
|
|
77
|
+
}
|
|
78
|
+
export interface LocaleConfig {
|
|
79
|
+
code: string;
|
|
80
|
+
label: string;
|
|
81
|
+
isDefault?: boolean;
|
|
82
|
+
direction?: "ltr" | "rtl";
|
|
83
|
+
}
|
|
84
|
+
export interface EditorConfig {
|
|
85
|
+
maxLength?: number;
|
|
86
|
+
allowedTags?: string[];
|
|
87
|
+
allowedAttributes?: Record<string, string[]>;
|
|
88
|
+
uploadEndpoint?: string;
|
|
89
|
+
placeholder?: string;
|
|
90
|
+
}
|
|
91
|
+
export interface PluginConfig {
|
|
92
|
+
locales?: LocaleConfig[];
|
|
93
|
+
defaultLocale?: string;
|
|
94
|
+
editor?: EditorConfig;
|
|
95
|
+
versioning?: {
|
|
96
|
+
enabled?: boolean;
|
|
97
|
+
maxVersions?: number;
|
|
98
|
+
};
|
|
99
|
+
sanitization?: {
|
|
100
|
+
allowedTags?: string[];
|
|
101
|
+
allowedAttributes?: Record<string, string[]>;
|
|
102
|
+
removeScripts?: boolean;
|
|
103
|
+
removeStyles?: boolean;
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
export interface TabProps {
|
|
107
|
+
product: EnhancedProduct;
|
|
108
|
+
isLoading?: boolean;
|
|
109
|
+
onUpdate?: (updates: Partial<ProductContentMetadata>) => Promise<void>;
|
|
110
|
+
config?: PluginConfig;
|
|
111
|
+
}
|
|
112
|
+
export interface EditorToolbarButton {
|
|
113
|
+
icon: ReactNode;
|
|
114
|
+
label: string;
|
|
115
|
+
command: string;
|
|
116
|
+
isActive?: boolean;
|
|
117
|
+
isDisabled?: boolean;
|
|
118
|
+
}
|
|
119
|
+
export interface SpecTableColumn {
|
|
120
|
+
id: string;
|
|
121
|
+
header: string;
|
|
122
|
+
accessor: string | ((row: any) => any);
|
|
123
|
+
width?: number | string;
|
|
124
|
+
sortable?: boolean;
|
|
125
|
+
editable?: boolean;
|
|
126
|
+
}
|
|
127
|
+
export interface ImportValidationError {
|
|
128
|
+
row: number;
|
|
129
|
+
field: string;
|
|
130
|
+
message: string;
|
|
131
|
+
value?: any;
|
|
132
|
+
}
|
|
133
|
+
export interface ImportValidationResult {
|
|
134
|
+
isValid: boolean;
|
|
135
|
+
errors: ImportValidationError[];
|
|
136
|
+
warnings?: ImportValidationError[];
|
|
137
|
+
processedRows?: number;
|
|
138
|
+
}
|
|
139
|
+
export type SortDirection = "asc" | "desc";
|
|
140
|
+
export interface SortConfig {
|
|
141
|
+
field: string;
|
|
142
|
+
direction: SortDirection;
|
|
143
|
+
}
|
|
144
|
+
export interface FilterConfig {
|
|
145
|
+
field: string;
|
|
146
|
+
operator: "equals" | "contains" | "startsWith" | "endsWith";
|
|
147
|
+
value: any;
|
|
148
|
+
}
|
|
149
|
+
export interface PaginationConfig {
|
|
150
|
+
page: number;
|
|
151
|
+
pageSize: number;
|
|
152
|
+
total?: number;
|
|
153
|
+
}
|
|
154
|
+
export interface LocaleUtils {
|
|
155
|
+
getLocaleLabel: (code: string) => string;
|
|
156
|
+
parseLocaleCode: (code: string) => {
|
|
157
|
+
language: string;
|
|
158
|
+
region?: string;
|
|
159
|
+
};
|
|
160
|
+
getLanguageFromLocale: (code: string) => string;
|
|
161
|
+
getFallbackLocale: (locale: string, availableLocales: string[], defaultLocale: string) => string;
|
|
162
|
+
calculateLocaleCompleteness: (specs: ProductSpecs, locale: string) => number;
|
|
163
|
+
}
|
|
164
|
+
export interface DragEndEvent {
|
|
165
|
+
destination?: {
|
|
166
|
+
index: number;
|
|
167
|
+
};
|
|
168
|
+
source: {
|
|
169
|
+
index: number;
|
|
170
|
+
};
|
|
171
|
+
draggableId: string;
|
|
172
|
+
type: string;
|
|
173
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Type definitions for Product Content Manager plugin
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvdHlwZXMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBOztHQUVHIn0=
|
package/package.json
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lodashventure/medusa-product-content",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.21",
|
|
4
4
|
"description": "Medusa Admin plugin for enhanced product content management with rich text editor and i18n specifications",
|
|
5
5
|
"author": "Product Core Team",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"files": [
|
|
9
9
|
"dist",
|
|
10
|
-
"admin"
|
|
10
|
+
"admin",
|
|
11
|
+
".medusa"
|
|
11
12
|
],
|
|
12
13
|
"exports": {
|
|
13
14
|
"./package.json": "./package.json",
|
|
14
|
-
"./workflows": "./.medusa/server/
|
|
15
|
-
"./.medusa/server/src/modules/*": "./.medusa/server/
|
|
16
|
-
"./modules/*": "./.medusa/server/
|
|
17
|
-
"./providers/*": "./.medusa/server/
|
|
15
|
+
"./workflows": "./.medusa/server/workflows/index.js",
|
|
16
|
+
"./.medusa/server/src/modules/*": "./.medusa/server/modules/*/index.js",
|
|
17
|
+
"./modules/*": "./.medusa/server/modules/*/index.js",
|
|
18
|
+
"./providers/*": "./.medusa/server/providers/*/index.js",
|
|
18
19
|
"./admin": "./.medusa/server/src/admin/index.mjs",
|
|
19
|
-
"./*": "./.medusa/server
|
|
20
|
+
"./*": "./.medusa/server/*.js"
|
|
20
21
|
},
|
|
21
22
|
"scripts": {
|
|
22
23
|
"build": "medusa plugin:build",
|