@propbinder/mobile-design 0.0.1 → 0.0.2

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 (123) hide show
  1. package/ng-package.json +7 -0
  2. package/package.json +12 -39
  3. package/src/animations/page-transitions.ts +86 -0
  4. package/src/assets/fonts/Brockmann-Bold.otf +0 -0
  5. package/src/assets/fonts/Brockmann-BoldItalic.otf +0 -0
  6. package/src/assets/fonts/Brockmann-Medium.otf +0 -0
  7. package/src/assets/fonts/Brockmann-MediumItalic.otf +0 -0
  8. package/src/assets/fonts/Brockmann-Regular.otf +0 -0
  9. package/src/assets/fonts/Brockmann-RegularItalic.otf +0 -0
  10. package/src/assets/fonts/Brockmann-SemiBold.otf +0 -0
  11. package/src/assets/fonts/Brockmann-SemiBoldItalic.otf +0 -0
  12. package/src/assets/fonts/Brockmann_desktop_license.pdf +0 -0
  13. package/src/assets/fonts/brockmann-medium-webfont.woff2 +0 -0
  14. package/src/assets/fonts/brockmann-regular-webfont.woff2 +0 -0
  15. package/src/assets/fonts/brockmann-semibold-webfont.woff2 +0 -0
  16. package/src/components/action-list-item/ds-mobile-action-list-item.ts +83 -0
  17. package/src/components/action-list-item/index.ts +2 -0
  18. package/src/components/app-layout/ds-mobile-app-layout.css +343 -0
  19. package/src/components/app-layout/ds-mobile-app-layout.ts +271 -0
  20. package/src/components/app-layout/index.ts +2 -0
  21. package/src/components/avatar-with-badge/ds-avatar-with-badge.ts +130 -0
  22. package/src/components/avatar-with-badge/index.ts +2 -0
  23. package/src/components/bottom-sheet/ds-mobile-actions-bottom-sheet.ts +273 -0
  24. package/src/components/bottom-sheet/ds-mobile-bottom-sheet.css +110 -0
  25. package/src/components/bottom-sheet/ds-mobile-bottom-sheet.service.ts +167 -0
  26. package/src/components/bottom-sheet/ds-mobile-post-create-bottom-sheet.ts +656 -0
  27. package/src/components/bottom-sheet/index.ts +3 -0
  28. package/src/components/comment/ds-mobile-comment.ts +516 -0
  29. package/src/components/comment/index.ts +2 -0
  30. package/src/components/contact-list-item/ds-mobile-contact-list-item.ts +182 -0
  31. package/src/components/contact-list-item/index.ts +2 -0
  32. package/src/components/content/ds-mobile-content.ts +158 -0
  33. package/src/components/content/index.ts +2 -0
  34. package/src/components/ds-mobile-tabs.css +372 -0
  35. package/src/components/ds-mobile-tabs.ts +217 -0
  36. package/src/components/file-attachment/ds-mobile-file-attachment.ts +164 -0
  37. package/src/components/file-attachment/index.ts +2 -0
  38. package/src/components/handbook-detail-modal/ds-mobile-handbook-detail-modal.service.ts +98 -0
  39. package/src/components/handbook-detail-modal/ds-mobile-handbook-detail-modal.ts +514 -0
  40. package/src/components/handbook-detail-modal/index.ts +3 -0
  41. package/src/components/handbook-folder/ds-mobile-handbook-folder-mini.ts +130 -0
  42. package/src/components/handbook-folder/ds-mobile-handbook-folder.ts +444 -0
  43. package/src/components/handbook-folder/index.ts +4 -0
  44. package/src/components/header-content/ds-mobile-header-content.ts +211 -0
  45. package/src/components/header-content/index.ts +2 -0
  46. package/src/components/index.ts +45 -0
  47. package/src/components/inline-photo/ds-mobile-inline-photo.ts +269 -0
  48. package/src/components/inline-photo/index.ts +1 -0
  49. package/src/components/interactive-list-item-inquiry/ds-mobile-interactive-list-item-inquiry.css +60 -0
  50. package/src/components/interactive-list-item-inquiry/ds-mobile-interactive-list-item-inquiry.ts +280 -0
  51. package/src/components/interactive-list-item-inquiry/index.ts +2 -0
  52. package/src/components/interactive-list-item-message/ds-mobile-interactive-list-item-message.ts +197 -0
  53. package/src/components/interactive-list-item-message/index.ts +2 -0
  54. package/src/components/interactive-list-item-post/ds-mobile-interactive-list-item-post.css +70 -0
  55. package/src/components/interactive-list-item-post/ds-mobile-interactive-list-item-post.ts +594 -0
  56. package/src/components/interactive-list-item-post/ds-mobile-post-pdf-attachment.ts +124 -0
  57. package/src/components/interactive-list-item-post/index.ts +13 -0
  58. package/src/components/lightbox/ds-mobile-lightbox-footer.ts +331 -0
  59. package/src/components/lightbox/ds-mobile-lightbox-header.ts +173 -0
  60. package/src/components/lightbox/ds-mobile-lightbox-image.ts +464 -0
  61. package/src/components/lightbox/ds-mobile-lightbox-pdf.css +375 -0
  62. package/src/components/lightbox/ds-mobile-lightbox-pdf.ts +374 -0
  63. package/src/components/lightbox/ds-mobile-lightbox.css +587 -0
  64. package/src/components/lightbox/ds-mobile-lightbox.service.ts +293 -0
  65. package/src/components/lightbox/ds-mobile-lightbox.ts +529 -0
  66. package/src/components/lightbox/index.ts +22 -0
  67. package/src/components/list-item/ds-mobile-list-item.ts +499 -0
  68. package/src/components/list-item/index.ts +2 -0
  69. package/src/components/list-item-static/ds-mobile-list-item-static.ts +133 -0
  70. package/src/components/list-item-static/index.ts +2 -0
  71. package/src/components/logo/ds-logo.ts +85 -0
  72. package/src/components/logo/index.ts +2 -0
  73. package/src/components/modal/ds-mobile-modal.css +163 -0
  74. package/src/components/modal/ds-mobile-modal.service.ts +329 -0
  75. package/src/components/modal/index.ts +8 -0
  76. package/src/components/page-details/ds-mobile-page-details.css +285 -0
  77. package/src/components/page-details/ds-mobile-page-details.ts +128 -0
  78. package/src/components/page-details/index.ts +2 -0
  79. package/src/components/page-main/ds-mobile-page-main.css +346 -0
  80. package/src/components/page-main/ds-mobile-page-main.ts +331 -0
  81. package/src/components/page-main/index.ts +2 -0
  82. package/src/components/post-card/ds-mobile-post-card.ts +685 -0
  83. package/src/components/post-card/ds-mobile-post-pdf-attachment.ts +124 -0
  84. package/src/components/post-card/index.ts +11 -0
  85. package/src/components/post-composer/ds-mobile-post-composer.ts +140 -0
  86. package/src/components/post-composer/index.ts +2 -0
  87. package/src/components/post-detail-modal/ds-mobile-post-detail-modal.service.ts +104 -0
  88. package/src/components/post-detail-modal/ds-mobile-post-detail-modal.ts +1273 -0
  89. package/src/components/post-detail-modal/index.ts +9 -0
  90. package/src/components/shared/directives/index.ts +2 -0
  91. package/src/components/shared/directives/long-press.directive.ts +208 -0
  92. package/src/components/shared/index.ts +3 -0
  93. package/src/components/shared/mobile-common.css +94 -0
  94. package/src/components/shared/mobile-page-base.css +315 -0
  95. package/src/components/shared/mobile-page-base.ts +70 -0
  96. package/src/components/swiper/ds-mobile-swiper.ts +123 -0
  97. package/src/components/swiper/index.ts +2 -0
  98. package/src/components/tab-bar/ds-mobile-tab-bar.ts +132 -0
  99. package/src/components/tab-bar/index.ts +2 -0
  100. package/src/components/tabs/ds-mobile-tabs.css +405 -0
  101. package/src/components/tabs/ds-mobile-tabs.ts +204 -0
  102. package/src/components/tabs/index.ts +2 -0
  103. package/src/pages/community.page.ts +768 -0
  104. package/src/pages/handbook.page.ts +298 -0
  105. package/src/pages/home.page.ts +192 -0
  106. package/src/pages/index.ts +9 -0
  107. package/src/pages/inquiries.example.ts +212 -0
  108. package/src/pages/inquiry-detail.example.css +434 -0
  109. package/src/pages/inquiry-detail.example.ts +416 -0
  110. package/src/pages/mobile-tabs-example.component.ts +146 -0
  111. package/src/pages/post-create.page.ts +311 -0
  112. package/src/pages/post-detail.page.ts +295 -0
  113. package/src/pages/whitelabel-demo.page.ts +548 -0
  114. package/src/public-api.ts +5 -0
  115. package/src/services/user.service.ts +35 -0
  116. package/src/services/whitelabel.service.ts +171 -0
  117. package/src/styles/ionic.css +673 -0
  118. package/tsconfig.lib.json +17 -0
  119. package/tsconfig.lib.prod.json +9 -0
  120. package/tsconfig.spec.json +13 -0
  121. package/fesm2022/propbinder-mobile-design.mjs +0 -8294
  122. package/fesm2022/propbinder-mobile-design.mjs.map +0 -1
  123. package/index.d.ts +0 -2860
@@ -0,0 +1,293 @@
1
+ import { Injectable, ApplicationRef, ComponentRef, createComponent, EnvironmentInjector, Injector } from '@angular/core';
2
+ import { DsMobileLightboxImageComponent } from './ds-mobile-lightbox-image';
3
+ import { DsMobileLightboxPdfComponent } from './ds-mobile-lightbox-pdf';
4
+
5
+ /**
6
+ * Media file types supported by the lightbox
7
+ */
8
+ export type LightboxMediaType = 'image' | 'pdf';
9
+
10
+ /**
11
+ * Base media file interface
12
+ */
13
+ export interface LightboxMediaFile {
14
+ /** File source URL */
15
+ src: string;
16
+ /** Media type - determines which viewer to use */
17
+ type: LightboxMediaType;
18
+ /** File title */
19
+ title?: string;
20
+ /** File description */
21
+ description?: string;
22
+ }
23
+
24
+ /**
25
+ * Image data for lightbox display
26
+ */
27
+ export interface LightboxImage extends LightboxMediaFile {
28
+ type: 'image';
29
+ /** Alt text for accessibility */
30
+ alt?: string;
31
+ /** Thumbnail URL for faster loading (optional) */
32
+ thumbnail?: string;
33
+ /** Whether the image is liked */
34
+ isLiked?: boolean;
35
+ /** Number of likes */
36
+ likeCount?: number;
37
+ /** Number of comments */
38
+ commentCount?: number;
39
+ }
40
+
41
+ /**
42
+ * PDF document data for lightbox display
43
+ */
44
+ export interface LightboxPdf extends LightboxMediaFile {
45
+ type: 'pdf';
46
+ /** File size in bytes (optional, for display) */
47
+ fileSize?: number;
48
+ /** Number of pages (optional, for display) */
49
+ pageCount?: number;
50
+ }
51
+
52
+ /**
53
+ * Author metadata for the lightbox
54
+ */
55
+ export interface LightboxAuthor {
56
+ /** Author name */
57
+ name: string;
58
+ /** Author role/subtitle */
59
+ role?: string;
60
+ /** Author avatar URL */
61
+ avatarSrc?: string;
62
+ /** Author avatar initials (if no photo) */
63
+ avatarInitials?: string;
64
+ /** Avatar type */
65
+ avatarType?: 'photo' | 'initials';
66
+ /** Timestamp */
67
+ timestamp?: string;
68
+ }
69
+
70
+ /**
71
+ * Configuration options for image lightbox
72
+ */
73
+ export interface LightboxImageOptions {
74
+ /** Array of images to display */
75
+ images: LightboxImage[];
76
+ /** Author information to display in header */
77
+ author?: LightboxAuthor;
78
+ /** Initial image index to show (0-based) */
79
+ initialIndex?: number;
80
+ /** Enable pinch-to-zoom and double-tap zoom */
81
+ enableZoom?: boolean;
82
+ /** Show navigation controls (arrows, counter) */
83
+ showControls?: boolean;
84
+ /** Enable swipe gestures to navigate between images */
85
+ enableSwipe?: boolean;
86
+ /** Show image info (title, description) */
87
+ showInfo?: boolean;
88
+ /** Animation type for opening */
89
+ animation?: 'fade' | 'zoom' | 'slide';
90
+ }
91
+
92
+ /**
93
+ * Configuration options for PDF lightbox
94
+ */
95
+ export interface LightboxPdfOptions {
96
+ /** PDF document to display */
97
+ pdf: LightboxPdf;
98
+ /** Author information to display */
99
+ author?: LightboxAuthor;
100
+ }
101
+
102
+ /**
103
+ * Generic lightbox options (for backward compatibility)
104
+ */
105
+ export type LightboxOptions = LightboxImageOptions;
106
+
107
+ /**
108
+ * DsMobileLightboxService
109
+ *
110
+ * Service for displaying media files (images and PDFs) in full-screen viewers.
111
+ * - Images: Full-screen modal with gestures (pinch-zoom, swipe navigation)
112
+ * - PDFs: Native device PDF viewer (iOS/Android)
113
+ *
114
+ * Features:
115
+ * - Full-screen image viewing with gestures
116
+ * - Native PDF viewing
117
+ * - Swipe navigation between images
118
+ * - Pinch-to-zoom and double-tap zoom for images
119
+ * - Mobile-optimized touch gestures
120
+ * - Share functionality
121
+ *
122
+ * @example
123
+ * ```typescript
124
+ * constructor(private lightbox: DsMobileLightboxService) {}
125
+ *
126
+ * // Open images
127
+ * async openImages() {
128
+ * const modal = await this.lightbox.openImages({
129
+ * images: [
130
+ * {
131
+ * type: 'image',
132
+ * src: 'https://example.com/image1.jpg',
133
+ * title: 'Beautiful Sunset'
134
+ * }
135
+ * ]
136
+ * });
137
+ *
138
+ * // Listen for when lightbox is dismissed
139
+ * const { data } = await modal.onDidDismiss();
140
+ * if (data?.action === 'comment') {
141
+ * // Open post detail modal with comment focus
142
+ * this.openPostDetail({ focusComment: true });
143
+ * }
144
+ * }
145
+ *
146
+ * // Open PDF
147
+ * async openPdf() {
148
+ * await this.lightbox.openPdf({
149
+ * pdf: {
150
+ * type: 'pdf',
151
+ * src: 'https://example.com/document.pdf',
152
+ * title: 'Document'
153
+ * }
154
+ * });
155
+ * }
156
+ * ```
157
+ */
158
+ @Injectable({
159
+ providedIn: 'root'
160
+ })
161
+ export class DsMobileLightboxService {
162
+ private currentLightbox: ComponentRef<any> | null = null;
163
+
164
+ constructor(
165
+ private appRef: ApplicationRef,
166
+ private injector: EnvironmentInjector
167
+ ) {}
168
+
169
+ /**
170
+ * Open the lightbox with images (backward compatible method)
171
+ *
172
+ * @param options Configuration options for the image lightbox
173
+ * @returns Promise that resolves to a dismiss function
174
+ */
175
+ async open(options: LightboxOptions): Promise<() => void> {
176
+ return this.openImages(options);
177
+ }
178
+
179
+ /**
180
+ * Open the image lightbox with one or more images
181
+ *
182
+ * @param options Configuration options for the image lightbox
183
+ * @returns Promise that resolves to a dismiss function
184
+ */
185
+ async openImages(options: LightboxImageOptions): Promise<() => void> {
186
+ console.log('[Lightbox] Opening images with options:', options);
187
+
188
+ // Close any existing lightbox
189
+ if (this.currentLightbox) {
190
+ this.close();
191
+ }
192
+
193
+ // Create the component
194
+ const componentRef = createComponent(DsMobileLightboxImageComponent, {
195
+ environmentInjector: this.injector
196
+ });
197
+
198
+ // Set component props
199
+ componentRef.instance.images = options.images;
200
+ componentRef.instance.author = options.author;
201
+ componentRef.instance.initialIndex = options.initialIndex ?? 0;
202
+ componentRef.instance.enableZoom = options.enableZoom !== false;
203
+ componentRef.instance.showControls = options.showControls !== false;
204
+ componentRef.instance.enableSwipe = options.enableSwipe !== false;
205
+ componentRef.instance.showInfo = options.showInfo !== false;
206
+ componentRef.instance.animation = options.animation ?? 'fade';
207
+
208
+ // Set up close callback
209
+ componentRef.instance.onCloseRequested = () => {
210
+ this.close();
211
+ };
212
+
213
+ // Attach to application
214
+ this.appRef.attachView(componentRef.hostView);
215
+
216
+ // Append to body
217
+ const domElem = (componentRef.hostView as any).rootNodes[0] as HTMLElement;
218
+ document.body.appendChild(domElem);
219
+
220
+ // Store reference
221
+ this.currentLightbox = componentRef;
222
+
223
+ console.log('[Lightbox] Image lightbox rendered');
224
+
225
+ // Return dismiss function
226
+ return () => this.close();
227
+ }
228
+
229
+ /**
230
+ * Open the PDF lightbox (opens native PDF viewer)
231
+ *
232
+ * @param options Configuration options for the PDF lightbox
233
+ * @returns Promise that resolves to a dismiss function
234
+ */
235
+ async openPdf(options: LightboxPdfOptions): Promise<() => void> {
236
+ console.log('[Lightbox] Opening PDF with options:', options);
237
+
238
+ // Close any existing lightbox
239
+ if (this.currentLightbox) {
240
+ this.close();
241
+ }
242
+
243
+ // Create the component
244
+ const componentRef = createComponent(DsMobileLightboxPdfComponent, {
245
+ environmentInjector: this.injector
246
+ });
247
+
248
+ // Set component props
249
+ componentRef.instance.pdf = options.pdf;
250
+ componentRef.instance.author = options.author;
251
+
252
+ // Set up close callback
253
+ componentRef.instance.onCloseRequested = () => {
254
+ this.close();
255
+ };
256
+
257
+ // Attach to application
258
+ this.appRef.attachView(componentRef.hostView);
259
+
260
+ // Append to body
261
+ const domElem = (componentRef.hostView as any).rootNodes[0] as HTMLElement;
262
+ document.body.appendChild(domElem);
263
+
264
+ // Store reference
265
+ this.currentLightbox = componentRef;
266
+
267
+ console.log('[Lightbox] PDF lightbox rendered');
268
+
269
+ // Return dismiss function
270
+ return () => this.close();
271
+ }
272
+
273
+ /**
274
+ * Close the currently open lightbox
275
+ */
276
+ close(): void {
277
+ if (this.currentLightbox) {
278
+ const domElem = (this.currentLightbox.hostView as any).rootNodes[0] as HTMLElement;
279
+ domElem.remove();
280
+ this.appRef.detachView(this.currentLightbox.hostView);
281
+ this.currentLightbox.destroy();
282
+ this.currentLightbox = null;
283
+ }
284
+ }
285
+
286
+ /**
287
+ * Check if a lightbox is currently open
288
+ */
289
+ isOpen(): boolean {
290
+ return this.currentLightbox !== null;
291
+ }
292
+ }
293
+