@ember-eui/core 4.1.1 → 4.2.3

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/CHANGELOG.md CHANGED
@@ -2,6 +2,32 @@
2
2
 
3
3
  ### Master
4
4
 
5
+ ### 4.2.3
6
+ 🐛 Bug / Fixes
7
+ `@ember-eui/core`
8
+ - Cherry pick 1.6.x fix commit hash https://github.com/prysmex/ember-eui/commit/c4b8a4a259f6b86c2be516fd7427f5e48b28cecd
9
+ - Use next for updating the attachTo for `<EuiToolTip />`
10
+
11
+ ### 4.2.2
12
+ 🐛 Bug / Fixes
13
+ `@ember-eui/core`
14
+ - fix typing issues
15
+
16
+ ### 4.2.1
17
+ 🐛 Bug / Fixes
18
+ `@ember-eui/core`
19
+ - fix markdown editor components
20
+
21
+ ### 4.2.0
22
+ 🚀 Enhancements
23
+ `@ember-eui/core`
24
+ - Remove blueprint, inspired by https://github.com/mikkopaderes/ember-cloud-firestore-adapter README.md we should teach users to install peerDependencies manually, which is now required.
25
+ - Update docs for this change.
26
+
27
+ 🐛 Bug / Fixes
28
+ `@ember-eui/core`
29
+ - fix markdown editor icons
30
+
5
31
  ### 4.1.1
6
32
  🐛 Bug / Fixes
7
33
  `@ember-eui/core`
@@ -99,6 +125,11 @@ bump @embroider 1.3.0 regenerating yarn.lock, this finally enables staticCompone
99
125
  💥 Breaking change
100
126
  `@ember-eui/core`
101
127
  - Deprecate `ember-svg-jar` `hbs` strategy for now, just use stock `ember-svg-jar`
128
+
129
+ ### 1.6.10
130
+ 🐛 Bug / Fixes
131
+ `@ember-eui/core`
132
+ - `<EuiComboBox />` fixes to `onCreateOption`
102
133
  ### 1.6.7
103
134
  🐛 Bug / Fixes
104
135
  `@ember-eui/core`
@@ -25,7 +25,7 @@
25
25
  singleSelection=@singleSelection
26
26
  onClose=@removeTag
27
27
  onCreateOption=(if
28
- @onCreateOption (pipe this.onCreateOption @onCreateOption)
28
+ @onCreateOption this.onCreateOption
29
29
  )
30
30
  }}
31
31
  @matcher={{@matcher}}
@@ -75,7 +75,7 @@
75
75
  (component
76
76
  "eui-combo-box/create-option"
77
77
  customOptionText=@customOptionText
78
- onCreateOption=(pipe this.onCreateOption @onCreateOption)
78
+ onCreateOption=this.onCreateOption
79
79
  select=this.select
80
80
  )
81
81
  (component "eui-combo-box/no-matches-message")
@@ -7,6 +7,7 @@ import { isEqual } from '@ember/utils';
7
7
 
8
8
  interface EuiComboBoxArgs {
9
9
  singleSelection: boolean;
10
+ onCreateOption?: (search: string) => boolean | undefined;
10
11
  }
11
12
 
12
13
  interface Select {
@@ -64,9 +65,19 @@ export default class EuiComboBoxComponent extends Component<EuiComboBoxArgs> {
64
65
 
65
66
  @action
66
67
  onCreateOption() {
67
- let search = this.select.searchText;
68
+ let option;
69
+ if (
70
+ this.args.onCreateOption &&
71
+ typeof this.args.onCreateOption === 'function'
72
+ ) {
73
+ // The `onCreateOption` function can be used to sanitize the input or explicitly return `false` to reject the input
74
+ option = this.args.onCreateOption(this.select.searchText);
75
+ if (option === false) {
76
+ return;
77
+ }
78
+ }
79
+ let search = option || this.select.searchText;
68
80
  this.select.actions.search('');
69
- this.select.actions.select(search);
70
81
  this.select.actions.close();
71
82
  return search;
72
83
  }
@@ -0,0 +1,3 @@
1
+ import Component from '@glimmer/component';
2
+
3
+ export default class EuiMarkdownEditorToolbarComponent extends Component {}
@@ -18,11 +18,7 @@
18
18
  <EuiButtonIcon
19
19
  @color="text"
20
20
  {{on "click" (fn this.handleMdButtonClick item.id)}}
21
- @iconType={{if
22
- item.iconType.component
23
- (component (ensure-safe-component item.iconType.component))
24
- item.iconType
25
- }}
21
+ @iconType={{or item.iconType.component item.iconType}}
26
22
  @useComponent={{item.iconType.component}}
27
23
  aria-label={{item.label}}
28
24
  @useSvg={{item.useSvg}}
@@ -3,7 +3,7 @@ import { action } from '@ember/object';
3
3
  import type MarkdownActions from '../../utils/markdown/markdown-actions';
4
4
  import { MODE_VIEWING } from '../../utils/markdown/markdown-modes';
5
5
  import { cached } from '@glimmer/tracking';
6
-
6
+ import MarkdownCheckmark from './icons/markdown-checkmark';
7
7
  import { Plugin } from 'unified';
8
8
 
9
9
  export interface EuiMarkdownEditorToolbarArgs {
@@ -14,7 +14,7 @@ export interface EuiMarkdownEditorToolbarArgs {
14
14
  }
15
15
 
16
16
  export default class EuiMarkdownEditorToolbarComponent extends Component<EuiMarkdownEditorToolbarArgs> {
17
- boldItalicButtons = [
17
+ boldItalicsButtons = [
18
18
  {
19
19
  id: 'mdBold',
20
20
  label: 'Bold',
@@ -50,8 +50,7 @@ export default class EuiMarkdownEditorToolbarComponent extends Component<EuiMark
50
50
  name: 'tl',
51
51
  useSvg: true,
52
52
  iconType: {
53
- // this should't be needed when we drop support for 3.24.0
54
- component: 'eui-markdown-editor-toolbar/icons/markdown-checkmark'
53
+ component: MarkdownCheckmark
55
54
  }
56
55
  }
57
56
  ];
@@ -0,0 +1,3 @@
1
+ import templateOnlyComponent from '@ember/component/template-only';
2
+
3
+ export type EuiMarkdownFormatMarkdownCode = typeof templateOnlyComponent;
@@ -0,0 +1,3 @@
1
+ import templateOnlyComponent from '@ember/component/template-only';
2
+
3
+ export type EuiMarkdownFormatMarkdownCodeBlock = typeof templateOnlyComponent;
@@ -0,0 +1,3 @@
1
+ import templateOnlyComponent from '@ember/component/template-only';
2
+
3
+ export type EuiMarkdownFormatMarkdownTooltip = typeof templateOnlyComponent;
@@ -5,7 +5,7 @@ import { uniqueId } from '../../helpers/unique-id';
5
5
  import { tracked, cached } from '@glimmer/tracking';
6
6
  import { findPopoverPosition } from '../../utils/popover';
7
7
  import { keys } from '../../utils/keys';
8
- import { later, cancel, scheduleOnce } from '@ember/runloop';
8
+ import { later, cancel, scheduleOnce, next } from '@ember/runloop';
9
9
 
10
10
  export type ToolTipPositions = 'top' | 'right' | 'bottom' | 'left';
11
11
 
@@ -113,9 +113,11 @@ export default class EuiToolTip extends Component<EuiTooltipArgs> {
113
113
  }
114
114
 
115
115
  if (this.args.attachTo && this.args.attachTo !== this._attachTo) {
116
- this.removeAttachToHandlers();
117
- this._attachTo = this.args.attachTo;
118
- this.setupAttachToHandlers();
116
+ next(() => {
117
+ this.removeAttachToHandlers();
118
+ this._attachTo = this.args.attachTo;
119
+ this.setupAttachToHandlers();
120
+ });
119
121
  }
120
122
  }
121
123
 
@@ -246,13 +248,16 @@ export default class EuiToolTip extends Component<EuiTooltipArgs> {
246
248
  }
247
249
  });
248
250
 
249
- const windowWidth = document.documentElement.clientWidth || window.innerWidth;
251
+ const windowWidth =
252
+ document.documentElement.clientWidth || window.innerWidth;
250
253
  const useRightValue = windowWidth / 2 < left;
251
254
 
252
255
  const toolTipStyles: ToolTipStyles = {
253
256
  top: `${top}px`,
254
257
  left: useRightValue ? 'auto' : `${left}px`,
255
- right: useRightValue ? `${windowWidth - left - this.popover.offsetWidth}px` : 'auto'
258
+ right: useRightValue
259
+ ? `${windowWidth - left - this.popover.offsetWidth}px`
260
+ : 'auto'
256
261
  };
257
262
 
258
263
  this.visible = true;
@@ -299,7 +304,8 @@ export default class EuiToolTip extends Component<EuiTooltipArgs> {
299
304
  // left the anchor for a non-child.
300
305
  if (
301
306
  this._anchor === event.relatedTarget ||
302
- (this._anchor != null && !this._anchor.contains(event.relatedTarget as Node))
307
+ (this._anchor != null &&
308
+ !this._anchor.contains(event.relatedTarget as Node))
303
309
  ) {
304
310
  this.hideToolTip();
305
311
  }
@@ -1,3 +1,15 @@
1
1
  .euiIcon {
2
2
  line-height: 1; /* added while we support back hbs svgs components */
3
+ }
4
+
5
+ .euiMarkdownEditor--fullHeight {
6
+ display: -webkit-flex;
7
+ display: flex;
8
+ -webkit-flex-direction: column;
9
+ flex-direction: column;
10
+ height: 100%;
11
+ }
12
+
13
+ .euiMarkdownEditor--isPreviewing .euiMarkdownEditor__toggleContainer {
14
+ display: none;
3
15
  }
@@ -1,4 +1,6 @@
1
1
  import { RehypeNode } from '../markdown-types';
2
+ import EuiMarkdownFormatMarkdownCode from '../../../components/eui-markdown-format/markdown-code';
3
+ import EuiMarkdownFormatMarkdownCodeBlock from '../../../components/eui-markdown-format/markdown-code-block';
2
4
 
3
5
  type Visitor = (node: RehypeNode) => RehypeNode;
4
6
 
@@ -48,12 +50,11 @@ export default function MarkdownAddComponents(): (tree: RehypeNode) => void {
48
50
  /\r|\n/.exec(child.value)
49
51
  );
50
52
  if (hasBreaks) {
51
- node.properties.componentName =
52
- 'eui-markdown-format/markdown-code-block';
53
+ node.properties.componentName = EuiMarkdownFormatMarkdownCodeBlock;
53
54
  node.properties.fontSize = 'm';
54
55
  node.properties.paddingSize = 's';
55
56
  } else {
56
- node.properties.componentName = 'eui-markdown-format/markdown-code';
57
+ node.properties.componentName = EuiMarkdownFormatMarkdownCode;
57
58
  node.properties.inline = true;
58
59
  }
59
60
  }
@@ -19,10 +19,11 @@
19
19
 
20
20
  import { RemarkTokenizer } from '../markdown-types';
21
21
  import { Plugin } from 'unified';
22
+ import EuiMarkdownFormatMarkdownCheckbox from '../../../components/eui-markdown-format/markdown-checkbox';
22
23
 
23
24
  interface CheckboxNodeDetails {
24
25
  type: 'component';
25
- componentName: 'eui-markdown-format/markdown-checkbox';
26
+ componentName: any;
26
27
  lead: string;
27
28
  label: string;
28
29
  isChecked: boolean;
@@ -64,7 +65,7 @@ const CheckboxParser: Plugin = function CheckboxParser() {
64
65
 
65
66
  return add({
66
67
  type: 'component',
67
- componentName: 'eui-markdown-format/markdown-checkbox',
68
+ componentName: EuiMarkdownFormatMarkdownCheckbox,
68
69
  lead,
69
70
  label: text,
70
71
  isChecked,
@@ -1,5 +1,6 @@
1
1
  import { RemarkTokenizer } from '../markdown-types';
2
2
  import { Plugin } from 'unified';
3
+ import EuiMarkdownFormatMarkdownTooltip from '../../../components/eui-markdown-format/markdown-tooltip';
3
4
 
4
5
  interface TooltipNodeDetails {
5
6
  type: 'component';
@@ -95,7 +96,7 @@ const TooltipParser: Plugin = function TooltipParser() {
95
96
 
96
97
  return eat(`!{tooltip[${tooltipAnchor}](${tooltipText})}`)({
97
98
  type: 'component',
98
- componentName: 'eui-markdown-format/markdown-tooltip',
99
+ componentName: EuiMarkdownFormatMarkdownTooltip,
99
100
  tooltipText: tooltipText,
100
101
  children
101
102
  } as TooltipNodeDetails);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ember-eui/core",
3
- "version": "4.1.1",
3
+ "version": "4.2.3",
4
4
  "description": "Ember Components for Elastic UI",
5
5
  "keywords": [
6
6
  "ember-addon",
@@ -56,7 +56,7 @@
56
56
  "@html-next/vertical-collection": "3.0.0-1",
57
57
  "@types/lodash-es": "^4.17.4",
58
58
  "chroma-js": "^2.1.0",
59
- "ember-auto-import": "^2.2.4",
59
+ "ember-auto-import": "^2.4.0",
60
60
  "ember-cached-decorator-polyfill": "^0.1.4",
61
61
  "ember-cli-babel": "^7.26.11",
62
62
  "ember-cli-htmlbars": "^6.0.1",
@@ -89,6 +89,7 @@
89
89
  "vfile": "^4.2.0"
90
90
  },
91
91
  "peerDependencies": {
92
+ "ember-auto-import": "^2.2.4",
92
93
  "ember-focus-trap": "^1.0.1"
93
94
  },
94
95
  "devDependencies": {
@@ -175,5 +176,5 @@
175
176
  "volta": {
176
177
  "extends": "../../package.json"
177
178
  },
178
- "gitHead": "934a2412ad1e4bfe937f7e362408355320580b5b"
179
+ "gitHead": "416ebf9ca1d85d3d9404d71badda1af1db82d191"
179
180
  }
@@ -1,4 +0,0 @@
1
- import templateOnlyComponent from '@ember/component/template-only';
2
-
3
- export type EuiMarkdownEditorToolbarIconsMarkdownCheckmark =
4
- typeof templateOnlyComponent;
@@ -1,14 +0,0 @@
1
- 'use strict';
2
-
3
- module.exports = {
4
- description: 'Installs ember-focus-trap',
5
-
6
- normalizeEntityName() {
7
- // this prevents an error when the entityName is
8
- // not specified
9
- },
10
-
11
- afterInstall() {
12
- return this.addAddonToProject('ember-focus-trap');
13
- }
14
- };