@medusajs/admin-shared 3.0.0-snapshot-20250410112222 → 3.0.0-snapshot-20251104004624
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/dist/index.d.mts +6 -3
- package/dist/index.d.ts +6 -3
- package/dist/index.js +50 -4
- package/dist/index.mjs +45 -1
- package/package.json +2 -7
package/dist/index.d.mts
CHANGED
|
@@ -60,7 +60,7 @@ type NestedRoutePosition = (typeof NESTED_ROUTE_POSITIONS)[number];
|
|
|
60
60
|
* All valid injection zones in the admin panel. An injection zone is a specific place
|
|
61
61
|
* in the admin panel where a plugin can inject custom widgets.
|
|
62
62
|
*/
|
|
63
|
-
declare const INJECTION_ZONES: readonly ["order.details.before", "order.details.after", "order.details.side.before", "order.details.side.after", "order.list.before", "order.list.after", "customer.details.before", "customer.details.after", "customer.details.side.before", "customer.details.side.after", "customer.list.before", "customer.list.after", "customer_group.details.before", "customer_group.details.after", "customer_group.list.before", "customer_group.list.after", "product.details.before", "product.details.after", "product.list.before", "product.list.after", "product.details.side.before", "product.details.side.after", "product_variant.details.before", "product_variant.details.after", "product_variant.details.side.before", "product_variant.details.side.after", "product_collection.details.before", "product_collection.details.after", "product_collection.list.before", "product_collection.list.after", "product_category.details.before", "product_category.details.after", "product_category.details.side.before", "product_category.details.side.after", "product_category.list.before", "product_category.list.after", "product_type.details.before", "product_type.details.after", "product_type.list.before", "product_type.list.after", "product_tag.details.before", "product_tag.details.after", "product_tag.list.before", "product_tag.list.after", "price_list.details.before", "price_list.details.after", "price_list.details.side.before", "price_list.details.side.after", "price_list.list.before", "price_list.list.after", "promotion.details.before", "promotion.details.after", "promotion.details.side.before", "promotion.details.side.after", "promotion.list.before", "promotion.list.after", "user.details.before", "user.details.after", "user.list.before", "user.list.after", "store.details.before", "store.details.after", "profile.details.before", "profile.details.after", "region.details.before", "region.details.after", "region.list.before", "region.list.after", "shipping_profile.details.before", "shipping_profile.details.after", "shipping_profile.list.before", "shipping_profile.list.after", "location.details.before", "location.details.after", "location.details.side.before", "location.details.side.after", "location.list.before", "location.list.after", "location.list.side.before", "location.list.side.after", "login.before", "login.after", "sales_channel.details.before", "sales_channel.details.after", "sales_channel.list.before", "sales_channel.list.after", "reservation.details.before", "reservation.details.after", "reservation.details.side.before", "reservation.details.side.after", "reservation.list.before", "reservation.list.after", "api_key.details.before", "api_key.details.after", "api_key.list.before", "api_key.list.after", "workflow.details.before", "workflow.details.after", "workflow.list.before", "workflow.list.after", "campaign.details.before", "campaign.details.after", "campaign.details.side.before", "campaign.details.side.after", "campaign.list.before", "campaign.list.after", "tax.details.before", "tax.details.after", "tax.list.before", "tax.list.after", "return_reason.list.before", "return_reason.list.after", "inventory_item.details.before", "inventory_item.details.after", "inventory_item.details.side.before", "inventory_item.details.side.after", "inventory_item.list.before", "inventory_item.list.after"];
|
|
63
|
+
declare const INJECTION_ZONES: readonly ["order.details.before", "order.details.after", "order.details.side.before", "order.details.side.after", "order.list.before", "order.list.after", "customer.details.before", "customer.details.after", "customer.details.side.before", "customer.details.side.after", "customer.list.before", "customer.list.after", "customer_group.details.before", "customer_group.details.after", "customer_group.list.before", "customer_group.list.after", "product.details.before", "product.details.after", "product.list.before", "product.list.after", "product.details.side.before", "product.details.side.after", "product_variant.details.before", "product_variant.details.after", "product_variant.details.side.before", "product_variant.details.side.after", "product_collection.details.before", "product_collection.details.after", "product_collection.list.before", "product_collection.list.after", "product_category.details.before", "product_category.details.after", "product_category.details.side.before", "product_category.details.side.after", "product_category.list.before", "product_category.list.after", "product_type.details.before", "product_type.details.after", "product_type.list.before", "product_type.list.after", "shipping_option_type.details.before", "shipping_option_type.details.after", "shipping_option_type.list.before", "shipping_option_type.list.after", "product_tag.details.before", "product_tag.details.after", "product_tag.list.before", "product_tag.list.after", "price_list.details.before", "price_list.details.after", "price_list.details.side.before", "price_list.details.side.after", "price_list.list.before", "price_list.list.after", "promotion.details.before", "promotion.details.after", "promotion.details.side.before", "promotion.details.side.after", "promotion.list.before", "promotion.list.after", "user.details.before", "user.details.after", "user.list.before", "user.list.after", "store.details.before", "store.details.after", "profile.details.before", "profile.details.after", "region.details.before", "region.details.after", "region.list.before", "region.list.after", "shipping_profile.details.before", "shipping_profile.details.after", "shipping_profile.list.before", "shipping_profile.list.after", "location.details.before", "location.details.after", "location.details.side.before", "location.details.side.after", "location.list.before", "location.list.after", "location.list.side.before", "location.list.side.after", "login.before", "login.after", "sales_channel.details.before", "sales_channel.details.after", "sales_channel.list.before", "sales_channel.list.after", "reservation.details.before", "reservation.details.after", "reservation.details.side.before", "reservation.details.side.after", "reservation.list.before", "reservation.list.after", "api_key.details.before", "api_key.details.after", "api_key.list.before", "api_key.list.after", "workflow.details.before", "workflow.details.after", "workflow.list.before", "workflow.list.after", "campaign.details.before", "campaign.details.after", "campaign.details.side.before", "campaign.details.side.after", "campaign.list.before", "campaign.list.after", "tax.details.before", "tax.details.after", "tax.list.before", "tax.list.after", "return_reason.list.before", "return_reason.list.after", "refund_reason.list.before", "refund_reason.list.after", "inventory_item.details.before", "inventory_item.details.after", "inventory_item.details.side.before", "inventory_item.details.side.after", "inventory_item.list.before", "inventory_item.list.after"];
|
|
64
64
|
|
|
65
65
|
type InjectionZone = (typeof INJECTION_ZONES)[number];
|
|
66
66
|
|
|
@@ -75,6 +75,9 @@ declare const DISPLAY_VIRTUAL_MODULE = "virtual:medusa/displays";
|
|
|
75
75
|
declare const ROUTE_VIRTUAL_MODULE = "virtual:medusa/routes";
|
|
76
76
|
declare const MENU_ITEM_VIRTUAL_MODULE = "virtual:medusa/menu-items";
|
|
77
77
|
declare const WIDGET_VIRTUAL_MODULE = "virtual:medusa/widgets";
|
|
78
|
-
declare const
|
|
78
|
+
declare const I18N_VIRTUAL_MODULE = "virtual:medusa/i18n";
|
|
79
|
+
declare const VIRTUAL_MODULES: readonly ["virtual:medusa/links", "virtual:medusa/forms", "virtual:medusa/displays", "virtual:medusa/routes", "virtual:medusa/menu-items", "virtual:medusa/widgets", "virtual:medusa/i18n"];
|
|
79
80
|
|
|
80
|
-
|
|
81
|
+
declare function deepMerge(target: any, source: any): any;
|
|
82
|
+
|
|
83
|
+
export { type CustomFieldContainerZone, type CustomFieldFormKeys, type CustomFieldFormTab, type CustomFieldFormZone, type CustomFieldImportType, type CustomFieldModel, type CustomFieldModelContainerMap, type CustomFieldModelFormMap, type CustomFieldModelFormTabsMap, type CustomFieldZone, DISPLAY_VIRTUAL_MODULE, FORM_VIRTUAL_MODULE, I18N_VIRTUAL_MODULE, INJECTION_ZONES, type InjectionZone, LINK_VIRTUAL_MODULE, MENU_ITEM_VIRTUAL_MODULE, NESTED_ROUTE_POSITIONS, type NestedRoutePosition, PRODUCT_CUSTOM_FIELD_CREATE_FORM_TABS, PRODUCT_CUSTOM_FIELD_DISPLAY_PATHS, PRODUCT_CUSTOM_FIELD_DISPLAY_ZONES, PRODUCT_CUSTOM_FIELD_FORM_CONFIG_PATHS, PRODUCT_CUSTOM_FIELD_FORM_FIELD_PATHS, PRODUCT_CUSTOM_FIELD_FORM_TABS, PRODUCT_CUSTOM_FIELD_FORM_ZONES, PRODUCT_CUSTOM_FIELD_LINK_PATHS, PRODUCT_CUSTOM_FIELD_MODEL, type ProductDisplayZone, type ProductFormTab, type ProductFormZone, ROUTE_VIRTUAL_MODULE, VIRTUAL_MODULES, WIDGET_VIRTUAL_MODULE, deepMerge, isValidCustomFieldDisplayPath, isValidCustomFieldDisplayZone, isValidCustomFieldFormConfigPath, isValidCustomFieldFormFieldPath, isValidCustomFieldFormTab, isValidCustomFieldFormZone, isValidCustomFieldLinkPath, isValidCustomFieldModel, isValidInjectionZone };
|
package/dist/index.d.ts
CHANGED
|
@@ -60,7 +60,7 @@ type NestedRoutePosition = (typeof NESTED_ROUTE_POSITIONS)[number];
|
|
|
60
60
|
* All valid injection zones in the admin panel. An injection zone is a specific place
|
|
61
61
|
* in the admin panel where a plugin can inject custom widgets.
|
|
62
62
|
*/
|
|
63
|
-
declare const INJECTION_ZONES: readonly ["order.details.before", "order.details.after", "order.details.side.before", "order.details.side.after", "order.list.before", "order.list.after", "customer.details.before", "customer.details.after", "customer.details.side.before", "customer.details.side.after", "customer.list.before", "customer.list.after", "customer_group.details.before", "customer_group.details.after", "customer_group.list.before", "customer_group.list.after", "product.details.before", "product.details.after", "product.list.before", "product.list.after", "product.details.side.before", "product.details.side.after", "product_variant.details.before", "product_variant.details.after", "product_variant.details.side.before", "product_variant.details.side.after", "product_collection.details.before", "product_collection.details.after", "product_collection.list.before", "product_collection.list.after", "product_category.details.before", "product_category.details.after", "product_category.details.side.before", "product_category.details.side.after", "product_category.list.before", "product_category.list.after", "product_type.details.before", "product_type.details.after", "product_type.list.before", "product_type.list.after", "product_tag.details.before", "product_tag.details.after", "product_tag.list.before", "product_tag.list.after", "price_list.details.before", "price_list.details.after", "price_list.details.side.before", "price_list.details.side.after", "price_list.list.before", "price_list.list.after", "promotion.details.before", "promotion.details.after", "promotion.details.side.before", "promotion.details.side.after", "promotion.list.before", "promotion.list.after", "user.details.before", "user.details.after", "user.list.before", "user.list.after", "store.details.before", "store.details.after", "profile.details.before", "profile.details.after", "region.details.before", "region.details.after", "region.list.before", "region.list.after", "shipping_profile.details.before", "shipping_profile.details.after", "shipping_profile.list.before", "shipping_profile.list.after", "location.details.before", "location.details.after", "location.details.side.before", "location.details.side.after", "location.list.before", "location.list.after", "location.list.side.before", "location.list.side.after", "login.before", "login.after", "sales_channel.details.before", "sales_channel.details.after", "sales_channel.list.before", "sales_channel.list.after", "reservation.details.before", "reservation.details.after", "reservation.details.side.before", "reservation.details.side.after", "reservation.list.before", "reservation.list.after", "api_key.details.before", "api_key.details.after", "api_key.list.before", "api_key.list.after", "workflow.details.before", "workflow.details.after", "workflow.list.before", "workflow.list.after", "campaign.details.before", "campaign.details.after", "campaign.details.side.before", "campaign.details.side.after", "campaign.list.before", "campaign.list.after", "tax.details.before", "tax.details.after", "tax.list.before", "tax.list.after", "return_reason.list.before", "return_reason.list.after", "inventory_item.details.before", "inventory_item.details.after", "inventory_item.details.side.before", "inventory_item.details.side.after", "inventory_item.list.before", "inventory_item.list.after"];
|
|
63
|
+
declare const INJECTION_ZONES: readonly ["order.details.before", "order.details.after", "order.details.side.before", "order.details.side.after", "order.list.before", "order.list.after", "customer.details.before", "customer.details.after", "customer.details.side.before", "customer.details.side.after", "customer.list.before", "customer.list.after", "customer_group.details.before", "customer_group.details.after", "customer_group.list.before", "customer_group.list.after", "product.details.before", "product.details.after", "product.list.before", "product.list.after", "product.details.side.before", "product.details.side.after", "product_variant.details.before", "product_variant.details.after", "product_variant.details.side.before", "product_variant.details.side.after", "product_collection.details.before", "product_collection.details.after", "product_collection.list.before", "product_collection.list.after", "product_category.details.before", "product_category.details.after", "product_category.details.side.before", "product_category.details.side.after", "product_category.list.before", "product_category.list.after", "product_type.details.before", "product_type.details.after", "product_type.list.before", "product_type.list.after", "shipping_option_type.details.before", "shipping_option_type.details.after", "shipping_option_type.list.before", "shipping_option_type.list.after", "product_tag.details.before", "product_tag.details.after", "product_tag.list.before", "product_tag.list.after", "price_list.details.before", "price_list.details.after", "price_list.details.side.before", "price_list.details.side.after", "price_list.list.before", "price_list.list.after", "promotion.details.before", "promotion.details.after", "promotion.details.side.before", "promotion.details.side.after", "promotion.list.before", "promotion.list.after", "user.details.before", "user.details.after", "user.list.before", "user.list.after", "store.details.before", "store.details.after", "profile.details.before", "profile.details.after", "region.details.before", "region.details.after", "region.list.before", "region.list.after", "shipping_profile.details.before", "shipping_profile.details.after", "shipping_profile.list.before", "shipping_profile.list.after", "location.details.before", "location.details.after", "location.details.side.before", "location.details.side.after", "location.list.before", "location.list.after", "location.list.side.before", "location.list.side.after", "login.before", "login.after", "sales_channel.details.before", "sales_channel.details.after", "sales_channel.list.before", "sales_channel.list.after", "reservation.details.before", "reservation.details.after", "reservation.details.side.before", "reservation.details.side.after", "reservation.list.before", "reservation.list.after", "api_key.details.before", "api_key.details.after", "api_key.list.before", "api_key.list.after", "workflow.details.before", "workflow.details.after", "workflow.list.before", "workflow.list.after", "campaign.details.before", "campaign.details.after", "campaign.details.side.before", "campaign.details.side.after", "campaign.list.before", "campaign.list.after", "tax.details.before", "tax.details.after", "tax.list.before", "tax.list.after", "return_reason.list.before", "return_reason.list.after", "refund_reason.list.before", "refund_reason.list.after", "inventory_item.details.before", "inventory_item.details.after", "inventory_item.details.side.before", "inventory_item.details.side.after", "inventory_item.list.before", "inventory_item.list.after"];
|
|
64
64
|
|
|
65
65
|
type InjectionZone = (typeof INJECTION_ZONES)[number];
|
|
66
66
|
|
|
@@ -75,6 +75,9 @@ declare const DISPLAY_VIRTUAL_MODULE = "virtual:medusa/displays";
|
|
|
75
75
|
declare const ROUTE_VIRTUAL_MODULE = "virtual:medusa/routes";
|
|
76
76
|
declare const MENU_ITEM_VIRTUAL_MODULE = "virtual:medusa/menu-items";
|
|
77
77
|
declare const WIDGET_VIRTUAL_MODULE = "virtual:medusa/widgets";
|
|
78
|
-
declare const
|
|
78
|
+
declare const I18N_VIRTUAL_MODULE = "virtual:medusa/i18n";
|
|
79
|
+
declare const VIRTUAL_MODULES: readonly ["virtual:medusa/links", "virtual:medusa/forms", "virtual:medusa/displays", "virtual:medusa/routes", "virtual:medusa/menu-items", "virtual:medusa/widgets", "virtual:medusa/i18n"];
|
|
79
80
|
|
|
80
|
-
|
|
81
|
+
declare function deepMerge(target: any, source: any): any;
|
|
82
|
+
|
|
83
|
+
export { type CustomFieldContainerZone, type CustomFieldFormKeys, type CustomFieldFormTab, type CustomFieldFormZone, type CustomFieldImportType, type CustomFieldModel, type CustomFieldModelContainerMap, type CustomFieldModelFormMap, type CustomFieldModelFormTabsMap, type CustomFieldZone, DISPLAY_VIRTUAL_MODULE, FORM_VIRTUAL_MODULE, I18N_VIRTUAL_MODULE, INJECTION_ZONES, type InjectionZone, LINK_VIRTUAL_MODULE, MENU_ITEM_VIRTUAL_MODULE, NESTED_ROUTE_POSITIONS, type NestedRoutePosition, PRODUCT_CUSTOM_FIELD_CREATE_FORM_TABS, PRODUCT_CUSTOM_FIELD_DISPLAY_PATHS, PRODUCT_CUSTOM_FIELD_DISPLAY_ZONES, PRODUCT_CUSTOM_FIELD_FORM_CONFIG_PATHS, PRODUCT_CUSTOM_FIELD_FORM_FIELD_PATHS, PRODUCT_CUSTOM_FIELD_FORM_TABS, PRODUCT_CUSTOM_FIELD_FORM_ZONES, PRODUCT_CUSTOM_FIELD_LINK_PATHS, PRODUCT_CUSTOM_FIELD_MODEL, type ProductDisplayZone, type ProductFormTab, type ProductFormZone, ROUTE_VIRTUAL_MODULE, VIRTUAL_MODULES, WIDGET_VIRTUAL_MODULE, deepMerge, isValidCustomFieldDisplayPath, isValidCustomFieldDisplayZone, isValidCustomFieldFormConfigPath, isValidCustomFieldFormFieldPath, isValidCustomFieldFormTab, isValidCustomFieldFormZone, isValidCustomFieldLinkPath, isValidCustomFieldModel, isValidInjectionZone };
|
package/dist/index.js
CHANGED
|
@@ -18,10 +18,11 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
|
|
20
20
|
// src/index.ts
|
|
21
|
-
var
|
|
22
|
-
__export(
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
23
|
DISPLAY_VIRTUAL_MODULE: () => DISPLAY_VIRTUAL_MODULE,
|
|
24
24
|
FORM_VIRTUAL_MODULE: () => FORM_VIRTUAL_MODULE,
|
|
25
|
+
I18N_VIRTUAL_MODULE: () => I18N_VIRTUAL_MODULE,
|
|
25
26
|
INJECTION_ZONES: () => INJECTION_ZONES,
|
|
26
27
|
LINK_VIRTUAL_MODULE: () => LINK_VIRTUAL_MODULE,
|
|
27
28
|
MENU_ITEM_VIRTUAL_MODULE: () => MENU_ITEM_VIRTUAL_MODULE,
|
|
@@ -38,6 +39,7 @@ __export(src_exports, {
|
|
|
38
39
|
ROUTE_VIRTUAL_MODULE: () => ROUTE_VIRTUAL_MODULE,
|
|
39
40
|
VIRTUAL_MODULES: () => VIRTUAL_MODULES,
|
|
40
41
|
WIDGET_VIRTUAL_MODULE: () => WIDGET_VIRTUAL_MODULE,
|
|
42
|
+
deepMerge: () => deepMerge,
|
|
41
43
|
isValidCustomFieldDisplayPath: () => isValidCustomFieldDisplayPath,
|
|
42
44
|
isValidCustomFieldDisplayZone: () => isValidCustomFieldDisplayZone,
|
|
43
45
|
isValidCustomFieldFormConfigPath: () => isValidCustomFieldFormConfigPath,
|
|
@@ -48,7 +50,7 @@ __export(src_exports, {
|
|
|
48
50
|
isValidCustomFieldModel: () => isValidCustomFieldModel,
|
|
49
51
|
isValidInjectionZone: () => isValidInjectionZone
|
|
50
52
|
});
|
|
51
|
-
module.exports = __toCommonJS(
|
|
53
|
+
module.exports = __toCommonJS(index_exports);
|
|
52
54
|
|
|
53
55
|
// src/extensions/custom-fields/product/constants.ts
|
|
54
56
|
var PRODUCT_CUSTOM_FIELD_MODEL = "product";
|
|
@@ -202,6 +204,12 @@ var PRODUCT_CATEGORY_INJECTION_ZONES = [
|
|
|
202
204
|
"product_category.list.before",
|
|
203
205
|
"product_category.list.after"
|
|
204
206
|
];
|
|
207
|
+
var SHIPPING_OPTION_TYPE_INJECTION_ZONES = [
|
|
208
|
+
"shipping_option_type.details.before",
|
|
209
|
+
"shipping_option_type.details.after",
|
|
210
|
+
"shipping_option_type.list.before",
|
|
211
|
+
"shipping_option_type.list.after"
|
|
212
|
+
];
|
|
205
213
|
var PRODUCT_TYPE_INJECTION_ZONES = [
|
|
206
214
|
"product_type.details.before",
|
|
207
215
|
"product_type.details.after",
|
|
@@ -311,6 +319,10 @@ var RETURN_REASON_INJECTION_ZONES = [
|
|
|
311
319
|
"return_reason.list.before",
|
|
312
320
|
"return_reason.list.after"
|
|
313
321
|
];
|
|
322
|
+
var REFUND_REASON_INJECTION_ZONES = [
|
|
323
|
+
"refund_reason.list.before",
|
|
324
|
+
"refund_reason.list.after"
|
|
325
|
+
];
|
|
314
326
|
var INVENTORY_ITEM_INJECTION_ZONES = [
|
|
315
327
|
"inventory_item.details.before",
|
|
316
328
|
"inventory_item.details.after",
|
|
@@ -328,6 +340,7 @@ var INJECTION_ZONES = [
|
|
|
328
340
|
...PRODUCT_COLLECTION_INJECTION_ZONES,
|
|
329
341
|
...PRODUCT_CATEGORY_INJECTION_ZONES,
|
|
330
342
|
...PRODUCT_TYPE_INJECTION_ZONES,
|
|
343
|
+
...SHIPPING_OPTION_TYPE_INJECTION_ZONES,
|
|
331
344
|
...PRODUCT_TAG_INJECTION_ZONES,
|
|
332
345
|
...PRICE_LIST_INJECTION_ZONES,
|
|
333
346
|
...PROMOTION_INJECTION_ZONES,
|
|
@@ -345,6 +358,7 @@ var INJECTION_ZONES = [
|
|
|
345
358
|
...CAMPAIGN_INJECTION_ZONES,
|
|
346
359
|
...TAX_INJECTION_ZONES,
|
|
347
360
|
...RETURN_REASON_INJECTION_ZONES,
|
|
361
|
+
...REFUND_REASON_INJECTION_ZONES,
|
|
348
362
|
...INVENTORY_ITEM_INJECTION_ZONES
|
|
349
363
|
];
|
|
350
364
|
|
|
@@ -360,18 +374,49 @@ var DISPLAY_VIRTUAL_MODULE = `virtual:medusa/displays`;
|
|
|
360
374
|
var ROUTE_VIRTUAL_MODULE = `virtual:medusa/routes`;
|
|
361
375
|
var MENU_ITEM_VIRTUAL_MODULE = `virtual:medusa/menu-items`;
|
|
362
376
|
var WIDGET_VIRTUAL_MODULE = `virtual:medusa/widgets`;
|
|
377
|
+
var I18N_VIRTUAL_MODULE = `virtual:medusa/i18n`;
|
|
363
378
|
var VIRTUAL_MODULES = [
|
|
364
379
|
LINK_VIRTUAL_MODULE,
|
|
365
380
|
FORM_VIRTUAL_MODULE,
|
|
366
381
|
DISPLAY_VIRTUAL_MODULE,
|
|
367
382
|
ROUTE_VIRTUAL_MODULE,
|
|
368
383
|
MENU_ITEM_VIRTUAL_MODULE,
|
|
369
|
-
WIDGET_VIRTUAL_MODULE
|
|
384
|
+
WIDGET_VIRTUAL_MODULE,
|
|
385
|
+
I18N_VIRTUAL_MODULE
|
|
370
386
|
];
|
|
387
|
+
|
|
388
|
+
// src/utils/is-object.ts
|
|
389
|
+
function isObject(obj) {
|
|
390
|
+
return obj != null && obj?.constructor?.name === "Object";
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
// src/utils/deep-merge.ts
|
|
394
|
+
function deepMerge(target, source) {
|
|
395
|
+
const recursive = (a, b) => {
|
|
396
|
+
if (!isObject(a)) {
|
|
397
|
+
return b;
|
|
398
|
+
}
|
|
399
|
+
if (!isObject(b)) {
|
|
400
|
+
return a;
|
|
401
|
+
}
|
|
402
|
+
Object.keys(b).forEach((key) => {
|
|
403
|
+
if (isObject(b[key])) {
|
|
404
|
+
a[key] ?? (a[key] = {});
|
|
405
|
+
a[key] = deepMerge(a[key], b[key]);
|
|
406
|
+
} else {
|
|
407
|
+
a[key] = b[key];
|
|
408
|
+
}
|
|
409
|
+
});
|
|
410
|
+
return a;
|
|
411
|
+
};
|
|
412
|
+
const copy = { ...target };
|
|
413
|
+
return recursive(copy, source);
|
|
414
|
+
}
|
|
371
415
|
// Annotate the CommonJS export names for ESM import in node:
|
|
372
416
|
0 && (module.exports = {
|
|
373
417
|
DISPLAY_VIRTUAL_MODULE,
|
|
374
418
|
FORM_VIRTUAL_MODULE,
|
|
419
|
+
I18N_VIRTUAL_MODULE,
|
|
375
420
|
INJECTION_ZONES,
|
|
376
421
|
LINK_VIRTUAL_MODULE,
|
|
377
422
|
MENU_ITEM_VIRTUAL_MODULE,
|
|
@@ -388,6 +433,7 @@ var VIRTUAL_MODULES = [
|
|
|
388
433
|
ROUTE_VIRTUAL_MODULE,
|
|
389
434
|
VIRTUAL_MODULES,
|
|
390
435
|
WIDGET_VIRTUAL_MODULE,
|
|
436
|
+
deepMerge,
|
|
391
437
|
isValidCustomFieldDisplayPath,
|
|
392
438
|
isValidCustomFieldDisplayZone,
|
|
393
439
|
isValidCustomFieldFormConfigPath,
|
package/dist/index.mjs
CHANGED
|
@@ -150,6 +150,12 @@ var PRODUCT_CATEGORY_INJECTION_ZONES = [
|
|
|
150
150
|
"product_category.list.before",
|
|
151
151
|
"product_category.list.after"
|
|
152
152
|
];
|
|
153
|
+
var SHIPPING_OPTION_TYPE_INJECTION_ZONES = [
|
|
154
|
+
"shipping_option_type.details.before",
|
|
155
|
+
"shipping_option_type.details.after",
|
|
156
|
+
"shipping_option_type.list.before",
|
|
157
|
+
"shipping_option_type.list.after"
|
|
158
|
+
];
|
|
153
159
|
var PRODUCT_TYPE_INJECTION_ZONES = [
|
|
154
160
|
"product_type.details.before",
|
|
155
161
|
"product_type.details.after",
|
|
@@ -259,6 +265,10 @@ var RETURN_REASON_INJECTION_ZONES = [
|
|
|
259
265
|
"return_reason.list.before",
|
|
260
266
|
"return_reason.list.after"
|
|
261
267
|
];
|
|
268
|
+
var REFUND_REASON_INJECTION_ZONES = [
|
|
269
|
+
"refund_reason.list.before",
|
|
270
|
+
"refund_reason.list.after"
|
|
271
|
+
];
|
|
262
272
|
var INVENTORY_ITEM_INJECTION_ZONES = [
|
|
263
273
|
"inventory_item.details.before",
|
|
264
274
|
"inventory_item.details.after",
|
|
@@ -276,6 +286,7 @@ var INJECTION_ZONES = [
|
|
|
276
286
|
...PRODUCT_COLLECTION_INJECTION_ZONES,
|
|
277
287
|
...PRODUCT_CATEGORY_INJECTION_ZONES,
|
|
278
288
|
...PRODUCT_TYPE_INJECTION_ZONES,
|
|
289
|
+
...SHIPPING_OPTION_TYPE_INJECTION_ZONES,
|
|
279
290
|
...PRODUCT_TAG_INJECTION_ZONES,
|
|
280
291
|
...PRICE_LIST_INJECTION_ZONES,
|
|
281
292
|
...PROMOTION_INJECTION_ZONES,
|
|
@@ -293,6 +304,7 @@ var INJECTION_ZONES = [
|
|
|
293
304
|
...CAMPAIGN_INJECTION_ZONES,
|
|
294
305
|
...TAX_INJECTION_ZONES,
|
|
295
306
|
...RETURN_REASON_INJECTION_ZONES,
|
|
307
|
+
...REFUND_REASON_INJECTION_ZONES,
|
|
296
308
|
...INVENTORY_ITEM_INJECTION_ZONES
|
|
297
309
|
];
|
|
298
310
|
|
|
@@ -308,17 +320,48 @@ var DISPLAY_VIRTUAL_MODULE = `virtual:medusa/displays`;
|
|
|
308
320
|
var ROUTE_VIRTUAL_MODULE = `virtual:medusa/routes`;
|
|
309
321
|
var MENU_ITEM_VIRTUAL_MODULE = `virtual:medusa/menu-items`;
|
|
310
322
|
var WIDGET_VIRTUAL_MODULE = `virtual:medusa/widgets`;
|
|
323
|
+
var I18N_VIRTUAL_MODULE = `virtual:medusa/i18n`;
|
|
311
324
|
var VIRTUAL_MODULES = [
|
|
312
325
|
LINK_VIRTUAL_MODULE,
|
|
313
326
|
FORM_VIRTUAL_MODULE,
|
|
314
327
|
DISPLAY_VIRTUAL_MODULE,
|
|
315
328
|
ROUTE_VIRTUAL_MODULE,
|
|
316
329
|
MENU_ITEM_VIRTUAL_MODULE,
|
|
317
|
-
WIDGET_VIRTUAL_MODULE
|
|
330
|
+
WIDGET_VIRTUAL_MODULE,
|
|
331
|
+
I18N_VIRTUAL_MODULE
|
|
318
332
|
];
|
|
333
|
+
|
|
334
|
+
// src/utils/is-object.ts
|
|
335
|
+
function isObject(obj) {
|
|
336
|
+
return obj != null && obj?.constructor?.name === "Object";
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
// src/utils/deep-merge.ts
|
|
340
|
+
function deepMerge(target, source) {
|
|
341
|
+
const recursive = (a, b) => {
|
|
342
|
+
if (!isObject(a)) {
|
|
343
|
+
return b;
|
|
344
|
+
}
|
|
345
|
+
if (!isObject(b)) {
|
|
346
|
+
return a;
|
|
347
|
+
}
|
|
348
|
+
Object.keys(b).forEach((key) => {
|
|
349
|
+
if (isObject(b[key])) {
|
|
350
|
+
a[key] ?? (a[key] = {});
|
|
351
|
+
a[key] = deepMerge(a[key], b[key]);
|
|
352
|
+
} else {
|
|
353
|
+
a[key] = b[key];
|
|
354
|
+
}
|
|
355
|
+
});
|
|
356
|
+
return a;
|
|
357
|
+
};
|
|
358
|
+
const copy = { ...target };
|
|
359
|
+
return recursive(copy, source);
|
|
360
|
+
}
|
|
319
361
|
export {
|
|
320
362
|
DISPLAY_VIRTUAL_MODULE,
|
|
321
363
|
FORM_VIRTUAL_MODULE,
|
|
364
|
+
I18N_VIRTUAL_MODULE,
|
|
322
365
|
INJECTION_ZONES,
|
|
323
366
|
LINK_VIRTUAL_MODULE,
|
|
324
367
|
MENU_ITEM_VIRTUAL_MODULE,
|
|
@@ -335,6 +378,7 @@ export {
|
|
|
335
378
|
ROUTE_VIRTUAL_MODULE,
|
|
336
379
|
VIRTUAL_MODULES,
|
|
337
380
|
WIDGET_VIRTUAL_MODULE,
|
|
381
|
+
deepMerge,
|
|
338
382
|
isValidCustomFieldDisplayPath,
|
|
339
383
|
isValidCustomFieldDisplayZone,
|
|
340
384
|
isValidCustomFieldFormConfigPath,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medusajs/admin-shared",
|
|
3
3
|
"description": "Shared code for Medusa admin packages.",
|
|
4
|
-
"version": "3.0.0-snapshot-
|
|
4
|
+
"version": "3.0.0-snapshot-20251104004624",
|
|
5
5
|
"author": "Kasper Kristensen <kasper@medusajs.com>",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"main": "dist/index.js",
|
|
@@ -16,12 +16,7 @@
|
|
|
16
16
|
"package.json"
|
|
17
17
|
],
|
|
18
18
|
"scripts": {
|
|
19
|
-
"build": "tsup"
|
|
20
|
-
},
|
|
21
|
-
"devDependencies": {
|
|
22
|
-
"@types/react": "^18.3.2",
|
|
23
|
-
"tsup": "^8.0.2",
|
|
24
|
-
"typescript": "^5.3.3"
|
|
19
|
+
"build": "yarn run -T tsup"
|
|
25
20
|
},
|
|
26
21
|
"packageManager": "yarn@3.2.1"
|
|
27
22
|
}
|