@deephaven/components 1.7.2-beta.5 → 1.7.2-beta.6

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.
@@ -0,0 +1,30 @@
1
+ import React from 'react';
2
+ import '@fontsource/fira-mono/400.css';
3
+ import '@fontsource/fira-mono/500.css';
4
+ import '@fontsource/fira-mono/700.css';
5
+ import '@fontsource/fira-sans/300.css';
6
+ import '@fontsource/fira-sans/300-italic.css';
7
+ import '@fontsource/fira-sans/400.css';
8
+ import '@fontsource/fira-sans/400-italic.css';
9
+ import '@fontsource/fira-sans/500.css';
10
+ import '@fontsource/fira-sans/600.css';
11
+ import '@fontsource/fira-sans/700.css';
12
+ import '@fontsource/fira-sans/700-italic.css';
13
+ export declare const FontsLoadedContext: React.Context<boolean>;
14
+ export type FontBootstrapProps = {
15
+ /**
16
+ * Class names of the font elements to pre load
17
+ */
18
+ fontClassNames?: string[];
19
+ /**
20
+ * The children to render wrapped with the FontsLoadedContext.
21
+ * Note that it renders the children even if the fonts aren't loaded yet.
22
+ */
23
+ children: React.ReactNode;
24
+ };
25
+ /**
26
+ * FontBootstrap component. Handles preloading fonts.
27
+ */
28
+ export declare function FontBootstrap({ fontClassNames, children, }: FontBootstrapProps): JSX.Element;
29
+ export default FontBootstrap;
30
+ //# sourceMappingURL=FontBootstrap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FontBootstrap.d.ts","sourceRoot":"","sources":["../../src/theme/FontBootstrap.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6C,MAAM,OAAO,CAAC;AAClE,OAAO,+BAA+B,CAAC;AACvC,OAAO,+BAA+B,CAAC;AACvC,OAAO,+BAA+B,CAAC;AACvC,OAAO,+BAA+B,CAAC;AACvC,OAAO,sCAAsC,CAAC;AAC9C,OAAO,+BAA+B,CAAC;AACvC,OAAO,sCAAsC,CAAC;AAC9C,OAAO,+BAA+B,CAAC;AACvC,OAAO,+BAA+B,CAAC;AACvC,OAAO,+BAA+B,CAAC;AACvC,OAAO,sCAAsC,CAAC;AAE9C,eAAO,MAAM,kBAAkB,wBAAgC,CAAC;AAGhE,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAE1B;;;OAGG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF;;GAEG;AACH,wBAAgB,aAAa,CAAC,EAC5B,cAAyE,EACzE,QAAQ,GACT,EAAE,kBAAkB,GAAG,GAAG,CAAC,OAAO,CAmClC;AAED,eAAe,aAAa,CAAC"}
@@ -0,0 +1,49 @@
1
+ import React, { createContext, useEffect, useState } from 'react';
2
+ import '@fontsource/fira-mono/400.css';
3
+ import '@fontsource/fira-mono/500.css';
4
+ import '@fontsource/fira-mono/700.css';
5
+ import '@fontsource/fira-sans/300.css';
6
+ import '@fontsource/fira-sans/300-italic.css';
7
+ import '@fontsource/fira-sans/400.css';
8
+ import '@fontsource/fira-sans/400-italic.css';
9
+ import '@fontsource/fira-sans/500.css';
10
+ import '@fontsource/fira-sans/600.css';
11
+ import '@fontsource/fira-sans/700.css';
12
+ import '@fontsource/fira-sans/700-italic.css';
13
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
14
+ export var FontsLoadedContext = /*#__PURE__*/createContext(false);
15
+ FontsLoadedContext.displayName = 'FontsLoadedContext';
16
+ /**
17
+ * FontBootstrap component. Handles preloading fonts.
18
+ */
19
+ export function FontBootstrap(_ref) {
20
+ var {
21
+ fontClassNames = ['fira-sans-regular', 'fira-sans-semibold', 'fira-mono'],
22
+ children
23
+ } = _ref;
24
+ var [isLoaded, setIsLoaded] = useState(false);
25
+ useEffect(function initFonts() {
26
+ document.fonts.ready.then(() => {
27
+ setIsLoaded(true);
28
+ });
29
+ }, []);
30
+ return /*#__PURE__*/_jsxs(_Fragment, {
31
+ children: [/*#__PURE__*/_jsx(FontsLoadedContext.Provider, {
32
+ value: isLoaded,
33
+ children: children
34
+ }), /*#__PURE__*/_jsx("div", {
35
+ id: "preload-fonts",
36
+ style: {
37
+ visibility: 'hidden',
38
+ position: 'absolute',
39
+ top: -10000
40
+ },
41
+ children: fontClassNames.map(className => /*#__PURE__*/_jsx("p", {
42
+ className: className,
43
+ children: "preload"
44
+ }, className))
45
+ })]
46
+ });
47
+ }
48
+ export default FontBootstrap;
49
+ //# sourceMappingURL=FontBootstrap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FontBootstrap.js","names":["React","createContext","useEffect","useState","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","FontsLoadedContext","displayName","FontBootstrap","_ref","fontClassNames","children","isLoaded","setIsLoaded","initFonts","document","fonts","ready","then","Provider","value","id","style","visibility","position","top","map","className"],"sources":["../../src/theme/FontBootstrap.tsx"],"sourcesContent":["import React, { createContext, useEffect, useState } from 'react';\nimport '@fontsource/fira-mono/400.css';\nimport '@fontsource/fira-mono/500.css';\nimport '@fontsource/fira-mono/700.css';\nimport '@fontsource/fira-sans/300.css';\nimport '@fontsource/fira-sans/300-italic.css';\nimport '@fontsource/fira-sans/400.css';\nimport '@fontsource/fira-sans/400-italic.css';\nimport '@fontsource/fira-sans/500.css';\nimport '@fontsource/fira-sans/600.css';\nimport '@fontsource/fira-sans/700.css';\nimport '@fontsource/fira-sans/700-italic.css';\n\nexport const FontsLoadedContext = createContext<boolean>(false);\nFontsLoadedContext.displayName = 'FontsLoadedContext';\n\nexport type FontBootstrapProps = {\n /**\n * Class names of the font elements to pre load\n */\n fontClassNames?: string[];\n\n /**\n * The children to render wrapped with the FontsLoadedContext.\n * Note that it renders the children even if the fonts aren't loaded yet.\n */\n children: React.ReactNode;\n};\n\n/**\n * FontBootstrap component. Handles preloading fonts.\n */\nexport function FontBootstrap({\n fontClassNames = ['fira-sans-regular', 'fira-sans-semibold', 'fira-mono'],\n children,\n}: FontBootstrapProps): JSX.Element {\n const [isLoaded, setIsLoaded] = useState(false);\n useEffect(function initFonts() {\n document.fonts.ready.then(() => {\n setIsLoaded(true);\n });\n }, []);\n\n return (\n <>\n <FontsLoadedContext.Provider value={isLoaded}>\n {children}\n </FontsLoadedContext.Provider>\n {/*\n Need to preload any monaco and Deephaven grid fonts.\n We hide text with all the fonts we need on the root app.jsx page\n Load the Fira Mono font so that Monaco calculates word wrapping properly.\n This element doesn't need to be visible, just load the font and stay hidden.\n https://github.com/microsoft/vscode/issues/88689\n Can be replaced with a rel=\"preload\" when firefox adds support\n https://developer.mozilla.org/en-US/docs/Web/HTML/Preloading_content\n */}\n <div\n id=\"preload-fonts\"\n style={{ visibility: 'hidden', position: 'absolute', top: -10000 }}\n >\n {/* trigger loading of fonts needed by monaco and iris grid */}\n {fontClassNames.map(className => (\n <p key={className} className={className}>\n preload\n </p>\n ))}\n </div>\n </>\n );\n}\n\nexport default FontBootstrap;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,aAAa,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AACjE,OAAO,+BAA+B;AACtC,OAAO,+BAA+B;AACtC,OAAO,+BAA+B;AACtC,OAAO,+BAA+B;AACtC,OAAO,sCAAsC;AAC7C,OAAO,+BAA+B;AACtC,OAAO,sCAAsC;AAC7C,OAAO,+BAA+B;AACtC,OAAO,+BAA+B;AACtC,OAAO,+BAA+B;AACtC,OAAO,sCAAsC;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAE9C,OAAO,IAAMC,kBAAkB,gBAAGT,aAAa,CAAU,KAAK,CAAC;AAC/DS,kBAAkB,CAACC,WAAW,GAAG,oBAAoB;AAerD;AACA;AACA;AACA,OAAO,SAASC,aAAaA,CAAAC,IAAA,EAGO;EAAA,IAHN;IAC5BC,cAAc,GAAG,CAAC,mBAAmB,EAAE,oBAAoB,EAAE,WAAW,CAAC;IACzEC;EACkB,CAAC,GAAAF,IAAA;EACnB,IAAM,CAACG,QAAQ,EAAEC,WAAW,CAAC,GAAGd,QAAQ,CAAC,KAAK,CAAC;EAC/CD,SAAS,CAAC,SAASgB,SAASA,CAAA,EAAG;IAC7BC,QAAQ,CAACC,KAAK,CAACC,KAAK,CAACC,IAAI,CAAC,MAAM;MAC9BL,WAAW,CAAC,IAAI,CAAC;IACnB,CAAC,CAAC;EACJ,CAAC,EAAE,EAAE,CAAC;EAEN,oBACER,KAAA,CAAAF,SAAA;IAAAQ,QAAA,gBACEV,IAAA,CAACK,kBAAkB,CAACa,QAAQ;MAACC,KAAK,EAAER,QAAS;MAAAD,QAAA,EAC1CA;IAAQ,CACkB,CAAC,eAU9BV,IAAA;MACEoB,EAAE,EAAC,eAAe;MAClBC,KAAK,EAAE;QAAEC,UAAU,EAAE,QAAQ;QAAEC,QAAQ,EAAE,UAAU;QAAEC,GAAG,EAAE,CAAC;MAAM,CAAE;MAAAd,QAAA,EAGlED,cAAc,CAACgB,GAAG,CAACC,SAAS,iBAC3B1B,IAAA;QAAmB0B,SAAS,EAAEA,SAAU;QAAAhB,QAAA,EAAC;MAEzC,GAFQgB,SAEL,CACJ;IAAC,CACC,CAAC;EAAA,CACN,CAAC;AAEP;AAEA,eAAenB,aAAa","ignoreList":[]}
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ export type FontsLoadedProps = {
3
+ /** Children to show when the fonts have completed loading */
4
+ children: React.ReactNode;
5
+ };
6
+ export declare function FontsLoaded({ children }: FontsLoadedProps): JSX.Element;
7
+ export default FontsLoaded;
8
+ //# sourceMappingURL=FontsLoaded.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FontsLoaded.d.ts","sourceRoot":"","sources":["../../src/theme/FontsLoaded.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAI1C,MAAM,MAAM,gBAAgB,GAAG;IAC7B,6DAA6D;IAC7D,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF,wBAAgB,WAAW,CAAC,EAAE,QAAQ,EAAE,EAAE,gBAAgB,GAAG,GAAG,CAAC,OAAO,CASvE;AAED,eAAe,WAAW,CAAC"}
@@ -0,0 +1,22 @@
1
+ import React, { useContext } from 'react';
2
+ import LoadingOverlay from "../LoadingOverlay.js";
3
+ import { FontsLoadedContext } from "./FontBootstrap.js";
4
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
5
+ export function FontsLoaded(_ref) {
6
+ var {
7
+ children
8
+ } = _ref;
9
+ var isFontsLoaded = useContext(FontsLoadedContext);
10
+ if (!isFontsLoaded) {
11
+ return /*#__PURE__*/_jsx(LoadingOverlay, {
12
+ "data-testid": "fonts-loaded-loading"
13
+ });
14
+ }
15
+
16
+ // eslint-disable-next-line react/jsx-no-useless-fragment
17
+ return /*#__PURE__*/_jsx(_Fragment, {
18
+ children: children
19
+ });
20
+ }
21
+ export default FontsLoaded;
22
+ //# sourceMappingURL=FontsLoaded.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FontsLoaded.js","names":["React","useContext","LoadingOverlay","FontsLoadedContext","jsx","_jsx","Fragment","_Fragment","FontsLoaded","_ref","children","isFontsLoaded"],"sources":["../../src/theme/FontsLoaded.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport LoadingOverlay from '../LoadingOverlay';\nimport { FontsLoadedContext } from './FontBootstrap';\n\nexport type FontsLoadedProps = {\n /** Children to show when the fonts have completed loading */\n children: React.ReactNode;\n};\n\nexport function FontsLoaded({ children }: FontsLoadedProps): JSX.Element {\n const isFontsLoaded = useContext(FontsLoadedContext);\n\n if (!isFontsLoaded) {\n return <LoadingOverlay data-testid=\"fonts-loaded-loading\" />;\n }\n\n // eslint-disable-next-line react/jsx-no-useless-fragment\n return <>{children}</>;\n}\n\nexport default FontsLoaded;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AAAC,OACnCC,cAAc;AAAA,SACZC,kBAAkB;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA;AAO3B,OAAO,SAASC,WAAWA,CAAAC,IAAA,EAA8C;EAAA,IAA7C;IAAEC;EAA2B,CAAC,GAAAD,IAAA;EACxD,IAAME,aAAa,GAAGV,UAAU,CAACE,kBAAkB,CAAC;EAEpD,IAAI,CAACQ,aAAa,EAAE;IAClB,oBAAON,IAAA,CAACH,cAAc;MAAC,eAAY;IAAsB,CAAE,CAAC;EAC9D;;EAEA;EACA,oBAAOG,IAAA,CAAAE,SAAA;IAAAG,QAAA,EAAGA;EAAQ,CAAG,CAAC;AACxB;AAEA,eAAeF,WAAW","ignoreList":[]}
@@ -9,4 +9,6 @@ export * from './Logo';
9
9
  export * from './colorUtils';
10
10
  export * from './useExternalTheme';
11
11
  export * from './useSpectrumThemeProvider';
12
+ export * from './FontsLoaded';
13
+ export * from './FontBootstrap';
12
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC"}
@@ -9,4 +9,6 @@ export * from "./Logo.js";
9
9
  export * from "./colorUtils.js";
10
10
  export * from "./useExternalTheme.js";
11
11
  export * from "./useSpectrumThemeProvider.js";
12
+ export * from "./FontsLoaded.js";
13
+ export * from "./FontBootstrap.js";
12
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/theme/index.ts"],"sourcesContent":["export * from './theme-dark';\nexport * from './theme-light';\nexport * from './ThemeModel';\nexport * from './ThemePicker';\nexport * from './ThemeProvider';\nexport * from './ThemeUtils';\nexport * from './useTheme';\nexport * from './Logo';\nexport * from './colorUtils';\nexport * from './useExternalTheme';\nexport * from './useSpectrumThemeProvider';\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/theme/index.ts"],"sourcesContent":["export * from './theme-dark';\nexport * from './theme-light';\nexport * from './ThemeModel';\nexport * from './ThemePicker';\nexport * from './ThemeProvider';\nexport * from './ThemeUtils';\nexport * from './useTheme';\nexport * from './Logo';\nexport * from './colorUtils';\nexport * from './useExternalTheme';\nexport * from './useSpectrumThemeProvider';\nexport * from './FontsLoaded';\nexport * from './FontBootstrap';\n"],"mappings":"","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deephaven/components",
3
- "version": "1.7.2-beta.5+28d63776",
3
+ "version": "1.7.2-beta.6+c0084cf6",
4
4
  "description": "Deephaven React component library",
5
5
  "author": "Deephaven Data Labs LLC",
6
6
  "license": "Apache-2.0",
@@ -25,10 +25,12 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "@adobe/react-spectrum": "3.38.0",
28
- "@deephaven/icons": "^1.7.2-beta.5+28d63776",
29
- "@deephaven/log": "^1.7.2-beta.5+28d63776",
30
- "@deephaven/react-hooks": "^1.7.2-beta.5+28d63776",
31
- "@deephaven/utils": "^1.7.2-beta.5+28d63776",
28
+ "@deephaven/icons": "^1.7.2-beta.6+c0084cf6",
29
+ "@deephaven/log": "^1.7.2-beta.6+c0084cf6",
30
+ "@deephaven/react-hooks": "^1.7.2-beta.6+c0084cf6",
31
+ "@deephaven/utils": "^1.7.2-beta.6+c0084cf6",
32
+ "@fontsource/fira-mono": "5.0.13",
33
+ "@fontsource/fira-sans": "5.0.20",
32
34
  "@fortawesome/fontawesome-svg-core": "^6.2.1",
33
35
  "@fortawesome/react-fontawesome": "^0.2.0",
34
36
  "@hello-pangea/dnd": "^18.0.1",
@@ -60,8 +62,8 @@
60
62
  "react-is": ">=16.8.0"
61
63
  },
62
64
  "devDependencies": {
63
- "@deephaven/mocks": "^1.7.2-beta.5+28d63776",
64
- "@deephaven/test-utils": "^1.7.2-beta.5+28d63776",
65
+ "@deephaven/mocks": "^1.7.2-beta.6+c0084cf6",
66
+ "@deephaven/test-utils": "^1.7.2-beta.6+c0084cf6",
65
67
  "react-redux": "^7.2.7"
66
68
  },
67
69
  "files": [
@@ -76,5 +78,5 @@
76
78
  "publishConfig": {
77
79
  "access": "public"
78
80
  },
79
- "gitHead": "28d637768ffe289c1f16e1fdbc3af037aa9790ba"
81
+ "gitHead": "c0084cf65bb4d6ba4af1db356b3e1c144aa7bc29"
80
82
  }
@@ -913,7 +913,7 @@ input[type='number']::-webkit-inner-spin-button {
913
913
  }
914
914
  }
915
915
 
916
- /** Preload some fonts for grid metric calculations, loaded in App.jsx */
916
+ /** Preload some fonts for grid metric calculations, loaded by FontBootstrap */
917
917
  /* stylelint-disable */
918
918
  .fira-sans-regular {
919
919
  font-family: 'Fira Sans';