@finsemble/finsemble-ui 7.2.0-alpha.1 → 7.2.0

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 (59) hide show
  1. package/package.json +6 -6
  2. package/react/components/appCatalog/AppCatalogComponent.d.ts +12 -0
  3. package/react/components/appCatalog/components/AppCard.d.ts +13 -0
  4. package/react/components/appCatalog/components/Carousel.d.ts +5 -0
  5. package/react/components/appCatalog/components/Showcase/AppShowcase.d.ts +9 -0
  6. package/react/components/menu/keyboardNavigation.js.map +1 -1
  7. package/react/components/menu/menuHelpers.d.ts +1 -1
  8. package/react/components/notifications/components/views/CardView.js.map +1 -1
  9. package/react/components/notifications/components/views/ListView.js.map +1 -1
  10. package/react/components/processMonitor/stores/ProcessMonitorStore.d.ts +3 -3
  11. package/react/components/sdd/Appearance.d.ts +1 -13
  12. package/react/components/sdd/Appearance.js +2 -2
  13. package/react/components/sdd/Appearance.js.map +1 -1
  14. package/react/components/sdd/AssetsPage.d.ts +1 -13
  15. package/react/components/sdd/AssetsPage.js +50 -47
  16. package/react/components/sdd/AssetsPage.js.map +1 -1
  17. package/react/components/sdd/SmartDesktopDesigner.d.ts +1 -1
  18. package/react/components/sdd/SmartDesktopDesigner.js +7 -3
  19. package/react/components/sdd/SmartDesktopDesigner.js.map +1 -1
  20. package/react/components/sdd/Themes.d.ts +1 -6
  21. package/react/components/sdd/Themes.js +5 -52
  22. package/react/components/sdd/Themes.js.map +1 -1
  23. package/react/components/sdd/common/fsbl_functions.d.ts +1 -1
  24. package/react/components/sdd/common/views.js +0 -2
  25. package/react/components/sdd/common/views.js.map +1 -1
  26. package/react/components/sdd/css/addApp.css +11 -5
  27. package/react/components/sdd/fixtures/themeProps.d.ts +0 -4
  28. package/react/components/sdd/fixtures/themeProps.js +0 -15
  29. package/react/components/sdd/fixtures/themeProps.js.map +1 -1
  30. package/react/components/sdd/fixtures/views.js +1 -1
  31. package/react/components/sdd/fixtures/views.js.map +1 -1
  32. package/react/components/sdd/smartDesktopClient.d.ts +3 -3
  33. package/react/components/sdd/stories/Appearance.stories.d.ts +1 -1
  34. package/react/components/sdd/stories/Appearance.stories.js +0 -12
  35. package/react/components/sdd/stories/Appearance.stories.js.map +1 -1
  36. package/react/components/sdd/stories/AssetsPage.stories.d.ts +1 -1
  37. package/react/components/sdd/stories/AssetsPage.stories.js +0 -24
  38. package/react/components/sdd/stories/AssetsPage.stories.js.map +1 -1
  39. package/react/components/sdd/stories/SmartDesktopDesigner.stories.d.ts +1 -1
  40. package/react/components/sdd/stories/SmartDesktopDesigner.stories.js +16 -1
  41. package/react/components/sdd/stories/SmartDesktopDesigner.stories.js.map +1 -1
  42. package/react/components/sdd/stories/Themes.stories.d.ts +1 -1
  43. package/react/components/sdd/stories/Themes.stories.js +0 -25
  44. package/react/components/sdd/stories/Themes.stories.js.map +1 -1
  45. package/react/components/toolbar/appLauncher/stores/appLauncherStore.d.ts +2 -2
  46. package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.d.ts +2 -2
  47. package/react/components/userPreferences/components/workspaces/WorkspaceItem.js.map +1 -1
  48. package/react/components/windowTitleBar/WindowTitleBarShell.js +60 -5
  49. package/react/components/windowTitleBar/WindowTitleBarShell.js.map +1 -1
  50. package/react/components/windowTitleBar/components/left/LinkerButtonDeprecated.d.ts +25 -0
  51. package/react/components/windowTitleBar/components/left/LinkerGroupsDeprecated.d.ts +23 -0
  52. package/react/components/windowTitleBar/components/left/ShareButton.d.ts +16 -0
  53. package/react/components/windowTitleBar/components/windowTitle.js +2 -2
  54. package/react/components/windowTitleBar/components/windowTitle.js.map +1 -1
  55. package/react/reducers/smartDesktopDesignerReducer.js +1 -0
  56. package/react/reducers/smartDesktopDesignerReducer.js.map +1 -1
  57. package/react/tsconfig.tsbuildinfo +1 -1
  58. package/react/types/smartDesktopDesignerTypes.d.ts +1 -0
  59. package/react/types/smartDesktopDesignerTypes.js.map +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finsemble/finsemble-ui",
3
- "version": "7.2.0-alpha.1",
3
+ "version": "7.2.0",
4
4
  "description": "Ready-made React components to give you a head-start building your SmartDesktop.",
5
5
  "types": "index.d.ts",
6
6
  "files": [
@@ -29,7 +29,7 @@
29
29
  "build-storybook": "build-storybook"
30
30
  },
31
31
  "dependencies": {
32
- "@finsemble/finsemble-api": "7.2.0-alpha.1",
32
+ "@finsemble/finsemble-api": "7.2.0",
33
33
  "@q42/floating-focus-a11y": "^1.3.3",
34
34
  "@reduxjs/toolkit": "^1.5.0",
35
35
  "@svgr/webpack": "^5.5.0",
@@ -92,13 +92,13 @@
92
92
  "rimraf": "3.0.2",
93
93
  "sinon": "^14.0.0",
94
94
  "ts-mocha": "10.0.0",
95
- "typescript": "4.5.5"
95
+ "typescript": "4.7.3"
96
96
  },
97
97
  "resolutions": {
98
+ "trim-newlines": "4.0.1",
99
+ "nth-check": "2.0.1",
98
100
  "glob-parent": "~5.1.2",
99
- "prismjs": "~1.27.0",
100
- "trim": "~0.0.3",
101
- "ansi-regex": "^5.0.1"
101
+ "trim": "~0.0.3"
102
102
  },
103
103
  "repository": {
104
104
  "type": "git",
@@ -1,5 +1,13 @@
1
1
  export class AppCatalogComponent extends React.Component<any, any, any> {
2
2
  constructor(props: any);
3
+ state: {
4
+ apps: never[];
5
+ isLoading: boolean;
6
+ serverError: boolean;
7
+ installed: never[];
8
+ tags: never[];
9
+ installationActionTaken: null;
10
+ };
3
11
  bindCorrectContext(): void;
4
12
  addedAppsChanged(): void;
5
13
  /**
@@ -62,8 +70,11 @@ export class AppCatalogComponent extends React.Component<any, any, any> {
62
70
  * @memberof AppMarket
63
71
  */
64
72
  getActiveTags(): array;
73
+ UNSAFE_componentWillMount(): void;
65
74
  _asyncAppRequest: Promise<void> | undefined;
66
75
  _asyncTagsRequest: Promise<void> | undefined;
76
+ componentDidMount(): void;
77
+ componentWillUnmount(): void;
67
78
  /**
68
79
  * Returns the activeApp from the Store
69
80
  *
@@ -78,5 +89,6 @@ export class AppCatalogComponent extends React.Component<any, any, any> {
78
89
  * @memberof AppMarket
79
90
  */
80
91
  getFilteredApps(): object;
92
+ render(): JSX.Element;
81
93
  }
82
94
  import React from "react";
@@ -8,6 +8,17 @@ export default AppCard;
8
8
  */
9
9
  declare class AppCard extends React.Component<any, any, any> {
10
10
  constructor(props: any);
11
+ state: {
12
+ checkShown: boolean;
13
+ checkHighlighted: boolean;
14
+ awaitingInstall: boolean;
15
+ toggleCheckAfterAction: boolean;
16
+ titleUnderlined: boolean;
17
+ appName: any;
18
+ id: any;
19
+ entitled: any;
20
+ tags: any;
21
+ };
11
22
  bindCorrectContext(): void;
12
23
  /**
13
24
  * Toggles the highlight state of the check mark for installing an app
@@ -45,6 +56,8 @@ declare class AppCard extends React.Component<any, any, any> {
45
56
  * @param {object} e React Synthetic event
46
57
  */
47
58
  addTag(name: string, e: object): void;
59
+ componentDidMount(): void;
60
+ render(): JSX.Element;
48
61
  footer: HTMLDivElement | null | undefined;
49
62
  tagNamesList: HTMLDivElement | null | undefined;
50
63
  }
@@ -7,6 +7,10 @@
7
7
  */
8
8
  export default class Carousel extends React.Component<any, any, any> {
9
9
  constructor(props: any);
10
+ state: {
11
+ firstIndex: number;
12
+ titleHighlighted: boolean;
13
+ };
10
14
  bindCorrectContext(): void;
11
15
  /**
12
16
  * Pages through the carousel by one card (right)
@@ -33,5 +37,6 @@ export default class Carousel extends React.Component<any, any, any> {
33
37
  * Function to build the items in the carousel
34
38
  */
35
39
  buildCarousel(): any[];
40
+ render(): JSX.Element;
36
41
  }
37
42
  import React from "react";
@@ -1,6 +1,14 @@
1
1
  export default AppShowcase;
2
2
  declare class AppShowcase extends React.Component<any, any, any> {
3
3
  constructor(props: any);
4
+ state: {
5
+ name: any;
6
+ iconUrl: any;
7
+ entitled: any;
8
+ imageIndex: number;
9
+ imageModalOpen: boolean;
10
+ modalImage: null;
11
+ };
4
12
  bindCorrectContext(): void;
5
13
  /**
6
14
  * Pages right through the app's images.
@@ -24,5 +32,6 @@ declare class AppShowcase extends React.Component<any, any, any> {
24
32
  * @param {string} name The tag name
25
33
  */
26
34
  addTag(name: string): void;
35
+ render(): JSX.Element;
27
36
  }
28
37
  import React from "react";
@@ -1 +1 @@
1
- {"version":3,"file":"keyboardNavigation.js","sourceRoot":"","sources":["../../../src/components/menu/keyboardNavigation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,QAAgB,EAAE,YAAoB,YAAY,EAAE,EAAE;IACjG,IAAI,YAAY,GAAW,CAAC,CAAC;IAE7B,IAAI,YAAY,GAAW,CAAC,CAAC,CAAC;IAE9B,IAAI,gBAAgB,CAAC,GAAG,EAAE;QACzB,qDAAqD;QACrD,wDAAwD;QACxD,sDAAsD;QACtD,6CAA6C;QAC7C,YAAY,GAAG,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE;QAClC,SAAS,EAAE,IAAI;QACf,aAAa,EAAE,KAAK;QACpB,OAAO,EAAE,IAAI;KACb,CAAC,CAAC;IAEH;;OAEG;IACH,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,gBAAgB,CAAC,SAAS,CAA4B,CAAC;IAEnG,MAAM,gBAAgB,GAAG,CAAC,KAAa,EAAE,EAAE;QAC1C,MAAM,SAAS,GAAG,WAAW,EAAE,CAAC;QAChC,OAAO,SAAS,CAAC,KAAK,CAAC,CAAC,gBAAgB,CAAC,iBAAiB,CAA4B,CAAC;IACxF,CAAC,CAAC;IAEF;;;OAGG;IACH,MAAM,OAAO,GAAG,CAAC,KAAa,EAAE,EAAE;QACjC,MAAM,SAAS,GAAG,WAAW,EAAE,CAAC;QAEhC,2BAA2B;QAC3B,IAAI,CAAC,SAAS,CAAC,MAAM;YAAE,OAAO;QAE9B,wCAAwC;QACxC,SA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,GAAG,EAAE,GAAG,CAAkB,CAAC;QAEnC,IAAI,GAAG,IAAI,gBAAgB,EAAE;YAC5B,MAAA,gBAAgB,CAAC,GAAoC,CAAC,+CAAtD,gBAAgB,CAA0C,CAAC;YAC3D,CAAC,CAAC,cAAc,EAAE,CAAC;SACnB;IACF,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,gBAAgB,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IAChD,QAAQ,CAAC,gBAAgB,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;AAClD,CAAC,CAAC","sourcesContent":["/**\n * Keyboard navigation allows the end user to navigate through menus using\n * arrow keys and to select items using the enter key.\n *\n * When an element is selected then the keyboard navigation state is reset\n * so that the user will begin again with the first item.\n *\n * @param childWin - Main window or child window reference.\n * @param [className] - Selector of elements to apply navigation on.\n * @example\n * applyMenuKeyboardNavigation(window, \".menu-item\");\n */\nexport const applyMenuKeyboardNavigation = (childWin: Window, className: string = \".menu-item\") => {\n\tlet selectedItem: number = 0;\n\n\tlet selectedIcon: number = -1;\n\n\tnew MutationObserver(() => {\n\t\t// Reset selectedIndex when elements added or removed\n\t\t// from the DOM. The motivation behind this was an issue\n\t\t// with Brad's search menu where the order of focus is\n\t\t// messed up when his list of result changes.\n\t\tselectedItem = 0;\n\t}).observe(childWin.document.body, {\n\t\tchildList: true,\n\t\tcharacterData: false,\n\t\tsubtree: true,\n\t});\n\n\t/**\n\t * Returns list of elements\n\t */\n\tconst getElements = () => childWin.document.querySelectorAll(className) as NodeListOf<HTMLElement>;\n\n\tconst getMenuItemIcons = (index: number) => {\n\t\tconst menuItems = getElements();\n\t\treturn menuItems[index].querySelectorAll(\".menu-item-icon\") as NodeListOf<HTMLElement>;\n\t};\n\n\t/**\n\t * Sets the focus on a menu item\n\t * @param index The index of the menu item in the list\n\t */\n\tconst focusOn = (index: number) => {\n\t\tconst menuItems = getElements();\n\n\t\t// Menu could have no items\n\t\tif (!menuItems.length) return;\n\n\t\t// Focus on element and scroll if needed\n\t\tmenuItems[index].focus();\n\t};\n\n\tconst focusOnFirst = () => {\n\t\tselectedItem = 0;\n\t\tselectedIcon = -1;\n\t\tfocusOn(0);\n\t};\n\n\tconst focusOnLast = () => {\n\t\tselectedIcon = -1;\n\t\tconst { length } = getElements();\n\t\tif (length) {\n\t\t\tselectedItem = length - 1;\n\t\t\tfocusOn(length - 1);\n\t\t}\n\t};\n\n\t/**\n\t * Sets the focus on a menu item's icon\n\t * @param index The index of the menu item in the list\n\t * @param iconIndex The index of the menu item's icon (-1 = menu text, not icon)\n\t */\n\tconst focusOnIcon = (index: number, iconIndex: number) => {\n\t\tconst menuItems = getElements();\n\t\t// Menu could have no items\n\t\tif (!menuItems.length) return;\n\n\t\tconst icons = getMenuItemIcons(index);\n\t\t// Defend against possible js runtime error\n\t\tif (icons.length <= iconIndex) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Focus on menu item text, if relevant\n\t\tif (iconIndex === -1) {\n\t\t\tmenuItems[index].focus();\n\t\t\treturn;\n\t\t}\n\n\t\ticons[iconIndex].focus();\n\t};\n\n\t/**\n\t * Simulates mouse events\n\t */\n\tconst clickOnItem = () => {\n\t\tconst elements = getElements();\n\t\tconst selectedItemElement = elements[selectedItem as any];\n\t\t[\"mousedown\", \"click\", \"mouseup\"].forEach((event) => {\n\t\t\tif (selectedIcon > -1) {\n\t\t\t\tconst icons = getMenuItemIcons(selectedItem as any);\n\t\t\t\tconst selectedIconElement = icons[selectedIcon as any];\n\t\t\t\tif (selectedIconElement) {\n\t\t\t\t\tselectedIconElement.dispatchEvent(\n\t\t\t\t\t\tnew MouseEvent(event, {\n\t\t\t\t\t\t\tview: childWin,\n\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\tcancelable: true,\n\t\t\t\t\t\t\tbuttons: 1,\n\t\t\t\t\t\t})\n\t\t\t\t\t);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (selectedItemElement && selectedItemElement.dispatchEvent) {\n\t\t\t\tselectedItemElement.dispatchEvent(\n\t\t\t\t\tnew MouseEvent(event, {\n\t\t\t\t\t\tview: childWin,\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcancelable: true,\n\t\t\t\t\t\tbuttons: 1,\n\t\t\t\t\t})\n\t\t\t\t);\n\t\t\t}\n\t\t});\n\t};\n\n\t/**\n\t * Invoked when a user presses on the arrow up key\n\t */\n\tconst onArrowUp = () => {\n\t\tselectedIcon = -1;\n\n\t\t// Set the focus on the previous item\n\t\tselectedItem--;\n\t\tif (selectedItem < 0) {\n\t\t\t// If we are back to the begining\n\t\t\t// set the focus on last item\n\t\t\tfocusOnLast();\n\t\t\treturn;\n\t\t}\n\t\tfocusOn(selectedItem);\n\t};\n\n\t/**\n\t * Invoked when user press the arrow down key\n\t */\n\tconst onArrowDown = () => {\n\t\tselectedIcon = -1;\n\n\t\t// The the focus on the next item\n\t\tselectedItem++;\n\t\t// If we reached the end, then go back to first item\n\t\tif (selectedItem === getElements().length) {\n\t\t\tselectedItem = 0;\n\t\t}\n\t\tfocusOn(selectedItem);\n\t};\n\n\t/**\n\t * Invoked when user press the arrow right key\n\t */\n\tconst onArrowRight = () => {\n\t\tconst menuItems = getElements();\n\t\t// Menu could have no items\n\t\tif (!menuItems.length) return;\n\n\t\tconst icons = getMenuItemIcons(selectedItem);\n\t\tif (icons.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tselectedIcon++;\n\t\tif (selectedIcon === icons.length) {\n\t\t\tselectedIcon = -1;\n\t\t}\n\t\tfocusOnIcon(selectedItem, selectedIcon);\n\t};\n\n\t/**\n\t * Invoked when user press the arrow left key\n\t */\n\tconst onArrowLeft = () => {\n\t\tconst menuItems = getElements();\n\t\t// Menu could have no items\n\t\tif (!menuItems.length) return;\n\n\t\tconst icons = getMenuItemIcons(selectedItem);\n\t\tif (icons.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tselectedIcon--;\n\t\tif (selectedIcon === icons.length) {\n\t\t\tselectedIcon = -1;\n\t\t}\n\t\tfocusOnIcon(selectedItem, selectedIcon);\n\t};\n\n\tconst actionDictionary = {\n\t\tArrowDown: onArrowDown,\n\t\tArrowUp: onArrowUp,\n\t\tArrowLeft: onArrowLeft,\n\t\tArrowRight: onArrowRight,\n\t\tEnter: clickOnItem,\n\t\tHome: focusOnFirst,\n\t\tEnd: focusOnLast,\n\t};\n\n\tchildWin.addEventListener(\"keydown\", (e) => {\n\t\tconst { key } = e as KeyboardEvent;\n\n\t\tif (key in actionDictionary) {\n\t\t\tactionDictionary[key as keyof typeof actionDictionary]?.();\n\t\t\te.preventDefault();\n\t\t}\n\t});\n\n\tchildWin.addEventListener(\"blur\", focusOnFirst);\n\tchildWin.addEventListener(\"focus\", focusOnFirst);\n};\n"]}
1
+ {"version":3,"file":"keyboardNavigation.js","sourceRoot":"","sources":["../../../src/components/menu/keyboardNavigation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,QAAgB,EAAE,YAAoB,YAAY,EAAE,EAAE;IACjG,IAAI,YAAY,GAAW,CAAC,CAAC;IAE7B,IAAI,YAAY,GAAW,CAAC,CAAC,CAAC;IAE9B,IAAI,gBAAgB,CAAC,GAAG,EAAE;QACzB,qDAAqD;QACrD,wDAAwD;QACxD,sDAAsD;QACtD,6CAA6C;QAC7C,YAAY,GAAG,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE;QAClC,SAAS,EAAE,IAAI;QACf,aAAa,EAAE,KAAK;QACpB,OAAO,EAAE,IAAI;KACb,CAAC,CAAC;IAEH;;OAEG;IACH,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,gBAAgB,CAAC,SAAS,CAA4B,CAAC;IAEnG,MAAM,gBAAgB,GAAG,CAAC,KAAa,EAAE,EAAE;QAC1C,MAA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,CAAC;IACzC,CAAC,CAAC;IAEF,MAAM,gBAAgB,GAAG;QACxB,SAAS,EAAE,WAAW;QACtB,OAAO,EAAE,SAAS;QAClB,SAAS,EAAE,WAAW;QACtB,UAAU,EAAE,YAAY;QACxB,KAAK,EAAE,WAAW;QAClB,IAAI,EAAE,YAAY;QAClB,GAAG,EAAE,WAAW;KAChB,CAAC;IAEF,QAAQ,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE;;QAC1C,MAAM,EAAE,GAAG,EAAE,GAAG,CAAkB,CAAC;QAEnC,IAAI,GAAG,IAAI,gBAAgB,EAAE;YAC5B,MAAA,gBAAgB,CAAC,GAAoC,CAAC,gEAAI,CAAC;YAC3D,CAAC,CAAC,cAAc,EAAE,CAAC;SACnB;IACF,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,gBAAgB,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IAChD,QAAQ,CAAC,gBAAgB,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;AAClD,CAAC,CAAC","sourcesContent":["/**\n * Keyboard navigation allows the end user to navigate through menus using\n * arrow keys and to select items using the enter key.\n *\n * When an element is selected then the keyboard navigation state is reset\n * so that the user will begin again with the first item.\n *\n * @param childWin - Main window or child window reference.\n * @param [className] - Selector of elements to apply navigation on.\n * @example\n * applyMenuKeyboardNavigation(window, \".menu-item\");\n */\nexport const applyMenuKeyboardNavigation = (childWin: Window, className: string = \".menu-item\") => {\n\tlet selectedItem: number = 0;\n\n\tlet selectedIcon: number = -1;\n\n\tnew MutationObserver(() => {\n\t\t// Reset selectedIndex when elements added or removed\n\t\t// from the DOM. The motivation behind this was an issue\n\t\t// with Brad's search menu where the order of focus is\n\t\t// messed up when his list of result changes.\n\t\tselectedItem = 0;\n\t}).observe(childWin.document.body, {\n\t\tchildList: true,\n\t\tcharacterData: false,\n\t\tsubtree: true,\n\t});\n\n\t/**\n\t * Returns list of elements\n\t */\n\tconst getElements = () => childWin.document.querySelectorAll(className) as NodeListOf<HTMLElement>;\n\n\tconst getMenuItemIcons = (index: number) => {\n\t\tconst menuItems = getElements();\n\t\treturn menuItems[index].querySelectorAll(\".menu-item-icon\") as NodeListOf<HTMLElement>;\n\t};\n\n\t/**\n\t * Sets the focus on a menu item\n\t * @param index The index of the menu item in the list\n\t */\n\tconst focusOn = (index: number) => {\n\t\tconst menuItems = getElements();\n\n\t\t// Menu could have no items\n\t\tif (!menuItems.length) return;\n\n\t\t// Focus on element and scroll if needed\n\t\tmenuItems[index].focus();\n\t};\n\n\tconst focusOnFirst = () => {\n\t\tselectedItem = 0;\n\t\tselectedIcon = -1;\n\t\tfocusOn(0);\n\t};\n\n\tconst focusOnLast = () => {\n\t\tselectedIcon = -1;\n\t\tconst { length } = getElements();\n\t\tif (length) {\n\t\t\tselectedItem = length - 1;\n\t\t\tfocusOn(length - 1);\n\t\t}\n\t};\n\n\t/**\n\t * Sets the focus on a menu item's icon\n\t * @param index The index of the menu item in the list\n\t * @param iconIndex The index of the menu item's icon (-1 = menu text, not icon)\n\t */\n\tconst focusOnIcon = (index: number, iconIndex: number) => {\n\t\tconst menuItems = getElements();\n\t\t// Menu could have no items\n\t\tif (!menuItems.length) return;\n\n\t\tconst icons = getMenuItemIcons(index);\n\t\t// Defend against possible js runtime error\n\t\tif (icons.length <= iconIndex) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Focus on menu item text, if relevant\n\t\tif (iconIndex === -1) {\n\t\t\tmenuItems[index].focus();\n\t\t\treturn;\n\t\t}\n\n\t\ticons[iconIndex].focus();\n\t};\n\n\t/**\n\t * Simulates mouse events\n\t */\n\tconst clickOnItem = () => {\n\t\tconst elements = getElements();\n\t\tconst selectedItemElement = elements[selectedItem as any];\n\t\t[\"mousedown\", \"click\", \"mouseup\"].forEach((event) => {\n\t\t\tif (selectedIcon > -1) {\n\t\t\t\tconst icons = getMenuItemIcons(selectedItem as any);\n\t\t\t\tconst selectedIconElement = icons[selectedIcon as any];\n\t\t\t\tif (selectedIconElement) {\n\t\t\t\t\tselectedIconElement.dispatchEvent(\n\t\t\t\t\t\tnew MouseEvent(event, {\n\t\t\t\t\t\t\tview: childWin,\n\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\tcancelable: true,\n\t\t\t\t\t\t\tbuttons: 1,\n\t\t\t\t\t\t})\n\t\t\t\t\t);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (selectedItemElement && selectedItemElement.dispatchEvent) {\n\t\t\t\tselectedItemElement.dispatchEvent(\n\t\t\t\t\tnew MouseEvent(event, {\n\t\t\t\t\t\tview: childWin,\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcancelable: true,\n\t\t\t\t\t\tbuttons: 1,\n\t\t\t\t\t})\n\t\t\t\t);\n\t\t\t}\n\t\t});\n\t};\n\n\t/**\n\t * Invoked when a user presses on the arrow up key\n\t */\n\tconst onArrowUp = () => {\n\t\tselectedIcon = -1;\n\n\t\t// Set the focus on the previous item\n\t\tselectedItem--;\n\t\tif (selectedItem < 0) {\n\t\t\t// If we are back to the begining\n\t\t\t// set the focus on last item\n\t\t\tfocusOnLast();\n\t\t\treturn;\n\t\t}\n\t\tfocusOn(selectedItem);\n\t};\n\n\t/**\n\t * Invoked when user press the arrow down key\n\t */\n\tconst onArrowDown = () => {\n\t\tselectedIcon = -1;\n\n\t\t// The the focus on the next item\n\t\tselectedItem++;\n\t\t// If we reached the end, then go back to first item\n\t\tif (selectedItem === getElements().length) {\n\t\t\tselectedItem = 0;\n\t\t}\n\t\tfocusOn(selectedItem);\n\t};\n\n\t/**\n\t * Invoked when user press the arrow right key\n\t */\n\tconst onArrowRight = () => {\n\t\tconst menuItems = getElements();\n\t\t// Menu could have no items\n\t\tif (!menuItems.length) return;\n\n\t\tconst icons = getMenuItemIcons(selectedItem);\n\t\tif (icons.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tselectedIcon++;\n\t\tif (selectedIcon === icons.length) {\n\t\t\tselectedIcon = -1;\n\t\t}\n\t\tfocusOnIcon(selectedItem, selectedIcon);\n\t};\n\n\t/**\n\t * Invoked when user press the arrow left key\n\t */\n\tconst onArrowLeft = () => {\n\t\tconst menuItems = getElements();\n\t\t// Menu could have no items\n\t\tif (!menuItems.length) return;\n\n\t\tconst icons = getMenuItemIcons(selectedItem);\n\t\tif (icons.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tselectedIcon--;\n\t\tif (selectedIcon === icons.length) {\n\t\t\tselectedIcon = -1;\n\t\t}\n\t\tfocusOnIcon(selectedItem, selectedIcon);\n\t};\n\n\tconst actionDictionary = {\n\t\tArrowDown: onArrowDown,\n\t\tArrowUp: onArrowUp,\n\t\tArrowLeft: onArrowLeft,\n\t\tArrowRight: onArrowRight,\n\t\tEnter: clickOnItem,\n\t\tHome: focusOnFirst,\n\t\tEnd: focusOnLast,\n\t};\n\n\tchildWin.addEventListener(\"keydown\", (e) => {\n\t\tconst { key } = e as KeyboardEvent;\n\n\t\tif (key in actionDictionary) {\n\t\t\tactionDictionary[key as keyof typeof actionDictionary]?.();\n\t\t\te.preventDefault();\n\t\t}\n\t});\n\n\tchildWin.addEventListener(\"blur\", focusOnFirst);\n\tchildWin.addEventListener(\"focus\", focusOnFirst);\n};\n"]}
@@ -5,7 +5,7 @@
5
5
  * @param menuId The shell ID (e.g. filemenu)
6
6
  * @param menuContentHeight The height of menu contents.
7
7
  */
8
- export declare const calculatePosition: (menuId: string, menuContentHeight?: number | undefined) => Promise<{
8
+ export declare const calculatePosition: (menuId: string, menuContentHeight?: number) => Promise<{
9
9
  top: number;
10
10
  left: number;
11
11
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"CardView.js","sourceRoot":"","sources":["../../../../../src/components/notifications/components/views/CardView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,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CACN,6BAAK,GAAG,EAAE,GAAG;YACX,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI;YAClD,oBAAC,aAAa,IAAC,GAAG,EAAE,GAAG;gBACtB,oBAAC,yBAAyB,IACzB,GAAG,EAAE,YAAY,CAAC,EAAE,EACpB,YAAY,EAAE,YAAY,EAC1B,kBAAkB,EAAE,GAAG,EAAE,GAAE,CAAC,EAC5B,SAAS,EAAE,QAAQ,GAClB,CACa;YAChB,6BAAK,SAAS,EAAC,SAAS,aAAa,CAChC,CACN,CAAC;IACH,CAAC,CAAC,CAAC;IAEL,OAAO,OAAO,CAAC,qBAAqB,EAAE,YAAY,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAC1E,oBAAC,eAAe,OAAG,CACnB,CAAC,CAAC,CAAC,CACH,0CAAG,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,wBAAwB,CAAC,MAAiB,CAAC,CAAC,CAAI,CACtG,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import React, { useContext, useEffect } from \"react\";\nimport { isToday, isYesterday, isThisWeek } from \"date-fns\";\n\n// Types\nimport { NotificationCardViewProps } from \"../../types\";\n\n// Context\nimport { NotificationsContext } from \"../../notificationsContext\";\n\n// Components\nimport { NotificationCardShell } from \"../shared/NotificationCardShell\";\nimport NoNotifications from \"../NoNotifications\";\n\n// Utils\nimport { getActiveFilter, searchNotifications } from \"../../utils\";\n\nimport { services } from \"@finsemble/finsemble-api\";\nimport { ErrorBoundary } from \"../../../common/ErrorBoundary\";\n\ntype INotification = services.notification.types.INotification;\n\nenum Periods {\n\tTODAY = \"today\",\n\tTHIS_WEEK = \"thisWeek\",\n\tYESTERDAY = \"yesterday\",\n\tOLDER = \"older\",\n}\n\nconst isEmpty = (byPeriodNotifications: Record<Periods, INotification[]>, accountForSnooze: boolean) => {\n\tif (accountForSnooze) {\n\t\treturn Object.values(byPeriodNotifications).every((value: INotification[]) => value.length === 0);\n\t} else {\n\t\treturn Object.values(byPeriodNotifications).every(\n\t\t\t(value: INotification[]) =>\n\t\t\t\tvalue.length === 0 || value.filter((notification: INotification) => !notification.isSnoozed).length === 0\n\t\t);\n\t}\n};\n\nexport const CardView: React.FunctionComponent<NotificationCardViewProps> = (props: NotificationCardViewProps) => {\n\tconst { notifications } = props;\n\n\tconst notificationsContext = useContext(NotificationsContext);\n\tconst { drawerControlProps, searchString, filteredNotifications, setFilteredNotifications } = notificationsContext;\n\tconst activeFilter = getActiveFilter(drawerControlProps);\n\n\tconst byPeriodNotifications: Record<Periods, INotification[]> = {\n\t\ttoday: [],\n\t\tyesterday: [],\n\t\tthisWeek: [],\n\t\tolder: [],\n\t};\n\n\tuseEffect(() => {\n\t\tif (searchString === \"\") {\n\t\t\tsetFilteredNotifications(notifications);\n\t\t} else {\n\t\t\tsetFilteredNotifications(searchNotifications(notifications, searchString));\n\t\t}\n\t}, [searchString, notifications]);\n\n\tconst controlFilteredNotifications = activeFilter ? activeFilter.run?.(filteredNotifications) : [];\n\n\tcontrolFilteredNotifications.reduce((accumulator: any, notification: INotification) => {\n\t\tconst notificationDate: number = Date.parse(notification.issuedAt);\n\t\tif (isToday(notificationDate)) {\n\t\t\taccumulator.today.push(notification);\n\t\t} else if (isYesterday(notificationDate)) {\n\t\t\taccumulator.yesterday.push(notification);\n\t\t} else if (isThisWeek(notificationDate)) {\n\t\t\taccumulator.thisWeek.push(notification);\n\t\t} else {\n\t\t\taccumulator.older.push(notification);\n\t\t}\n\t\treturn accumulator;\n\t}, byPeriodNotifications);\n\n\tconst NotificationCardComponent = props.notificationCard ? props.notificationCard : NotificationCardShell;\n\n\tconst renderSeparatorLabel = (period: string) => {\n\t\tif (period === Periods.TODAY) {\n\t\t\treturn <p className=\"notification-day\">Today</p>;\n\t\t} else if (period === Periods.YESTERDAY) {\n\t\t\treturn <p className=\"notification-day\">Yesterday</p>;\n\t\t} else if (period === Periods.THIS_WEEK) {\n\t\t\treturn <p className=\"notification-day\">This Week</p>;\n\t\t} else {\n\t\t\treturn <p className=\"notification-day\">Older</p>;\n\t\t}\n\t};\n\n\tconst renderNotificationsBlock = (period: Periods) =>\n\t\tbyPeriodNotifications[period]\n\t\t\t.sort((a: INotification, b: INotification) => Date.parse(b.issuedAt) - Date.parse(a.issuedAt))\n\t\t\t.filter((notification) => (activeFilter.action === \"snoozed\" ? notification.isSnoozed : !notification.isSnoozed))\n\t\t\t.map((notification, index) => {\n\t\t\t\tconst key = `${index}_${notification.id ? notification.id : notification.issuedAt}`;\n\t\t\t\treturn (\n\t\t\t\t\t<div key={key}>\n\t\t\t\t\t\t{index === 0 ? renderSeparatorLabel(period) : null}\n\t\t\t\t\t\t<ErrorBoundary key={key}>\n\t\t\t\t\t\t\t<NotificationCardComponent\n\t\t\t\t\t\t\t\tkey={notification.id}\n\t\t\t\t\t\t\t\tnotification={notification}\n\t\t\t\t\t\t\t\tremoveNotification={() => {}}\n\t\t\t\t\t\t\t\tuiContext={\"center\"}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t\t<div className=\"divider\">&nbsp;</div>\n\t\t\t\t\t</div>\n\t\t\t\t);\n\t\t\t});\n\n\treturn isEmpty(byPeriodNotifications, activeFilter.action === \"snoozed\") ? (\n\t\t<NoNotifications />\n\t) : (\n\t\t<>{Object.keys(byPeriodNotifications).map((period) => renderNotificationsBlock(period as Periods))}</>\n\t);\n};\n\nexport default CardView;\n"]}
1
+ {"version":3,"file":"CardView.js","sourceRoot":"","sources":["../../../../../src/components/notifications/components/views/CardView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,UAA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KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI;YAClD,oBAAC,aAAa,IAAC,GAAG,EAAE,GAAG;gBACtB,oBAAC,yBAAyB,IACzB,GAAG,EAAE,YAAY,CAAC,EAAE,EACpB,YAAY,EAAE,YAAY,EAC1B,kBAAkB,EAAE,GAAG,EAAE,GAAE,CAAC,EAC5B,SAAS,EAAE,QAAQ,GAClB,CACa;YAChB,6BAAK,SAAS,EAAC,SAAS,aAAa,CAChC,CACN,CAAC;IACH,CAAC,CAAC,CAAC;IAEL,OAAO,OAAO,CAAC,qBAAqB,EAAE,YAAY,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAC1E,oBAAC,eAAe,OAAG,CACnB,CAAC,CAAC,CAAC,CACH,0CAAG,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,wBAAwB,CAAC,MAAiB,CAAC,CAAC,CAAI,CACtG,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import React, { useContext, useEffect } from \"react\";\nimport { isToday, isYesterday, isThisWeek } from \"date-fns\";\n\n// Types\nimport { NotificationCardViewProps } from \"../../types\";\n\n// Context\nimport { NotificationsContext } from \"../../notificationsContext\";\n\n// Components\nimport { NotificationCardShell } from \"../shared/NotificationCardShell\";\nimport NoNotifications from \"../NoNotifications\";\n\n// Utils\nimport { getActiveFilter, searchNotifications } from \"../../utils\";\n\nimport { services } from \"@finsemble/finsemble-api\";\nimport { ErrorBoundary } from \"../../../common/ErrorBoundary\";\n\ntype INotification = services.notification.types.INotification;\n\nenum Periods {\n\tTODAY = \"today\",\n\tTHIS_WEEK = \"thisWeek\",\n\tYESTERDAY = \"yesterday\",\n\tOLDER = \"older\",\n}\n\nconst isEmpty = (byPeriodNotifications: Record<Periods, INotification[]>, accountForSnooze: boolean) => {\n\tif (accountForSnooze) {\n\t\treturn Object.values(byPeriodNotifications).every((value: INotification[]) => value.length === 0);\n\t} else {\n\t\treturn Object.values(byPeriodNotifications).every(\n\t\t\t(value: INotification[]) =>\n\t\t\t\tvalue.length === 0 || value.filter((notification: INotification) => !notification.isSnoozed).length === 0\n\t\t);\n\t}\n};\n\nexport const CardView: React.FunctionComponent<NotificationCardViewProps> = (props: NotificationCardViewProps) => {\n\tconst { notifications } = props;\n\n\tconst notificationsContext = useContext(NotificationsContext);\n\tconst { drawerControlProps, searchString, filteredNotifications, setFilteredNotifications } = notificationsContext;\n\tconst activeFilter = getActiveFilter(drawerControlProps);\n\n\tconst byPeriodNotifications: Record<Periods, INotification[]> = {\n\t\ttoday: [],\n\t\tyesterday: [],\n\t\tthisWeek: [],\n\t\tolder: [],\n\t};\n\n\tuseEffect(() => {\n\t\tif (searchString === \"\") {\n\t\t\tsetFilteredNotifications(notifications);\n\t\t} else {\n\t\t\tsetFilteredNotifications(searchNotifications(notifications, searchString));\n\t\t}\n\t}, [searchString, notifications]);\n\n\tconst controlFilteredNotifications = activeFilter ? activeFilter.run?.(filteredNotifications) : [];\n\n\tcontrolFilteredNotifications.reduce((accumulator: any, notification: INotification) => {\n\t\tconst notificationDate: number = Date.parse(notification.issuedAt);\n\t\tif (isToday(notificationDate)) {\n\t\t\taccumulator.today.push(notification);\n\t\t} else if (isYesterday(notificationDate)) {\n\t\t\taccumulator.yesterday.push(notification);\n\t\t} else if (isThisWeek(notificationDate)) {\n\t\t\taccumulator.thisWeek.push(notification);\n\t\t} else {\n\t\t\taccumulator.older.push(notification);\n\t\t}\n\t\treturn accumulator;\n\t}, byPeriodNotifications);\n\n\tconst NotificationCardComponent = props.notificationCard ? props.notificationCard : NotificationCardShell;\n\n\tconst renderSeparatorLabel = (period: string) => {\n\t\tif (period === Periods.TODAY) {\n\t\t\treturn <p className=\"notification-day\">Today</p>;\n\t\t} else if (period === Periods.YESTERDAY) {\n\t\t\treturn <p className=\"notification-day\">Yesterday</p>;\n\t\t} else if (period === Periods.THIS_WEEK) {\n\t\t\treturn <p className=\"notification-day\">This Week</p>;\n\t\t} else {\n\t\t\treturn <p className=\"notification-day\">Older</p>;\n\t\t}\n\t};\n\n\tconst renderNotificationsBlock = (period: Periods) =>\n\t\tbyPeriodNotifications[period]\n\t\t\t.sort((a: INotification, b: INotification) => Date.parse(b.issuedAt) - Date.parse(a.issuedAt))\n\t\t\t.filter((notification) => (activeFilter.action === \"snoozed\" ? notification.isSnoozed : !notification.isSnoozed))\n\t\t\t.map((notification, index) => {\n\t\t\t\tconst key = `${index}_${notification.id ? notification.id : notification.issuedAt}`;\n\t\t\t\treturn (\n\t\t\t\t\t<div key={key}>\n\t\t\t\t\t\t{index === 0 ? renderSeparatorLabel(period) : null}\n\t\t\t\t\t\t<ErrorBoundary key={key}>\n\t\t\t\t\t\t\t<NotificationCardComponent\n\t\t\t\t\t\t\t\tkey={notification.id}\n\t\t\t\t\t\t\t\tnotification={notification}\n\t\t\t\t\t\t\t\tremoveNotification={() => {}}\n\t\t\t\t\t\t\t\tuiContext={\"center\"}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t\t<div className=\"divider\">&nbsp;</div>\n\t\t\t\t\t</div>\n\t\t\t\t);\n\t\t\t});\n\n\treturn isEmpty(byPeriodNotifications, activeFilter.action === \"snoozed\") ? (\n\t\t<NoNotifications />\n\t) : (\n\t\t<>{Object.keys(byPeriodNotifications).map((period) => renderNotificationsBlock(period as Periods))}</>\n\t);\n};\n\nexport default CardView;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ListView.js","sourceRoot":"","sources":["../../../../../src/components/notifications/components/views/ListView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,wBAAwB,EAAE,QAAQ,EAAE,UAAU,EAAE,M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F,OAAO,4BAA4B,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAClD,oBAAC,eAAe,OAAG,CACnB,CAAC,CAAC,CAAC,CACH;QACC,oBAAC,qBAAqB,OAAG;QACxB,4BAA4B,CAAC,GAAG,CAAC,CAAC,YAA2B,EAAE,KAAa,EAAE,EAAE;YAChF,MAAM,GAAG,GAAG,GAAG,KAAK,IAAI,YAAY,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC;YACpF,OAAO,CACN,oBAAC,aAAa,IAAC,GAAG,EAAE,GAAG;gBACtB,oBAAC,mBAAmB,IACnB,GAAG,EAAE,GAAG,EACR,YAAY,EAAE,YAAY,EAC1B,gCAAgC,EAAE,gCAAgC,GACjE,CACa,CAChB,CAAC;QACH,CAAC,CAAC,CACA,CACH,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import React, { useContext, useState, useEffect } from \"react\";\nimport { format, differenceInMilliseconds, parseISO, addSeconds } from \"date-fns\";\n\n// types\nimport { NotificationListViewProps } from \"../../types\";\n\n// Context\nimport { NotificationsContext } from \"../../notificationsContext\";\n\n// Components\nimport IconButton from \"../shared/IconButton\";\nimport NoNotifications from \"../NoNotifications\";\nimport OverflowMenu, { OverflowMenuActions, renderOverflowMenuAction } from \"../shared/OverflowMenu\";\nimport { CheckButton } from \"../shared/CheckButton\";\n\n// Utils\nimport {\n\tgetActiveFilter,\n\tgetMostRecentAction,\n\tisNewNotification,\n\tisReNotification,\n\tsearchNotifications,\n} from \"../../utils\";\n\nimport { NotificationCardHeaderLogo } from \"../shared/notificationCard/NotificationCardHeaderLogo\";\n\n// Constants\nimport { SelectionMode } from \"../../constants\";\nimport { services } from \"@finsemble/finsemble-api\";\nimport { ErrorBoundary } from \"../../../common/ErrorBoundary\";\n\ntype INotification = services.notification.types.INotification;\ntype IPerformedAction = services.notification.types.IPerformedAction;\n\nconst ListHeaderComponent = () => (\n\t<div className=\"list-header__container\">\n\t\t<div className=\"list-header_cell\">Received</div>\n\t\t<div className=\"list-header_cell\">App</div>\n\t\t<div className=\"list-header_cell\">Content</div>\n\t\t<div className=\"list-header_cell\">{\"\"}</div>\n\t</div>\n);\n\nexport type NotificationListRowPropType = {\n\tnotification: INotification;\n\tnewNotificationHaloPeriodSeconds: number;\n};\n\nexport const NotificationListRowShell: React.FunctionComponent<NotificationListRowPropType> = ({\n\tnotification,\n\tnewNotificationHaloPeriodSeconds,\n\tchildren,\n}: any) => {\n\tconst notificationsContext = useContext(NotificationsContext);\n\tconst { setSelectedNotification, muteFilters, selectionMode } = notificationsContext;\n\tconst [overflowMenuOpen, setOverflowMenuOpen] = useState(false);\n\tconst toggleOverflowMenu = () => {\n\t\tsetOverflowMenuOpen(!overflowMenuOpen);\n\t};\n\n\tconst [isNew, setIsNew] = useState(isNewNotification(notification, newNotificationHaloPeriodSeconds));\n\tconst [wokeFromSnooze, setWokeFromSnooze] = useState(\n\t\tisReNotification(notification, newNotificationHaloPeriodSeconds)\n\t);\n\tconst [isMuteFilterApplied, setIsMuteFilterApplied] = useState(\n\t\tmuteFilters\n\t\t\t? muteFilters.some((filter) => filter.source === notification.source && filter.type === notification.type)\n\t\t\t: false\n\t);\n\n\t// effect needed as the newNotificationHaloPeriodSeconds is fecthed asynchronously in the parent component\n\t// and sometimes at the first render, this value is still 0\n\tuseEffect(() => {\n\t\tsetIsNew(isNewNotification(notification, newNotificationHaloPeriodSeconds));\n\t}, [newNotificationHaloPeriodSeconds]);\n\n\tuseEffect(() => {\n\t\tlet isNewTimerId: any;\n\t\tif (isNew) {\n\t\t\tif (notification.isRead) {\n\t\t\t\tsetIsNew(false);\n\t\t\t\tclearTimeout(isNewTimerId);\n\t\t\t} else {\n\t\t\t\tisNewTimerId = setTimeout(() => {\n\t\t\t\t\tsetIsNew(false);\n\t\t\t\t}, differenceInMilliseconds(addSeconds(parseISO(notification.issuedAt), newNotificationHaloPeriodSeconds), Date.now()));\n\t\t\t}\n\t\t}\n\t\treturn () => {\n\t\t\tclearTimeout(isNewTimerId);\n\t\t};\n\t}, [isNew, notification]);\n\n\tuseEffect(() => {\n\t\tlet isRenotificationTimerId: any;\n\t\tif (isReNotification(notification, newNotificationHaloPeriodSeconds)) {\n\t\t\tconst mostRecentAction: IPerformedAction | null = getMostRecentAction(notification);\n\t\t\tif (mostRecentAction) {\n\t\t\t\tconst { datePerformed } = mostRecentAction;\n\t\t\t\tsetWokeFromSnooze(true);\n\t\t\t\tisRenotificationTimerId = setTimeout(() => {\n\t\t\t\t\tsetWokeFromSnooze(false);\n\t\t\t\t}, differenceInMilliseconds(addSeconds(parseISO(datePerformed), newNotificationHaloPeriodSeconds), Date.now()));\n\t\t\t}\n\t\t} else {\n\t\t\tsetWokeFromSnooze(false);\n\t\t\tclearTimeout(isRenotificationTimerId);\n\t\t}\n\t\treturn () => {\n\t\t\tclearTimeout(isRenotificationTimerId);\n\t\t};\n\t}, [newNotificationHaloPeriodSeconds, notification]);\n\n\tconst overFlowActions = Object.assign({}, OverflowMenuActions);\n\toverFlowActions.DETAILS.action = (detailNotification: INotification) => {\n\t\tsetSelectedNotification(detailNotification);\n\t};\n\n\tdelete overFlowActions.DISMISS;\n\n\tuseEffect(() => {\n\t\tfunction listenMuteStateChanged(error: any, response: any) {\n\t\t\tif (error) {\n\t\t\t\tconsole.error(\"FinsembleNotificationsMuteStateChannel: \", error);\n\t\t\t} else {\n\t\t\t\tconst { data } = response;\n\t\t\t\tif (notification.source === data.source && notification.type === data.type) {\n\t\t\t\t\tsetIsMuteFilterApplied(data.isMuted);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tFSBL.Clients.RouterClient.addListener(\"FinsembleNotificationsMuteStateChannel\", listenMuteStateChanged);\n\t\treturn () => {\n\t\t\tFSBL.Clients.RouterClient.removeListener(\"FinsembleNotificationsMuteStateChannel\", listenMuteStateChanged);\n\t\t};\n\t}, []);\n\n\tconst menuActions = Object.values(overFlowActions).map((value) =>\n\t\trenderOverflowMenuAction(notification, value, isMuteFilterApplied)\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tclassName={`list-row__container notification-item ${notification.isRead ? \"is-read\" : \"\"} ${\n\t\t\t\tisNew || wokeFromSnooze ? \"new\" : \"\"\n\t\t\t}\n\t\t\t\t${notification.cssClassName ? notification.cssClassName : \"\"}`}\n\t\t>\n\t\t\t{children ? (\n\t\t\t\t<>\n\t\t\t\t\t{selectionMode === SelectionMode.SELECTION ? (\n\t\t\t\t\t\t<div className=\"list-row__cell\">\n\t\t\t\t\t\t\t<CheckButton notification={notification} />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<></>\n\t\t\t\t\t)}\n\t\t\t\t\t{children}\n\t\t\t\t</>\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<div className=\"list-row__cell\">{format(Date.parse(notification.issuedAt), \"dd-MM-yyyy HH:mm\")}</div>\n\t\t\t\t\t<div className=\"list-row__cell\">\n\t\t\t\t\t\t{selectionMode === SelectionMode.SELECTION ? (\n\t\t\t\t\t\t\t<div className=\"list-row__cell\">\n\t\t\t\t\t\t\t\t<CheckButton notification={notification} />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<NotificationCardHeaderLogo headerLogo={notification.headerLogo} />\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className=\"list-row__cell\">{`${notification.title} - ${notification.details}`}</div>\n\t\t\t\t</>\n\t\t\t)}\n\t\t\t<div className=\"list-row__cell\">\n\t\t\t\t<span>\n\t\t\t\t\t<IconButton iconName=\"ff-dots-vert\" tooltip=\"Options\" clickHandler={toggleOverflowMenu}>\n\t\t\t\t\t\t{overflowMenuOpen ? <OverflowMenu closeSelf={setOverflowMenuOpen}>{menuActions}</OverflowMenu> : null}\n\t\t\t\t\t</IconButton>\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nconst ListView: React.FunctionComponent<NotificationListViewProps> = ({\n\tnotificationHeaderRow,\n\tnotificationListRow,\n\tnotifications,\n}) => {\n\tconst notificationsContext = useContext(NotificationsContext);\n\t// The context will be used to filter the notifications\n\tconst { drawerControlProps, searchString, filteredNotifications, setFilteredNotifications } = notificationsContext;\n\n\tconst activeFilter = getActiveFilter(drawerControlProps);\n\n\tconst [newNotificationHaloPeriodSeconds, setNotificationHaloPeriodSeconds] = useState(0);\n\n\tconst NotificationHeaderRow = notificationHeaderRow || ListHeaderComponent;\n\tconst NotificationListRow = notificationListRow || NotificationListRowShell;\n\n\t// Sets the current default preference\n\tuseEffect(() => {\n\t\tasync function getNotificationsPreferences() {\n\t\t\treturn await FSBL.Clients.NotificationClient.getPreferences();\n\t\t}\n\n\t\tgetNotificationsPreferences().then((preferences: any) => {\n\t\t\tsetNotificationHaloPeriodSeconds(preferences.newNotificationHaloPeriodSeconds);\n\t\t});\n\t}, []);\n\n\tuseEffect(() => {\n\t\tif (searchString === \"\") {\n\t\t\tsetFilteredNotifications(notifications);\n\t\t} else {\n\t\t\tsetFilteredNotifications(searchNotifications(notifications, searchString));\n\t\t}\n\t}, [searchString, notifications]);\n\n\tlet controlFilteredNotifications = activeFilter ? activeFilter.run?.(filteredNotifications) : [];\n\tcontrolFilteredNotifications.sort(\n\t\t(a: INotification, b: INotification) => Date.parse(b.issuedAt) - Date.parse(a.issuedAt)\n\t);\n\n\tcontrolFilteredNotifications = controlFilteredNotifications.filter((notification: INotification) =>\n\t\tactiveFilter.action === \"snoozed\" ? notification.isSnoozed : !notification.isSnoozed\n\t);\n\n\treturn controlFilteredNotifications.length === 0 ? (\n\t\t<NoNotifications />\n\t) : (\n\t\t<>\n\t\t\t<NotificationHeaderRow />\n\t\t\t{controlFilteredNotifications.map((notification: INotification, index: number) => {\n\t\t\t\tconst key = `${index}_${notification.id ? notification.id : notification.issuedAt}`;\n\t\t\t\treturn (\n\t\t\t\t\t<ErrorBoundary key={key}>\n\t\t\t\t\t\t<NotificationListRow\n\t\t\t\t\t\t\tkey={key}\n\t\t\t\t\t\t\tnotification={notification}\n\t\t\t\t\t\t\tnewNotificationHaloPeriodSeconds={newNotificationHaloPeriodSeconds}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t);\n\t\t\t})}\n\t\t</>\n\t);\n};\n\nexport default ListView;\n"]}
1
+ {"version":3,"file":"ListView.js","sourceRoot":"","sources":["../../../../../src/components/notifications/components/views/ListView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,wBAAwB,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAKlF,UAAU;AACV,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,aAAa;AACb,OAAO,UAAU,MAAM,sBAAsB,CAAC;AAC9C,OAAO,eAAe,MAAM,oBAAoB,CAAC;AACjD,OAAO,YAAY,EAAE,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AACrG,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,QAAQ;AACR,OAAO,EACN,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,GACnB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,0BAA0B,EAAE,MAAM,uDAAuD,CAAC;AAEnG,YAAY;AACZ,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAK9D,MAAM,mBAAmB,GAAG,GAAG,EAAE,CAAC,CACjC,6BAAK,SAAS,EAAC,wBAAwB;IACtC,6BAAK,SAAS,EAAC,kBAAkB,eAAe;IAChD,6BAAK,SAA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,YAAY,CAAC,CAAC,CAAC,MAAA,YAAY,CAAC,GAAG,6DAAG,qBAAqB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACjG,4BAA4B,CAAC,IAAI,CAChC,CAAC,CAAgB,EAAE,CAAgB,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CACvF,CAAC;IAEF,4BAA4B,GAAG,4BAA4B,CAAC,MAAM,CAAC,CAAC,YAA2B,EAAE,EAAE,CAClG,YAAY,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,SAAS,CACpF,CAAC;IAEF,OAAO,4BAA4B,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAClD,oBAAC,eAAe,OAAG,CACnB,CAAC,CAAC,CAAC,CACH;QACC,oBAAC,qBAAqB,OAAG;QACxB,4BAA4B,CAAC,GAAG,CAAC,CAAC,YAA2B,EAAE,KAAa,EAAE,EAAE;YAChF,MAAM,GAAG,GAAG,GAAG,KAAK,IAAI,YAAY,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC;YACpF,OAAO,CACN,oBAAC,aAAa,IAAC,GAAG,EAAE,GAAG;gBACtB,oBAAC,mBAAmB,IACnB,GAAG,EAAE,GAAG,EACR,YAAY,EAAE,YAAY,EAC1B,gCAAgC,EAAE,gCAAgC,GACjE,CACa,CAChB,CAAC;QACH,CAAC,CAAC,CACA,CACH,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import React, { useContext, useState, useEffect } from \"react\";\nimport { format, differenceInMilliseconds, parseISO, addSeconds } from \"date-fns\";\n\n// types\nimport { NotificationListViewProps } from \"../../types\";\n\n// Context\nimport { NotificationsContext } from \"../../notificationsContext\";\n\n// Components\nimport IconButton from \"../shared/IconButton\";\nimport NoNotifications from \"../NoNotifications\";\nimport OverflowMenu, { OverflowMenuActions, renderOverflowMenuAction } from \"../shared/OverflowMenu\";\nimport { CheckButton } from \"../shared/CheckButton\";\n\n// Utils\nimport {\n\tgetActiveFilter,\n\tgetMostRecentAction,\n\tisNewNotification,\n\tisReNotification,\n\tsearchNotifications,\n} from \"../../utils\";\n\nimport { NotificationCardHeaderLogo } from \"../shared/notificationCard/NotificationCardHeaderLogo\";\n\n// Constants\nimport { SelectionMode } from \"../../constants\";\nimport { services } from \"@finsemble/finsemble-api\";\nimport { ErrorBoundary } from \"../../../common/ErrorBoundary\";\n\ntype INotification = services.notification.types.INotification;\ntype IPerformedAction = services.notification.types.IPerformedAction;\n\nconst ListHeaderComponent = () => (\n\t<div className=\"list-header__container\">\n\t\t<div className=\"list-header_cell\">Received</div>\n\t\t<div className=\"list-header_cell\">App</div>\n\t\t<div className=\"list-header_cell\">Content</div>\n\t\t<div className=\"list-header_cell\">{\"\"}</div>\n\t</div>\n);\n\nexport type NotificationListRowPropType = {\n\tnotification: INotification;\n\tnewNotificationHaloPeriodSeconds: number;\n};\n\nexport const NotificationListRowShell: React.FunctionComponent<NotificationListRowPropType> = ({\n\tnotification,\n\tnewNotificationHaloPeriodSeconds,\n\tchildren,\n}: any) => {\n\tconst notificationsContext = useContext(NotificationsContext);\n\tconst { setSelectedNotification, muteFilters, selectionMode } = notificationsContext;\n\tconst [overflowMenuOpen, setOverflowMenuOpen] = useState(false);\n\tconst toggleOverflowMenu = () => {\n\t\tsetOverflowMenuOpen(!overflowMenuOpen);\n\t};\n\n\tconst [isNew, setIsNew] = useState(isNewNotification(notification, newNotificationHaloPeriodSeconds));\n\tconst [wokeFromSnooze, setWokeFromSnooze] = useState(\n\t\tisReNotification(notification, newNotificationHaloPeriodSeconds)\n\t);\n\tconst [isMuteFilterApplied, setIsMuteFilterApplied] = useState(\n\t\tmuteFilters\n\t\t\t? muteFilters.some((filter) => filter.source === notification.source && filter.type === notification.type)\n\t\t\t: false\n\t);\n\n\t// effect needed as the newNotificationHaloPeriodSeconds is fecthed asynchronously in the parent component\n\t// and sometimes at the first render, this value is still 0\n\tuseEffect(() => {\n\t\tsetIsNew(isNewNotification(notification, newNotificationHaloPeriodSeconds));\n\t}, [newNotificationHaloPeriodSeconds]);\n\n\tuseEffect(() => {\n\t\tlet isNewTimerId: any;\n\t\tif (isNew) {\n\t\t\tif (notification.isRead) {\n\t\t\t\tsetIsNew(false);\n\t\t\t\tclearTimeout(isNewTimerId);\n\t\t\t} else {\n\t\t\t\tisNewTimerId = setTimeout(() => {\n\t\t\t\t\tsetIsNew(false);\n\t\t\t\t}, differenceInMilliseconds(addSeconds(parseISO(notification.issuedAt), newNotificationHaloPeriodSeconds), Date.now()));\n\t\t\t}\n\t\t}\n\t\treturn () => {\n\t\t\tclearTimeout(isNewTimerId);\n\t\t};\n\t}, [isNew, notification]);\n\n\tuseEffect(() => {\n\t\tlet isRenotificationTimerId: any;\n\t\tif (isReNotification(notification, newNotificationHaloPeriodSeconds)) {\n\t\t\tconst mostRecentAction: IPerformedAction | null = getMostRecentAction(notification);\n\t\t\tif (mostRecentAction) {\n\t\t\t\tconst { datePerformed } = mostRecentAction;\n\t\t\t\tsetWokeFromSnooze(true);\n\t\t\t\tisRenotificationTimerId = setTimeout(() => {\n\t\t\t\t\tsetWokeFromSnooze(false);\n\t\t\t\t}, differenceInMilliseconds(addSeconds(parseISO(datePerformed), newNotificationHaloPeriodSeconds), Date.now()));\n\t\t\t}\n\t\t} else {\n\t\t\tsetWokeFromSnooze(false);\n\t\t\tclearTimeout(isRenotificationTimerId);\n\t\t}\n\t\treturn () => {\n\t\t\tclearTimeout(isRenotificationTimerId);\n\t\t};\n\t}, [newNotificationHaloPeriodSeconds, notification]);\n\n\tconst overFlowActions = Object.assign({}, OverflowMenuActions);\n\toverFlowActions.DETAILS.action = (detailNotification: INotification) => {\n\t\tsetSelectedNotification(detailNotification);\n\t};\n\n\tdelete overFlowActions.DISMISS;\n\n\tuseEffect(() => {\n\t\tfunction listenMuteStateChanged(error: any, response: any) {\n\t\t\tif (error) {\n\t\t\t\tconsole.error(\"FinsembleNotificationsMuteStateChannel: \", error);\n\t\t\t} else {\n\t\t\t\tconst { data } = response;\n\t\t\t\tif (notification.source === data.source && notification.type === data.type) {\n\t\t\t\t\tsetIsMuteFilterApplied(data.isMuted);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tFSBL.Clients.RouterClient.addListener(\"FinsembleNotificationsMuteStateChannel\", listenMuteStateChanged);\n\t\treturn () => {\n\t\t\tFSBL.Clients.RouterClient.removeListener(\"FinsembleNotificationsMuteStateChannel\", listenMuteStateChanged);\n\t\t};\n\t}, []);\n\n\tconst menuActions = Object.values(overFlowActions).map((value) =>\n\t\trenderOverflowMenuAction(notification, value, isMuteFilterApplied)\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tclassName={`list-row__container notification-item ${notification.isRead ? \"is-read\" : \"\"} ${\n\t\t\t\tisNew || wokeFromSnooze ? \"new\" : \"\"\n\t\t\t}\n\t\t\t\t${notification.cssClassName ? notification.cssClassName : \"\"}`}\n\t\t>\n\t\t\t{children ? (\n\t\t\t\t<>\n\t\t\t\t\t{selectionMode === SelectionMode.SELECTION ? (\n\t\t\t\t\t\t<div className=\"list-row__cell\">\n\t\t\t\t\t\t\t<CheckButton notification={notification} />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<></>\n\t\t\t\t\t)}\n\t\t\t\t\t{children}\n\t\t\t\t</>\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<div className=\"list-row__cell\">{format(Date.parse(notification.issuedAt), \"dd-MM-yyyy HH:mm\")}</div>\n\t\t\t\t\t<div className=\"list-row__cell\">\n\t\t\t\t\t\t{selectionMode === SelectionMode.SELECTION ? (\n\t\t\t\t\t\t\t<div className=\"list-row__cell\">\n\t\t\t\t\t\t\t\t<CheckButton notification={notification} />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<NotificationCardHeaderLogo headerLogo={notification.headerLogo} />\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className=\"list-row__cell\">{`${notification.title} - ${notification.details}`}</div>\n\t\t\t\t</>\n\t\t\t)}\n\t\t\t<div className=\"list-row__cell\">\n\t\t\t\t<span>\n\t\t\t\t\t<IconButton iconName=\"ff-dots-vert\" tooltip=\"Options\" clickHandler={toggleOverflowMenu}>\n\t\t\t\t\t\t{overflowMenuOpen ? <OverflowMenu closeSelf={setOverflowMenuOpen}>{menuActions}</OverflowMenu> : null}\n\t\t\t\t\t</IconButton>\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nconst ListView: React.FunctionComponent<NotificationListViewProps> = ({\n\tnotificationHeaderRow,\n\tnotificationListRow,\n\tnotifications,\n}) => {\n\tconst notificationsContext = useContext(NotificationsContext);\n\t// The context will be used to filter the notifications\n\tconst { drawerControlProps, searchString, filteredNotifications, setFilteredNotifications } = notificationsContext;\n\n\tconst activeFilter = getActiveFilter(drawerControlProps);\n\n\tconst [newNotificationHaloPeriodSeconds, setNotificationHaloPeriodSeconds] = useState(0);\n\n\tconst NotificationHeaderRow = notificationHeaderRow || ListHeaderComponent;\n\tconst NotificationListRow = notificationListRow || NotificationListRowShell;\n\n\t// Sets the current default preference\n\tuseEffect(() => {\n\t\tasync function getNotificationsPreferences() {\n\t\t\treturn await FSBL.Clients.NotificationClient.getPreferences();\n\t\t}\n\n\t\tgetNotificationsPreferences().then((preferences: any) => {\n\t\t\tsetNotificationHaloPeriodSeconds(preferences.newNotificationHaloPeriodSeconds);\n\t\t});\n\t}, []);\n\n\tuseEffect(() => {\n\t\tif (searchString === \"\") {\n\t\t\tsetFilteredNotifications(notifications);\n\t\t} else {\n\t\t\tsetFilteredNotifications(searchNotifications(notifications, searchString));\n\t\t}\n\t}, [searchString, notifications]);\n\n\tlet controlFilteredNotifications = activeFilter ? activeFilter.run?.(filteredNotifications) : [];\n\tcontrolFilteredNotifications.sort(\n\t\t(a: INotification, b: INotification) => Date.parse(b.issuedAt) - Date.parse(a.issuedAt)\n\t);\n\n\tcontrolFilteredNotifications = controlFilteredNotifications.filter((notification: INotification) =>\n\t\tactiveFilter.action === \"snoozed\" ? notification.isSnoozed : !notification.isSnoozed\n\t);\n\n\treturn controlFilteredNotifications.length === 0 ? (\n\t\t<NoNotifications />\n\t) : (\n\t\t<>\n\t\t\t<NotificationHeaderRow />\n\t\t\t{controlFilteredNotifications.map((notification: INotification, index: number) => {\n\t\t\t\tconst key = `${index}_${notification.id ? notification.id : notification.issuedAt}`;\n\t\t\t\treturn (\n\t\t\t\t\t<ErrorBoundary key={key}>\n\t\t\t\t\t\t<NotificationListRow\n\t\t\t\t\t\t\tkey={key}\n\t\t\t\t\t\t\tnotification={notification}\n\t\t\t\t\t\t\tnewNotificationHaloPeriodSeconds={newNotificationHaloPeriodSeconds}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t);\n\t\t\t})}\n\t\t</>\n\t);\n};\n\nexport default ListView;\n"]}
@@ -1,6 +1,6 @@
1
1
  import { ChildWindowType, ProcessType } from "../ProcessMonitorTypes";
2
2
  import StoreModel from "@finsemble/finsemble-api/types/clients/StoreModel";
3
- import { StandardCallback, StandardError } from "@finsemble/finsemble-api/types/types";
3
+ import { StandardCallback } from "@finsemble/finsemble-api/types/types";
4
4
  import { ProcessInfo } from "@finsemble/finsemble-api/types/FEA";
5
5
  declare let ProcessMonitorStore: StoreModel | undefined;
6
6
  declare type VoidCallback = () => void;
@@ -37,11 +37,11 @@ declare const Actions: {
37
37
  /**
38
38
  * Gets the current "flashing" state - whether the process monitor is currently flashing a window
39
39
  */
40
- getFlashingState: (cb?: StandardCallback<StandardError, any> | undefined) => void;
40
+ getFlashingState: (cb?: StandardCallback) => void;
41
41
  /**
42
42
  * Gets the current "flashing" state for the process monitor
43
43
  */
44
- setFlashingState: (value: boolean, cb?: StandardCallback<StandardError, any> | undefined) => void;
44
+ setFlashingState: (value: boolean, cb?: StandardCallback) => void;
45
45
  /**
46
46
  * Make the window flash a couple of times so that the user can identify it.
47
47
  */
@@ -9,22 +9,10 @@ export declare type AppearanceProps = {
9
9
  updateTheme: (theme: ThemeBundle) => void;
10
10
  updateThemes: (id: string, newValue: string) => void;
11
11
  areYouSure: (affirmativeCallback: () => void) => void;
12
- baseURL: string;
13
- toolbarIcon: string;
14
- taskbarIcon: string;
15
- installerIcon: string;
16
- systemTrayIcon: string;
17
- splashScreenImage: string;
18
- setToolbarIcon: (s: string) => void;
19
- setTaskbarIcon: (s: string) => void;
20
- setInstallerIcon: (s: string) => void;
21
- setSystemTrayIcon: (s: string) => void;
22
- setSplashScreenImage: (s: string) => void;
23
- setIconsChanged: (n: number) => void;
24
12
  updateSplashScreen: FileInputUploadCb;
25
13
  updateToolbarIcon: FileInputUploadCb;
26
14
  updateTaskbarIcon: FileInputUploadCb;
27
15
  updateSystemTrayIcon: FileInputUploadCb;
28
16
  updateInstallerIcon: FileInputUploadCb;
29
17
  };
30
- export declare const Appearance: ({ startTheme, darkTheme, lightTheme, updateTheme, updateThemes, areYouSure, baseURL, toolbarIcon, taskbarIcon, installerIcon, systemTrayIcon, splashScreenImage, setToolbarIcon, setTaskbarIcon, setInstallerIcon, setSystemTrayIcon, setSplashScreenImage, setIconsChanged, updateSplashScreen, updateToolbarIcon, updateTaskbarIcon, updateSystemTrayIcon, updateInstallerIcon, }: AppearanceProps) => JSX.Element;
18
+ export declare const Appearance: ({ startTheme, darkTheme, lightTheme, updateTheme, updateThemes, areYouSure, updateSplashScreen, updateToolbarIcon, updateTaskbarIcon, updateSystemTrayIcon, updateInstallerIcon, }: AppearanceProps) => JSX.Element;
@@ -9,7 +9,7 @@ import { View } from "./View";
9
9
  import { Content } from "./Content";
10
10
  import { Tab } from "../common/Tab";
11
11
  import { launchTutorialLink } from "./common/fsbl_functions";
12
- export const Appearance = ({ startTheme, darkTheme, lightTheme, updateTheme, updateThemes, areYouSure, baseURL, toolbarIcon, taskbarIcon, installerIcon, systemTrayIcon, splashScreenImage, setToolbarIcon, setTaskbarIcon, setInstallerIcon, setSystemTrayIcon, setSplashScreenImage, setIconsChanged, updateSplashScreen, updateToolbarIcon, updateTaskbarIcon, updateSystemTrayIcon, updateInstallerIcon, }) => {
12
+ export const Appearance = ({ startTheme, darkTheme, lightTheme, updateTheme, updateThemes, areYouSure, updateSplashScreen, updateToolbarIcon, updateTaskbarIcon, updateSystemTrayIcon, updateInstallerIcon, }) => {
13
13
  const [theme, setTheme] = useState(startTheme);
14
14
  const ref = useRef(null);
15
15
  const applyTheme = (newTheme) => {
@@ -59,6 +59,6 @@ export const Appearance = ({ startTheme, darkTheme, lightTheme, updateTheme, upd
59
59
  "Browse your computer for images to use in Finsemble.",
60
60
  React.createElement("br", null),
61
61
  "You can also drag and drop images into the fields below."),
62
- React.createElement(AssetsPage, { baseURL: baseURL, toolbarIcon: toolbarIcon, taskbarIcon: taskbarIcon, installerIcon: installerIcon, systemTrayIcon: systemTrayIcon, splashScreenImage: splashScreenImage, setToolbarIcon: setToolbarIcon, setTaskbarIcon: setTaskbarIcon, setInstallerIcon: setInstallerIcon, setSystemTrayIcon: setSystemTrayIcon, setSplashScreenImage: setSplashScreenImage, setIconsChanged: setIconsChanged, updateSplashScreen: updateSplashScreen, updateToolbarIcon: updateToolbarIcon, updateTaskbarIcon: updateTaskbarIcon, updateSystemTrayIcon: updateSystemTrayIcon, updateInstallerIcon: updateInstallerIcon }))))));
62
+ React.createElement(AssetsPage, { updateSplashScreen: updateSplashScreen, updateToolbarIcon: updateToolbarIcon, updateTaskbarIcon: updateTaskbarIcon, updateSystemTrayIcon: updateSystemTrayIcon, updateInstallerIcon: updateInstallerIcon }))))));
63
63
  };
64
64
  //# sourceMappingURL=Appearance.js.map
@@ -1 +1 @@
1
- {"version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AC,MAAM,EAAC,IAAI,EAAC,YAAY,EAAC,OAAO,EAAE,cAAc,GAAI;wBACzF,oBAAC,MAAM,IAAC,OAAO,EAAC,SAAS,EAAC,UAAU,EAAC,KAAK,EAAC,IAAI,EAAC,aAAa,EAAC,OAAO,EAAE,eAAe,GAAI,CACrF;oBAEN,oBAAC,SAAS,IAAC,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,cAAc,GAAI,CACpD;gBAEN,2CAAgB,QAAQ;oBACvB,6BAAK,SAAS,EAAC,aAAa;;wBAE3B,+BAAM;mFAED;oBACN,oBAAC,UAAU,IACV,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,aAAa,EAC5B,cAAc,EAAE,cAAc,EAC9B,iBAAiB,EAAE,iBAAiB,EACpC,cAAc,EAAE,cAAc,EAC9B,cAAc,EAAE,cAAc,EAC9B,gBAAgB,EAAE,gBAAgB,EAClC,iBAAiB,EAAE,iBAAiB,EACpC,oBAAoB,EAAE,oBAAoB,EAC1C,eAAe,EAAE,eAAe,EAChC,kBAAkB,EAAE,kBAAkB,EACtC,iBAAiB,EAAE,iBAAiB,EACpC,iBAAiB,EAAE,iBAAiB,EACpC,oBAAoB,EAAE,oBAAoB,EAC1C,mBAAmB,EAAE,mBAAmB,GACvC,CACG,CACD,CACG,CACJ,CACP,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React, { useState, useRef, useLayoutEffect } from \"react\";\nimport { Button } from \"../common/Button\";\nimport { Header } from \"../common/Header\";\nimport \"./Appearance.css\";\nimport { AssetsPage } from \"./AssetsPage\";\nimport { ThemePage, ThemeBundle } from \"./ThemePage\";\nimport { clone } from \"./Appearance.helpers\";\nimport { FileInputUploadCb } from \"../common/FileInput\";\nimport { View } from \"./View\";\nimport { Content } from \"./Content\";\nimport { Tab } from \"../common/Tab\";\nimport { launchTutorialLink } from \"./common/fsbl_functions\";\n\nexport type AppearanceProps = {\n\tstartTheme: ThemeBundle;\n\tdarkTheme: ThemeBundle;\n\tlightTheme: ThemeBundle;\n\tupdateTheme: (theme: ThemeBundle) => void;\n\tupdateThemes: (id: string, newValue: string) => void;\n\tareYouSure: (affirmativeCallback: () => void) => void;\n\tbaseURL: string;\n\ttoolbarIcon: string;\n\ttaskbarIcon: string;\n\tinstallerIcon: string;\n\tsystemTrayIcon: string;\n\tsplashScreenImage: string;\n\tsetToolbarIcon: (s: string) => void;\n\tsetTaskbarIcon: (s: string) => void;\n\tsetInstallerIcon: (s: string) => void;\n\tsetSystemTrayIcon: (s: string) => void;\n\tsetSplashScreenImage: (s: string) => void;\n\tsetIconsChanged: (n: number) => void;\n\tupdateSplashScreen: FileInputUploadCb;\n\tupdateToolbarIcon: FileInputUploadCb;\n\tupdateTaskbarIcon: FileInputUploadCb;\n\tupdateSystemTrayIcon: FileInputUploadCb;\n\tupdateInstallerIcon: FileInputUploadCb;\n};\n\nexport const Appearance = ({\n\tstartTheme,\n\tdarkTheme,\n\tlightTheme,\n\tupdateTheme,\n\tupdateThemes,\n\tareYouSure,\n\tbaseURL,\n\ttoolbarIcon,\n\ttaskbarIcon,\n\tinstallerIcon,\n\tsystemTrayIcon,\n\tsplashScreenImage,\n\tsetToolbarIcon,\n\tsetTaskbarIcon,\n\tsetInstallerIcon,\n\tsetSystemTrayIcon,\n\tsetSplashScreenImage,\n\tsetIconsChanged,\n\tupdateSplashScreen,\n\tupdateToolbarIcon,\n\tupdateTaskbarIcon,\n\tupdateSystemTrayIcon,\n\tupdateInstallerIcon,\n}: AppearanceProps) => {\n\tconst [theme, setTheme] = useState(startTheme);\n\tconst ref = useRef<HTMLDivElement>(null);\n\n\tconst applyTheme = (newTheme: ThemeBundle) => {\n\t\tareYouSure(() => {\n\t\t\tconst clonedTheme = clone(newTheme);\n\t\t\tsetTheme(clonedTheme);\n\t\t\tupdateTheme(clonedTheme);\n\t\t});\n\t};\n\n\tconst applyDarkTheme = () => {\n\t\tapplyTheme(darkTheme);\n\t};\n\n\tconst applyLightTheme = () => {\n\t\tapplyTheme(lightTheme);\n\t};\n\n\tuseLayoutEffect(() => {\n\t\t// Allow for the tab panel content to look nice with its own scrollbar,\n\t\t// which also keeps the heading/tab group at the top of the page.\n\t\t// It feels like css flex should do this, but I could never get it to work.\n\t\tif (ref.current !== null) {\n\t\t\tref.current.style.height = `${window.innerHeight - (ref.current.getBoundingClientRect()?.top || 0) - 10}px`;\n\t\t}\n\t});\n\n\tconst onUpdateThemes = (id: string, newValue: string) => {\n\t\tsetTheme({\n\t\t\t...theme,\n\t\t\t[id]: newValue,\n\t\t});\n\t\tupdateThemes(id, newValue);\n\t};\n\n\treturn (\n\t\t<View>\n\t\t\t<Header\n\t\t\t\thelpFunction={() => {\n\t\t\t\t\tlaunchTutorialLink(\"SDD-03-Theme\");\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\tTheme\n\t\t\t</Header>\n\n\t\t\t<Content>\n\t\t\t\t<Tab>\n\t\t\t\t\t<div data-label=\"Themes\">\n\t\t\t\t\t\t<div className=\"frontmatter\">\n\t\t\t\t\t\t\tUse a template to set or reset your theme.\n\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\tUse either template to start building your own theme.\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t<div className=\"template-row\">\n\t\t\t\t\t\t\t<label>Templates:</label>\n\t\t\t\t\t\t\t<Button fashion=\"primary\" iconBefore=\"moon\" text=\"Dark theme\" onClick={applyDarkTheme} />\n\t\t\t\t\t\t\t<Button fashion=\"primary\" iconBefore=\"sun\" text=\"Light theme\" onClick={applyLightTheme} />\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t<ThemePage theme={theme} updateThemes={onUpdateThemes} />\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div data-label=\"Images\">\n\t\t\t\t\t\t<div className=\"frontmatter\">\n\t\t\t\t\t\t\tBrowse your computer for images to use in Finsemble.\n\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\tYou can also drag and drop images into the fields below.\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<AssetsPage\n\t\t\t\t\t\t\tbaseURL={baseURL}\n\t\t\t\t\t\t\ttoolbarIcon={toolbarIcon}\n\t\t\t\t\t\t\ttaskbarIcon={taskbarIcon}\n\t\t\t\t\t\t\tinstallerIcon={installerIcon}\n\t\t\t\t\t\t\tsystemTrayIcon={systemTrayIcon}\n\t\t\t\t\t\t\tsplashScreenImage={splashScreenImage}\n\t\t\t\t\t\t\tsetToolbarIcon={setToolbarIcon}\n\t\t\t\t\t\t\tsetTaskbarIcon={setTaskbarIcon}\n\t\t\t\t\t\t\tsetInstallerIcon={setInstallerIcon}\n\t\t\t\t\t\t\tsetSystemTrayIcon={setSystemTrayIcon}\n\t\t\t\t\t\t\tsetSplashScreenImage={setSplashScreenImage}\n\t\t\t\t\t\t\tsetIconsChanged={setIconsChanged}\n\t\t\t\t\t\t\tupdateSplashScreen={updateSplashScreen}\n\t\t\t\t\t\t\tupdateToolbarIcon={updateToolbarIcon}\n\t\t\t\t\t\t\tupdateTaskbarIcon={updateTaskbarIcon}\n\t\t\t\t\t\t\tupdateSystemTrayIcon={updateSystemTrayIcon}\n\t\t\t\t\t\t\tupdateInstallerIcon={updateInstallerIcon}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</Tab>\n\t\t\t</Content>\n\t\t</View>\n\t);\n};\n"]}
1
+ {"version":3,"file":"Appearance.js","sourceRoot":"","sources":["../../../src/components/sdd/Appearance.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EA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AmB,EAAE,mBAAmB,GACvC,CACG,CACD,CACG,CACJ,CACP,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React, { useState, useRef, useLayoutEffect } from \"react\";\nimport { Button } from \"../common/Button\";\nimport { Header } from \"../common/Header\";\nimport \"./Appearance.css\";\nimport { AssetsPage } from \"./AssetsPage\";\nimport { ThemePage, ThemeBundle } from \"./ThemePage\";\nimport { clone } from \"./Appearance.helpers\";\nimport { FileInputUploadCb } from \"../common/FileInput\";\nimport { View } from \"./View\";\nimport { Content } from \"./Content\";\nimport { Tab } from \"../common/Tab\";\nimport { launchTutorialLink } from \"./common/fsbl_functions\";\n\nexport type AppearanceProps = {\n\tstartTheme: ThemeBundle;\n\tdarkTheme: ThemeBundle;\n\tlightTheme: ThemeBundle;\n\tupdateTheme: (theme: ThemeBundle) => void;\n\tupdateThemes: (id: string, newValue: string) => void;\n\tareYouSure: (affirmativeCallback: () => void) => void;\n\tupdateSplashScreen: FileInputUploadCb;\n\tupdateToolbarIcon: FileInputUploadCb;\n\tupdateTaskbarIcon: FileInputUploadCb;\n\tupdateSystemTrayIcon: FileInputUploadCb;\n\tupdateInstallerIcon: FileInputUploadCb;\n};\n\nexport const Appearance = ({\n\tstartTheme,\n\tdarkTheme,\n\tlightTheme,\n\tupdateTheme,\n\tupdateThemes,\n\tareYouSure,\n\tupdateSplashScreen,\n\tupdateToolbarIcon,\n\tupdateTaskbarIcon,\n\tupdateSystemTrayIcon,\n\tupdateInstallerIcon,\n}: AppearanceProps) => {\n\tconst [theme, setTheme] = useState(startTheme);\n\tconst ref = useRef<HTMLDivElement>(null);\n\n\tconst applyTheme = (newTheme: ThemeBundle) => {\n\t\tareYouSure(() => {\n\t\t\tconst clonedTheme = clone(newTheme);\n\t\t\tsetTheme(clonedTheme);\n\t\t\tupdateTheme(clonedTheme);\n\t\t});\n\t};\n\n\tconst applyDarkTheme = () => {\n\t\tapplyTheme(darkTheme);\n\t};\n\n\tconst applyLightTheme = () => {\n\t\tapplyTheme(lightTheme);\n\t};\n\n\tuseLayoutEffect(() => {\n\t\t// Allow for the tab panel content to look nice with its own scrollbar,\n\t\t// which also keeps the heading/tab group at the top of the page.\n\t\t// It feels like css flex should do this, but I could never get it to work.\n\t\tif (ref.current !== null) {\n\t\t\tref.current.style.height = `${window.innerHeight - (ref.current.getBoundingClientRect()?.top || 0) - 10}px`;\n\t\t}\n\t});\n\n\tconst onUpdateThemes = (id: string, newValue: string) => {\n\t\tsetTheme({\n\t\t\t...theme,\n\t\t\t[id]: newValue,\n\t\t});\n\t\tupdateThemes(id, newValue);\n\t};\n\n\treturn (\n\t\t<View>\n\t\t\t<Header\n\t\t\t\thelpFunction={() => {\n\t\t\t\t\tlaunchTutorialLink(\"SDD-03-Theme\");\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\tTheme\n\t\t\t</Header>\n\n\t\t\t<Content>\n\t\t\t\t<Tab>\n\t\t\t\t\t<div data-label=\"Themes\">\n\t\t\t\t\t\t<div className=\"frontmatter\">\n\t\t\t\t\t\t\tUse a template to set or reset your theme.\n\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\tUse either template to start building your own theme.\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t<div className=\"template-row\">\n\t\t\t\t\t\t\t<label>Templates:</label>\n\t\t\t\t\t\t\t<Button fashion=\"primary\" iconBefore=\"moon\" text=\"Dark theme\" onClick={applyDarkTheme} />\n\t\t\t\t\t\t\t<Button fashion=\"primary\" iconBefore=\"sun\" text=\"Light theme\" onClick={applyLightTheme} />\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t<ThemePage theme={theme} updateThemes={onUpdateThemes} />\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div data-label=\"Images\">\n\t\t\t\t\t\t<div className=\"frontmatter\">\n\t\t\t\t\t\t\tBrowse your computer for images to use in Finsemble.\n\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\tYou can also drag and drop images into the fields below.\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<AssetsPage\n\t\t\t\t\t\t\tupdateSplashScreen={updateSplashScreen}\n\t\t\t\t\t\t\tupdateToolbarIcon={updateToolbarIcon}\n\t\t\t\t\t\t\tupdateTaskbarIcon={updateTaskbarIcon}\n\t\t\t\t\t\t\tupdateSystemTrayIcon={updateSystemTrayIcon}\n\t\t\t\t\t\t\tupdateInstallerIcon={updateInstallerIcon}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</Tab>\n\t\t\t</Content>\n\t\t</View>\n\t);\n};\n"]}
@@ -6,22 +6,10 @@
6
6
  import { FileInputUploadCb } from "../common/FileInput";
7
7
  import "./AssetsPage.css";
8
8
  export declare type AssetsPageProps = {
9
- baseURL: string;
10
- toolbarIcon: string;
11
- setToolbarIcon: (s: string) => void;
12
- taskbarIcon: string;
13
- setTaskbarIcon: (s: string) => void;
14
- installerIcon: string;
15
- setInstallerIcon: (s: string) => void;
16
- systemTrayIcon: string;
17
- setSystemTrayIcon: (s: string) => void;
18
- splashScreenImage: string;
19
- setSplashScreenImage: (s: string) => void;
20
- setIconsChanged: (n: number) => void;
21
9
  updateSplashScreen: FileInputUploadCb;
22
10
  updateToolbarIcon: FileInputUploadCb;
23
11
  updateTaskbarIcon: FileInputUploadCb;
24
12
  updateSystemTrayIcon: FileInputUploadCb;
25
13
  updateInstallerIcon: FileInputUploadCb;
26
14
  };
27
- export declare const AssetsPage: ({ baseURL, toolbarIcon, setToolbarIcon, taskbarIcon, setTaskbarIcon, installerIcon, setInstallerIcon, systemTrayIcon, setSystemTrayIcon, splashScreenImage, setSplashScreenImage, setIconsChanged, updateSplashScreen, updateToolbarIcon, updateTaskbarIcon, updateSystemTrayIcon, updateInstallerIcon, }: AssetsPageProps) => JSX.Element;
15
+ export declare const AssetsPage: ({ updateSplashScreen, updateToolbarIcon, updateTaskbarIcon, updateSystemTrayIcon, updateInstallerIcon, }: AssetsPageProps) => JSX.Element;
@@ -5,52 +5,55 @@
5
5
  import React from "react";
6
6
  import { ImagePreview, ImagePreviewSize } from "../common/ImagePreview";
7
7
  import { Tooltip } from "../common/Tooltip";
8
+ import { useSelector, useDispatch } from "../../store";
9
+ import { SmartDesktopDesignerActions } from "../../actions/smartDesktopDesignerActions";
8
10
  import "./AssetsPage.css";
9
- export const AssetsPage = ({ baseURL, toolbarIcon, setToolbarIcon, taskbarIcon, setTaskbarIcon, installerIcon, setInstallerIcon, systemTrayIcon, setSystemTrayIcon, splashScreenImage, setSplashScreenImage, setIconsChanged, updateSplashScreen, updateToolbarIcon, updateTaskbarIcon, updateSystemTrayIcon, updateInstallerIcon, }) => (React.createElement("div", { className: "images-section" },
10
- React.createElement("fieldset", { className: "project-assets" },
11
- React.createElement("div", { className: "project-assets-field" },
12
- React.createElement("label", { htmlFor: "export-splash-screen" },
13
- React.createElement("span", null, "Splash screen"),
14
- React.createElement(Tooltip, null, "The Splash screen should be 600px X 400px (W x H). Supported formats are PNG, JPG, and GIF.")),
15
- React.createElement("div", { className: "project-splash-screen-field" },
16
- React.createElement(ImagePreview, { id: "export-splash-screen", value: splashScreenImage, onSetValue: (value) => {
17
- setSplashScreenImage(value);
18
- setIconsChanged(new Date().getTime());
19
- }, uploadFunction: updateSplashScreen, acceptTypes: ["image/png", "image/jpeg", "image/gif"], baseURL: baseURL, previewSize: ImagePreviewSize.LARGE }))),
20
- React.createElement("div", { className: "project-assets-field" },
21
- React.createElement("label", { htmlFor: "export-toolbar-icon" },
22
- React.createElement("span", null, "Toolbar icon"),
23
- React.createElement(Tooltip, null, "The Toolbar icon should be 200px X 200px. Supported formats are PNG, JPG, and GIF.")),
24
- React.createElement("div", { className: "project-icon-field" },
25
- React.createElement(ImagePreview, { id: "export-toolbar-icon", value: toolbarIcon, onSetValue: (value) => {
26
- setToolbarIcon(value);
27
- setIconsChanged(new Date().getTime());
28
- }, uploadFunction: updateToolbarIcon, acceptTypes: ["image/png", "image/jpeg", "image/gif"], baseURL: baseURL }))),
29
- React.createElement("div", { className: "project-assets-field" },
30
- React.createElement("label", { htmlFor: "export-taskbar-icon" },
31
- React.createElement("span", null, "Taskbar icon"),
32
- React.createElement(Tooltip, null, "The Toolbar icon should be 400px X 400px. Supported formats are PNG and JPG")),
33
- React.createElement("div", { className: "project-icon-field" },
34
- React.createElement(ImagePreview, { value: taskbarIcon, id: "export-taskbar-icon", onSetValue: (value) => {
35
- setTaskbarIcon(value);
36
- setIconsChanged(new Date().getTime());
37
- }, uploadFunction: updateTaskbarIcon, acceptTypes: ["image/png", "image/jpeg"], baseURL: baseURL }))),
38
- React.createElement("div", { className: "project-assets-field" },
39
- React.createElement("label", { htmlFor: "export-system-tray-icon" },
40
- React.createElement("span", null, "System Tray Icon"),
41
- React.createElement(Tooltip, null, "The System tray icon should be 100px X 100px. Supported formats are PNG and JPG.")),
42
- React.createElement("div", { className: "project-icon-field" },
43
- React.createElement(ImagePreview, { value: systemTrayIcon, id: "export-system-tray-icon", onSetValue: (value) => {
44
- setSystemTrayIcon(value);
45
- setIconsChanged(new Date().getTime());
46
- }, uploadFunction: updateSystemTrayIcon, acceptTypes: ["image/png", "image/jpeg"], baseURL: baseURL }))),
47
- React.createElement("div", { className: "project-assets-field" },
48
- React.createElement("label", { htmlFor: "export-installer-icon" },
49
- React.createElement("span", null, "Installer Icon"),
50
- React.createElement(Tooltip, null, "Installer icons must use the ICO format. You can create and ICO image from a PNG file using free online services. See the User Guide for more information.")),
51
- React.createElement("div", { className: "project-icon-field" },
52
- React.createElement(ImagePreview, { value: installerIcon, id: "export-installer-icon", onSetValue: (value) => {
53
- setInstallerIcon(value);
54
- setIconsChanged(new Date().getTime());
55
- }, uploadFunction: updateInstallerIcon, acceptTypes: ["image/x-icon"], baseURL: baseURL }))))));
11
+ export const AssetsPage = ({ updateSplashScreen, updateToolbarIcon, updateTaskbarIcon, updateSystemTrayIcon, updateInstallerIcon, }) => {
12
+ const dispatch = useDispatch();
13
+ const project = useSelector((state) => state.smartDesktopDesigner.projectInfo);
14
+ const { splashScreenImage, toolbarIcon, taskbarIcon, installerIcon, systemTrayIcon } = project.export;
15
+ const baseURL = project.applicationRoot;
16
+ return (React.createElement("div", { className: "images-section" },
17
+ React.createElement("fieldset", { className: "project-assets" },
18
+ React.createElement("div", { className: "project-assets-field" },
19
+ React.createElement("label", { htmlFor: "export-splash-screen" },
20
+ React.createElement("span", null, "Splash screen"),
21
+ React.createElement(Tooltip, null, "The Splash screen should be 600px X 400px (W x H). Supported formats are PNG, JPG, and GIF.")),
22
+ React.createElement("div", { className: "project-splash-screen-field" },
23
+ React.createElement(ImagePreview, { id: "export-splash-screen", value: splashScreenImage, onSetValue: (value) => {
24
+ dispatch(SmartDesktopDesignerActions.set_project_info(Object.assign(Object.assign({}, project), { export: Object.assign(Object.assign({}, project.export), { splashScreenImage: value }) })));
25
+ }, uploadFunction: updateSplashScreen, acceptTypes: ["image/png", "image/jpeg", "image/gif"], baseURL: baseURL, previewSize: ImagePreviewSize.LARGE }))),
26
+ React.createElement("div", { className: "project-assets-field" },
27
+ React.createElement("label", { htmlFor: "export-toolbar-icon" },
28
+ React.createElement("span", null, "Toolbar icon"),
29
+ React.createElement(Tooltip, null, "The Toolbar icon should be 200px X 200px. Supported formats are PNG, JPG, and GIF.")),
30
+ React.createElement("div", { className: "project-icon-field" },
31
+ React.createElement(ImagePreview, { id: "export-toolbar-icon", value: toolbarIcon, onSetValue: (value) => {
32
+ dispatch(SmartDesktopDesignerActions.set_project_info(Object.assign(Object.assign({}, project), { export: Object.assign(Object.assign({}, project.export), { toolbarIcon: value }) })));
33
+ }, uploadFunction: updateToolbarIcon, acceptTypes: ["image/png", "image/jpeg", "image/gif"], baseURL: baseURL }))),
34
+ React.createElement("div", { className: "project-assets-field" },
35
+ React.createElement("label", { htmlFor: "export-taskbar-icon" },
36
+ React.createElement("span", null, "Taskbar icon"),
37
+ React.createElement(Tooltip, null, "The Toolbar icon should be 400px X 400px. Supported formats are PNG and JPG")),
38
+ React.createElement("div", { className: "project-icon-field" },
39
+ React.createElement(ImagePreview, { value: taskbarIcon, id: "export-taskbar-icon", onSetValue: (value) => {
40
+ dispatch(SmartDesktopDesignerActions.set_project_info(Object.assign(Object.assign({}, project), { export: Object.assign(Object.assign({}, project.export), { taskbarIcon: value }) })));
41
+ }, uploadFunction: updateTaskbarIcon, acceptTypes: ["image/png", "image/jpeg"], baseURL: baseURL }))),
42
+ React.createElement("div", { className: "project-assets-field" },
43
+ React.createElement("label", { htmlFor: "export-system-tray-icon" },
44
+ React.createElement("span", null, "System Tray Icon"),
45
+ React.createElement(Tooltip, null, "The System tray icon should be 100px X 100px. Supported formats are PNG and JPG.")),
46
+ React.createElement("div", { className: "project-icon-field" },
47
+ React.createElement(ImagePreview, { value: systemTrayIcon, id: "export-system-tray-icon", onSetValue: (value) => {
48
+ dispatch(SmartDesktopDesignerActions.set_project_info(Object.assign(Object.assign({}, project), { export: Object.assign(Object.assign({}, project.export), { systemTrayIcon: value }) })));
49
+ }, uploadFunction: updateSystemTrayIcon, acceptTypes: ["image/png", "image/jpeg"], baseURL: baseURL }))),
50
+ React.createElement("div", { className: "project-assets-field" },
51
+ React.createElement("label", { htmlFor: "export-installer-icon" },
52
+ React.createElement("span", null, "Installer Icon"),
53
+ React.createElement(Tooltip, null, "Installer icons must use the ICO format. You can create and ICO image from a PNG file using free online services. See the User Guide for more information.")),
54
+ React.createElement("div", { className: "project-icon-field" },
55
+ React.createElement(ImagePreview, { value: installerIcon, id: "export-installer-icon", onSetValue: (value) => {
56
+ dispatch(SmartDesktopDesignerActions.set_project_info(Object.assign(Object.assign({}, project), { export: Object.assign(Object.assign({}, project.export), { installerIcon: value }) })));
57
+ }, uploadFunction: updateInstallerIcon, acceptTypes: ["image/x-icon"], baseURL: baseURL }))))));
58
+ };
56
59
  //# sourceMappingURL=AssetsPage.js.map