prosemirror-slash-menu-react 0.0.5 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -127,8 +127,10 @@ override the following classnames.
127
127
 
128
128
  - `menu-display-root` root div for the menu
129
129
  - `menu-element-wrapper` root of menu elements
130
+ - `menu-element-wrapper-clickable` root of menu elements when the menu items are set to be clickable
130
131
  - `menu-element-selected` classname that is added alongside `menu-element-wrapper` when an element is selected
131
132
  - `menu-element-icon` if icon is provided for the element it's rendered in this div
133
+ - `menu-element-right-icon` if right icon is provided its rendered in this div
132
134
  - `menu-element-label` label of the menu element
133
135
  - `menu-placeholder` when there is no matching items for the filter, this is displayed with the text "No matching items"
134
136
  - `menu-filter-wrapper` root of the filter display, positioned above the menu by default
@@ -143,10 +145,13 @@ override the following classnames.
143
145
  - `editorView` prosemirror editor view
144
146
  - `icons` Optional, if you want to provide icons for your menu elements. Type of `{[key: string]: FC}` where the key is
145
147
  the id of the menu element and the value is a `FunctionComponent` that renders the icon
148
+ - `rightIcons` Same as icons but these appear on the right on the menu element, most commonly used for indicating a
149
+ submenu with an arrow
146
150
  - `subMenuIcon` Optional icon for submenu label. By default, when a submenu is open an arrow is displayed indicating
147
151
  that the user is in a subMenu, it can be replaced with a react node of your choice
148
152
  - `filterFieldIcon` Optional icon in the filter field.
149
153
  - `filterPlaceHolder` Optional placeholder text for the filter field.
150
154
  - `mainMenuLabel` Optional label for the main menu. By default, there is none.
151
155
  - `popperReference` Optional popper reference HTMLElement, for displaying the menu next to whatever element you want
152
- - `popperOptions` You can pass in `placement` and `offset` to position your menu around the reference Element
156
+ - `popperOptions` You can pass in `placement` and `offset` to position your menu around the reference Element
157
+ - `clickable` Optional boolean, if true the menu items are clickable, by default they are used only with keyboard
@@ -18,6 +18,13 @@
18
18
  padding: 0.2rem 0.5rem;
19
19
  }
20
20
 
21
+ .menu-element-wrapper-clickable {
22
+ display: flex;
23
+ border-radius: 0.3rem;
24
+ padding: 0.2rem 0.5rem;
25
+ cursor: pointer;
26
+ }
27
+
21
28
  .menu-element-selected {
22
29
  background-color: #f1f1f1;
23
30
  }
@@ -29,6 +36,15 @@
29
36
  align-items: center;
30
37
  }
31
38
 
39
+ .menu-element-right-icon {
40
+ margin-left: auto;
41
+ width: 23px;
42
+ height: auto;
43
+ display: flex;
44
+ align-items: center;
45
+ margin-right: 0.5rem;
46
+ }
47
+
32
48
  .menu-element-label {
33
49
  color: black;
34
50
  display: flex;
@@ -18,6 +18,13 @@
18
18
  padding: 0.2rem 0.5rem;
19
19
  }
20
20
 
21
+ .menu-element-wrapper-clickable {
22
+ display: flex;
23
+ border-radius: 0.3rem;
24
+ padding: 0.2rem 0.5rem;
25
+ cursor: pointer;
26
+ }
27
+
21
28
  .menu-element-selected {
22
29
  background-color: #f1f1f1;
23
30
  }
@@ -29,6 +36,15 @@
29
36
  align-items: center;
30
37
  }
31
38
 
39
+ .menu-element-right-icon {
40
+ margin-left: auto;
41
+ width: 23px;
42
+ height: auto;
43
+ display: flex;
44
+ align-items: center;
45
+ margin-right: 0.5rem;
46
+ }
47
+
32
48
  .menu-element-label {
33
49
  color: black;
34
50
  display: flex;
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export * from "./slashMenuReact/display";
2
- export * from "./slashMenuReact/defaults";
1
+ export * from "./slashMenuReact/display";
2
+ export * from "./slashMenuReact/defaults";