@instructure/ui-react-utils 10.26.1 → 11.0.1-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 +30 -1
- package/es/DeterministicIdContext/withDeterministicId.js +0 -6
- package/es/index.js +0 -3
- package/lib/DeterministicIdContext/withDeterministicId.js +0 -6
- package/lib/index.js +0 -21
- package/package.json +11 -12
- package/src/DeterministicIdContext/withDeterministicId.tsx +0 -6
- package/src/getElementType.ts +2 -2
- package/src/index.ts +1 -3
- package/src/safeCloneElement.ts +2 -3
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/DeterministicIdContext/withDeterministicId.d.ts.map +1 -1
- package/types/getElementType.d.ts +2 -2
- package/types/getElementType.d.ts.map +1 -1
- package/types/index.d.ts +0 -3
- package/types/index.d.ts.map +1 -1
- package/types/safeCloneElement.d.ts +1 -1
- package/types/safeCloneElement.d.ts.map +1 -1
- package/es/deprecated.js +0 -147
- package/es/experimental.js +0 -85
- package/es/hack.js +0 -96
- package/lib/deprecated.js +0 -153
- package/lib/experimental.js +0 -91
- package/lib/hack.js +0 -79
- package/src/deprecated.ts +0 -237
- package/src/experimental.ts +0 -127
- package/src/hack.ts +0 -128
- package/types/deprecated.d.ts +0 -37
- package/types/deprecated.d.ts.map +0 -1
- package/types/experimental.d.ts +0 -27
- package/types/experimental.d.ts.map +0 -1
- package/types/hack.d.ts +0 -47
- package/types/hack.d.ts.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
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
|
-
## [
|
|
6
|
+
## [11.0.1-snapshot-0](https://github.com/instructure/instructure-ui/compare/v11.0.0...v11.0.1-snapshot-0) (2025-10-07)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @instructure/ui-react-utils
|
|
9
9
|
|
|
@@ -11,6 +11,35 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
+
# [11.0.0](https://github.com/instructure/instructure-ui/compare/v10.26.0...v11.0.0) (2025-10-06)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* **many:** instUI v11 release ([36f5438](https://github.com/instructure/instructure-ui/commit/36f54382669186227ba24798bbf7201ef2f5cd4c))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### BREAKING CHANGES
|
|
23
|
+
|
|
24
|
+
* **many:** InstUI v11 contains the following breaking changes:
|
|
25
|
+
- React 16 and 17 are no longer supported
|
|
26
|
+
- remove `PropTypes` from all packages
|
|
27
|
+
- remove `CodeEditor` component
|
|
28
|
+
- remove `@instui/theme-registry` package
|
|
29
|
+
- remove `@testable`, `@experimental`, `@hack` decorators
|
|
30
|
+
- InstUISettingsProvider's `as` prop is removed
|
|
31
|
+
- `canvas.use()`, `canvasHighContrast.use()` functions are removed
|
|
32
|
+
- `canvasThemeLocal`, `canvasHighContrastThemeLocal` are removed
|
|
33
|
+
- `variables` field on theme objects are removed
|
|
34
|
+
- remove deprecated props from Table: Row's `isStacked`, Body's
|
|
35
|
+
`isStacked`, `hover`, and `headers`
|
|
36
|
+
- `Table`'s `caption` prop is now required
|
|
37
|
+
- `ui-dom-utils`'s `getComputedStyle` can now return `undefined`
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
14
43
|
# [10.26.0](https://github.com/instructure/instructure-ui/compare/v10.25.0...v10.26.0) (2025-10-01)
|
|
15
44
|
|
|
16
45
|
**Note:** Version bump only for package @instructure/ui-react-utils
|
|
@@ -52,12 +52,6 @@ const withDeterministicId = decorator(ComposedComponent => {
|
|
|
52
52
|
});
|
|
53
53
|
hoistNonReactStatics(WithDeterministicId, ComposedComponent);
|
|
54
54
|
|
|
55
|
-
// we have to pass these on, because sometimes users
|
|
56
|
-
// access propTypes of the component in other components
|
|
57
|
-
// eslint-disable-next-line react/forbid-foreign-prop-types
|
|
58
|
-
WithDeterministicId.propTypes = ComposedComponent.propTypes;
|
|
59
|
-
WithDeterministicId.defaultProps = ComposedComponent.defaultProps;
|
|
60
|
-
|
|
61
55
|
// These static fields exist on InstUI components
|
|
62
56
|
//@ts-expect-error fix this
|
|
63
57
|
WithDeterministicId.allowedProps = ComposedComponent.allowedProps;
|
package/es/index.js
CHANGED
|
@@ -24,10 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
/* list utils in alphabetical order */
|
|
26
26
|
export { callRenderProp } from './callRenderProp';
|
|
27
|
-
export { deprecated } from './deprecated';
|
|
28
27
|
export { ensureSingleChild } from './ensureSingleChild';
|
|
29
|
-
export { experimental } from './experimental';
|
|
30
|
-
export { hack } from './hack';
|
|
31
28
|
export { getDisplayName } from './getDisplayName';
|
|
32
29
|
export { getElementType } from './getElementType';
|
|
33
30
|
export { getInteraction } from './getInteraction';
|
|
@@ -60,12 +60,6 @@ const withDeterministicId = exports.withDeterministicId = (0, _decorator.decorat
|
|
|
60
60
|
});
|
|
61
61
|
(0, _hoistNonReactStatics.default)(WithDeterministicId, ComposedComponent);
|
|
62
62
|
|
|
63
|
-
// we have to pass these on, because sometimes users
|
|
64
|
-
// access propTypes of the component in other components
|
|
65
|
-
// eslint-disable-next-line react/forbid-foreign-prop-types
|
|
66
|
-
WithDeterministicId.propTypes = ComposedComponent.propTypes;
|
|
67
|
-
WithDeterministicId.defaultProps = ComposedComponent.defaultProps;
|
|
68
|
-
|
|
69
63
|
// These static fields exist on InstUI components
|
|
70
64
|
//@ts-expect-error fix this
|
|
71
65
|
WithDeterministicId.allowedProps = ComposedComponent.allowedProps;
|
package/lib/index.js
CHANGED
|
@@ -21,24 +21,12 @@ Object.defineProperty(exports, "callRenderProp", {
|
|
|
21
21
|
return _callRenderProp.callRenderProp;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
Object.defineProperty(exports, "deprecated", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function () {
|
|
27
|
-
return _deprecated.deprecated;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
24
|
Object.defineProperty(exports, "ensureSingleChild", {
|
|
31
25
|
enumerable: true,
|
|
32
26
|
get: function () {
|
|
33
27
|
return _ensureSingleChild.ensureSingleChild;
|
|
34
28
|
}
|
|
35
29
|
});
|
|
36
|
-
Object.defineProperty(exports, "experimental", {
|
|
37
|
-
enumerable: true,
|
|
38
|
-
get: function () {
|
|
39
|
-
return _experimental.experimental;
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
30
|
Object.defineProperty(exports, "getDisplayName", {
|
|
43
31
|
enumerable: true,
|
|
44
32
|
get: function () {
|
|
@@ -57,12 +45,6 @@ Object.defineProperty(exports, "getInteraction", {
|
|
|
57
45
|
return _getInteraction.getInteraction;
|
|
58
46
|
}
|
|
59
47
|
});
|
|
60
|
-
Object.defineProperty(exports, "hack", {
|
|
61
|
-
enumerable: true,
|
|
62
|
-
get: function () {
|
|
63
|
-
return _hack.hack;
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
48
|
Object.defineProperty(exports, "matchComponentTypes", {
|
|
67
49
|
enumerable: true,
|
|
68
50
|
get: function () {
|
|
@@ -106,10 +88,7 @@ Object.defineProperty(exports, "withDeterministicId", {
|
|
|
106
88
|
}
|
|
107
89
|
});
|
|
108
90
|
var _callRenderProp = require("./callRenderProp");
|
|
109
|
-
var _deprecated = require("./deprecated");
|
|
110
91
|
var _ensureSingleChild = require("./ensureSingleChild");
|
|
111
|
-
var _experimental = require("./experimental");
|
|
112
|
-
var _hack = require("./hack");
|
|
113
92
|
var _getDisplayName = require("./getDisplayName");
|
|
114
93
|
var _getElementType = require("./getElementType");
|
|
115
94
|
var _getInteraction = require("./getInteraction");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-react-utils",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.0.1-snapshot-0",
|
|
4
4
|
"description": "A React utility library made by Instructure Inc.",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -22,25 +22,24 @@
|
|
|
22
22
|
},
|
|
23
23
|
"license": "MIT",
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@instructure/ui-babel-preset": "
|
|
25
|
+
"@instructure/ui-babel-preset": "11.0.1-snapshot-0",
|
|
26
26
|
"@testing-library/jest-dom": "^6.6.3",
|
|
27
|
-
"@testing-library/react": "
|
|
27
|
+
"@testing-library/react": "15.0.7",
|
|
28
28
|
"vitest": "^3.2.2"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@babel/runtime": "^7.27.6",
|
|
32
32
|
"@emotion/is-prop-valid": "^1.3.1",
|
|
33
|
-
"@instructure/console": "
|
|
34
|
-
"@instructure/shared-types": "
|
|
35
|
-
"@instructure/ui-decorator": "
|
|
36
|
-
"@instructure/ui-dom-utils": "
|
|
37
|
-
"@instructure/ui-utils": "
|
|
38
|
-
"hoist-non-react-statics": "^3.3.2"
|
|
39
|
-
"prop-types": "^15.8.1"
|
|
33
|
+
"@instructure/console": "11.0.1-snapshot-0",
|
|
34
|
+
"@instructure/shared-types": "11.0.1-snapshot-0",
|
|
35
|
+
"@instructure/ui-decorator": "11.0.1-snapshot-0",
|
|
36
|
+
"@instructure/ui-dom-utils": "11.0.1-snapshot-0",
|
|
37
|
+
"@instructure/ui-utils": "11.0.1-snapshot-0",
|
|
38
|
+
"hoist-non-react-statics": "^3.3.2"
|
|
40
39
|
},
|
|
41
40
|
"peerDependencies": {
|
|
42
|
-
"react": ">=
|
|
43
|
-
"react-dom": ">=
|
|
41
|
+
"react": ">=18 <=19",
|
|
42
|
+
"react-dom": ">=18 <=19"
|
|
44
43
|
},
|
|
45
44
|
"publishConfig": {
|
|
46
45
|
"access": "public"
|
|
@@ -79,12 +79,6 @@ const withDeterministicId = decorator((ComposedComponent: InstUIComponent) => {
|
|
|
79
79
|
|
|
80
80
|
hoistNonReactStatics(WithDeterministicId, ComposedComponent)
|
|
81
81
|
|
|
82
|
-
// we have to pass these on, because sometimes users
|
|
83
|
-
// access propTypes of the component in other components
|
|
84
|
-
// eslint-disable-next-line react/forbid-foreign-prop-types
|
|
85
|
-
WithDeterministicId.propTypes = ComposedComponent.propTypes
|
|
86
|
-
WithDeterministicId.defaultProps = ComposedComponent.defaultProps
|
|
87
|
-
|
|
88
82
|
// These static fields exist on InstUI components
|
|
89
83
|
//@ts-expect-error fix this
|
|
90
84
|
WithDeterministicId.allowedProps = ComposedComponent.allowedProps
|
package/src/getElementType.ts
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
import {
|
|
25
|
+
import type { ComponentClass } from 'react'
|
|
26
26
|
import { logWarn as warn } from '@instructure/console'
|
|
27
27
|
import { AsElementType } from '@instructure/shared-types'
|
|
28
28
|
|
|
@@ -56,7 +56,7 @@ interface PropsObject {
|
|
|
56
56
|
* @returns the element type
|
|
57
57
|
*/
|
|
58
58
|
function getElementType<T extends PropsObject>(
|
|
59
|
-
Component:
|
|
59
|
+
Component: ComponentClass<T>,
|
|
60
60
|
props: T,
|
|
61
61
|
getDefault?: () => AsElementType<T>
|
|
62
62
|
) {
|
package/src/index.ts
CHANGED
|
@@ -24,10 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
/* list utils in alphabetical order */
|
|
26
26
|
export { callRenderProp } from './callRenderProp'
|
|
27
|
-
export { deprecated } from './deprecated'
|
|
28
27
|
export { ensureSingleChild } from './ensureSingleChild'
|
|
29
|
-
export { experimental } from './experimental'
|
|
30
|
-
export { hack } from './hack'
|
|
31
28
|
export { getDisplayName } from './getDisplayName'
|
|
32
29
|
export { getElementType } from './getElementType'
|
|
33
30
|
export { getInteraction } from './getInteraction'
|
|
@@ -42,6 +39,7 @@ export {
|
|
|
42
39
|
DeterministicIdContextProvider,
|
|
43
40
|
withDeterministicId
|
|
44
41
|
} from './DeterministicIdContext'
|
|
42
|
+
|
|
45
43
|
export type { GetInteractionOptions } from './getInteraction'
|
|
46
44
|
export type { InteractionType } from './getInteraction'
|
|
47
45
|
export type {
|
package/src/safeCloneElement.ts
CHANGED
|
@@ -53,7 +53,7 @@ type GetProps<E extends ReactElement = ReactElement> = E extends
|
|
|
53
53
|
* @param children
|
|
54
54
|
*/
|
|
55
55
|
function safeCloneElement<
|
|
56
|
-
E extends ReactElement = ReactElement,
|
|
56
|
+
E extends ReactElement<any> = ReactElement,
|
|
57
57
|
P extends GetProps<E> = GetProps<E>
|
|
58
58
|
>(
|
|
59
59
|
element: { ref?: any } & E,
|
|
@@ -122,11 +122,10 @@ Ignoring ref: ${originalRef}`
|
|
|
122
122
|
...mergedProps,
|
|
123
123
|
ref(component: E) {
|
|
124
124
|
if (cloneRefIsFunction) {
|
|
125
|
-
;(cloneRef as (instance:
|
|
125
|
+
;(cloneRef as (instance: unknown) => void)(component)
|
|
126
126
|
} else {
|
|
127
127
|
cloneRef.current = component
|
|
128
128
|
}
|
|
129
|
-
|
|
130
129
|
originalRefIsAFunction && originalRef(component)
|
|
131
130
|
}
|
|
132
131
|
},
|