@jetbrains/ring-ui 7.0.0-beta.8 → 7.0.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.
- package/babel.config.js +20 -14
- package/components/alert/alert.css +7 -7
- package/components/alert/alert.d.ts +2 -2
- package/components/alert/alert.js +10 -12
- package/components/alert/container.js +1 -1
- package/components/alert-service/alert-service.js +4 -2
- package/components/analytics/analytics__custom-plugin.js +1 -1
- package/components/auth/auth.js +1 -1
- package/components/auth/auth__core.js +36 -36
- package/components/auth/background-flow.js +2 -2
- package/components/auth/down-notification.js +3 -1
- package/components/auth/iframe-flow.js +4 -2
- package/components/auth/request-builder.js +5 -5
- package/components/auth/storage.js +10 -9
- package/components/auth/token-validator.js +8 -15
- package/components/auth-dialog/auth-dialog.js +8 -8
- package/components/auth-dialog-service/auth-dialog-service.js +4 -4
- package/components/avatar/avatar.js +9 -7
- package/components/avatar/fallback-avatar.js +15 -12
- package/components/button/button.css +36 -25
- package/components/button/button.js +9 -9
- package/components/button/button__classes.d.ts +1 -1
- package/components/button/button__classes.js +3 -4
- package/components/button-group/button-group.css +25 -13
- package/components/button-group/caption.js +1 -1
- package/components/button-toolbar/button-toolbar.d.ts +1 -1
- package/components/button-toolbar/button-toolbar.js +2 -2
- package/components/caret/caret.js +8 -8
- package/components/checkbox/checkbox.css +8 -5
- package/components/checkbox/checkbox.js +1 -1
- package/components/clipboard/clipboard-fallback.js +2 -6
- package/components/clipboard/clipboard.js +5 -5
- package/components/code/code.d.ts +1 -1
- package/components/code/code.js +2 -2
- package/components/code/highlight.css +3 -1
- package/components/collapse/collapse-content.d.ts +1 -2
- package/components/collapse/collapse-content.js +25 -14
- package/components/collapse/collapse-context.js +1 -1
- package/components/collapse/collapse-control.js +5 -3
- package/components/collapse/collapse.css +21 -20
- package/components/collapse/collapse.js +2 -2
- package/components/confirm/confirm.d.ts +2 -2
- package/components/confirm/confirm.js +2 -2
- package/components/confirm-service/confirm-service.d.ts +1 -1
- package/components/confirm-service/confirm-service.js +6 -6
- package/components/content-layout/content-layout.css +6 -5
- package/components/content-layout/content-layout.js +7 -6
- package/components/content-layout/sidebar.js +5 -5
- package/components/contenteditable/contenteditable.d.ts +1 -1
- package/components/contenteditable/contenteditable.js +3 -4
- package/components/control-label/control-label.js +5 -3
- package/components/data-list/data-list.css +3 -3
- package/components/data-list/data-list.d.ts +2 -2
- package/components/data-list/data-list.js +6 -7
- package/components/data-list/data-list.mock.js +57 -47
- package/components/data-list/item.js +14 -16
- package/components/data-list/selection.js +5 -7
- package/components/data-list/title.js +5 -6
- package/components/date-picker/consts.js +2 -2
- package/components/date-picker/date-input.js +4 -4
- package/components/date-picker/date-picker.css +23 -18
- package/components/date-picker/date-picker.d.ts +2 -1
- package/components/date-picker/date-picker.js +13 -19
- package/components/date-picker/date-popup.js +30 -36
- package/components/date-picker/day.js +6 -9
- package/components/date-picker/formats.js +647 -1
- package/components/date-picker/month-names.js +6 -8
- package/components/date-picker/month-slider.js +2 -2
- package/components/date-picker/month.js +1 -3
- package/components/date-picker/months.js +2 -6
- package/components/date-picker/weekdays.js +2 -3
- package/components/date-picker/years.js +3 -3
- package/components/dialog/dialog.d.ts +1 -0
- package/components/dialog/dialog.js +20 -13
- package/components/dialog/dialog__body-scroll-preventer.js +1 -1
- package/components/dropdown/dropdown.css +2 -4
- package/components/dropdown/dropdown.d.ts +2 -2
- package/components/dropdown/dropdown.js +5 -5
- package/components/dropdown-menu/dropdown-menu.js +5 -5
- package/components/editable-heading/editable-heading.css +5 -2
- package/components/editable-heading/editable-heading.js +21 -19
- package/components/error-bubble/error-bubble.js +1 -1
- package/components/error-message/error-message.js +2 -4
- package/components/footer/footer.js +11 -15
- package/components/form/form.stories.js +45 -63
- package/components/global/create-stateful-context.js +2 -4
- package/components/global/data-tests.js +5 -6
- package/components/global/dom.js +8 -11
- package/components/global/focus-sensor-hoc.js +5 -6
- package/components/global/fuzzy-highlight.js +1 -1
- package/components/global/get-event-key.js +2 -2
- package/components/global/global.css +0 -3
- package/components/global/linear-function.js +1 -1
- package/components/global/normalize-indent.js +2 -6
- package/components/global/react-dom-renderer.js +2 -3
- package/components/global/theme.d.ts +4 -2
- package/components/global/theme.js +14 -12
- package/components/global/url.js +8 -8
- package/components/global/variables.css +1 -8
- package/components/global/variables_dark.css +0 -1
- package/components/grid/col.js +6 -6
- package/components/grid/grid.css +174 -173
- package/components/grid/grid.js +1 -1
- package/components/grid/row.js +13 -6
- package/components/group/group.js +1 -1
- package/components/header/header-icon.js +2 -2
- package/components/header/header.css +19 -15
- package/components/header/header.js +3 -5
- package/components/header/links.js +1 -1
- package/components/header/logo.js +1 -1
- package/components/header/profile.d.ts +2 -2
- package/components/header/profile.js +9 -9
- package/components/header/services-link.js +1 -1
- package/components/header/services.js +4 -5
- package/components/header/smart-profile.js +4 -3
- package/components/header/smart-services.js +9 -5
- package/components/header/tray.js +1 -1
- package/components/heading/heading.css +0 -1
- package/components/heading/heading.js +2 -2
- package/components/http/http.d.ts +3 -3
- package/components/http/http.js +25 -29
- package/components/http/http.mock.js +9 -6
- package/components/hub-source/hub-source.js +5 -7
- package/components/hub-source/hub-source__user.js +1 -1
- package/components/hub-source/hub-source__users-groups.js +6 -7
- package/components/i18n/README.md +3 -4
- package/components/i18n/i18n-context.js +2 -4
- package/components/icon/icon.css +1 -1
- package/components/icon/icon.js +7 -9
- package/components/icon/icon__svg.js +6 -6
- package/components/input/input.css +1 -1
- package/components/input/input.js +11 -14
- package/components/input-size/input-size.stories.js +42 -22
- package/components/island/adaptive-island-hoc.js +1 -1
- package/components/island/content.js +4 -6
- package/components/island/header.js +8 -10
- package/components/island/island.css +5 -5
- package/components/island/island.js +1 -1
- package/components/link/clickableLink.js +3 -1
- package/components/link/link.js +5 -3
- package/components/list/consts.js +1 -1
- package/components/list/list.d.ts +1 -1
- package/components/list/list.js +35 -57
- package/components/list/list__custom.js +3 -5
- package/components/list/list__hint.js +3 -1
- package/components/list/list__item.js +11 -9
- package/components/list/list__link.js +1 -1
- package/components/list/list__separator.js +2 -2
- package/components/list/list__title.js +7 -3
- package/components/list/list__users-groups-source.js +6 -8
- package/components/loader/loader.js +1 -1
- package/components/loader/loader__core.js +5 -5
- package/components/loader-inline/loader-inline.css +0 -3
- package/components/loader-inline/loader-inline.js +5 -7
- package/components/loader-screen/loader-screen.js +1 -1
- package/components/login-dialog/login-dialog.js +4 -4
- package/components/login-dialog/service.js +5 -5
- package/components/markdown/markdown.css +6 -6
- package/components/markdown/markdown.d.ts +2 -2
- package/components/markdown/markdown.js +4 -6
- package/components/message/message.css +2 -1
- package/components/message/message.js +30 -21
- package/components/old-browsers-message/old-browsers-message.js +2 -2
- package/components/old-browsers-message/white-list.js +2 -3
- package/components/pager/pager.js +28 -29
- package/components/permissions/permissions.js +8 -13
- package/components/permissions/permissions__cache.js +6 -7
- package/components/popup/popup.consts.js +8 -2
- package/components/popup/popup.js +27 -33
- package/components/popup/popup.target.js +4 -4
- package/components/popup/position.js +21 -28
- package/components/popup-menu/popup-menu.js +1 -1
- package/components/progress-bar/progress-bar.css +10 -8
- package/components/progress-bar/progress-bar.d.ts +2 -2
- package/components/progress-bar/progress-bar.js +2 -2
- package/components/query-assist/query-assist.css +0 -3
- package/components/query-assist/query-assist.js +73 -84
- package/components/query-assist/query-assist__suggestions.js +10 -9
- package/components/radio/radio.css +6 -2
- package/components/radio/radio.js +1 -3
- package/components/scrollable-section/scrollable-section.css +5 -6
- package/components/scrollable-section/scrollable-section.js +1 -1
- package/components/select/select.css +5 -7
- package/components/select/select.d.ts +1 -1
- package/components/select/select.js +96 -110
- package/components/select/select__filter.js +1 -1
- package/components/select/select__popup.js +40 -51
- package/components/shortcuts/core.js +8 -6
- package/components/shortcuts/shortcut-title.js +6 -6
- package/components/shortcuts/shortcuts.js +1 -1
- package/components/sidebar/sidebar.css +3 -1
- package/components/slider/slider.css +14 -14
- package/components/slider/slider.js +7 -7
- package/components/tab-trap/tab-trap.js +7 -9
- package/components/table/cell.js +3 -1
- package/components/table/disable-hover-hoc.js +2 -2
- package/components/table/header-cell.js +5 -3
- package/components/table/header.d.ts +2 -10
- package/components/table/header.js +10 -12
- package/components/table/multitable.js +5 -3
- package/components/table/row.d.ts +0 -1
- package/components/table/row.js +20 -27
- package/components/table/selection-adapter.js +1 -1
- package/components/table/selection-shortcuts-hoc.js +2 -2
- package/components/table/selection.d.ts +2 -3
- package/components/table/selection.js +4 -5
- package/components/table/simple-table.js +4 -4
- package/components/table/smart-table.js +5 -5
- package/components/table/table.css +8 -9
- package/components/table/table.d.ts +0 -1
- package/components/table/table.js +22 -23
- package/components/table/table.stories.json +45 -16
- package/components/tabs/collapsible-more.d.ts +1 -1
- package/components/tabs/collapsible-more.js +13 -16
- package/components/tabs/collapsible-tab.js +2 -2
- package/components/tabs/collapsible-tabs.d.ts +2 -2
- package/components/tabs/collapsible-tabs.js +13 -22
- package/components/tabs/dumb-tabs.js +6 -9
- package/components/tabs/smart-tabs.js +4 -4
- package/components/tabs/tab-link.js +1 -3
- package/components/tabs/tabs.css +7 -9
- package/components/tag/tag.css +7 -7
- package/components/tag/tag.d.ts +1 -1
- package/components/tag/tag.js +9 -12
- package/components/tags-input/tags-input.js +15 -19
- package/components/tags-list/tags-list.d.ts +2 -2
- package/components/tags-list/tags-list.js +6 -5
- package/components/text/text.js +5 -3
- package/components/toggle/toggle.css +12 -10
- package/components/toggle/toggle.d.ts +2 -2
- package/components/toggle/toggle.js +4 -3
- package/components/tooltip/tooltip.d.ts +4 -1
- package/components/tooltip/tooltip.js +19 -10
- package/components/user-agreement/service.js +15 -13
- package/components/user-agreement/user-agreement.js +3 -5
- package/components/user-card/card.js +10 -9
- package/components/user-card/smart-user-card-tooltip.js +5 -7
- package/components/user-card/tooltip.js +4 -4
- package/components/user-card/user-card.css +4 -0
- package/jslint-xml.js +20 -19
- package/package.json +66 -58
- package/postcss.config.js +3 -4
- package/typings.d.ts +2 -4
- package/webpack.config.js +20 -25
- package/components/badge/badge.css +0 -42
- package/components/badge/badge.d.ts +0 -14
- package/components/badge/badge.js +0 -29
- package/components/island-legacy/content-legacy.d.ts +0 -5
- package/components/island-legacy/content-legacy.js +0 -12
- package/components/island-legacy/header-legacy.d.ts +0 -5
- package/components/island-legacy/header-legacy.js +0 -14
- package/components/island-legacy/island-legacy.css +0 -98
- package/components/island-legacy/island-legacy.d.ts +0 -7
- package/components/island-legacy/island-legacy.js +0 -14
- package/components/table-legacy/table-legacy.css +0 -346
- package/components/table-legacy/table-legacy__toolbar.css +0 -25
package/components/list/list.js
CHANGED
|
@@ -37,19 +37,14 @@ function isItemType(listItemType, item) {
|
|
|
37
37
|
}
|
|
38
38
|
return type === listItemType;
|
|
39
39
|
}
|
|
40
|
-
const nonActivatableTypes = [
|
|
41
|
-
Type.SEPARATOR,
|
|
42
|
-
Type.TITLE,
|
|
43
|
-
Type.MARGIN
|
|
44
|
-
];
|
|
40
|
+
const nonActivatableTypes = [Type.SEPARATOR, Type.TITLE, Type.MARGIN];
|
|
45
41
|
function isActivatable(item) {
|
|
46
42
|
return item != null && !nonActivatableTypes.includes(item.rgItemType) && !item.disabled;
|
|
47
43
|
}
|
|
48
44
|
function getDataHash(data) {
|
|
49
45
|
return data.map(it => `${it.key}-${it.disabled}`).join('-');
|
|
50
46
|
}
|
|
51
|
-
const shouldActivateFirstItem = (props) => props.activateFirstItem ||
|
|
52
|
-
props.activateSingleItem && props.data.length === 1;
|
|
47
|
+
const shouldActivateFirstItem = (props) => props.activateFirstItem || (props.activateSingleItem && props.data.length === 1);
|
|
53
48
|
export const ActiveItemContext = createStatefulContext(undefined, 'ActiveItem');
|
|
54
49
|
/**
|
|
55
50
|
* @name List
|
|
@@ -72,7 +67,7 @@ export default class List extends Component {
|
|
|
72
67
|
shortcuts: false,
|
|
73
68
|
renderOptimization: true,
|
|
74
69
|
disableMoveDownOverflow: false,
|
|
75
|
-
ariaLabel: 'List'
|
|
70
|
+
ariaLabel: 'List',
|
|
76
71
|
};
|
|
77
72
|
state = {
|
|
78
73
|
activeIndex: null,
|
|
@@ -83,7 +78,7 @@ export default class List extends Component {
|
|
|
83
78
|
scrolling: false,
|
|
84
79
|
hasOverflow: false,
|
|
85
80
|
disabledHover: false,
|
|
86
|
-
scrolledToBottom: false
|
|
81
|
+
scrolledToBottom: false,
|
|
87
82
|
};
|
|
88
83
|
static getDerivedStateFromProps(nextProps, prevState) {
|
|
89
84
|
const { prevActiveIndex, prevData, activeItem } = prevState;
|
|
@@ -92,26 +87,23 @@ export default class List extends Component {
|
|
|
92
87
|
if (data !== prevData) {
|
|
93
88
|
Object.assign(nextState, {
|
|
94
89
|
activeIndex: null,
|
|
95
|
-
activeItem: null
|
|
90
|
+
activeItem: null,
|
|
96
91
|
});
|
|
97
92
|
}
|
|
98
93
|
if (activeIndex != null && activeIndex !== prevActiveIndex && data[activeIndex] != null) {
|
|
99
94
|
Object.assign(nextState, {
|
|
100
95
|
activeIndex,
|
|
101
96
|
activeItem: data[activeIndex],
|
|
102
|
-
needScrollToActive: true
|
|
97
|
+
needScrollToActive: true,
|
|
103
98
|
});
|
|
104
99
|
}
|
|
105
|
-
else if (data !== prevData &&
|
|
106
|
-
restoreActiveIndex &&
|
|
107
|
-
activeItem != null &&
|
|
108
|
-
activeItem.key != null) {
|
|
100
|
+
else if (data !== prevData && restoreActiveIndex && activeItem != null && activeItem.key != null) {
|
|
109
101
|
// Restore active index if there is an item with the same "key" property
|
|
110
102
|
const index = data.findIndex(item => item.key === activeItem.key);
|
|
111
103
|
if (index >= 0) {
|
|
112
104
|
Object.assign(nextState, {
|
|
113
105
|
activeIndex: index,
|
|
114
|
-
activeItem: data[index]
|
|
106
|
+
activeItem: data[index],
|
|
115
107
|
});
|
|
116
108
|
}
|
|
117
109
|
}
|
|
@@ -125,9 +117,8 @@ export default class List extends Component {
|
|
|
125
117
|
}
|
|
126
118
|
}
|
|
127
119
|
shouldComponentUpdate(nextProps, nextState) {
|
|
128
|
-
return nextProps !== this.props ||
|
|
129
|
-
Object.keys(nextState).
|
|
130
|
-
some(key => nextState[key] !== this.state[key]);
|
|
120
|
+
return (nextProps !== this.props ||
|
|
121
|
+
Object.keys(nextState).some(key => nextState[key] !== this.state[key]));
|
|
131
122
|
}
|
|
132
123
|
componentDidUpdate(prevProps) {
|
|
133
124
|
if (this.virtualizedList && prevProps.data !== this.props.data) {
|
|
@@ -151,7 +142,7 @@ export default class List extends Component {
|
|
|
151
142
|
static ListHint = ListHint;
|
|
152
143
|
static ListProps = {
|
|
153
144
|
Type,
|
|
154
|
-
Dimension
|
|
145
|
+
Dimension,
|
|
155
146
|
};
|
|
156
147
|
virtualizedList;
|
|
157
148
|
unmounted;
|
|
@@ -164,7 +155,7 @@ export default class List extends Component {
|
|
|
164
155
|
this.setState({
|
|
165
156
|
activeIndex: index,
|
|
166
157
|
activeItem: this.props.data[index],
|
|
167
|
-
needScrollToActive: false
|
|
158
|
+
needScrollToActive: false,
|
|
168
159
|
});
|
|
169
160
|
}
|
|
170
161
|
}));
|
|
@@ -197,7 +188,7 @@ export default class List extends Component {
|
|
|
197
188
|
_cache = new CellMeasurerCache({
|
|
198
189
|
defaultHeight: this.defaultItemHeight(),
|
|
199
190
|
fixedWidth: true,
|
|
200
|
-
keyMapper: this.sizeCacheKey
|
|
191
|
+
keyMapper: this.sizeCacheKey,
|
|
201
192
|
});
|
|
202
193
|
_hasActivatableItems = memoizeOne(items => items.some(isActivatable));
|
|
203
194
|
hasActivatableItems() {
|
|
@@ -209,7 +200,7 @@ export default class List extends Component {
|
|
|
209
200
|
this.setState({
|
|
210
201
|
activeIndex: firstActivatableIndex,
|
|
211
202
|
activeItem: this.props.data[firstActivatableIndex],
|
|
212
|
-
needScrollToActive: true
|
|
203
|
+
needScrollToActive: true,
|
|
213
204
|
});
|
|
214
205
|
}
|
|
215
206
|
};
|
|
@@ -295,7 +286,7 @@ export default class List extends Component {
|
|
|
295
286
|
this.setState({
|
|
296
287
|
activeIndex: correctedIndex,
|
|
297
288
|
activeItem: item,
|
|
298
|
-
needScrollToActive: true
|
|
289
|
+
needScrollToActive: true,
|
|
299
290
|
}, function onSet() {
|
|
300
291
|
if (!isActivatable(item)) {
|
|
301
292
|
retryCallback(e);
|
|
@@ -342,7 +333,7 @@ export default class List extends Component {
|
|
|
342
333
|
clearSelected = () => {
|
|
343
334
|
this.setState({
|
|
344
335
|
activeIndex: null,
|
|
345
|
-
needScrollToActive: false
|
|
336
|
+
needScrollToActive: false,
|
|
346
337
|
});
|
|
347
338
|
};
|
|
348
339
|
defaultItemHeight() {
|
|
@@ -366,7 +357,7 @@ export default class List extends Component {
|
|
|
366
357
|
checkOverflow = () => {
|
|
367
358
|
if (this.inner) {
|
|
368
359
|
this.setState({
|
|
369
|
-
hasOverflow: this.inner.scrollHeight - this.inner.clientHeight > 1
|
|
360
|
+
hasOverflow: this.inner.scrollHeight - this.inner.clientHeight > 1,
|
|
370
361
|
});
|
|
371
362
|
}
|
|
372
363
|
};
|
|
@@ -408,7 +399,7 @@ export default class List extends Component {
|
|
|
408
399
|
}
|
|
409
400
|
const itemProps = Object.assign({ rgItemType: DEFAULT_ITEM_TYPE }, restProps);
|
|
410
401
|
itemKey = key || itemId;
|
|
411
|
-
itemProps.hover =
|
|
402
|
+
itemProps.hover = realIndex === this.state.activeIndex;
|
|
412
403
|
if (itemProps.hoverClassName != null && itemProps.hover) {
|
|
413
404
|
itemProps.className = classNames(itemProps.className, itemProps.hoverClassName);
|
|
414
405
|
}
|
|
@@ -454,17 +445,13 @@ export default class List extends Component {
|
|
|
454
445
|
}
|
|
455
446
|
el = <ItemComponent {...itemProps} key={itemProps.key}/>;
|
|
456
447
|
}
|
|
457
|
-
return parent
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
</CellMeasurer>)
|
|
465
|
-
: (<div role="row" id={itemId} key={itemKey}>
|
|
466
|
-
<div role="cell">{el}</div>
|
|
467
|
-
</div>);
|
|
448
|
+
return parent ? (<CellMeasurer cache={this._cache} key={itemKey} parent={parent} rowIndex={index} columnIndex={0}>
|
|
449
|
+
{({ registerChild }) => (<div ref={registerChild} style={style} role="row" id={itemId}>
|
|
450
|
+
<div role="cell">{el}</div>
|
|
451
|
+
</div>)}
|
|
452
|
+
</CellMeasurer>) : (<div role="row" id={itemId} key={itemKey}>
|
|
453
|
+
<div role="cell">{el}</div>
|
|
454
|
+
</div>);
|
|
468
455
|
};
|
|
469
456
|
addItemDataTestToProp = (props) => {
|
|
470
457
|
props['data-test'] = dataTests('ring-list-item', props['data-test']);
|
|
@@ -483,7 +470,7 @@ export default class List extends Component {
|
|
|
483
470
|
}
|
|
484
471
|
return this._inner;
|
|
485
472
|
}
|
|
486
|
-
renderVirtualizedInner({ height, maxHeight, autoHeight = false, rowCount, isScrolling, onChildScroll = noop, scrollTop, registerChild }) {
|
|
473
|
+
renderVirtualizedInner({ height, maxHeight, autoHeight = false, rowCount, isScrolling, onChildScroll = noop, scrollTop, registerChild, }) {
|
|
487
474
|
const dirOverride = { direction: 'inherit' }; // Virtualized sets "direction: ltr" by default https://github.com/bvaughn/react-virtualized/issues/457
|
|
488
475
|
return (<AutoSizer disableHeight onResize={this.props.onResize}>
|
|
489
476
|
{({ width }) => (<div ref={registerChild}>
|
|
@@ -492,9 +479,7 @@ export default class List extends Component {
|
|
|
492
479
|
this.scrollEndHandler();
|
|
493
480
|
}} scrollTop={scrollTop} rowCount={rowCount} estimatedRowSize={this.defaultItemHeight()} rowHeight={this._cache.rowHeight} rowRenderer={this.renderItem} overscanRowCount={this._bufferSize}
|
|
494
481
|
// ensure rerendering
|
|
495
|
-
noop={() => { }} scrollToIndex={!this.props.disableScrollToActive &&
|
|
496
|
-
this.state.needScrollToActive &&
|
|
497
|
-
this.state.activeIndex != null
|
|
482
|
+
noop={() => { }} scrollToIndex={!this.props.disableScrollToActive && this.state.needScrollToActive && this.state.activeIndex != null
|
|
498
483
|
? this.state.activeIndex + 1
|
|
499
484
|
: undefined} scrollToAlignment="center" deferredMeasurementCache={this._cache} onRowsRendered={this.checkOverflow}/>
|
|
500
485
|
</div>)}
|
|
@@ -504,22 +489,18 @@ export default class List extends Component {
|
|
|
504
489
|
if (maxHeight) {
|
|
505
490
|
return this.renderVirtualizedInner({ height: maxHeight, maxHeight, rowCount });
|
|
506
491
|
}
|
|
507
|
-
return (<WindowScroller>
|
|
508
|
-
{props => this.renderVirtualizedInner({ ...props, rowCount, autoHeight: true })}
|
|
509
|
-
</WindowScroller>);
|
|
492
|
+
return (<WindowScroller>{props => this.renderVirtualizedInner({ ...props, rowCount, autoHeight: true })}</WindowScroller>);
|
|
510
493
|
}
|
|
511
494
|
renderSimple(maxHeight, rowCount) {
|
|
512
495
|
const items = [];
|
|
513
496
|
for (let index = 0; index < rowCount; index++) {
|
|
514
497
|
items.push(this.renderItem({
|
|
515
498
|
index,
|
|
516
|
-
isScrolling: this.state.scrolling
|
|
499
|
+
isScrolling: this.state.scrolling,
|
|
517
500
|
}));
|
|
518
501
|
}
|
|
519
502
|
return (<div className={classNames('ring-list__i', styles.simpleInner)} onScroll={this.scrollHandler} onMouseMove={this.mouseHandler}>
|
|
520
|
-
<div aria-label={this.props.ariaLabel} role="grid" style={maxHeight
|
|
521
|
-
? { maxHeight: this.getVisibleListHeight(maxHeight) }
|
|
522
|
-
: undefined}>
|
|
503
|
+
<div aria-label={this.props.ariaLabel} role="grid" style={maxHeight ? { maxHeight: this.getVisibleListHeight(maxHeight) } : undefined}>
|
|
523
504
|
{items}
|
|
524
505
|
</div>
|
|
525
506
|
</div>);
|
|
@@ -535,11 +516,11 @@ export default class List extends Component {
|
|
|
535
516
|
'meta+enter': this.enterHandler,
|
|
536
517
|
'ctrl+enter': this.enterHandler,
|
|
537
518
|
'command+enter': this.enterHandler,
|
|
538
|
-
'shift+enter': this.enterHandler
|
|
519
|
+
'shift+enter': this.enterHandler,
|
|
539
520
|
};
|
|
540
521
|
/** @override */
|
|
541
522
|
render() {
|
|
542
|
-
const hint = this.getSelected() && this.props.hintOnSelection || this.props.hint;
|
|
523
|
+
const hint = (this.getSelected() && this.props.hintOnSelection) || this.props.hint;
|
|
543
524
|
const fadeStyles = hint ? { bottom: Dimension.ITEM_HEIGHT } : undefined;
|
|
544
525
|
const rowCount = this.props.data.length + 2;
|
|
545
526
|
const maxHeight = this.props.maxHeight && this.getVisibleListHeight(this.props.maxHeight);
|
|
@@ -547,15 +528,12 @@ export default class List extends Component {
|
|
|
547
528
|
return (<>
|
|
548
529
|
<ActiveItemContext.Updater value={this.getId(this.state.activeItem)} skipUpdate={this.props.hidden || !isActivatable(this.state.activeItem)}/>
|
|
549
530
|
<div id={this.props.id} ref={this.containerRef} className={classes} onMouseOut={this.props.onMouseOut} onBlur={this.props.onMouseOut} onMouseLeave={this.clearSelected} data-test="ring-list">
|
|
550
|
-
{this.props.shortcuts &&
|
|
551
|
-
(<Shortcuts map={this.props.shortcutsMap
|
|
552
|
-
? { ...this.shortcutsMap, ...this.props.shortcutsMap }
|
|
553
|
-
: this.shortcutsMap} scope={this.shortcutsScope}/>)}
|
|
531
|
+
{this.props.shortcuts && (<Shortcuts map={this.props.shortcutsMap ? { ...this.shortcutsMap, ...this.props.shortcutsMap } : this.shortcutsMap} scope={this.shortcutsScope}/>)}
|
|
554
532
|
{this.props.renderOptimization
|
|
555
533
|
? this.renderVirtualized(maxHeight, rowCount)
|
|
556
534
|
: this.renderSimple(maxHeight, rowCount)}
|
|
557
|
-
{this.state.hasOverflow && !this.state.scrolledToBottom &&
|
|
558
|
-
{hint &&
|
|
535
|
+
{this.state.hasOverflow && !this.state.scrolledToBottom && <div className={styles.fade} style={fadeStyles}/>}
|
|
536
|
+
{hint && <ListHint label={hint}/>}
|
|
559
537
|
</div>
|
|
560
538
|
</>);
|
|
561
539
|
}
|
|
@@ -16,14 +16,12 @@ export default class ListCustom extends PureComponent {
|
|
|
16
16
|
const classes = classNames(styles.item, className, {
|
|
17
17
|
[styles.action]: !disabled,
|
|
18
18
|
[styles.hover]: hover && !disabled,
|
|
19
|
-
[styles.scrolling]: scrolling
|
|
19
|
+
[styles.scrolling]: scrolling,
|
|
20
20
|
});
|
|
21
21
|
const dataTest = dataTests('ring-list-item-custom', {
|
|
22
|
-
'ring-list-item-action': !disabled
|
|
22
|
+
'ring-list-item-action': !disabled,
|
|
23
23
|
}, restProps['data-test']);
|
|
24
|
-
const content =
|
|
25
|
-
? template(this.props)
|
|
26
|
-
: template;
|
|
24
|
+
const content = typeof template === 'function' ? template(this.props) : template;
|
|
27
25
|
const TagName = tagName || 'span';
|
|
28
26
|
return (<TagName role={role || 'button'} tabIndex={tabIndex} onClick={onClick} onKeyPress={this.handleKeyPress} onMouseOver={onMouseOver} onFocus={onMouseOver} onMouseUp={onMouseUp} className={classes} data-test={dataTest}>
|
|
29
27
|
{content}
|
|
@@ -7,6 +7,8 @@ import styles from './list.css';
|
|
|
7
7
|
*/
|
|
8
8
|
export default class ListHint extends PureComponent {
|
|
9
9
|
render() {
|
|
10
|
-
return (<span className={classnames(styles.item, styles.hint)} data-test="ring-list-hint">
|
|
10
|
+
return (<span className={classnames(styles.item, styles.hint)} data-test="ring-list-hint">
|
|
11
|
+
{this.props.label}
|
|
12
|
+
</span>);
|
|
11
13
|
}
|
|
12
14
|
}
|
|
@@ -29,16 +29,14 @@ export default class ListItem extends PureComponent {
|
|
|
29
29
|
[styles.hover]: hover && !disabled,
|
|
30
30
|
[styles.compact]: compact,
|
|
31
31
|
[styles.scrolling]: scrolling,
|
|
32
|
-
[styles.disabled]: disabled
|
|
32
|
+
[styles.disabled]: disabled,
|
|
33
33
|
});
|
|
34
34
|
const detailsClasses = classNames({
|
|
35
35
|
[styles.details]: details,
|
|
36
|
-
[styles.padded]: icon !== undefined ||
|
|
37
|
-
checkbox !== undefined ||
|
|
38
|
-
glyph !== undefined
|
|
36
|
+
[styles.padded]: icon !== undefined || checkbox !== undefined || glyph !== undefined,
|
|
39
37
|
});
|
|
40
38
|
const style = {
|
|
41
|
-
paddingLeft: `${(Number(level) || 0) * RING_UNIT + DEFAULT_PADDING + (showCheckbox ? CHECKBOX_WIDTH : 0)}px
|
|
39
|
+
paddingLeft: `${(Number(level) || 0) * RING_UNIT + DEFAULT_PADDING + (showCheckbox ? CHECKBOX_WIDTH : 0)}px`,
|
|
42
40
|
};
|
|
43
41
|
let computedTitle = null;
|
|
44
42
|
if (this._isString(title)) {
|
|
@@ -53,9 +51,11 @@ export default class ListItem extends PureComponent {
|
|
|
53
51
|
const dataTest = dataTests({
|
|
54
52
|
'ring-list-item': (restProps['data-test'] || '').indexOf('ring-list-item') === -1,
|
|
55
53
|
'ring-list-item-action': !disabled,
|
|
56
|
-
'ring-list-item-selected': checkbox
|
|
54
|
+
'ring-list-item-selected': checkbox,
|
|
57
55
|
}, restProps['data-test']);
|
|
58
|
-
const labelElement = (<span className={styles.label} title={computedTitle} data-test="ring-list-item-label">
|
|
56
|
+
const labelElement = (<span className={styles.label} title={computedTitle} data-test="ring-list-item-label">
|
|
57
|
+
{label}
|
|
58
|
+
</span>);
|
|
59
59
|
return (<div className={styles.itemContainer} data-test={dataTest}>
|
|
60
60
|
{showCheckbox && (<div className={styles.checkboxContainer}>
|
|
61
61
|
<Checkbox aria-labelledby={this.id} checked={checkbox} disabled={disabled} onChange={onCheckboxChange} onClick={this.stopBubbling}/>
|
|
@@ -70,11 +70,13 @@ export default class ListItem extends PureComponent {
|
|
|
70
70
|
|
|
71
71
|
{labelWrapper ? labelWrapper(labelElement) : labelElement}
|
|
72
72
|
|
|
73
|
-
{description && (<span className={styles.description} data-test="ring-list-item-description">
|
|
73
|
+
{description && (<span className={styles.description} data-test="ring-list-item-description">
|
|
74
|
+
{description}
|
|
75
|
+
</span>)}
|
|
74
76
|
|
|
75
77
|
<div className={styles.right}>
|
|
76
78
|
{rightGlyph && (<Icon className={styles.rightGlyph} glyph={rightGlyph} suppressSizeWarning={this.props.suppressSizeWarning} size={this.props.iconSize}/>)}
|
|
77
|
-
{icon &&
|
|
79
|
+
{icon && <div className={styles.icon} style={{ backgroundImage: `url("${icon}")` }}/>}
|
|
78
80
|
{rightNodes}
|
|
79
81
|
</div>
|
|
80
82
|
</div>
|
|
@@ -13,7 +13,7 @@ export default class ListLink extends PureComponent {
|
|
|
13
13
|
const classes = classNames(styles.item, className, {
|
|
14
14
|
[styles.actionLink]: !disabled,
|
|
15
15
|
[styles.compact]: compact,
|
|
16
|
-
[styles.scrolling]: scrolling
|
|
16
|
+
[styles.scrolling]: scrolling,
|
|
17
17
|
});
|
|
18
18
|
const Comp = LinkComponent ? linkHOC(LinkComponent) : Link;
|
|
19
19
|
return (<Comp pseudo={!this.props.href} {...restProps} hover={hover && !disabled} className={classes} data-test={dataTests('ring-list-link', dataTest)}>
|
|
@@ -5,8 +5,8 @@ export default class ListSeparator extends PureComponent {
|
|
|
5
5
|
render() {
|
|
6
6
|
const { description, isFirst, className } = this.props;
|
|
7
7
|
const classes = classNames(styles.separator, className, {
|
|
8
|
-
[styles.separator_first]: isFirst
|
|
8
|
+
[styles.separator_first]: isFirst,
|
|
9
9
|
});
|
|
10
|
-
return
|
|
10
|
+
return <span className={classes}>{description}</span>;
|
|
11
11
|
}
|
|
12
12
|
}
|
|
@@ -5,11 +5,15 @@ export default class ListTitle extends PureComponent {
|
|
|
5
5
|
render() {
|
|
6
6
|
const { className, description, label, isFirst } = this.props;
|
|
7
7
|
const classes = classnames(styles.title, className, {
|
|
8
|
-
[styles.title_first]: isFirst
|
|
8
|
+
[styles.title_first]: isFirst,
|
|
9
9
|
});
|
|
10
10
|
return (<span className={classes} data-test="ring-list-title">
|
|
11
|
-
<span className={classnames(styles.label, styles.text)} data-test="ring-list-title-label">
|
|
12
|
-
|
|
11
|
+
<span className={classnames(styles.label, styles.text)} data-test="ring-list-title-label">
|
|
12
|
+
{label}
|
|
13
|
+
</span>
|
|
14
|
+
<div className={styles.description} data-test="ring-list-title-description">
|
|
15
|
+
{description}
|
|
16
|
+
</div>
|
|
13
17
|
</span>);
|
|
14
18
|
}
|
|
15
19
|
}
|
|
@@ -10,7 +10,7 @@ const defaultOptions = {
|
|
|
10
10
|
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
|
|
11
11
|
const plural = count % 10 !== 1 || count % 100 === 11;
|
|
12
12
|
return `${count} member${plural ? 's' : ''}`;
|
|
13
|
-
}
|
|
13
|
+
},
|
|
14
14
|
};
|
|
15
15
|
var Filter;
|
|
16
16
|
(function (Filter) {
|
|
@@ -26,9 +26,7 @@ export default class ListUsersGroupsSource extends HubSourceUsersGroups {
|
|
|
26
26
|
this.listSourceOptions = Object.assign({}, defaultOptions, options);
|
|
27
27
|
}
|
|
28
28
|
getGroupsSectionTitle(groups) {
|
|
29
|
-
return groups.length
|
|
30
|
-
? this.listSourceOptions.GroupsTitle
|
|
31
|
-
: this.listSourceOptions.NoGroupsTitle;
|
|
29
|
+
return groups.length ? this.listSourceOptions.GroupsTitle : this.listSourceOptions.NoGroupsTitle;
|
|
32
30
|
}
|
|
33
31
|
getUsersSectionTitle(users) {
|
|
34
32
|
return users.length ? this.listSourceOptions.UsersTitle : this.listSourceOptions.NoUsersTitle;
|
|
@@ -40,7 +38,7 @@ export default class ListUsersGroupsSource extends HubSourceUsersGroups {
|
|
|
40
38
|
items.push({
|
|
41
39
|
rgItemType: List.ListProps.Type.SEPARATOR,
|
|
42
40
|
key: 2,
|
|
43
|
-
description: this.getUsersSectionTitle(users)
|
|
41
|
+
description: this.getUsersSectionTitle(users),
|
|
44
42
|
});
|
|
45
43
|
}
|
|
46
44
|
if (filter !== Filter.GROUPS) {
|
|
@@ -49,14 +47,14 @@ export default class ListUsersGroupsSource extends HubSourceUsersGroups {
|
|
|
49
47
|
key: user.id,
|
|
50
48
|
label: user.name,
|
|
51
49
|
avatar: user.profile ? user.profile.avatar?.url : null,
|
|
52
|
-
description: user.login
|
|
50
|
+
description: user.login,
|
|
53
51
|
}));
|
|
54
52
|
}
|
|
55
53
|
if (filter === Filter.ALL) {
|
|
56
54
|
items.push({
|
|
57
55
|
rgItemType: List.ListProps.Type.SEPARATOR,
|
|
58
56
|
key: 1,
|
|
59
|
-
description: this.getGroupsSectionTitle(groups)
|
|
57
|
+
description: this.getGroupsSectionTitle(groups),
|
|
60
58
|
});
|
|
61
59
|
}
|
|
62
60
|
if (filter !== Filter.USERS) {
|
|
@@ -66,7 +64,7 @@ export default class ListUsersGroupsSource extends HubSourceUsersGroups {
|
|
|
66
64
|
label: group.name,
|
|
67
65
|
avatar: group.iconUrl,
|
|
68
66
|
glyph: group.iconUrl ? null : GroupIcon,
|
|
69
|
-
description: this.listSourceOptions.getPluralForUserCount(group.userCount)
|
|
67
|
+
description: this.listSourceOptions.getPluralForUserCount(group.userCount),
|
|
70
68
|
}));
|
|
71
69
|
}
|
|
72
70
|
return items;
|
|
@@ -29,6 +29,6 @@ export default class Loader extends PureComponent {
|
|
|
29
29
|
};
|
|
30
30
|
render() {
|
|
31
31
|
const { message, size, colors, 'data-test': dataTest, stop, deterministic, ...restProps } = this.props;
|
|
32
|
-
return
|
|
32
|
+
return <div data-test={dataTests('ring-loader', dataTest)} {...restProps} ref={this.initLoader}/>;
|
|
33
33
|
}
|
|
34
34
|
}
|
|
@@ -46,15 +46,15 @@ export default class LoaderCore {
|
|
|
46
46
|
{ r: 37, g: 183, b: 255 }, //#25B7FF
|
|
47
47
|
{ r: 89, g: 189, b: 0 }, //#59BD00
|
|
48
48
|
{ r: 251, g: 172, b: 2 }, //#FBAC02
|
|
49
|
-
{ r: 227, g: 37, b: 129 } //#E32581
|
|
50
|
-
]
|
|
49
|
+
{ r: 227, g: 37, b: 129 }, //#E32581
|
|
50
|
+
],
|
|
51
51
|
};
|
|
52
52
|
static calculateGradient(startColor, stopColor, position) {
|
|
53
53
|
const calculateChannelValue = (a, b) => a + Math.round((b - a) * position);
|
|
54
54
|
return {
|
|
55
55
|
r: calculateChannelValue(startColor.r, stopColor.r),
|
|
56
56
|
g: calculateChannelValue(startColor.g, stopColor.g),
|
|
57
|
-
b: calculateChannelValue(startColor.b, stopColor.b)
|
|
57
|
+
b: calculateChannelValue(startColor.b, stopColor.b),
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
60
|
props;
|
|
@@ -134,7 +134,7 @@ export default class LoaderCore {
|
|
|
134
134
|
handleLimits(coord, radius, speed, limit) {
|
|
135
135
|
const randomFunc = this.props.deterministic ? deterministic : Math.random;
|
|
136
136
|
const randomizedSpeedChange = randomFunc() - this.baseSpeed / 2;
|
|
137
|
-
if (coord +
|
|
137
|
+
if (coord + radius * 2 + this.baseSpeed >= limit) {
|
|
138
138
|
return -(this.baseSpeed + randomizedSpeedChange);
|
|
139
139
|
}
|
|
140
140
|
else if (coord <= this.baseSpeed) {
|
|
@@ -179,7 +179,7 @@ export default class LoaderCore {
|
|
|
179
179
|
x: this.x,
|
|
180
180
|
y: this.y,
|
|
181
181
|
radius: this.radius,
|
|
182
|
-
color: this.getNextColor()
|
|
182
|
+
color: this.getNextColor(),
|
|
183
183
|
}));
|
|
184
184
|
}
|
|
185
185
|
removeDeadParticles() {
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
@import "../global/variables.css";
|
|
2
2
|
|
|
3
|
-
@value dark from "../global/variables_dark.css";
|
|
4
|
-
|
|
5
3
|
:root {
|
|
6
4
|
/* stylelint-disable-next-line color-no-hex */
|
|
7
5
|
--ring-loader-inline-stops: #ff00eb, #bd3bff, #008eff, #58ba00, #f48700, #ff00eb;
|
|
8
6
|
}
|
|
9
7
|
|
|
10
|
-
.dark,
|
|
11
8
|
:global(.ring-ui-theme-dark) {
|
|
12
9
|
/* stylelint-disable-next-line color-no-hex */
|
|
13
10
|
--ring-loader-inline-stops: #ff2eef, #d178ff, #289fff, #88d444, #ffe000, #ff2eef;
|
|
@@ -9,13 +9,11 @@ class LoaderInline extends PureComponent {
|
|
|
9
9
|
render() {
|
|
10
10
|
const { className, 'data-test': dataTest, children, ...restProps } = this.props;
|
|
11
11
|
const classes = classNames(styles.loader, className);
|
|
12
|
-
const loader =
|
|
13
|
-
return children
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
</>)
|
|
18
|
-
: loader;
|
|
12
|
+
const loader = <div {...restProps} data-test={dataTests('ring-loader-inline', dataTest)} className={classes}/>;
|
|
13
|
+
return children ? (<>
|
|
14
|
+
{loader}
|
|
15
|
+
<span className={styles.children}>{children}</span>
|
|
16
|
+
</>) : (loader);
|
|
19
17
|
}
|
|
20
18
|
}
|
|
21
19
|
export default LoaderInline;
|
|
@@ -10,7 +10,7 @@ export default class LoaderScreen extends PureComponent {
|
|
|
10
10
|
const { message, className, containerClassName, ...restProps } = this.props;
|
|
11
11
|
const containerClasses = classNames(containerClassName, styles.loaderScreen);
|
|
12
12
|
const loaderClasses = classNames(className, styles.loader, {
|
|
13
|
-
[styles.loaderWithoutSpacing]: !message
|
|
13
|
+
[styles.loaderWithoutSpacing]: !message,
|
|
14
14
|
});
|
|
15
15
|
return (<div className={containerClasses}>
|
|
16
16
|
<Loader {...restProps} message={message} className={loaderClasses}/>
|
|
@@ -17,14 +17,14 @@ export default class LoginDialog extends Component {
|
|
|
17
17
|
show: false,
|
|
18
18
|
url: 'about:blank',
|
|
19
19
|
renderFallbackLink: () => null,
|
|
20
|
-
showFallbackTimeout: DEFAULT_SHOW_FALLBACK_TIMEOUT
|
|
20
|
+
showFallbackTimeout: DEFAULT_SHOW_FALLBACK_TIMEOUT,
|
|
21
21
|
};
|
|
22
22
|
state = {
|
|
23
23
|
loading: true,
|
|
24
24
|
loggingIn: false,
|
|
25
25
|
showFallbackLink: false,
|
|
26
26
|
height: DEFAULT_HEIGHT,
|
|
27
|
-
width: DEFAULT_WIDTH
|
|
27
|
+
width: DEFAULT_WIDTH,
|
|
28
28
|
};
|
|
29
29
|
componentDidMount() {
|
|
30
30
|
window.addEventListener('message', this.onMessage);
|
|
@@ -65,9 +65,9 @@ export default class LoginDialog extends Component {
|
|
|
65
65
|
<iframe title="Login dialog" style={iFrameStyle} src={url} className={styles.iFrame} scrolling="no"/>
|
|
66
66
|
</Content>
|
|
67
67
|
|
|
68
|
-
{loading &&
|
|
68
|
+
{loading && <LoaderScreen message={loadingMessage} containerClassName={styles.nonOpaqueLoader}/>}
|
|
69
69
|
|
|
70
|
-
{showFallbackLink &&
|
|
70
|
+
{showFallbackLink && <div className={styles.fallbackLinkContainer}>{renderFallbackLink(loggingIn)}</div>}
|
|
71
71
|
</Dialog>);
|
|
72
72
|
}
|
|
73
73
|
}
|
|
@@ -7,20 +7,20 @@ const reactRoot = createRoot(containerElement);
|
|
|
7
7
|
* Renders LoginDialog into virtual node to skip maintaining container
|
|
8
8
|
*/
|
|
9
9
|
function renderLoginDialog(props) {
|
|
10
|
-
reactRoot.render(
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
reactRoot.render(<ControlsHeightContext.Provider value={getGlobalControlsHeight()}>
|
|
11
|
+
<LoginDialog {...props}/>
|
|
12
|
+
</ControlsHeightContext.Provider>);
|
|
13
13
|
}
|
|
14
14
|
function noop() { }
|
|
15
15
|
export default function showAuthDialog(props = { onCancel: noop }) {
|
|
16
16
|
renderLoginDialog({
|
|
17
17
|
...props,
|
|
18
|
-
show: true
|
|
18
|
+
show: true,
|
|
19
19
|
});
|
|
20
20
|
return () => {
|
|
21
21
|
renderLoginDialog({
|
|
22
22
|
...props,
|
|
23
|
-
show: false
|
|
23
|
+
show: false,
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
26
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
@import "../global/variables.css";
|
|
2
2
|
|
|
3
|
-
@value p-margin: 10px;
|
|
4
|
-
|
|
5
3
|
.inline {
|
|
6
4
|
&,
|
|
7
5
|
& p {
|
|
@@ -10,7 +8,9 @@
|
|
|
10
8
|
}
|
|
11
9
|
|
|
12
10
|
.markdown {
|
|
13
|
-
|
|
11
|
+
--ring-markdown-p-margin: 10px;
|
|
12
|
+
|
|
13
|
+
composes: font from "../global/global.css";
|
|
14
14
|
|
|
15
15
|
& ol,
|
|
16
16
|
& ul {
|
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
margin: 0;
|
|
24
24
|
|
|
25
25
|
&:not(:first-child) {
|
|
26
|
-
margin-top: p-margin;
|
|
26
|
+
margin-top: var(--ring-markdown-p-margin);
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
& li {
|
|
31
|
-
margin-top: p-margin;
|
|
31
|
+
margin-top: var(--ring-markdown-p-margin);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
& li {
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
& hr {
|
|
45
|
-
margin: p-margin 0;
|
|
45
|
+
margin: var(--ring-markdown-p-margin) 0;
|
|
46
46
|
|
|
47
47
|
border: none;
|
|
48
48
|
border-bottom: 1px solid var(--ring-line-color);
|
|
@@ -4,17 +4,15 @@ import headingStyles from '../heading/heading.css';
|
|
|
4
4
|
import linkStyles from '../link/link.css';
|
|
5
5
|
import styles from './markdown.css';
|
|
6
6
|
/**
|
|
7
|
-
|
|
8
|
-
*/
|
|
7
|
+
* @name Markdown
|
|
8
|
+
*/
|
|
9
9
|
export default class Markdown extends PureComponent {
|
|
10
10
|
render() {
|
|
11
11
|
const { className, children, inline } = this.props;
|
|
12
12
|
const classes = classNames(className, headingStyles.contentWithHeadings, linkStyles.withLinks, {
|
|
13
13
|
[styles.markdown]: !inline,
|
|
14
|
-
[styles.inline]: inline
|
|
14
|
+
[styles.inline]: inline,
|
|
15
15
|
});
|
|
16
|
-
return
|
|
17
|
-
{children}
|
|
18
|
-
</div>);
|
|
16
|
+
return <div className={classes}>{children}</div>;
|
|
19
17
|
}
|
|
20
18
|
}
|