@vc-shell/framework 1.0.244 → 1.0.246

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 (43) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/core/composables/index.ts +1 -0
  3. package/core/composables/useAppInsights/index.ts +42 -0
  4. package/core/composables/useErrorHandler/index.ts +9 -7
  5. package/core/plugins/signalR/index.ts +8 -5
  6. package/dist/core/composables/index.d.ts +1 -0
  7. package/dist/core/composables/index.d.ts.map +1 -1
  8. package/dist/core/composables/useAppInsights/index.d.ts +12 -0
  9. package/dist/core/composables/useAppInsights/index.d.ts.map +1 -0
  10. package/dist/core/composables/useErrorHandler/index.d.ts.map +1 -1
  11. package/dist/core/plugins/signalR/index.d.ts.map +1 -1
  12. package/dist/framework.js +21818 -20975
  13. package/dist/index.css +1 -1
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/shared/components/blade-navigation/composables/useBladeNavigation/index.d.ts.map +1 -1
  16. package/dist/shared/modules/dynamic/factories/types/index.d.ts +2 -0
  17. package/dist/shared/modules/dynamic/factories/types/index.d.ts.map +1 -1
  18. package/dist/shared/modules/dynamic/helpers/nodeBuilder.d.ts.map +1 -1
  19. package/dist/shared/modules/dynamic/pages/dynamic-blade-form.vue.d.ts +2 -0
  20. package/dist/shared/modules/dynamic/pages/dynamic-blade-form.vue.d.ts.map +1 -1
  21. package/dist/tsconfig.tsbuildinfo +1 -1
  22. package/dist/ui/components/molecules/vc-editor/vc-editor.stories.d.ts +397 -3
  23. package/dist/ui/components/molecules/vc-editor/vc-editor.stories.d.ts.map +1 -1
  24. package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/_internal/vc-app-menu-link.vue.d.ts.map +1 -1
  25. package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/vc-app-menu.vue.d.ts.map +1 -1
  26. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-button/vc-blade-toolbar-button.vue.d.ts +1 -0
  27. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-button/vc-blade-toolbar-button.vue.d.ts.map +1 -1
  28. package/dist/ui/components/organisms/vc-table/vc-table.vue.d.ts.map +1 -1
  29. package/package.json +5 -4
  30. package/shared/components/blade-navigation/composables/useBladeNavigation/index.ts +17 -21
  31. package/shared/modules/dynamic/factories/types/index.ts +2 -0
  32. package/shared/modules/dynamic/helpers/nodeBuilder.ts +1 -0
  33. package/shared/modules/dynamic/pages/dynamic-blade-form.vue +7 -1
  34. package/ui/components/molecules/vc-editor/vc-editor.stories.ts +1 -0
  35. package/ui/components/molecules/vc-editor/vc-editor.vue +4 -0
  36. package/ui/components/molecules/vc-select/vc-select.vue +3 -0
  37. package/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/_internal/vc-app-menu-link.vue +17 -14
  38. package/ui/components/organisms/vc-app/_internal/vc-app-menu/vc-app-menu.vue +14 -10
  39. package/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-button/vc-blade-toolbar-button.vue +3 -0
  40. package/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/vc-blade-toolbar.vue +1 -0
  41. package/ui/components/organisms/vc-table/vc-table.vue +10 -4
  42. package/dist/ui/components/molecules/vc-editor/vc-editor.vue.d.ts +0 -42
  43. package/dist/ui/components/molecules/vc-editor/vc-editor.vue.d.ts.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,21 @@
1
+ ## [1.0.246](https://github.com/VirtoCommerce/vc-shell/compare/v1.0.245...v1.0.246) (2024-06-28)
2
+
3
+
4
+ ### Features
5
+
6
+ * add useAppInsights composable for application insights pageview logging ([7c030d6](https://github.com/VirtoCommerce/vc-shell/commit/7c030d6947529a93f0476adc9d59b94336c3580b))
7
+
8
+
9
+
10
+ ## [1.0.245](https://github.com/VirtoCommerce/vc-shell/compare/v1.0.244...v1.0.245) (2024-06-28)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * **ui:** fix vc-table cell hover behavior and cell opacity ([8548032](https://github.com/VirtoCommerce/vc-shell/commit/85480323eadc982344684be5c57e1f900659eb80))
16
+
17
+
18
+
1
19
  ## [1.0.244](https://github.com/VirtoCommerce/vc-shell/compare/v1.0.243...v1.0.244) (2024-06-24)
2
20
 
3
21
 
@@ -12,3 +12,4 @@ export { useMenuService } from "./useMenuService";
12
12
  export { useBeforeUnload } from "./useBeforeUnload";
13
13
  export { useLanguages } from "./useLanguages";
14
14
  export { useBreadcrumbs } from "./useBreadcrumbs";
15
+ export { useAppInsights } from "./useAppInsights";
@@ -0,0 +1,42 @@
1
+ import { inject } from "vue";
2
+ import { AppInsightsPluginOptions, useAppInsights as useInsights } from "vue3-application-insights";
3
+ import { generateW3CId } from "@microsoft/applicationinsights-core-js";
4
+ import { useUser } from "..";
5
+
6
+ export const useAppInsights = () => {
7
+ const appInsights = useInsights();
8
+ const { user } = useUser();
9
+ const appInsightsOptions = inject<AppInsightsPluginOptions>("appInsightsOptions");
10
+
11
+ function setupPageTracking() {
12
+ const appName = appInsightsOptions?.appName ? `[${appInsightsOptions.appName}] ` : "";
13
+
14
+ const pageName = (route: { name: string }) => `${appName}${route.name as string}`;
15
+
16
+ function beforeEach(route: { name: string }) {
17
+ const name = pageName(route);
18
+ appInsights.context.telemetryTrace.traceID = generateW3CId();
19
+ appInsights.context.telemetryTrace.name = route.name as string;
20
+
21
+ appInsights.startTrackPage(name);
22
+ }
23
+
24
+ function afterEach(route: { name: string; fullPath: string }) {
25
+ const name = pageName(route);
26
+ const url = location.protocol + "//" + location.host + route.fullPath;
27
+ appInsights.stopTrackPage(name, url, {
28
+ userId: user.value?.id ?? "",
29
+ userName: user.value?.userName ?? "",
30
+ });
31
+ }
32
+
33
+ return {
34
+ beforeEach,
35
+ afterEach,
36
+ };
37
+ }
38
+
39
+ return {
40
+ setupPageTracking: setupPageTracking(),
41
+ };
42
+ };
@@ -30,13 +30,15 @@ export function useErrorHandler(capture?: boolean): IUseErrorHandler {
30
30
  error.value = err.toString();
31
31
  }
32
32
 
33
- appInsights.trackException({
34
- exception: err,
35
- properties: {
36
- userId: user.value?.id ?? "",
37
- userName: user.value?.userName ?? "",
38
- },
39
- });
33
+ if (appInsights) {
34
+ appInsights.trackException({
35
+ exception: err,
36
+ properties: {
37
+ userId: user.value?.id ?? "",
38
+ userName: user.value?.userName ?? "",
39
+ },
40
+ });
41
+ }
40
42
 
41
43
  console.error(err);
42
44
  }
@@ -3,6 +3,7 @@ import { HubConnectionBuilder, LogLevel } from "@microsoft/signalr";
3
3
  import { PushNotification } from "../../api/platform";
4
4
  import { useNotifications } from "./../../composables/useNotifications";
5
5
  import { useUser } from "../../composables/useUser";
6
+ import { useCypressSignalRMock } from "cypress-signalr-mock";
6
7
 
7
8
  const { addNotification } = useNotifications();
8
9
 
@@ -15,11 +16,13 @@ export const signalR = {
15
16
  ) {
16
17
  const { isAuthenticated } = useUser();
17
18
  let reconnect = false;
18
- const connection = new HubConnectionBuilder()
19
- .withUrl("/pushNotificationHub")
20
- .withAutomaticReconnect()
21
- .configureLogging(LogLevel.Information)
22
- .build();
19
+ const connection =
20
+ useCypressSignalRMock("pushNotificationHub", { enableForVitest: true }) ??
21
+ new HubConnectionBuilder()
22
+ .withUrl("/pushNotificationHub")
23
+ .withAutomaticReconnect()
24
+ .configureLogging(LogLevel.Information)
25
+ .build();
23
26
 
24
27
  const start = () => {
25
28
  connection
@@ -12,4 +12,5 @@ export { useMenuService } from "./useMenuService";
12
12
  export { useBeforeUnload } from "./useBeforeUnload";
13
13
  export { useLanguages } from "./useLanguages";
14
14
  export { useBreadcrumbs } from "./useBreadcrumbs";
15
+ export { useAppInsights } from "./useAppInsights";
15
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../core/composables/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../core/composables/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,12 @@
1
+ export declare const useAppInsights: () => {
2
+ setupPageTracking: {
3
+ beforeEach: (route: {
4
+ name: string;
5
+ }) => void;
6
+ afterEach: (route: {
7
+ name: string;
8
+ fullPath: string;
9
+ }) => void;
10
+ };
11
+ };
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../core/composables/useAppInsights/index.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,cAAc;;4BAUI;YAAE,MAAM,MAAM,CAAA;SAAE;2BAQjB;YAAE,MAAM,MAAM,CAAC;YAAC,QAAQ,EAAE,MAAM,CAAA;SAAE;;CAkB/D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../core/composables/useErrorHandler/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4C,GAAG,EAAE,MAAM,KAAK,CAAC;AAIpE,UAAU,gBAAgB;IACxB,KAAK,EAAE,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC1B,KAAK,IAAI,IAAI,CAAC;CACf;AAED,wBAAgB,eAAe,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,gBAAgB,CA+CnE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../core/composables/useErrorHandler/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4C,GAAG,EAAE,MAAM,KAAK,CAAC;AAIpE,UAAU,gBAAgB;IACxB,KAAK,EAAE,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC1B,KAAK,IAAI,IAAI,CAAC;CACf;AAED,wBAAgB,eAAe,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,gBAAgB,CAiDnE"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../core/plugins/signalR/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAS,MAAM,KAAK,CAAC;AAQjC,eAAO,MAAM,OAAO;iBAEX,GAAG,YACE;QACR,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB;CAwDJ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../core/plugins/signalR/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAS,MAAM,KAAK,CAAC;AASjC,eAAO,MAAM,OAAO;iBAEX,GAAG,YACE;QACR,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB;CA0DJ,CAAC"}