@rh-support/components 2.1.85 → 2.1.87

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.
@@ -1 +1 @@
1
- {"version":3,"file":"MarkdownEditor.d.ts","sourceRoot":"","sources":["../../../src/MarkdownEditor/MarkdownEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAwB,MAAM,qBAAqB,CAAC;AAgC7E,OAAO,KAAK,EAAE,EAAE,SAAS,EAA+B,MAAM,OAAO,CAAC;AAKtE,oBAAY,UAAU;IAClB,KAAK,cAAc;IACnB,QAAQ,aAAa;CACxB;AAED,UAAU,kBAAkB;IACxB,yBAAyB,EAAE,OAAO,CAAC;IACnC,SAAS,EAAE,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;IAClC,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IACnD,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IACnD,gBAAgB,EAAE,CAAC,IAAI,KAAA,KAAK,IAAI,CAAC;IACjC,eAAe,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC;IAChD,aAAa,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B,eAAe,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,SAAS,CAAC,mBAAmB,CAAC,EAAE,UAAU,GAAG,OAAO,GAAG,KAAK,CAAC;IACtG,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,MA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KAAK,IAAI,CAAC;IAClD,iBAAiB,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;CACnD;AAuBD,iBAAS,cAAc,CAAC,KAAK,EAAE,cAAc,qBAy1B5C;kBAz1BQ,cAAc;;;AA61BvB,OAAO,EAAE,cAAc,EAAE,CAAC"}
@@ -382,7 +382,8 @@ function MarkdownEditor(props) {
382
382
  const [menuHeights, setMenuHeights] = useState({});
383
383
  const toggleRef = useRef(null);
384
384
  const drillMenuRef = useRef(null);
385
- const onToggleClick = () => {
385
+ const onToggleClick = (e) => {
386
+ e.stopPropagation();
386
387
  setIsDrillMenuOpen(!isDrillMenuOpen);
387
388
  setMenuDrilledIn([]);
388
389
  setDrilldownPath([]);
@@ -433,7 +434,7 @@ function MarkdownEditor(props) {
433
434
  React.createElement(ToolbarItem, null, markdownGuidanceBtn)),
434
435
  React.createElement(Toolbar, null,
435
436
  React.createElement("div", { className: "mobile-markdown-toolbar" },
436
- React.createElement(ToolbarGroup, { "data-tracking-id": "mobile-md-editor-toolbar", className: "markdown-toolbar-left-section" },
437
+ React.createElement(ToolbarGroup, { spaceItems: { default: 'spaceItemsNone' }, "data-tracking-id": "mobile-md-editor-toolbar", className: "markdown-toolbar-left-section" },
437
438
  !props.hideHeadingOptions && (React.createElement(Dropdown, { isText: true, isPlain: true, onSelect: onHeadingSelect, toggle: React.createElement(DropdownToggle, { id: "heading-selector", onToggle: onToggle }, "Heading"), isOpen: isHeadingDropdownOpen, dropdownItems: [
438
439
  React.createElement(DropdownItem, { key: "heading-1", tabIndex: -1, isDisabled: props.disabled || isPreview, onClick: h1, title: "Heading 1", "data-tracking-id": "mobile-md-editor-toolbar-h1" }, "Heading 1"),
439
440
  React.createElement(DropdownItem, { tabIndex: -1, isDisabled: props.disabled || isPreview, onClick: h2, title: "Heading 2", "data-tracking-id": "mobile-md-editor-toolbar-h2" }, "Heading 2"),
@@ -445,14 +446,14 @@ function MarkdownEditor(props) {
445
446
  React.createElement(ListUlIcon, null)),
446
447
  React.createElement(Button, { tabIndex: -1, variant: ButtonVariant.plain, isDisabled: props.disabled || isPreview, onClick: code, title: "Code", "data-tracking-id": "mobile-md-editor-toolbar-code", className: "mobile-markdown-tool-item" },
447
448
  React.createElement(CodeIcon, null))),
448
- React.createElement(ToolbarItem, { className: "mobile-markdown-tool-item" },
449
+ React.createElement(ToolbarItem, { id: "tools-kebab-menu-container", className: "mobile-markdown-tool-item", spacer: { default: 'spacerSm' } },
449
450
  React.createElement(MenuContainer, { isOpen: isDrillMenuOpen, onOpenChange: (isOpen) => setIsDrillMenuOpen(isOpen), popperProps: { position: 'left' }, menu: React.createElement(Menu, { id: "toolsKebabMenu", containsDrilldown: true, drilldownItemPath: drilldownPath, drilledInMenus: menuDrilledIn, activeMenu: activeMenu, onDrillIn: drillIn, onDrillOut: drillOut, onGetMenuHeight: setHeight, ref: drillMenuRef },
450
451
  React.createElement(MenuContent, { menuHeight: `${menuHeights[activeMenu]}px` },
451
452
  React.createElement(MenuList, null,
452
453
  React.createElement(MenuItem, { itemId: "link-btn-menu-item", isDisabled: props.disabled || isPreview, onClick: link, "data-tracking-id": "mobile-md-editor-toolbar-link", icon: React.createElement(LinkIcon, { "aria-hidden": true }) }, "Link"),
453
454
  React.createElement(MenuItem, { itemId: "code-btn-menu-item", isDisabled: props.disabled || isPreview, onClick: quote, "data-tracking-id": "mobile-md-editor-toolbar-quote", icon: React.createElement(QuoteRightIcon, { "aria-hidden": true }) }, "Quote"),
454
455
  React.createElement(MenuItem, { itemId: "group:manage_attachments", direction: "down", icon: React.createElement(ImageIcon, { "aria-hidden": true }), drilldownMenu: React.createElement(DrilldownMenu, { id: "drilldownMenuStart" },
455
- React.createElement(MenuItem, { itemId: "group:manage_attachments_breadcrumb", direction: "up" }, "Manage Attachments"),
456
+ React.createElement(MenuItem, { itemId: "group:manage_attachments_breadcrumb", direction: "up" }, "Manage attachments"),
456
457
  React.createElement("div", { className: "attachments-items" }, getFileSelectorList(true))) }, "Manage Attachments")))), menuRef: drillMenuRef, toggle: React.createElement(MenuToggle, { variant: "plain", ref: toggleRef, onClick: onToggleClick, isExpanded: isDrillMenuOpen },
457
458
  React.createElement(EllipsisVIcon, null)), toggleRef: toggleRef }))))))),
458
459
  React.createElement("div", { className: "markdown-content" }, !isPreview ? (React.createElement("textarea", Object.assign({}, textAreaProps, { onKeyDown: keydown, placeholder: isPlainModeEnabled ? t(props.plainTextPlaceholder) : t(props.mdPlaceholder), ref: bindTextAreaRef, className: cx('form-control', 'markdown-text-area', props.textAreaClassName, 'textArea'), value: mdValue, onChange: textChanged, rows: props.rows || contentRows, style: { height: '313px' } }))) : (React.createElement("div", { className: "markdown-preview-placeholder", style: { height: '313px' } },
@@ -469,14 +470,14 @@ function MarkdownEditor(props) {
469
470
  t(showPreviewText))))),
470
471
  isUploadingFile && (React.createElement(React.Fragment, null,
471
472
  React.createElement(Trans, null,
472
- React.createElement("small", { className: "pf-v5-u-pl-md" },
473
+ React.createElement("small", { className: "pf-v5-u-pl-md uploading-spinner-text" },
473
474
  React.createElement(Trans, null, "Uploading File"))),
474
- React.createElement(Spinner, { className: "pf-v5-u-ml-sm", size: "md" }))),
475
+ React.createElement(Spinner, { className: "pf-v5-u-ml-sm", size: "sm" }))),
475
476
  mdValue.length > props.minCharsForCounter && getCharCountText(mdValue)),
476
477
  React.createElement("span", null,
477
- React.createElement(Button, { variant: "plain", className: isPlainModeEnabled ? 'markdown-active-mode' : '', onClick: () => onModeChange(true), isDisabled: isPlainModeEnabled || isUploadingFile, "data-tracking-id": "md-editor-plaintext" },
478
+ React.createElement(Button, { variant: "plain", className: `${isPlainModeEnabled ? 'markdown-active-mode' : ''} plain-mode-btn`, onClick: () => onModeChange(true), isDisabled: isPlainModeEnabled || isUploadingFile, "data-tracking-id": "md-editor-plaintext" },
478
479
  React.createElement(Trans, null, "Plain text")),
479
- React.createElement(Button, { variant: "plain", className: !isPlainModeEnabled ? 'markdown-active-mode' : '', onClick: () => onModeChange(false), isDisabled: !isPlainModeEnabled, "data-tracking-id": "md-editor-md" },
480
+ React.createElement(Button, { variant: "plain", className: `${!isPlainModeEnabled ? 'markdown-active-mode' : ''} markdown-mode-btn`, onClick: () => onModeChange(false), isDisabled: !isPlainModeEnabled, "data-tracking-id": "md-editor-md" },
480
481
  React.createElement(Trans, null, "Markdown")))))))));
481
482
  }
482
483
  MarkdownEditor.defaultProps = defaultProps;
@@ -179,4 +179,41 @@ button[data-link*='/attachments/']::before {
179
179
  width: 2.5rem !important;
180
180
  }
181
181
  }
182
+
183
+ .markdown-toolbar-left-section {
184
+ margin-inline-end: 0px !important;
185
+ }
186
+
187
+ .markdown-preview-btn,
188
+ .plain-mode-btn,
189
+ .markdown-mode-btn {
190
+ padding-left: 4px;
191
+ padding-right: 4px;
192
+ }
193
+
194
+ .markdown-editor-container .markdown-toggle-toolbar button {
195
+ font-size: 14px;
196
+ padding: 10px 0.25rem;
197
+ }
198
+ }
199
+
200
+ @media (max-width: 475px) {
201
+ .markdown-editor-container .pf-v5-c-toolbar {
202
+ padding: 0.5rem 0rem;
203
+ }
204
+
205
+ .mobile-markdown-toolbar {
206
+ .mobile-markdown-tool-item {
207
+ width: 0.1rem !important;
208
+ }
209
+
210
+ #tools-kebab-menu-container {
211
+ position: relative;
212
+ right: 2rem;
213
+ }
214
+ }
215
+
216
+ .uploading-spinner-text {
217
+ display: none;
218
+ }
182
219
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/components",
3
- "version": "2.1.85",
3
+ "version": "2.1.87",
4
4
  "description": "Contains all reusabel components for support app",
5
5
  "author": "Vikas Rathee <vrathee@redhat.com>",
6
6
  "license": "ISC",
@@ -111,5 +111,5 @@
111
111
  "defaults and supports es6-module",
112
112
  "maintained node versions"
113
113
  ],
114
- "gitHead": "a8f01c7004ad07e3c1c695ecbe1a00dd4fc909d1"
114
+ "gitHead": "1de61badca2519b3f481396206cde31f2fc89487"
115
115
  }