@vc-shell/vc-app-skill 2.0.0-alpha.32 → 2.0.0-alpha.33-pr220.455e322
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 +59 -47
- package/README.md +18 -12
- package/package.json +4 -4
- package/runtime/VERSION +1 -1
- package/runtime/agents/api-analyzer.md +31 -16
- package/runtime/agents/blade-enhancer.md +15 -9
- package/runtime/agents/details-blade-generator.md +47 -31
- package/runtime/agents/list-blade-generator.md +21 -37
- package/runtime/agents/locales-generator.md +3 -0
- package/runtime/agents/migration-agent.md +94 -0
- package/runtime/agents/module-analyzer.md +2 -0
- package/runtime/agents/module-assembler.md +15 -0
- package/runtime/agents/promote-agent.md +15 -4
- package/runtime/agents/type-checker.md +11 -0
- package/runtime/knowledge/docs/_BUILD_HASH.md +1 -1
- package/runtime/knowledge/docs/core/api/platform.docs.md +30 -30
- package/runtime/knowledge/docs/core/blade-navigation/blade-nav-composables.docs.md +41 -41
- package/runtime/knowledge/docs/core/composables/bladeContext/index.docs.md +12 -10
- package/runtime/knowledge/docs/core/composables/useApiClient/useApiClient.docs.md +11 -14
- package/runtime/knowledge/docs/core/composables/useAppBarMobileButtons/useAppBarMobileButtons.docs.md +35 -35
- package/runtime/knowledge/docs/core/composables/useAppBarWidget/useAppBarWidget.docs.md +35 -35
- package/runtime/knowledge/docs/core/composables/useAppInsights/useAppInsights.docs.md +15 -15
- package/runtime/knowledge/docs/core/composables/useAssets/useAssets.docs.md +21 -18
- package/runtime/knowledge/docs/core/composables/useAssetsManager/useAssetsManager.docs.md +31 -27
- package/runtime/knowledge/docs/core/composables/useAsync/useAsync.docs.md +90 -61
- package/runtime/knowledge/docs/core/composables/useBeforeUnload/useBeforeUnload.docs.md +19 -18
- package/runtime/knowledge/docs/core/composables/useBlade/useBlade.docs.md +89 -68
- package/runtime/knowledge/docs/core/composables/useBladeForm/useBladeForm.docs.md +75 -19
- package/runtime/knowledge/docs/core/composables/useBladeRegistry/useBladeRegistry.docs.md +15 -15
- package/runtime/knowledge/docs/core/composables/useBladeWidgets/index.docs.md +74 -78
- package/runtime/knowledge/docs/core/composables/useBreadcrumbs/useBreadcrumbs.docs.md +11 -11
- package/runtime/knowledge/docs/core/composables/useConnectionStatus/useConnectionStatus.docs.md +27 -15
- package/runtime/knowledge/docs/core/composables/useDashboard/useDashboard.docs.md +30 -30
- package/runtime/knowledge/docs/core/composables/useDynamicProperties/useDynamicProperties.docs.md +34 -36
- package/runtime/knowledge/docs/core/composables/useErrorHandler/useErrorHandler.docs.md +44 -23
- package/runtime/knowledge/docs/core/composables/useFunctions/useFunctions.docs.md +14 -11
- package/runtime/knowledge/docs/core/composables/useKeyboardNavigation/useKeyboardNavigation.docs.md +47 -38
- package/runtime/knowledge/docs/core/composables/useLanguages/useLanguages.docs.md +37 -28
- package/runtime/knowledge/docs/core/composables/useLoading/useLoading.docs.md +23 -17
- package/runtime/knowledge/docs/core/composables/useMenuExpanded/index.docs.md +10 -10
- package/runtime/knowledge/docs/core/composables/useMenuService/useMenuService.docs.md +42 -42
- package/runtime/knowledge/docs/core/composables/useModificationTracker/useModificationTracker.docs.md +22 -12
- package/runtime/knowledge/docs/core/composables/useNotifications/useNotifications.docs.md +33 -41
- package/runtime/knowledge/docs/core/composables/usePermissions/usePermissions.docs.md +16 -16
- package/runtime/knowledge/docs/core/composables/usePopup/usePopup.docs.md +32 -24
- package/runtime/knowledge/docs/core/composables/useResponsive/useResponsive.docs.md +32 -11
- package/runtime/knowledge/docs/core/composables/useSettings/useSettings.docs.md +24 -15
- package/runtime/knowledge/docs/core/composables/useSettingsMenu/useSettingsMenu.docs.md +7 -7
- package/runtime/knowledge/docs/core/composables/useSidebarState/useSidebarState.docs.md +32 -24
- package/runtime/knowledge/docs/core/composables/useSlowNetworkDetection/useSlowNetworkDetection.docs.md +21 -17
- package/runtime/knowledge/docs/core/composables/useTheme/useTheme.docs.md +24 -24
- package/runtime/knowledge/docs/core/composables/useToolbar/useToolbar.docs.md +28 -31
- package/runtime/knowledge/docs/core/composables/useUser/useUser.docs.md +43 -24
- package/runtime/knowledge/docs/core/composables/useUserManagement/useUserManagement.docs.md +68 -48
- package/runtime/knowledge/docs/core/composables/useWebVitals/useWebVitals.docs.md +19 -19
- package/runtime/knowledge/docs/core/composables/useWidgets/useWidgets.docs.md +42 -47
- package/runtime/knowledge/docs/core/directives/autofocus/autofocus.docs.md +10 -4
- package/runtime/knowledge/docs/core/directives/loading/loading.docs.md +35 -20
- package/runtime/knowledge/docs/core/notifications/notifications.docs.md +36 -35
- package/runtime/knowledge/docs/core/plugins/ai-agent/ai-agent.docs.md +38 -38
- package/runtime/knowledge/docs/core/plugins/extension-points/extension-points.docs.md +107 -91
- package/runtime/knowledge/docs/core/plugins/global-error-handler/global-error-handler.docs.md +10 -10
- package/runtime/knowledge/docs/core/plugins/i18n/i18n.docs.md +21 -23
- package/runtime/knowledge/docs/core/plugins/modularity/modularity.docs.md +98 -90
- package/runtime/knowledge/docs/core/plugins/permissions/permissions.docs.md +10 -16
- package/runtime/knowledge/docs/core/plugins/signalR/signalR.docs.md +9 -9
- package/runtime/knowledge/docs/core/plugins/validation/validation.docs.md +65 -22
- package/runtime/knowledge/docs/core/services/services.docs.md +19 -22
- package/runtime/knowledge/docs/core/types/types.docs.md +40 -40
- package/runtime/knowledge/docs/core/utilities/date/date-utilities.docs.md +27 -27
- package/runtime/knowledge/docs/core/utilities/shared-utilities.docs.md +23 -23
- package/runtime/knowledge/docs/core/utilities/thumbnail/thumbnail.docs.md +22 -25
- package/runtime/knowledge/docs/core/utilities/utilities.docs.md +64 -64
- package/runtime/knowledge/docs/injection-keys.docs.md +52 -51
- package/runtime/knowledge/docs/modules/assets-manager/assets-manager.docs.md +9 -9
- package/runtime/knowledge/docs/shell/_internal/popup/common/popup-common.docs.md +23 -43
- package/runtime/knowledge/docs/shell/auth/ChangePasswordPage/change-password-page.docs.md +102 -0
- package/runtime/knowledge/docs/shell/auth/ForgotPasswordPage/forgot-password-page.docs.md +5 -5
- package/runtime/knowledge/docs/shell/auth/InvitePage/invite-page.docs.md +8 -7
- package/runtime/knowledge/docs/shell/auth/LoginPage/login-page.docs.md +7 -7
- package/runtime/knowledge/docs/shell/auth/ResetPasswordPage/reset-password-page.docs.md +8 -7
- package/runtime/knowledge/docs/shell/auth/sign-in/sign-in.docs.md +29 -13
- package/runtime/knowledge/docs/shell/components/change-password/change-password.docs.md +13 -16
- package/runtime/knowledge/docs/shell/components/change-password-button/change-password-button.docs.md +1 -7
- package/runtime/knowledge/docs/shell/components/error-interceptor/error-interceptor.docs.md +5 -5
- package/runtime/knowledge/docs/shell/components/language-selector/language-selector.docs.md +1 -1
- package/runtime/knowledge/docs/shell/components/logout-button/logout-button.docs.md +1 -1
- package/runtime/knowledge/docs/shell/components/notification-template/notification-template.docs.md +17 -9
- package/runtime/knowledge/docs/shell/components/settings-menu/settings-menu.docs.md +12 -18
- package/runtime/knowledge/docs/shell/components/settings-menu-item/settings-menu-item.docs.md +34 -65
- package/runtime/knowledge/docs/shell/components/sidebar/sidebar.docs.md +16 -26
- package/runtime/knowledge/docs/shell/components/theme-selector/theme-selector.docs.md +2 -2
- package/runtime/knowledge/docs/shell/components/user-dropdown-button/user-dropdown-button.docs.md +7 -9
- package/runtime/knowledge/docs/shell/dashboard/dashboard-charts/dashboard-charts.docs.md +30 -40
- package/runtime/knowledge/docs/shell/dashboard/dashboard-widget-card/dashboard-widget-card.docs.md +26 -19
- package/runtime/knowledge/docs/shell/dashboard/draggable-dashboard/draggable-dashboard.docs.md +15 -12
- package/runtime/knowledge/docs/ui/components/atoms/vc-badge/vc-badge.docs.md +15 -26
- package/runtime/knowledge/docs/ui/components/atoms/vc-banner/vc-banner.docs.md +21 -19
- package/runtime/knowledge/docs/ui/components/atoms/vc-button/vc-button.docs.md +83 -67
- package/runtime/knowledge/docs/ui/components/atoms/vc-card/vc-card.docs.md +104 -59
- package/runtime/knowledge/docs/ui/components/atoms/vc-col/vc-col.docs.md +28 -11
- package/runtime/knowledge/docs/ui/components/atoms/vc-container/vc-container.docs.md +20 -17
- package/runtime/knowledge/docs/ui/components/atoms/vc-hint/vc-hint.docs.md +26 -17
- package/runtime/knowledge/docs/ui/components/atoms/vc-icon/vc-icon.docs.md +30 -32
- package/runtime/knowledge/docs/ui/components/atoms/vc-image/vc-image.docs.md +25 -48
- package/runtime/knowledge/docs/ui/components/atoms/vc-label/vc-label.docs.md +29 -24
- package/runtime/knowledge/docs/ui/components/atoms/vc-link/vc-link.docs.md +23 -15
- package/runtime/knowledge/docs/ui/components/atoms/vc-loading/vc-loading.docs.md +22 -13
- package/runtime/knowledge/docs/ui/components/atoms/vc-progress/vc-progress.docs.md +33 -18
- package/runtime/knowledge/docs/ui/components/atoms/vc-row/vc-row.docs.md +56 -15
- package/runtime/knowledge/docs/ui/components/atoms/vc-scrollable-container/vc-scrollable-container.docs.md +28 -15
- package/runtime/knowledge/docs/ui/components/atoms/vc-skeleton/vc-skeleton.docs.md +40 -20
- package/runtime/knowledge/docs/ui/components/atoms/vc-status/vc-status.docs.md +25 -14
- package/runtime/knowledge/docs/ui/components/atoms/vc-status-icon/vc-status-icon.docs.md +40 -14
- package/runtime/knowledge/docs/ui/components/atoms/vc-tooltip/vc-tooltip.docs.md +54 -42
- package/runtime/knowledge/docs/ui/components/atoms/vc-video/vc-video.docs.md +17 -17
- package/runtime/knowledge/docs/ui/components/atoms/vc-widget/vc-widget.docs.md +21 -21
- package/runtime/knowledge/docs/ui/components/molecules/multilanguage-selector/multilanguage-selector.docs.md +23 -10
- package/runtime/knowledge/docs/ui/components/molecules/vc-accordion/vc-accordion.docs.md +59 -44
- package/runtime/knowledge/docs/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.docs.md +23 -20
- package/runtime/knowledge/docs/ui/components/molecules/vc-checkbox/vc-checkbox.docs.md +96 -64
- package/runtime/knowledge/docs/ui/components/molecules/vc-checkbox-group/vc-checkbox-group.docs.md +26 -35
- package/runtime/knowledge/docs/ui/components/molecules/vc-color-input/vc-color-input.docs.md +69 -22
- package/runtime/knowledge/docs/ui/components/molecules/vc-date-picker/vc-date-picker.docs.md +58 -72
- package/runtime/knowledge/docs/ui/components/molecules/vc-dropdown/vc-dropdown.docs.md +91 -85
- package/runtime/knowledge/docs/ui/components/molecules/vc-dropdown-panel/vc-dropdown-panel.docs.md +38 -42
- package/runtime/knowledge/docs/ui/components/molecules/vc-editor/vc-editor.docs.md +60 -72
- package/runtime/knowledge/docs/ui/components/molecules/vc-field/vc-field.docs.md +65 -26
- package/runtime/knowledge/docs/ui/components/molecules/vc-file-upload/vc-file-upload.docs.md +46 -49
- package/runtime/knowledge/docs/ui/components/molecules/vc-form/vc-form.docs.md +35 -64
- package/runtime/knowledge/docs/ui/components/molecules/vc-image-tile/vc-image-tile.docs.md +38 -41
- package/runtime/knowledge/docs/ui/components/molecules/vc-input/vc-input.docs.md +115 -130
- package/runtime/knowledge/docs/ui/components/molecules/vc-input-currency/vc-input-currency.docs.md +53 -87
- package/runtime/knowledge/docs/ui/components/molecules/vc-input-dropdown/vc-input-dropdown.docs.md +56 -63
- package/runtime/knowledge/docs/ui/components/molecules/vc-input-group/vc-input-group.docs.md +29 -24
- package/runtime/knowledge/docs/ui/components/molecules/vc-menu/vc-menu.docs.md +32 -28
- package/runtime/knowledge/docs/ui/components/molecules/vc-multivalue/vc-multivalue.docs.md +63 -64
- package/runtime/knowledge/docs/ui/components/molecules/vc-pagination/vc-pagination.docs.md +28 -26
- package/runtime/knowledge/docs/ui/components/molecules/vc-radio-button/vc-radio-button.docs.md +59 -19
- package/runtime/knowledge/docs/ui/components/molecules/vc-radio-group/vc-radio-group.docs.md +25 -34
- package/runtime/knowledge/docs/ui/components/molecules/vc-rating/vc-rating.docs.md +42 -32
- package/runtime/knowledge/docs/ui/components/molecules/vc-select/vc-select.docs.md +78 -82
- package/runtime/knowledge/docs/ui/components/molecules/vc-slider/vc-slider.docs.md +25 -15
- package/runtime/knowledge/docs/ui/components/molecules/vc-switch/vc-switch.docs.md +59 -63
- package/runtime/knowledge/docs/ui/components/molecules/vc-textarea/vc-textarea.docs.md +57 -69
- package/runtime/knowledge/docs/ui/components/molecules/vc-toast/vc-toast.docs.md +58 -57
- package/runtime/knowledge/docs/ui/components/organisms/vc-app/vc-app.docs.md +49 -26
- package/runtime/knowledge/docs/ui/components/organisms/vc-auth-layout/vc-auth-layout.docs.md +82 -28
- package/runtime/knowledge/docs/ui/components/organisms/vc-blade/vc-blade.docs.md +120 -75
- package/runtime/knowledge/docs/ui/components/organisms/vc-data-table/composables/table-composables.docs.md +30 -44
- package/runtime/knowledge/docs/ui/components/organisms/vc-data-table/vc-data-table.docs.md +536 -365
- package/runtime/knowledge/docs/ui/components/organisms/vc-dynamic-property/vc-dynamic-property.docs.md +35 -52
- package/runtime/knowledge/docs/ui/components/organisms/vc-gallery/vc-gallery.docs.md +33 -62
- package/runtime/knowledge/docs/ui/components/organisms/vc-image-upload/vc-image-upload.docs.md +17 -23
- package/runtime/knowledge/docs/ui/components/organisms/vc-popup/vc-popup.docs.md +109 -68
- package/runtime/knowledge/docs/ui/components/organisms/vc-sidebar/vc-sidebar.docs.md +82 -44
- package/runtime/knowledge/docs/ui/composables/ui-composables.docs.md +8 -8
- package/runtime/knowledge/docs/ui/composables/useDataTablePagination.docs.md +164 -0
- package/runtime/knowledge/docs/ui/composables/useDataTableSort.docs.md +34 -26
- package/runtime/knowledge/docs/ui/composables/useTableSelection.docs.md +48 -40
- package/runtime/knowledge/docs/ui/composables/useTableSort.docs.md +30 -17
- package/runtime/knowledge/docs/ui/types/ui-types.docs.md +40 -29
- package/runtime/knowledge/examples/offers-module.md +15 -13
- package/runtime/knowledge/examples/team-module.md +82 -119
- package/runtime/knowledge/examples/videos-module.md +44 -17
- package/runtime/knowledge/index.md +22 -0
- package/runtime/knowledge/migration-prompts/blade-form-migration.md +255 -0
- package/runtime/knowledge/migration-prompts/blade-props-migration.md +194 -0
- package/runtime/knowledge/migration-prompts/datatable-migration.md +801 -0
- package/runtime/knowledge/migration-prompts/icon-migration.md +97 -0
- package/runtime/knowledge/migration-prompts/manual-migration-audit.md +117 -0
- package/runtime/knowledge/migration-prompts/notifications-migration.md +223 -0
- package/runtime/knowledge/migration-prompts/nswag-migration.md +244 -0
- package/runtime/knowledge/migration-prompts/use-assets-migration.md +164 -0
- package/runtime/knowledge/migration-prompts/use-data-table-pagination-migration.md +176 -0
- package/runtime/knowledge/migration-prompts/widgets-migration.md +178 -0
- package/runtime/knowledge/patterns/assets-management.md +20 -20
- package/runtime/knowledge/patterns/blade-navigation.md +7 -14
- package/runtime/knowledge/patterns/blade-widget.md +19 -17
- package/runtime/knowledge/patterns/child-blade-flow.md +19 -7
- package/runtime/knowledge/patterns/composable-details.md +20 -50
- package/runtime/knowledge/patterns/composable-list.md +43 -31
- package/runtime/knowledge/patterns/dashboard-widget.md +14 -16
- package/runtime/knowledge/patterns/datatable-pattern.md +521 -0
- package/runtime/knowledge/patterns/details-blade-pattern.md +78 -116
- package/runtime/knowledge/patterns/extension-points-usage.md +53 -44
- package/runtime/knowledge/patterns/form-validation.md +28 -64
- package/runtime/knowledge/patterns/list-blade-pattern.md +33 -21
- package/runtime/knowledge/patterns/module-structure.md +7 -1
- package/runtime/knowledge/patterns/multilanguage-fields.md +8 -14
- package/runtime/knowledge/patterns/notification-template.md +21 -14
- package/runtime/knowledge/patterns/signalr-notifications.md +30 -32
- package/runtime/knowledge/patterns/toolbar-pattern.md +18 -20
- package/runtime/vc-app.md +354 -49
- package/runtime/knowledge/docs/core/constants/constants.docs.md +0 -185
|
@@ -50,7 +50,11 @@ This is how vc-shell achieves its modular architecture: modules can extend each
|
|
|
50
50
|
<form><!-- main form fields --></form>
|
|
51
51
|
|
|
52
52
|
<!-- Other modules can inject components here -->
|
|
53
|
-
<ExtensionPoint
|
|
53
|
+
<ExtensionPoint
|
|
54
|
+
name="entity:custom-fields"
|
|
55
|
+
separator
|
|
56
|
+
gap="1rem"
|
|
57
|
+
/>
|
|
54
58
|
</VcBlade>
|
|
55
59
|
</template>
|
|
56
60
|
|
|
@@ -62,22 +66,24 @@ import { ExtensionPoint } from "@vc-shell/framework";
|
|
|
62
66
|
**Plugin module** -- registers a component into that extension point:
|
|
63
67
|
|
|
64
68
|
```typescript
|
|
65
|
-
// modules/
|
|
69
|
+
// modules/entity-extensions/index.ts
|
|
66
70
|
import { defineAppModule, useExtensionPoint } from "@vc-shell/framework";
|
|
67
|
-
import
|
|
71
|
+
import CustomFields from "./components/CustomFields.vue";
|
|
68
72
|
|
|
69
|
-
const { add } = useExtensionPoint("
|
|
73
|
+
const { add } = useExtensionPoint("entity:custom-fields");
|
|
70
74
|
add({
|
|
71
|
-
id: "
|
|
72
|
-
component:
|
|
75
|
+
id: "entity-extension",
|
|
76
|
+
component: CustomFields,
|
|
73
77
|
props: { showAdvanced: true },
|
|
74
78
|
priority: 10,
|
|
75
79
|
});
|
|
76
80
|
|
|
77
|
-
export default defineAppModule({
|
|
81
|
+
export default defineAppModule({
|
|
82
|
+
/* ... */
|
|
83
|
+
});
|
|
78
84
|
```
|
|
79
85
|
|
|
80
|
-
When the seller details page renders, `
|
|
86
|
+
When the seller details page renders, `CustomFields` appears automatically below the main form -- with a separator and 1rem gap.
|
|
81
87
|
|
|
82
88
|
---
|
|
83
89
|
|
|
@@ -91,9 +97,9 @@ Extension points follow a two-role architecture:
|
|
|
91
97
|
HOST (declares) PLUGIN (registers)
|
|
92
98
|
----------------- ------------------
|
|
93
99
|
"I have a slot called "I want to put my
|
|
94
|
-
|
|
100
|
+
entity:custom-fields CustomFields
|
|
95
101
|
where plugins can component in the
|
|
96
|
-
inject content."
|
|
102
|
+
inject content." entity:custom-fields slot."
|
|
97
103
|
|
|
98
104
|
| |
|
|
99
105
|
v v
|
|
@@ -110,8 +116,8 @@ Neither side imports the other. They communicate through a shared **name string*
|
|
|
110
116
|
|
|
111
117
|
Plugins can register components **before** the host declares the extension point. The reactive store handles this gracefully:
|
|
112
118
|
|
|
113
|
-
1. Plugin calls `useExtensionPoint("
|
|
114
|
-
2. Later, host calls `defineExtensionPoint("
|
|
119
|
+
1. Plugin calls `useExtensionPoint("entity:custom-fields")` and `add(...)` -- the store creates an undeclared entry and stores the component.
|
|
120
|
+
2. Later, host calls `defineExtensionPoint("entity:custom-fields")` -- the store upgrades the entry to "declared" and preserves all previously registered components.
|
|
115
121
|
3. The host's `components` computed ref reactively picks up the registered components.
|
|
116
122
|
|
|
117
123
|
This means module load order does not matter. Remote modules loaded via Module Federation may install in any sequence, and extensions still work.
|
|
@@ -125,7 +131,7 @@ Components are sorted by `priority` (ascending). Lower numbers render first:
|
|
|
125
131
|
```typescript
|
|
126
132
|
add({ id: "a", component: A, priority: 20 }); // Renders second
|
|
127
133
|
add({ id: "b", component: B, priority: 10 }); // Renders first
|
|
128
|
-
add({ id: "c", component: C });
|
|
134
|
+
add({ id: "c", component: C }); // priority=0, renders first (tie)
|
|
129
135
|
```
|
|
130
136
|
|
|
131
137
|
Default priority is `0`. Components with the same priority render in registration order.
|
|
@@ -159,7 +165,7 @@ Used in pages or components that **accept** plugin content. Declares the extensi
|
|
|
159
165
|
```typescript
|
|
160
166
|
import { defineExtensionPoint } from "@vc-shell/framework";
|
|
161
167
|
|
|
162
|
-
const { components, hasComponents } = defineExtensionPoint("
|
|
168
|
+
const { components, hasComponents } = defineExtensionPoint("entity:custom-fields", {
|
|
163
169
|
description: "Commission fee fields in the seller details form",
|
|
164
170
|
});
|
|
165
171
|
|
|
@@ -171,7 +177,10 @@ Use in templates:
|
|
|
171
177
|
|
|
172
178
|
```vue
|
|
173
179
|
<template>
|
|
174
|
-
<div
|
|
180
|
+
<div
|
|
181
|
+
v-if="hasComponents"
|
|
182
|
+
class="extensions-area"
|
|
183
|
+
>
|
|
175
184
|
<component
|
|
176
185
|
v-for="ext in components"
|
|
177
186
|
:key="ext.id"
|
|
@@ -192,7 +201,7 @@ Used in modules that **provide** content to an extension point. Returns `add` an
|
|
|
192
201
|
import { useExtensionPoint } from "@vc-shell/framework";
|
|
193
202
|
import MyComponent from "./MyComponent.vue";
|
|
194
203
|
|
|
195
|
-
const { add, remove } = useExtensionPoint("
|
|
204
|
+
const { add, remove } = useExtensionPoint("entity:custom-fields");
|
|
196
205
|
|
|
197
206
|
// Register a component
|
|
198
207
|
add({
|
|
@@ -208,10 +217,12 @@ remove("my-unique-id");
|
|
|
208
217
|
```
|
|
209
218
|
|
|
210
219
|
**`add()` behavior:**
|
|
220
|
+
|
|
211
221
|
- If a component with the same `id` already exists, it is **replaced** (not duplicated).
|
|
212
222
|
- This makes `add()` idempotent -- safe to call multiple times.
|
|
213
223
|
|
|
214
224
|
**`remove()` behavior:**
|
|
225
|
+
|
|
215
226
|
- Removes the component by `id`. No-op if not found.
|
|
216
227
|
|
|
217
228
|
### ExtensionPoint Component (Declarative)
|
|
@@ -220,7 +231,7 @@ The `<ExtensionPoint>` component is the easiest way to render extensions in a te
|
|
|
220
231
|
|
|
221
232
|
```vue
|
|
222
233
|
<template>
|
|
223
|
-
<ExtensionPoint name="
|
|
234
|
+
<ExtensionPoint name="entity:custom-fields" />
|
|
224
235
|
</template>
|
|
225
236
|
|
|
226
237
|
<script setup lang="ts">
|
|
@@ -230,14 +241,14 @@ import { ExtensionPoint } from "@vc-shell/framework";
|
|
|
230
241
|
|
|
231
242
|
**Props:**
|
|
232
243
|
|
|
233
|
-
| Prop
|
|
234
|
-
|
|
235
|
-
| `name`
|
|
236
|
-
| `separator`
|
|
237
|
-
| `separatorClass` | `string`
|
|
238
|
-
| `wrapperClass`
|
|
239
|
-
| `gap`
|
|
240
|
-
| `filter`
|
|
244
|
+
| Prop | Type | Default | Description |
|
|
245
|
+
| ---------------- | ------------------------- | ------------- | ------------------------------------------ |
|
|
246
|
+
| `name` | `string` | required | Extension point name |
|
|
247
|
+
| `separator` | `boolean` | `false` | Adds an `<hr>` before components |
|
|
248
|
+
| `separatorClass` | `string` | default style | Custom CSS class for the `<hr>` |
|
|
249
|
+
| `wrapperClass` | `string` | none | CSS class for the wrapper `<div>` |
|
|
250
|
+
| `gap` | `string` | none | CSS gap between components (e.g. `"1rem"`) |
|
|
251
|
+
| `filter` | `Record<string, unknown>` | none | Filter components by `meta` fields |
|
|
241
252
|
|
|
242
253
|
**Rendering modes:**
|
|
243
254
|
|
|
@@ -249,15 +260,10 @@ The component has three rendering modes, chosen automatically:
|
|
|
249
260
|
|
|
250
261
|
```vue
|
|
251
262
|
<!-- Layout mode: separator + gap -->
|
|
252
|
-
<ExtensionPoint
|
|
253
|
-
name="seller:commissions"
|
|
254
|
-
separator
|
|
255
|
-
gap="1rem"
|
|
256
|
-
wrapper-class="tw-p-4"
|
|
257
|
-
/>
|
|
263
|
+
<ExtensionPoint name="entity:custom-fields" separator gap="1rem" wrapper-class="tw-p-4" />
|
|
258
264
|
|
|
259
265
|
<!-- Plain mode: no wrapper -->
|
|
260
|
-
<ExtensionPoint name="
|
|
266
|
+
<ExtensionPoint name="entity:custom-fields" />
|
|
261
267
|
```
|
|
262
268
|
|
|
263
269
|
### Scoped Slots for Custom Rendering
|
|
@@ -266,8 +272,14 @@ When you need full control over how extensions are rendered, use the scoped slot
|
|
|
266
272
|
|
|
267
273
|
```vue
|
|
268
274
|
<template>
|
|
269
|
-
<ExtensionPoint
|
|
270
|
-
|
|
275
|
+
<ExtensionPoint
|
|
276
|
+
name="order:actions"
|
|
277
|
+
v-slot="{ components, hasComponents }"
|
|
278
|
+
>
|
|
279
|
+
<div
|
|
280
|
+
v-if="hasComponents"
|
|
281
|
+
class="action-bar tw-flex tw-gap-2"
|
|
282
|
+
>
|
|
271
283
|
<component
|
|
272
284
|
v-for="ext in components"
|
|
273
285
|
:key="ext.id"
|
|
@@ -281,10 +293,10 @@ When you need full control over how extensions are rendered, use the scoped slot
|
|
|
281
293
|
|
|
282
294
|
The scoped slot receives:
|
|
283
295
|
|
|
284
|
-
| Slot prop
|
|
285
|
-
|
|
286
|
-
| `components`
|
|
287
|
-
| `hasComponents` | `boolean`
|
|
296
|
+
| Slot prop | Type | Description |
|
|
297
|
+
| --------------- | ---------------------- | ----------------------------- |
|
|
298
|
+
| `components` | `ExtensionComponent[]` | Sorted, filtered list |
|
|
299
|
+
| `hasComponents` | `boolean` | Whether the list is non-empty |
|
|
288
300
|
|
|
289
301
|
### Metadata Filtering
|
|
290
302
|
|
|
@@ -293,8 +305,8 @@ The `<ExtensionPoint>` component supports filtering by metadata fields. Only com
|
|
|
293
305
|
```typescript
|
|
294
306
|
// Plugin registers two components with different meta
|
|
295
307
|
const { add } = useExtensionPoint("order:details");
|
|
296
|
-
add({ id: "info-panel",
|
|
297
|
-
add({ id: "action-btn",
|
|
308
|
+
add({ id: "info-panel", component: InfoPanel, meta: { type: "info" } });
|
|
309
|
+
add({ id: "action-btn", component: ActionBtn, meta: { type: "action" } });
|
|
298
310
|
```
|
|
299
311
|
|
|
300
312
|
```vue
|
|
@@ -318,11 +330,11 @@ const { add } = useExtensionPoint(ExtensionPoints.AUTH_AFTER_FORM);
|
|
|
318
330
|
|
|
319
331
|
Currently defined constants:
|
|
320
332
|
|
|
321
|
-
| Constant
|
|
322
|
-
|
|
333
|
+
| Constant | Value | Location |
|
|
334
|
+
| --------------------------------- | ------------------- | ---------------------------------- |
|
|
323
335
|
| `ExtensionPoints.AUTH_AFTER_FORM` | `"auth:after-form"` | Login page, below the sign-in form |
|
|
324
336
|
|
|
325
|
-
App-level extension point names (e.g., `"
|
|
337
|
+
App-level extension point names (e.g., `"entity:custom-fields"`) are the app's responsibility to define. Consider creating a shared constants file in your application.
|
|
326
338
|
|
|
327
339
|
---
|
|
328
340
|
|
|
@@ -344,7 +356,7 @@ Scenario: You want to add commission fee fields to the Seller Details page, whic
|
|
|
344
356
|
|
|
345
357
|
<ExtensionPoint
|
|
346
358
|
v-if="sellerDetails?.id"
|
|
347
|
-
name="
|
|
359
|
+
name="entity:custom-fields"
|
|
348
360
|
wrapper-class="tw-p-2"
|
|
349
361
|
/>
|
|
350
362
|
</VcBlade>
|
|
@@ -356,13 +368,13 @@ Scenario: You want to add commission fee fields to the Seller Details page, whic
|
|
|
356
368
|
```typescript
|
|
357
369
|
// commissions/index.ts
|
|
358
370
|
import { defineAppModule, useExtensionPoint } from "@vc-shell/framework";
|
|
359
|
-
import
|
|
371
|
+
import CustomFields from "./components/CustomFields.vue";
|
|
360
372
|
import en from "./locales/en.json";
|
|
361
373
|
|
|
362
|
-
const { add } = useExtensionPoint("
|
|
374
|
+
const { add } = useExtensionPoint("entity:custom-fields");
|
|
363
375
|
add({
|
|
364
376
|
id: "commission-fields",
|
|
365
|
-
component:
|
|
377
|
+
component: CustomFields,
|
|
366
378
|
props: { editable: true },
|
|
367
379
|
priority: 10,
|
|
368
380
|
});
|
|
@@ -370,14 +382,18 @@ add({
|
|
|
370
382
|
export default defineAppModule({ locales: { en } });
|
|
371
383
|
```
|
|
372
384
|
|
|
373
|
-
**Step 3:** `
|
|
385
|
+
**Step 3:** `CustomFields.vue` receives props and renders:
|
|
374
386
|
|
|
375
387
|
```vue
|
|
376
|
-
<!-- commissions/components/
|
|
388
|
+
<!-- commissions/components/CustomFields.vue -->
|
|
377
389
|
<template>
|
|
378
390
|
<div class="commission-fields">
|
|
379
391
|
<h3>{{ $t("COMMISSIONS.TITLE") }}</h3>
|
|
380
|
-
<VcInput
|
|
392
|
+
<VcInput
|
|
393
|
+
v-if="editable"
|
|
394
|
+
v-model="rate"
|
|
395
|
+
label="Commission Rate (%)"
|
|
396
|
+
/>
|
|
381
397
|
<span v-else>{{ rate }}%</span>
|
|
382
398
|
</div>
|
|
383
399
|
</template>
|
|
@@ -433,14 +449,14 @@ The host renders them in order: ShippingInfo, PaymentInfo, OrderNotes.
|
|
|
433
449
|
If you call `add()` with an `id` that already exists, the component is replaced:
|
|
434
450
|
|
|
435
451
|
```typescript
|
|
436
|
-
const { add } = useExtensionPoint("
|
|
452
|
+
const { add } = useExtensionPoint("entity:custom-fields");
|
|
437
453
|
|
|
438
454
|
// Original registration (e.g., from another module or earlier in the code)
|
|
439
|
-
add({ id: "commission-fields", component:
|
|
455
|
+
add({ id: "commission-fields", component: OldCustomFields, priority: 10 });
|
|
440
456
|
|
|
441
457
|
// Override with a new component (same id)
|
|
442
|
-
add({ id: "commission-fields", component:
|
|
443
|
-
// Only
|
|
458
|
+
add({ id: "commission-fields", component: NewCustomFields, priority: 10 });
|
|
459
|
+
// Only NewCustomFields is rendered
|
|
444
460
|
```
|
|
445
461
|
|
|
446
462
|
This is useful for overriding default behavior provided by a base module.
|
|
@@ -452,9 +468,9 @@ Use metadata to categorize extensions and filter them in different locations:
|
|
|
452
468
|
```typescript
|
|
453
469
|
// Plugin registers multiple components with different categories
|
|
454
470
|
const { add } = useExtensionPoint("product:details");
|
|
455
|
-
add({ id: "specs-tab",
|
|
456
|
-
add({ id: "review-tab",
|
|
457
|
-
add({ id: "quick-action",
|
|
471
|
+
add({ id: "specs-tab", component: SpecsTab, meta: { zone: "tabs" }, priority: 10 });
|
|
472
|
+
add({ id: "review-tab", component: ReviewTab, meta: { zone: "tabs" }, priority: 20 });
|
|
473
|
+
add({ id: "quick-action", component: QuickAction, meta: { zone: "toolbar" } });
|
|
458
474
|
```
|
|
459
475
|
|
|
460
476
|
```vue
|
|
@@ -462,11 +478,17 @@ add({ id: "quick-action", component: QuickAction, meta: { zone: "toolbar" } }
|
|
|
462
478
|
<template>
|
|
463
479
|
<VcBlade title="Product Details">
|
|
464
480
|
<div class="toolbar">
|
|
465
|
-
<ExtensionPoint
|
|
481
|
+
<ExtensionPoint
|
|
482
|
+
name="product:details"
|
|
483
|
+
:filter="{ zone: 'toolbar' }"
|
|
484
|
+
/>
|
|
466
485
|
</div>
|
|
467
486
|
|
|
468
487
|
<div class="tabs">
|
|
469
|
-
<ExtensionPoint
|
|
488
|
+
<ExtensionPoint
|
|
489
|
+
name="product:details"
|
|
490
|
+
:filter="{ zone: 'tabs' }"
|
|
491
|
+
/>
|
|
470
492
|
</div>
|
|
471
493
|
</VcBlade>
|
|
472
494
|
</template>
|
|
@@ -482,16 +504,17 @@ add({ id: "quick-action", component: QuickAction, meta: { zone: "toolbar" } }
|
|
|
482
504
|
// WRONG -- typo: "seller:comissions" (single 'm')
|
|
483
505
|
const { add } = useExtensionPoint("seller:comissions");
|
|
484
506
|
add({ id: "my-fields", component: MyFields });
|
|
485
|
-
// Component is registered but never rendered because the host declared "
|
|
507
|
+
// Component is registered but never rendered because the host declared "entity:custom-fields"
|
|
486
508
|
```
|
|
487
509
|
|
|
488
510
|
The dev-mode console warning (`Extension point "seller:comissions" is not declared`) will alert you to this. Always check the console in development.
|
|
489
511
|
|
|
490
512
|
> **Tip:** Define constants for your extension point names in a shared file:
|
|
513
|
+
>
|
|
491
514
|
> ```typescript
|
|
492
515
|
> // shared/extension-points.ts
|
|
493
516
|
> export const EP = {
|
|
494
|
-
>
|
|
517
|
+
> ENTITY_CUSTOM_FIELDS: "entity:custom-fields",
|
|
495
518
|
> ORDER_SIDEBAR: "order:sidebar",
|
|
496
519
|
> } as const;
|
|
497
520
|
> ```
|
|
@@ -501,7 +524,7 @@ The dev-mode console warning (`Extension point "seller:comissions" is not declar
|
|
|
501
524
|
```vue
|
|
502
525
|
<!-- WRONG -- ExtensionPoint is not imported -->
|
|
503
526
|
<template>
|
|
504
|
-
<ExtensionPoint name="
|
|
527
|
+
<ExtensionPoint name="entity:custom-fields" />
|
|
505
528
|
</template>
|
|
506
529
|
|
|
507
530
|
<script setup lang="ts">
|
|
@@ -523,7 +546,7 @@ add({ id: "my-component", component: ComponentB });
|
|
|
523
546
|
Use globally unique IDs. A good convention is `module-name:component-name`:
|
|
524
547
|
|
|
525
548
|
```typescript
|
|
526
|
-
add({ id: "
|
|
549
|
+
add({ id: "module:custom-fields", component: CustomFields });
|
|
527
550
|
add({ id: "shipping:delivery-estimate", component: DeliveryEstimate });
|
|
528
551
|
```
|
|
529
552
|
|
|
@@ -547,10 +570,7 @@ function someUtility() {
|
|
|
547
570
|
Declares an extension point (host-side). Returns reactive computed refs.
|
|
548
571
|
|
|
549
572
|
```typescript
|
|
550
|
-
function defineExtensionPoint<M = Record<string, unknown>>(
|
|
551
|
-
name: string,
|
|
552
|
-
options?: ExtensionPointOptions,
|
|
553
|
-
): DefineExtensionPointReturn<M>;
|
|
573
|
+
function defineExtensionPoint<M = Record<string, unknown>>(name: string, options?: ExtensionPointOptions): DefineExtensionPointReturn<M>;
|
|
554
574
|
|
|
555
575
|
interface DefineExtensionPointReturn<M> {
|
|
556
576
|
/** Sorted list of registered components (by priority, ascending) */
|
|
@@ -603,23 +623,20 @@ interface ExtensionComponent {
|
|
|
603
623
|
|
|
604
624
|
### `<ExtensionPoint>` Component
|
|
605
625
|
|
|
606
|
-
| Prop
|
|
607
|
-
|
|
608
|
-
| `name`
|
|
609
|
-
| `separator`
|
|
610
|
-
| `separatorClass` | `string`
|
|
611
|
-
| `wrapperClass`
|
|
612
|
-
| `gap`
|
|
613
|
-
| `filter`
|
|
626
|
+
| Prop | Type | Default | Description |
|
|
627
|
+
| ---------------- | ------------------------- | -------------- | ----------------------------- |
|
|
628
|
+
| `name` | `string` | required | Extension point name |
|
|
629
|
+
| `separator` | `boolean` | `false` | Adds `<hr>` before components |
|
|
630
|
+
| `separatorClass` | `string` | built-in style | CSS class for the separator |
|
|
631
|
+
| `wrapperClass` | `string` | none | CSS class for the wrapper div |
|
|
632
|
+
| `gap` | `string` | none | CSS gap value (e.g. `"1rem"`) |
|
|
633
|
+
| `filter` | `Record<string, unknown>` | none | Filter by meta field equality |
|
|
614
634
|
|
|
615
635
|
**Scoped slot:**
|
|
616
636
|
|
|
617
637
|
```typescript
|
|
618
638
|
defineSlots<{
|
|
619
|
-
default?: (props: {
|
|
620
|
-
components: ExtensionComponent[];
|
|
621
|
-
hasComponents: boolean;
|
|
622
|
-
}) => any;
|
|
639
|
+
default?: (props: { components: ExtensionComponent[]; hasComponents: boolean }) => any;
|
|
623
640
|
}>();
|
|
624
641
|
```
|
|
625
642
|
|
|
@@ -641,20 +658,19 @@ type ExtensionPointName = "auth:after-form";
|
|
|
641
658
|
|
|
642
659
|
These are used internally by `defineExtensionPoint` and `useExtensionPoint`. You typically do not call them directly, but they are available for testing and dev tools:
|
|
643
660
|
|
|
644
|
-
| Function
|
|
645
|
-
|
|
646
|
-
| `declarePoint(name, options)` | Declare a point. No-op if already declared.
|
|
647
|
-
| `getPoint(name)`
|
|
648
|
-
| `getRegistry()`
|
|
661
|
+
| Function | Description |
|
|
662
|
+
| ----------------------------- | -------------------------------------------------------- |
|
|
663
|
+
| `declarePoint(name, options)` | Declare a point. No-op if already declared. |
|
|
664
|
+
| `getPoint(name)` | Get reactive state. Creates undeclared entry if missing. |
|
|
665
|
+
| `getRegistry()` | Get the full reactive registry (for dev tools). |
|
|
649
666
|
|
|
650
667
|
---
|
|
651
668
|
|
|
652
669
|
## Related
|
|
653
670
|
|
|
654
|
-
| Resource
|
|
655
|
-
|
|
656
|
-
| Modularity Plugin
|
|
657
|
-
| Extension Point Store
|
|
658
|
-
| ExtensionPoint Component | `core/plugins/extension-points/ExtensionPoint.vue` | Declarative render component
|
|
659
|
-
| Types
|
|
660
|
-
| Seller Details (usage example) | `apps/vendor-portal/src/modules/seller-details/` | Real-world extension point host |
|
|
671
|
+
| Resource | Path | Description |
|
|
672
|
+
| ------------------------ | -------------------------------------------------- | --------------------------------------------- |
|
|
673
|
+
| Modularity Plugin | `core/plugins/modularity/` | Module definition and registration |
|
|
674
|
+
| Extension Point Store | `core/plugins/extension-points/store.ts` | Reactive registry implementation |
|
|
675
|
+
| ExtensionPoint Component | `core/plugins/extension-points/ExtensionPoint.vue` | Declarative render component |
|
|
676
|
+
| Types | `core/plugins/extension-points/types.ts` | `ExtensionComponent`, `ExtensionPointOptions` |
|
package/runtime/knowledge/docs/core/plugins/global-error-handler/global-error-handler.docs.md
CHANGED
|
@@ -38,14 +38,14 @@ Module developers do not need to call this function. It is invoked once during t
|
|
|
38
38
|
|
|
39
39
|
Installs all error handlers on the given Vue app instance.
|
|
40
40
|
|
|
41
|
-
| Behavior
|
|
42
|
-
|
|
43
|
-
| Chains to existing `errorHandler` | Does not replace a previously registered Vue error handler; calls it after processing
|
|
44
|
-
| Idempotent for window listeners
|
|
45
|
-
| Deduplication
|
|
46
|
-
| Notification IDs
|
|
47
|
-
| SSR-safe
|
|
48
|
-
| Map cleanup
|
|
41
|
+
| Behavior | Description |
|
|
42
|
+
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
|
|
43
|
+
| Chains to existing `errorHandler` | Does not replace a previously registered Vue error handler; calls it after processing |
|
|
44
|
+
| Idempotent for window listeners | Uses `__VC_GLOBAL_ERROR_HANDLERS_INSTALLED__` guard to prevent duplicate listeners |
|
|
45
|
+
| Deduplication | Same error (by `name:message` key) is suppressed for 3 seconds |
|
|
46
|
+
| Notification IDs | Each toast gets a unique `notificationId` prefixed by source (`global-vue-`, `global-rejection-`, `global-error-`) |
|
|
47
|
+
| SSR-safe | Skips `window` event listeners when `typeof window === "undefined"` |
|
|
48
|
+
| Map cleanup | The deduplication map auto-prunes entries older than 3 seconds when it exceeds 50 entries |
|
|
49
49
|
|
|
50
50
|
## Usage
|
|
51
51
|
|
|
@@ -112,8 +112,8 @@ try {
|
|
|
112
112
|
await apiClient.updateOrder(order);
|
|
113
113
|
} catch (err) {
|
|
114
114
|
const parsed = parseError(err);
|
|
115
|
-
console.log(parsed.message);
|
|
116
|
-
console.log(parsed.details);
|
|
115
|
+
console.log(parsed.message); // Human-readable message
|
|
116
|
+
console.log(parsed.details); // Additional details (e.g., validation errors)
|
|
117
117
|
}
|
|
118
118
|
```
|
|
119
119
|
|
|
@@ -32,19 +32,19 @@ The i18n instance is created once and shared as a singleton. Calling `app.use(i1
|
|
|
32
32
|
|
|
33
33
|
### Singleton Export
|
|
34
34
|
|
|
35
|
-
| Export | Type
|
|
36
|
-
|
|
35
|
+
| Export | Type | Description |
|
|
36
|
+
| ------ | ------ | --------------------------------------------------------------- |
|
|
37
37
|
| `i18n` | `I18n` | The shared vue-i18n instance used across the entire application |
|
|
38
38
|
|
|
39
39
|
### Configuration (set by framework)
|
|
40
40
|
|
|
41
|
-
| Option
|
|
42
|
-
|
|
43
|
-
| `legacy`
|
|
44
|
-
| `globalInjection`
|
|
45
|
-
| `locale`
|
|
46
|
-
| `fallbackLocale`
|
|
47
|
-
| `formatFallbackMessages` | `true`
|
|
41
|
+
| Option | Value | Description |
|
|
42
|
+
| ------------------------ | ------- | -------------------------------------------------------- |
|
|
43
|
+
| `legacy` | `false` | Composition API mode |
|
|
44
|
+
| `globalInjection` | `true` | Enables `$t()` in templates without explicit `useI18n()` |
|
|
45
|
+
| `locale` | `"en"` | Default locale |
|
|
46
|
+
| `fallbackLocale` | `"en"` | Fallback when a key is missing in the active locale |
|
|
47
|
+
| `formatFallbackMessages` | `true` | Uses the message key itself as fallback text |
|
|
48
48
|
|
|
49
49
|
## Usage
|
|
50
50
|
|
|
@@ -109,9 +109,7 @@ Thanks to `globalInjection: true`, `$t()` is available in every template without
|
|
|
109
109
|
```vue
|
|
110
110
|
<template>
|
|
111
111
|
<VcBlade :title="$t('ORDERS.PAGES.LIST.TITLE')">
|
|
112
|
-
<VcDataTable
|
|
113
|
-
:empty-text="$t('ORDERS.PAGES.LIST.EMPTY_STATE')"
|
|
114
|
-
/>
|
|
112
|
+
<VcDataTable :empty-text="$t('ORDERS.PAGES.LIST.EMPTY_STATE')" />
|
|
115
113
|
</VcBlade>
|
|
116
114
|
</template>
|
|
117
115
|
```
|
|
@@ -188,9 +186,9 @@ The framework exports its locale files as typed ES modules. App developers can i
|
|
|
188
186
|
### Importing Framework Locales
|
|
189
187
|
|
|
190
188
|
```typescript
|
|
191
|
-
import en from
|
|
192
|
-
import de from
|
|
193
|
-
import type { VcShellLocale, VcShellLocalePartial } from
|
|
189
|
+
import en from "@vc-shell/framework/locales/en";
|
|
190
|
+
import de from "@vc-shell/framework/locales/de";
|
|
191
|
+
import type { VcShellLocale, VcShellLocalePartial } from "@vc-shell/framework/locales/types";
|
|
194
192
|
```
|
|
195
193
|
|
|
196
194
|
The `VcShellLocale` interface provides autocomplete for all framework translation keys. Use it when creating a full translation to ensure no keys are missed.
|
|
@@ -200,8 +198,8 @@ The `VcShellLocale` interface provides autocomplete for all framework translatio
|
|
|
200
198
|
Spread the English locale as a base and override all sections:
|
|
201
199
|
|
|
202
200
|
```typescript
|
|
203
|
-
import en from
|
|
204
|
-
import type { VcShellLocale } from
|
|
201
|
+
import en from "@vc-shell/framework/locales/en";
|
|
202
|
+
import type { VcShellLocale } from "@vc-shell/framework/locales/types";
|
|
205
203
|
|
|
206
204
|
const fr: VcShellLocale = {
|
|
207
205
|
...en,
|
|
@@ -219,10 +217,10 @@ const fr: VcShellLocale = {
|
|
|
219
217
|
...en.COMPONENTS,
|
|
220
218
|
// ... translate component strings
|
|
221
219
|
},
|
|
222
|
-
}
|
|
220
|
+
};
|
|
223
221
|
|
|
224
222
|
// Register in your app's main.ts or plugin setup:
|
|
225
|
-
app.config.globalProperties.$mergeLocaleMessage(
|
|
223
|
+
app.config.globalProperties.$mergeLocaleMessage("fr", fr);
|
|
226
224
|
```
|
|
227
225
|
|
|
228
226
|
### Overriding Specific Keys
|
|
@@ -230,13 +228,13 @@ app.config.globalProperties.$mergeLocaleMessage('fr', fr)
|
|
|
230
228
|
Use `VcShellLocalePartial` for partial overrides — all keys are optional:
|
|
231
229
|
|
|
232
230
|
```typescript
|
|
233
|
-
import type { VcShellLocalePartial } from
|
|
231
|
+
import type { VcShellLocalePartial } from "@vc-shell/framework/locales/types";
|
|
234
232
|
|
|
235
233
|
const overrides: VcShellLocalePartial = {
|
|
236
|
-
SHELL: { ACCOUNT: { LOGOUT: "Sign Out" } }
|
|
237
|
-
}
|
|
234
|
+
SHELL: { ACCOUNT: { LOGOUT: "Sign Out" } },
|
|
235
|
+
};
|
|
238
236
|
|
|
239
|
-
app.config.globalProperties.$mergeLocaleMessage(
|
|
237
|
+
app.config.globalProperties.$mergeLocaleMessage("en", overrides);
|
|
240
238
|
```
|
|
241
239
|
|
|
242
240
|
### Validating Your Translation
|