@instructure/ui-i18n 11.7.9-snapshot-0 → 11.7.9-snapshot-1
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,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
|
-
## [11.7.9-snapshot-
|
|
6
|
+
## [11.7.9-snapshot-1](https://github.com/instructure/instructure-ui/compare/v11.7.8...v11.7.9-snapshot-1) (2026-10-06)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @instructure/ui-i18n
|
|
9
9
|
|
package/lib/ApplyLocale/index.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = exports.ApplyLocale = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _uiReactUtils = require("@instructure/ui-react-utils");
|
|
8
8
|
var _ApplyLocaleContext = require("./ApplyLocaleContext.js");
|
|
9
9
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
10
10
|
/*
|
|
@@ -46,7 +46,7 @@ const ApplyLocale = ({
|
|
|
46
46
|
locale,
|
|
47
47
|
timezone
|
|
48
48
|
},
|
|
49
|
-
children: (0,
|
|
49
|
+
children: (0, _uiReactUtils.ensureSingleChild)(children)
|
|
50
50
|
});
|
|
51
51
|
};
|
|
52
52
|
exports.ApplyLocale = ApplyLocale;
|
package/lib/Locale.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = exports.Locale = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _uiDomUtils = require("@instructure/ui-dom-utils");
|
|
8
8
|
/*
|
|
9
9
|
* The MIT License (MIT)
|
|
10
10
|
*
|
|
@@ -47,7 +47,7 @@ const Locale = exports.Locale = {
|
|
|
47
47
|
* Return the locale from the browser
|
|
48
48
|
* @returns {String} locale (defaults to 'en-US' if DOM cannot be accessed)
|
|
49
49
|
*/
|
|
50
|
-
browserLocale(nav, hasDOM =
|
|
50
|
+
browserLocale(nav, hasDOM = _uiDomUtils.canUseDOM) {
|
|
51
51
|
if (nav) return nav.language;
|
|
52
52
|
if (!hasDOM) return defaultLocale;
|
|
53
53
|
const documentLanguage = window.document.documentElement.lang;
|
package/lib/getTextDirection.js
CHANGED
|
@@ -5,8 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
exports.getTextDirection = getTextDirection;
|
|
8
|
-
var
|
|
9
|
-
var _getCSSStyleDeclaration = require("@instructure/ui-dom-utils/lib/getCSSStyleDeclaration.js");
|
|
8
|
+
var _uiDomUtils = require("@instructure/ui-dom-utils");
|
|
10
9
|
/*
|
|
11
10
|
* The MIT License (MIT)
|
|
12
11
|
*
|
|
@@ -42,11 +41,11 @@ const getDefaultDir = () => {
|
|
|
42
41
|
if (defaultDir) {
|
|
43
42
|
return defaultDir;
|
|
44
43
|
}
|
|
45
|
-
if (
|
|
44
|
+
if (_uiDomUtils.canUseDOM) {
|
|
46
45
|
const htmlEl = document.documentElement;
|
|
47
46
|
dirAttribute = htmlEl.getAttribute('dir');
|
|
48
47
|
// https://developer.mozilla.org/en-US/docs/Web/CSS/direction
|
|
49
|
-
defaultDir = dirAttribute || (0,
|
|
48
|
+
defaultDir = dirAttribute || (0, _uiDomUtils.getCSSStyleDeclaration)(htmlEl)?.direction;
|
|
50
49
|
if (!observer) {
|
|
51
50
|
observer = new MutationObserver(() => {
|
|
52
51
|
// https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/dir
|
|
@@ -75,9 +74,9 @@ const getDefaultDir = () => {
|
|
|
75
74
|
* @returns {String} 'ltr' or 'rtl' or 'auto' (or `undefined` if no DOM is present)
|
|
76
75
|
*/
|
|
77
76
|
function getTextDirection(element) {
|
|
78
|
-
if (
|
|
77
|
+
if (_uiDomUtils.canUseDOM) {
|
|
79
78
|
if (typeof element === 'undefined' || element === document.documentElement) return getDefaultDir();
|
|
80
|
-
return element.getAttribute('dir') || (0,
|
|
79
|
+
return element.getAttribute('dir') || (0, _uiDomUtils.getCSSStyleDeclaration)(element)?.direction;
|
|
81
80
|
}
|
|
82
81
|
return undefined;
|
|
83
82
|
}
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.textDirectionContextConsumer = exports.default = void 0;
|
|
8
8
|
var _react = require("react");
|
|
9
|
-
var
|
|
9
|
+
var _uiDecorator = require("@instructure/ui-decorator");
|
|
10
10
|
var _TextDirectionContext = require("./TextDirectionContext.js");
|
|
11
11
|
var _hoistNonReactStatics = _interopRequireDefault(require("hoist-non-react-statics"));
|
|
12
12
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
@@ -70,7 +70,7 @@ var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
|
70
70
|
* @module textDirectionContextConsumer
|
|
71
71
|
* @return The decorator that composes the textDirectionContextConsumer component.
|
|
72
72
|
*/
|
|
73
|
-
const textDirectionContextConsumer = exports.textDirectionContextConsumer = (0,
|
|
73
|
+
const textDirectionContextConsumer = exports.textDirectionContextConsumer = (0, _uiDecorator.decorator)(ComposedComponent => {
|
|
74
74
|
class TextDirectionContextConsumerComponent extends _react.Component {
|
|
75
75
|
static displayName = 'TextDirectionContextConsumerComponent';
|
|
76
76
|
render() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-i18n",
|
|
3
|
-
"version": "11.7.9-snapshot-
|
|
3
|
+
"version": "11.7.9-snapshot-1",
|
|
4
4
|
"description": "Helper components and utilities for internationalization.",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -17,17 +17,17 @@
|
|
|
17
17
|
"@babel/runtime": "^7.29.7",
|
|
18
18
|
"hoist-non-react-statics": "^3.3.2",
|
|
19
19
|
"moment-timezone": "^0.6.2",
|
|
20
|
-
"@instructure/ui-decorator": "11.7.9-snapshot-
|
|
21
|
-
"@instructure/shared-types": "11.7.9-snapshot-
|
|
22
|
-
"@instructure/ui-dom-utils": "11.7.9-snapshot-
|
|
23
|
-
"@instructure/ui-react-utils": "11.7.9-snapshot-
|
|
24
|
-
"@instructure/ui-utils": "11.7.9-snapshot-
|
|
20
|
+
"@instructure/ui-decorator": "11.7.9-snapshot-1",
|
|
21
|
+
"@instructure/shared-types": "11.7.9-snapshot-1",
|
|
22
|
+
"@instructure/ui-dom-utils": "11.7.9-snapshot-1",
|
|
23
|
+
"@instructure/ui-react-utils": "11.7.9-snapshot-1",
|
|
24
|
+
"@instructure/ui-utils": "11.7.9-snapshot-1"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/hoist-non-react-statics": "^3.3.7",
|
|
28
28
|
"react-dom": "18.3.1",
|
|
29
29
|
"vitest": "^5.0.0",
|
|
30
|
-
"@instructure/ui-babel-preset": "11.7.9-snapshot-
|
|
30
|
+
"@instructure/ui-babel-preset": "11.7.9-snapshot-1"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"react": ">=18 <=19"
|