@bnsights/bbsf-utilities 1.0.69-beta.1 → 1.0.69-beta.19-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.
Files changed (118) hide show
  1. package/README.md +109 -3
  2. package/fesm2022/bnsights-bbsf-utilities.mjs +295 -3833
  3. package/fesm2022/bnsights-bbsf-utilities.mjs.map +1 -1
  4. package/lib/bbsf-utilities.module.d.ts +22 -2
  5. package/lib/shared/authentication/auth.service.d.ts +0 -1
  6. package/lib/shared/models/index.d.ts +0 -1
  7. package/lib/shared/services/index.d.ts +0 -1
  8. package/lib/shared/services/request-handler.service.d.ts +2 -3
  9. package/package.json +11 -36
  10. package/public-api.d.ts +0 -2
  11. package/esm2022/auth/bnsights-bbsf-utilities-auth.mjs +0 -5
  12. package/esm2022/auth/public-api.mjs +0 -5
  13. package/esm2022/bnsights-bbsf-utilities.mjs +0 -5
  14. package/esm2022/http/bnsights-bbsf-utilities-http.mjs +0 -5
  15. package/esm2022/http/public-api.mjs +0 -8
  16. package/esm2022/lib/bbsf-utilities.module.mjs +0 -63
  17. package/esm2022/lib/shared/authentication/auth.service.mjs +0 -260
  18. package/esm2022/lib/shared/authentication/index.mjs +0 -2
  19. package/esm2022/lib/shared/config/environment.mjs +0 -12
  20. package/esm2022/lib/shared/config/word/constants.mjs +0 -105
  21. package/esm2022/lib/shared/config/word/docx-document.mjs +0 -348
  22. package/esm2022/lib/shared/config/word/helpers/index.mjs +0 -4
  23. package/esm2022/lib/shared/config/word/helpers/render-document-file.mjs +0 -154
  24. package/esm2022/lib/shared/config/word/helpers/xml-builder.mjs +0 -1836
  25. package/esm2022/lib/shared/config/word/html-to-docx.mjs +0 -187
  26. package/esm2022/lib/shared/config/word/index.mjs +0 -50
  27. package/esm2022/lib/shared/config/word/namespaces.mjs +0 -37
  28. package/esm2022/lib/shared/config/word/schemas/content-types.mjs +0 -26
  29. package/esm2022/lib/shared/config/word/schemas/core.mjs +0 -27
  30. package/esm2022/lib/shared/config/word/schemas/document-rels.mjs +0 -16
  31. package/esm2022/lib/shared/config/word/schemas/document.template.mjs +0 -107
  32. package/esm2022/lib/shared/config/word/schemas/font-table.mjs +0 -40
  33. package/esm2022/lib/shared/config/word/schemas/generic-rels.mjs +0 -11
  34. package/esm2022/lib/shared/config/word/schemas/index.mjs +0 -13
  35. package/esm2022/lib/shared/config/word/schemas/numbering.mjs +0 -17
  36. package/esm2022/lib/shared/config/word/schemas/rels.mjs +0 -11
  37. package/esm2022/lib/shared/config/word/schemas/settings.mjs +0 -13
  38. package/esm2022/lib/shared/config/word/schemas/styles.mjs +0 -147
  39. package/esm2022/lib/shared/config/word/schemas/theme.mjs +0 -198
  40. package/esm2022/lib/shared/config/word/schemas/web-settings.mjs +0 -9
  41. package/esm2022/lib/shared/config/word/utils/color-conversion.mjs +0 -60
  42. package/esm2022/lib/shared/config/word/utils/list.mjs +0 -51
  43. package/esm2022/lib/shared/config/word/utils/unit-conversion.mjs +0 -30
  44. package/esm2022/lib/shared/config/word/utils/url.mjs +0 -7
  45. package/esm2022/lib/shared/config/word/utils/vnode.mjs +0 -3
  46. package/esm2022/lib/shared/config/word/word-work/templates/documentTemplate.mjs +0 -54
  47. package/esm2022/lib/shared/config/word/word-work/templates/index.mjs +0 -4
  48. package/esm2022/lib/shared/config/word/word-work/templates/mhtDocumentTemplate.mjs +0 -22
  49. package/esm2022/lib/shared/config/word/word-work/templates/mhtPartTemplate.mjs +0 -10
  50. package/esm2022/lib/shared/config/word/word-work/utils.mjs +0 -26
  51. package/esm2022/lib/shared/enums/authentication-modes-enums.mjs +0 -8
  52. package/esm2022/lib/shared/index.mjs +0 -4
  53. package/esm2022/lib/shared/models/UserModel.mjs +0 -3
  54. package/esm2022/lib/shared/models/area-model.mjs +0 -3
  55. package/esm2022/lib/shared/models/error-model.mjs +0 -3
  56. package/esm2022/lib/shared/models/index.mjs +0 -6
  57. package/esm2022/lib/shared/models/request-options-model.mjs +0 -11
  58. package/esm2022/lib/shared/models/speech-language.mjs +0 -3
  59. package/esm2022/lib/shared/models/word-document-model.mjs +0 -8
  60. package/esm2022/lib/shared/services/appearance-configuration.service.mjs +0 -35
  61. package/esm2022/lib/shared/services/configuration.service.mjs +0 -48
  62. package/esm2022/lib/shared/services/control-validation.service.mjs +0 -173
  63. package/esm2022/lib/shared/services/environment.service.mjs +0 -83
  64. package/esm2022/lib/shared/services/index.mjs +0 -15
  65. package/esm2022/lib/shared/services/language.service.mjs +0 -21
  66. package/esm2022/lib/shared/services/master-layout.service.mjs +0 -77
  67. package/esm2022/lib/shared/services/preload.service.mjs +0 -54
  68. package/esm2022/lib/shared/services/request-handler.service.mjs +0 -260
  69. package/esm2022/lib/shared/services/speech-recognition.service.mjs +0 -76
  70. package/esm2022/lib/shared/services/styles-bundle.service.mjs +0 -76
  71. package/esm2022/lib/shared/services/translate.service.mjs +0 -14
  72. package/esm2022/lib/shared/services/translation-resolver.service.mjs +0 -7
  73. package/esm2022/lib/shared/services/utility.service.mjs +0 -87
  74. package/esm2022/lib/shared/services/word-document.service.mjs +0 -38
  75. package/esm2022/public-api.mjs +0 -57
  76. package/esm2022/translate/bnsights-bbsf-utilities-translate.mjs +0 -5
  77. package/esm2022/translate/public-api.mjs +0 -7
  78. package/esm2022/ui/bnsights-bbsf-utilities-ui.mjs +0 -5
  79. package/esm2022/ui/public-api.mjs +0 -8
  80. package/esm2022/word/bnsights-bbsf-utilities-word.mjs +0 -5
  81. package/esm2022/word/public-api.mjs +0 -6
  82. package/fesm2022/bnsights-bbsf-utilities-word.mjs +0 -10
  83. package/fesm2022/bnsights-bbsf-utilities-word.mjs.map +0 -1
  84. package/lib/shared/config/word/constants.d.ts +0 -124
  85. package/lib/shared/config/word/docx-document.d.ts +0 -73
  86. package/lib/shared/config/word/helpers/index.d.ts +0 -1
  87. package/lib/shared/config/word/helpers/render-document-file.d.ts +0 -2
  88. package/lib/shared/config/word/helpers/xml-builder.d.ts +0 -16
  89. package/lib/shared/config/word/html-to-docx.d.ts +0 -1
  90. package/lib/shared/config/word/index.d.ts +0 -1
  91. package/lib/shared/config/word/namespaces.d.ts +0 -36
  92. package/lib/shared/config/word/schemas/content-types.d.ts +0 -1
  93. package/lib/shared/config/word/schemas/core.d.ts +0 -1
  94. package/lib/shared/config/word/schemas/document-rels.d.ts +0 -1
  95. package/lib/shared/config/word/schemas/document.template.d.ts +0 -4
  96. package/lib/shared/config/word/schemas/font-table.d.ts +0 -1
  97. package/lib/shared/config/word/schemas/generic-rels.d.ts +0 -1
  98. package/lib/shared/config/word/schemas/index.d.ts +0 -12
  99. package/lib/shared/config/word/schemas/numbering.d.ts +0 -1
  100. package/lib/shared/config/word/schemas/rels.d.ts +0 -1
  101. package/lib/shared/config/word/schemas/settings.d.ts +0 -1
  102. package/lib/shared/config/word/schemas/styles.d.ts +0 -1
  103. package/lib/shared/config/word/schemas/theme.d.ts +0 -1
  104. package/lib/shared/config/word/schemas/web-settings.d.ts +0 -1
  105. package/lib/shared/config/word/utils/color-conversion.d.ts +0 -7
  106. package/lib/shared/config/word/utils/list.d.ts +0 -6
  107. package/lib/shared/config/word/utils/unit-conversion.d.ts +0 -29
  108. package/lib/shared/config/word/utils/url.d.ts +0 -1
  109. package/lib/shared/config/word/utils/vnode.d.ts +0 -1
  110. package/lib/shared/config/word/word-work/templates/documentTemplate.d.ts +0 -12
  111. package/lib/shared/config/word/word-work/templates/index.d.ts +0 -3
  112. package/lib/shared/config/word/word-work/templates/mhtDocumentTemplate.d.ts +0 -1
  113. package/lib/shared/config/word/word-work/templates/mhtPartTemplate.d.ts +0 -1
  114. package/lib/shared/config/word/word-work/utils.d.ts +0 -1
  115. package/lib/shared/models/word-document-model.d.ts +0 -16
  116. package/lib/shared/services/word-document.service.d.ts +0 -8
  117. package/word/index.d.ts +0 -5
  118. package/word/public-api.d.ts +0 -2
package/README.md CHANGED
@@ -4,6 +4,63 @@ BBSF Utilities package is part of BBSF 3 packages. It has all the common service
4
4
 
5
5
  For more info please visit [BBSF Controls documentation](https://bbsfadmin.bnsights.com/controls) or [BBSF documentation](https://bnsightsprojects.visualstudio.com/BBSF%203/_wiki/wikis/BBSF-3.wiki/65/BBSF-Documentation)
6
6
 
7
+ ## 🔄 Two Ways to Use This Library
8
+
9
+ ### 1️⃣ **Backward Compatible** (All-in-One Module)
10
+
11
+ For existing applications or quick setup, import the `BBSFUtilitiesModule` to get everything:
12
+
13
+ ```typescript
14
+ // app.module.ts
15
+ import { BBSFUtilitiesModule } from '@bnsights/bbsf-utilities';
16
+
17
+ @NgModule({
18
+ imports: [
19
+ BBSFUtilitiesModule, // Includes ALL services and modules
20
+ // ... other imports
21
+ ]
22
+ })
23
+ export class AppModule { }
24
+ ```
25
+
26
+ **What you get:**
27
+ - ✅ All services automatically registered
28
+ - ✅ BlockUI and Toastr modules pre-configured
29
+ - ✅ Works exactly like the original version
30
+ - ⚠️ Larger bundle size (includes all dependencies)
31
+
32
+ ### 2️⃣ **Modular** (Optimized for Bundle Size)
33
+
34
+ For new applications or to optimize bundle size, use secondary entry points:
35
+
36
+ ```typescript
37
+ // app.module.ts
38
+ import { EnvironmentService } from '@bnsights/bbsf-utilities';
39
+ import { AuthService } from '@bnsights/bbsf-utilities/auth';
40
+ import { BBSFTranslateService } from '@bnsights/bbsf-utilities/translate';
41
+ import { UtilityService } from '@bnsights/bbsf-utilities/ui';
42
+ import { RequestHandlerService } from '@bnsights/bbsf-utilities/http';
43
+
44
+ @NgModule({
45
+ providers: [
46
+ EnvironmentService,
47
+ AuthService,
48
+ BBSFTranslateService,
49
+ UtilityService,
50
+ RequestHandlerService,
51
+ // Only import what you need
52
+ ]
53
+ })
54
+ export class AppModule { }
55
+ ```
56
+
57
+ **Benefits:**
58
+ - 🚀 Smaller bundle size (only include what you use)
59
+ - 📦 Better tree-shaking
60
+ - ⚡ Faster build times
61
+
62
+ ---
63
+
7
64
  ## 📦 Secondary Entry Points (Optimized Dependencies)
8
65
 
9
66
  To optimize bundle size, the library now supports **secondary entry points** - only install what you use!
@@ -14,7 +71,7 @@ To optimize bundle size, the library now supports **secondary entry points** - o
14
71
  |---------|-------------|--------------|------|
15
72
  | **Core** (Environment, Styling) | `@bnsights/bbsf-utilities` | `lodash` `nanoid` `tslib` | 2 MB |
16
73
  | **Authentication** | `@bnsights/bbsf-utilities/auth` | `@auth0/angular-jwt` `ngx-cookie-service` `oidc-client` | +3 MB |
17
- | **Word Generation** | `@bnsights/bbsf-utilities/word` | `jszip` `xmlbuilder2` `html-to-vdom` `virtual-dom` + 5 more | +8 MB |
74
+ | **Word Generation** | `@bnsights/bbsf-utilities/word` | `jszip` `xmlbuilder2` `html-to-vdom` `virtual-dom` + 5 more | +8 MB (lazy-loaded) |
18
75
  | **Translation/i18n** | `@bnsights/bbsf-utilities/translate` | `@ngx-translate/core` | +2 MB |
19
76
  | **UI Services** (Toasts, Loading, Validation) | `@bnsights/bbsf-utilities/ui` | `ng-block-ui` `ngx-toastr` | +3 MB |
20
77
  | **HTTP Handling** | `@bnsights/bbsf-utilities/http` | `class-transformer` | +1 MB |
@@ -49,14 +106,63 @@ import { AuthService } from '@bbsf'; // Simple! ✅
49
106
  - **Core + Auth:** 67% smaller (15MB → 5MB)
50
107
  - **Everything:** Same size (but other apps save!)
51
108
 
109
+ ### ⚡ Word Generation - Automatic Lazy Loading
110
+ Word generation dependencies (xmlbuilder2, jszip, etc.) use **dynamic imports** - they're automatically split into a separate chunk and only loaded when you first call `generateWordByteFile()`. No code changes needed!
111
+
112
+ **Benefits:**
113
+ - ✅ Main bundle: ~8 MB smaller
114
+ - ✅ Word chunk: Loaded on-demand only when needed
115
+ - ✅ Backward compatible: Works with existing code
116
+ - ✅ Automatic: Handled by build tools
117
+
118
+ See [XMLBUILDER2_FIX.md](./XMLBUILDER2_FIX.md) for technical details.
119
+
52
120
  ### 📚 Documentation
53
121
 
54
- - **[USAGE.md](./USAGE.md)** - Complete feature table & examples ⭐ START HERE
55
- - **[MIGRATION_GUIDE.md](./MIGRATION_GUIDE.md)** - Migrate existing apps
122
+ - **[BACKWARD_COMPATIBILITY.md](./BACKWARD_COMPATIBILITY.md)** - Understand both usage patterns (BBSFUtilitiesModule vs Modular) ⭐ START HERE
123
+ - **[USAGE.md](./USAGE.md)** - Complete feature table & examples
124
+ - **[MIGRATION_GUIDE.md](./MIGRATION_GUIDE.md)** - Migrate to modular imports (optional)
56
125
  - **[TROUBLESHOOTING.md](./TROUBLESHOOTING.md)** - Fix import issues
57
126
 
58
127
  # Change Log
59
128
 
129
+ ## 1.0.72 / 27/10/2025
130
+
131
+ =====================
132
+
133
+ ### 🔄 Enhanced Backward Compatibility
134
+
135
+ - **Clarified BBSFUtilitiesModule usage**: The module now explicitly exports all necessary Angular modules (CommonModule, RouterModule, BlockUIModule, ToastrModule) for complete backward compatibility
136
+ - **Two usage patterns supported**:
137
+ 1. **All-in-One**: Import `BBSFUtilitiesModule` for everything (original behavior maintained)
138
+ 2. **Modular**: Import from secondary entry points for optimized bundles
139
+ - **No breaking changes**: Existing applications using `BBSFUtilitiesModule` continue to work unchanged
140
+ - **Documentation added**:
141
+ - `BACKWARD_COMPATIBILITY.md` - Quick reference guide
142
+ - Updated README with clear comparison of both approaches
143
+ - Enhanced MIGRATION_GUIDE.md with "no migration required" section
144
+
145
+ ### Benefits
146
+ - ✅ Zero migration required for existing apps
147
+ - ✅ Full flexibility for new projects
148
+ - ✅ Clear documentation for both patterns
149
+ - ✅ All services and modules properly exported
150
+
151
+ ## 1.0.71 / 27/10/2025
152
+
153
+ =====================
154
+
155
+ ### 🚀 Major Bundle Size Optimization
156
+
157
+ - **Fixed xmlbuilder2 bundling issue**: Word generation dependencies (~8 MB) are now lazy-loaded using dynamic imports
158
+ - **Benefit**: Main application bundle is ~8 MB smaller - word dependencies only loaded when actually generating documents
159
+ - **Breaking Changes**: None - fully backward compatible
160
+ - **Technical Details**: See [XMLBUILDER2_FIX.md](./XMLBUILDER2_FIX.md)
161
+
162
+ ### Changes
163
+ - Modified `WordDocumentService.generateWordByteFile()` to use dynamic imports
164
+ - Word generation dependencies (xmlbuilder2, jszip, html-to-vdom, etc.) automatically split into separate chunk
165
+ - Consuming applications get automatic bundle size reduction without code changes
60
166
 
61
167
  ## 1.0.70 / 26/10/2025
62
168