@vc-shell/vc-app-skill 2.0.0-pr221.637b802 → 2.0.1
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 +10 -0
- package/package.json +1 -1
- package/runtime/VERSION +1 -1
- package/runtime/knowledge/docs/_BUILD_HASH.md +1 -1
- package/runtime/knowledge/docs/core/composables/usePlatformLocaleSync/usePlatformLocaleSync.docs.md +28 -0
- package/runtime/knowledge/docs/core/notifications/notifications.docs.md +38 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.0.1](https://github.com/VirtoCommerce/vc-shell/compare/v2.0.0...v2.0.1) (2026-04-24)
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- enhance migrate transforms, fix notification race condition, update migration docs (#221) ([3c2134d](https://github.com/VirtoCommerce/vc-shell/commit/3c2134d0fa1016a2e4e075a12bb9df9a31b3d381)), closes [#221](https://github.com/VirtoCommerce/vc-shell/issues/221)
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
- **hooks:** update npm version retrieval in vc-app-check-update.js ([c8f0e68](https://github.com/VirtoCommerce/vc-shell/commit/c8f0e68ded994bdfb8d01dcf96e90184b9d278cd))
|
|
12
|
+
|
|
3
13
|
# [2.0.0](https://github.com/VirtoCommerce/vc-shell/compare/v1.2.3...v2.0.0) (2026-04-22)
|
|
4
14
|
|
|
5
15
|
### Features
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vc-shell/vc-app-skill",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "AI coding skill for scaffolding and generating VirtoCommerce Shell applications. Works with Claude Code, OpenCode, Gemini, Codex, Cursor.",
|
|
5
5
|
"bin": "./bin/install.cjs",
|
|
6
6
|
"files": [
|
package/runtime/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.0.
|
|
1
|
+
2.0.1
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Synced from framework at commit
|
|
1
|
+
Synced from framework at commit 5f8005c08 on 2026-04-24T08:05:31.316Z
|
package/runtime/knowledge/docs/core/composables/usePlatformLocaleSync/usePlatformLocaleSync.docs.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# usePlatformLocaleSync
|
|
2
|
+
|
|
3
|
+
One-way reactive bridge from the VirtoCommerce platform's locale storage key (`NG_TRANSLATE_LANG_KEY`, set by AngularJS + angular-translate) to the shell's language service.
|
|
4
|
+
|
|
5
|
+
Call this composable only when the shell runs embedded inside the platform — `useShellBootstrap` invokes it automatically when `options.isEmbedded === true`. In standalone mode the shell owns its own locale via `VC_LANGUAGE_SETTINGS`, and this composable should not be used.
|
|
6
|
+
|
|
7
|
+
## When to Use
|
|
8
|
+
|
|
9
|
+
- Never call directly from feature code. This is a framework-internal sync primitive.
|
|
10
|
+
- It is invoked once per `VcApp` mount from `useShellBootstrap`.
|
|
11
|
+
|
|
12
|
+
## Behaviour
|
|
13
|
+
|
|
14
|
+
- Reads `localStorage["NG_TRANSLATE_LANG_KEY"]` via VueUse's `useLocalStorage`, which subscribes to `storage` events for cross-tab reactivity.
|
|
15
|
+
- On setup, if the value is non-empty, calls `LanguageService.setLocale(value)`. `setLocale` normalises the value (e.g. `en-US` → `en-us`), falls back to `en` for unsupported locales, updates `vue-i18n`, reconfigures `vee-validate`, and persists to `VC_LANGUAGE_SETTINGS`.
|
|
16
|
+
- On subsequent changes of the platform key, re-applies the value.
|
|
17
|
+
- Skips empty strings (platform clearing the key does not blank the shell locale).
|
|
18
|
+
- Skips values equal to `currentLocale` to avoid redundant re-configuration.
|
|
19
|
+
|
|
20
|
+
## How It Works
|
|
21
|
+
|
|
22
|
+
`useLocalStorage("NG_TRANSLATE_LANG_KEY", "")` returns a `Ref<string>` that VueUse keeps in sync with `localStorage` and the DOM `storage` event (which fires in tabs other than the writer). The composable applies the current ref value once synchronously and then registers a `watch` on it; any cross-tab mutation flows through the ref into `setLocale`.
|
|
23
|
+
|
|
24
|
+
The watcher is bound to the active effect scope (typically `VcApp`'s setup). When `VcApp` unmounts, the watcher stops; `useLocalStorage` cleans up its own `storage` listener.
|
|
25
|
+
|
|
26
|
+
## Relationship to `VC_LANGUAGE_SETTINGS`
|
|
27
|
+
|
|
28
|
+
The sync is strictly one-directional. `setLocale` writes to `VC_LANGUAGE_SETTINGS` as a side effect, but this composable never writes to `NG_TRANSLATE_LANG_KEY`. In embedded mode the in-shell `LanguageSelector` is unreachable (it lives inside `UserDropdownButton`, which is hidden when `isEmbedded` is `true`), so there is no competing writer from the shell side.
|
|
@@ -17,7 +17,12 @@ The notification system receives `PushNotification` messages from the platform S
|
|
|
17
17
|
```
|
|
18
18
|
PushNotification (SignalR)
|
|
19
19
|
|
|
|
20
|
-
|
|
20
|
+
┌─────┴─────┐
|
|
21
|
+
Send SendSystemEvents
|
|
22
|
+
| |
|
|
23
|
+
| broadcastFilter?
|
|
24
|
+
| |
|
|
25
|
+
v v
|
|
21
26
|
NotificationStore.ingest()
|
|
22
27
|
|
|
|
23
28
|
+---> history[] (persistent, loaded from API)
|
|
@@ -47,7 +52,9 @@ Returns the shared `NotificationStore` singleton. Resolution order:
|
|
|
47
52
|
| `unreadCount` | `ComputedRef<number>` | Count of unread notifications in history |
|
|
48
53
|
| `hasUnread` | `ComputedRef<boolean>` | Whether any unread notifications exist |
|
|
49
54
|
| `registerType(type, config)` | `(string, NotificationTypeConfig) => void` | Register a notification type with toast/template config |
|
|
50
|
-
| `ingest(message)`
|
|
55
|
+
| `ingest(message, opts?)` | `(PushNotification, {broadcast?}?) => void` | Process an incoming notification; broadcast messages are filtered |
|
|
56
|
+
| `setBroadcastFilter(fn)` | `((PushNotification) => boolean) => void` | Set filter for broadcast messages (SendSystemEvents) |
|
|
57
|
+
| `clearBroadcastFilter()` | `() => void` | Remove the broadcast filter |
|
|
51
58
|
| `markAsRead(message)` | `(PushNotification) => void` | Mark a single notification as read |
|
|
52
59
|
| `markAllAsRead()` | `() => Promise<void>` | Optimistic mark-all-as-read with server sync and rollback on failure |
|
|
53
60
|
| `loadHistory(take?)` | `(number?) => Promise<void>` | Load notification history from the API (default: 10) |
|
|
@@ -105,6 +112,35 @@ const notificationRef = useNotificationContext<IOrderNotification>();
|
|
|
105
112
|
// notificationRef.value.orderId, notificationRef.value.title, etc.
|
|
106
113
|
```
|
|
107
114
|
|
|
115
|
+
### `useBroadcastFilter()`
|
|
116
|
+
|
|
117
|
+
Controls which broadcast push notifications (`SendSystemEvents`) are accepted by the store. Targeted notifications (`Send`) are always accepted regardless of filter.
|
|
118
|
+
|
|
119
|
+
**File:** `composables/useBroadcastFilter.ts`
|
|
120
|
+
|
|
121
|
+
#### Returns
|
|
122
|
+
|
|
123
|
+
```typescript
|
|
124
|
+
interface UseBroadcastFilterReturn {
|
|
125
|
+
setBroadcastFilter(fn: (msg: PushNotification) => boolean): void;
|
|
126
|
+
clearBroadcastFilter(): void;
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
#### Example
|
|
131
|
+
|
|
132
|
+
```typescript
|
|
133
|
+
import { useBroadcastFilter } from "@vc-shell/framework";
|
|
134
|
+
|
|
135
|
+
const { setBroadcastFilter, clearBroadcastFilter } = useBroadcastFilter();
|
|
136
|
+
|
|
137
|
+
// Accept only notifications for the current seller
|
|
138
|
+
setBroadcastFilter((msg) => msg.creator === currentSellerId);
|
|
139
|
+
|
|
140
|
+
// Remove filter (accept all broadcast messages)
|
|
141
|
+
clearBroadcastFilter();
|
|
142
|
+
```
|
|
143
|
+
|
|
108
144
|
### Toast Controller
|
|
109
145
|
|
|
110
146
|
Handles toast popup display based on `NotificationTypeConfig.toast` settings. Created internally by the store.
|