@vc-shell/framework 1.1.56 → 1.1.58
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/CHANGELOG.md +20 -0
- package/core/services/widget-service.ts +27 -4
- package/dist/core/services/widget-service.d.ts +13 -2
- package/dist/core/services/widget-service.d.ts.map +1 -1
- package/dist/framework.js +1872 -1902
- package/dist/index.css +1 -1
- package/dist/shared/composables/index.d.ts +0 -1
- package/dist/shared/composables/index.d.ts.map +1 -1
- package/dist/shared/composables/useExternalWidgets.d.ts +1 -6
- package/dist/shared/composables/useExternalWidgets.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui/components/molecules/vc-select/vc-select.vue.d.ts +4 -4
- package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-widget-container/_internal/vc-widget-container-desktop.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-header/vc-table-header.vue.d.ts +1 -1
- package/dist/ui/components/organisms/vc-table/_internal/vc-table-header/vc-table-header.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-table/types.d.ts +1 -1
- package/dist/ui/components/organisms/vc-table/types.d.ts.map +1 -1
- package/package.json +4 -4
- package/shared/composables/index.ts +0 -1
- package/shared/composables/useExternalWidgets.ts +38 -86
- package/ui/components/molecules/vc-editor/vc-editor.vue +2 -2
- package/ui/components/molecules/vc-select/vc-select.vue +1 -1
- package/ui/components/organisms/vc-blade/_internal/vc-blade-widget-container/_internal/vc-widget-container-desktop.vue +1 -0
- package/ui/components/organisms/vc-table/_internal/vc-table-header/vc-table-header.vue +1 -1
- package/ui/components/organisms/vc-table/types.ts +1 -1
- package/dist/shared/composables/useBladeMultilanguage.d.ts +0 -28
- package/dist/shared/composables/useBladeMultilanguage.d.ts.map +0 -1
- package/shared/composables/useBladeMultilanguage.ts +0 -75
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
## [1.1.58](https://github.com/VirtoCommerce/vc-shell/compare/v1.1.57...v1.1.58) (2025-07-10)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## [1.1.57](https://github.com/VirtoCommerce/vc-shell/compare/v1.1.56...v1.1.57) (2025-07-10)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **vc-editor:** update disabled text and background colors ([0ee79c5](https://github.com/VirtoCommerce/vc-shell/commit/0ee79c59bcc631ae5ee8868032dc626ec8fca890))
|
|
11
|
+
* **vc-select:** update modelValue type to support multiple option formats ([1f163a8](https://github.com/VirtoCommerce/vc-shell/commit/1f163a8cc7679d2aa5f5a94db49d79b3f98fe247))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* **vc-widget-container:** add click event to toggle toolbar visibility on click ([007931f](https://github.com/VirtoCommerce/vc-shell/commit/007931f8c86b224a5b03a1ad321f633eace715ec))
|
|
17
|
+
* **widget-service:** add methods to retrieve all external widgets and clone widgets for improved widget management ([2806152](https://github.com/VirtoCommerce/vc-shell/commit/2806152873d85bbee9877ef2ead9d2ceabcca0a6))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
1
21
|
## [1.1.56](https://github.com/VirtoCommerce/vc-shell/compare/v1.1.55...v1.1.56) (2025-07-08)
|
|
2
22
|
|
|
3
23
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Component, reactive, ref, ComponentInternalInstance, ComputedRef, Ref,
|
|
1
|
+
import { Component, reactive, ref, ComponentInternalInstance, ComputedRef, Ref, markRaw, Raw } from "vue";
|
|
2
2
|
import { IBladeInstance } from "../../shared/components/blade-navigation/types";
|
|
3
|
+
import { cloneDeep } from "lodash-es";
|
|
3
4
|
|
|
4
5
|
export type WidgetEventHandler = (...args: unknown[]) => void;
|
|
5
6
|
|
|
@@ -35,7 +36,7 @@ export interface IWidget {
|
|
|
35
36
|
|
|
36
37
|
export interface IWidgetRegistration {
|
|
37
38
|
bladeId: string;
|
|
38
|
-
widget: IWidget
|
|
39
|
+
widget: Raw<IWidget>;
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
// Interface for global registration of external widgets
|
|
@@ -62,6 +63,8 @@ export interface IWidgetService {
|
|
|
62
63
|
updateWidget: ({ id, bladeId, widget }: { id: string; bladeId: string; widget: Partial<IWidget> }) => void;
|
|
63
64
|
resolveWidgetProps: (widget: IWidget, bladeData: Record<string, unknown>) => Record<string, unknown>;
|
|
64
65
|
getExternalWidgetsForBlade: (bladeId: string) => IExternalWidgetRegistration[];
|
|
66
|
+
getAllExternalWidgets: () => IExternalWidgetRegistration[];
|
|
67
|
+
cloneWidget: <T extends IWidget | IExternalWidgetRegistration>(widget: T) => T;
|
|
65
68
|
}
|
|
66
69
|
|
|
67
70
|
// Global state for pre-registering widgets
|
|
@@ -94,6 +97,22 @@ export function getExternalWidgetsForBlade(bladeId: string): IExternalWidgetRegi
|
|
|
94
97
|
return externalWidgets.filter((widget) => !widget.targetBlades || widget.targetBlades.includes(bladeId));
|
|
95
98
|
}
|
|
96
99
|
|
|
100
|
+
/**
|
|
101
|
+
* Gets all external widgets
|
|
102
|
+
*/
|
|
103
|
+
export function getAllExternalWidgets(): IExternalWidgetRegistration[] {
|
|
104
|
+
return externalWidgets;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Deep clones a widget to avoid modifying the original registered widget
|
|
109
|
+
* For now, this is a structured clone, but we can make it more robust if needed
|
|
110
|
+
*/
|
|
111
|
+
export function cloneWidget<T extends IWidget | IExternalWidgetRegistration>(widget: T): T {
|
|
112
|
+
// Using structuredClone for a deep copy
|
|
113
|
+
return cloneDeep(widget);
|
|
114
|
+
}
|
|
115
|
+
|
|
97
116
|
export function createWidgetService(): IWidgetService {
|
|
98
117
|
const widgetRegistry = reactive<Record<string, IWidget[]>>({});
|
|
99
118
|
const registeredWidgets = reactive<IWidgetRegistration[]>([]);
|
|
@@ -109,8 +128,10 @@ export function createWidgetService(): IWidgetService {
|
|
|
109
128
|
|
|
110
129
|
const existingIndex = widgetRegistry[normalizedBladeId].findIndex((w) => w.id === widget.id);
|
|
111
130
|
if (existingIndex === -1) {
|
|
112
|
-
|
|
113
|
-
|
|
131
|
+
const rawWidget: IWidget = markRaw(widget);
|
|
132
|
+
|
|
133
|
+
widgetRegistry[normalizedBladeId].push(rawWidget);
|
|
134
|
+
registeredWidgets.push({ bladeId: normalizedBladeId, widget: rawWidget });
|
|
114
135
|
registeredIds.add(widget.id);
|
|
115
136
|
}
|
|
116
137
|
};
|
|
@@ -289,5 +310,7 @@ export function createWidgetService(): IWidgetService {
|
|
|
289
310
|
updateWidget,
|
|
290
311
|
resolveWidgetProps,
|
|
291
312
|
getExternalWidgetsForBlade: getExternalWidgetsForBladeLocal,
|
|
313
|
+
getAllExternalWidgets,
|
|
314
|
+
cloneWidget,
|
|
292
315
|
};
|
|
293
316
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, ComponentInternalInstance, ComputedRef, Ref } from "vue";
|
|
1
|
+
import { Component, ComponentInternalInstance, ComputedRef, Ref, Raw } from "vue";
|
|
2
2
|
import { IBladeInstance } from "../../shared/components/blade-navigation/types";
|
|
3
3
|
export type WidgetEventHandler = (...args: unknown[]) => void;
|
|
4
4
|
export interface IWidgetEvents {
|
|
@@ -26,7 +26,7 @@ export interface IWidget {
|
|
|
26
26
|
}
|
|
27
27
|
export interface IWidgetRegistration {
|
|
28
28
|
bladeId: string;
|
|
29
|
-
widget: IWidget
|
|
29
|
+
widget: Raw<IWidget>;
|
|
30
30
|
}
|
|
31
31
|
export interface IExternalWidgetRegistration {
|
|
32
32
|
id: string;
|
|
@@ -57,6 +57,8 @@ export interface IWidgetService {
|
|
|
57
57
|
}) => void;
|
|
58
58
|
resolveWidgetProps: (widget: IWidget, bladeData: Record<string, unknown>) => Record<string, unknown>;
|
|
59
59
|
getExternalWidgetsForBlade: (bladeId: string) => IExternalWidgetRegistration[];
|
|
60
|
+
getAllExternalWidgets: () => IExternalWidgetRegistration[];
|
|
61
|
+
cloneWidget: <T extends IWidget | IExternalWidgetRegistration>(widget: T) => T;
|
|
60
62
|
}
|
|
61
63
|
/**
|
|
62
64
|
* Registers a widget before the service is initialized
|
|
@@ -70,5 +72,14 @@ export declare function registerExternalWidget(widget: IExternalWidgetRegistrati
|
|
|
70
72
|
* Gets list of external widgets for a specific blade type
|
|
71
73
|
*/
|
|
72
74
|
export declare function getExternalWidgetsForBlade(bladeId: string): IExternalWidgetRegistration[];
|
|
75
|
+
/**
|
|
76
|
+
* Gets all external widgets
|
|
77
|
+
*/
|
|
78
|
+
export declare function getAllExternalWidgets(): IExternalWidgetRegistration[];
|
|
79
|
+
/**
|
|
80
|
+
* Deep clones a widget to avoid modifying the original registered widget
|
|
81
|
+
* For now, this is a structured clone, but we can make it more robust if needed
|
|
82
|
+
*/
|
|
83
|
+
export declare function cloneWidget<T extends IWidget | IExternalWidgetRegistration>(widget: T): T;
|
|
73
84
|
export declare function createWidgetService(): IWidgetService;
|
|
74
85
|
//# sourceMappingURL=widget-service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widget-service.d.ts","sourceRoot":"","sources":["../../../core/services/widget-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAiB,yBAAyB,EAAE,WAAW,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"widget-service.d.ts","sourceRoot":"","sources":["../../../core/services/widget-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAiB,yBAAyB,EAAE,WAAW,EAAE,GAAG,EAAW,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1G,OAAO,EAAE,cAAc,EAAE,MAAM,gDAAgD,CAAC;AAGhF,MAAM,MAAM,kBAAkB,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;AAE9D,M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