osi-cards-lib 1.5.33 → 1.5.35
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/README.md +58 -20
- package/fesm2022/osi-cards-lib.mjs +23 -6
- package/fesm2022/osi-cards-lib.mjs.map +1 -1
- package/index.d.ts +9 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -159,21 +159,43 @@ This is the **most reliable method**, especially for SASS files. The styles are
|
|
|
159
159
|
|
|
160
160
|
**Important**:
|
|
161
161
|
- ⚠️ **Case sensitive**: Use `osi-cards-lib` (lowercase), NOT `osi-cards-Lib`
|
|
162
|
-
- ⚠️ **REQUIRED**: You must wrap your components in a container
|
|
162
|
+
- ⚠️ **REQUIRED**: You must wrap your components in a container. **RECOMMENDED: Use `<osi-cards-container>` component** (automatically handles theme and tilt):
|
|
163
163
|
|
|
164
164
|
```html
|
|
165
|
-
<!--
|
|
165
|
+
<!-- ✅ RECOMMENDED: Use osi-cards-container component -->
|
|
166
|
+
<osi-cards-container [theme]="'day'">
|
|
167
|
+
<app-ai-card-renderer [cardConfig]="card"></app-ai-card-renderer>
|
|
168
|
+
</osi-cards-container>
|
|
169
|
+
|
|
170
|
+
<!-- ✅ Also works with dynamic theme -->
|
|
171
|
+
<osi-cards-container [theme]="cardTheme" *ngIf="cardConfig">
|
|
172
|
+
<app-ai-card-renderer [cardConfig]="cardConfig"></app-ai-card-renderer>
|
|
173
|
+
</osi-cards-container>
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
**Why use the component?**
|
|
177
|
+
- ✅ Automatically sets `data-theme` attribute correctly
|
|
178
|
+
- ✅ Automatically adds `perspective: 1200px` for 3D tilt effects
|
|
179
|
+
- ✅ Preserves 3D transform context (`transform-style: preserve-3d`)
|
|
180
|
+
- ✅ Handles all container styling automatically
|
|
181
|
+
- ✅ More reliable than manual div setup
|
|
182
|
+
|
|
183
|
+
**Alternative (Manual Setup):**
|
|
184
|
+
If you prefer a plain div, you must manually set both the class and `data-theme` attribute:
|
|
185
|
+
|
|
186
|
+
```html
|
|
187
|
+
<!-- ⚠️ Manual setup - requires both class and data-theme -->
|
|
166
188
|
<div class="osi-cards-container" data-theme="day">
|
|
167
189
|
<app-ai-card-renderer [cardConfig]="card"></app-ai-card-renderer>
|
|
168
190
|
</div>
|
|
169
191
|
|
|
170
|
-
<!-- Dynamic theme
|
|
192
|
+
<!-- Dynamic theme with manual setup -->
|
|
171
193
|
<div class="osi-cards-container" [attr.data-theme]="theme" *ngIf="cardConfig">
|
|
172
194
|
<app-ai-card-renderer [cardConfig]="cardConfig"></app-ai-card-renderer>
|
|
173
195
|
</div>
|
|
174
196
|
```
|
|
175
197
|
|
|
176
|
-
**The `data-theme` attribute is REQUIRED** - without it, styles will not apply correctly. Use `"day"` for light theme or `"night"` for dark theme.
|
|
198
|
+
**The `data-theme` attribute is REQUIRED** - without it, styles will not apply correctly. Use `"day"` for light theme or `"night"` for dark theme. The component handles this automatically.
|
|
177
199
|
|
|
178
200
|
#### Option B: Global Styles (For Standalone Apps)
|
|
179
201
|
|
|
@@ -236,32 +258,36 @@ export class StaticCardComponent {
|
|
|
236
258
|
}
|
|
237
259
|
```
|
|
238
260
|
|
|
239
|
-
**HTML (
|
|
261
|
+
**HTML (RECOMMENDED - using OsiCardsContainerComponent):**
|
|
240
262
|
|
|
241
263
|
```html
|
|
242
|
-
<
|
|
264
|
+
<osi-cards-container [theme]="cardTheme">
|
|
243
265
|
<app-ai-card-renderer
|
|
244
266
|
[cardConfig]="card"
|
|
245
267
|
[streamingStage]="'complete'"
|
|
246
268
|
[showLoadingByDefault]="false"
|
|
269
|
+
[tiltEnabled]="true"
|
|
247
270
|
(cardInteraction)="onCardAction($event)">
|
|
248
271
|
</app-ai-card-renderer>
|
|
249
|
-
</
|
|
272
|
+
</osi-cards-container>
|
|
250
273
|
```
|
|
251
274
|
|
|
252
|
-
**HTML (
|
|
275
|
+
**HTML (Alternative - manual div setup):**
|
|
253
276
|
|
|
254
277
|
```html
|
|
255
|
-
<osi-cards-container [theme]="cardTheme">
|
|
278
|
+
<div class="osi-cards-container" [attr.data-theme]="cardTheme">
|
|
256
279
|
<app-ai-card-renderer
|
|
257
280
|
[cardConfig]="card"
|
|
258
281
|
[streamingStage]="'complete'"
|
|
259
282
|
[showLoadingByDefault]="false"
|
|
283
|
+
[tiltEnabled]="true"
|
|
260
284
|
(cardInteraction)="onCardAction($event)">
|
|
261
285
|
</app-ai-card-renderer>
|
|
262
|
-
</
|
|
286
|
+
</div>
|
|
263
287
|
```
|
|
264
288
|
|
|
289
|
+
**Note**: The component approach is recommended because it automatically handles theme, perspective for tilt, and 3D transform context.
|
|
290
|
+
|
|
265
291
|
**Key Settings:**
|
|
266
292
|
- `[streamingStage]="'complete'"` → Card is fully loaded
|
|
267
293
|
- `[showLoadingByDefault]="false"` → No loading spinner
|
|
@@ -354,14 +380,14 @@ export class StreamingCardComponent {
|
|
|
354
380
|
}
|
|
355
381
|
```
|
|
356
382
|
|
|
357
|
-
**HTML (
|
|
383
|
+
**HTML (RECOMMENDED - using OsiCardsContainerComponent):**
|
|
358
384
|
|
|
359
385
|
```html
|
|
360
386
|
<button (click)="generateCard()" [disabled]="isStreaming">
|
|
361
387
|
{{ isStreaming ? 'Generating...' : 'Generate Card' }}
|
|
362
388
|
</button>
|
|
363
389
|
|
|
364
|
-
<
|
|
390
|
+
<osi-cards-container [theme]="cardTheme">
|
|
365
391
|
<app-ai-card-renderer
|
|
366
392
|
[cardConfig]="card"
|
|
367
393
|
[isStreaming]="isStreaming"
|
|
@@ -370,19 +396,20 @@ export class StreamingCardComponent {
|
|
|
370
396
|
[showLoadingByDefault]="true"
|
|
371
397
|
[loadingMessages]="loadingMessages"
|
|
372
398
|
[loadingTitle]="'AI Analysis'"
|
|
399
|
+
[tiltEnabled]="true"
|
|
373
400
|
(cardInteraction)="onCardAction($event)">
|
|
374
401
|
</app-ai-card-renderer>
|
|
375
|
-
</
|
|
402
|
+
</osi-cards-container>
|
|
376
403
|
```
|
|
377
404
|
|
|
378
|
-
**HTML (
|
|
405
|
+
**HTML (Alternative - manual div setup):**
|
|
379
406
|
|
|
380
407
|
```html
|
|
381
408
|
<button (click)="generateCard()" [disabled]="isStreaming">
|
|
382
409
|
{{ isStreaming ? 'Generating...' : 'Generate Card' }}
|
|
383
410
|
</button>
|
|
384
411
|
|
|
385
|
-
<osi-cards-container [theme]="cardTheme">
|
|
412
|
+
<div class="osi-cards-container" [attr.data-theme]="cardTheme">
|
|
386
413
|
<app-ai-card-renderer
|
|
387
414
|
[cardConfig]="card"
|
|
388
415
|
[isStreaming]="isStreaming"
|
|
@@ -391,9 +418,10 @@ export class StreamingCardComponent {
|
|
|
391
418
|
[showLoadingByDefault]="true"
|
|
392
419
|
[loadingMessages]="loadingMessages"
|
|
393
420
|
[loadingTitle]="'AI Analysis'"
|
|
421
|
+
[tiltEnabled]="true"
|
|
394
422
|
(cardInteraction)="onCardAction($event)">
|
|
395
423
|
</app-ai-card-renderer>
|
|
396
|
-
</
|
|
424
|
+
</div>
|
|
397
425
|
```
|
|
398
426
|
|
|
399
427
|
**Key Settings:**
|
|
@@ -1095,14 +1123,23 @@ If you want to keep the import in your styles file:
|
|
|
1095
1123
|
```
|
|
1096
1124
|
Then remove the `@import` from your `styles.scss`.
|
|
1097
1125
|
|
|
1098
|
-
3. **Wrap components in container** - You MUST wrap your components:
|
|
1126
|
+
3. **Wrap components in container** - You MUST wrap your components. **RECOMMENDED: Use `<osi-cards-container>` component** (automatically handles theme and tilt):
|
|
1127
|
+
```html
|
|
1128
|
+
<!-- ✅ RECOMMENDED: Component automatically handles theme and tilt -->
|
|
1129
|
+
<osi-cards-container [theme]="'day'">
|
|
1130
|
+
<app-ai-card-renderer [cardConfig]="card"></app-ai-card-renderer>
|
|
1131
|
+
</osi-cards-container>
|
|
1132
|
+
```
|
|
1133
|
+
|
|
1134
|
+
**Alternative (Manual Setup):**
|
|
1099
1135
|
```html
|
|
1136
|
+
<!-- ⚠️ Manual setup - requires both class and data-theme -->
|
|
1100
1137
|
<div class="osi-cards-container" data-theme="day">
|
|
1101
1138
|
<app-ai-card-renderer [cardConfig]="card"></app-ai-card-renderer>
|
|
1102
1139
|
</div>
|
|
1103
1140
|
```
|
|
1104
1141
|
|
|
1105
|
-
4. **Set theme attribute** -
|
|
1142
|
+
4. **Set theme attribute** - The component handles this automatically via `[theme]` input. For manual setup, add `data-theme="day"` or `data-theme="night"`:
|
|
1106
1143
|
```html
|
|
1107
1144
|
<div class="osi-cards-container" data-theme="day">
|
|
1108
1145
|
```
|
|
@@ -1131,8 +1168,9 @@ Import styles in your `styles.scss`:
|
|
|
1131
1168
|
|
|
1132
1169
|
**Common Issues:**
|
|
1133
1170
|
- ❌ **Wrong import path**: `@import 'osi-cards-Lib/styles/_styles-scoped'` (wrong casing)
|
|
1134
|
-
- ❌ **Missing container**: Components not wrapped in `.osi-cards-container`
|
|
1135
|
-
- ❌ **Missing theme**: No `data-theme` attribute on container
|
|
1171
|
+
- ❌ **Missing container**: Components not wrapped in `.osi-cards-container` or `<osi-cards-container>` component
|
|
1172
|
+
- ❌ **Missing theme**: No `data-theme` attribute on container (use `<osi-cards-container [theme]="'day'">` to fix automatically)
|
|
1173
|
+
- ❌ **Tilt not working**: Missing `perspective` on container (use `<osi-cards-container>` component which adds it automatically)
|
|
1136
1174
|
- ❌ **SCSS not compiled**: Check that your build process compiles SCSS files
|
|
1137
1175
|
|
|
1138
1176
|
### Icons not showing
|
|
@@ -6083,7 +6083,7 @@ function getSectionsRequiringExternalLibs() {
|
|
|
6083
6083
|
* Manifest metadata
|
|
6084
6084
|
*/
|
|
6085
6085
|
const MANIFEST_META = {
|
|
6086
|
-
generatedAt: '2025-12-
|
|
6086
|
+
generatedAt: '2025-12-12T20:10:53.516Z',
|
|
6087
6087
|
registryVersion: '1.5.19',
|
|
6088
6088
|
totalSections: 22,
|
|
6089
6089
|
publicSections: 22
|
|
@@ -26542,6 +26542,7 @@ class OsiCardsContainerComponent {
|
|
|
26542
26542
|
// Inject configuration from providers (optional - may not be provided)
|
|
26543
26543
|
this.cssIsolationMode = inject(CSS_ISOLATION_MODE, { optional: true });
|
|
26544
26544
|
this.defaultThemeConfig = inject(DEFAULT_THEME, { optional: true });
|
|
26545
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
26545
26546
|
}
|
|
26546
26547
|
/**
|
|
26547
26548
|
* Computed container class name.
|
|
@@ -26566,8 +26567,24 @@ class OsiCardsContainerComponent {
|
|
|
26566
26567
|
const resolvedTheme = this.theme ?? (typeof configTheme === 'string' ? configTheme : null) ?? 'day';
|
|
26567
26568
|
return resolvedTheme;
|
|
26568
26569
|
}
|
|
26570
|
+
/**
|
|
26571
|
+
* React to input changes, especially theme changes.
|
|
26572
|
+
* This ensures OnPush change detection works correctly when theme input changes.
|
|
26573
|
+
*/
|
|
26574
|
+
ngOnChanges(changes) {
|
|
26575
|
+
// If theme input changed, manually trigger change detection for OnPush strategy
|
|
26576
|
+
// Handle both first change and subsequent changes to ensure theme updates work
|
|
26577
|
+
if (changes['theme']) {
|
|
26578
|
+
const oldTheme = changes['theme'].previousValue;
|
|
26579
|
+
const newTheme = changes['theme'].currentValue;
|
|
26580
|
+
console.log(`[OsiCardsContainer] Theme input changed from ${oldTheme} to ${newTheme}`);
|
|
26581
|
+
this.cdr.markForCheck();
|
|
26582
|
+
// Also trigger detectChanges to ensure immediate update
|
|
26583
|
+
this.cdr.detectChanges();
|
|
26584
|
+
}
|
|
26585
|
+
}
|
|
26569
26586
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: OsiCardsContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
26570
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.14", type: OsiCardsContainerComponent, isStandalone: true, selector: "osi-cards-container", inputs: { theme: "theme", strictIsolation: "strictIsolation" }, ngImport: i0, template: `
|
|
26587
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.14", type: OsiCardsContainerComponent, isStandalone: true, selector: "osi-cards-container", inputs: { theme: "theme", strictIsolation: "strictIsolation" }, usesOnChanges: true, ngImport: i0, template: `
|
|
26571
26588
|
<div
|
|
26572
26589
|
[class]="containerClass"
|
|
26573
26590
|
[attr.data-theme]="effectiveTheme"
|
|
@@ -26576,7 +26593,7 @@ class OsiCardsContainerComponent {
|
|
|
26576
26593
|
>
|
|
26577
26594
|
<ng-content></ng-content>
|
|
26578
26595
|
</div>
|
|
26579
|
-
`, isInline: true, styles: [":host{display:block;background:transparent!important;background-color:transparent!important}.osi-cards-container{padding:var(--osi-card-padding);background:transparent!important;background-color:transparent!important;perspective:1200px;transform-style:preserve-3d;display:flex;justify-content:center;align-items:flex-start}.osi-cards-container--strict{contain:content;isolation:isolate;overflow:hidden}@media (max-width: 480px){.osi-cards-container{padding:var(--osi-card-padding-mobile)}}\n"], changeDetection: i0.ChangeDetectionStrategy.
|
|
26596
|
+
`, isInline: true, styles: [":host{display:block;background:transparent!important;background-color:transparent!important}.osi-cards-container{padding:var(--osi-card-padding);background:transparent!important;background-color:transparent!important;perspective:1200px;transform-style:preserve-3d;display:flex;justify-content:center;align-items:flex-start}.osi-cards-container--strict{contain:content;isolation:isolate;overflow:hidden}@media (max-width: 480px){.osi-cards-container{padding:var(--osi-card-padding-mobile)}}\n"], changeDetection: i0.ChangeDetectionStrategy.Default, encapsulation: i0.ViewEncapsulation.None }); }
|
|
26580
26597
|
}
|
|
26581
26598
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: OsiCardsContainerComponent, decorators: [{
|
|
26582
26599
|
type: Component,
|
|
@@ -26589,7 +26606,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImpo
|
|
|
26589
26606
|
>
|
|
26590
26607
|
<ng-content></ng-content>
|
|
26591
26608
|
</div>
|
|
26592
|
-
`, changeDetection: ChangeDetectionStrategy.
|
|
26609
|
+
`, changeDetection: ChangeDetectionStrategy.Default, encapsulation: ViewEncapsulation.None, styles: [":host{display:block;background:transparent!important;background-color:transparent!important}.osi-cards-container{padding:var(--osi-card-padding);background:transparent!important;background-color:transparent!important;perspective:1200px;transform-style:preserve-3d;display:flex;justify-content:center;align-items:flex-start}.osi-cards-container--strict{contain:content;isolation:isolate;overflow:hidden}@media (max-width: 480px){.osi-cards-container{padding:var(--osi-card-padding-mobile)}}\n"] }]
|
|
26593
26610
|
}], propDecorators: { theme: [{
|
|
26594
26611
|
type: Input
|
|
26595
26612
|
}], strictIsolation: [{
|
|
@@ -31794,10 +31811,10 @@ class SubscriptionPool {
|
|
|
31794
31811
|
* Do not edit manually - generated by scripts/generate-version.js
|
|
31795
31812
|
*
|
|
31796
31813
|
* Source of truth: version.config.json
|
|
31797
|
-
* Last synced: 2025-12-
|
|
31814
|
+
* Last synced: 2025-12-12T20:38:43.054Z
|
|
31798
31815
|
*/
|
|
31799
31816
|
const VERSION = '1.5.19';
|
|
31800
|
-
const BUILD_DATE = '2025-12-
|
|
31817
|
+
const BUILD_DATE = '2025-12-12T20:38:43.054Z';
|
|
31801
31818
|
const BUILD_HASH = 'fbe56c9';
|
|
31802
31819
|
const BUILD_BRANCH = 'main';
|
|
31803
31820
|
const VERSION_INFO = {
|