@manuscripts/style-guide 2.0.3-LEAN-3573-menus.0 → 2.0.3-LEAN-3858

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 (31) hide show
  1. package/dist/cjs/components/InsertTableDialog.js +130 -0
  2. package/dist/cjs/components/Menus/Menus.js +126 -13
  3. package/dist/cjs/components/Menus/Submenu.js +39 -25
  4. package/dist/cjs/components/Menus/index.js +0 -1
  5. package/dist/cjs/components/SystemUserAvatar.js +77 -0
  6. package/dist/cjs/components/icons/avatar.js +4 -2
  7. package/dist/cjs/components/icons/index.js +4 -2
  8. package/dist/cjs/components/icons/system-user-avatar.js +12 -0
  9. package/dist/cjs/hooks/use-menus.js +5 -2
  10. package/dist/cjs/index.js +1 -0
  11. package/dist/es/components/InsertTableDialog.js +100 -0
  12. package/dist/es/components/Menus/Menus.js +101 -12
  13. package/dist/es/components/Menus/Submenu.js +37 -22
  14. package/dist/es/components/Menus/index.js +0 -1
  15. package/dist/es/components/SystemUserAvatar.js +47 -0
  16. package/dist/es/components/icons/avatar.js +4 -2
  17. package/dist/es/components/icons/index.js +1 -0
  18. package/dist/es/components/icons/system-user-avatar.js +7 -0
  19. package/dist/es/hooks/use-menus.js +5 -2
  20. package/dist/es/index.js +1 -0
  21. package/dist/types/components/InsertTableDialog.d.ts +22 -0
  22. package/dist/types/components/Menus/Menus.d.ts +22 -2
  23. package/dist/types/components/Menus/Submenu.d.ts +3 -4
  24. package/dist/types/components/Menus/index.d.ts +0 -1
  25. package/dist/types/components/SystemUserAvatar.d.ts +23 -0
  26. package/dist/types/components/icons/index.d.ts +1 -0
  27. package/dist/types/components/icons/system-user-avatar.d.ts +4 -0
  28. package/dist/types/hooks/use-menus.d.ts +2 -2
  29. package/dist/types/index.d.ts +1 -0
  30. package/dist/types/lib/menus.d.ts +11 -7
  31. package/package.json +2 -2
@@ -13,25 +13,29 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import React from 'react';
16
+ import { ManuscriptTransaction } from '@manuscripts/transform';
17
+ export type Dispatch = (tr: ManuscriptTransaction) => void;
17
18
  export interface MenuShortcut {
18
19
  mac: string;
19
20
  pc: string;
20
21
  }
21
- export interface MenuComponentProps {
22
- menu: Menu;
23
- handleClick: (position: number[]) => void;
24
- }
22
+ export type TableConfig = {
23
+ numberOfColumns: number;
24
+ numberOfRows: number;
25
+ includeHeader: boolean;
26
+ };
25
27
  export interface MenuSpec {
26
28
  id: string;
27
29
  label: string;
28
30
  role?: string;
29
31
  shortcut?: MenuShortcut;
30
- component?: React.FC<MenuComponentProps>;
31
32
  isActive?: boolean;
32
33
  isEnabled: boolean;
33
- run?: () => void;
34
+ run?: (tableConfig?: TableConfig) => void;
34
35
  submenu?: (MenuSpec | MenuSeparator)[];
36
+ options?: {
37
+ [key: string]: () => void;
38
+ };
35
39
  }
36
40
  export interface Menu extends MenuSpec {
37
41
  isOpen: boolean;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@manuscripts/style-guide",
3
3
  "description": "Shared components for Manuscripts applications",
4
- "version": "2.0.3-LEAN-3573-menus.0",
4
+ "version": "2.0.3-LEAN-3858",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-style-guide",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",
@@ -33,7 +33,7 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@manuscripts/json-schema": "2.2.10",
36
- "@manuscripts/transform": "2.3.21",
36
+ "@manuscripts/transform": "2.3.22",
37
37
  "@reach/tabs": "^0.18.0",
38
38
  "date-fns": "^2.29.3",
39
39
  "formik": "^2.2.9",