@finsemble/finsemble-ui 8.2.1 → 8.3.0-beta.1

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 (145) hide show
  1. package/clients/Interop/FinsembleDesktopAgent.d.ts +63 -19
  2. package/clients/Interop/FinsembleDesktopAgent.d.ts.map +1 -1
  3. package/clients/Interop/FinsembleDesktopAgent.js +522 -125
  4. package/clients/Interop/FinsembleDesktopAgent.js.map +1 -1
  5. package/clients/Interop/InteropAdmin.d.ts +1 -1
  6. package/clients/Interop/InteropAdmin.d.ts.map +1 -1
  7. package/clients/Interop/InteropAdmin.js.map +1 -1
  8. package/clients/Interop/types.d.ts +112 -11
  9. package/clients/Interop/types.d.ts.map +1 -1
  10. package/clients/Interop/types.js.map +1 -1
  11. package/clients/Startup/FSBLDesktop.d.ts +7 -1
  12. package/clients/Startup/FSBLDesktop.d.ts.map +1 -1
  13. package/clients/Startup/FSBLDesktop.js +13 -2
  14. package/clients/Startup/FSBLDesktop.js.map +1 -1
  15. package/clients/Startup/FSBLFreestanding.d.ts.map +1 -1
  16. package/clients/Startup/FSBLFreestanding.js +5 -2
  17. package/clients/Startup/FSBLFreestanding.js.map +1 -1
  18. package/clients/Startup/FSBLService.d.ts.map +1 -1
  19. package/clients/Startup/FSBLService.js +1 -0
  20. package/clients/Startup/FSBLService.js.map +1 -1
  21. package/clients/Startup/types.d.ts +7 -2
  22. package/clients/Startup/types.d.ts.map +1 -1
  23. package/clients/configClient.js +1 -1
  24. package/clients/configClient.js.map +1 -1
  25. package/common/FinsembleWindow.d.ts +3 -1
  26. package/common/FinsembleWindow.d.ts.map +1 -1
  27. package/common/FinsembleWindow.js +66 -31
  28. package/common/FinsembleWindow.js.map +1 -1
  29. package/common/configUtil.d.ts +9 -0
  30. package/common/configUtil.d.ts.map +1 -1
  31. package/common/configUtil.js +15 -0
  32. package/common/configUtil.js.map +1 -1
  33. package/common/redux/createReducer.js +1 -1
  34. package/common/redux/createReducer.js.map +1 -1
  35. package/common/redux/remoteReduxEnhancer.js +2 -2
  36. package/common/redux/remoteReduxEnhancer.js.map +1 -1
  37. package/deprecated/dragAndDropClient.d.ts.map +1 -1
  38. package/deprecated/dragAndDropClient.js +1 -8
  39. package/deprecated/dragAndDropClient.js.map +1 -1
  40. package/index.d.ts +2 -0
  41. package/index.d.ts.map +1 -1
  42. package/index.js +2 -0
  43. package/index.js.map +1 -1
  44. package/package.json +1 -1
  45. package/platform/services/Interop/modules/actions.d.ts +2 -1
  46. package/platform/services/Interop/modules/actions.d.ts.map +1 -1
  47. package/platform/services/Interop/modules/actions.js.map +1 -1
  48. package/platform/services/Interop/modules/types.d.ts +3 -1
  49. package/platform/services/Interop/modules/types.d.ts.map +1 -1
  50. package/platform/services/Interop/types.d.ts +116 -15
  51. package/platform/services/Interop/types.d.ts.map +1 -1
  52. package/platform/services/Interop/types.js +1 -1
  53. package/platform/services/Interop/types.js.map +1 -1
  54. package/platform/services/window/types.d.ts +3 -3
  55. package/platform/services/window/types.d.ts.map +1 -1
  56. package/react/assets/css/core/windowFrame.css +13 -4
  57. package/react/components/appCatalog/components/AppResults.js +1 -1
  58. package/react/components/appCatalog/components/AppResults.js.map +1 -1
  59. package/react/components/appCatalog/components/Showcase/Header.js +1 -1
  60. package/react/components/appCatalog/components/Showcase/Header.js.map +1 -1
  61. package/react/components/common/Dropdown.d.ts +15 -0
  62. package/react/components/common/Dropdown.d.ts.map +1 -0
  63. package/react/components/common/Dropdown.js +83 -0
  64. package/react/components/common/Dropdown.js.map +1 -0
  65. package/react/components/common/FinsembleToggleButtonBar.d.ts +1 -0
  66. package/react/components/common/FinsembleToggleButtonBar.d.ts.map +1 -1
  67. package/react/components/common/FinsembleToggleButtonBar.js +21 -18
  68. package/react/components/common/FinsembleToggleButtonBar.js.map +1 -1
  69. package/react/components/common/css/FinsembleToggle.css +4 -0
  70. package/react/components/common/css/dropdown.css +56 -0
  71. package/react/components/fdc3Resolver/ResolverContainer.d.ts.map +1 -1
  72. package/react/components/fdc3Resolver/ResolverContainer.js +78 -1
  73. package/react/components/fdc3Resolver/ResolverContainer.js.map +1 -1
  74. package/react/components/fdc3Resolver/ResolverDialog.css +60 -103
  75. package/react/components/fdc3Resolver/ResolverDialog.d.ts +4 -2
  76. package/react/components/fdc3Resolver/ResolverDialog.d.ts.map +1 -1
  77. package/react/components/fdc3Resolver/ResolverDialog.js +113 -69
  78. package/react/components/fdc3Resolver/ResolverDialog.js.map +1 -1
  79. package/react/components/toolbar/advancedAppLauncher/stores/StoreActions.js +1 -1
  80. package/react/components/toolbar/advancedAppLauncher/stores/StoreActions.js.map +1 -1
  81. package/react/components/toolbar/appLauncher/components/componentList.js +2 -2
  82. package/react/components/toolbar/appLauncher/components/componentList.js.map +1 -1
  83. package/react/components/userPreferences/components/content/Workspaces.js +1 -1
  84. package/react/components/userPreferences/components/content/Workspaces.js.map +1 -1
  85. package/react/components/windowTitleBar/components/windowTitle.js +4 -5
  86. package/react/components/windowTitleBar/components/windowTitle.js.map +1 -1
  87. package/typedefs/FDC3/api/AppIdentifier.d.ts +18 -0
  88. package/typedefs/FDC3/api/AppIdentifier.d.ts.map +1 -0
  89. package/typedefs/FDC3/api/AppIdentifier.js +6 -0
  90. package/typedefs/FDC3/api/AppIdentifier.js.map +1 -0
  91. package/typedefs/FDC3/api/AppIntent.d.ts +3 -1
  92. package/typedefs/FDC3/api/AppIntent.d.ts.map +1 -1
  93. package/typedefs/FDC3/api/AppIntent.js +1 -1
  94. package/typedefs/FDC3/api/AppMetadata.d.ts +22 -9
  95. package/typedefs/FDC3/api/AppMetadata.d.ts.map +1 -1
  96. package/typedefs/FDC3/api/AppMetadata.js +1 -1
  97. package/typedefs/FDC3/api/Channel.d.ts +8 -7
  98. package/typedefs/FDC3/api/Channel.d.ts.map +1 -1
  99. package/typedefs/FDC3/api/Channel.js +1 -1
  100. package/typedefs/FDC3/api/ContextMetadata.d.ts +19 -0
  101. package/typedefs/FDC3/api/ContextMetadata.d.ts.map +1 -0
  102. package/typedefs/FDC3/api/ContextMetadata.js +6 -0
  103. package/typedefs/FDC3/api/ContextMetadata.js.map +1 -0
  104. package/typedefs/FDC3/api/DesktopAgent.d.ts +387 -75
  105. package/typedefs/FDC3/api/DesktopAgent.d.ts.map +1 -1
  106. package/typedefs/FDC3/api/DesktopAgent.js +1 -1
  107. package/typedefs/FDC3/api/DisplayMetadata.d.ts +1 -1
  108. package/typedefs/FDC3/api/DisplayMetadata.js +1 -1
  109. package/typedefs/FDC3/api/Errors.d.ts +28 -2
  110. package/typedefs/FDC3/api/Errors.d.ts.map +1 -1
  111. package/typedefs/FDC3/api/Errors.js +28 -1
  112. package/typedefs/FDC3/api/Errors.js.map +1 -1
  113. package/typedefs/FDC3/api/Icon.d.ts +13 -0
  114. package/typedefs/FDC3/api/Icon.d.ts.map +1 -0
  115. package/typedefs/FDC3/api/Icon.js +6 -0
  116. package/typedefs/FDC3/api/Icon.js.map +1 -0
  117. package/typedefs/FDC3/api/Image.d.ts +15 -0
  118. package/typedefs/FDC3/api/Image.d.ts.map +1 -0
  119. package/typedefs/FDC3/api/Image.js +6 -0
  120. package/typedefs/FDC3/api/Image.js.map +1 -0
  121. package/typedefs/FDC3/api/ImplementationMetadata.d.ts +4 -1
  122. package/typedefs/FDC3/api/ImplementationMetadata.d.ts.map +1 -1
  123. package/typedefs/FDC3/api/ImplementationMetadata.js +1 -1
  124. package/typedefs/FDC3/api/IntentMetadata.d.ts +1 -1
  125. package/typedefs/FDC3/api/IntentMetadata.js +1 -1
  126. package/typedefs/FDC3/api/IntentResolution.d.ts +48 -10
  127. package/typedefs/FDC3/api/IntentResolution.d.ts.map +1 -1
  128. package/typedefs/FDC3/api/IntentResolution.js +1 -1
  129. package/typedefs/FDC3/api/Listener.d.ts +1 -1
  130. package/typedefs/FDC3/api/Listener.js +1 -1
  131. package/typedefs/FDC3/api/PrivateChannel.d.ts +54 -0
  132. package/typedefs/FDC3/api/PrivateChannel.d.ts.map +1 -0
  133. package/typedefs/FDC3/api/PrivateChannel.js +6 -0
  134. package/typedefs/FDC3/api/PrivateChannel.js.map +1 -0
  135. package/typedefs/FDC3/api/Types.d.ts +25 -4
  136. package/typedefs/FDC3/api/Types.d.ts.map +1 -1
  137. package/typedefs/FDC3/api/Types.js +1 -1
  138. package/typedefs/FDC3/api/index.d.ts +13 -0
  139. package/typedefs/FDC3/api/index.d.ts.map +1 -0
  140. package/typedefs/FDC3/api/index.js +13 -0
  141. package/typedefs/FDC3/api/index.js.map +1 -0
  142. package/react/components/common/FinsembleSelect.d.ts +0 -14
  143. package/react/components/common/FinsembleSelect.d.ts.map +0 -1
  144. package/react/components/common/FinsembleSelect.js +0 -62
  145. package/react/components/common/FinsembleSelect.js.map +0 -1
@@ -1,21 +1,47 @@
1
1
  /**
2
2
  * SPDX-License-Identifier: Apache-2.0
3
- * Copyright 2019 FINOS FDC3 contributors - see NOTICE file
3
+ * Copyright FINOS FDC3 contributors - see NOTICE file
4
4
  */
5
+ /** Constants representing the errors that can be encountered when calling the `open` method on the DesktopAgent object (`fdc3`). */
5
6
  export declare enum OpenError {
7
+ /** Returned if the specified application is not found.*/
6
8
  AppNotFound = "AppNotFound",
9
+ /** Returned if the specified application fails to launch correctly.*/
7
10
  ErrorOnLaunch = "ErrorOnLaunch",
11
+ /** Returned if the specified application launches but fails to add a context listener in order to receive the context passed to the `fdc3.open` call.*/
8
12
  AppTimeout = "AppTimeout",
13
+ /** Returned if the FDC3 desktop agent implementation is not currently able to handle the request.*/
9
14
  ResolverUnavailable = "ResolverUnavailable"
10
15
  }
16
+ /** Constants representing the errors that can be encountered when calling the `findIntent`, `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the DesktopAgent (`fdc3`). */
11
17
  export declare enum ResolveError {
18
+ /** SHOULD be returned if no apps are available that can resolve the intent and context combination.*/
12
19
  NoAppsFound = "NoAppsFound",
20
+ /** Returned if the FDC3 desktop agent implementation is not currently able to handle the request.*/
13
21
  ResolverUnavailable = "ResolverUnavailable",
14
- ResolverTimeout = "ResolverTimeout"
22
+ /** Returned if the user cancelled the resolution request, for example by closing or cancelling a resolver UI.*/
23
+ UserCancelled = "UserCancelledResolution",
24
+ /** SHOULD be returned if a timeout cancels an intent resolution that required user interaction. Please use `ResolverUnavailable` instead for situations where a resolver UI or similar fails.*/
25
+ ResolverTimeout = "ResolverTimeout",
26
+ /** Returned if a specified target application is not available or a new instance of it cannot be opened. */
27
+ TargetAppUnavailable = "TargetAppUnavailable",
28
+ /** Returned if a specified target application instance is not available, for example because it has been closed. */
29
+ TargetInstanceUnavailable = "TargetInstanceUnavailable",
30
+ /** Returned if the intent and context could not be delivered to the selected application or instance, for example because it has not added an intent handler within a timeout.*/
31
+ IntentDeliveryFailed = "IntentDeliveryFailed"
32
+ }
33
+ export declare enum ResultError {
34
+ /** Returned if the intent handler exited without returning a Promise or that Promise was not resolved with a Context or Channel object. */
35
+ NoResultReturned = "NoResultReturned",
36
+ /** Returned if the Intent handler function processing the raised intent throws an error or rejects the Promise it returned. */
37
+ IntentHandlerRejected = "IntentHandlerRejected"
15
38
  }
16
39
  export declare enum ChannelError {
40
+ /** Returned if the specified channel is not found when attempting to join a channel via the `joinUserChannel` function of the DesktopAgent (`fdc3`).*/
17
41
  NoChannelFound = "NoChannelFound",
42
+ /** SHOULD be returned when a request to join a user channel or to a retrieve a Channel object via the `joinUserChannel` or `getOrCreateChannel` methods of the DesktopAgent (`fdc3`) object is denied. */
18
43
  AccessDenied = "AccessDenied",
44
+ /** SHOULD be returned when a channel cannot be created or retrieved via the `getOrCreateChannel` method of the DesktopAgent (`fdc3`).*/
19
45
  CreationFailed = "CreationFailed"
20
46
  }
21
47
  //# sourceMappingURL=Errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Errors.d.ts","sourceRoot":"","sources":["../../../../../src/typedefs/FDC3/api/Errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,oBAAY,SAAS;IACpB,WAAW,gBAAgB;IAC3B,aAAa,kBAAkB;IAC/B,UAAU,eAAe;IACzB,mBAAmB,wBAAwB;CAC3C;AAED,oBAAY,YAAY;IACvB,WAAW,gBAAgB;IAC3B,mBAAmB,wBAAwB;IAC3C,eAAe,oBAAoB;CACnC;AAED,oBAAY,YAAY;IACvB,cAAc,mBAAmB;IACjC,YAAY,iBAAiB;IAC7B,cAAc,mBAAmB;CACjC"}
1
+ {"version":3,"file":"Errors.d.ts","sourceRoot":"","sources":["../../../../../src/typedefs/FDC3/api/Errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,oIAAoI;AACpI,oBAAY,SAAS;IACpB,yDAAyD;IACzD,WAAW,gBAAgB;IAC3B,sEAAsE;IACtE,aAAa,kBAAkB;IAC/B,wJAAwJ;IACxJ,UAAU,eAAe;IACzB,oGAAoG;IACpG,mBAAmB,wBAAwB;CAC3C;AAED,sMAAsM;AACtM,oBAAY,YAAY;IACvB,sGAAsG;IACtG,WAAW,gBAAgB;IAC3B,oGAAoG;IACpG,mBAAmB,wBAAwB;IAC3C,gHAAgH;IAChH,aAAa,4BAA4B;IACzC,gMAAgM;IAChM,eAAe,oBAAoB;IACnC,4GAA4G;IAC5G,oBAAoB,yBAAyB;IAC7C,oHAAoH;IACpH,yBAAyB,8BAA8B;IACvD,iLAAiL;IACjL,oBAAoB,yBAAyB;CAC7C;AAED,oBAAY,WAAW;IACtB,2IAA2I;IAC3I,gBAAgB,qBAAqB;IACrC,+HAA+H;IAC/H,qBAAqB,0BAA0B;CAC/C;AAED,oBAAY,YAAY;IACvB,wJAAwJ;IACxJ,cAAc,mBAAmB;IACjC,0MAA0M;IAC1M,YAAY,iBAAiB;IAC7B,wIAAwI;IACxI,cAAc,mBAAmB;CACjC"}
@@ -1,24 +1,51 @@
1
1
  /**
2
2
  * SPDX-License-Identifier: Apache-2.0
3
- * Copyright 2019 FINOS FDC3 contributors - see NOTICE file
3
+ * Copyright FINOS FDC3 contributors - see NOTICE file
4
4
  */
5
+ /** Constants representing the errors that can be encountered when calling the `open` method on the DesktopAgent object (`fdc3`). */
5
6
  export var OpenError;
6
7
  (function (OpenError) {
8
+ /** Returned if the specified application is not found.*/
7
9
  OpenError["AppNotFound"] = "AppNotFound";
10
+ /** Returned if the specified application fails to launch correctly.*/
8
11
  OpenError["ErrorOnLaunch"] = "ErrorOnLaunch";
12
+ /** Returned if the specified application launches but fails to add a context listener in order to receive the context passed to the `fdc3.open` call.*/
9
13
  OpenError["AppTimeout"] = "AppTimeout";
14
+ /** Returned if the FDC3 desktop agent implementation is not currently able to handle the request.*/
10
15
  OpenError["ResolverUnavailable"] = "ResolverUnavailable";
11
16
  })(OpenError || (OpenError = {}));
17
+ /** Constants representing the errors that can be encountered when calling the `findIntent`, `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the DesktopAgent (`fdc3`). */
12
18
  export var ResolveError;
13
19
  (function (ResolveError) {
20
+ /** SHOULD be returned if no apps are available that can resolve the intent and context combination.*/
14
21
  ResolveError["NoAppsFound"] = "NoAppsFound";
22
+ /** Returned if the FDC3 desktop agent implementation is not currently able to handle the request.*/
15
23
  ResolveError["ResolverUnavailable"] = "ResolverUnavailable";
24
+ /** Returned if the user cancelled the resolution request, for example by closing or cancelling a resolver UI.*/
25
+ ResolveError["UserCancelled"] = "UserCancelledResolution";
26
+ /** SHOULD be returned if a timeout cancels an intent resolution that required user interaction. Please use `ResolverUnavailable` instead for situations where a resolver UI or similar fails.*/
16
27
  ResolveError["ResolverTimeout"] = "ResolverTimeout";
28
+ /** Returned if a specified target application is not available or a new instance of it cannot be opened. */
29
+ ResolveError["TargetAppUnavailable"] = "TargetAppUnavailable";
30
+ /** Returned if a specified target application instance is not available, for example because it has been closed. */
31
+ ResolveError["TargetInstanceUnavailable"] = "TargetInstanceUnavailable";
32
+ /** Returned if the intent and context could not be delivered to the selected application or instance, for example because it has not added an intent handler within a timeout.*/
33
+ ResolveError["IntentDeliveryFailed"] = "IntentDeliveryFailed";
17
34
  })(ResolveError || (ResolveError = {}));
35
+ export var ResultError;
36
+ (function (ResultError) {
37
+ /** Returned if the intent handler exited without returning a Promise or that Promise was not resolved with a Context or Channel object. */
38
+ ResultError["NoResultReturned"] = "NoResultReturned";
39
+ /** Returned if the Intent handler function processing the raised intent throws an error or rejects the Promise it returned. */
40
+ ResultError["IntentHandlerRejected"] = "IntentHandlerRejected";
41
+ })(ResultError || (ResultError = {}));
18
42
  export var ChannelError;
19
43
  (function (ChannelError) {
44
+ /** Returned if the specified channel is not found when attempting to join a channel via the `joinUserChannel` function of the DesktopAgent (`fdc3`).*/
20
45
  ChannelError["NoChannelFound"] = "NoChannelFound";
46
+ /** SHOULD be returned when a request to join a user channel or to a retrieve a Channel object via the `joinUserChannel` or `getOrCreateChannel` methods of the DesktopAgent (`fdc3`) object is denied. */
21
47
  ChannelError["AccessDenied"] = "AccessDenied";
48
+ /** SHOULD be returned when a channel cannot be created or retrieved via the `getOrCreateChannel` method of the DesktopAgent (`fdc3`).*/
22
49
  ChannelError["CreationFailed"] = "CreationFailed";
23
50
  })(ChannelError || (ChannelError = {}));
24
51
  //# sourceMappingURL=Errors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Errors.js","sourceRoot":"","sources":["../../../../../src/typedefs/FDC3/api/Errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,CAAN,IAAY,SAKX;AALD,WAAY,SAAS;IACpB,wCAA2B,CAAA;IAC3B,4CAA+B,CAAA;IAC/B,sCAAyB,CAAA;IACzB,wDAA2C,CAAA;AAC5C,CAAC,EALW,SAAS,KAAT,SAAS,QAKpB;AAED,MAAM,CAAN,IAAY,YAIX;AAJD,WAAY,YAAY;IACvB,2CAA2B,CAAA;IAC3B,2DAA2C,CAAA;IAC3C,mDAAmC,CAAA;AACpC,CAAC,EAJW,YAAY,KAAZ,YAAY,QAIvB;AAED,MAAM,CAAN,IAAY,YAIX;AAJD,WAAY,YAAY;IACvB,iDAAiC,CAAA;IACjC,6CAA6B,CAAA;IAC7B,iDAAiC,CAAA;AAClC,CAAC,EAJW,YAAY,KAAZ,YAAY,QAIvB"}
1
+ {"version":3,"file":"Errors.js","sourceRoot":"","sources":["../../../../../src/typedefs/FDC3/api/Errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,oIAAoI;AACpI,MAAM,CAAN,IAAY,SASX;AATD,WAAY,SAAS;IACpB,yDAAyD;IACzD,wCAA2B,CAAA;IAC3B,sEAAsE;IACtE,4CAA+B,CAAA;IAC/B,wJAAwJ;IACxJ,sCAAyB,CAAA;IACzB,oGAAoG;IACpG,wDAA2C,CAAA;AAC5C,CAAC,EATW,SAAS,KAAT,SAAS,QASpB;AAED,sMAAsM;AACtM,MAAM,CAAN,IAAY,YAeX;AAfD,WAAY,YAAY;IACvB,sGAAsG;IACtG,2CAA2B,CAAA;IAC3B,oGAAoG;IACpG,2DAA2C,CAAA;IAC3C,gHAAgH;IAChH,yDAAyC,CAAA;IACzC,gMAAgM;IAChM,mDAAmC,CAAA;IACnC,4GAA4G;IAC5G,6DAA6C,CAAA;IAC7C,oHAAoH;IACpH,uEAAuD,CAAA;IACvD,iLAAiL;IACjL,6DAA6C,CAAA;AAC9C,CAAC,EAfW,YAAY,KAAZ,YAAY,QAevB;AAED,MAAM,CAAN,IAAY,WAKX;AALD,WAAY,WAAW;IACtB,2IAA2I;IAC3I,oDAAqC,CAAA;IACrC,+HAA+H;IAC/H,8DAA+C,CAAA;AAChD,CAAC,EALW,WAAW,KAAX,WAAW,QAKtB;AAED,MAAM,CAAN,IAAY,YAOX;AAPD,WAAY,YAAY;IACvB,wJAAwJ;IACxJ,iDAAiC,CAAA;IACjC,0MAA0M;IAC1M,6CAA6B,CAAA;IAC7B,wIAAwI;IACxI,iDAAiC,CAAA;AAClC,CAAC,EAPW,YAAY,KAAZ,YAAY,QAOvB"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * SPDX-License-Identifier: Apache-2.0
3
+ * Copyright FINOS FDC3 contributors - see NOTICE file
4
+ */
5
+ export interface Icon {
6
+ /** The icon url */
7
+ readonly src: string;
8
+ /** The icon dimension, formatted as `<height>x<width>`. */
9
+ readonly size?: string;
10
+ /** Icon media type. If not present the Desktop Agent may use the src file extension. */
11
+ readonly type?: string;
12
+ }
13
+ //# sourceMappingURL=Icon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../../../src/typedefs/FDC3/api/Icon.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,IAAI;IACpB,mBAAmB;IACnB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAErB,2DAA2D;IAC3D,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB,wFAAwF;IACxF,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACvB"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * SPDX-License-Identifier: Apache-2.0
3
+ * Copyright FINOS FDC3 contributors - see NOTICE file
4
+ */
5
+ export {};
6
+ //# sourceMappingURL=Icon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Icon.js","sourceRoot":"","sources":["../../../../../src/typedefs/FDC3/api/Icon.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * SPDX-License-Identifier: Apache-2.0
3
+ * Copyright FINOS FDC3 contributors - see NOTICE file
4
+ */
5
+ export interface Image {
6
+ /** The image url. */
7
+ readonly src: string;
8
+ /** The image dimension, formatted as `<height>x<width>`. */
9
+ readonly size?: string;
10
+ /** Image media type. If not present the Desktop Agent may use the src file extension. */
11
+ readonly type?: string;
12
+ /** Caption for the image. */
13
+ readonly label?: string;
14
+ }
15
+ //# sourceMappingURL=Image.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../../../../../src/typedefs/FDC3/api/Image.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,KAAK;IACrB,qBAAqB;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAErB,4DAA4D;IAC5D,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB,yFAAyF;IACzF,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB,6BAA6B;IAC7B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACxB"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * SPDX-License-Identifier: Apache-2.0
3
+ * Copyright FINOS FDC3 contributors - see NOTICE file
4
+ */
5
+ export {};
6
+ //# sourceMappingURL=Image.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Image.js","sourceRoot":"","sources":["../../../../../src/typedefs/FDC3/api/Image.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * SPDX-License-Identifier: Apache-2.0
3
- * Copyright 2021 FINOS FDC3 contributors - see NOTICE file
3
+ * Copyright FINOS FDC3 contributors - see NOTICE file
4
4
  */
5
+ import { AppMetadata } from "./AppMetadata";
5
6
  /**
6
7
  * Metadata relating to the FDC3 Desktop Agent implementation and its provider.
7
8
  */
@@ -14,5 +15,7 @@ export interface ImplementationMetadata {
14
15
  readonly provider: string;
15
16
  /** The version of the provider of the FDC3 Desktop Agent Implementation (e.g. 5.3.0). */
16
17
  readonly providerVersion?: string;
18
+ /** The calling application instance's own metadata, according to the Desktop Agent (MUST include at least the `appId` and `instanceId`). */
19
+ readonly appMetadata: AppMetadata;
17
20
  }
18
21
  //# sourceMappingURL=ImplementationMetadata.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ImplementationMetadata.d.ts","sourceRoot":"","sources":["../../../../../src/typedefs/FDC3/api/ImplementationMetadata.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACtC;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAE7B,gHAAgH;IAChH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B,yFAAyF;IACzF,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;CAClC"}
1
+ {"version":3,"file":"ImplementationMetadata.d.ts","sourceRoot":"","sources":["../../../../../src/typedefs/FDC3/api/ImplementationMetadata.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACtC;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAE7B,gHAAgH;IAChH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B,yFAAyF;IACzF,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAElC,4IAA4I;IAC5I,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;CAClC"}
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * SPDX-License-Identifier: Apache-2.0
3
- * Copyright 2021 FINOS FDC3 contributors - see NOTICE file
3
+ * Copyright FINOS FDC3 contributors - see NOTICE file
4
4
  */
5
5
  export {};
6
6
  //# sourceMappingURL=ImplementationMetadata.js.map
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * SPDX-License-Identifier: Apache-2.0
3
- * Copyright 2019 FINOS FDC3 contributors - see NOTICE file
3
+ * Copyright FINOS FDC3 contributors - see NOTICE file
4
4
  */
5
5
  /**
6
6
  * Intent descriptor
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * SPDX-License-Identifier: Apache-2.0
3
- * Copyright 2019 FINOS FDC3 contributors - see NOTICE file
3
+ * Copyright FINOS FDC3 contributors - see NOTICE file
4
4
  */
5
5
  export {};
6
6
  //# sourceMappingURL=IntentMetadata.js.map
@@ -1,25 +1,63 @@
1
1
  /**
2
2
  * SPDX-License-Identifier: Apache-2.0
3
- * Copyright 2019 FINOS FDC3 contributors - see NOTICE file
3
+ * Copyright FINOS FDC3 contributors - see NOTICE file
4
4
  */
5
- import { TargetApp } from "./Types";
5
+ import { IntentResult } from "./Types";
6
+ import { AppMetadata } from "./AppMetadata";
6
7
  /**
7
8
  * IntentResolution provides a standard format for data returned upon resolving an intent.
8
9
  * ```javascript
9
10
  * //resolve a "Chain" type intent
10
- * var intentR = await agent.raiseIntent("intentName", context);
11
- * //resolve a "Client-Service" type intent with data response
12
- * var intentR = await agent.raiseIntent("intentName", context);
13
- * var dataR = intentR.data;
11
+ * let resolution = await agent.raiseIntent("intentName", context);
12
+ *
13
+ * //resolve a "Client-Service" type intent with a data response or a Channel
14
+ * let resolution = await agent.raiseIntent("intentName", context);
15
+ * try {
16
+ * const result = await resolution.getResult();
17
+ * if (result && result.broadcast) {
18
+ * console.log(`${resolution.source} returned a channel with id ${result.id}`);
19
+ * } else if (result){
20
+ * console.log(`${resolution.source} returned data: ${JSON.stringify(result)}`);
21
+ * } else {
22
+ * console.error(`${resolution.source} didn't return data`
23
+ * }
24
+ * } catch(error) {
25
+ * console.error(`${resolution.source} returned an error: ${error}`);
26
+ * }
27
+ * // Use metadata about the resolving app instance to target a further intent
28
+ * await agent.raiseIntent("intentName", context, resolution.source);
14
29
  * ```
15
30
  */
16
31
  export interface IntentResolution {
17
- readonly source: TargetApp;
32
+ /**
33
+ * Metadata about the app instance that was selected (or started) to resolve the intent.
34
+ * `source.instanceId` MUST be set, indicating the specific app instance that
35
+ * received the intent.
36
+ */
37
+ readonly source: AppMetadata;
38
+ /**
39
+ * The intent that was raised. May be used to determine which intent the user
40
+ * chose in response to `fdc3.raiseIntentForContext()`.
41
+ */
18
42
  readonly intent: string;
19
43
  /**
20
- * @deprecated not assignable from intent listeners
44
+ * The version number of the Intents schema being used.
45
+ */
46
+ readonly version?: string;
47
+ /**
48
+ * Retrieves a promise that will resolve to either `Context` data returned
49
+ * by the application that resolves the raised intent or a `Channel`
50
+ * established and returned by the app resolving the intent.
51
+ *
52
+ * A `Channel` returned will often be of the `PrivateChannel` type. The
53
+ * client can then `addContextListener()` on that channel to, for example,
54
+ * receive a stream of data.
55
+ *
56
+ * The promise MUST reject with a string from the `ResultError` enumeration
57
+ * if an error is thrown by the intent handler, it rejects the returned
58
+ * promise, it does not return a promise or the promise resolves to an
59
+ * object of an invalid type.
21
60
  */
22
- readonly data?: object;
23
- readonly version: string;
61
+ getResult(): Promise<IntentResult>;
24
62
  }
25
63
  //# sourceMappingURL=IntentResolution.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"IntentResolution.d.ts","sourceRoot":"","sources":["../../../../../src/typedefs/FDC3/api/IntentResolution.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC;;;;;;;;;GASG;AACH,MAAM,WAAW,gBAAgB;IAChC,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CACzB"}
1
+ {"version":3,"file":"IntentResolution.d.ts","sourceRoot":"","sources":["../../../../../src/typedefs/FDC3/api/IntentResolution.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,WAAW,gBAAgB;IAChC;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;;;;;;;;;;OAaG;IACH,SAAS,IAAI,OAAO,CAAC,YAAY,CAAC,CAAC;CACnC"}
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * SPDX-License-Identifier: Apache-2.0
3
- * Copyright 2019 FINOS FDC3 contributors - see NOTICE file
3
+ * Copyright FINOS FDC3 contributors - see NOTICE file
4
4
  */
5
5
  export {};
6
6
  //# sourceMappingURL=IntentResolution.js.map
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * SPDX-License-Identifier: Apache-2.0
3
- * Copyright 2019 FINOS FDC3 contributors - see NOTICE file
3
+ * Copyright FINOS FDC3 contributors - see NOTICE file
4
4
  */
5
5
  export interface Listener {
6
6
  /**
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * SPDX-License-Identifier: Apache-2.0
3
- * Copyright 2019 FINOS FDC3 contributors - see NOTICE file
3
+ * Copyright FINOS FDC3 contributors - see NOTICE file
4
4
  */
5
5
  export {};
6
6
  //# sourceMappingURL=Listener.js.map
@@ -0,0 +1,54 @@
1
+ /**
2
+ * SPDX-License-Identifier: Apache-2.0
3
+ * Copyright 2021 FINOS FDC3 contributors - see NOTICE file
4
+ */
5
+ import { Listener } from "./Listener";
6
+ import { Channel } from "./Channel";
7
+ /**
8
+ * Object representing a private context channel, which is intended to support
9
+ * secure communication between applications, and extends the Channel interface
10
+ * with event handlers which provide information on the connection state of both
11
+ * parties, ensuring that desktop agents do not need to queue or retain messages
12
+ * that are broadcast before a context listener is added and that applications
13
+ * are able to stop broadcasting messages when the other party has disconnected.
14
+ *
15
+ * It is intended that Desktop Agent implementations:
16
+ * - SHOULD restrict external apps from listening or publishing on this channel.
17
+ * - MUST prevent private channels from being retrieved via fdc3.getOrCreateChannel.
18
+ * - MUST provide the `id` value for the channel as required by the Channel interface.
19
+ */
20
+ export interface PrivateChannel extends Channel {
21
+ /**
22
+ * Adds a listener that will be called each time that the remote app invokes
23
+ * addContextListener on this channel.
24
+ *
25
+ * Desktop Agents MUST call this for each invocation of addContextListener on this
26
+ * channel, including those that occurred before this handler was registered
27
+ * (to prevent race conditions).
28
+ */
29
+ onAddContextListener(handler: (contextType?: string) => void): Listener;
30
+ /**
31
+ * Adds a listener that will be called whenever the remote app invokes
32
+ * Listener.unsubscribe() on a context listener that it previously added.
33
+ *
34
+ * Desktop Agents MUST call this when disconnect() is called by the other party, for
35
+ * each listner that they had added.
36
+ */
37
+ onUnsubscribe(handler: (contextType?: string) => void): Listener;
38
+ /**
39
+ * Adds a listener that will be called when the remote app terminates, for example
40
+ * when its window is closed or because disconnect was called. This is in addition
41
+ * to calls that will be made to onUnsubscribe listeners.
42
+ */
43
+ onDisconnect(handler: () => void): Listener;
44
+ /**
45
+ * May be called to indicate that a participant will no longer interact with this channel.
46
+ *
47
+ * After this function has been called, Desktop Agents SHOULD prevent apps from broadcasting
48
+ * on this channel and MUST automatically call Listener.unsubscribe() for each listener that
49
+ * they've added (causing any onUnsubscribe handler added by the other party to be called)
50
+ * before triggering any onDisconnect handler added by the other party.
51
+ */
52
+ disconnect(): void;
53
+ }
54
+ //# sourceMappingURL=PrivateChannel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PrivateChannel.d.ts","sourceRoot":"","sources":["../../../../../src/typedefs/FDC3/api/PrivateChannel.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,cAAe,SAAQ,OAAO;IAC9C;;;;;;;OAOG;IACH,oBAAoB,CAAC,OAAO,EAAE,CAAC,WAAW,CAAC,EAAE,MAAM,KAAK,IAAI,GAAG,QAAQ,CAAC;IAExE;;;;;;OAMG;IACH,aAAa,CAAC,OAAO,EAAE,CAAC,WAAW,CAAC,EAAE,MAAM,KAAK,IAAI,GAAG,QAAQ,CAAC;IAEjE;;;;OAIG;IACH,YAAY,CAAC,OAAO,EAAE,MAAM,IAAI,GAAG,QAAQ,CAAC;IAE5C;;;;;;;OAOG;IACH,UAAU,IAAI,IAAI,CAAC;CACnB"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * SPDX-License-Identifier: Apache-2.0
3
+ * Copyright 2021 FINOS FDC3 contributors - see NOTICE file
4
+ */
5
+ export {};
6
+ //# sourceMappingURL=PrivateChannel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PrivateChannel.js","sourceRoot":"","sources":["../../../../../src/typedefs/FDC3/api/PrivateChannel.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
@@ -1,9 +1,30 @@
1
1
  /**
2
2
  * SPDX-License-Identifier: Apache-2.0
3
- * Copyright 2019 FINOS FDC3 contributors - see NOTICE file
3
+ * Copyright FINOS FDC3 contributors - see NOTICE file
4
4
  */
5
- import { AppMetadata } from "..";
5
+ import { Channel, ContextMetadata } from "./";
6
6
  import { Context } from "../context/ContextTypes";
7
- export declare type TargetApp = string | AppMetadata;
8
- export declare type ContextHandler = (context: Context) => void;
7
+ /**
8
+ * Describes a callback that handles a context event.
9
+ * Used when attaching listeners for context broadcasts.
10
+ *
11
+ * Optional metadata about the context message, including the app that originated
12
+ * the message, SHOULD be provided by the desktop agent implementation.
13
+ */
14
+ export declare type ContextHandler = (context: Context, metadata?: ContextMetadata) => void;
15
+ /**
16
+ * Intents can return results that are either context data objects
17
+ * or a reference to a Channel.
18
+ */
19
+ export declare type IntentResult = Context | Channel;
20
+ /**
21
+ * Describes a callback that handles a context event and may return a
22
+ * promise of a Context or Channel object to be returned to the
23
+ * application that raised the intent.
24
+ * Used when attaching listeners for raised intents.
25
+ *
26
+ * Optional metadata about the raised intent, including the app that originated
27
+ * the message, SHOULD be provided by the desktop agent implementation.
28
+ */
29
+ export declare type IntentHandler = (context: Context, metadata?: ContextMetadata) => Promise<IntentResult> | void;
9
30
  //# sourceMappingURL=Types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Types.d.ts","sourceRoot":"","sources":["../../../../../src/typedefs/FDC3/api/Types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAElD,oBAAY,SAAS,GAAG,MAAM,GAAG,WAAW,CAAC;AAC7C,oBAAY,cAAc,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC"}
1
+ {"version":3,"file":"Types.d.ts","sourceRoot":"","sources":["../../../../../src/typedefs/FDC3/api/Types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAElD;;;;;;GAMG;AACH,oBAAY,cAAc,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,eAAe,KAAK,IAAI,CAAC;AACpF;;;GAGG;AACH,oBAAY,YAAY,GAAG,OAAO,GAAG,OAAO,CAAC;AAC7C;;;;;;;;GAQG;AACH,oBAAY,aAAa,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,eAAe,KAAK,OAAO,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC"}
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * SPDX-License-Identifier: Apache-2.0
3
- * Copyright 2019 FINOS FDC3 contributors - see NOTICE file
3
+ * Copyright FINOS FDC3 contributors - see NOTICE file
4
4
  */
5
5
  export {};
6
6
  //# sourceMappingURL=Types.js.map
@@ -0,0 +1,13 @@
1
+ export * from "./AppIntent";
2
+ export * from "./AppMetadata";
3
+ export * from "./Channel";
4
+ export * from "./ContextMetadata";
5
+ export * from "./DesktopAgent";
6
+ export * from "./DisplayMetadata";
7
+ export * from "./Errors";
8
+ export * from "./ImplementationMetadata";
9
+ export * from "./IntentMetadata";
10
+ export * from "./IntentResolution";
11
+ export * from "./Listener";
12
+ export * from "./Types";
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/typedefs/FDC3/api/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC"}
@@ -0,0 +1,13 @@
1
+ export * from "./AppIntent";
2
+ export * from "./AppMetadata";
3
+ export * from "./Channel";
4
+ export * from "./ContextMetadata";
5
+ export * from "./DesktopAgent";
6
+ export * from "./DisplayMetadata";
7
+ export * from "./Errors";
8
+ export * from "./ImplementationMetadata";
9
+ export * from "./IntentMetadata";
10
+ export * from "./IntentResolution";
11
+ export * from "./Listener";
12
+ export * from "./Types";
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/typedefs/FDC3/api/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC"}
@@ -1,14 +0,0 @@
1
- import { ReactNode } from "react";
2
- import "./css/selector.css";
3
- export interface FinsembleSelectProps {
4
- options: string[];
5
- optionComponents?: ReactNode[];
6
- values?: string[];
7
- selected?: string[];
8
- size?: number;
9
- updateCallback: (selectedValues: string[]) => void;
10
- showSearch?: boolean;
11
- limit?: number;
12
- }
13
- export declare const FinsembleSelect: ({ options, optionComponents, updateCallback, selected, size, values, showSearch, limit, }: FinsembleSelectProps) => JSX.Element;
14
- //# sourceMappingURL=FinsembleSelect.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FinsembleSelect.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/common/FinsembleSelect.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAY,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,oBAAoB,CAAC;AAc5B,MAAM,WAAW,oBAAoB;IACpC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,gBAAgB,CAAC,EAAE,SAAS,EAAE,CAAC;IAC/B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,CAAC,cAAc,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACnD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,eAAe,8FASzB,oBAAoB,gBAuFtB,CAAC"}
@@ -1,62 +0,0 @@
1
- import React, { useState } from "react";
2
- import "./css/selector.css";
3
- import { FinsembleIcon } from "./FinsembleIcon";
4
- import { FinsembleToggle } from "./FinsembleToggle";
5
- const heightMultiplier = 40; // It works in storybook, but we will probably want a better way of detecting this soon.
6
- const removeItem = (startingArray, removableItem) => {
7
- const removableIndex = startingArray.indexOf(removableItem);
8
- if (removableIndex < 0) {
9
- return startingArray;
10
- }
11
- return startingArray.slice(0, removableIndex).concat(startingArray.slice(removableIndex + 1));
12
- };
13
- export const FinsembleSelect = ({ options, optionComponents, updateCallback, selected = [], size, values = options, showSearch = false, limit = Infinity, }) => {
14
- const mappedOptions = options.map((option, index) => {
15
- return { option, value: values[index] };
16
- });
17
- const [selectedOptions, setSelectedOptions] = useState(selected);
18
- const [displayOptions, setDisplayOptions] = useState(mappedOptions);
19
- // Magic numbers
20
- const height = size ? heightMultiplier * size : "";
21
- // Updating consumer
22
- const doSetSelectedOptions = (opts) => {
23
- if (opts.length > limit) {
24
- opts = opts.slice(limit * -1);
25
- }
26
- if (JSON.stringify(opts) !== JSON.stringify(selectedOptions)) {
27
- updateCallback(opts);
28
- }
29
- setSelectedOptions(opts);
30
- };
31
- // Event handlers
32
- const changeHandler = (e) => {
33
- doSetSelectedOptions(Array.from(e.target.selectedOptions).map((option) => option.value));
34
- };
35
- const updateSearch = (e) => {
36
- // TS doesn't complain if I use .currentTarget, but then I can't use Enzyme to test it, so here we are
37
- const searchString = e.target.value;
38
- setDisplayOptions(mappedOptions
39
- .filter((optionMap) => optionMap.option.toUpperCase().includes(searchString.toUpperCase()))
40
- .map((combination) => {
41
- return Object.assign(Object.assign({}, combination), { option: combination.option.replace(new RegExp(`(${searchString})`, "i"), `<span class="highlight">$1</span>`) });
42
- }));
43
- };
44
- return (React.createElement(React.Fragment, null,
45
- React.createElement("div", { className: "emperorSelectContainer" },
46
- showSearch && (React.createElement(React.Fragment, null,
47
- React.createElement(FinsembleIcon, { className: "searchIcon", icon: "search" }),
48
- React.createElement("input", { type: "text", placeholder: "Search", "aria-label": "search", className: "search", onInput: updateSearch }))),
49
- React.createElement("select", { "aria-hidden": "true", className: "shogunSelect", multiple: true, onChange: changeHandler }, displayOptions.map(({ option, value }, index) => (React.createElement("option", { key: `shogun-option-${index}`, value: value }, option)))),
50
- React.createElement("div", { className: "emperorSelect", style: height === "" ? {} : { height } }, displayOptions.map(({ option, value }, index) => (React.createElement("div", { className: "emperorOption", key: `emperor-option-${index}` },
51
- React.createElement("label", null,
52
- React.createElement(FinsembleToggle, { checked: selectedOptions.includes(value) || selected.includes(value), onChange: () => {
53
- if (selectedOptions.includes(value) || selected.includes(value)) {
54
- doSetSelectedOptions(removeItem(selectedOptions, value));
55
- }
56
- else {
57
- doSetSelectedOptions(selectedOptions.concat([value]));
58
- }
59
- } }),
60
- (optionComponents === null || optionComponents === void 0 ? void 0 : optionComponents[index]) ? (optionComponents === null || optionComponents === void 0 ? void 0 : optionComponents[index]) : (React.createElement("span", { dangerouslySetInnerHTML: { __html: option } }))))))))));
61
- };
62
- //# sourceMappingURL=FinsembleSelect.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FinsembleSelect.js","sourceRoot":"","sources":["../../../../../src/ui/components/common/FinsembleSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAa,MAAM,OAAO,CAAC;AACnD,OAAO,oBAAoB,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,MAAM,gBAAgB,GAAG,EAAE,CAAC,CAAC,wFAAwF;AAErH,MAAM,UAAU,GAAG,CAAC,aAAuB,EAAE,aAAqB,EAAE,EAAE;IACrE,MAAM,cAAc,GAAG,aAAa,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IAC5D,IAAI,cAAc,GAAG,CAAC,EAAE;QACvB,OAAO,aAAa,CAAC;KACrB;IACD,OAAO,aAAa,CAAC,KAAK,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,cAAc,GAAG,CAAC,CAAC,CAAC,CAAC;AAC/F,CAAC,CAAC;AAaF,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAC/B,OAAO,EACP,gBAAgB,EAChB,cAAc,EACd,QAAQ,GAAG,EAAE,EACb,IAAI,EACJ,MAAM,GAAG,OAAO,EAChB,UAAU,GAAG,KAAK,EAClB,KAAK,GAAG,QAAQ,GACM,EAAE,EAAE;IAC1B,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CA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