@grasco/profile-picture 0.1.7 → 0.1.8
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/dist/angular.cjs +1012 -1
- package/dist/angular.cjs.map +1 -1
- package/dist/angular.d.cts +71 -81
- package/dist/angular.d.ts +71 -81
- package/dist/angular.js +1012 -1
- package/dist/angular.js.map +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -81
- package/dist/index.d.ts +12 -81
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +1013 -0
- package/dist/react.cjs.map +1 -0
- package/dist/react.d.cts +407 -0
- package/dist/react.d.ts +407 -0
- package/dist/react.js +1013 -0
- package/dist/react.js.map +1 -0
- package/dist/standalone.d.ts +3 -3
- package/dist/standalone.standalone.js.map +1 -1
- package/dist/svelte.cjs +1012 -1
- package/dist/svelte.cjs.map +1 -1
- package/dist/svelte.d.cts +67 -81
- package/dist/svelte.d.ts +67 -81
- package/dist/svelte.js +1012 -1
- package/dist/svelte.js.map +1 -1
- package/dist/vue.cjs +1012 -1
- package/dist/vue.cjs.map +1 -1
- package/dist/vue.d.cts +83 -81
- package/dist/vue.d.ts +83 -81
- package/dist/vue.js +1012 -1
- package/dist/vue.js.map +1 -1
- package/package.json +11 -1
package/dist/svelte.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as lit from 'lit';
|
|
2
2
|
import { LitElement } from 'lit';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -201,84 +201,6 @@ interface ProfilePictureGroupProps {
|
|
|
201
201
|
animated?: boolean;
|
|
202
202
|
}
|
|
203
203
|
|
|
204
|
-
declare class ProfilePicture extends LitElement {
|
|
205
|
-
private static stylesInjected;
|
|
206
|
-
private static cdnBaseUrl;
|
|
207
|
-
private static instances;
|
|
208
|
-
/**
|
|
209
|
-
* Set global CDN base URL for all ProfilePicture instances
|
|
210
|
-
* @example ProfilePicture.setCdnBaseUrl('https://api.example.com')
|
|
211
|
-
*/
|
|
212
|
-
static setCdnBaseUrl(url: string): void;
|
|
213
|
-
/**
|
|
214
|
-
* Get current CDN base URL
|
|
215
|
-
*/
|
|
216
|
-
static getCdnBaseUrl(): string;
|
|
217
|
-
protected createRenderRoot(): this;
|
|
218
|
-
private static injectStylesOnce;
|
|
219
|
-
src: string;
|
|
220
|
-
alt: string;
|
|
221
|
-
extCustomerId?: string;
|
|
222
|
-
size: Size | string;
|
|
223
|
-
variant: Variant;
|
|
224
|
-
shadow: ShadowPreset;
|
|
225
|
-
border: boolean;
|
|
226
|
-
borderWidth: 1 | 2 | 3 | 4 | 5 | 6 | 8;
|
|
227
|
-
borderColor: string;
|
|
228
|
-
rotation: number;
|
|
229
|
-
bgColor?: string;
|
|
230
|
-
bgGradient?: string;
|
|
231
|
-
ring?: RingConfig;
|
|
232
|
-
presence?: PresenceConfig;
|
|
233
|
-
glow?: GlowConfig;
|
|
234
|
-
badge?: BadgeConfig;
|
|
235
|
-
loading: LoadingStrategy;
|
|
236
|
-
placeholder: PlaceholderType;
|
|
237
|
-
placeholderColor: string;
|
|
238
|
-
fallback?: string;
|
|
239
|
-
interactive?: InteractionConfig;
|
|
240
|
-
private isLoaded;
|
|
241
|
-
private hasError;
|
|
242
|
-
private cdnImageUrl?;
|
|
243
|
-
private cdnLoadFailed;
|
|
244
|
-
private previousSrc;
|
|
245
|
-
private previousExtCustomerId?;
|
|
246
|
-
private retryTimeoutId?;
|
|
247
|
-
private readonly RETRY_DELAY_MS;
|
|
248
|
-
private get pixelSize();
|
|
249
|
-
connectedCallback(): void;
|
|
250
|
-
disconnectedCallback(): void;
|
|
251
|
-
protected firstUpdated(): void;
|
|
252
|
-
protected updated(changedProperties: Map<string, unknown>): void;
|
|
253
|
-
protected willUpdate(changedProperties: Map<string, unknown>): void;
|
|
254
|
-
private handleLoad;
|
|
255
|
-
private handleError;
|
|
256
|
-
/**
|
|
257
|
-
* Construct CDN URL for profile picture using ext-customer-id
|
|
258
|
-
* Uses direct image src binding - browser handles redirects automatically
|
|
259
|
-
*/
|
|
260
|
-
private loadCdnImage;
|
|
261
|
-
private getContainerStyles;
|
|
262
|
-
private renderPlaceholder;
|
|
263
|
-
private renderFallback;
|
|
264
|
-
private renderImage;
|
|
265
|
-
private renderRing;
|
|
266
|
-
/**
|
|
267
|
-
* Calculate corner offset based on variant
|
|
268
|
-
* Returns the inset from container edge where badges/presence should be positioned
|
|
269
|
-
*/
|
|
270
|
-
private getCornerOffset;
|
|
271
|
-
private renderPresence;
|
|
272
|
-
private renderBadge;
|
|
273
|
-
render(): lit_html.TemplateResult<1>;
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
declare global {
|
|
277
|
-
interface HTMLElementTagNameMap {
|
|
278
|
-
"profile-picture": ProfilePicture;
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
|
|
282
204
|
declare class ProfilePictureGroup extends LitElement {
|
|
283
205
|
protected createRenderRoot(): this;
|
|
284
206
|
max: 4;
|
|
@@ -330,7 +252,7 @@ declare class ProfilePictureGroup extends LitElement {
|
|
|
330
252
|
private renderDropdownItem;
|
|
331
253
|
private formatStatus;
|
|
332
254
|
protected updated(changedProperties: Map<PropertyKey, unknown>): void;
|
|
333
|
-
render():
|
|
255
|
+
render(): lit.TemplateResult<1>;
|
|
334
256
|
}
|
|
335
257
|
|
|
336
258
|
declare global {
|
|
@@ -339,4 +261,68 @@ declare global {
|
|
|
339
261
|
}
|
|
340
262
|
}
|
|
341
263
|
|
|
342
|
-
|
|
264
|
+
/**
|
|
265
|
+
* Svelte wrapper for ProfilePicture Web Component
|
|
266
|
+
*
|
|
267
|
+
* The component is a standard Web Component and works natively with Svelte.
|
|
268
|
+
* Just import to register, then use in templates.
|
|
269
|
+
*
|
|
270
|
+
* @example
|
|
271
|
+
* ```svelte
|
|
272
|
+
* <script lang="ts">
|
|
273
|
+
* import '@grasco/profile-picture/svelte';
|
|
274
|
+
* import type { ProfilePictureProps, RingConfig, BadgeConfig } from '@grasco/profile-picture/svelte';
|
|
275
|
+
*
|
|
276
|
+
* let avatarUrl = 'https://example.com/avatar.png';
|
|
277
|
+
*
|
|
278
|
+
* const ring: RingConfig = { show: true, color: '#ff5722' };
|
|
279
|
+
* const badge: BadgeConfig = { content: 3, position: 'bottom-right', pulse: true };
|
|
280
|
+
*
|
|
281
|
+
* function handleLoad() {
|
|
282
|
+
* console.log('Image loaded');
|
|
283
|
+
* }
|
|
284
|
+
*
|
|
285
|
+
* function handleError() {
|
|
286
|
+
* console.error('Image failed to load');
|
|
287
|
+
* }
|
|
288
|
+
* </script>
|
|
289
|
+
*
|
|
290
|
+
* <profile-picture
|
|
291
|
+
* src={avatarUrl}
|
|
292
|
+
* alt="John Doe"
|
|
293
|
+
* size="lg"
|
|
294
|
+
* variant="circle"
|
|
295
|
+
* border={true}
|
|
296
|
+
* border-color="white"
|
|
297
|
+
* bg-color="#f3f4f6"
|
|
298
|
+
* ring={JSON.stringify(ring)}
|
|
299
|
+
* badge={JSON.stringify(badge)}
|
|
300
|
+
* on:load={handleLoad}
|
|
301
|
+
* on:error={handleError}
|
|
302
|
+
* />
|
|
303
|
+
* ```
|
|
304
|
+
*
|
|
305
|
+
* Note: For TypeScript support, you may need to add type definitions:
|
|
306
|
+
*
|
|
307
|
+
* ```typescript
|
|
308
|
+
* // src/app.d.ts or global.d.ts
|
|
309
|
+
* declare namespace svelteHTML {
|
|
310
|
+
* interface IntrinsicElements {
|
|
311
|
+
* 'profile-picture': any;
|
|
312
|
+
* 'profile-picture-group': any;
|
|
313
|
+
* }
|
|
314
|
+
* }
|
|
315
|
+
* ```
|
|
316
|
+
*/
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* Set global CDN base URL for all ProfilePicture instances
|
|
320
|
+
* @example setCdnBaseUrl('https://api.example.com')
|
|
321
|
+
*/
|
|
322
|
+
declare function setCdnBaseUrl(url: string): void;
|
|
323
|
+
/**
|
|
324
|
+
* Get current CDN base URL
|
|
325
|
+
*/
|
|
326
|
+
declare function getCdnBaseUrl(): string;
|
|
327
|
+
|
|
328
|
+
export { type BadgeConfig, type DropdownConfig, type GlowConfig, type GroupUserData, type InteractionConfig, type LoadingStrategy, type PlaceholderType, type Position, type PresenceConfig, type PresenceStatus, type ProfilePictureGroupProps, type ProfilePictureProps, type RingConfig, type ShadowPreset, type Size, type StackDirection, type TooltipConfig, type TooltipPosition, type Variant, getCdnBaseUrl, setCdnBaseUrl };
|