@cubejs-client/playground 0.29.23 → 0.29.29

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,12 +1,15 @@
1
- export * from './deep-compare-memoize';
2
- export * from './security-context';
1
+ export * from './app-context';
3
2
  export * from './cubejs-api';
4
- export * from './live-preview-context';
5
- export * from './local-storage';
6
- export * from './identifier';
7
- export * from './is-mounted';
3
+ export * from './deep-compare-memoize';
4
+ export * from './deep-dependencies';
8
5
  export * from './deep-effect';
9
6
  export * from './deep-memo';
10
- export * from './toggle';
7
+ export * from './identifier';
8
+ export * from './is-mounted';
9
+ export * from './live-preview-context';
10
+ export * from './local-storage';
11
+ export * from './security-context';
11
12
  export * from './server-core-version';
12
- export * from './app-context';
13
+ export * from './setter';
14
+ export * from './toggle';
15
+ export * from './window-size';
@@ -0,0 +1,6 @@
1
+ declare type WindowSize = {
2
+ width?: number;
3
+ height?: number;
4
+ };
5
+ export declare function useWindowSize(): WindowSize;
6
+ export {};
@@ -1,5 +1,5 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
- import React, { createContext, useState, useContext, useRef, useMemo, useCallback, useEffect, Component, useLayoutEffect, lazy, Suspense, Fragment as Fragment$1, memo } from 'react';
2
+ import React, { createContext, useState, useContext, useCallback, useMemo, useRef, useEffect, Component, useLayoutEffect, lazy, Suspense, Fragment as Fragment$1, memo } from 'react';
3
3
  import equals from 'fast-deep-equal';
4
4
  import { BrowserRouter, Redirect, withRouter } from 'react-router-dom';
5
5
  import styled, { createGlobalStyle, ThemeProvider, css } from 'styled-components';
@@ -205,7 +205,10 @@ var VARIABLES = {
205
205
  'border-radius-base': '4px',
206
206
  'padding-lg': '16px',
207
207
  };
208
- Object.keys(colors).forEach(function (name) { return (VARIABLES["".concat(name, "-color")] = color$1(name)); });
208
+ Object.keys(colors).forEach(function (name) {
209
+ VARIABLES["".concat(name, "-color")] = color$1(name);
210
+ VARIABLES["".concat(name, "-color-rgb")] = colors[name];
211
+ });
209
212
  var LESS_VARIABLES = {};
210
213
  var CSS_PROPERTIES = {};
211
214
  Object.keys(VARIABLES).forEach(function (key) {
@@ -215,7 +218,7 @@ Object.keys(VARIABLES).forEach(function (key) {
215
218
  CSS_PROPERTIES["--".concat(key)] = VARIABLES[key];
216
219
  });
217
220
 
218
- var GlobalStyles = createGlobalStyle(templateObject_1$w || (templateObject_1$w = __makeTemplateObject(["\n body {\n ", "\n }\n\n body {\n margin: 0;\n padding: 0;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n background: var(--layout-body-background);\n overflow-x: hidden;\n }\n\n .inline-code {\n margin: 0 1px;\n padding: 0.2em 0.4em;\n font-size: 0.9em;\n background: #f2f4f5;\n border: 1px solid #eee;\n border-radius: 3px;\n }\n \n .ant-dropdown-menu::-webkit-scrollbar-track {\n background: var(--light-color);\n }\n \n .ant-dropdown-menu::-webkit-scrollbar-thumb {\n border-radius: 4px;\n background: var(--dark-03-color);\n }\n \n .ant-dropdown-menu::-webkit-scrollbar {\n width: 8px;\n height: 8px;\n } \n \n .schema-sidebar .ant-tabs-top-bar {\n padding: 0 16px;\n }\n \n .schema-sidebar .ant-menu {\n border: 0;\n }\n \n .ant-layout {\n height: 100%;\n background: var(--layout-body-background);\n }\n \n .ant-layout-header .ant-menu {\n height: 100%;\n }\n \n .ant-menu-horizontal .ant-menu-item {\n top: 0;\n height: 100%;\n }\n \n .ant-select-item.ant-select-item-option-selected:not(.ant-select-item-option-disabled) {\n color: white;\n }\n \n .ant-popover .ant-popover-inner-content {\n padding: 0;\n }\n \n \n code[class*=\"language-\"],\n pre[class*=\"language-\"] {\n color: var(--dark-01-color);\n background: none;\n /*text-shadow: 0 1px white;*/\n font-family: \"Roboto Mono\", Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;\n text-align: left;\n font-weight: normal;\n font-size: 14px;\n line-height: 20px;\n white-space: pre;\n word-spacing: normal;\n word-break: normal;\n word-wrap: normal;\n border-radius: 4px;\n border: none;\n \n -moz-tab-size: 4;\n -o-tab-size: 4;\n tab-size: 4;\n \n -webkit-hyphens: none;\n -moz-hyphens: none;\n -ms-hyphens: none;\n hyphens: none;\n }\n\n code {\n font-family: source-code-pro, Menlo, Monaco, Consolas, \"Courier New\",\n monospace;\n }\n\n .schema-sidebar,\n .schema-sidebar .ant-tabs,\n .schema-sidebar .ant-tabs-content {\n height: 100%;\n }\n\n .schema-sidebar {\n background: #fff;\n border-right: 1px solid #eee;\n padding: 0;\n }\n\n .schema-sidebar .ant-tabs-tabpane {\n /* TODO: replace with flexbox */\n height: 85%;\n overflow: auto;\n }\n\n .ant-popover-disabled-compatible-wrapper {\n pointer-events: none;\n }\n \n pre[class*=\"language-\"]::-moz-selection, pre[class*=\"language-\"] ::-moz-selection,\n code[class*=\"language-\"]::-moz-selection, code[class*=\"language-\"] ::-moz-selection {\n text-shadow: none;\n /*background: #b3d4fc;*/\n }\n \n pre[class*=\"language-\"]::selection, pre[class*=\"language-\"] ::selection,\n code[class*=\"language-\"]::selection, code[class*=\"language-\"] ::selection {\n text-shadow: none;\n /*background: #b3d4fc;*/\n }\n \n @media print {\n code[class*=\"language-\"],\n pre[class*=\"language-\"] {\n text-shadow: none;\n }\n }\n \n /* Code blocks */\n pre[class*=\"language-\"] {\n padding: 1em;\n overflow: auto;\n }\n \n :not(pre) > code[class*=\"language-\"],\n pre[class*=\"language-\"] {\n background: transparent;\n }\n \n /* Inline code */\n :not(pre) > code[class*=\"language-\"] {\n padding: .1em;\n border-radius: .3em;\n white-space: normal;\n }\n \n .token.comment,\n .token.prolog,\n .token.doctype,\n .token.cdata {\n color: var(--dark-04-color);\n }\n \n .token.punctuation {\n color: var(--dark-04-color);\n }\n \n .namespace {\n opacity: .7;\n }\n \n .token.property,\n .token.tag,\n .token.boolean,\n .token.number,\n .token.constant,\n .token.symbol,\n .token.deleted {\n color: var(--pink-color);\n }\n \n .token.selector,\n .token.attr-name,\n .token.string,\n .token.char,\n .token.builtin,\n .token.inserted {\n color: var(--purple-color);\n }\n \n .token.operator,\n .token.entity,\n .token.url,\n .language-css .token.string,\n .style .token.string {\n color: var(--dark-01-color);\n }\n \n .token.atrule,\n .token.attr-value,\n .token.keyword {\n color: var(--dark-01-color);\n }\n \n .token.atrule,\n .token.keyword {\n font-weight: 500;\n }\n \n .token.function,\n .token.class-name {\n color: var(--pink-color);\n }\n \n .token.regex,\n .token.important,\n .token.variable {\n color: var(--pink-color);\n }\n \n .token.important,\n .token.bold {\n font-weight: bold;\n }\n \n .token.italic {\n font-style: italic;\n }\n \n .token.entity {\n cursor: help;\n }\n \n .missing-member-tooltip {\n max-width: none;\n }\n \n .ant-btn-link > span {\n text-decoration: underline;\n }\n \n a.ant-typography {\n text-decoration: underline;\n }\n \n .ant-notification {\n z-index: 9999;\n }\n \n .ant-modal-header {\n padding: 16px 24px;\n }\n \n .ant-modal-body {\n padding: 24px;\n }\n"], ["\n body {\n ", "\n }\n\n body {\n margin: 0;\n padding: 0;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n background: var(--layout-body-background);\n overflow-x: hidden;\n }\n\n .inline-code {\n margin: 0 1px;\n padding: 0.2em 0.4em;\n font-size: 0.9em;\n background: #f2f4f5;\n border: 1px solid #eee;\n border-radius: 3px;\n }\n \n .ant-dropdown-menu::-webkit-scrollbar-track {\n background: var(--light-color);\n }\n \n .ant-dropdown-menu::-webkit-scrollbar-thumb {\n border-radius: 4px;\n background: var(--dark-03-color);\n }\n \n .ant-dropdown-menu::-webkit-scrollbar {\n width: 8px;\n height: 8px;\n } \n \n .schema-sidebar .ant-tabs-top-bar {\n padding: 0 16px;\n }\n \n .schema-sidebar .ant-menu {\n border: 0;\n }\n \n .ant-layout {\n height: 100%;\n background: var(--layout-body-background);\n }\n \n .ant-layout-header .ant-menu {\n height: 100%;\n }\n \n .ant-menu-horizontal .ant-menu-item {\n top: 0;\n height: 100%;\n }\n \n .ant-select-item.ant-select-item-option-selected:not(.ant-select-item-option-disabled) {\n color: white;\n }\n \n .ant-popover .ant-popover-inner-content {\n padding: 0;\n }\n \n \n code[class*=\"language-\"],\n pre[class*=\"language-\"] {\n color: var(--dark-01-color);\n background: none;\n /*text-shadow: 0 1px white;*/\n font-family: \"Roboto Mono\", Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;\n text-align: left;\n font-weight: normal;\n font-size: 14px;\n line-height: 20px;\n white-space: pre;\n word-spacing: normal;\n word-break: normal;\n word-wrap: normal;\n border-radius: 4px;\n border: none;\n \n -moz-tab-size: 4;\n -o-tab-size: 4;\n tab-size: 4;\n \n -webkit-hyphens: none;\n -moz-hyphens: none;\n -ms-hyphens: none;\n hyphens: none;\n }\n\n code {\n font-family: source-code-pro, Menlo, Monaco, Consolas, \"Courier New\",\n monospace;\n }\n\n .schema-sidebar,\n .schema-sidebar .ant-tabs,\n .schema-sidebar .ant-tabs-content {\n height: 100%;\n }\n\n .schema-sidebar {\n background: #fff;\n border-right: 1px solid #eee;\n padding: 0;\n }\n\n .schema-sidebar .ant-tabs-tabpane {\n /* TODO: replace with flexbox */\n height: 85%;\n overflow: auto;\n }\n\n .ant-popover-disabled-compatible-wrapper {\n pointer-events: none;\n }\n \n pre[class*=\"language-\"]::-moz-selection, pre[class*=\"language-\"] ::-moz-selection,\n code[class*=\"language-\"]::-moz-selection, code[class*=\"language-\"] ::-moz-selection {\n text-shadow: none;\n /*background: #b3d4fc;*/\n }\n \n pre[class*=\"language-\"]::selection, pre[class*=\"language-\"] ::selection,\n code[class*=\"language-\"]::selection, code[class*=\"language-\"] ::selection {\n text-shadow: none;\n /*background: #b3d4fc;*/\n }\n \n @media print {\n code[class*=\"language-\"],\n pre[class*=\"language-\"] {\n text-shadow: none;\n }\n }\n \n /* Code blocks */\n pre[class*=\"language-\"] {\n padding: 1em;\n overflow: auto;\n }\n \n :not(pre) > code[class*=\"language-\"],\n pre[class*=\"language-\"] {\n background: transparent;\n }\n \n /* Inline code */\n :not(pre) > code[class*=\"language-\"] {\n padding: .1em;\n border-radius: .3em;\n white-space: normal;\n }\n \n .token.comment,\n .token.prolog,\n .token.doctype,\n .token.cdata {\n color: var(--dark-04-color);\n }\n \n .token.punctuation {\n color: var(--dark-04-color);\n }\n \n .namespace {\n opacity: .7;\n }\n \n .token.property,\n .token.tag,\n .token.boolean,\n .token.number,\n .token.constant,\n .token.symbol,\n .token.deleted {\n color: var(--pink-color);\n }\n \n .token.selector,\n .token.attr-name,\n .token.string,\n .token.char,\n .token.builtin,\n .token.inserted {\n color: var(--purple-color);\n }\n \n .token.operator,\n .token.entity,\n .token.url,\n .language-css .token.string,\n .style .token.string {\n color: var(--dark-01-color);\n }\n \n .token.atrule,\n .token.attr-value,\n .token.keyword {\n color: var(--dark-01-color);\n }\n \n .token.atrule,\n .token.keyword {\n font-weight: 500;\n }\n \n .token.function,\n .token.class-name {\n color: var(--pink-color);\n }\n \n .token.regex,\n .token.important,\n .token.variable {\n color: var(--pink-color);\n }\n \n .token.important,\n .token.bold {\n font-weight: bold;\n }\n \n .token.italic {\n font-style: italic;\n }\n \n .token.entity {\n cursor: help;\n }\n \n .missing-member-tooltip {\n max-width: none;\n }\n \n .ant-btn-link > span {\n text-decoration: underline;\n }\n \n a.ant-typography {\n text-decoration: underline;\n }\n \n .ant-notification {\n z-index: 9999;\n }\n \n .ant-modal-header {\n padding: 16px 24px;\n }\n \n .ant-modal-body {\n padding: 24px;\n }\n"])), Object.entries(CSS_PROPERTIES)
221
+ var GlobalStyles = createGlobalStyle(templateObject_1$w || (templateObject_1$w = __makeTemplateObject(["\n body {\n ", "\n }\n\n body {\n margin: 0;\n padding: 0;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n background: var(--layout-body-background);\n overflow-x: hidden;\n }\n\n .inline-code {\n margin: 0 1px;\n padding: 0.2em 0.4em;\n font-size: 0.9em;\n background: #f2f4f5;\n border: 1px solid #eee;\n border-radius: 3px;\n }\n \n .ant-dropdown-menu::-webkit-scrollbar-track {\n background: var(--light-color);\n }\n \n .ant-dropdown-menu::-webkit-scrollbar-thumb {\n border-radius: 4px;\n background: var(--dark-03-color);\n }\n \n .ant-dropdown-menu::-webkit-scrollbar {\n width: 8px;\n height: 8px;\n } \n \n .schema-sidebar .ant-tabs-top-bar {\n padding: 0 16px;\n }\n \n .schema-sidebar .ant-menu {\n border: 0;\n }\n \n .ant-layout {\n height: 100%;\n background: var(--layout-body-background);\n }\n \n .ant-layout-header .ant-menu {\n height: 100%;\n }\n \n .ant-menu-horizontal .ant-menu-item {\n top: 0;\n height: 100%;\n }\n \n .ant-select-item.ant-select-item-option-selected:not(.ant-select-item-option-disabled) {\n color: white;\n }\n \n .ant-popover .ant-popover-inner-content {\n padding: 0;\n }\n \n \n code[class*=\"language-\"],\n pre[class*=\"language-\"] {\n color: var(--dark-01-color);\n background: none;\n /*text-shadow: 0 1px white;*/\n font-family: \"Roboto Mono\", Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;\n text-align: left;\n font-weight: normal;\n font-size: 14px;\n line-height: 20px;\n white-space: pre;\n word-spacing: normal;\n word-break: normal;\n word-wrap: normal;\n border-radius: 4px;\n border: none;\n \n -moz-tab-size: 4;\n -o-tab-size: 4;\n tab-size: 4;\n \n -webkit-hyphens: none;\n -moz-hyphens: none;\n -ms-hyphens: none;\n hyphens: none;\n }\n\n code {\n font-family: source-code-pro, Menlo, Monaco, Consolas, \"Courier New\",\n monospace;\n }\n\n .schema-sidebar,\n .schema-sidebar .ant-tabs,\n .schema-sidebar .ant-tabs-content {\n height: 100%;\n }\n\n .schema-sidebar {\n background: #fff;\n border-right: 1px solid #eee;\n padding: 0;\n }\n\n .schema-sidebar .ant-tabs-tabpane {\n /* TODO: replace with flexbox */\n height: 85%;\n overflow: auto;\n }\n\n .ant-popover-disabled-compatible-wrapper {\n pointer-events: none;\n }\n \n pre[class*=\"language-\"]::-moz-selection, pre[class*=\"language-\"] ::-moz-selection,\n code[class*=\"language-\"]::-moz-selection, code[class*=\"language-\"] ::-moz-selection {\n text-shadow: none;\n /*background: #b3d4fc;*/\n }\n \n pre[class*=\"language-\"]::selection, pre[class*=\"language-\"] ::selection,\n code[class*=\"language-\"]::selection, code[class*=\"language-\"] ::selection {\n text-shadow: none;\n /*background: #b3d4fc;*/\n }\n \n @media print {\n code[class*=\"language-\"],\n pre[class*=\"language-\"] {\n text-shadow: none;\n }\n }\n \n /* Code blocks */\n pre[class*=\"language-\"] {\n padding: 1em;\n overflow: auto;\n }\n \n :not(pre) > code[class*=\"language-\"],\n pre[class*=\"language-\"] {\n background: transparent;\n }\n \n /* Inline code */\n :not(pre) > code[class*=\"language-\"] {\n padding: .1em;\n border-radius: .3em;\n white-space: normal;\n }\n \n .token.comment,\n .token.prolog,\n .token.doctype,\n .token.cdata {\n color: var(--dark-04-color);\n }\n \n .token.punctuation {\n color: var(--dark-04-color);\n }\n \n .namespace {\n opacity: .7;\n }\n \n .token.property,\n .token.tag,\n .token.boolean,\n .token.number,\n .token.constant,\n .token.symbol,\n .token.deleted {\n color: var(--pink-color);\n }\n \n .token.selector,\n .token.attr-name,\n .token.string,\n .token.char,\n .token.builtin,\n .token.inserted {\n color: var(--purple-color);\n }\n \n .token.operator,\n .token.entity,\n .token.url,\n .language-css .token.string,\n .style .token.string {\n color: var(--dark-01-color);\n }\n \n .token.atrule,\n .token.attr-value,\n .token.keyword {\n color: var(--dark-01-color);\n }\n \n .token.atrule,\n .token.keyword {\n font-weight: 500;\n }\n \n .token.function,\n .token.class-name {\n color: var(--pink-color);\n }\n \n .token.regex,\n .token.important,\n .token.variable {\n color: var(--pink-color);\n }\n \n .token.important,\n .token.bold {\n font-weight: bold;\n }\n \n .token.italic {\n font-style: italic;\n }\n \n .token.entity {\n cursor: help;\n }\n \n .missing-member-tooltip {\n max-width: none;\n }\n \n .ant-btn-link > span {\n text-decoration: underline;\n }\n \n a.ant-typography {\n text-decoration: underline;\n }\n \n .ant-notification {\n z-index: 9999;\n }\n \n .ant-modal-header {\n padding: 16px 24px;\n }\n \n .ant-modal-body {\n padding: 24px;\n }\n\n // Fix close tab button styles\n .ant-tabs-dropdown {\n & .ant-tabs-dropdown-menu-item {\n display: flex;\n place-content: center space-between;\n }\n \n & button.ant-tabs-dropdown-menu-item-remove {\n -webkit-appearance: none;\n padding: 0;\n border: none;\n border-radius: var(--border-radius-base);\n background: transparent;\n color: var(--dark-color);\n cursor: pointer;\n transition: color .125s linear;\n }\n \n & button.ant-tabs-dropdown-menu-item-remove:hover {\n color: var(--purple-color);\n }\n }\n"], ["\n body {\n ", "\n }\n\n body {\n margin: 0;\n padding: 0;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n background: var(--layout-body-background);\n overflow-x: hidden;\n }\n\n .inline-code {\n margin: 0 1px;\n padding: 0.2em 0.4em;\n font-size: 0.9em;\n background: #f2f4f5;\n border: 1px solid #eee;\n border-radius: 3px;\n }\n \n .ant-dropdown-menu::-webkit-scrollbar-track {\n background: var(--light-color);\n }\n \n .ant-dropdown-menu::-webkit-scrollbar-thumb {\n border-radius: 4px;\n background: var(--dark-03-color);\n }\n \n .ant-dropdown-menu::-webkit-scrollbar {\n width: 8px;\n height: 8px;\n } \n \n .schema-sidebar .ant-tabs-top-bar {\n padding: 0 16px;\n }\n \n .schema-sidebar .ant-menu {\n border: 0;\n }\n \n .ant-layout {\n height: 100%;\n background: var(--layout-body-background);\n }\n \n .ant-layout-header .ant-menu {\n height: 100%;\n }\n \n .ant-menu-horizontal .ant-menu-item {\n top: 0;\n height: 100%;\n }\n \n .ant-select-item.ant-select-item-option-selected:not(.ant-select-item-option-disabled) {\n color: white;\n }\n \n .ant-popover .ant-popover-inner-content {\n padding: 0;\n }\n \n \n code[class*=\"language-\"],\n pre[class*=\"language-\"] {\n color: var(--dark-01-color);\n background: none;\n /*text-shadow: 0 1px white;*/\n font-family: \"Roboto Mono\", Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;\n text-align: left;\n font-weight: normal;\n font-size: 14px;\n line-height: 20px;\n white-space: pre;\n word-spacing: normal;\n word-break: normal;\n word-wrap: normal;\n border-radius: 4px;\n border: none;\n \n -moz-tab-size: 4;\n -o-tab-size: 4;\n tab-size: 4;\n \n -webkit-hyphens: none;\n -moz-hyphens: none;\n -ms-hyphens: none;\n hyphens: none;\n }\n\n code {\n font-family: source-code-pro, Menlo, Monaco, Consolas, \"Courier New\",\n monospace;\n }\n\n .schema-sidebar,\n .schema-sidebar .ant-tabs,\n .schema-sidebar .ant-tabs-content {\n height: 100%;\n }\n\n .schema-sidebar {\n background: #fff;\n border-right: 1px solid #eee;\n padding: 0;\n }\n\n .schema-sidebar .ant-tabs-tabpane {\n /* TODO: replace with flexbox */\n height: 85%;\n overflow: auto;\n }\n\n .ant-popover-disabled-compatible-wrapper {\n pointer-events: none;\n }\n \n pre[class*=\"language-\"]::-moz-selection, pre[class*=\"language-\"] ::-moz-selection,\n code[class*=\"language-\"]::-moz-selection, code[class*=\"language-\"] ::-moz-selection {\n text-shadow: none;\n /*background: #b3d4fc;*/\n }\n \n pre[class*=\"language-\"]::selection, pre[class*=\"language-\"] ::selection,\n code[class*=\"language-\"]::selection, code[class*=\"language-\"] ::selection {\n text-shadow: none;\n /*background: #b3d4fc;*/\n }\n \n @media print {\n code[class*=\"language-\"],\n pre[class*=\"language-\"] {\n text-shadow: none;\n }\n }\n \n /* Code blocks */\n pre[class*=\"language-\"] {\n padding: 1em;\n overflow: auto;\n }\n \n :not(pre) > code[class*=\"language-\"],\n pre[class*=\"language-\"] {\n background: transparent;\n }\n \n /* Inline code */\n :not(pre) > code[class*=\"language-\"] {\n padding: .1em;\n border-radius: .3em;\n white-space: normal;\n }\n \n .token.comment,\n .token.prolog,\n .token.doctype,\n .token.cdata {\n color: var(--dark-04-color);\n }\n \n .token.punctuation {\n color: var(--dark-04-color);\n }\n \n .namespace {\n opacity: .7;\n }\n \n .token.property,\n .token.tag,\n .token.boolean,\n .token.number,\n .token.constant,\n .token.symbol,\n .token.deleted {\n color: var(--pink-color);\n }\n \n .token.selector,\n .token.attr-name,\n .token.string,\n .token.char,\n .token.builtin,\n .token.inserted {\n color: var(--purple-color);\n }\n \n .token.operator,\n .token.entity,\n .token.url,\n .language-css .token.string,\n .style .token.string {\n color: var(--dark-01-color);\n }\n \n .token.atrule,\n .token.attr-value,\n .token.keyword {\n color: var(--dark-01-color);\n }\n \n .token.atrule,\n .token.keyword {\n font-weight: 500;\n }\n \n .token.function,\n .token.class-name {\n color: var(--pink-color);\n }\n \n .token.regex,\n .token.important,\n .token.variable {\n color: var(--pink-color);\n }\n \n .token.important,\n .token.bold {\n font-weight: bold;\n }\n \n .token.italic {\n font-style: italic;\n }\n \n .token.entity {\n cursor: help;\n }\n \n .missing-member-tooltip {\n max-width: none;\n }\n \n .ant-btn-link > span {\n text-decoration: underline;\n }\n \n a.ant-typography {\n text-decoration: underline;\n }\n \n .ant-notification {\n z-index: 9999;\n }\n \n .ant-modal-header {\n padding: 16px 24px;\n }\n \n .ant-modal-body {\n padding: 24px;\n }\n\n // Fix close tab button styles\n .ant-tabs-dropdown {\n & .ant-tabs-dropdown-menu-item {\n display: flex;\n place-content: center space-between;\n }\n \n & button.ant-tabs-dropdown-menu-item-remove {\n -webkit-appearance: none;\n padding: 0;\n border: none;\n border-radius: var(--border-radius-base);\n background: transparent;\n color: var(--dark-color);\n cursor: pointer;\n transition: color .125s linear;\n }\n \n & button.ant-tabs-dropdown-menu-item-remove:hover {\n color: var(--purple-color);\n }\n }\n"])), Object.entries(CSS_PROPERTIES)
219
222
  .map(function (_a) {
220
223
  var key = _a[0], value = _a[1];
221
224
  return "".concat(key, ": ").concat(value, ";");
@@ -223,16 +226,30 @@ var GlobalStyles = createGlobalStyle(templateObject_1$w || (templateObject_1$w =
223
226
  .join('\n '));
224
227
  var templateObject_1$w;
225
228
 
226
- function useDeepCompareMemoize(value) {
227
- var ref = useRef([]);
228
- if (!equals(value, ref.current)) {
229
- ref.current = value;
230
- }
231
- return ref.current;
229
+ var AppContext = createContext({});
230
+ function AppContextProvider(_a) {
231
+ var children = _a.children, contextProps = __rest(_a, ["children"]);
232
+ var _b = useState(contextProps || null), context = _b[0], setContextState = _b[1];
233
+ var setContext = useCallback(function (context) {
234
+ setContextState(function (currentContext) { return (__assign(__assign(__assign({}, currentContext), context), { playgroundContext: __assign(__assign({}, currentContext === null || currentContext === void 0 ? void 0 : currentContext.playgroundContext), context === null || context === void 0 ? void 0 : context.playgroundContext) })); });
235
+ }, []);
236
+ return (jsx(AppContext.Provider, __assign({ value: __assign(__assign({ apiUrl: null, schemaVersion: 0, ready: false }, context), { token: (context === null || context === void 0 ? void 0 : context.token) || null, playgroundContext: (context === null || context === void 0 ? void 0 : context.playgroundContext) || {}, setContext: setContext }) }, { children: children }), void 0));
232
237
  }
233
238
 
234
- function useSecurityContext() {
235
- return useContext(SecurityContextContext);
239
+ function useAppContext() {
240
+ return useContext(AppContext);
241
+ }
242
+ function usePlaygroundContext() {
243
+ var playgroundContext = useAppContext().playgroundContext;
244
+ return playgroundContext;
245
+ }
246
+ function useIsCloud() {
247
+ var playgroundContext = useAppContext().playgroundContext;
248
+ return (playgroundContext === null || playgroundContext === void 0 ? void 0 : playgroundContext.isCloud) || false;
249
+ }
250
+ function useToken() {
251
+ var token = useAppContext().token;
252
+ return token;
236
253
  }
237
254
 
238
255
  function useCubejsApi(apiUrl, token) {
@@ -246,6 +263,48 @@ function useCubejsApi(apiUrl, token) {
246
263
  }, [apiUrl, token]);
247
264
  }
248
265
 
266
+ function useDeepCompareMemoize(value) {
267
+ var ref = useRef([]);
268
+ if (!equals(value, ref.current)) {
269
+ ref.current = value;
270
+ }
271
+ return ref.current;
272
+ }
273
+
274
+ function useDeepDependencies(dependencies) {
275
+ var memo = useRef();
276
+ if (!equals(memo.current, dependencies)) {
277
+ memo.current = dependencies;
278
+ }
279
+ return memo.current;
280
+ }
281
+
282
+ function useDeepEffect(callback, dependencies) {
283
+ var memoizedDependencies = useDeepDependencies(dependencies);
284
+ return useEffect(callback, memoizedDependencies);
285
+ }
286
+
287
+ function useDeepMemo(callback, dependencies) {
288
+ var memoizedDependencies = useDeepDependencies(dependencies);
289
+ return useMemo(callback, memoizedDependencies);
290
+ }
291
+
292
+ function useIdentifier() {
293
+ var identifier = useAppContext().identifier;
294
+ return identifier || '';
295
+ }
296
+
297
+ function useIsMounted() {
298
+ var isMountedRef = useRef(true);
299
+ var isMounted = useCallback(function () { return isMountedRef.current; }, []);
300
+ useEffect(function () {
301
+ return function () {
302
+ isMountedRef.current = false;
303
+ };
304
+ }, []);
305
+ return isMounted;
306
+ }
307
+
249
308
  function getNameMemberPairs(members) {
250
309
  var items = [];
251
310
  members.forEach(function (cube) {
@@ -312,37 +371,6 @@ function useLivePreviewContext() {
312
371
  return useContext(LivePreviewContextContext);
313
372
  }
314
373
 
315
- var AppContext = createContext({});
316
- function AppContextProvider(_a) {
317
- var children = _a.children, contextProps = __rest(_a, ["children"]);
318
- var _b = useState(contextProps || null), context = _b[0], setContextState = _b[1];
319
- var setContext = useCallback(function (context) {
320
- setContextState(function (currentContext) { return (__assign(__assign(__assign({}, currentContext), context), { playgroundContext: __assign(__assign({}, currentContext === null || currentContext === void 0 ? void 0 : currentContext.playgroundContext), context === null || context === void 0 ? void 0 : context.playgroundContext) })); });
321
- }, []);
322
- return (jsx(AppContext.Provider, __assign({ value: __assign(__assign({ apiUrl: null, schemaVersion: 0, ready: false }, context), { token: (context === null || context === void 0 ? void 0 : context.token) || null, playgroundContext: (context === null || context === void 0 ? void 0 : context.playgroundContext) || {}, setContext: setContext }) }, { children: children }), void 0));
323
- }
324
-
325
- function useAppContext() {
326
- return useContext(AppContext);
327
- }
328
- function usePlaygroundContext() {
329
- var playgroundContext = useAppContext().playgroundContext;
330
- return playgroundContext;
331
- }
332
- function useIsCloud() {
333
- var playgroundContext = useAppContext().playgroundContext;
334
- return (playgroundContext === null || playgroundContext === void 0 ? void 0 : playgroundContext.isCloud) || false;
335
- }
336
- function useToken() {
337
- var token = useAppContext().token;
338
- return token;
339
- }
340
-
341
- function useIdentifier() {
342
- var identifier = useAppContext().identifier;
343
- return identifier || '';
344
- }
345
-
346
374
  var storage = new (/** @class */ (function () {
347
375
  function Storage() {
348
376
  var _this = this;
@@ -426,39 +454,8 @@ function useLocalStorage(itemKey, defaultValue) {
426
454
  }, [key, value]);
427
455
  }
428
456
 
429
- function useIsMounted() {
430
- var isMountedRef = useRef(true);
431
- var isMounted = useCallback(function () { return isMountedRef.current; }, []);
432
- useEffect(function () {
433
- return function () {
434
- isMountedRef.current = false;
435
- };
436
- }, []);
437
- return isMounted;
438
- }
439
-
440
- function useDeepDependencies(dependencies) {
441
- var memo = useRef();
442
- if (!equals(memo.current, dependencies)) {
443
- memo.current = dependencies;
444
- }
445
- return memo.current;
446
- }
447
-
448
- function useDeepEffect(callback, dependencies) {
449
- var memoizedDependencies = useDeepDependencies(dependencies);
450
- return useEffect(callback, memoizedDependencies);
451
- }
452
-
453
- function useDeepMemo(callback, dependencies) {
454
- var memoizedDependencies = useDeepDependencies(dependencies);
455
- return useMemo(callback, memoizedDependencies);
456
- }
457
-
458
- function useToggle(defaultValue) {
459
- if (defaultValue === void 0) { defaultValue = false; }
460
- var _a = useState(defaultValue), isOn = _a[0], toggle = _a[1];
461
- return [isOn, function () { return toggle(function (value) { return !value; }); }];
457
+ function useSecurityContext() {
458
+ return useContext(SecurityContextContext);
462
459
  }
463
460
 
464
461
  function useServerCoreVersionGte(version) {
@@ -477,6 +474,48 @@ function useServerCoreVersionGte(version) {
477
474
  return gt;
478
475
  }
479
476
 
477
+ function useSetter(setter, initialValue) {
478
+ var _a = useState(setter(initialValue)), state = _a[0], setValue = _a[1];
479
+ return [
480
+ state,
481
+ function (value) {
482
+ setValue(setter(state, value));
483
+ },
484
+ ];
485
+ }
486
+
487
+ function useToggle(defaultValue) {
488
+ if (defaultValue === void 0) { defaultValue = false; }
489
+ var _a = useState(defaultValue), isOn = _a[0], toggle = _a[1];
490
+ return [isOn, function () { return toggle(function (value) { return !value; }); }];
491
+ }
492
+
493
+ function useWindowSize() {
494
+ // Initialize state with undefined width/height so server and client renders match
495
+ // Learn more here: https://joshwcomeau.com/react/the-perils-of-rehydration/
496
+ var _a = useState({
497
+ width: undefined,
498
+ height: undefined,
499
+ }), windowSize = _a[0], setWindowSize = _a[1];
500
+ useEffect(function () {
501
+ // Handler to call on window resize
502
+ function handleResize() {
503
+ // Set window width/height to state
504
+ setWindowSize({
505
+ width: window.innerWidth,
506
+ height: window.innerHeight,
507
+ });
508
+ }
509
+ // Add event listener
510
+ window.addEventListener('resize', handleResize);
511
+ // Call handler right away so state gets updated with initial window size
512
+ handleResize();
513
+ // Remove event listener on cleanup
514
+ return function () { return window.removeEventListener('resize', handleResize); };
515
+ }, []); // Empty array ensures that effect is only run on mount
516
+ return windowSize;
517
+ }
518
+
480
519
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
481
520
 
482
521
  var pretty = function(jsObject, indentLength, outputTo, fullFunction) {
@@ -6300,7 +6339,7 @@ var GraphQLIcon = function () {
6300
6339
  return (jsx(Icon, { component: function () { return (jsx("svg", __assign({ version: "1.1", height: "1em", width: "1em", x: "0px", y: "0px", viewBox: "0 0 400 400", "enable-background": "new 0 0 400 400", fill: "currentColor" }, { children: jsxs("g", { children: [jsx("rect", { x: "122", y: "-0.4", transform: "matrix(-0.866 -0.5 0.5 -0.866 163.3196 363.3136)", width: "16.6", height: "320.3" }, void 0), jsx("rect", { x: "39.8", y: "272.2", width: "320.3", height: "16.6" }, void 0), jsx("rect", { x: "37.9", y: "312.2", transform: "matrix(-0.866 -0.5 0.5 -0.866 83.0693 663.3409)", width: "185", height: "16.6" }, void 0), jsx("rect", { x: "177.1", y: "71.1", transform: "matrix(-0.866 -0.5 0.5 -0.866 463.3409 283.0693)", width: "185", height: "16.6" }, void 0), jsx("rect", { x: "122.1", y: "-13", transform: "matrix(-0.5 -0.866 0.866 -0.5 126.7903 232.1221)", width: "16.6", height: "185" }, void 0), jsx("rect", { x: "109.6", y: "151.6", transform: "matrix(-0.5 -0.866 0.866 -0.5 266.0828 473.3766)", width: "320.3", height: "16.6" }, void 0), jsx("rect", { x: "52.5", y: "107.5", width: "16.6", height: "185" }, void 0), jsx("rect", { x: "330.9", y: "107.5", width: "16.6", height: "185" }, void 0), jsx("rect", { x: "262.4", y: "240.1", transform: "matrix(-0.5 -0.866 0.866 -0.5 126.7953 714.2875)", width: "14.5", height: "160.9" }, void 0), jsx("path", { d: "M369.5,297.9c-9.6,16.7-31,22.4-47.7,12.8c-16.7-9.6-22.4-31-12.8-47.7c9.6-16.7,31-22.4,47.7-12.8 C373.5,259.9,379.2,281.2,369.5,297.9" }, void 0), jsx("path", { d: "M90.9,137c-9.6,16.7-31,22.4-47.7,12.8c-16.7-9.6-22.4-31-12.8-47.7c9.6-16.7,31-22.4,47.7-12.8 C94.8,99,100.5,120.3,90.9,137" }, void 0), jsx("path", { d: "M30.5,297.9c-9.6-16.7-3.9-38,12.8-47.7c16.7-9.6,38-3.9,47.7,12.8c9.6,16.7,3.9,38-12.8,47.7 C61.4,320.3,40.1,314.6,30.5,297.9" }, void 0), jsx("path", { d: "M309.1,137c-9.6-16.7-3.9-38,12.8-47.7c16.7-9.6,38-3.9,47.7,12.8c9.6,16.7,3.9,38-12.8,47.7 C340.1,159.4,318.7,153.7,309.1,137" }, void 0), jsx("path", { d: "M200,395.8c-19.3,0-34.9-15.6-34.9-34.9c0-19.3,15.6-34.9,34.9-34.9c19.3,0,34.9,15.6,34.9,34.9 C234.9,380.1,219.3,395.8,200,395.8" }, void 0), jsx("path", { d: "M200,74c-19.3,0-34.9-15.6-34.9-34.9c0-19.3,15.6-34.9,34.9-34.9c19.3,0,34.9,15.6,34.9,34.9 C234.9,58.4,219.3,74,200,74" }, void 0)] }, void 0) }), void 0)); } }, void 0));
6301
6340
  };
6302
6341
 
6303
- var GraphiQLSandbox = lazy(function () { return import('./GraphiQLSandbox-8b3b8bbf.js'); });
6342
+ var GraphiQLSandbox = lazy(function () { return import('./GraphiQLSandbox-caafdd5e.js'); });
6304
6343
  var frameworkToTemplate = {
6305
6344
  react: 'create-react-app',
6306
6345
  angular: 'angular-cli',
@@ -6605,8 +6644,17 @@ var Wrapper$1 = styled.div(templateObject_5 || (templateObject_5 = __makeTemplat
6605
6644
  function ChartRenderer(_a) {
6606
6645
  var queryId = _a.queryId, areQueriesEqual = _a.areQueriesEqual, isFetchingMeta = _a.isFetchingMeta, iframeRef = _a.iframeRef, framework = _a.framework, queryHasMissingMembers = _a.queryHasMissingMembers, onRunButtonClick = _a.onRunButtonClick;
6607
6646
  var cubejsApi = useContext(CubeContext).cubejsApi;
6608
- var _b = useChartRendererState(queryId), isChartRendererReady = _b.isChartRendererReady, isQueryLoading = _b.isQueryLoading, resultSetExists = _b.resultSetExists, queryError = _b.queryError, isBuildInProgress = _b.isBuildInProgress, slowQuery = _b.slowQuery, slowQueryFromCache = _b.slowQueryFromCache;
6609
- var _c = useChartRendererStateMethods(), setResultSetExists = _c.setResultSetExists, setChartRendererReady = _c.setChartRendererReady, setQueryError = _c.setQueryError;
6647
+ var _b = useState('auto'), containerSize = _b[0], setContainerSize = _b[1];
6648
+ useWindowSize(); // triggers the following useEffect() on window size change
6649
+ useEffect(function () {
6650
+ if (iframeRef === null || iframeRef === void 0 ? void 0 : iframeRef.current) {
6651
+ var container = iframeRef === null || iframeRef === void 0 ? void 0 : iframeRef.current;
6652
+ var height = window.innerHeight - container.getBoundingClientRect().y - 40;
6653
+ setContainerSize("".concat(height, "px"));
6654
+ }
6655
+ }); // no deps, it's better to re-check position on every render
6656
+ var _c = useChartRendererState(queryId), isChartRendererReady = _c.isChartRendererReady, isQueryLoading = _c.isQueryLoading, resultSetExists = _c.resultSetExists, queryError = _c.queryError, isBuildInProgress = _c.isBuildInProgress, slowQuery = _c.slowQuery, slowQueryFromCache = _c.slowQueryFromCache;
6657
+ var _d = useChartRendererStateMethods(), setResultSetExists = _d.setResultSetExists, setChartRendererReady = _d.setChartRendererReady, setQueryError = _d.setQueryError;
6610
6658
  var runButtonRef = useRef(null);
6611
6659
  // for you, ovr :)
6612
6660
  useHotkeys('cmd+enter', function () {
@@ -6655,7 +6703,7 @@ function ChartRenderer(_a) {
6655
6703
  : slowQueryFromCache
6656
6704
  ? "This query takes more than 5 seconds to execute. It was served from the cache because Cube.js wasn't able to renew it in less than 5 seconds. Please consider using pre-aggregations to improve its performance. "
6657
6705
  : '';
6658
- return (jsxs(Fragment, { children: [(slowQuery || slowQueryFromCache) && (jsx(Alert$1, { style: { marginBottom: 24 }, message: slowQueryMsg, type: "warning" }, void 0)), renderExtras(), jsx(ChartContainer, __assign({ invisible: invisible }, { children: cubejsApi ? (jsx("iframe", { id: "iframe-".concat(queryId), "data-testid": "chart-renderer", ref: iframeRef, title: "Chart renderer", src: "/chart-renderers/".concat(framework, "/index.html#queryId=").concat(queryId) }, void 0)) : null }), void 0)] }, void 0));
6706
+ return (jsxs(Fragment, { children: [(slowQuery || slowQueryFromCache) && (jsx(Alert$1, { style: { marginBottom: 24 }, message: slowQueryMsg, type: "warning" }, void 0)), renderExtras(), jsx(ChartContainer, __assign({ invisible: invisible }, { children: cubejsApi ? (jsx("iframe", { id: "iframe-".concat(queryId), "data-testid": "chart-renderer", ref: iframeRef, style: { height: containerSize }, title: "Chart renderer", src: "/chart-renderers/".concat(framework, "/index.html#queryId=").concat(queryId) }, void 0)) : null }), void 0)] }, void 0));
6659
6707
  }
6660
6708
  var templateObject_1$6, templateObject_2$2, templateObject_3, templateObject_4, templateObject_5;
6661
6709
 
@@ -6889,7 +6937,7 @@ var FilterGroup = function (_a) {
6889
6937
  }, onClick: function (updateWith) {
6890
6938
  return updateMethods.update(m, __assign(__assign({}, m), { dimension: updateWith }));
6891
6939
  } }, { children: m.dimension.title }), void 0) }), void 0));
6892
- return (jsxs(Fragment$1, { children: [isMissing ? (jsx(MissingMemberTooltip, { children: buttonGroup }, void 0)) : (buttonGroup), jsx(StyledSelect, __assign({ disabled: disabled, value: m.operator, style: { width: 200 }, onChange: function (operator) { return updateMethods.update(m, __assign(__assign({}, m), { operator: operator })); } }, { children: m.operators.map(function (operator) { return (jsx(StyledSelect.Option, __assign({ value: operator.name }, { children: operator.title }), operator.name)); }) }), void 0), jsx(FilterInput, { disabled: disabled, member: m, updateMethods: updateMethods }, "filterInput")] }, m.index));
6940
+ return (jsxs(Fragment$1, { children: [isMissing ? (jsx(MissingMemberTooltip, { children: buttonGroup }, void 0)) : (buttonGroup), jsx(StyledSelect, __assign({ disabled: disabled, value: m.operator, style: { width: 200 }, onChange: function (operator) { return updateMethods.update(m, __assign(__assign({}, m), { operator: operator })); } }, { children: m.operators.map(function (operator) { return (jsx(StyledSelect.Option, __assign({ value: operator.name }, { children: operator.title }), operator.name)); }) }), void 0), jsx(FilterInput, { disabled: disabled, member: m, updateMethods: updateMethods }, "filterInput")] }, m.member));
6893
6941
  }), jsx(MemberMenu, __assign({ availableCubes: availableMembers, type: "dashed", disabled: disabled, icon: jsx(PlusOutlined, {}, void 0), onClick: function (m) { return updateMethods.add({ member: m }); } }, { children: !members.length ? addMemberName : null }), void 0)] }, void 0));
6894
6942
  };
6895
6943
 
@@ -7263,5 +7311,5 @@ var QueryBuilder = memo(QueryBuilderComponent, function (prevProps, nextProps) {
7263
7311
  return equals(prevProps, nextProps);
7264
7312
  });
7265
7313
 
7266
- export { CloudProvider as C, QueryBuilder as Q, RollupDesignerContext as R, __assign as _, unCapitalize as a, __spreadArray as b, useSecurityContext as c, useToken as d, useDeepMemo as e, __makeTemplateObject as f, fetchPoll as g, setTelemetry as h, useCloud as i, Context as j, useRollupDesignerContext as k, useDeepCompareMemoize as l, metaToTypes as m, useCubejsApi as n, useLivePreviewContext as o, useLocalStorage as p, useIdentifier as q, useIsMounted as r, setTracker as s, useDeepEffect as t, uniqArray as u, useToggle as v, useServerCoreVersionGte as w, useAppContext as x, usePlaygroundContext as y, useIsCloud as z };
7267
- //# sourceMappingURL=index-fd53d684.js.map
7314
+ export { useSetter as A, useToggle as B, CloudProvider as C, useWindowSize as D, QueryBuilder as Q, RollupDesignerContext as R, __assign as _, unCapitalize as a, __spreadArray as b, useSecurityContext as c, useToken as d, useDeepMemo as e, __makeTemplateObject as f, fetchPoll as g, setTelemetry as h, useCloud as i, Context as j, useRollupDesignerContext as k, useAppContext as l, metaToTypes as m, usePlaygroundContext as n, useIsCloud as o, useCubejsApi as p, useDeepCompareMemoize as q, useDeepDependencies as r, setTracker as s, useDeepEffect as t, uniqArray as u, useIdentifier as v, useIsMounted as w, useLivePreviewContext as x, useLocalStorage as y, useServerCoreVersionGte as z };
7315
+ //# sourceMappingURL=index-a74365e7.js.map