@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,171 @@
1
+ import { Injectable, signal, effect } from '@angular/core';
2
+
3
+ export interface WhitelabelConfig {
4
+ // Logo assets
5
+ logoUrl: string; // Full logo for header (typically horizontal)
6
+ logoMarkUrl: string; // Compact logo mark for avatars/badges
7
+ logoAlt: string; // Alt text for accessibility
8
+
9
+ // Logo dimensions (optional, for optimization)
10
+ logoWidth?: number;
11
+ logoHeight?: number;
12
+ logoMarkWidth?: number;
13
+ logoMarkHeight?: number;
14
+
15
+ // Brand colors - these will update CSS custom properties
16
+ primaryColor: string; // Maps to --color-background-brand
17
+ secondaryColor: string; // Maps to --color-brand-secondary
18
+
19
+ // Organization info
20
+ organizationName: string;
21
+ organizationId: string;
22
+ }
23
+
24
+ const DEFAULT_CONFIG: WhitelabelConfig = {
25
+ logoUrl: '/assets/logos/propbinder-logo.svg',
26
+ logoMarkUrl: '/assets/logos/propbinder-logomark.svg',
27
+ logoAlt: 'Propbinder',
28
+ primaryColor: '#6B5FF5', // Propbinder brand purple (--color-background-brand)
29
+ secondaryColor: '#221a4c', // Propbinder dark purple for headers (--color-brand-secondary)
30
+ organizationName: 'Propbinder',
31
+ organizationId: 'default'
32
+ };
33
+
34
+ /**
35
+ * WhitelabelService
36
+ *
37
+ * Manages whitelabel configuration including logos and brand colors.
38
+ * Automatically updates CSS custom properties when colors change.
39
+ *
40
+ * @example
41
+ * Initialize with custom config:
42
+ * ```typescript
43
+ * whitelabelService.initialize({
44
+ * logoUrl: '/assets/logos/acme-logo.svg',
45
+ * logoMarkUrl: '/assets/logos/acme-mark.svg',
46
+ * primaryColor: '#2563eb',
47
+ * secondaryColor: '#3b82f6',
48
+ * organizationName: 'Acme Corp'
49
+ * });
50
+ * ```
51
+ *
52
+ * Load from API:
53
+ * ```typescript
54
+ * await whitelabelService.loadFromApi('acme-corp');
55
+ * ```
56
+ */
57
+ @Injectable({
58
+ providedIn: 'root'
59
+ })
60
+ export class WhitelabelService {
61
+ private _config = signal<WhitelabelConfig>(DEFAULT_CONFIG);
62
+
63
+ // Readonly getters for accessing config values
64
+ readonly logoUrl = () => this._config().logoUrl;
65
+ readonly logoMarkUrl = () => this._config().logoMarkUrl;
66
+ readonly logoAlt = () => this._config().logoAlt;
67
+ readonly primaryColor = () => this._config().primaryColor;
68
+ readonly secondaryColor = () => this._config().secondaryColor;
69
+ readonly organizationName = () => this._config().organizationName;
70
+ readonly organizationId = () => this._config().organizationId;
71
+
72
+ // Full config accessor
73
+ readonly config = this._config.asReadonly();
74
+
75
+ constructor() {
76
+ // Apply default colors on initialization
77
+ this.applyColors(DEFAULT_CONFIG.primaryColor, DEFAULT_CONFIG.secondaryColor);
78
+
79
+ // Watch for config changes and update CSS custom properties
80
+ effect(() => {
81
+ const config = this._config();
82
+ this.applyColors(config.primaryColor, config.secondaryColor);
83
+ });
84
+ }
85
+
86
+ /**
87
+ * Initialize whitelabel configuration
88
+ * Call this early in app initialization (app.config.ts or app.component.ts)
89
+ */
90
+ initialize(config: Partial<WhitelabelConfig>) {
91
+ this._config.update(current => ({
92
+ ...current,
93
+ ...config
94
+ }));
95
+ }
96
+
97
+ /**
98
+ * Load whitelabel config from API
99
+ * Typically called on app startup based on subdomain, user tenant, etc.
100
+ *
101
+ * @param organizationId - The organization identifier (subdomain, tenant ID, etc.)
102
+ */
103
+ async loadFromApi(organizationId?: string): Promise<void> {
104
+ try {
105
+ // Example API call structure
106
+ // const response = await fetch(`/api/whitelabel/${organizationId || 'default'}`);
107
+ // const config = await response.json();
108
+ // this.initialize(config);
109
+
110
+ console.log('Loading whitelabel config from API for:', organizationId);
111
+
112
+ // Example: Different configs for different organizations
113
+ if (organizationId === 'demo-client') {
114
+ this.initialize({
115
+ logoUrl: '/assets/logos/demo-logo.svg',
116
+ logoMarkUrl: '/assets/logos/demo-mark.svg',
117
+ logoAlt: 'Demo Client',
118
+ primaryColor: '#2563eb', // Blue
119
+ secondaryColor: '#3b82f6', // Lighter blue
120
+ organizationName: 'Demo Client',
121
+ organizationId: 'demo-client'
122
+ });
123
+ }
124
+ // Add more organization-specific configs as needed
125
+
126
+ } catch (error) {
127
+ console.error('Failed to load whitelabel config:', error);
128
+ // Fallback to defaults already set
129
+ }
130
+ }
131
+
132
+ /**
133
+ * Update config dynamically (e.g., when user switches organizations)
134
+ */
135
+ updateConfig(updates: Partial<WhitelabelConfig>) {
136
+ this.initialize(updates);
137
+ }
138
+
139
+ /**
140
+ * Update only the brand colors
141
+ */
142
+ updateColors(primaryColor: string, secondaryColor: string) {
143
+ this._config.update(current => ({
144
+ ...current,
145
+ primaryColor,
146
+ secondaryColor
147
+ }));
148
+ }
149
+
150
+ /**
151
+ * Reset to default configuration
152
+ */
153
+ resetToDefault() {
154
+ this._config.set(DEFAULT_CONFIG);
155
+ }
156
+
157
+ /**
158
+ * Apply colors to CSS custom properties
159
+ * This updates the actual CSS variables used throughout the app
160
+ */
161
+ private applyColors(primaryColor: string, secondaryColor: string) {
162
+ if (typeof document !== 'undefined') {
163
+ const root = document.documentElement;
164
+ root.style.setProperty('--color-background-brand', primaryColor);
165
+ root.style.setProperty('--color-brand-secondary', secondaryColor);
166
+
167
+ console.log('Applied whitelabel colors:', { primaryColor, secondaryColor });
168
+ }
169
+ }
170
+ }
171
+