@instructure/ui-source-code-editor 8.53.3-snapshot-4 → 8.53.3-snapshot-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/CHANGELOG.md CHANGED
@@ -3,12 +3,9 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- ## [8.53.3-snapshot-4](https://github.com/instructure/instructure-ui/compare/v8.53.2...v8.53.3-snapshot-4) (2024-02-19)
6
+ ## [8.53.3-snapshot-0](https://github.com/instructure/instructure-ui/compare/v8.53.2...v8.53.3-snapshot-0) (2024-02-20)
7
7
 
8
-
9
- ### Bug Fixes
10
-
11
- * **ui-source-code-editor:** fix react-dom version detection ([465c10d](https://github.com/instructure/instructure-ui/commit/465c10d43543efe1dc6d3de07d5b0b311d4c27ea))
8
+ **Note:** Version bump only for package @instructure/ui-source-code-editor
12
9
 
13
10
 
14
11
 
@@ -29,7 +29,12 @@ import { setSearchQuery, search, findNext, findPrevious, SearchQuery, closeSearc
29
29
  import { TextInput } from '@instructure/ui-text-input';
30
30
  import { IconButton } from '@instructure/ui-buttons';
31
31
  import { IconArrowOpenDownLine, IconArrowOpenUpLine, IconSearchLine } from '@instructure/ui-icons';
32
- import ReactDOM from 'react-dom';
32
+ let reactdom;
33
+ try {
34
+ reactdom = require('react-dom/client');
35
+ } catch {
36
+ reactdom = require('react-dom');
37
+ }
33
38
  function SearchPanel({
34
39
  view,
35
40
  searchConfig
@@ -95,20 +100,16 @@ function SearchPanel({
95
100
  export default function customSearch(searchConfig) {
96
101
  return searchConfig ? search({
97
102
  createPanel: view => {
98
- var _SearchPanel;
99
103
  const dom = document.createElement('div');
100
104
  dom.style.padding = '8px';
101
- if (!React.version.startsWith('16.')) {
102
- const path = 'react-dom/client';
103
- import(path).then(r => {
104
- const root = r.createRoot(dom);
105
- root.render(_SearchPanel || (_SearchPanel = /*#__PURE__*/React.createElement(SearchPanel, {
106
- view: view,
107
- searchConfig: searchConfig
108
- })));
109
- }).catch(e => {});
105
+ if ('createRoot' in reactdom) {
106
+ const root = reactdom.createRoot(dom);
107
+ root.render( /*#__PURE__*/React.createElement(SearchPanel, {
108
+ view: view,
109
+ searchConfig: searchConfig
110
+ }));
110
111
  } else {
111
- ReactDOM.render( /*#__PURE__*/React.createElement(SearchPanel, {
112
+ reactdom.render( /*#__PURE__*/React.createElement(SearchPanel, {
112
113
  view: view,
113
114
  searchConfig: searchConfig
114
115
  }), dom);
@@ -1,21 +1,19 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- var _interopRequireWildcard3 = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.default = customSearch;
9
- var _interopRequireWildcard2 = _interopRequireDefault(require("@babel/runtime/helpers/interopRequireWildcard"));
10
9
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
- var _react = _interopRequireWildcard3(require("react"));
10
+ var _react = _interopRequireWildcard(require("react"));
12
11
  var _search = require("@codemirror/search");
13
12
  var _TextInput = require("@instructure/ui-text-input/lib/TextInput");
14
13
  var _IconButton = require("@instructure/ui-buttons/lib/IconButton");
15
14
  var _IconArrowOpenDownLine = require("@instructure/ui-icons/lib/IconArrowOpenDownLine.js");
16
15
  var _IconArrowOpenUpLine2 = require("@instructure/ui-icons/lib/IconArrowOpenUpLine.js");
17
16
  var _IconSearchLine2 = require("@instructure/ui-icons/lib/IconSearchLine.js");
18
- var _reactDom = _interopRequireDefault(require("react-dom"));
19
17
  var _IconSearchLine, _IconArrowOpenDownLin, _IconArrowOpenUpLine;
20
18
  /*
21
19
  * The MIT License (MIT)
@@ -40,6 +38,12 @@ var _IconSearchLine, _IconArrowOpenDownLin, _IconArrowOpenUpLine;
40
38
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
41
39
  * SOFTWARE.
42
40
  */
41
+ let reactdom;
42
+ try {
43
+ reactdom = require('react-dom/client');
44
+ } catch {
45
+ reactdom = require('react-dom');
46
+ }
43
47
  function SearchPanel({
44
48
  view,
45
49
  searchConfig
@@ -105,20 +109,16 @@ function SearchPanel({
105
109
  function customSearch(searchConfig) {
106
110
  return searchConfig ? (0, _search.search)({
107
111
  createPanel: view => {
108
- var _SearchPanel;
109
112
  const dom = document.createElement('div');
110
113
  dom.style.padding = '8px';
111
- if (!_react.default.version.startsWith('16.')) {
112
- const path = 'react-dom/client';
113
- (specifier => new Promise(r => r(`${specifier}`)).then(s => (0, _interopRequireWildcard2.default)(require(s))))(path).then(r => {
114
- const root = r.createRoot(dom);
115
- root.render(_SearchPanel || (_SearchPanel = /*#__PURE__*/_react.default.createElement(SearchPanel, {
116
- view: view,
117
- searchConfig: searchConfig
118
- })));
119
- }).catch(e => {});
114
+ if ('createRoot' in reactdom) {
115
+ const root = reactdom.createRoot(dom);
116
+ root.render( /*#__PURE__*/_react.default.createElement(SearchPanel, {
117
+ view: view,
118
+ searchConfig: searchConfig
119
+ }));
120
120
  } else {
121
- _reactDom.default.render( /*#__PURE__*/_react.default.createElement(SearchPanel, {
121
+ reactdom.render( /*#__PURE__*/_react.default.createElement(SearchPanel, {
122
122
  view: view,
123
123
  searchConfig: searchConfig
124
124
  }), dom);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-source-code-editor",
3
- "version": "8.53.3-snapshot-4",
3
+ "version": "8.53.3-snapshot-0",
4
4
  "description": "A UI component library made by Instructure Inc.",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "module": "./es/index.js",
@@ -23,9 +23,9 @@
23
23
  },
24
24
  "license": "MIT",
25
25
  "devDependencies": {
26
- "@instructure/ui-babel-preset": "8.53.3-snapshot-4",
27
- "@instructure/ui-test-queries": "8.53.3-snapshot-4",
28
- "@instructure/ui-test-utils": "8.53.3-snapshot-4",
26
+ "@instructure/ui-babel-preset": "8.53.3-snapshot-0",
27
+ "@instructure/ui-test-queries": "8.53.3-snapshot-0",
28
+ "@instructure/ui-test-utils": "8.53.3-snapshot-0",
29
29
  "@testing-library/jest-dom": "^6.1.4",
30
30
  "@testing-library/react": "^14.0.0"
31
31
  },
@@ -44,20 +44,20 @@
44
44
  "@codemirror/search": "^6.5.4",
45
45
  "@codemirror/state": "^6.3.0",
46
46
  "@codemirror/view": "^6.21.3",
47
- "@instructure/emotion": "8.53.3-snapshot-4",
48
- "@instructure/shared-types": "8.53.3-snapshot-4",
49
- "@instructure/ui-a11y-content": "8.53.3-snapshot-4",
50
- "@instructure/ui-buttons": "8.53.3-snapshot-4",
51
- "@instructure/ui-dom-utils": "8.53.3-snapshot-4",
52
- "@instructure/ui-i18n": "8.53.3-snapshot-4",
53
- "@instructure/ui-icons": "8.53.3-snapshot-4",
54
- "@instructure/ui-prop-types": "8.53.3-snapshot-4",
55
- "@instructure/ui-react-utils": "8.53.3-snapshot-4",
56
- "@instructure/ui-test-locator": "8.53.3-snapshot-4",
57
- "@instructure/ui-testable": "8.53.3-snapshot-4",
58
- "@instructure/ui-text-input": "8.53.3-snapshot-4",
59
- "@instructure/ui-themes": "8.53.3-snapshot-4",
60
- "@instructure/ui-utils": "8.53.3-snapshot-4",
47
+ "@instructure/emotion": "8.53.3-snapshot-0",
48
+ "@instructure/shared-types": "8.53.3-snapshot-0",
49
+ "@instructure/ui-a11y-content": "8.53.3-snapshot-0",
50
+ "@instructure/ui-buttons": "8.53.3-snapshot-0",
51
+ "@instructure/ui-dom-utils": "8.53.3-snapshot-0",
52
+ "@instructure/ui-i18n": "8.53.3-snapshot-0",
53
+ "@instructure/ui-icons": "8.53.3-snapshot-0",
54
+ "@instructure/ui-prop-types": "8.53.3-snapshot-0",
55
+ "@instructure/ui-react-utils": "8.53.3-snapshot-0",
56
+ "@instructure/ui-test-locator": "8.53.3-snapshot-0",
57
+ "@instructure/ui-testable": "8.53.3-snapshot-0",
58
+ "@instructure/ui-text-input": "8.53.3-snapshot-0",
59
+ "@instructure/ui-themes": "8.53.3-snapshot-0",
60
+ "@instructure/ui-utils": "8.53.3-snapshot-0",
61
61
  "@lezer/highlight": "1.1.6",
62
62
  "prop-types": "^15.8.1"
63
63
  },
@@ -40,7 +40,12 @@ import {
40
40
  IconSearchLine
41
41
  } from '@instructure/ui-icons'
42
42
 
43
- import ReactDOM from 'react-dom'
43
+ let reactdom: any
44
+ try {
45
+ reactdom = require('react-dom/client')
46
+ } catch {
47
+ reactdom = require('react-dom')
48
+ }
44
49
 
45
50
  export type SearchConfig = {
46
51
  placeholder: string
@@ -139,20 +144,11 @@ export default function customSearch(searchConfig: SearchConfig | undefined) {
139
144
  createPanel: (view) => {
140
145
  const dom = document.createElement('div')
141
146
  dom.style.padding = '8px'
142
- if (!React.version.startsWith('16.')) {
143
- const path = 'react-dom/client'
144
- import(path)
145
- .then((r) => {
146
- const root = r.createRoot(dom)
147
- root.render(
148
- <SearchPanel view={view} searchConfig={searchConfig} />
149
- )
150
- })
151
- .catch((e) => {
152
- console.error(e)
153
- })
147
+ if ('createRoot' in reactdom) {
148
+ const root = reactdom.createRoot(dom)
149
+ root.render(<SearchPanel view={view} searchConfig={searchConfig} />)
154
150
  } else {
155
- ReactDOM.render(
151
+ reactdom.render(
156
152
  <SearchPanel view={view} searchConfig={searchConfig} />,
157
153
  dom
158
154
  )