sample-piral 1.0.2-beta.5733 → 1.1.0-beta.5752

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/app/index.d.ts CHANGED
@@ -256,7 +256,7 @@ export interface PiletNotificationsApi {
256
256
  * @param options The options to consider for showing the notification.
257
257
  * @returns A callback to trigger closing the notification.
258
258
  */
259
- showNotification(content: string | React.ReactElement<any, any> | AnyComponent<NotificationComponentProps>, options?: NotificationOptions): Disposable;
259
+ showNotification<TType extends keyof PiralNotificationTypes = "info">(content: string | React.ReactElement<any, any> | AnyComponent<NotificationComponentProps<TType>>, options?: NotificationOptions<TType>): Disposable;
260
260
  }
261
261
 
262
262
  export interface PiletModalsApi {
@@ -482,9 +482,9 @@ export interface MenuSettings extends PiralCustomMenuSettings {
482
482
  type?: MenuType;
483
483
  }
484
484
 
485
- export type NotificationComponentProps = BaseComponentProps & BareNotificationProps;
485
+ export type NotificationComponentProps<TType extends keyof PiralNotificationTypes> = BaseComponentProps & BareNotificationProps<TType>;
486
486
 
487
- export interface NotificationOptions extends PiralCustomNotificationOptions {
487
+ export interface NotificationOptions<TType extends keyof PiralNotificationTypes> extends PiralCustomNotificationOptions {
488
488
  /**
489
489
  * The title of the notification, if any.
490
490
  */
@@ -498,7 +498,30 @@ export interface NotificationOptions extends PiralCustomNotificationOptions {
498
498
  * The type of the notification used when displaying the message.
499
499
  * By default info is used.
500
500
  */
501
- type?: "info" | "success" | "warning" | "error";
501
+ type?: TType;
502
+ /**
503
+ * The extra options to specify, if any.
504
+ */
505
+ extra?: PiralNotificationTypes[TType];
506
+ }
507
+
508
+ export interface PiralNotificationTypes extends PiralCustomNotificationTypes {
509
+ /**
510
+ * The info type. No extra options.
511
+ */
512
+ info: void;
513
+ /**
514
+ * The success type. No extra options.
515
+ */
516
+ success: void;
517
+ /**
518
+ * The warning type. No extra options.
519
+ */
520
+ warning: void;
521
+ /**
522
+ * The error type. No extra options.
523
+ */
524
+ error: void;
502
525
  }
503
526
 
504
527
  export type ModalOptions<T> = T extends keyof PiralModalsMap ? PiralModalsMap[T] & BaseModalOptions : T extends string ? BaseModalOptions : T;
@@ -751,7 +774,7 @@ export interface PiralCustomMenuSettings {}
751
774
 
752
775
  export type MenuType = StandardMenuType | keyof PiralCustomMenuTypes;
753
776
 
754
- export interface BareNotificationProps {
777
+ export interface BareNotificationProps<TType extends keyof PiralNotificationTypes = any> {
755
778
  /**
756
779
  * Callback for closing the notification programmatically.
757
780
  */
@@ -759,11 +782,13 @@ export interface BareNotificationProps {
759
782
  /**
760
783
  * Provides the passed in options for this particular notification.
761
784
  */
762
- options: NotificationOptions;
785
+ options: NotificationOptions<TType>;
763
786
  }
764
787
 
765
788
  export interface PiralCustomNotificationOptions {}
766
789
 
790
+ export interface PiralCustomNotificationTypes {}
791
+
767
792
  export interface BaseModalOptions {}
768
793
 
769
794
  export interface PiralModalsMap extends PiralCustomModalsMap {}
package/app/index.html CHANGED
@@ -5,7 +5,7 @@
5
5
  <title>Piral Sample</title>
6
6
  <link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
7
7
 
8
- <script defer src="/index.6d58ea.js"></script></head>
8
+ <script defer src="/index.0dafac.js"></script></head>
9
9
  <body>
10
10
  <div id="app">
11
11
  <div class="pi-center">
package/app/index.js CHANGED
@@ -2,7 +2,7 @@ if (process.env.NODE_ENV === 'test') {
2
2
  // behavior for the test environment, we'll try to make it work
3
3
 
4
4
  if (typeof window !== 'undefined') {
5
- require('.//index.6d58ea.js');
5
+ require('.//index.0dafac.js');
6
6
  const ctx = window['dbg:piral'];
7
7
  const dependencies = (ctx && ctx.pilets && ctx.pilets.getDependencies({})) || {};
8
8
  module.exports = dependencies['sample-piral'] || {};
package/files.tar CHANGED
Binary file
package/files_once.tar CHANGED
Binary file
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sample-piral",
3
3
  "description": "Example project illustrating the use of the piral and piral-cli packages.",
4
- "version": "1.0.2-beta.5733",
4
+ "version": "1.1.0-beta.5752",
5
5
  "license": "MIT",
6
6
  "homepage": "https://piral.io",
7
7
  "keywords": [
@@ -31,7 +31,7 @@
31
31
  "files": []
32
32
  },
33
33
  "piralCLI": {
34
- "version": "1.0.2-beta.5733",
34
+ "version": "1.1.0-beta.5752",
35
35
  "generated": true
36
36
  },
37
37
  "main": "./app/index.js",
@@ -43,14 +43,14 @@
43
43
  "@types/react-dom": "^18.0.0",
44
44
  "@types/react-router": "^5.1.8",
45
45
  "@types/react-router-dom": "^5.1.6",
46
- "piral-cli": "^1.0.2-beta.5733",
47
- "piral-cli-webpack5": "^1.0.2-beta.5733",
46
+ "piral-cli": "^1.1.0-beta.5752",
47
+ "piral-cli-webpack5": "^1.1.0-beta.5752",
48
48
  "sass": "^1.17.0",
49
49
  "bootstrap": "^4.3.1",
50
- "piral": "^1.0.2-beta.5733",
51
- "piral-auth": "^1.0.2-beta.5733",
52
- "piral-hooks-utils": "^1.0.2-beta.5733",
53
- "piral-search": "^1.0.2-beta.5733",
50
+ "piral": "^1.1.0-beta.5752",
51
+ "piral-auth": "^1.1.0-beta.5752",
52
+ "piral-hooks-utils": "^1.0.2",
53
+ "piral-search": "^1.1.0-beta.5752",
54
54
  "reactstrap": "8.10.1",
55
55
  "tslib": "2.5.2",
56
56
  "react": "18.2.0",