@deephaven/components 0.49.2-theme-plugins.31 → 0.49.2-theme-plugins.32
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"declaration.d.js","names":[],"sources":["../src/declaration.d.ts"],"sourcesContent":["declare module '*.module.scss' {\n const content: Record<string, string>;\n export default content;\n}\n\ndeclare module '*.scss?inline' {\n const content: string;\n export default content;\n}\n\ndeclare module '*.scss';\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"declaration.d.js","names":[],"sources":["../src/declaration.d.ts"],"sourcesContent":["declare module '*.module.scss' {\n const content: Record<string, string>;\n export default content;\n}\n\ndeclare module '*.css?inline' {\n const content: string;\n export default content;\n}\n\ndeclare module '*.scss?inline' {\n const content: string;\n export default content;\n}\n\ndeclare module '*.scss';\n"],"mappings":""}
|
package/dist/theme/ThemeUtils.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Log from '@deephaven/log';
|
|
2
2
|
import { assertNotNull } from '@deephaven/utils';
|
|
3
|
-
import darkTheme from "./theme_default_dark.css";
|
|
4
|
-
import lightTheme from "./theme_default_light.css";
|
|
3
|
+
import darkTheme from "./theme_default_dark.css?inline.js";
|
|
4
|
+
import lightTheme from "./theme_default_light.css?inline.js";
|
|
5
5
|
import { DEFAULT_DARK_THEME_KEY, DEFAULT_LIGHT_THEME_KEY, DEFAULT_PRELOAD_DATA_VARIABLES, THEME_CACHE_LOCAL_STORAGE_KEY } from "./ThemeModel.js";
|
|
6
6
|
var log = Log.module('ThemeUtils');
|
|
7
7
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeUtils.js","names":["Log","assertNotNull","darkTheme","lightTheme","DEFAULT_DARK_THEME_KEY","DEFAULT_LIGHT_THEME_KEY","DEFAULT_PRELOAD_DATA_VARIABLES","THEME_CACHE_LOCAL_STORAGE_KEY","log","module","calculatePreloadStyleContent","bodyStyle","getComputedStyle","document","body","pairs","Object","entries","map","key","defaultValue","getPropertyValue","join","getActiveThemes","themeKey","themeRegistration","custom","find","theme","baseThemeKey","base","error","debug","getDefaultBaseThemes","name","styleContent","getThemePreloadData","data","localStorage","getItem","JSON","parse","setThemePreloadData","preloadData","setItem","stringify","getThemeKey","pluginName","themeName","preloadTheme","preloadStyleContent","style","createElement","innerHTML","head","appendChild"],"sources":["../../src/theme/ThemeUtils.ts"],"sourcesContent":["import Log from '@deephaven/log';\nimport { assertNotNull } from '@deephaven/utils';\nimport darkTheme from './theme_default_dark.
|
|
1
|
+
{"version":3,"file":"ThemeUtils.js","names":["Log","assertNotNull","darkTheme","lightTheme","DEFAULT_DARK_THEME_KEY","DEFAULT_LIGHT_THEME_KEY","DEFAULT_PRELOAD_DATA_VARIABLES","THEME_CACHE_LOCAL_STORAGE_KEY","log","module","calculatePreloadStyleContent","bodyStyle","getComputedStyle","document","body","pairs","Object","entries","map","key","defaultValue","getPropertyValue","join","getActiveThemes","themeKey","themeRegistration","custom","find","theme","baseThemeKey","base","error","debug","getDefaultBaseThemes","name","styleContent","getThemePreloadData","data","localStorage","getItem","JSON","parse","setThemePreloadData","preloadData","setItem","stringify","getThemeKey","pluginName","themeName","preloadTheme","preloadStyleContent","style","createElement","innerHTML","head","appendChild"],"sources":["../../src/theme/ThemeUtils.ts"],"sourcesContent":["import Log from '@deephaven/log';\nimport { assertNotNull } from '@deephaven/utils';\nimport darkTheme from './theme_default_dark.css?inline';\nimport lightTheme from './theme_default_light.css?inline';\nimport {\n DEFAULT_DARK_THEME_KEY,\n DEFAULT_LIGHT_THEME_KEY,\n DEFAULT_PRELOAD_DATA_VARIABLES,\n ThemeData,\n ThemePreloadData,\n ThemePreloadStyleContent,\n ThemeRegistrationData,\n THEME_CACHE_LOCAL_STORAGE_KEY,\n} from './ThemeModel';\n\nconst log = Log.module('ThemeUtils');\n\n/**\n * Creates a string containing preload style content for the current theme.\n * This resolves the current values of a few CSS variables that can be used\n * to style the page before the theme is loaded on next page load.\n */\nexport function calculatePreloadStyleContent(): ThemePreloadStyleContent {\n const bodyStyle = getComputedStyle(document.body);\n\n // Calculate the current preload variables. If the variable is not set, use\n // the default value.\n const pairs = Object.entries(DEFAULT_PRELOAD_DATA_VARIABLES).map(\n ([key, defaultValue]) =>\n `${key}:${bodyStyle.getPropertyValue(key) || defaultValue}`\n );\n\n return `:root{${pairs.join(';')}}`;\n}\n\n/**\n * Returns an array of the active themes. The first item will always be one\n * of the base themes. Optionally, the second item will be a custom theme.\n */\nexport function getActiveThemes(\n themeKey: string,\n themeRegistration: ThemeRegistrationData\n): [ThemeData] | [ThemeData, ThemeData] {\n const custom = themeRegistration.custom.find(\n theme => theme.themeKey === themeKey\n );\n\n const baseThemeKey = custom?.baseThemeKey ?? themeKey;\n\n let base = themeRegistration.base.find(\n theme => theme.themeKey === baseThemeKey\n );\n\n if (base == null) {\n log.error(\n `No registered base theme found for theme key: '${baseThemeKey}'`\n );\n base = themeRegistration.base.find(\n theme => theme.themeKey === DEFAULT_DARK_THEME_KEY\n );\n\n assertNotNull(\n base,\n `Default base theme '${DEFAULT_DARK_THEME_KEY}' is not registered`\n );\n }\n\n log.debug('Applied themes:', base.themeKey, custom?.themeKey);\n\n return custom == null ? [base] : [base, custom];\n}\n\n/**\n * Get default base theme data.\n */\nexport function getDefaultBaseThemes(): ThemeData[] {\n return [\n {\n name: 'Default Dark',\n themeKey: DEFAULT_DARK_THEME_KEY,\n styleContent: darkTheme,\n },\n {\n name: 'Default Light',\n themeKey: DEFAULT_LIGHT_THEME_KEY,\n styleContent: lightTheme,\n },\n ];\n}\n\n/**\n * Get the preload data from local storage or null if it does not exist or is\n * invalid\n */\nexport function getThemePreloadData(): ThemePreloadData | null {\n const data = localStorage.getItem(THEME_CACHE_LOCAL_STORAGE_KEY);\n\n try {\n return data == null ? null : JSON.parse(data);\n } catch {\n // ignore\n }\n\n return null;\n}\n\n/**\n * Store theme preload data in local storage.\n * @param preloadData The preload data to set\n */\nexport function setThemePreloadData(preloadData: ThemePreloadData): void {\n localStorage.setItem(\n THEME_CACHE_LOCAL_STORAGE_KEY,\n JSON.stringify(preloadData)\n );\n}\n\n/**\n * Derive unique theme key from plugin root path and theme name.\n * @param pluginName The root path of the plugin\n * @param themeName The name of the theme\n */\nexport function getThemeKey(pluginName: string, themeName: string): string {\n return `${pluginName}_${themeName}`;\n}\n\n/**\n * Preload minimal theme variables from the cache.\n */\nexport function preloadTheme(): void {\n const preloadStyleContent =\n getThemePreloadData()?.preloadStyleContent ??\n calculatePreloadStyleContent();\n\n log.debug('Preloading theme content:', `'${preloadStyleContent}'`);\n\n const style = document.createElement('style');\n style.innerHTML = preloadStyleContent;\n document.head.appendChild(style);\n}\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,gBAAgB;AAChC,SAASC,aAAa,QAAQ,kBAAkB;AAAC,OAC1CC,SAAS;AAAA,OACTC,UAAU;AAAA,SAEfC,sBAAsB,EACtBC,uBAAuB,EACvBC,8BAA8B,EAK9BC,6BAA6B;AAG/B,IAAMC,GAAG,GAAGR,GAAG,CAACS,MAAM,CAAC,YAAY,CAAC;;AAEpC;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,4BAA4B,GAA6B;EACvE,IAAMC,SAAS,GAAGC,gBAAgB,CAACC,QAAQ,CAACC,IAAI,CAAC;;EAEjD;EACA;EACA,IAAMC,KAAK,GAAGC,MAAM,CAACC,OAAO,CAACX,8BAA8B,CAAC,CAACY,GAAG,CAC9D;IAAA,IAAC,CAACC,GAAG,EAAEC,YAAY,CAAC;IAAA,iBACfD,GAAG,cAAIR,SAAS,CAACU,gBAAgB,CAACF,GAAG,CAAC,IAAIC,YAAY;EAAA,CAAE,CAC9D;EAED,uBAAgBL,KAAK,CAACO,IAAI,CAAC,GAAG,CAAC;AACjC;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASC,eAAe,CAC7BC,QAAgB,EAChBC,iBAAwC,EACF;EAAA;EACtC,IAAMC,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AAG,IAAI,GAAGG,IAAI,CAACC,KAAK,CAACJ,IAAI,CAAC;EAC/C,CAAC,CAAC,gBAAM;IACN;EAAA;EAGF,OAAO,IAAI;AACb;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASK,mBAAmB,CAACC,WAA6B,EAAQ;EACvEL,YAAY,CAACM,OAAO,CAClBrC,6BAA6B,EAC7BiC,IAAI,CAACK,SAAS,CAACF,WAAW,CAAC,CAC5B;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASG,WAAW,CAACC,UAAkB,EAAEC,SAAiB,EAAU;EACzE,iBAAUD,UAAU,cAAIC,SAAS;AACnC;;AAEA;AACA;AACA;AACA,OAAO,SAASC,YAAY,GAAS;EAAA;EACnC,IAAMC,mBAAmB,oDACvBd,mBAAmB,EAAE,yDAArB,qBAAuBc,mBAAmB,yEAC1CxC,4BAA4B,EAAE;EAEhCF,GAAG,CAACwB,KAAK,CAAC,2BAA2B,aAAMkB,mBAAmB,OAAI;EAElE,IAAMC,KAAK,GAAGtC,QAAQ,CAACuC,aAAa,CAAC,OAAO,CAAC;EAC7CD,KAAK,CAACE,SAAS,GAAGH,mBAAmB;EACrCrC,QAAQ,CAACyC,IAAI,CAACC,WAAW,CAACJ,KAAK,CAAC;AAClC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sourceRoot":"","sources":["../../src/theme/theme_default_dark.
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../../src/theme/theme_default_dark.css"],"names":[],"mappings":"AAAA;AACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAEA;EACA;EACA;EACA;EACA;EACA;EACA","file":"theme_default_dark.css","sourcesContent":[":root {\n /* Grays */\n --dh-color-gray-900: #fcfcfa;\n --dh-color-gray-800: #f0f0ee;\n --dh-color-gray-700: #c0bfbf;\n --dh-color-gray-600: #929192;\n --dh-color-gray-500: #5b5a5c;\n --dh-color-gray-400: #403e41;\n --dh-color-gray-300: #373438;\n --dh-color-gray-200: #322f33;\n --dh-color-gray-100: #2d2a2e;\n --dh-color-gray-75: #211f22;\n --dh-color-gray-50: #1a171a;\n\n /* Blues */\n --dh-color-blue-100: #112451;\n --dh-color-blue-200: #16306c;\n --dh-color-blue-300: #1d3d88;\n --dh-color-blue-400: #254ba4;\n --dh-color-blue-500: #2f5bc0;\n --dh-color-blue-600: #3b6bda;\n --dh-color-blue-700: #4c7dee;\n --dh-color-blue-800: #6390fa;\n --dh-color-blue-900: #7ca4ff;\n --dh-color-blue-1000: #97b7ff;\n --dh-color-blue-1100: #afc9ff;\n --dh-color-blue-1200: #c7d9ff;\n --dh-color-blue-1300: #dbe6ff;\n --dh-color-blue-1400: #ecf1ff;\n\n /* Seafoam */\n --dh-color-seafoam-100: #1f2925;\n --dh-color-seafoam-200: #263630;\n --dh-color-seafoam-300: #2f463e;\n --dh-color-seafoam-400: #37574b;\n --dh-color-seafoam-500: #3e6959;\n --dh-color-seafoam-600: #447b68;\n --dh-color-seafoam-700: #488f78;\n --dh-color-seafoam-800: #4ca387;\n --dh-color-seafoam-900: #4fb797;\n --dh-color-seafoam-1000: #54cba6;\n --dh-color-seafoam-1100: #5edeb7;\n --dh-color-seafoam-1200: #78edc7;\n --dh-color-seafoam-1300: #9ef8d7;\n --dh-color-seafoam-1400: #cbfce8;\n\n /* Semantic */\n --dh-color-black: var(--dh-color-gray-50);\n --dh-color-white: var(--dh-color-gray-800);\n --dh-accent-color: var(--dh-color-blue-700);\n --dh-background-color: var(--dh-color-black);\n --dh-foreground-color: var(--dh-color-white);\n --dh-grid-background-color: var(--dh-background-color);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sourceRoot":"","sources":["../../src/theme/theme_default_light.
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../../src/theme/theme_default_light.css"],"names":[],"mappings":"AAAA;AACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAEA;EACA;EACA;EACA;EACA;EACA;EACA","file":"theme_default_light.css","sourcesContent":[":root {\n /* Grays */\n --dh-color-gray-900: #000;\n --dh-color-gray-800: #222;\n --dh-color-gray-700: #464646;\n --dh-color-gray-600: #6d6d6d;\n --dh-color-gray-500: #909090;\n --dh-color-gray-400: #b1b1b1;\n --dh-color-gray-300: #d5d5d5;\n --dh-color-gray-200: #e6e6e6;\n --dh-color-gray-100: #f8f8f8;\n --dh-color-gray-75: #fdfdfd;\n --dh-color-gray-50: #fff;\n\n /* Blues */\n --dh-color-blue-100: #112451;\n --dh-color-blue-200: #16306c;\n --dh-color-blue-300: #1d3d88;\n --dh-color-blue-400: #254ba4;\n --dh-color-blue-500: #2f5bc0;\n --dh-color-blue-600: #3b6bda;\n --dh-color-blue-700: #4c7dee;\n --dh-color-blue-800: #6390fa;\n --dh-color-blue-900: #7ca4ff;\n --dh-color-blue-1000: #97b7ff;\n --dh-color-blue-1100: #afc9ff;\n --dh-color-blue-1200: #c7d9ff;\n --dh-color-blue-1300: #dbe6ff;\n --dh-color-blue-1400: #ecf1ff;\n\n /* Seafoam */\n --dh-color-seafoam-100: #1f2925;\n --dh-color-seafoam-200: #263630;\n --dh-color-seafoam-300: #2f463e;\n --dh-color-seafoam-400: #37574b;\n --dh-color-seafoam-500: #3e6959;\n --dh-color-seafoam-600: #447b68;\n --dh-color-seafoam-700: #488f78;\n --dh-color-seafoam-800: #4ca387;\n --dh-color-seafoam-900: #4fb797;\n --dh-color-seafoam-1000: #54cba6;\n --dh-color-seafoam-1100: #5edeb7;\n --dh-color-seafoam-1200: #78edc7;\n --dh-color-seafoam-1300: #9ef8d7;\n --dh-color-seafoam-1400: #cbfce8;\n\n /* Semantic */\n --dh-color-black: var(--dh-color-gray-50);\n --dh-color-white: var(--dh-color-gray-75);\n --dh-accent-color: var(--dh-color-blue-700);\n --dh-background-color: var(--dh-color-white);\n --dh-foreground-color: var(--dh-color-black);\n --dh-grid-background-color: var(--dh-background-color);\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deephaven/components",
|
|
3
|
-
"version": "0.49.2-theme-plugins.
|
|
3
|
+
"version": "0.49.2-theme-plugins.32+0587bde6",
|
|
4
4
|
"description": "Deephaven React component library",
|
|
5
5
|
"author": "Deephaven Data Labs LLC",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@adobe/react-spectrum": "^3.29.0",
|
|
27
|
-
"@deephaven/icons": "^0.49.2-theme-plugins.
|
|
28
|
-
"@deephaven/log": "^0.49.2-theme-plugins.
|
|
29
|
-
"@deephaven/react-hooks": "^0.49.2-theme-plugins.
|
|
30
|
-
"@deephaven/utils": "^0.49.2-theme-plugins.
|
|
27
|
+
"@deephaven/icons": "^0.49.2-theme-plugins.32+0587bde6",
|
|
28
|
+
"@deephaven/log": "^0.49.2-theme-plugins.32+0587bde6",
|
|
29
|
+
"@deephaven/react-hooks": "^0.49.2-theme-plugins.32+0587bde6",
|
|
30
|
+
"@deephaven/utils": "^0.49.2-theme-plugins.32+0587bde6",
|
|
31
31
|
"@fortawesome/fontawesome-svg-core": "^6.2.1",
|
|
32
32
|
"@fortawesome/react-fontawesome": "^0.2.0",
|
|
33
33
|
"@react-spectrum/theme-default": "^3.5.1",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"react-dom": "^17.x"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@deephaven/mocks": "^0.49.2-theme-plugins.
|
|
54
|
+
"@deephaven/mocks": "^0.49.2-theme-plugins.32+0587bde6"
|
|
55
55
|
},
|
|
56
56
|
"files": [
|
|
57
57
|
"dist",
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"publishConfig": {
|
|
65
65
|
"access": "public"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "0587bde67172eff55952970026115e9b56ecaed0"
|
|
68
68
|
}
|