@instructure/canvas-rce 5.10.1 → 5.10.2

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,46 +0,0 @@
1
- /*
2
- * Copyright (C) 2023 - present Instructure, Inc.
3
- *
4
- * This file is part of Canvas.
5
- *
6
- * Canvas is free software: you can redistribute it and/or modify it under
7
- * the terms of the GNU Affero General Public License as published by the Free
8
- * Software Foundation, version 3 of the License.
9
- *
10
- * Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
11
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12
- * A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
13
- * details.
14
- *
15
- * You should have received a copy of the GNU Affero General Public License along
16
- * with this program. If not, see <http://www.gnu.org/licenses/>.
17
- */
18
- import { ThemeRegistry } from '@instructure/ui-themeable'; // ^^ at InstUI 8, just directly import getRegistry directly from @instructure/theme-registry
19
-
20
- import { merge, cloneDeep } from 'lodash'; // The running theme is the running theme for this page load, and it never
21
- // changes, so there's no point in doing the work more than once.
22
-
23
- let memoizedVariables;
24
-
25
- function getThemeVars() {
26
- if (memoizedVariables) return memoizedVariables;
27
- const {
28
- defaultThemeKey,
29
- overrides,
30
- themes
31
- } = ThemeRegistry.getRegistry(); // Just assume the "canvas" theme if the default key is null. This will
32
- // never happen in the live app because one way or another a theme gets
33
- // used, but unit tests don't always do that.
34
- // Also we have to cloneDeep this because the merge below is about to
35
- // mutate the whole thing.
36
-
37
- const variables = cloneDeep(themes[defaultThemeKey !== null && defaultThemeKey !== void 0 ? defaultThemeKey : 'canvas'].variables);
38
- merge(variables, overrides);
39
- memoizedVariables = {
40
- variables,
41
- key: defaultThemeKey
42
- };
43
- return memoizedVariables;
44
- }
45
-
46
- export { getThemeVars };