@vc-shell/framework 1.0.337 → 1.0.339

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 (35) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/core/plugins/modularity/README.md +152 -0
  3. package/core/plugins/modularity/extensions-helper.ts +209 -0
  4. package/core/plugins/modularity/index.ts +1 -0
  5. package/core/plugins/modularity/loader.ts +101 -45
  6. package/dist/core/plugins/modularity/extensions-helper.d.ts +43 -0
  7. package/dist/core/plugins/modularity/extensions-helper.d.ts.map +1 -0
  8. package/dist/core/plugins/modularity/index.d.ts +1 -0
  9. package/dist/core/plugins/modularity/index.d.ts.map +1 -1
  10. package/dist/core/plugins/modularity/loader.d.ts +8 -1
  11. package/dist/core/plugins/modularity/loader.d.ts.map +1 -1
  12. package/dist/framework.js +78 -75
  13. package/dist/{index-uN8bAa26.js → index-BA4XLzrE.js} +1 -1
  14. package/dist/{index-CSSkJOfq.js → index-BK6bOJ2f.js} +1 -1
  15. package/dist/{index-CgzWGbHS.js → index-BV98cGOv.js} +1 -1
  16. package/dist/{index-lVT4dHp9.js → index-ByAWvAvC.js} +1 -1
  17. package/dist/{index-qjmd8hvu.js → index-Bych2Dea.js} +1 -1
  18. package/dist/{index-WxuHZ6ax.js → index-Cn3LT6Oh.js} +1 -1
  19. package/dist/{index-DORisCqC.js → index-D2zjsAdg.js} +1 -1
  20. package/dist/{index-C92JvhP1.js → index-D65gmF6H.js} +1 -1
  21. package/dist/{index-BDvESZx7.js → index-D8-DRuRz.js} +1 -1
  22. package/dist/{index-BQmhRbEk.js → index-DDoMuob5.js} +1 -1
  23. package/dist/{index-C7PASwQX.js → index-DtSXKQ_1.js} +1 -1
  24. package/dist/{index-Bgq8S5p_.js → index-PFPVBXLk.js} +1 -1
  25. package/dist/{index-Cz8wvRrh.js → index-Zf-flepy.js} +1 -1
  26. package/dist/{index-B8GFtokC.js → index-oAIKLPI1.js} +16135 -16033
  27. package/dist/{index-A-dq3OuG.js → index-ub_-R52E.js} +1 -1
  28. package/dist/{index-CI2AIc_X.js → index-wlHLaOEQ.js} +1 -1
  29. package/dist/{index-CqZkZSbf.js → index-xepYcArZ.js} +1 -1
  30. package/dist/index.css +1 -1
  31. package/dist/shared/pages/LoginPage/components/login/Login.vue.d.ts.map +1 -1
  32. package/dist/tsconfig.tsbuildinfo +1 -1
  33. package/package.json +4 -4
  34. package/shared/pages/LoginPage/components/login/Login.vue +22 -1
  35. package/shared/pages/LoginPage/components/login/README.md +52 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vc-shell/framework",
3
- "version": "1.0.337",
3
+ "version": "1.0.339",
4
4
  "type": "module",
5
5
  "main": "./dist/framework.js",
6
6
  "types": "./dist/index.d.ts",
@@ -59,9 +59,9 @@
59
59
  },
60
60
  "devDependencies": {
61
61
  "@types/dompurify": "^3.0.5",
62
- "@vc-shell/api-client-generator": "^1.0.337",
63
- "@vc-shell/config-generator": "^1.0.337",
64
- "@vc-shell/ts-config": "^1.0.337",
62
+ "@vc-shell/api-client-generator": "^1.0.339",
63
+ "@vc-shell/config-generator": "^1.0.339",
64
+ "@vc-shell/ts-config": "^1.0.339",
65
65
  "@vitejs/plugin-vue": "5.0.3",
66
66
  "cypress-signalr-mock": "^1.5.0",
67
67
  "sass": "^1.69.6",
@@ -81,6 +81,16 @@
81
81
 
82
82
  <ExternalProviders :providers="loginProviders" />
83
83
  </div>
84
+
85
+ <!-- Extensions after form -->
86
+ <template
87
+ v-for="extension in afterLoginFormExtensions"
88
+ :key="extension.id"
89
+ >
90
+ <div class="vc-login-page__extension">
91
+ <component :is="extension.component" />
92
+ </div>
93
+ </template>
84
94
  </template>
85
95
  <template v-else>
86
96
  <template v-if="!forgotPasswordRequestSent">
@@ -162,7 +172,7 @@
162
172
 
163
173
  <!-- eslint-disable @typescript-eslint/no-explicit-any -->
164
174
  <script lang="ts" setup>
165
- import { ref, reactive, computed, onMounted, Ref } from "vue";
175
+ import { ref, reactive, computed, onMounted, Ref, inject } from "vue";
166
176
  import { useRouter } from "vue-router";
167
177
  import { useIsFormValid, Field, useIsFormDirty, useForm } from "vee-validate";
168
178
  import { useSettings, useUser } from "./../../../../../core/composables";
@@ -171,6 +181,7 @@ import { ExternalSignInProviderInfo, SignInResult } from "./../../../../../core/
171
181
  import { useI18n } from "vue-i18n";
172
182
  import { default as ExternalProviders } from "./../../../../../shared/components/sign-in/external-providers.vue";
173
183
  import { useExternalProvider } from "./../../../../../shared/components/sign-in/useExternalProvider";
184
+ import { Extension, ExtensionPoint, extensionsHelperSymbol } from "./../../../../../core/plugins";
174
185
 
175
186
  type ForgotPasswordFunc = (args: { loginOrEmail: string }) => Promise<void>;
176
187
 
@@ -203,6 +214,12 @@ const loadingForgotPassword = ref(false);
203
214
  const loginProviders = ref<ExternalSignInProviderInfo[]>();
204
215
  let forgotPassword: ForgotPasswordFunc;
205
216
 
217
+ const extensionsHelper = inject(extensionsHelperSymbol);
218
+
219
+ const afterLoginFormExtensions = computed(
220
+ (): ExtensionPoint[] => (extensionsHelper?.getOutboundExtensions("login-after-form") as ExtensionPoint[]) || [],
221
+ );
222
+
206
223
  if (props.composable && typeof props.composable === "function") {
207
224
  useLogin = props.composable;
208
225
 
@@ -320,6 +337,10 @@ console.debug("Init login-page");
320
337
  @apply tw-w-28;
321
338
  }
322
339
 
340
+ &__extension {
341
+ @apply tw-mt-6 tw-pt-6 tw-border-t tw-border-t-[color:var(--login-separator)] tw-flex tw-justify-center;
342
+ }
343
+
323
344
  &__separator {
324
345
  @apply tw-mt-4;
325
346
  }
@@ -0,0 +1,52 @@
1
+ # Login Component Extension Guide
2
+
3
+ The Login component can be extended through the dynamic modules system. This guide explains how to add custom functionality to the login page.
4
+
5
+ ## Extension Points
6
+
7
+ Currently, the Login component supports the following extension points:
8
+
9
+ - `login-after-form` - Allows adding content after the login form
10
+
11
+ ## How to Add Extensions
12
+
13
+ ### 1. Create Your Extension Component
14
+
15
+ First, create your custom component:
16
+ ```vue
17
+ <!-- MyLoginExtension.vue -->
18
+ <template>
19
+ <div class="my-login-extension">
20
+ <!-- Your custom content -->
21
+ </div>
22
+ </template>
23
+ <script lang="ts" setup>
24
+ // Your component logic
25
+ </script>
26
+ ```
27
+
28
+ ### 2. Register Extension in Your Module
29
+
30
+ In your module's entry point, register the extension:
31
+
32
+ ```typescript
33
+ import MyLoginExtension from './components/MyLoginExtension.vue';
34
+ export default {
35
+ install(app) {
36
+ // Module installation logic
37
+ },
38
+ extensions: {
39
+ 'login-after-form': [{id: 'MyLoginExtension', component: MyLoginExtensionComponent}]
40
+ }
41
+ }
42
+ ```
43
+
44
+ ## Extension Points Details
45
+
46
+ ### login-after-form
47
+
48
+ This extension point appears after the login form and before any error messages. Extensions will be rendered with:
49
+ - A horizontal separator line above
50
+ - Centered alignment
51
+ - Proper spacing from the login form
52
+