xmlui 0.9.67 → 0.9.69
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/dist/lib/{apiInterceptorWorker-JRzJvZYD.mjs → apiInterceptorWorker-UGlauegS.mjs} +1 -1
- package/dist/lib/{index-CcvStYZ-.mjs → index-D4XP6T9c.mjs} +9685 -9616
- package/dist/lib/index.css +1 -1
- package/dist/lib/language-server-web-worker.mjs +1 -1
- package/dist/lib/language-server.mjs +1 -1
- package/dist/lib/{server-common-LUcdzTQs.mjs → server-common-CfdMYx46.mjs} +4453 -4423
- package/dist/lib/xmlui.d.ts +2 -1
- package/dist/lib/xmlui.mjs +1 -1
- package/dist/metadata/{apiInterceptorWorker-CkH3kF96.mjs → apiInterceptorWorker-CNbJTzxw.mjs} +1 -1
- package/dist/metadata/{collectedComponentMetadata-BarV5tXf.mjs → collectedComponentMetadata-BJTdYg2J.mjs} +9251 -9182
- package/dist/metadata/style.css +1 -1
- package/dist/metadata/xmlui-metadata.mjs +1 -1
- package/dist/metadata/xmlui-metadata.umd.js +87 -87
- package/dist/scripts/package.json +2 -2
- package/dist/scripts/src/components/App/App.js +1 -1
- package/dist/scripts/src/components/Checkbox/Checkbox.js +8 -3
- package/dist/scripts/src/components/CodeBlock/CodeBlock.js +0 -1
- package/dist/scripts/src/components/Link/Link.js +2 -2
- package/dist/scripts/src/components/List/ListNative.js +1 -1
- package/dist/scripts/src/components/NestedApp/AppWithCodeViewNative.js +14 -5
- package/dist/scripts/src/components/NestedApp/NestedApp.js +2 -2
- package/dist/scripts/src/components/NestedApp/NestedAppNative.js +13 -4
- package/dist/scripts/src/components/Option/Option.js +6 -1
- package/dist/scripts/src/components/Select/HiddenOption.js +1 -1
- package/dist/scripts/src/components/Select/SelectNative.js +15 -9
- package/dist/scripts/src/components/Switch/Switch.js +2 -2
- package/dist/scripts/src/components/Text/Text.js +4 -2
- package/dist/scripts/src/components/Toggle/Toggle.js +11 -8
- package/dist/scripts/src/components-core/interception/ApiInterceptorProvider.js +13 -7
- package/dist/scripts/src/components-core/rendering/AppContent.js +9 -0
- package/dist/scripts/src/components-core/theming/themes/root.js +1 -1
- package/dist/standalone/xmlui-standalone.es.d.ts +2 -1
- package/dist/standalone/xmlui-standalone.umd.js +233 -233
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xmlui",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.69",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"start-test-bed": "cd src/testing/infrastructure && xmlui start",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"postpublish": "clean-package restore",
|
|
19
19
|
"generate-docs-summaries": "node scripts/generate-docs/generate-summary-files.mjs",
|
|
20
20
|
"generate-docs": "node scripts/generate-docs/get-docs.mjs",
|
|
21
|
-
"generate-all-docs": "npm run build:xmlui-metadata && npm run
|
|
21
|
+
"generate-all-docs": "npm run build:xmlui-metadata && npm run generate-docs && npm run generate-docs-summaries",
|
|
22
22
|
"export-themes": "npm run build:xmlui-metadata && node scripts/generate-docs/create-theme-files.mjs",
|
|
23
23
|
"generate-docs-with-refresh": "npm run build:xmlui-metadata && npm run generate-docs && npm run generate-docs-summaries",
|
|
24
24
|
"gen:langserver-metadata": "node scripts/get-langserver-metadata.mjs > src/language-server/xmlui-metadata-generated.mjs"
|
|
@@ -94,7 +94,7 @@ exports.AppMd = (0, metadata_helpers_1.createMetadata)({
|
|
|
94
94
|
"with one of the vertical layouts.",
|
|
95
95
|
},
|
|
96
96
|
defaultThemeVars: {
|
|
97
|
-
"maxWidth-Drawer": "
|
|
97
|
+
"maxWidth-Drawer": "100%",
|
|
98
98
|
[`width-navPanel-${COMP}`]: "$space-64",
|
|
99
99
|
[`backgroundColor-navPanel-${COMP}`]: "$backgroundColor",
|
|
100
100
|
[`maxWidth-content-${COMP}`]: "$maxWidth-content",
|
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.checkboxComponentRenderer = exports.CheckboxMd = void 0;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const
|
|
8
|
+
const Checkbox_module_scss_1 = __importDefault(require("./Checkbox.module.scss"));
|
|
9
9
|
const renderers_1 = require("../../components-core/renderers");
|
|
10
10
|
const themeVars_1 = require("../../components-core/theming/themeVars");
|
|
11
11
|
const metadata_helpers_1 = require("../../components/metadata-helpers");
|
|
@@ -43,7 +43,7 @@ exports.CheckboxMd = (0, metadata_helpers_1.createMetadata)({
|
|
|
43
43
|
value: (0, metadata_helpers_1.dValueApi)(),
|
|
44
44
|
setValue: (0, metadata_helpers_1.dSetValueApi)(),
|
|
45
45
|
},
|
|
46
|
-
themeVars: (0, themeVars_1.parseScssVar)(
|
|
46
|
+
themeVars: (0, themeVars_1.parseScssVar)(Checkbox_module_scss_1.default.themeVars),
|
|
47
47
|
limitThemeVarsToComponent: true,
|
|
48
48
|
defaultThemeVars: {
|
|
49
49
|
[`borderColor-checked-${COMP}-error`]: `$borderColor-${COMP}-error`,
|
|
@@ -60,7 +60,12 @@ exports.CheckboxMd = (0, metadata_helpers_1.createMetadata)({
|
|
|
60
60
|
});
|
|
61
61
|
exports.checkboxComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.CheckboxMd, ({ node, extractValue, layoutCss, updateState, lookupEventHandler, state, registerComponentApi, renderChild, layoutContext, }) => {
|
|
62
62
|
const inputTemplate = node.props.inputTemplate;
|
|
63
|
+
const validationStatus = extractValue(node.props.validationStatus);
|
|
63
64
|
return ((0, jsx_runtime_1.jsx)(Toggle_1.Toggle, { inputRenderer: inputTemplate
|
|
64
65
|
? (contextVars) => ((0, jsx_runtime_1.jsx)(container_helpers_1.MemoizedItem, { contextVars: contextVars, node: inputTemplate, renderChild: renderChild, layoutContext: layoutContext }))
|
|
65
|
-
: undefined, enabled: extractValue.asOptionalBoolean(node.props.enabled),
|
|
66
|
+
: undefined, enabled: extractValue.asOptionalBoolean(node.props.enabled), autoFocus: extractValue.asOptionalBoolean(node.props.autoFocus), style: layoutCss, initialValue: extractValue.asOptionalBoolean(node.props.initialValue, Toggle_1.defaultProps.initialValue), variantClassName: Checkbox_module_scss_1.default.checkbox, statusClasses: {
|
|
67
|
+
[Checkbox_module_scss_1.default.error]: validationStatus === "error",
|
|
68
|
+
[Checkbox_module_scss_1.default.warning]: validationStatus === "warning",
|
|
69
|
+
[Checkbox_module_scss_1.default.valid]: validationStatus === "valid",
|
|
70
|
+
}, value: state === null || state === void 0 ? void 0 : state.value, readOnly: extractValue.asOptionalBoolean(node.props.readOnly), validationStatus: validationStatus, updateState: updateState, onDidChange: lookupEventHandler("didChange"), onFocus: lookupEventHandler("gotFocus"), onBlur: lookupEventHandler("lostFocus"), label: extractValue(node.props.label), labelPosition: extractValue(node.props.labelPosition), labelWidth: extractValue(node.props.labelWidth), labelBreak: extractValue.asOptionalBoolean(node.props.labelBreak), required: extractValue.asOptionalBoolean(node.props.required), indeterminate: extractValue.asOptionalBoolean(node.props.indeterminate), registerComponentApi: registerComponentApi }));
|
|
66
71
|
});
|
|
@@ -26,7 +26,6 @@ exports.CodeBlockMd = (0, metadata_helpers_1.createMetadata)({
|
|
|
26
26
|
"borderColor-CodeBlock-highlightString-emphasis": "$color-attention",
|
|
27
27
|
"border-CodeBlock": "0.5px solid $borderColor",
|
|
28
28
|
"borderRadius-CodeBlock": "$space-2",
|
|
29
|
-
"boxShadow-CodeBlock": "none",
|
|
30
29
|
"height-CodeBlock": "fit-content",
|
|
31
30
|
"paddingVertical-content-CodeBlock": "0",
|
|
32
31
|
"paddingHorizontal-content-CodeBlock": "0",
|
|
@@ -42,9 +42,9 @@ exports.LinkMd = (0, metadata_helpers_1.createMetadata)({
|
|
|
42
42
|
defaultThemeVars: {
|
|
43
43
|
[`border-${COMP}`]: "0px solid $borderColor",
|
|
44
44
|
[`textColor-${COMP}`]: "$color-primary-500",
|
|
45
|
-
[`textDecorationColor-${COMP}`]:
|
|
45
|
+
[`textDecorationColor-${COMP}`]: `textDecorationColor-${COMP}`,
|
|
46
46
|
[`textColor-${COMP}--hover`]: `$color-primary-400`,
|
|
47
|
-
[`textDecorationColor-${COMP}--hover`]:
|
|
47
|
+
[`textDecorationColor-${COMP}--hover`]: `textColor-${COMP}--hover`,
|
|
48
48
|
[`textColor-${COMP}--active`]: "$color-primary-400",
|
|
49
49
|
[`textDecorationColor-${COMP}--active`]: "$color-primary-400",
|
|
50
50
|
[`textColor-${COMP}--hover--active`]: `$textColor-${COMP}--active`,
|
|
@@ -392,7 +392,7 @@ exports.ListNative = (0, react_1.forwardRef)(function DynamicHeightList({ items
|
|
|
392
392
|
const row = rows === null || rows === void 0 ? void 0 : rows[rowIndex];
|
|
393
393
|
const key = row === null || row === void 0 ? void 0 : row[idKey];
|
|
394
394
|
if (!row) {
|
|
395
|
-
return
|
|
395
|
+
return null;
|
|
396
396
|
}
|
|
397
397
|
// --- End change
|
|
398
398
|
switch (row._row_type) {
|
|
@@ -19,9 +19,13 @@ const NestedAppNative_1 = require("./NestedAppNative");
|
|
|
19
19
|
const Markdown_1 = require("../Markdown/Markdown");
|
|
20
20
|
const ButtonNative_1 = require("../Button/ButtonNative");
|
|
21
21
|
const NestedApp_module_scss_1 = __importDefault(require("./NestedApp.module.scss"));
|
|
22
|
+
const Tooltip_1 = require("./Tooltip");
|
|
23
|
+
const rx_1 = require("react-icons/rx");
|
|
24
|
+
const lia_1 = require("react-icons/lia");
|
|
22
25
|
const utils_1 = require("./utils");
|
|
23
26
|
const AppContext_1 = require("../../components-core/AppContext");
|
|
24
27
|
const classnames_1 = __importDefault(require("classnames"));
|
|
28
|
+
const logo_svg_react_1 = __importDefault(require("./logo.svg?react"));
|
|
25
29
|
/**
|
|
26
30
|
* A component that displays markdown content on the left and a NestedApp on the right
|
|
27
31
|
*/
|
|
@@ -58,11 +62,16 @@ function AppWithCodeViewNative({ markdown, splitView, withFrame = true, noHeader
|
|
|
58
62
|
: `https://docs.xmlui.com/playground#${appQueryString}`, "_blank");
|
|
59
63
|
}), [app, components, title, activeTheme, api, activeTone, useHashBasedRouting]);
|
|
60
64
|
if (splitView) {
|
|
61
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: NestedApp_module_scss_1.default.nestedAppContainer, style: { height }, children: [(0, jsx_runtime_1.
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
65
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: NestedApp_module_scss_1.default.nestedAppContainer, style: { height }, children: [(0, jsx_runtime_1.jsxs)("div", { className: NestedApp_module_scss_1.default.header, children: [(0, jsx_runtime_1.jsx)("div", { className: NestedApp_module_scss_1.default.wrapper, children: (0, jsx_runtime_1.jsx)(logo_svg_react_1.default, { className: NestedApp_module_scss_1.default.logo }) }), (0, jsx_runtime_1.jsxs)("div", { className: NestedApp_module_scss_1.default.viewControls, children: [(0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { onClick: () => setShowCode(true), variant: showCode ? "solid" : "ghost", className: (0, classnames_1.default)(NestedApp_module_scss_1.default.splitViewButton, {
|
|
66
|
+
[NestedApp_module_scss_1.default.active]: showCode,
|
|
67
|
+
}), children: "XML" }), (0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { onClick: () => setShowCode(false), variant: showCode ? "ghost" : "solid", className: (0, classnames_1.default)(NestedApp_module_scss_1.default.splitViewButton, {
|
|
68
|
+
[NestedApp_module_scss_1.default.active]: !showCode,
|
|
69
|
+
}), children: "UI" })] }), (0, jsx_runtime_1.jsxs)("div", { className: NestedApp_module_scss_1.default.wrapper, children: [allowPlaygroundPopup && ((0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { trigger: (0, jsx_runtime_1.jsx)("button", { className: NestedApp_module_scss_1.default.headerButton, onClick: () => {
|
|
70
|
+
openPlayground();
|
|
71
|
+
}, children: (0, jsx_runtime_1.jsx)(rx_1.RxOpenInNewWindow, {}) }), label: "View and edit in new full-width window" })), (0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { trigger: (0, jsx_runtime_1.jsx)("button", { className: NestedApp_module_scss_1.default.headerButton, onClick: () => {
|
|
72
|
+
setShowCode(false);
|
|
73
|
+
setRefreshVersion(refreshVersion + 1);
|
|
74
|
+
}, children: (0, jsx_runtime_1.jsx)(lia_1.LiaUndoAltSolid, {}) }), label: "Reset the app" })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: NestedApp_module_scss_1.default.contentContainer, children: [showCode && (0, jsx_runtime_1.jsx)(Markdown_1.Markdown, { style: { height: "100%" }, children: markdown }), !showCode && ((0, jsx_runtime_1.jsx)(NestedAppNative_1.IndexAwareNestedApp, { height: "100%", refVersion: refreshVersion, app: app, api: api, components: components, config: config, activeTone: activeTone, activeTheme: activeTheme, title: title, allowPlaygroundPopup: allowPlaygroundPopup, withFrame: false, noHeader: false, popOutUrl: popOutUrl }))] })] }));
|
|
66
75
|
}
|
|
67
76
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(Markdown_1.Markdown, { children: markdown }) }), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(NestedAppNative_1.IndexAwareNestedApp, { app: app, api: api, components: components, config: config, activeTone: activeTone, activeTheme: activeTheme, title: title, height: height, allowPlaygroundPopup: allowPlaygroundPopup, withFrame: withFrame, noHeader: noHeader, popOutUrl: popOutUrl }) })] }));
|
|
68
77
|
}
|
|
@@ -66,7 +66,7 @@ exports.NestedAppMd = (0, metadata_helpers_1.createMetadata)({
|
|
|
66
66
|
[`backgroundColor-frame-${COMP}`]: "$color-primary-50",
|
|
67
67
|
[`gap-frame-${COMP}`]: "0",
|
|
68
68
|
[`fontWeight-header-${COMP}`]: "$fontWeight-bold",
|
|
69
|
-
[`boxShadow-${COMP}`]: "
|
|
69
|
+
[`boxShadow-${COMP}`]: "0px 0px 32px 0px rgba(0, 0, 0, 0.05)",
|
|
70
70
|
[`backgroundColor-viewControls-${COMP}`]: "$color-primary-100",
|
|
71
71
|
[`borderRadius-viewControls-${COMP}`]: "5px",
|
|
72
72
|
[`padding-viewControls-${COMP}`]: "$space-0_5",
|
|
@@ -76,7 +76,7 @@ exports.NestedAppMd = (0, metadata_helpers_1.createMetadata)({
|
|
|
76
76
|
[`width-button-splitView-${COMP}`]: "60px",
|
|
77
77
|
[`width-logo-splitView-${COMP}`]: "2rem",
|
|
78
78
|
[`height-logo-splitView-${COMP}`]: "2rem",
|
|
79
|
-
[`width-controls-${COMP}`]: "
|
|
79
|
+
[`width-controls-${COMP}`]: "80px",
|
|
80
80
|
},
|
|
81
81
|
});
|
|
82
82
|
exports.nestedAppComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.NestedAppMd, ({ node, extractValue, layoutCss }) => {
|
|
@@ -64,11 +64,11 @@ function NestedApp({ api, app, components = constants_1.EMPTY_ARRAY, config, act
|
|
|
64
64
|
const toneToApply = activeTone || (config === null || config === void 0 ? void 0 : config.defaultTone) || (theme === null || theme === void 0 ? void 0 : theme.activeThemeTone);
|
|
65
65
|
const { appGlobals } = (0, AppContext_1.useAppContext)();
|
|
66
66
|
const componentRegistry = (0, ComponentRegistryContext_1.useComponentRegistry)();
|
|
67
|
-
const { interceptorWorker } = (0, useApiInterceptorContext_1.useApiInterceptorContext)();
|
|
67
|
+
const { interceptorWorker, initialized, forceInitialize } = (0, useApiInterceptorContext_1.useApiInterceptorContext)();
|
|
68
68
|
(0, react_1.useEffect)(() => {
|
|
69
69
|
setRefreshVersion(refVersion);
|
|
70
70
|
}, [refVersion]);
|
|
71
|
-
//TODO illesg: we should come up with something to make sure that nestedApps
|
|
71
|
+
//TODO illesg: we should come up with something to make sure that nestedApps don't overwrite each other's mocked api endpoints
|
|
72
72
|
// disabled for now, as it messes up the paths of not mocked APIs (e.g. resources/{staticJsonfiles})
|
|
73
73
|
//const safeId = playgroundId || nestedAppId;
|
|
74
74
|
//const apiUrl = api ? `/${safeId.replaceAll(":", "")}` : '';
|
|
@@ -116,7 +116,7 @@ function NestedApp({ api, app, components = constants_1.EMPTY_ARRAY, config, act
|
|
|
116
116
|
window.open(useHashBasedRouting
|
|
117
117
|
? `${popOutUrl !== null && popOutUrl !== void 0 ? popOutUrl : ""}/#/playground#${appQueryString}`
|
|
118
118
|
: `${popOutUrl !== null && popOutUrl !== void 0 ? popOutUrl : ""}/playground#${appQueryString}`, "_blank");
|
|
119
|
-
}), [app, components, title, activeTheme, api, activeTone, useHashBasedRouting]);
|
|
119
|
+
}), [app, components, title, activeTheme, api, activeTone, useHashBasedRouting, popOutUrl]);
|
|
120
120
|
(0, react_1.useEffect)(() => {
|
|
121
121
|
var _a;
|
|
122
122
|
if (!shadowRef.current && rootRef.current) {
|
|
@@ -154,7 +154,13 @@ function NestedApp({ api, app, components = constants_1.EMPTY_ARRAY, config, act
|
|
|
154
154
|
Object.keys(theme.themeStyles).forEach((key) => {
|
|
155
155
|
themeVarReset[key] = "initial";
|
|
156
156
|
});
|
|
157
|
-
let
|
|
157
|
+
let shouldForceInit = mock && initialized && !interceptorWorker;
|
|
158
|
+
if (shouldForceInit) {
|
|
159
|
+
// in this case we need to force initialize the interceptor worker
|
|
160
|
+
// to make sure that the mock is applied (this could be the case when the 'root' app is not using any mocks)
|
|
161
|
+
forceInitialize();
|
|
162
|
+
}
|
|
163
|
+
let nestedAppRoot = mock && !interceptorWorker ? null : ((0, jsx_runtime_1.jsx)(ApiInterceptorProvider_1.ApiInterceptorProvider, { interceptor: mock, apiWorker: interceptorWorker, children: (0, jsx_runtime_1.jsx)("div", { style: Object.assign(Object.assign({ height }, style), themeVarReset), children: (0, jsx_runtime_1.jsx)(AppRoot_1.AppRoot, { isNested: true, previewMode: true, standalone: true, trackContainerHeight: height ? "fixed" : "auto", node: component, globalProps: globalProps, defaultTheme: activeTheme || (config === null || config === void 0 ? void 0 : config.defaultTheme), defaultTone: toneToApply, contributes: {
|
|
158
164
|
compoundComponents,
|
|
159
165
|
themes: config === null || config === void 0 ? void 0 : config.themes,
|
|
160
166
|
}, resources: config === null || config === void 0 ? void 0 : config.resources, extensionManager: componentRegistry.getExtensionManager() }, `app-${nestedAppId}-${refreshVersion}`) }) }));
|
|
@@ -186,6 +192,9 @@ function NestedApp({ api, app, components = constants_1.EMPTY_ARRAY, config, act
|
|
|
186
192
|
withFrame,
|
|
187
193
|
noHeader,
|
|
188
194
|
apiUrl,
|
|
195
|
+
initialized,
|
|
196
|
+
style,
|
|
197
|
+
forceInitialize,
|
|
189
198
|
]);
|
|
190
199
|
const mountedRef = (0, react_1.useRef)(false);
|
|
191
200
|
(0, react_1.useEffect)(() => {
|
|
@@ -31,7 +31,12 @@ exports.OptionMd = (0, metadata_helpers_1.createMetadata)({
|
|
|
31
31
|
});
|
|
32
32
|
exports.optionComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.OptionMd, ({ node, extractValue, layoutCss, renderChild, layoutContext }) => {
|
|
33
33
|
const optionTemplate = node.props.optionTemplate;
|
|
34
|
+
const label = extractValue.asOptionalString(node.props.label) || extractValue(node.props.value);
|
|
35
|
+
const value = extractValue.asOptionalString(node.props.value) || extractValue(node.props.label);
|
|
36
|
+
if (label === undefined) {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
34
39
|
return ((0, jsx_runtime_1.jsx)(OptionNative_1.OptionNative, { optionRenderer: optionTemplate
|
|
35
40
|
? (contextVars) => ((0, jsx_runtime_1.jsx)(container_helpers_1.MemoizedItem, { node: optionTemplate, renderChild: renderChild, contextVars: contextVars, layoutContext: layoutContext }))
|
|
36
|
-
: undefined,
|
|
41
|
+
: undefined, label: label, value: value, enabled: extractValue.asOptionalBoolean(node.props.enabled), style: layoutCss }));
|
|
37
42
|
});
|
|
@@ -11,7 +11,7 @@ function HiddenOption(option) {
|
|
|
11
11
|
const opt = (0, react_1.useMemo)(() => {
|
|
12
12
|
var _a, _b;
|
|
13
13
|
return Object.assign(Object.assign({}, option), { label: (_a = label !== null && label !== void 0 ? label : node === null || node === void 0 ? void 0 : node.textContent) !== null && _a !== void 0 ? _a : "", keywords: [(_b = label !== null && label !== void 0 ? label : node === null || node === void 0 ? void 0 : node.textContent) !== null && _b !== void 0 ? _b : ""] });
|
|
14
|
-
}, [option, node]);
|
|
14
|
+
}, [option, node, label]);
|
|
15
15
|
(0, react_1.useEffect)(() => {
|
|
16
16
|
onOptionAdd(opt);
|
|
17
17
|
return () => onOptionRemove(opt);
|
|
@@ -83,7 +83,7 @@ const SimpleSelect = (0, react_1.forwardRef)(function SimpleSelect(props, forwar
|
|
|
83
83
|
}
|
|
84
84
|
const match = Array.from(options).find((o) => `${o.value}` === val);
|
|
85
85
|
onValueChange((_a = match === null || match === void 0 ? void 0 : match.value) !== null && _a !== void 0 ? _a : val);
|
|
86
|
-
}, [onValueChange, options]);
|
|
86
|
+
}, [onValueChange, options, readOnly]);
|
|
87
87
|
return ((0, jsx_runtime_1.jsxs)(react_select_1.Root, { value: stringValue, onValueChange: onValChange, children: [(0, jsx_runtime_1.jsxs)(react_select_1.Trigger, { id: id, "aria-haspopup": "listbox", style: style, onFocus: onFocus, onBlur: onBlur, disabled: !enabled, className: (0, classnames_1.default)(Select_module_scss_1.default.selectTrigger, {
|
|
88
88
|
[Select_module_scss_1.default.error]: validationStatus === "error",
|
|
89
89
|
[Select_module_scss_1.default.warning]: validationStatus === "warning",
|
|
@@ -204,16 +204,16 @@ exports.Select = (0, react_1.forwardRef)(function Select({ id, initialValue, val
|
|
|
204
204
|
}) }) })) : ((0, jsx_runtime_1.jsx)("span", { placeholder: placeholder, className: Select_module_scss_1.default.placeholder, children: placeholder }))) : value !== undefined && value !== null ? ((0, jsx_runtime_1.jsx)("div", { children: (_a = Array.from(options).find((o) => o.value === value)) === null || _a === void 0 ? void 0 : _a.label })) : ((0, jsx_runtime_1.jsx)("span", { "aria-placeholder": placeholder, className: Select_module_scss_1.default.placeholder, children: placeholder || "" })), (0, jsx_runtime_1.jsxs)("div", { className: Select_module_scss_1.default.actions, children: [multiSelect && Array.isArray(value) && value.length > 0 && ((0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "close", onClick: (event) => {
|
|
205
205
|
event.stopPropagation();
|
|
206
206
|
clearValue();
|
|
207
|
-
} })), (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "chevrondown" })] })] }), open && ((0, jsx_runtime_1.jsx)(react_select_1.Portal, { container: root, children: (0, jsx_runtime_1.jsx)(react_focus_scope_1.FocusScope, { asChild: true, loop: true, trapped: true, children: (0, jsx_runtime_1.jsx)(react_popover_1.PopoverContent, { style: { width, height: dropdownHeight }, className: Select_module_scss_1.default.selectContent, children: (0, jsx_runtime_1.jsxs)(cmdk_1.Command, { className: Select_module_scss_1.default.command, shouldFilter: searchable, filter: (
|
|
208
|
-
const
|
|
209
|
-
|
|
210
|
-
|
|
207
|
+
} })), (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "chevrondown" })] })] }), open && ((0, jsx_runtime_1.jsx)(react_select_1.Portal, { container: root, children: (0, jsx_runtime_1.jsx)(react_focus_scope_1.FocusScope, { asChild: true, loop: true, trapped: true, children: (0, jsx_runtime_1.jsx)(react_popover_1.PopoverContent, { style: { width, height: dropdownHeight }, className: Select_module_scss_1.default.selectContent, children: (0, jsx_runtime_1.jsxs)(cmdk_1.Command, { className: Select_module_scss_1.default.command, shouldFilter: searchable, filter: (_, search, keywords) => {
|
|
208
|
+
const lowSearch = search.toLowerCase();
|
|
209
|
+
for (const kw of keywords) {
|
|
210
|
+
if (kw.toLowerCase().includes(lowSearch))
|
|
211
|
+
return 1;
|
|
212
|
+
}
|
|
211
213
|
return 0;
|
|
212
214
|
}, children: [searchable ? ((0, jsx_runtime_1.jsxs)("div", { className: Select_module_scss_1.default.commandInputContainer, children: [(0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "search" }), (0, jsx_runtime_1.jsx)(cmdk_1.CommandInput, { className: (0, classnames_1.default)(Select_module_scss_1.default.commandInput), placeholder: "Search..." })] })) : (
|
|
213
215
|
// https://github.com/pacocoursey/cmdk/issues/322#issuecomment-2444703817
|
|
214
|
-
(0, jsx_runtime_1.jsx)("button", { autoFocus: true, "aria-hidden": "true", className: Select_module_scss_1.default.srOnly })), (0, jsx_runtime_1.jsxs)(cmdk_1.CommandList, { className: Select_module_scss_1.default.commandList, children: [inProgress && ((0, jsx_runtime_1.jsx)("div", { className: Select_module_scss_1.default.loading, children: inProgressNotificationMessage })), Array.from(options).map(({ value, label, enabled, keywords }) => ((0, jsx_runtime_1.jsx)(exports.ComboboxOption, { readOnly: readOnly, value: value, label: label, enabled: enabled, keywords: keywords }, value))), !inProgress && (0, jsx_runtime_1.jsx)(cmdk_1.CommandEmpty, { children: emptyListNode })] })] }) }) }) }))] })) : ((0, jsx_runtime_1.jsx)(SimpleSelect, { readOnly: !!readOnly, ref: ref, value: value, options: options, onValueChange: toggleOption, id: inputId, style: style, onFocus: onFocus, onBlur: onBlur, enabled: enabled, validationStatus: validationStatus, triggerRef: setReferenceElement, autoFocus: autoFocus, placeholder: placeholder, height: dropdownHeight, children: options
|
|
215
|
-
? Array.from(options).map((option, idx) => ((0, jsx_runtime_1.jsx)(SelectOption, { value: option.value, label: option.label, enabled: option.enabled }, `${option.value}-${idx}`)))
|
|
216
|
-
: emptyListNode })) }), children] }) }) }));
|
|
216
|
+
(0, jsx_runtime_1.jsx)("button", { autoFocus: true, "aria-hidden": "true", className: Select_module_scss_1.default.srOnly })), (0, jsx_runtime_1.jsxs)(cmdk_1.CommandList, { className: Select_module_scss_1.default.commandList, children: [inProgress && ((0, jsx_runtime_1.jsx)("div", { className: Select_module_scss_1.default.loading, children: inProgressNotificationMessage })), Array.from(options).map(({ value, label, enabled, keywords }) => ((0, jsx_runtime_1.jsx)(exports.ComboboxOption, { readOnly: readOnly, value: value, label: label, enabled: enabled, keywords: keywords }, value))), !inProgress && (0, jsx_runtime_1.jsx)(cmdk_1.CommandEmpty, { children: emptyListNode })] })] }) }) }) }))] })) : ((0, jsx_runtime_1.jsx)(SimpleSelect, { readOnly: !!readOnly, ref: ref, value: value, options: options, onValueChange: toggleOption, id: inputId, style: style, onFocus: onFocus, onBlur: onBlur, enabled: enabled, validationStatus: validationStatus, triggerRef: setReferenceElement, autoFocus: autoFocus, placeholder: placeholder, height: dropdownHeight, children: renderOptionsOrDefault(options, emptyListNode) })) }), children] }) }) }));
|
|
217
217
|
});
|
|
218
218
|
exports.ComboboxOption = (0, react_1.forwardRef)(function Combobox(option, forwardedRef) {
|
|
219
219
|
const id = (0, react_1.useId)();
|
|
@@ -230,7 +230,7 @@ exports.ComboboxOption = (0, react_1.forwardRef)(function Combobox(option, forwa
|
|
|
230
230
|
return;
|
|
231
231
|
}
|
|
232
232
|
onChange(value);
|
|
233
|
-
}, "data-state": selected ? "checked" : undefined, keywords: keywords, children: (0, jsx_runtime_1.jsx)("div", { className: Select_module_scss_1.default.multiComboboxOptionContent, children: optionRenderer ? (optionRenderer({ label, value, enabled, keywords }, selectedValue, false)) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [optionLabelRenderer ? optionLabelRenderer({ label, value }) : label, selected && (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "checkmark" })] })) }) }, id));
|
|
233
|
+
}, "data-state": selected ? "checked" : undefined, keywords: [...keywords, label], children: (0, jsx_runtime_1.jsx)("div", { className: Select_module_scss_1.default.multiComboboxOptionContent, children: optionRenderer ? (optionRenderer({ label, value, enabled, keywords }, selectedValue, false)) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [optionLabelRenderer ? optionLabelRenderer({ label, value }) : label, selected && (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "checkmark" })] })) }) }, id));
|
|
234
234
|
});
|
|
235
235
|
const SelectOption = react_1.default.forwardRef((option, ref) => {
|
|
236
236
|
const { value, label, enabled = true } = option;
|
|
@@ -242,3 +242,9 @@ const SelectOption = react_1.default.forwardRef((option, ref) => {
|
|
|
242
242
|
}, selectedValue, false)) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_select_1.ItemText, { className: Select_module_scss_1.default.selectItemContent, children: optionLabelRenderer ? optionLabelRenderer({ value, label }) : label }), selectedValue === value && ((0, jsx_runtime_1.jsx)("span", { className: Select_module_scss_1.default.selectItemIndicator, children: (0, jsx_runtime_1.jsx)(react_select_1.ItemIndicator, { children: (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "checkmark" }) }) }))] })) }) }));
|
|
243
243
|
});
|
|
244
244
|
SelectOption.displayName = "SelectOption";
|
|
245
|
+
function renderOptionsOrDefault(options, default_) {
|
|
246
|
+
if (options.size === 0) {
|
|
247
|
+
return default_;
|
|
248
|
+
}
|
|
249
|
+
return Array.from(options).map((option) => ((0, jsx_runtime_1.jsx)(SelectOption, { value: option.value, label: option.label, enabled: option.enabled }, option.value)));
|
|
250
|
+
}
|
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.switchComponentRenderer = exports.SwitchMd = void 0;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const
|
|
8
|
+
const Switch_module_scss_1 = __importDefault(require("./Switch.module.scss"));
|
|
9
9
|
const renderers_1 = require("../../components-core/renderers");
|
|
10
10
|
const themeVars_1 = require("../../components-core/theming/themeVars");
|
|
11
11
|
const metadata_helpers_1 = require("../metadata-helpers");
|
|
@@ -38,7 +38,7 @@ exports.SwitchMd = (0, metadata_helpers_1.createMetadata)({
|
|
|
38
38
|
value: (0, metadata_helpers_1.dValueApi)(),
|
|
39
39
|
setValue: (0, metadata_helpers_1.dSetValueApi)(),
|
|
40
40
|
},
|
|
41
|
-
themeVars: (0, themeVars_1.parseScssVar)(
|
|
41
|
+
themeVars: (0, themeVars_1.parseScssVar)(Switch_module_scss_1.default.themeVars),
|
|
42
42
|
limitThemeVarsToComponent: true,
|
|
43
43
|
defaultThemeVars: {
|
|
44
44
|
[`borderColor-checked-${COMP}-error`]: `$borderColor-${COMP}-error`,
|
|
@@ -97,8 +97,8 @@ exports.TextMd = (0, metadata_helpers_1.createMetadata)({
|
|
|
97
97
|
[`letterSpacing-${COMP}-caption`]: "0.05rem",
|
|
98
98
|
[`fontSize-${COMP}-placeholder`]: "$fontSize-smaller",
|
|
99
99
|
[`fontFamily-${COMP}-codefence`]: "$fontFamily-monospace",
|
|
100
|
-
[`paddingHorizontal-${COMP}-codefence`]: "$space-
|
|
101
|
-
[`paddingVertical-${COMP}-codefence`]: "$space-
|
|
100
|
+
[`paddingHorizontal-${COMP}-codefence`]: "$space-4",
|
|
101
|
+
[`paddingVertical-${COMP}-codefence`]: "$space-3",
|
|
102
102
|
[`paddingVertical-${COMP}-paragraph`]: "$space-1",
|
|
103
103
|
[`fontSize-${COMP}-subheading`]: "$fontSize-H6",
|
|
104
104
|
[`fontWeight-${COMP}-subheading`]: "$fontWeight-bold",
|
|
@@ -111,6 +111,8 @@ exports.TextMd = (0, metadata_helpers_1.createMetadata)({
|
|
|
111
111
|
[`fontWeight-${COMP}-tableheading`]: "$fontWeight-bold",
|
|
112
112
|
[`marginTop-${COMP}-markdown`]: "$space-3",
|
|
113
113
|
[`marginBottom-${COMP}-markdown`]: "$space-6",
|
|
114
|
+
[`fontSize-${COMP}-markdown`]: `fontSize-${COMP}`,
|
|
115
|
+
[`fontWeight-${COMP}-markdown`]: `fontWeight-${COMP}`,
|
|
114
116
|
[`backgroundColor-${COMP}-code`]: "rgb(from $color-surface-100 r g b / 0.4)",
|
|
115
117
|
[`borderColor-${COMP}-code`]: "$color-surface-100",
|
|
116
118
|
[`backgroundColor-${COMP}-keyboard`]: "rgb(from $color-surface-100 r g b / 0.4)",
|
|
@@ -53,10 +53,18 @@ exports.defaultProps = {
|
|
|
53
53
|
validationStatus: "none",
|
|
54
54
|
indeterminate: false,
|
|
55
55
|
};
|
|
56
|
-
exports.Toggle = (0, react_3.forwardRef)(function Toggle({ id, initialValue = exports.defaultProps.initialValue, value = exports.defaultProps.value, enabled = exports.defaultProps.enabled, style, readOnly, validationStatus = exports.defaultProps.validationStatus, updateState = constants_1.noop, onDidChange = constants_1.noop, onFocus = constants_1.noop, onBlur = constants_1.noop, variant = "checkbox", indeterminate = exports.defaultProps.indeterminate, className, label, labelPosition = "end", labelWidth, labelBreak, required, registerComponentApi, inputRenderer, }, forwardedRef) {
|
|
56
|
+
exports.Toggle = (0, react_3.forwardRef)(function Toggle({ id, initialValue = exports.defaultProps.initialValue, value = exports.defaultProps.value, enabled = exports.defaultProps.enabled, style, readOnly, validationStatus = exports.defaultProps.validationStatus, updateState = constants_1.noop, onDidChange = constants_1.noop, onFocus = constants_1.noop, onBlur = constants_1.noop, variant = "checkbox", indeterminate = exports.defaultProps.indeterminate, className, variantClassName, statusClasses = {}, label, labelPosition = "end", labelWidth, labelBreak, required, registerComponentApi, inputRenderer, autoFocus = false, }, forwardedRef) {
|
|
57
57
|
const generatedId = (0, react_1.useId)();
|
|
58
58
|
const inputId = id || generatedId;
|
|
59
59
|
const innerRef = react_3.default.useRef(null);
|
|
60
|
+
(0, react_3.useEffect)(() => {
|
|
61
|
+
if (autoFocus) {
|
|
62
|
+
setTimeout(() => {
|
|
63
|
+
var _a;
|
|
64
|
+
(_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
65
|
+
}, 0);
|
|
66
|
+
}
|
|
67
|
+
}, [autoFocus]);
|
|
60
68
|
(0, react_3.useEffect)(() => {
|
|
61
69
|
updateState({ value: initialValue }, { initial: true });
|
|
62
70
|
}, [initialValue, updateState]);
|
|
@@ -98,13 +106,7 @@ exports.Toggle = (0, react_3.forwardRef)(function Toggle({ id, initialValue = ex
|
|
|
98
106
|
setValue,
|
|
99
107
|
});
|
|
100
108
|
}, [focus, registerComponentApi, setValue]);
|
|
101
|
-
const input = (0, react_2.useMemo)(() => ((0, jsx_runtime_1.jsx)("input", { id: inputId, ref: innerRef, type: "checkbox", role: variant, checked: value, disabled: !enabled, required: required, readOnly: readOnly, "aria-readonly": readOnly, "aria-checked": value, onChange: onInputChange, onFocus: handleOnFocus, onBlur: handleOnBlur, className: (0, classnames_1.default)(Toggle_module_scss_1.default.resetAppearance, className,
|
|
102
|
-
[Toggle_module_scss_1.default.checkbox]: variant === "checkbox",
|
|
103
|
-
[Toggle_module_scss_1.default.switch]: variant === "switch",
|
|
104
|
-
[Toggle_module_scss_1.default.error]: validationStatus === "error",
|
|
105
|
-
[Toggle_module_scss_1.default.warning]: validationStatus === "warning",
|
|
106
|
-
[Toggle_module_scss_1.default.valid]: validationStatus === "valid",
|
|
107
|
-
}) })), [
|
|
109
|
+
const input = (0, react_2.useMemo)(() => ((0, jsx_runtime_1.jsx)("input", { id: inputId, ref: innerRef, type: "checkbox", role: variant, checked: value, disabled: !enabled, required: required, readOnly: readOnly, "aria-readonly": readOnly, "aria-checked": indeterminate ? "mixed" : value, "aria-required": required, "aria-disabled": !enabled, onChange: onInputChange, onFocus: handleOnFocus, onBlur: handleOnBlur, className: (0, classnames_1.default)(Toggle_module_scss_1.default.resetAppearance, className, variantClassName, statusClasses) })), [
|
|
108
110
|
inputId,
|
|
109
111
|
className,
|
|
110
112
|
enabled,
|
|
@@ -116,6 +118,7 @@ exports.Toggle = (0, react_3.forwardRef)(function Toggle({ id, initialValue = ex
|
|
|
116
118
|
validationStatus,
|
|
117
119
|
value,
|
|
118
120
|
variant,
|
|
121
|
+
indeterminate,
|
|
119
122
|
]);
|
|
120
123
|
return ((0, jsx_runtime_1.jsx)(ItemWithLabel_1.ItemWithLabel, { ref: forwardedRef, id: inputId, label: label, style: style, labelPosition: labelPosition, labelWidth: labelWidth, labelBreak: labelBreak, required: required, enabled: enabled, isInputTemplateUsed: !!inputRenderer, shrinkToLabel: true, labelStyle: { pointerEvents: readOnly ? "none" : undefined }, children: inputRenderer ? ((0, jsx_runtime_1.jsxs)("label", { className: Toggle_module_scss_1.default.label, children: [(0, jsx_runtime_1.jsx)("div", { className: Toggle_module_scss_1.default.inputContainer, children: input }), inputRenderer({
|
|
121
124
|
$checked: value,
|
|
@@ -48,12 +48,13 @@ const react_1 = require("react");
|
|
|
48
48
|
const misc_1 = require("../utils/misc");
|
|
49
49
|
const useApiInterceptorContext_1 = require("./useApiInterceptorContext");
|
|
50
50
|
// This React component injects the API interceptor into the application's context
|
|
51
|
-
function ApiInterceptorProvider({ interceptor, children, apiWorker, useHashBasedRouting, waitForApiInterceptor = false }) {
|
|
51
|
+
function ApiInterceptorProvider({ interceptor, children, apiWorker, useHashBasedRouting, waitForApiInterceptor = false, }) {
|
|
52
|
+
const [forceInitialize, setForceInitialize] = (0, react_1.useState)(false);
|
|
52
53
|
const [initialized, setInitialized] = (0, react_1.useState)(!interceptor);
|
|
53
54
|
const [interceptorWorker, setInterceptorWorker] = (0, react_1.useState)(null);
|
|
54
55
|
// --- Whenever the interceptor changes, update the provider accordingly
|
|
55
56
|
(0, react_1.useEffect)(() => {
|
|
56
|
-
if (interceptor) {
|
|
57
|
+
if (interceptor || forceInitialize) {
|
|
57
58
|
setInitialized(false);
|
|
58
59
|
// --- We use "msw" to manage the API interception
|
|
59
60
|
let interceptorWorker;
|
|
@@ -61,8 +62,8 @@ function ApiInterceptorProvider({ interceptor, children, apiWorker, useHashBased
|
|
|
61
62
|
// --- Create the worker on the fly
|
|
62
63
|
if (process.env.VITE_MOCK_ENABLED) {
|
|
63
64
|
const { createApiInterceptorWorker } = yield Promise.resolve().then(() => __importStar(require("./apiInterceptorWorker")));
|
|
64
|
-
if (interceptor) {
|
|
65
|
-
interceptorWorker = yield createApiInterceptorWorker(interceptor, apiWorker);
|
|
65
|
+
if (interceptor || forceInitialize) {
|
|
66
|
+
interceptorWorker = yield createApiInterceptorWorker(interceptor || {}, apiWorker);
|
|
66
67
|
setInterceptorWorker(interceptorWorker);
|
|
67
68
|
// if the apiWorker comes from the outside, we don't handle the lifecycle here
|
|
68
69
|
if (!apiWorker) {
|
|
@@ -86,13 +87,18 @@ function ApiInterceptorProvider({ interceptor, children, apiWorker, useHashBased
|
|
|
86
87
|
}
|
|
87
88
|
};
|
|
88
89
|
}
|
|
89
|
-
}, [apiWorker, interceptor, useHashBasedRouting]);
|
|
90
|
+
}, [apiWorker, forceInitialize, interceptor, useHashBasedRouting]);
|
|
91
|
+
const doForceInitialize = (0, react_1.useCallback)(() => {
|
|
92
|
+
setForceInitialize(true);
|
|
93
|
+
}, []);
|
|
94
|
+
const isMocked = (0, react_1.useCallback)((url) => interceptor !== undefined && !!process.env.VITE_MOCK_ENABLED, [interceptor]);
|
|
90
95
|
const contextValue = (0, react_1.useMemo)(() => {
|
|
91
96
|
return {
|
|
92
97
|
interceptorWorker,
|
|
93
98
|
initialized: initialized,
|
|
94
|
-
|
|
99
|
+
forceInitialize: doForceInitialize,
|
|
100
|
+
isMocked: isMocked,
|
|
95
101
|
};
|
|
96
|
-
}, [interceptorWorker, initialized,
|
|
102
|
+
}, [interceptorWorker, initialized, doForceInitialize, isMocked]);
|
|
97
103
|
return ((0, jsx_runtime_1.jsx)(useApiInterceptorContext_1.ApiInterceptorContext.Provider, { value: contextValue, children: waitForApiInterceptor && !initialized ? null : children }));
|
|
98
104
|
}
|
|
@@ -164,6 +164,15 @@ function AppContent({ rootContainer, routerBaseName, globalProps, standalone, tr
|
|
|
164
164
|
const location = (0, react_2.useLocation)();
|
|
165
165
|
const lastHash = (0, react_1.useRef)("");
|
|
166
166
|
const [scrollForceRefresh, setScrollForceRefresh] = (0, react_1.useState)(0);
|
|
167
|
+
// useEffect(()=>{
|
|
168
|
+
// if(isWindowFocused){
|
|
169
|
+
// if ("serviceWorker" in navigator) {
|
|
170
|
+
// // Manually Activate the MSW again
|
|
171
|
+
// // console.log("REACTIVATE MSW");
|
|
172
|
+
// navigator.serviceWorker.controller?.postMessage("MOCK_ACTIVATE");
|
|
173
|
+
// }
|
|
174
|
+
// }
|
|
175
|
+
// }, [isWindowFocused]);
|
|
167
176
|
// --- Listen to location change using useEffect with location as dependency
|
|
168
177
|
// https://jasonwatmore.com/react-router-v6-listen-to-location-route-change-without-history-listen
|
|
169
178
|
// https://dev.to/mindactuate/scroll-to-anchor-element-with-react-router-v6-38op
|
|
@@ -160,7 +160,7 @@ exports.RootThemeDefinition = {
|
|
|
160
160
|
"fontSize-medium": "1.25rem",
|
|
161
161
|
"fontSize-normal": "1rem",
|
|
162
162
|
"fontSize-small": "0.875rem",
|
|
163
|
-
"fontSize-code": "0.
|
|
163
|
+
"fontSize-code": "0.85rem",
|
|
164
164
|
"fontSize-smaller": "0.75rem",
|
|
165
165
|
"fontSize-tiny": "0.625rem",
|
|
166
166
|
// --- The default font size
|
|
@@ -47,7 +47,7 @@ declare type ApiInterceptorDefinition = {
|
|
|
47
47
|
auth?: AuthDefinition;
|
|
48
48
|
};
|
|
49
49
|
|
|
50
|
-
declare function ApiInterceptorProvider({ interceptor, children, apiWorker, useHashBasedRouting, waitForApiInterceptor }: {
|
|
50
|
+
declare function ApiInterceptorProvider({ interceptor, children, apiWorker, useHashBasedRouting, waitForApiInterceptor, }: {
|
|
51
51
|
interceptor?: ApiInterceptorDefinition;
|
|
52
52
|
children: ReactNode;
|
|
53
53
|
apiWorker?: SetupWorker;
|
|
@@ -739,6 +739,7 @@ declare type GlobalProps = Record<string, any>;
|
|
|
739
739
|
declare interface IApiInterceptorContext {
|
|
740
740
|
isMocked: (url: string) => boolean;
|
|
741
741
|
initialized: boolean;
|
|
742
|
+
forceInitialize: () => void;
|
|
742
743
|
interceptorWorker: SetupWorker | null;
|
|
743
744
|
}
|
|
744
745
|
|