@malto/sdk 0.1.2 → 0.1.3

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/index.d.cts CHANGED
@@ -1,6 +1,9 @@
1
1
  type SdkMode = "bubble" | "modal" | "inline" | "trigger";
2
2
  type SdkPosition = "bottom-right" | "bottom-left" | "top-right" | "top-left";
3
+ /** Server-side feature catalog. Reflects what the API may enable on a board. */
3
4
  type SdkFeature = "submit" | "vote" | "list" | "comment" | "roadmap" | "changelog";
5
+ /** Tabs the widget renders. Fixed surface — only roadmap, submit and changelog. */
6
+ type SdkTab = "roadmap" | "submit" | "changelog";
4
7
  type IdentifyPayload = {
5
8
  externalUserId: string;
6
9
  email: string;
@@ -31,7 +34,8 @@ type MaltoConfig = {
31
34
  /** Color scheme. "auto" follows OS preference. */
32
35
  appearance?: "light" | "dark" | "auto";
33
36
  zIndex?: number;
34
- views?: SdkFeature[];
37
+ /** Subset of tabs to expose. Defaults to all three. Other values are rejected at the type level. */
38
+ views?: SdkTab[];
35
39
  identify?: IdentifyPayload;
36
40
  target?: string | HTMLElement;
37
41
  onReady?: () => void;
@@ -74,8 +78,17 @@ type FeedbackItem = {
74
78
  title: string;
75
79
  description: string | null;
76
80
  status: string;
81
+ category?: string | null;
77
82
  votes: number;
83
+ commentCount?: number;
78
84
  createdAt: string;
85
+ /** Public URL for this request on the malto-web board, pre-built by the API. */
86
+ url?: string | null;
87
+ author?: {
88
+ id: string;
89
+ name: string;
90
+ avatarUrl: string | null;
91
+ } | null;
79
92
  hasVoted?: boolean;
80
93
  };
81
94
  type CommentItem = {
@@ -158,8 +171,14 @@ declare class MaltoWidget {
158
171
  private trigger;
159
172
  private board;
160
173
  private state;
174
+ private shellEl;
175
+ private bodyEl;
176
+ private tabRefs;
177
+ private bannerEl;
178
+ private initialLoaded;
161
179
  constructor(config: MaltoConfig);
162
180
  mount(): Promise<void>;
181
+ private ensureInitialLoad;
163
182
  unmount(): void;
164
183
  open(): void;
165
184
  close(): void;
@@ -169,23 +188,24 @@ declare class MaltoWidget {
169
188
  private buildBubble;
170
189
  private resolveTarget;
171
190
  private render;
172
- private buildPanelBody;
191
+ private buildShell;
192
+ private refreshShell;
173
193
  private buildHeader;
174
194
  private buildTabs;
175
195
  private tabBtn;
176
196
  private go;
177
197
  private allowedViews;
178
198
  private buildView;
179
- private viewList;
180
199
  private feedbackRow;
181
200
  private viewSubmit;
182
201
  private viewAuth;
183
202
  private viewRoadmap;
203
+ private feedbackCard;
204
+ private skeletonCards;
184
205
  private viewChangelog;
185
206
  private viewDetail;
186
207
  private skeletonList;
187
208
  private emptyState;
188
- private loadFeedbacks;
189
209
  private loadRoadmap;
190
210
  private loadReleases;
191
211
  private loadComments;
@@ -199,4 +219,4 @@ declare function identify(payload: IdentifyPayload): void;
199
219
  declare function reset(apiKey: string): void;
200
220
  declare function destroy(): void;
201
221
 
202
- export { type BoardInfo, type BoardResponse, type CommentItem, type FeedbackItem, type IdentifyPayload, MaltoApiError, MaltoClient, type MaltoConfig, type MaltoCssVars, MaltoWidget, type ReleaseItem, type SdkFeature, type SdkMode, type SdkPosition, type SessionResponse, type WidgetSettings, close, destroy, identify, init, open, reset };
222
+ export { type BoardInfo, type BoardResponse, type CommentItem, type FeedbackItem, type IdentifyPayload, MaltoApiError, MaltoClient, type MaltoConfig, type MaltoCssVars, MaltoWidget, type ReleaseItem, type SdkFeature, type SdkMode, type SdkPosition, type SdkTab, type SessionResponse, type WidgetSettings, close, destroy, identify, init, open, reset };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,9 @@
1
1
  type SdkMode = "bubble" | "modal" | "inline" | "trigger";
2
2
  type SdkPosition = "bottom-right" | "bottom-left" | "top-right" | "top-left";
3
+ /** Server-side feature catalog. Reflects what the API may enable on a board. */
3
4
  type SdkFeature = "submit" | "vote" | "list" | "comment" | "roadmap" | "changelog";
5
+ /** Tabs the widget renders. Fixed surface — only roadmap, submit and changelog. */
6
+ type SdkTab = "roadmap" | "submit" | "changelog";
4
7
  type IdentifyPayload = {
5
8
  externalUserId: string;
6
9
  email: string;
@@ -31,7 +34,8 @@ type MaltoConfig = {
31
34
  /** Color scheme. "auto" follows OS preference. */
32
35
  appearance?: "light" | "dark" | "auto";
33
36
  zIndex?: number;
34
- views?: SdkFeature[];
37
+ /** Subset of tabs to expose. Defaults to all three. Other values are rejected at the type level. */
38
+ views?: SdkTab[];
35
39
  identify?: IdentifyPayload;
36
40
  target?: string | HTMLElement;
37
41
  onReady?: () => void;
@@ -74,8 +78,17 @@ type FeedbackItem = {
74
78
  title: string;
75
79
  description: string | null;
76
80
  status: string;
81
+ category?: string | null;
77
82
  votes: number;
83
+ commentCount?: number;
78
84
  createdAt: string;
85
+ /** Public URL for this request on the malto-web board, pre-built by the API. */
86
+ url?: string | null;
87
+ author?: {
88
+ id: string;
89
+ name: string;
90
+ avatarUrl: string | null;
91
+ } | null;
79
92
  hasVoted?: boolean;
80
93
  };
81
94
  type CommentItem = {
@@ -158,8 +171,14 @@ declare class MaltoWidget {
158
171
  private trigger;
159
172
  private board;
160
173
  private state;
174
+ private shellEl;
175
+ private bodyEl;
176
+ private tabRefs;
177
+ private bannerEl;
178
+ private initialLoaded;
161
179
  constructor(config: MaltoConfig);
162
180
  mount(): Promise<void>;
181
+ private ensureInitialLoad;
163
182
  unmount(): void;
164
183
  open(): void;
165
184
  close(): void;
@@ -169,23 +188,24 @@ declare class MaltoWidget {
169
188
  private buildBubble;
170
189
  private resolveTarget;
171
190
  private render;
172
- private buildPanelBody;
191
+ private buildShell;
192
+ private refreshShell;
173
193
  private buildHeader;
174
194
  private buildTabs;
175
195
  private tabBtn;
176
196
  private go;
177
197
  private allowedViews;
178
198
  private buildView;
179
- private viewList;
180
199
  private feedbackRow;
181
200
  private viewSubmit;
182
201
  private viewAuth;
183
202
  private viewRoadmap;
203
+ private feedbackCard;
204
+ private skeletonCards;
184
205
  private viewChangelog;
185
206
  private viewDetail;
186
207
  private skeletonList;
187
208
  private emptyState;
188
- private loadFeedbacks;
189
209
  private loadRoadmap;
190
210
  private loadReleases;
191
211
  private loadComments;
@@ -199,4 +219,4 @@ declare function identify(payload: IdentifyPayload): void;
199
219
  declare function reset(apiKey: string): void;
200
220
  declare function destroy(): void;
201
221
 
202
- export { type BoardInfo, type BoardResponse, type CommentItem, type FeedbackItem, type IdentifyPayload, MaltoApiError, MaltoClient, type MaltoConfig, type MaltoCssVars, MaltoWidget, type ReleaseItem, type SdkFeature, type SdkMode, type SdkPosition, type SessionResponse, type WidgetSettings, close, destroy, identify, init, open, reset };
222
+ export { type BoardInfo, type BoardResponse, type CommentItem, type FeedbackItem, type IdentifyPayload, MaltoApiError, MaltoClient, type MaltoConfig, type MaltoCssVars, MaltoWidget, type ReleaseItem, type SdkFeature, type SdkMode, type SdkPosition, type SdkTab, type SessionResponse, type WidgetSettings, close, destroy, identify, init, open, reset };