xmlui 0.9.38 → 0.9.40
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-BWeLEiFb.mjs → apiInterceptorWorker-B8TTzBdN.mjs} +1 -1
- package/dist/lib/{core-XLM8cuFP.mjs → core-CNYDxpbi.mjs} +1 -1
- package/dist/lib/{index-D7kFBKWN.mjs → index-DGZ1xviB.mjs} +345 -270
- package/dist/lib/index.css +248 -551
- package/dist/lib/language-server-web-worker.mjs +1 -1
- package/dist/lib/language-server.mjs +1 -1
- package/dist/lib/{server-common-B1bqw3bO.mjs → server-common-Cb_e1fYU.mjs} +2508 -2575
- package/dist/lib/xmlui.mjs +1 -1
- package/dist/metadata/style.css +248 -551
- package/dist/metadata/xmlui-metadata.mjs +212 -188
- package/dist/metadata/xmlui-metadata.umd.js +212 -188
- package/dist/scripts/package.json +5 -5
- package/dist/scripts/src/components/CodeBlock/CodeBlockNative.js +24 -1
- package/dist/scripts/src/components/CodeBlock/highlight-code.js +21 -1
- package/dist/scripts/src/components/ComponentProvider.js +9 -9
- package/dist/scripts/src/components/DatePicker/DatePicker.js +1 -0
- package/dist/scripts/src/components/DatePicker/DatePickerNative.js +25 -22
- package/dist/scripts/src/components/Icon/AdmonitionDanger.js +10 -0
- package/dist/scripts/src/components/Icon/AdmonitionInfo.js +10 -0
- package/dist/scripts/src/components/Icon/AdmonitionNote.js +10 -0
- package/dist/scripts/src/components/Icon/AdmonitionTip.js +10 -0
- package/dist/scripts/src/components/Icon/AdmonitionWarning.js +10 -0
- package/dist/scripts/src/components/IconProvider.js +10 -0
- package/dist/scripts/src/components/Markdown/MarkdownNative.js +21 -10
- package/dist/scripts/src/components/NavLink/NavLinkNative.js +9 -19
- package/dist/scripts/src/components/NestedApp/NestedAppNative.js +8 -6
- package/dist/scripts/src/components/Select/Select.js +0 -1
- package/dist/scripts/src/components-core/XmluiCodeHighlighter.js +4 -4
- package/dist/scripts/src/components-core/rendering/AppWrapper.js +2 -5
- package/dist/standalone/xmlui-standalone.umd.js +3922 -8446
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xmlui",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.40",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"start-test-bed": "cd src/testing/infrastructure && xmlui start",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"prepare-docs-data": "npm run build:xmlui-metadata",
|
|
22
22
|
"generate-all-docs": "npm run build:xmlui-metadata && npm run build:ext-meta && npm run generate-docs",
|
|
23
23
|
"export-themes": "npm run prepare-docs-data && node scripts/generate-docs/create-theme-files.mjs",
|
|
24
|
-
"
|
|
24
|
+
"gen:langserver-metadata": "node scripts/get-langserver-metadata.mjs > src/language-server/xmlui-metadata-generated.mjs"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@eslint-community/regexpp": "4.10.0",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"react": "18.2.0",
|
|
74
74
|
"react-currency-input-field": "3.6.9",
|
|
75
75
|
"react-datepicker": "4.25.0",
|
|
76
|
-
"react-day-picker": "9.
|
|
76
|
+
"react-day-picker": "9.7.0",
|
|
77
77
|
"react-dom": "18.2.0",
|
|
78
78
|
"react-dropzone": "14.2.3",
|
|
79
79
|
"react-helmet-async": "1.3.0",
|
|
@@ -213,8 +213,8 @@
|
|
|
213
213
|
"import": "./src/components-core/theming/_themes.scss"
|
|
214
214
|
},
|
|
215
215
|
"./vite-xmlui-plugin": {
|
|
216
|
-
"import": "./
|
|
217
|
-
"require": "./
|
|
216
|
+
"import": "./bin/vite-xmlui-plugin.ts",
|
|
217
|
+
"require": "./bin/vite-xmlui-plugin.ts"
|
|
218
218
|
},
|
|
219
219
|
"./language-server": {
|
|
220
220
|
"import": "./src/language-server/server.ts",
|
|
@@ -4,6 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.CodeBlock = CodeBlock;
|
|
7
|
+
exports.isBrowser = isBrowser;
|
|
8
|
+
exports.decodeValue = decodeValue;
|
|
7
9
|
exports.markdownCodeBlockParser = markdownCodeBlockParser;
|
|
8
10
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
9
11
|
const CodeBlock_module_scss_1 = __importDefault(require("./CodeBlock.module.scss"));
|
|
@@ -24,6 +26,27 @@ function CodeBlock({ children, meta, textToCopy, style }) {
|
|
|
24
26
|
react_hot_toast_1.default.success("Code copied!");
|
|
25
27
|
} }) })] })] }));
|
|
26
28
|
}
|
|
29
|
+
/*
|
|
30
|
+
* Check if global object window is defined
|
|
31
|
+
*/
|
|
32
|
+
function isBrowser() {
|
|
33
|
+
return typeof window !== 'undefined';
|
|
34
|
+
}
|
|
35
|
+
/*
|
|
36
|
+
* Decode base64 value, returns string
|
|
37
|
+
* @Params: string
|
|
38
|
+
*/
|
|
39
|
+
function decodeValue(value) {
|
|
40
|
+
if (!value) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
const valueToString = value.toString();
|
|
44
|
+
if (isBrowser()) {
|
|
45
|
+
return window.btoa(valueToString);
|
|
46
|
+
}
|
|
47
|
+
const buff = Buffer.from(valueToString, 'ascii');
|
|
48
|
+
return buff.toString('base64');
|
|
49
|
+
}
|
|
27
50
|
function markdownCodeBlockParser() {
|
|
28
51
|
return function transformer(tree) {
|
|
29
52
|
(0, unist_util_visit_1.visit)(tree, "code", visitor);
|
|
@@ -56,7 +79,7 @@ function markdownCodeBlockParser() {
|
|
|
56
79
|
if (item.indexOf("=") === -1) {
|
|
57
80
|
if (item.startsWith("/") && item.endsWith("/")) {
|
|
58
81
|
const unparsedSubstrings = acc[highlight_code_1.CodeHighlighterMetaKeys.highlightSubstrings.data];
|
|
59
|
-
const newItemBase64 =
|
|
82
|
+
const newItemBase64 = decodeValue(item.substring(1, item.length - 1));
|
|
60
83
|
if (!unparsedSubstrings) {
|
|
61
84
|
acc[highlight_code_1.CodeHighlighterMetaKeys.highlightSubstrings.data] = newItemBase64;
|
|
62
85
|
}
|
|
@@ -12,10 +12,27 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
exports.CodeHighlighterMetaKeysData = exports.CodeHighlighterMetaKeys = void 0;
|
|
15
|
+
exports.encodeValue = encodeValue;
|
|
15
16
|
exports.parseMetaAndHighlightCode = parseMetaAndHighlightCode;
|
|
17
|
+
exports.isCodeHighlighter = isCodeHighlighter;
|
|
16
18
|
const react_1 = require("react");
|
|
17
19
|
const highlightRowsClass = "codeBlockHighlightRow";
|
|
18
20
|
const highlightSubstringsClass = "codeBlockHighlightString";
|
|
21
|
+
/*
|
|
22
|
+
* Encode string, returns base64 value
|
|
23
|
+
* @Params: string
|
|
24
|
+
*/
|
|
25
|
+
function encodeValue(value) {
|
|
26
|
+
if (!value) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
const valueToString = value.toString();
|
|
30
|
+
if (typeof window !== 'undefined') {
|
|
31
|
+
return window.atob(valueToString);
|
|
32
|
+
}
|
|
33
|
+
const buff = Buffer.from(valueToString, 'base64');
|
|
34
|
+
return buff.toString('ascii');
|
|
35
|
+
}
|
|
19
36
|
/**
|
|
20
37
|
* This function handles two things:
|
|
21
38
|
* 1. The extraction of meta information from code blocks and exposing them as data-meta attributes
|
|
@@ -172,7 +189,7 @@ function parseSubstringHighlights(code, str) {
|
|
|
172
189
|
return [];
|
|
173
190
|
return str
|
|
174
191
|
.split(" ")
|
|
175
|
-
.map((item) =>
|
|
192
|
+
.map((item) => encodeValue(item))
|
|
176
193
|
.reduce((acc, item) => acc.concat(findAllNonOverlappingSubstrings(code, item)), []);
|
|
177
194
|
function findAllNonOverlappingSubstrings(str, code) {
|
|
178
195
|
const result = [];
|
|
@@ -192,6 +209,9 @@ function parseSubstringHighlights(code, str) {
|
|
|
192
209
|
return result;
|
|
193
210
|
}
|
|
194
211
|
}
|
|
212
|
+
function isCodeHighlighter(obj) {
|
|
213
|
+
return obj && obj.highlight && typeof obj.highlight === "function" && obj.availableLangs;
|
|
214
|
+
}
|
|
195
215
|
exports.CodeHighlighterMetaKeys = {
|
|
196
216
|
language: { data: "data-language", prop: "language" },
|
|
197
217
|
copy: { data: "data-copy", prop: "copy" },
|
|
@@ -377,17 +377,19 @@ class ComponentRegistry {
|
|
|
377
377
|
this.registerCoreComponent(Tabs_1.tabsComponentRenderer);
|
|
378
378
|
this.registerCoreComponent(Bookmark_1.bookmarkComponentRenderer);
|
|
379
379
|
this.registerCoreComponent(TableOfContents_1.tableOfContentsRenderer);
|
|
380
|
-
this.registerCoreComponent(Breakout_1.breakoutComponentRenderer);
|
|
381
380
|
this.registerCoreComponent(CodeBlock_1.codeBlockComponentRenderer);
|
|
382
|
-
|
|
381
|
+
// --- Nested app and related components
|
|
382
|
+
this.registerCoreComponent(NestedApp_1.nestedAppComponentRenderer);
|
|
383
|
+
// --- New Bootstrap-inspired components
|
|
384
|
+
this.registerCoreComponent(Carousel_1.carouselComponentRenderer);
|
|
385
|
+
this.registerCoreComponent(Accordion_1.accordionComponentRenderer);
|
|
386
|
+
this.registerCoreComponent(Slider_1.sliderComponentRenderer);
|
|
387
|
+
this.registerCoreComponent(Backdrop_1.backdropComponentRenderer);
|
|
388
|
+
}
|
|
389
|
+
this.registerCoreComponent(Breakout_1.breakoutComponentRenderer);
|
|
383
390
|
this.registerCoreComponent(Theme_1.themeComponentRenderer);
|
|
384
391
|
this.registerCoreComponent(AppState_1.appStateComponentRenderer);
|
|
385
392
|
this.registerCoreComponent(APICall_2.apiCallRenderer);
|
|
386
|
-
// --- New Bootstrap-inspired components
|
|
387
|
-
this.registerCoreComponent(Carousel_1.carouselComponentRenderer);
|
|
388
|
-
this.registerCoreComponent(Accordion_1.accordionComponentRenderer);
|
|
389
|
-
this.registerCoreComponent(Slider_1.sliderComponentRenderer);
|
|
390
|
-
this.registerCoreComponent(Backdrop_1.backdropComponentRenderer);
|
|
391
393
|
this.registerCoreComponent(HtmlTags_1.htmlATagRenderer);
|
|
392
394
|
this.registerCoreComponent(HtmlTags_1.htmlAbbrTagRenderer);
|
|
393
395
|
this.registerCoreComponent(HtmlTags_1.htmlAddressTagRenderer);
|
|
@@ -488,8 +490,6 @@ class ComponentRegistry {
|
|
|
488
490
|
this.registerCoreComponent(HtmlTags_1.htmlVarTagRenderer);
|
|
489
491
|
this.registerCoreComponent(HtmlTags_1.htmlVideoTagRenderer);
|
|
490
492
|
this.registerCoreComponent(HtmlTags_1.htmlWbrTagRenderer);
|
|
491
|
-
// --- Nested app and related components
|
|
492
|
-
this.registerCoreComponent(NestedApp_1.nestedAppComponentRenderer);
|
|
493
493
|
this.registerActionFn(APICall_1.apiAction);
|
|
494
494
|
this.registerActionFn(FileDownloadAction_1.downloadAction);
|
|
495
495
|
this.registerActionFn(FileUploadAction_1.uploadAction);
|
|
@@ -111,6 +111,7 @@ exports.DatePickerMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
111
111
|
[`boxShadow-menu-${COMP}`]: "$boxShadow-md",
|
|
112
112
|
[`borderRadius-menu-${COMP}`]: "$borderRadius",
|
|
113
113
|
[`textColor-value-${COMP}`]: "$textColor-primary",
|
|
114
|
+
[`borderColor-selectedItem-${COMP}`]: "$color-primary-200",
|
|
114
115
|
[`backgroundColor-menu-${COMP}`]: "$color-surface-50",
|
|
115
116
|
[`backgroundColor-item-${COMP}--hover`]: "$color-surface-100",
|
|
116
117
|
[`backgroundColor-item-${COMP}--active`]: "$color-surface-200",
|
|
@@ -39,6 +39,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
39
39
|
exports.DatePicker = exports.defaultProps = exports.dateFormats = exports.WeekDays = exports.DatePickerModeValues = void 0;
|
|
40
40
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
41
41
|
const react_1 = require("react");
|
|
42
|
+
const react_2 = require("react");
|
|
42
43
|
const react_day_picker_1 = require("react-day-picker");
|
|
43
44
|
const date_fns_1 = require("date-fns");
|
|
44
45
|
const ReactDropdownMenu = __importStar(require("@radix-ui/react-dropdown-menu"));
|
|
@@ -49,7 +50,7 @@ const ThemeContext_1 = require("../../components-core/theming/ThemeContext");
|
|
|
49
50
|
const constants_1 = require("../../components-core/constants");
|
|
50
51
|
const misc_1 = require("../../components-core/utils/misc");
|
|
51
52
|
const InputAdornment_1 = require("../Input/InputAdornment");
|
|
52
|
-
require("
|
|
53
|
+
const ItemWithLabel_1 = require("../FormItem/ItemWithLabel");
|
|
53
54
|
exports.DatePickerModeValues = ["single", "range"];
|
|
54
55
|
var WeekDays;
|
|
55
56
|
(function (WeekDays) {
|
|
@@ -81,13 +82,15 @@ exports.defaultProps = {
|
|
|
81
82
|
weekStartsOn: WeekDays.Sunday,
|
|
82
83
|
disabledDates: [],
|
|
83
84
|
};
|
|
84
|
-
exports.DatePicker = (0,
|
|
85
|
+
exports.DatePicker = (0, react_2.forwardRef)(function DatePicker({ id, initialValue, value, mode = exports.defaultProps.mode, enabled = exports.defaultProps.enabled, placeholder, updateState = constants_1.noop, validationStatus = exports.defaultProps.validationStatus, onDidChange = constants_1.noop, onFocus = constants_1.noop, onBlur = constants_1.noop, dateFormat = exports.defaultProps.dateFormat, showWeekNumber = exports.defaultProps.showWeekNumber, weekStartsOn = exports.defaultProps.weekStartsOn, fromDate, toDate, disabledDates = exports.defaultProps.disabledDates, style, registerComponentApi, inline = exports.defaultProps.inline, startText, startIcon, endText, endIcon, label, labelPosition, labelWidth, labelBreak, inProgress, inProgressNotificationMessage, readOnly, required, }, forwardedRef) {
|
|
85
86
|
const _weekStartsOn = weekStartsOn >= 0 && weekStartsOn <= 6 ? weekStartsOn : WeekDays.Sunday;
|
|
86
|
-
const [isButtonFocused, setIsButtonFocused] = (0,
|
|
87
|
-
const [isMenuFocused, setIsMenuFocused] = (0,
|
|
88
|
-
const referenceElement = (0,
|
|
87
|
+
const [isButtonFocused, setIsButtonFocused] = (0, react_2.useState)(false);
|
|
88
|
+
const [isMenuFocused, setIsMenuFocused] = (0, react_2.useState)(false);
|
|
89
|
+
const referenceElement = (0, react_2.useRef)(null);
|
|
89
90
|
const ref = forwardedRef ? (0, react_compose_refs_1.composeRefs)(referenceElement, forwardedRef) : referenceElement;
|
|
90
|
-
const
|
|
91
|
+
const generatedId = (0, react_1.useId)();
|
|
92
|
+
const inputId = id || generatedId;
|
|
93
|
+
const selected = (0, react_2.useMemo)(() => {
|
|
91
94
|
if (mode === "single" && typeof value === "string") {
|
|
92
95
|
return parseISODate(value) || parseDate(value);
|
|
93
96
|
}
|
|
@@ -99,21 +102,21 @@ exports.DatePicker = (0, react_1.forwardRef)(function DatePicker({ id, initialVa
|
|
|
99
102
|
}
|
|
100
103
|
return undefined;
|
|
101
104
|
}, [value, mode]);
|
|
102
|
-
(0,
|
|
105
|
+
(0, react_2.useEffect)(() => {
|
|
103
106
|
if (!exports.dateFormats.includes(dateFormat)) {
|
|
104
107
|
throw new Error(`Invalid dateFormat: ${dateFormat}. Supported formats are: ${exports.dateFormats.join(", ")}`);
|
|
105
108
|
}
|
|
106
109
|
}, [dateFormat]);
|
|
107
|
-
const startDate = (0,
|
|
110
|
+
const startDate = (0, react_2.useMemo)(() => {
|
|
108
111
|
return fromDate ? (0, date_fns_1.parse)(fromDate, dateFormat, new Date()) : undefined;
|
|
109
112
|
}, [fromDate, dateFormat]);
|
|
110
|
-
const endDate = (0,
|
|
113
|
+
const endDate = (0, react_2.useMemo)(() => {
|
|
111
114
|
return toDate ? (0, date_fns_1.parse)(toDate, dateFormat, new Date()) : undefined;
|
|
112
115
|
}, [toDate, dateFormat]);
|
|
113
|
-
const disabled = (0,
|
|
116
|
+
const disabled = (0, react_2.useMemo)(() => {
|
|
114
117
|
return disabledDates === null || disabledDates === void 0 ? void 0 : disabledDates.map((date) => (0, date_fns_1.parse)(date, dateFormat, new Date()));
|
|
115
118
|
}, [disabledDates, dateFormat]);
|
|
116
|
-
const [open, setOpen] = (0,
|
|
119
|
+
const [open, setOpen] = (0, react_2.useState)(false);
|
|
117
120
|
const { root } = (0, ThemeContext_1.useTheme)();
|
|
118
121
|
const handleOnButtonFocus = () => {
|
|
119
122
|
setIsButtonFocused(true);
|
|
@@ -128,7 +131,7 @@ exports.DatePicker = (0, react_1.forwardRef)(function DatePicker({ id, initialVa
|
|
|
128
131
|
setIsMenuFocused(false);
|
|
129
132
|
};
|
|
130
133
|
// Register component API for external interactions
|
|
131
|
-
const focus = (0,
|
|
134
|
+
const focus = (0, react_2.useCallback)(() => {
|
|
132
135
|
var _a;
|
|
133
136
|
(_a = referenceElement === null || referenceElement === void 0 ? void 0 : referenceElement.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
134
137
|
}, [referenceElement === null || referenceElement === void 0 ? void 0 : referenceElement.current]);
|
|
@@ -136,13 +139,13 @@ exports.DatePicker = (0, react_1.forwardRef)(function DatePicker({ id, initialVa
|
|
|
136
139
|
const parsedDate = parseDate(newValue);
|
|
137
140
|
handleSelect(parsedDate);
|
|
138
141
|
});
|
|
139
|
-
(0,
|
|
142
|
+
(0, react_2.useEffect)(() => {
|
|
140
143
|
registerComponentApi === null || registerComponentApi === void 0 ? void 0 : registerComponentApi({
|
|
141
144
|
focus,
|
|
142
145
|
setValue,
|
|
143
146
|
});
|
|
144
147
|
}, [focus, registerComponentApi, setValue]);
|
|
145
|
-
(0,
|
|
148
|
+
(0, react_2.useEffect)(() => {
|
|
146
149
|
if (!isButtonFocused && !isMenuFocused) {
|
|
147
150
|
onBlur === null || onBlur === void 0 ? void 0 : onBlur();
|
|
148
151
|
}
|
|
@@ -150,10 +153,10 @@ exports.DatePicker = (0, react_1.forwardRef)(function DatePicker({ id, initialVa
|
|
|
150
153
|
onFocus === null || onFocus === void 0 ? void 0 : onFocus();
|
|
151
154
|
}
|
|
152
155
|
}, [isButtonFocused, isMenuFocused, onFocus, onBlur]);
|
|
153
|
-
(0,
|
|
156
|
+
(0, react_2.useEffect)(() => {
|
|
154
157
|
updateState({ value: initialValue }, { initial: true });
|
|
155
158
|
}, [initialValue, updateState]);
|
|
156
|
-
const handleSelect = (0,
|
|
159
|
+
const handleSelect = (0, react_2.useCallback)((dateOrRange) => {
|
|
157
160
|
if (!dateOrRange) {
|
|
158
161
|
updateState({ value: undefined });
|
|
159
162
|
onDidChange("");
|
|
@@ -177,12 +180,12 @@ exports.DatePicker = (0, react_1.forwardRef)(function DatePicker({ id, initialVa
|
|
|
177
180
|
setOpen(false);
|
|
178
181
|
}
|
|
179
182
|
}, [onDidChange, updateState, mode, dateFormat]);
|
|
180
|
-
return
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
183
|
+
return ((0, jsx_runtime_1.jsx)(ItemWithLabel_1.ItemWithLabel, { id: inputId, labelPosition: labelPosition, label: label, labelWidth: labelWidth, labelBreak: labelBreak, required: required, enabled: enabled, onFocus: onFocus, onBlur: onBlur, style: style, children: inline ? ((0, jsx_runtime_1.jsx)("div", { className: DatePicker_module_scss_1.default.inlinePickerMenu, children: (0, jsx_runtime_1.jsx)(react_day_picker_1.DayPicker, { required: undefined, captionLayout: "dropdown", fixedWeeks: true, startMonth: startDate, endMonth: endDate, disabled: disabled, weekStartsOn: _weekStartsOn, showWeekNumber: showWeekNumber, showOutsideDays: true, classNames: DatePicker_module_scss_1.default, mode: mode === "single" ? "single" : "range", selected: selected, onSelect: handleSelect, autoFocus: !inline, numberOfMonths: mode === "range" ? 2 : 1 }) })) : ((0, jsx_runtime_1.jsxs)(ReactDropdownMenu.Root, { open: open, onOpenChange: setOpen, modal: false, children: [(0, jsx_runtime_1.jsx)(ReactDropdownMenu.Trigger, { asChild: true, children: (0, jsx_runtime_1.jsxs)("button", { disabled: !enabled, id: id, style: style, className: (0, classnames_1.default)(DatePicker_module_scss_1.default.datePicker, {
|
|
184
|
+
[DatePicker_module_scss_1.default.disabled]: !enabled,
|
|
185
|
+
[DatePicker_module_scss_1.default.error]: validationStatus === "error",
|
|
186
|
+
[DatePicker_module_scss_1.default.warning]: validationStatus === "warning",
|
|
187
|
+
[DatePicker_module_scss_1.default.valid]: validationStatus === "valid",
|
|
188
|
+
}), onFocus: handleOnButtonFocus, onBlur: handleOnButtonBlur, children: [(0, jsx_runtime_1.jsx)(InputAdornment_1.Adornment, { text: startText, iconName: startIcon, className: DatePicker_module_scss_1.default.adornment }), (0, jsx_runtime_1.jsx)("div", { className: DatePicker_module_scss_1.default.datePickerValue, children: mode === "single" && selected ? ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, date_fns_1.format)(selected, dateFormat) })) : mode === "range" && typeof selected === "object" && selected.from ? (selected.to ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, date_fns_1.format)(selected.from, dateFormat), " - ", (0, date_fns_1.format)(selected.to, dateFormat)] })) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, date_fns_1.format)(selected.from, dateFormat) }))) : placeholder ? ((0, jsx_runtime_1.jsx)("span", { className: DatePicker_module_scss_1.default.placeholder, children: placeholder })) : ((0, jsx_runtime_1.jsx)("span", { children: "\u00A0" })) }), (0, jsx_runtime_1.jsx)(InputAdornment_1.Adornment, { text: endText, iconName: endIcon, className: DatePicker_module_scss_1.default.adornment })] }) }), (0, jsx_runtime_1.jsx)(ReactDropdownMenu.Portal, { container: root, children: (0, jsx_runtime_1.jsx)(ReactDropdownMenu.Content, { align: "start", sideOffset: 5, className: DatePicker_module_scss_1.default.datePickerMenu, onFocus: handleOnMenuFocus, onBlur: handleOnMenuBlur, onInteractOutside: handleOnMenuBlur, children: (0, jsx_runtime_1.jsx)(react_day_picker_1.DayPicker, { required: undefined, animate: true, fixedWeeks: true, classNames: DatePicker_module_scss_1.default, captionLayout: "dropdown", startMonth: startDate, endMonth: endDate, disabled: disabled, weekStartsOn: _weekStartsOn, showWeekNumber: showWeekNumber, showOutsideDays: true, mode: mode === "single" ? "single" : "range", selected: selected, onSelect: handleSelect, autoFocus: !inline, numberOfMonths: mode === "range" ? 2 : 1 }) }) })] })) }));
|
|
186
189
|
});
|
|
187
190
|
const isoRegex = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z$/;
|
|
188
191
|
const parseISODate = (dateString) => {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.AdmonitionDangerIcon = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const admonition_danger_svg_react_1 = __importDefault(require("./svg/admonition_danger.svg?react"));
|
|
9
|
+
const AdmonitionDangerIcon = (props) => (0, jsx_runtime_1.jsx)(admonition_danger_svg_react_1.default, Object.assign({}, props));
|
|
10
|
+
exports.AdmonitionDangerIcon = AdmonitionDangerIcon;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.AdmonitionInfoIcon = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const admonition_info_svg_react_1 = __importDefault(require("./svg/admonition_info.svg?react"));
|
|
9
|
+
const AdmonitionInfoIcon = (props) => (0, jsx_runtime_1.jsx)(admonition_info_svg_react_1.default, Object.assign({}, props));
|
|
10
|
+
exports.AdmonitionInfoIcon = AdmonitionInfoIcon;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.AdmonitionNoteIcon = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const admonition_note_svg_react_1 = __importDefault(require("./svg/admonition_note.svg?react"));
|
|
9
|
+
const AdmonitionNoteIcon = (props) => (0, jsx_runtime_1.jsx)(admonition_note_svg_react_1.default, Object.assign({}, props));
|
|
10
|
+
exports.AdmonitionNoteIcon = AdmonitionNoteIcon;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.AdmonitionTipIcon = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const admonition_tip_svg_react_1 = __importDefault(require("./svg/admonition_tip.svg?react"));
|
|
9
|
+
const AdmonitionTipIcon = (props) => (0, jsx_runtime_1.jsx)(admonition_tip_svg_react_1.default, Object.assign({}, props));
|
|
10
|
+
exports.AdmonitionTipIcon = AdmonitionTipIcon;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.AdmonitionWarningIcon = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const admonition_warning_svg_react_1 = __importDefault(require("./svg/admonition_warning.svg?react"));
|
|
9
|
+
const AdmonitionWarningIcon = (props) => (0, jsx_runtime_1.jsx)(admonition_warning_svg_react_1.default, Object.assign({}, props));
|
|
10
|
+
exports.AdmonitionWarningIcon = AdmonitionWarningIcon;
|
|
@@ -83,6 +83,11 @@ const MoonIcon_1 = require("./Icon/MoonIcon");
|
|
|
83
83
|
const StarsIcon_1 = require("./Icon/StarsIcon");
|
|
84
84
|
const LightToDark_1 = require("./Icon/LightToDark");
|
|
85
85
|
const DarkToLightIcon_1 = require("./Icon/DarkToLightIcon");
|
|
86
|
+
const AdmonitionInfo_1 = require("./Icon/AdmonitionInfo");
|
|
87
|
+
const AdmonitionWarning_1 = require("./Icon/AdmonitionWarning");
|
|
88
|
+
const AdmonitionDanger_1 = require("./Icon/AdmonitionDanger");
|
|
89
|
+
const AdmonitionNote_1 = require("./Icon/AdmonitionNote");
|
|
90
|
+
const AdmonitionTip_1 = require("./Icon/AdmonitionTip");
|
|
86
91
|
const pool = new Map();
|
|
87
92
|
function registerIconRenderer(name, renderer) {
|
|
88
93
|
if (typeof name === "object") {
|
|
@@ -212,6 +217,11 @@ registerIconRenderer("trending-level", (props) => (0, jsx_runtime_1.jsx)(Trendin
|
|
|
212
217
|
registerIconRenderer("sortasc", (props) => (0, jsx_runtime_1.jsx)(SortAscendingIcon_1.SortAscendingIcon, Object.assign({}, props)));
|
|
213
218
|
registerIconRenderer("sortdesc", (props) => (0, jsx_runtime_1.jsx)(SortDescendingIcon_1.SortDescendingIcon, Object.assign({}, props)));
|
|
214
219
|
registerIconRenderer("nosort", (props) => (0, jsx_runtime_1.jsx)(NoSortIcon_1.NoSortIcon, Object.assign({}, props)));
|
|
220
|
+
registerIconRenderer("admonition_info", (props) => (0, jsx_runtime_1.jsx)(AdmonitionInfo_1.AdmonitionInfoIcon, Object.assign({}, props)));
|
|
221
|
+
registerIconRenderer("admonition_warning", (props) => (0, jsx_runtime_1.jsx)(AdmonitionWarning_1.AdmonitionWarningIcon, Object.assign({}, props)));
|
|
222
|
+
registerIconRenderer("admonition_danger", (props) => (0, jsx_runtime_1.jsx)(AdmonitionDanger_1.AdmonitionDangerIcon, Object.assign({}, props)));
|
|
223
|
+
registerIconRenderer("admonition_note", (props) => (0, jsx_runtime_1.jsx)(AdmonitionNote_1.AdmonitionNoteIcon, Object.assign({}, props)));
|
|
224
|
+
registerIconRenderer("admonition_tip", (props) => (0, jsx_runtime_1.jsx)(AdmonitionTip_1.AdmonitionTipIcon, Object.assign({}, props)));
|
|
215
225
|
// --- IDE extras (temporary)
|
|
216
226
|
registerIconRenderer("arrowdown", (props) => (0, jsx_runtime_1.jsx)(bs_1.BsArrowDownShort, Object.assign({}, props)));
|
|
217
227
|
registerIconRenderer("square", (props) => (0, jsx_runtime_1.jsx)(bs_1.BsSquare, Object.assign({}, props)));
|
|
@@ -30,16 +30,28 @@ const Toggle_1 = require("../Toggle/Toggle");
|
|
|
30
30
|
const NestedAppNative_1 = require("../NestedApp/NestedAppNative");
|
|
31
31
|
const highlight_code_1 = require("../CodeBlock/highlight-code");
|
|
32
32
|
const ThemeContext_1 = require("../../components-core/theming/ThemeContext");
|
|
33
|
+
const AppContext_1 = require("../../components-core/AppContext");
|
|
33
34
|
const CodeBlockNative_1 = require("../CodeBlock/CodeBlockNative");
|
|
34
35
|
const classnames_1 = __importDefault(require("classnames"));
|
|
36
|
+
const IconNative_1 = __importDefault(require("../Icon/IconNative"));
|
|
35
37
|
function PreTagComponent({ id, children, codeHighlighter }) {
|
|
36
38
|
// TEMP: After ironing out theming for syntax highlighting, this should be removed
|
|
37
39
|
const { activeThemeTone } = (0, ThemeContext_1.useTheme)();
|
|
40
|
+
const { appGlobals } = (0, AppContext_1.useAppContext)();
|
|
41
|
+
let _codeHighlighter = null;
|
|
42
|
+
if (codeHighlighter) {
|
|
43
|
+
_codeHighlighter = codeHighlighter;
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
_codeHighlighter = (0, highlight_code_1.isCodeHighlighter)(appGlobals.codeHighlighter)
|
|
47
|
+
? appGlobals.codeHighlighter
|
|
48
|
+
: null;
|
|
49
|
+
}
|
|
38
50
|
const defaultCodefence = ((0, jsx_runtime_1.jsx)(CodeBlockNative_1.CodeBlock, { children: (0, jsx_runtime_1.jsx)(TextNative_1.Text, { uid: id, variant: "codefence", children: children }) }));
|
|
39
|
-
if (!
|
|
51
|
+
if (!_codeHighlighter) {
|
|
40
52
|
return defaultCodefence;
|
|
41
53
|
}
|
|
42
|
-
const highlighterResult = (0, highlight_code_1.parseMetaAndHighlightCode)(children,
|
|
54
|
+
const highlighterResult = (0, highlight_code_1.parseMetaAndHighlightCode)(children, _codeHighlighter, activeThemeTone);
|
|
43
55
|
if (!highlighterResult) {
|
|
44
56
|
return defaultCodefence;
|
|
45
57
|
}
|
|
@@ -190,13 +202,12 @@ const Blockquote = ({ children, style }) => {
|
|
|
190
202
|
const isAdmonition = !!match;
|
|
191
203
|
if (isAdmonition && match && match[1]) {
|
|
192
204
|
const type = match[1].toLowerCase();
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
tip: "💬",
|
|
205
|
+
const iconMap = {
|
|
206
|
+
info: (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "admonition_info" }),
|
|
207
|
+
warning: (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "admonition_warning" }),
|
|
208
|
+
danger: (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "admonition_danger" }),
|
|
209
|
+
note: (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "admonition_note" }),
|
|
210
|
+
tip: (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "admonition_tip" }),
|
|
200
211
|
};
|
|
201
212
|
// Process children to remove the admonition marker
|
|
202
213
|
const processNode = (node) => {
|
|
@@ -229,7 +240,7 @@ const Blockquote = ({ children, style }) => {
|
|
|
229
240
|
[Markdown_module_scss_1.default.danger]: type === "danger",
|
|
230
241
|
[Markdown_module_scss_1.default.note]: type === "note",
|
|
231
242
|
[Markdown_module_scss_1.default.tip]: type === "tip",
|
|
232
|
-
}), style: style, children: (0, jsx_runtime_1.jsxs)("div", { className: Markdown_module_scss_1.default.admonitionContainer, children: [(0, jsx_runtime_1.jsx)("div", { className: `${Markdown_module_scss_1.default.admonitionIcon} ${Markdown_module_scss_1.default[type] || ""}`, children:
|
|
243
|
+
}), style: style, children: (0, jsx_runtime_1.jsxs)("div", { className: Markdown_module_scss_1.default.admonitionContainer, children: [(0, jsx_runtime_1.jsx)("div", { className: `${Markdown_module_scss_1.default.admonitionIcon} ${Markdown_module_scss_1.default[type] || ""}`, children: iconMap[type] || (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "admonition_info" }) }), (0, jsx_runtime_1.jsx)("div", { className: Markdown_module_scss_1.default.admonitionContent, children: processedChildren })] }) }));
|
|
233
244
|
}
|
|
234
245
|
return ((0, jsx_runtime_1.jsx)("blockquote", { className: Markdown_module_scss_1.default.blockquote, style: style, children: (0, jsx_runtime_1.jsx)("div", { className: Markdown_module_scss_1.default.blockquoteContainer, children: children }) }));
|
|
235
246
|
};
|
|
@@ -27,19 +27,9 @@ const NavPanelNative_1 = require("../NavPanel/NavPanelNative");
|
|
|
27
27
|
exports.NavLink = (0, react_1.forwardRef)(function NavLink(_a, ref) {
|
|
28
28
|
var {
|
|
29
29
|
/* eslint-disable react/prop-types */
|
|
30
|
-
uid, children, disabled, to, sx = {}, displayActive = true,
|
|
30
|
+
uid, children, disabled, to, sx = {}, displayActive = true, vertical, style, onClick, icon, forceActive } = _a, rest = __rest(_a, ["uid", "children", "disabled", "to", "sx", "displayActive", "vertical", "style", "onClick", "icon", "forceActive"]);
|
|
31
31
|
const appLayoutContext = (0, AppLayoutContext_1.useAppLayoutContext)();
|
|
32
32
|
const navPanelContext = (0, react_1.useContext)(NavPanelNative_1.NavPanelContext);
|
|
33
|
-
// This is for applying the active indicator for the button
|
|
34
|
-
//
|
|
35
|
-
// NOTE: there is a bug if you use Actions.navigate in the onClick handler, the indicator is not removed after click
|
|
36
|
-
// The issue needs to be resolved by either using contextual state (the NavLink knows it is active or not)
|
|
37
|
-
// or by rethinking the component and removing the <button> -> Discuss!
|
|
38
|
-
const [isClicked, setIsClicked] = (0, react_1.useState)(false);
|
|
39
|
-
const onClickForButton = (0, react_1.useCallback)((event) => {
|
|
40
|
-
setIsClicked((last) => !last);
|
|
41
|
-
onClick === null || onClick === void 0 ? void 0 : onClick(event);
|
|
42
|
-
}, [onClick]);
|
|
43
33
|
let safeVertical = vertical;
|
|
44
34
|
if (appLayoutContext && safeVertical === undefined) {
|
|
45
35
|
safeVertical =
|
|
@@ -51,20 +41,20 @@ exports.NavLink = (0, react_1.forwardRef)(function NavLink(_a, ref) {
|
|
|
51
41
|
}
|
|
52
42
|
}, [to]);
|
|
53
43
|
const styleObj = Object.assign(Object.assign({}, sx), style);
|
|
54
|
-
const
|
|
44
|
+
const baseClasses = (0, classnames_1.default)(NavLink_module_scss_1.default.content, NavLink_module_scss_1.default.base, {
|
|
55
45
|
[NavLink_module_scss_1.default.disabled]: disabled,
|
|
56
46
|
[NavLink_module_scss_1.default.vertical]: safeVertical,
|
|
57
|
-
[NavLink_module_scss_1.default.
|
|
47
|
+
[NavLink_module_scss_1.default.includeHoverIndicator]: displayActive,
|
|
48
|
+
[NavLink_module_scss_1.default.navItemActive]: displayActive && forceActive,
|
|
58
49
|
});
|
|
59
|
-
let content
|
|
50
|
+
let content;
|
|
60
51
|
if (disabled || !smartTo) {
|
|
61
|
-
content = ((0, jsx_runtime_1.jsxs)("button", Object.assign({
|
|
62
|
-
[NavLink_module_scss_1.default.active]: displayActive && (isClicked || forceActive),
|
|
63
|
-
}), style: styleObj, disabled: disabled, children: [icon, children] })));
|
|
52
|
+
content = ((0, jsx_runtime_1.jsxs)("button", Object.assign({}, rest, { ref: ref, onClick: onClick, className: baseClasses, style: styleObj, disabled: disabled, children: [icon, children] })));
|
|
64
53
|
}
|
|
65
54
|
else {
|
|
66
|
-
content = ((0, jsx_runtime_1.jsxs)(react_2.NavLink, Object.assign({ id: uid }, rest, { ref: ref, to: smartTo, style: styleObj, onClick: onClick, className: ({ isActive }) => (0, classnames_1.default)(
|
|
67
|
-
[NavLink_module_scss_1.default.
|
|
55
|
+
content = ((0, jsx_runtime_1.jsxs)(react_2.NavLink, Object.assign({ id: uid }, rest, { ref: ref, to: smartTo, style: styleObj, onClick: onClick, className: ({ isActive }) => (0, classnames_1.default)(baseClasses, {
|
|
56
|
+
[NavLink_module_scss_1.default.displayActive]: displayActive,
|
|
57
|
+
[NavLink_module_scss_1.default.navItemActive]: displayActive && (isActive || forceActive),
|
|
68
58
|
}), children: [icon, children] })));
|
|
69
59
|
}
|
|
70
60
|
return content;
|
|
@@ -120,7 +120,6 @@ function NestedApp({ api, app, components = constants_1.EMPTY_ARRAY, config, act
|
|
|
120
120
|
window.open(useHashBasedRouting ? `/#/playground#${appQueryString}` : `/playground#${appQueryString}`, "_blank");
|
|
121
121
|
}), [app, components, title, activeTheme, activeTone, useHashBasedRouting]);
|
|
122
122
|
(0, react_1.useEffect)(() => {
|
|
123
|
-
var _a;
|
|
124
123
|
if (!shadowRef.current && rootRef.current) {
|
|
125
124
|
// Clone existing style and link tags
|
|
126
125
|
shadowRef.current = rootRef.current.attachShadow({ mode: "open" });
|
|
@@ -160,11 +159,14 @@ function NestedApp({ api, app, components = constants_1.EMPTY_ARRAY, config, act
|
|
|
160
159
|
compoundComponents,
|
|
161
160
|
themes: config === null || config === void 0 ? void 0 : config.themes,
|
|
162
161
|
}, resources: config === null || config === void 0 ? void 0 : config.resources, extensionManager: componentRegistry.getExtensionManager() }, `app-${nestedAppId}-${refreshVersion}`) }));
|
|
163
|
-
(
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
162
|
+
(0, react_1.startTransition)(() => {
|
|
163
|
+
var _a;
|
|
164
|
+
(_a = contentRootRef.current) === null || _a === void 0 ? void 0 : _a.render((0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { node: component, children: (0, jsx_runtime_1.jsx)(ApiInterceptorProvider_1.ApiInterceptorProvider, { interceptor: mock, apiWorker: apiWorker, children: withFrame ? ((0, jsx_runtime_1.jsxs)("div", { className: NestedApp_module_scss_1.default.nestedAppContainer, children: [(0, jsx_runtime_1.jsxs)("div", { className: NestedApp_module_scss_1.default.header, children: [(0, jsx_runtime_1.jsx)("span", { className: NestedApp_module_scss_1.default.headerText, children: title }), (0, jsx_runtime_1.jsx)("div", { className: NestedApp_module_scss_1.default.spacer }), allowPlaygroundPopup && ((0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { trigger: (0, jsx_runtime_1.jsx)("button", { className: NestedApp_module_scss_1.default.headerButton, onClick: () => {
|
|
165
|
+
openPlayground();
|
|
166
|
+
}, children: (0, jsx_runtime_1.jsx)(rx_1.RxOpenInNewWindow, {}) }), label: "Edit code in new window" })), (0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { trigger: (0, jsx_runtime_1.jsx)("button", { className: NestedApp_module_scss_1.default.headerButton, onClick: () => {
|
|
167
|
+
setRefreshVersion(refreshVersion + 1);
|
|
168
|
+
}, children: (0, jsx_runtime_1.jsx)(lia_1.LiaUndoAltSolid, {}) }), label: "Reset the app" })] }), nestedAppRoot] })) : (nestedAppRoot) }) }));
|
|
169
|
+
});
|
|
168
170
|
}, [
|
|
169
171
|
activeTheme,
|
|
170
172
|
allowPlaygroundPopup,
|
|
@@ -20,7 +20,6 @@ exports.SelectMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
20
20
|
props: {
|
|
21
21
|
placeholder: (0, metadata_helpers_1.dPlaceholder)(),
|
|
22
22
|
initialValue: (0, metadata_helpers_1.dInitialValue)(),
|
|
23
|
-
maxLength: (0, metadata_helpers_1.dMaxLength)(),
|
|
24
23
|
autoFocus: (0, metadata_helpers_1.dAutoFocus)(),
|
|
25
24
|
required: (0, metadata_helpers_1.dRequired)(),
|
|
26
25
|
readOnly: (0, metadata_helpers_1.dReadonly)(),
|
|
@@ -54,7 +54,7 @@ const ThemeContext_1 = require("./theming/ThemeContext");
|
|
|
54
54
|
const classnames_1 = __importDefault(require("classnames"));
|
|
55
55
|
const renderers_1 = require("./renderers");
|
|
56
56
|
let highlighter = null;
|
|
57
|
-
function XmluiCodeHighlighter({ value }) {
|
|
57
|
+
function XmluiCodeHighlighter({ value, style }) {
|
|
58
58
|
const { activeThemeTone } = (0, ThemeContext_1.useTheme)();
|
|
59
59
|
const [initialized, setInitialized] = (0, react_1.useState)(false);
|
|
60
60
|
(0, react_1.useEffect)(() => {
|
|
@@ -101,10 +101,10 @@ function XmluiCodeHighlighter({ value }) {
|
|
|
101
101
|
return ((0, jsx_runtime_1.jsx)("div", { className: XmluiCodeHighlighter_module_scss_1.default.wrapper, children: (0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(XmluiCodeHighlighter_module_scss_1.default.innerWrapper, {
|
|
102
102
|
[XmluiCodeHighlighter_module_scss_1.default.dark]: activeThemeTone === "dark",
|
|
103
103
|
[XmluiCodeHighlighter_module_scss_1.default.light]: activeThemeTone === "light",
|
|
104
|
-
}), dangerouslySetInnerHTML: {
|
|
104
|
+
}), style: style, dangerouslySetInnerHTML: {
|
|
105
105
|
__html: html,
|
|
106
106
|
} }) }));
|
|
107
107
|
}
|
|
108
|
-
exports.codeComponentRenderer = (0, renderers_1.createComponentRenderer)("XmluiCodehighlighter", {}, ({ node, renderChild }) => {
|
|
109
|
-
return (0, jsx_runtime_1.jsx)(XmluiCodeHighlighter, { value: renderChild(node.children) });
|
|
108
|
+
exports.codeComponentRenderer = (0, renderers_1.createComponentRenderer)("XmluiCodehighlighter", {}, ({ node, renderChild, layoutCss }) => {
|
|
109
|
+
return (0, jsx_runtime_1.jsx)(XmluiCodeHighlighter, { value: renderChild(node.children), style: layoutCss });
|
|
110
110
|
});
|
|
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.AppWrapper = void 0;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
8
9
|
const react_router_dom_1 = require("react-router-dom");
|
|
9
10
|
const react_query_1 = require("@tanstack/react-query");
|
|
10
11
|
const react_helmet_async_1 = require("react-helmet-async");
|
|
@@ -41,10 +42,6 @@ const AppWrapper = ({ node, previewMode = false, routerBaseName: baseName = "",
|
|
|
41
42
|
// --- Select the router type for the app
|
|
42
43
|
const Router = previewMode ? react_router_dom_1.MemoryRouter : useHashBasedRouting ? react_router_dom_1.HashRouter : react_router_dom_1.BrowserRouter;
|
|
43
44
|
const shouldSkipClientRouter = previewMode ? false : (typeof window === "undefined" || process.env.VITE_REMIX);
|
|
44
|
-
return (
|
|
45
|
-
// <React.StrictMode>
|
|
46
|
-
(0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { node: node, location: "root-outer", children: (0, jsx_runtime_1.jsxs)(react_query_1.QueryClientProvider, { client: AppRoot_1.queryClient, children: [!!shouldSkipClientRouter && dynamicChildren, !shouldSkipClientRouter && ((0, jsx_runtime_1.jsx)(Router, { basename: Router === react_router_dom_1.HashRouter ? undefined : baseName, children: dynamicChildren }))] }) })
|
|
47
|
-
// </React.StrictMode>
|
|
48
|
-
);
|
|
45
|
+
return ((0, jsx_runtime_1.jsx)(react_1.default.StrictMode, { children: (0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { node: node, location: "root-outer", children: (0, jsx_runtime_1.jsxs)(react_query_1.QueryClientProvider, { client: AppRoot_1.queryClient, children: [!!shouldSkipClientRouter && dynamicChildren, !shouldSkipClientRouter && ((0, jsx_runtime_1.jsx)(Router, { basename: Router === react_router_dom_1.HashRouter ? undefined : baseName, children: dynamicChildren }))] }) }) }));
|
|
49
46
|
};
|
|
50
47
|
exports.AppWrapper = AppWrapper;
|