inviton-powerduck 0.0.209 → 0.0.211

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.
@@ -1,6 +1,6 @@
1
- export const SKILIFT_SVG: string = `
2
- <svg version="1.0" xmlns="http://www.w3.org/2000/svg" width="512.000000pt" height="512.000000pt" viewBox="0 0 512.000000 512.000000" preserveAspectRatio="xMidYMid meet">
3
- <g transform="translate(0.000000,512.000000) scale(0.100000,-0.100000)" fill="currentColor" stroke="none">
4
- <path d="M3911 4254 l-1153 -354 -40 34 c-77 66 -211 76 -290 20 -57 -40 -107 -107 -114 -153 l-6 -38 -1127 -345 -1126 -345 -3 -103 c-2 -94 -1 -102 15 -98 10 3 529 161 1154 353 l1135 347 43 -28 42 -29 -5 -55 c-2 -30 -21 -279 -42 -552 l-38 -498 -360 0 c-200 0 -390 -5 -426 -11 -173 -27 -319 -153 -371 -320 -18 -56 -19 -99 -19 -594 0 -495 1 -538 19 -594 50 -161 183 -281 350 -317 98 -20 1924 -20 2022 0 167 36 300 156 350 317 18 56 19 99 19 588 0 444 -2 536 -16 586 -44 170 -197 307 -374 335 -36 5 -227 10 -426 10 l-360 0 -38 498 c-21 273 -40 522 -43 552 -5 53 -4 56 25 73 40 23 72 69 93 131 l17 49 153 48 c85 26 309 95 499 153 852 260 1595 488 1598 490 1 2 1 48 0 103 l-3 100 -1154 -353z m-1913 -2666 l2 -358 -260 0 -260 0 0 353 c0 195 3 357 7 361 4 3 119 5 257 4 l251 -3 3 -357z m820 0 l2 -358 -260 0 -260 0 0 353 c0 195 3 357 7 361 4 3 119 5 257 4 l251 -3 3 -357z m820 0 l2 -358 -260 0 -260 0 0 353 c0 195 3 357 7 361 4 3 119 5 257 4 l251 -3 3 -357z"/>
5
- </g>
6
- </svg>`;
1
+ export const SKILIFT_SVG: string = `
2
+ <svg version="1.0" xmlns="http://www.w3.org/2000/svg" width="512.000000pt" height="512.000000pt" viewBox="0 0 512.000000 512.000000" preserveAspectRatio="xMidYMid meet">
3
+ <g transform="translate(0.000000,512.000000) scale(0.100000,-0.100000)" fill="currentColor" stroke="none">
4
+ <path d="M3911 4254 l-1153 -354 -40 34 c-77 66 -211 76 -290 20 -57 -40 -107 -107 -114 -153 l-6 -38 -1127 -345 -1126 -345 -3 -103 c-2 -94 -1 -102 15 -98 10 3 529 161 1154 353 l1135 347 43 -28 42 -29 -5 -55 c-2 -30 -21 -279 -42 -552 l-38 -498 -360 0 c-200 0 -390 -5 -426 -11 -173 -27 -319 -153 -371 -320 -18 -56 -19 -99 -19 -594 0 -495 1 -538 19 -594 50 -161 183 -281 350 -317 98 -20 1924 -20 2022 0 167 36 300 156 350 317 18 56 19 99 19 588 0 444 -2 536 -16 586 -44 170 -197 307 -374 335 -36 5 -227 10 -426 10 l-360 0 -38 498 c-21 273 -40 522 -43 552 -5 53 -4 56 25 73 40 23 72 69 93 131 l17 49 153 48 c85 26 309 95 499 153 852 260 1595 488 1598 490 1 2 1 48 0 103 l-3 100 -1154 -353z m-1913 -2666 l2 -358 -260 0 -260 0 0 353 c0 195 3 357 7 361 4 3 119 5 257 4 l251 -3 3 -357z m820 0 l2 -358 -260 0 -260 0 0 353 c0 195 3 357 7 361 4 3 119 5 257 4 l251 -3 3 -357z m820 0 l2 -358 -260 0 -260 0 0 353 c0 195 3 357 7 361 4 3 119 5 257 4 l251 -3 3 -357z"/>
5
+ </g>
6
+ </svg>`;
@@ -11,7 +11,6 @@ export enum NotificationType {
11
11
  Success = 'success',
12
12
  Warning = 'warning',
13
13
  Danger = 'danger',
14
- Error = 'danger',
15
14
  }
16
15
 
17
16
  export enum NotificationIcon {
@@ -119,6 +118,13 @@ interface NotificationDisplayArgs {
119
118
  */
120
119
  containerClass?: string;
121
120
  };
121
+
122
+ /**
123
+ * Optional custom template passed directly to bootstrap-notify.
124
+ * When not provided, a default template is used.
125
+ */
126
+ template?: string | ((containerClass: string) => string);
127
+
122
128
  }
123
129
 
124
130
  const isMobileViewport = (): boolean => typeof window !== 'undefined' && window.innerWidth < 768;
@@ -184,6 +190,18 @@ const NotificationUtils = (() => {
184
190
  <a href="{3}" target="{4}" data-notify="url"></a>
185
191
  </div>`.replace(/\s{2,}/g, ' ').trim();
186
192
 
193
+ const resolveTemplate = (args: NotificationDisplayArgs, containerClass: string): string => {
194
+ if (typeof args.template === 'string') {
195
+ return args.template;
196
+ }
197
+
198
+ if (typeof args.template === 'function') {
199
+ return args.template(containerClass);
200
+ }
201
+
202
+ return buildTemplate(containerClass);
203
+ };
204
+
187
205
  const show = (
188
206
  messageOrArgs: string | NotificationDisplayArgs,
189
207
  icon?: string,
@@ -213,6 +231,8 @@ const NotificationUtils = (() => {
213
231
  }
214
232
  : undefined;
215
233
 
234
+ const template = resolveTemplate(args, containerClass);
235
+
216
236
  (jQuery as any).notify({
217
237
  icon: args.icon,
218
238
  message: args.messageHtml,
@@ -230,7 +250,7 @@ const NotificationUtils = (() => {
230
250
  exit: args.animation?.exit || defaultExitAnimation,
231
251
  },
232
252
  offset: offsetOptions,
233
- template: buildTemplate(containerClass),
253
+ template,
234
254
  onShow: onShowHandler,
235
255
  });
236
256
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "inviton-powerduck",
3
3
  "type": "module",
4
- "version": "0.0.209",
4
+ "version": "0.0.211",
5
5
  "files": [
6
6
  "app/",
7
7
  "common/",