xmlui 0.9.23 → 0.9.25
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/apiInterceptorWorker-CFF3bC6o.mjs +818 -0
- package/dist/{index-B8C8yAZL.mjs → index-DtxDGaqF.mjs} +11792 -3151
- package/dist/index.css +1298 -521
- package/dist/language-server-web-worker.mjs +1 -1
- package/dist/language-server.mjs +1 -1
- package/dist/lint-CYAUfk0_.mjs +168 -0
- package/dist/metadata-utils-CCIMqe69.mjs +466 -0
- package/dist/scripts/package.json +252 -0
- package/dist/scripts/src/components/App/App.js +0 -2
- package/dist/scripts/src/components/App/AppNative.js +22 -12
- package/dist/scripts/src/components/AppHeader/AppHeader.js +1 -1
- package/dist/scripts/src/components/AppHeader/AppHeaderNative.js +4 -5
- package/dist/scripts/src/components/AutoComplete/AutoComplete.js +5 -2
- package/dist/scripts/src/components/AutoComplete/AutoCompleteNative.js +13 -10
- package/dist/scripts/src/components/Bookmark/BookmarkNative.js +5 -1
- package/dist/scripts/src/components/CodeBlock/CodeBlock.js +31 -0
- package/dist/scripts/src/components/CodeBlock/CodeBlockNative.js +82 -0
- package/dist/scripts/src/components/ComponentProvider.js +5 -0
- package/dist/scripts/src/components/DatePicker/DatePickerNative.js +1 -0
- package/dist/scripts/src/components/Footer/FooterNative.js +2 -1
- package/dist/scripts/src/components/Form/FormNative.js +34 -18
- package/dist/scripts/src/components/FormItem/FormItem.js +5 -2
- package/dist/scripts/src/components/FormItem/FormItemNative.js +4 -3
- package/dist/scripts/src/components/Heading/Heading.js +13 -0
- package/dist/scripts/src/components/Heading/HeadingNative.js +1 -1
- package/dist/scripts/src/components/HtmlTags/HtmlTags.js +7 -3
- package/dist/scripts/src/components/Icon/DarkToLightIcon.js +10 -0
- package/dist/scripts/src/components/Icon/LightToDark.js +10 -0
- package/dist/scripts/src/components/IconProvider.js +4 -0
- package/dist/scripts/src/components/Image/ImageNative.js +1 -1
- package/dist/scripts/src/components/Link/Link.js +5 -5
- package/dist/scripts/src/components/List/ListNative.js +1 -1
- package/dist/scripts/src/components/Markdown/Markdown.js +52 -16
- package/dist/scripts/src/components/Markdown/MarkdownNative.js +34 -73
- package/dist/scripts/src/components/Markdown/highlight-code.js +160 -0
- package/dist/scripts/src/components/Markdown/parse-binding-expr.js +60 -0
- package/dist/scripts/src/components/Markdown/utils.js +282 -0
- package/dist/scripts/src/components/ModalDialog/ConfirmationModalContextProvider.js +116 -0
- package/dist/scripts/src/components/ModalDialog/Dialog.js +20 -0
- package/dist/scripts/src/components/NavGroup/NavGroupNative.js +2 -2
- package/dist/scripts/src/components/NestedApp/NestedApp.js +61 -0
- package/dist/scripts/src/components/NestedApp/NestedAppNative.js +125 -0
- package/dist/scripts/src/components/NestedApp/Tooltip.js +46 -0
- package/dist/scripts/src/components/NumberBox/NumberBox.js +4 -1
- package/dist/scripts/src/components/NumberBox/NumberBoxNative.js +2 -2
- package/dist/scripts/src/components/Option/Option.js +3 -2
- package/dist/scripts/src/components/Select/Select.js +5 -3
- package/dist/scripts/src/components/Select/SelectNative.js +53 -42
- package/dist/scripts/src/components/SelectionStore/SelectionStore.js +1 -1
- package/dist/scripts/src/components/Spinner/Spinner.js +0 -1
- package/dist/scripts/src/components/TableOfContents/TableOfContents.js +1 -0
- package/dist/scripts/src/components/Text/Text.js +12 -1
- package/dist/scripts/src/components/Text/TextNative.js +5 -1
- package/dist/scripts/src/components/TextBox/TextBox.js +6 -1
- package/dist/scripts/src/components/TextBox/TextBoxNative.js +2 -2
- package/dist/scripts/src/components/Theme/ThemeNative.js +7 -3
- package/dist/scripts/src/components/ToneChangerButton/ToneChangerButton.js +1 -3
- package/dist/scripts/src/components-core/RestApiProxy.js +10 -7
- package/dist/scripts/src/components-core/TableOfContentsContext.js +1 -1
- package/dist/scripts/src/components-core/appContext/date-functions.js +23 -0
- package/dist/scripts/src/components-core/appContext/math-function.js +27 -0
- package/dist/scripts/src/components-core/appContext/misc-utils.js +13 -0
- package/dist/scripts/src/components-core/interception/ApiInterceptor.js +199 -0
- package/dist/scripts/src/components-core/interception/ApiInterceptorProvider.js +94 -0
- package/dist/scripts/src/components-core/interception/Backend.js +128 -0
- package/dist/scripts/src/components-core/interception/Errors.js +129 -0
- package/dist/scripts/src/components-core/interception/InMemoryDb.js +41 -0
- package/dist/scripts/src/components-core/interception/IndexedDb.js +207 -0
- package/dist/scripts/src/components-core/interception/ReadonlyCollection.js +145 -0
- package/dist/scripts/src/components-core/interception/abstractions.js +2 -0
- package/dist/scripts/src/components-core/interception/apiInterceptorWorker.js +46 -0
- package/dist/scripts/src/components-core/interception/useApiInterceptorContext.js +9 -0
- package/dist/scripts/src/components-core/rendering/AppContent.js +336 -0
- package/dist/scripts/src/components-core/rendering/AppRoot.js +84 -0
- package/dist/scripts/src/components-core/rendering/AppWrapper.js +49 -0
- package/dist/scripts/src/components-core/rendering/ComponentAdapter.js +17 -7
- package/dist/scripts/src/components-core/rendering/Container.js +2 -1
- package/dist/scripts/src/components-core/theming/ThemeProvider.js +2 -7
- package/dist/scripts/src/components-core/theming/themes/root.js +1 -0
- package/dist/scripts/src/components-core/utils/date-utils.js +78 -0
- package/dist/scripts/src/components-core/utils/hooks.js +26 -0
- package/dist/scripts/src/components-core/utils/misc.js +1 -1
- package/dist/scripts/src/components-core/utils/request-params.js +70 -0
- package/dist/scripts/src/logging/LoggerContext.js +22 -0
- package/dist/scripts/src/logging/LoggerInitializer.js +14 -0
- package/dist/scripts/src/logging/LoggerService.js +60 -0
- package/dist/scripts/src/parsers/xmlui-parser/transform.js +7 -0
- package/dist/{server-common-DW5h7Q34.mjs → server-common-9TiLMTJj.mjs} +106 -98
- package/dist/style.css +3325 -2794
- package/dist/{lint-EcgF-9Wr.mjs → transform-DC0Gy6qw.mjs} +1246 -540
- package/dist/xmlui-metadata.mjs +2647 -2521
- package/dist/xmlui-metadata.umd.js +2649 -2523
- package/dist/xmlui-parser.d.ts +49 -4
- package/dist/xmlui-parser.mjs +49 -48
- package/dist/xmlui-standalone.umd.js +34524 -31277
- package/dist/xmlui.d.ts +3 -1
- package/dist/xmlui.mjs +10 -10
- package/package.json +2 -1
- package/dist/apiInterceptorWorker-DZyEgCvB.mjs +0 -8447
- package/dist/parser-CBXS8ft2.mjs +0 -1196
|
@@ -98,6 +98,8 @@ const HtmlTags_1 = require("./HtmlTags/HtmlTags");
|
|
|
98
98
|
const ColorPicker_1 = require("./ColorPicker/ColorPicker");
|
|
99
99
|
const RadioItem_1 = require("./RadioGroup/RadioItem");
|
|
100
100
|
const InspectButton_1 = require("./InspectButton/InspectButton");
|
|
101
|
+
const NestedApp_1 = require("./NestedApp/NestedApp");
|
|
102
|
+
const CodeBlock_1 = require("./CodeBlock/CodeBlock");
|
|
101
103
|
/**
|
|
102
104
|
* The framework has a specialized component concept, the "property holder
|
|
103
105
|
* component." These components only hold property values but do not render
|
|
@@ -376,6 +378,7 @@ class ComponentRegistry {
|
|
|
376
378
|
this.registerCoreComponent(Bookmark_1.bookmarkComponentRenderer);
|
|
377
379
|
this.registerCoreComponent(TableOfContents_1.tableOfContentsRenderer);
|
|
378
380
|
this.registerCoreComponent(Breakout_1.breakoutComponentRenderer);
|
|
381
|
+
this.registerCoreComponent(CodeBlock_1.codeBlockComponentRenderer);
|
|
379
382
|
}
|
|
380
383
|
this.registerCoreComponent(Theme_1.themeComponentRenderer);
|
|
381
384
|
this.registerCoreComponent(AppState_1.appStateComponentRenderer);
|
|
@@ -485,6 +488,8 @@ class ComponentRegistry {
|
|
|
485
488
|
this.registerCoreComponent(HtmlTags_1.htmlVarTagRenderer);
|
|
486
489
|
this.registerCoreComponent(HtmlTags_1.htmlVideoTagRenderer);
|
|
487
490
|
this.registerCoreComponent(HtmlTags_1.htmlWbrTagRenderer);
|
|
491
|
+
// --- Nested app and related components
|
|
492
|
+
this.registerCoreComponent(NestedApp_1.nestedAppComponentRenderer);
|
|
488
493
|
this.registerActionFn(APICall_1.apiAction);
|
|
489
494
|
this.registerActionFn(FileDownloadAction_1.downloadAction);
|
|
490
495
|
this.registerActionFn(FileUploadAction_1.uploadAction);
|
|
@@ -49,6 +49,7 @@ const ThemeContext_1 = require("../../components-core/theming/ThemeContext");
|
|
|
49
49
|
const constants_1 = require("../../components-core/constants");
|
|
50
50
|
const misc_1 = require("../../components-core/utils/misc");
|
|
51
51
|
const InputAdornment_1 = require("../Input/InputAdornment");
|
|
52
|
+
require("react-day-picker/dist/style.css");
|
|
52
53
|
exports.DatePickerModeValues = ["single", "range"];
|
|
53
54
|
var WeekDays;
|
|
54
55
|
(function (WeekDays) {
|
|
@@ -13,7 +13,8 @@ const AppLayoutContext_1 = require("../App/AppLayoutContext");
|
|
|
13
13
|
// React Footer component implementation
|
|
14
14
|
exports.Footer = (0, react_1.forwardRef)(function Footer({ children, style, className, }, forwardedRef) {
|
|
15
15
|
const { layout } = (0, AppLayoutContext_1.useAppLayoutContext)() || {};
|
|
16
|
+
const canRestrictContentWidth = layout !== "vertical-full-header";
|
|
16
17
|
return ((0, jsx_runtime_1.jsx)("div", { className: Footer_module_scss_1.default.outerWrapper, ref: forwardedRef, style: style, children: (0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(Footer_module_scss_1.default.wrapper, className, {
|
|
17
|
-
[Footer_module_scss_1.default.
|
|
18
|
+
[Footer_module_scss_1.default.full]: !canRestrictContentWidth,
|
|
18
19
|
}), children: children }) }));
|
|
19
20
|
});
|
|
@@ -16,7 +16,6 @@ exports.defaultProps = exports.getByPath = void 0;
|
|
|
16
16
|
exports.FormWithContextVar = FormWithContextVar;
|
|
17
17
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
18
|
const react_1 = require("react");
|
|
19
|
-
const react_2 = require("react");
|
|
20
19
|
const react_dom_1 = require("react-dom");
|
|
21
20
|
const immer_1 = __importDefault(require("immer"));
|
|
22
21
|
const Form_module_scss_1 = __importDefault(require("./Form.module.scss"));
|
|
@@ -172,13 +171,22 @@ exports.defaultProps = {
|
|
|
172
171
|
itemLabelBreak: true,
|
|
173
172
|
keepModalOpenOnSubmit: false,
|
|
174
173
|
};
|
|
175
|
-
|
|
174
|
+
// --- Remove the properties from formState.subject where the property name ends with UNBOUND_FIELD_SUFFIX
|
|
175
|
+
function cleanUpSubject(subject) {
|
|
176
|
+
return Object.entries(subject || {}).reduce((acc, [key, value]) => {
|
|
177
|
+
if (!key.endsWith(formActions_1.UNBOUND_FIELD_SUFFIX)) {
|
|
178
|
+
acc[key] = value;
|
|
179
|
+
}
|
|
180
|
+
return acc;
|
|
181
|
+
}, {});
|
|
182
|
+
}
|
|
183
|
+
const Form = (0, react_1.forwardRef)(function ({ formState, dispatch, initialValue = constants_1.EMPTY_OBJECT, children, style, enabled = true, cancelLabel = "Cancel", saveLabel = "Save", saveInProgressLabel = "Saving...", swapCancelAndSave, onSubmit, onCancel, onReset, buttonRow, id, registerComponentApi, itemLabelBreak = true, itemLabelWidth, itemLabelPosition = "top", keepModalOpenOnSubmit = false, }, ref) {
|
|
176
184
|
const formRef = (0, react_1.useRef)(null);
|
|
177
185
|
(0, react_1.useImperativeHandle)(ref, () => formRef.current);
|
|
178
|
-
const [confirmSubmitModalVisible, setConfirmSubmitModalVisible] = (0,
|
|
186
|
+
const [confirmSubmitModalVisible, setConfirmSubmitModalVisible] = (0, react_1.useState)(false);
|
|
179
187
|
const requestModalFormClose = (0, ModalVisibilityContext_1.useModalFormClose)();
|
|
180
188
|
const isEnabled = enabled && !formState.submitInProgress;
|
|
181
|
-
const formContextValue = (0,
|
|
189
|
+
const formContextValue = (0, react_1.useMemo)(() => {
|
|
182
190
|
return {
|
|
183
191
|
itemLabelBreak,
|
|
184
192
|
itemLabelWidth,
|
|
@@ -224,13 +232,7 @@ const Form = (0, react_2.forwardRef)(function ({ formState, dispatch, initialVal
|
|
|
224
232
|
const prevFocused = document.activeElement;
|
|
225
233
|
dispatch((0, formActions_1.formSubmitting)());
|
|
226
234
|
try {
|
|
227
|
-
|
|
228
|
-
const filteredSubject = Object.entries(formState.subject).reduce((acc, [key, value]) => {
|
|
229
|
-
if (!key.endsWith(formActions_1.UNBOUND_FIELD_SUFFIX)) {
|
|
230
|
-
acc[key] = value;
|
|
231
|
-
}
|
|
232
|
-
return acc;
|
|
233
|
-
}, {});
|
|
235
|
+
const filteredSubject = cleanUpSubject(formState.subject);
|
|
234
236
|
yield (onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(filteredSubject, {
|
|
235
237
|
passAsDefaultBody: true,
|
|
236
238
|
}));
|
|
@@ -305,8 +307,8 @@ const Form = (0, react_2.forwardRef)(function ({ formState, dispatch, initialVal
|
|
|
305
307
|
});
|
|
306
308
|
});
|
|
307
309
|
const cancelButton = cancelLabel === "" ? null : ((0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { type: "button", themeColor: "secondary", variant: "ghost", onClick: doCancel, children: cancelLabel }, "cancel"));
|
|
308
|
-
const submitButton = (0,
|
|
309
|
-
(0,
|
|
310
|
+
const submitButton = (0, react_1.useMemo)(() => ((0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { type: "submit", disabled: !isEnabled, children: formState.submitInProgress ? saveInProgressLabel : saveLabel }, "submit")), [isEnabled, formState.submitInProgress, saveInProgressLabel, saveLabel]);
|
|
311
|
+
(0, react_1.useEffect)(() => {
|
|
310
312
|
registerComponentApi === null || registerComponentApi === void 0 ? void 0 : registerComponentApi({
|
|
311
313
|
reset: doReset,
|
|
312
314
|
update: updateData,
|
|
@@ -316,8 +318,8 @@ const Form = (0, react_2.forwardRef)(function ({ formState, dispatch, initialVal
|
|
|
316
318
|
});
|
|
317
319
|
Form.displayName = "Form";
|
|
318
320
|
function FormWithContextVar({ node, renderChild, extractValue, style, lookupEventHandler, registerComponentApi, }) {
|
|
319
|
-
const [formState, dispatch] = (0,
|
|
320
|
-
const
|
|
321
|
+
const [formState, dispatch] = (0, react_1.useReducer)(formReducer, initialState);
|
|
322
|
+
const $data = (0, react_1.useMemo)(() => {
|
|
321
323
|
const updateData = (change) => {
|
|
322
324
|
if (typeof change !== "object" || change === null || change === undefined) {
|
|
323
325
|
return;
|
|
@@ -332,14 +334,17 @@ function FormWithContextVar({ node, renderChild, extractValue, style, lookupEven
|
|
|
332
334
|
});
|
|
333
335
|
});
|
|
334
336
|
};
|
|
337
|
+
return Object.assign(Object.assign({}, cleanUpSubject(formState.subject)), { update: updateData });
|
|
338
|
+
}, [formState.subject]);
|
|
339
|
+
const nodeWithItem = (0, react_1.useMemo)(() => {
|
|
335
340
|
return {
|
|
336
341
|
type: "Fragment",
|
|
337
342
|
vars: {
|
|
338
|
-
$data:
|
|
343
|
+
$data: $data,
|
|
339
344
|
},
|
|
340
345
|
children: node.children,
|
|
341
346
|
};
|
|
342
|
-
}, [
|
|
347
|
+
}, [$data, node.children]);
|
|
343
348
|
const initialValue = extractValue(node.props.data);
|
|
344
349
|
const submitMethod = extractValue.asOptionalString(node.props.submitMethod) || (initialValue ? "put" : "post");
|
|
345
350
|
const submitUrl = extractValue.asOptionalString(node.props.submitUrl) ||
|
|
@@ -348,6 +353,17 @@ function FormWithContextVar({ node, renderChild, extractValue, style, lookupEven
|
|
|
348
353
|
defaultHandler: submitUrl
|
|
349
354
|
? `(eventArgs)=> Actions.callApi({ url: "${submitUrl}", method: "${submitMethod}", body: eventArgs })`
|
|
350
355
|
: undefined,
|
|
351
|
-
|
|
356
|
+
context: {
|
|
357
|
+
$data,
|
|
358
|
+
},
|
|
359
|
+
}), onCancel: lookupEventHandler("cancel", {
|
|
360
|
+
context: {
|
|
361
|
+
$data,
|
|
362
|
+
},
|
|
363
|
+
}), onReset: lookupEventHandler("reset", {
|
|
364
|
+
context: {
|
|
365
|
+
$data,
|
|
366
|
+
},
|
|
367
|
+
}), initialValue: initialValue, buttonRow: renderChild(node.props.buttonRowTemplate), registerComponentApi: registerComponentApi, enabled: extractValue.asOptionalBoolean(node.props.enabled, true) &&
|
|
352
368
|
!extractValue.asOptionalBoolean(node.props.loading, false), children: renderChild(nodeWithItem) }));
|
|
353
369
|
}
|
|
@@ -151,6 +151,9 @@ exports.FormItemMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
151
151
|
inputTemplate: {
|
|
152
152
|
description: "This property is used to define a custom input template.",
|
|
153
153
|
},
|
|
154
|
+
gap: {
|
|
155
|
+
description: "This property defines the gap between the adornments and the input area.",
|
|
156
|
+
},
|
|
154
157
|
},
|
|
155
158
|
events: {
|
|
156
159
|
validate: (0, ComponentDefs_1.d)(`This event is used to define a custom validation function.`),
|
|
@@ -174,7 +177,7 @@ exports.FormItemMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
174
177
|
});
|
|
175
178
|
exports.formItemComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.FormItemMd, ({ node, renderChild, extractValue, layoutCss, layoutContext, lookupEventHandler, lookupAction, registerComponentApi, }) => {
|
|
176
179
|
var _a;
|
|
177
|
-
const _b = node.props, { bindTo, autoFocus, label, labelPosition, labelWidth, labelBreak, enabled, required, type, requiredInvalidMessage, minLength, maxLength, lengthInvalidMessage, lengthInvalidSeverity, minValue, maxValue, rangeInvalidMessage, rangeInvalidSeverity, pattern, patternInvalidMessage, patternInvalidSeverity, regex, regexInvalidMessage, regexInvalidSeverity, customValidationsDebounce, validationMode, maxTextLength } = _b, rest = __rest(_b, ["bindTo", "autoFocus", "label", "labelPosition", "labelWidth", "labelBreak", "enabled", "required", "type", "requiredInvalidMessage", "minLength", "maxLength", "lengthInvalidMessage", "lengthInvalidSeverity", "minValue", "maxValue", "rangeInvalidMessage", "rangeInvalidSeverity", "pattern", "patternInvalidMessage", "patternInvalidSeverity", "regex", "regexInvalidMessage", "regexInvalidSeverity", "customValidationsDebounce", "validationMode", "maxTextLength"]);
|
|
180
|
+
const _b = node.props, { bindTo, autoFocus, label, labelPosition, labelWidth, labelBreak, enabled, required, type, requiredInvalidMessage, minLength, maxLength, lengthInvalidMessage, lengthInvalidSeverity, minValue, maxValue, rangeInvalidMessage, rangeInvalidSeverity, pattern, patternInvalidMessage, patternInvalidSeverity, regex, regexInvalidMessage, regexInvalidSeverity, customValidationsDebounce, validationMode, maxTextLength, gap } = _b, rest = __rest(_b, ["bindTo", "autoFocus", "label", "labelPosition", "labelWidth", "labelBreak", "enabled", "required", "type", "requiredInvalidMessage", "minLength", "maxLength", "lengthInvalidMessage", "lengthInvalidSeverity", "minValue", "maxValue", "rangeInvalidMessage", "rangeInvalidSeverity", "pattern", "patternInvalidMessage", "patternInvalidSeverity", "regex", "regexInvalidMessage", "regexInvalidSeverity", "customValidationsDebounce", "validationMode", "maxTextLength", "gap"]);
|
|
178
181
|
//extractValue works as a memoization mechanism too (if there's nothing to resolve, it won't produce a new object every time)
|
|
179
182
|
const resolvedValidationPropsAndEvents = extractValue({
|
|
180
183
|
required: extractValue.asOptionalBoolean(required),
|
|
@@ -205,7 +208,7 @@ exports.formItemComponentRenderer = (0, renderers_1.createComponentRenderer)(COM
|
|
|
205
208
|
const inputTemplate = node.children || ((_a = node.props) === null || _a === void 0 ? void 0 : _a.inputTemplate);
|
|
206
209
|
return ((0, jsx_runtime_1.jsx)(FormItemNative_1.FormItem, Object.assign({ style: layoutCss, layoutContext: layoutContext, labelBreak: extractValue.asOptionalBoolean(labelBreak), labelWidth: extractValue.asOptionalString(labelWidth), bindTo: extractValue.asString(bindTo), autoFocus: extractValue.asOptionalBoolean(autoFocus), enabled: extractValue.asOptionalBoolean(enabled), label: extractValue.asOptionalString(label), labelPosition: extractValue.asOptionalString(labelPosition), type: isCustomFormItem ? "custom" : formItemType, validations: resolvedValidationPropsAndEvents, onValidate: lookupEventHandler("validate"), customValidationsDebounce: extractValue.asOptionalNumber(customValidationsDebounce), validationMode: extractValue.asOptionalString(validationMode), registerComponentApi: registerComponentApi, maxTextLength: extractValue(maxTextLength), itemIndex: extractValue("{$itemIndex}"), initialValue: extractValue(node.props.initialValue), inputRenderer: inputTemplate
|
|
207
210
|
? (contextVars) => ((0, jsx_runtime_1.jsx)(container_helpers_1.MemoizedItem, { contextVars: contextVars, node: inputTemplate, renderChild: renderChild, layoutContext: layoutContext }))
|
|
208
|
-
: undefined }, resolvedRestProps, { children: isCustomFormItem ? ((0, jsx_runtime_1.jsx)(FormItemNative_1.CustomFormItem, { renderChild: renderChild, node: node, bindTo: extractValue.asString(bindTo) })) : (renderChild(node.children, {
|
|
211
|
+
: undefined, gap: extractValue.asOptionalString(gap) }, resolvedRestProps, { children: isCustomFormItem ? ((0, jsx_runtime_1.jsx)(FormItemNative_1.CustomFormItem, { renderChild: renderChild, node: node, bindTo: extractValue.asString(bindTo) })) : (renderChild(node.children, {
|
|
209
212
|
type: formItemType,
|
|
210
213
|
})) })));
|
|
211
214
|
});
|
|
@@ -69,7 +69,7 @@ function ArrayLikeFormItem({ children, formItemId, registerComponentApi, value =
|
|
|
69
69
|
return (0, jsx_runtime_1.jsx)(FormItemContext.Provider, { value: formContextValue, children: children });
|
|
70
70
|
}
|
|
71
71
|
exports.FormItem = (0, react_1.memo)(function FormItem(_a) {
|
|
72
|
-
var { style, bindTo, type = exports.defaultProps.type, label, enabled = exports.defaultProps.enabled, labelPosition, labelWidth, labelBreak = exports.defaultProps.labelBreak, children, validations, onValidate, customValidationsDebounce = exports.defaultProps.customValidationsDebounce, validationMode, registerComponentApi, maxTextLength, inputRenderer, itemIndex, initialValue: initialValueFromProps } = _a, rest = __rest(_a, ["style", "bindTo", "type", "label", "enabled", "labelPosition", "labelWidth", "labelBreak", "children", "validations", "onValidate", "customValidationsDebounce", "validationMode", "registerComponentApi", "maxTextLength", "inputRenderer", "itemIndex", "initialValue"]);
|
|
72
|
+
var { style, bindTo, type = exports.defaultProps.type, label, enabled = exports.defaultProps.enabled, labelPosition, labelWidth, labelBreak = exports.defaultProps.labelBreak, children, validations, onValidate, customValidationsDebounce = exports.defaultProps.customValidationsDebounce, validationMode, registerComponentApi, maxTextLength, inputRenderer, itemIndex, initialValue: initialValueFromProps, gap } = _a, rest = __rest(_a, ["style", "bindTo", "type", "label", "enabled", "labelPosition", "labelWidth", "labelBreak", "children", "validations", "onValidate", "customValidationsDebounce", "validationMode", "registerComponentApi", "maxTextLength", "inputRenderer", "itemIndex", "initialValue", "gap"]);
|
|
73
73
|
const defaultId = (0, react_1.useId)();
|
|
74
74
|
const { parentFormItemId } = (0, react_1.useContext)(FormItemContext);
|
|
75
75
|
const formItemId = (0, react_1.useMemo)(() => {
|
|
@@ -141,7 +141,7 @@ exports.FormItem = (0, react_1.memo)(function FormItem(_a) {
|
|
|
141
141
|
}
|
|
142
142
|
case "number":
|
|
143
143
|
case "integer": {
|
|
144
|
-
formControl = ((0, jsx_runtime_1.jsx)(NumberBoxNative_1.NumberBox, Object.assign({}, rest, { value: value, updateState: onStateChange, registerComponentApi: registerComponentApi, enabled: isEnabled, integersOnly: type === "integer", validationStatus: validationStatus, min: validations.minValue, max: validations.maxValue, maxLength: maxTextLength !== null && maxTextLength !== void 0 ? maxTextLength : validations === null || validations === void 0 ? void 0 : validations.maxLength })));
|
|
144
|
+
formControl = ((0, jsx_runtime_1.jsx)(NumberBoxNative_1.NumberBox, Object.assign({}, rest, { value: value, updateState: onStateChange, registerComponentApi: registerComponentApi, enabled: isEnabled, integersOnly: type === "integer", validationStatus: validationStatus, min: validations.minValue, max: validations.maxValue, maxLength: maxTextLength !== null && maxTextLength !== void 0 ? maxTextLength : validations === null || validations === void 0 ? void 0 : validations.maxLength, gap: gap })));
|
|
145
145
|
break;
|
|
146
146
|
}
|
|
147
147
|
// NOTE: This is a prototype for the new number field
|
|
@@ -164,7 +164,8 @@ exports.FormItem = (0, react_1.memo)(function FormItem(_a) {
|
|
|
164
164
|
break;
|
|
165
165
|
}
|
|
166
166
|
case "text": {
|
|
167
|
-
|
|
167
|
+
console.log("gap", gap);
|
|
168
|
+
formControl = ((0, jsx_runtime_1.jsx)(TextBoxNative_1.TextBox, Object.assign({}, rest, { value: value, updateState: onStateChange, registerComponentApi: registerComponentApi, enabled: isEnabled, validationStatus: validationStatus, maxLength: maxTextLength !== null && maxTextLength !== void 0 ? maxTextLength : validations === null || validations === void 0 ? void 0 : validations.maxLength, gap: gap })));
|
|
168
169
|
break;
|
|
169
170
|
}
|
|
170
171
|
case "password": {
|
|
@@ -84,6 +84,9 @@ exports.H1Md = (0, ComponentDefs_1.createMetadata)({
|
|
|
84
84
|
[`fontSize-${H1}`]: "$fontSize-large",
|
|
85
85
|
[`marginTop-${H1}`]: "0",
|
|
86
86
|
[`marginBottom-${H1}`]: "0",
|
|
87
|
+
[`fontSize-${H1}-markdown`]: "$fontSize-larger",
|
|
88
|
+
[`marginTop-${H1}-markdown`]: "0",
|
|
89
|
+
[`marginBottom-${H1}-markdown`]: "$space-6",
|
|
87
90
|
light: {
|
|
88
91
|
// --- No light-specific theme vars
|
|
89
92
|
},
|
|
@@ -106,6 +109,8 @@ exports.H2Md = (0, ComponentDefs_1.createMetadata)({
|
|
|
106
109
|
[`fontSize-${H2}`]: "$fontSize-medium",
|
|
107
110
|
[`marginTop-${H2}`]: "0",
|
|
108
111
|
[`marginBottom-${H2}`]: "0",
|
|
112
|
+
[`marginTop-${H2}-markdown`]: "$space-10",
|
|
113
|
+
[`marginBottom-${H2}-markdown`]: "$space-3",
|
|
109
114
|
light: {
|
|
110
115
|
// --- No light-specific theme vars
|
|
111
116
|
},
|
|
@@ -128,6 +133,8 @@ exports.H3Md = (0, ComponentDefs_1.createMetadata)({
|
|
|
128
133
|
[`fontSize-${H3}`]: "$fontSize-normal",
|
|
129
134
|
[`marginTop-${H3}`]: "0",
|
|
130
135
|
[`marginBottom-${H3}`]: "0",
|
|
136
|
+
[`marginTop-${H3}-markdown`]: "$space-6",
|
|
137
|
+
[`marginBottom-${H3}-markdown`]: "$space-2",
|
|
131
138
|
light: {
|
|
132
139
|
// --- No light-specific theme vars
|
|
133
140
|
},
|
|
@@ -150,6 +157,8 @@ exports.H4Md = (0, ComponentDefs_1.createMetadata)({
|
|
|
150
157
|
[`fontSize-${H4}`]: "$fontSize-small",
|
|
151
158
|
[`marginTop-${H4}`]: "0",
|
|
152
159
|
[`marginBottom-${H4}`]: "0",
|
|
160
|
+
[`marginTop-${H4}-markdown`]: "$space-5",
|
|
161
|
+
[`marginBottom-${H4}-markdown`]: "$space-1",
|
|
153
162
|
light: {
|
|
154
163
|
// --- No light-specific theme vars
|
|
155
164
|
},
|
|
@@ -172,6 +181,8 @@ exports.H5Md = (0, ComponentDefs_1.createMetadata)({
|
|
|
172
181
|
[`fontSize-${H5}`]: "$fontSize-smaller",
|
|
173
182
|
[`marginTop-${H5}`]: "0",
|
|
174
183
|
[`marginBottom-${H5}`]: "0",
|
|
184
|
+
[`marginTop-${H5}-markdown`]: "0",
|
|
185
|
+
[`marginBottom-${H5}-markdown`]: "$space-0",
|
|
175
186
|
light: {
|
|
176
187
|
// --- No light-specific theme vars
|
|
177
188
|
},
|
|
@@ -194,6 +205,8 @@ exports.H6Md = (0, ComponentDefs_1.createMetadata)({
|
|
|
194
205
|
[`fontSize-${H6}`]: "$fontSize-tiny",
|
|
195
206
|
[`marginTop-${H6}`]: "0",
|
|
196
207
|
[`marginBottom-${H6}`]: "0",
|
|
208
|
+
[`marginTop-${H6}-markdown`]: "0",
|
|
209
|
+
[`marginBottom-${H6}-markdown`]: "$space-0",
|
|
197
210
|
light: {
|
|
198
211
|
// --- No light-specific theme vars
|
|
199
212
|
},
|
|
@@ -59,5 +59,5 @@ exports.Heading = (0, react_1.forwardRef)(function Heading(_a, forwardedRef) {
|
|
|
59
59
|
[Heading_module_scss_1.default.truncateOverflow]: maxLines > 0,
|
|
60
60
|
[Heading_module_scss_1.default.preserveLinebreaks]: preserveLinebreaks,
|
|
61
61
|
[Heading_module_scss_1.default.noEllipsis]: !ellipses,
|
|
62
|
-
}) }, furtherProps, { children: [anchorId && ((0, jsx_runtime_1.jsx)("span", { ref: anchorRef, id: anchorId,
|
|
62
|
+
}) }, furtherProps, { children: [anchorId && ((0, jsx_runtime_1.jsx)("span", { ref: anchorRef, id: anchorId, className: Heading_module_scss_1.default.anchorRef, "data-anchor": true })), children] })));
|
|
63
63
|
});
|
|
@@ -655,7 +655,7 @@ exports.HtmlImgMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
655
655
|
loading: (0, ComponentDefs_1.d)("Specifies the loading behavior of the image"),
|
|
656
656
|
referrerPolicy: (0, ComponentDefs_1.d)("Specifies the referrer policy for the image"),
|
|
657
657
|
sizes: (0, ComponentDefs_1.d)("Specifies image sizes for different page layouts"),
|
|
658
|
-
}
|
|
658
|
+
}
|
|
659
659
|
});
|
|
660
660
|
exports.htmlImgTagRenderer = (0, renderers_1.createComponentRenderer)("img", exports.HtmlImgMd, ({ node, renderChild, extractValue, extractResourceUrl, layoutCss }) => {
|
|
661
661
|
const p = new extractParam_1.PropsTrasform(extractValue, extractResourceUrl, layoutCss, node.props);
|
|
@@ -750,6 +750,10 @@ exports.HtmlLiMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
750
750
|
props: {
|
|
751
751
|
value: (0, ComponentDefs_1.d)("Specifies the value of the list item (if the parent is an ordered list)"),
|
|
752
752
|
},
|
|
753
|
+
defaultThemeVars: {
|
|
754
|
+
"marginLeft-HtmlLi": "$space-6",
|
|
755
|
+
"paddingLeft-HtmlLi": "$space-1",
|
|
756
|
+
}
|
|
753
757
|
});
|
|
754
758
|
exports.htmlLiTagRenderer = (0, renderers_1.createComponentRenderer)("li", exports.HtmlLiMd, ({ node, renderChild, extractValue, extractResourceUrl, layoutCss }) => {
|
|
755
759
|
const p = new extractParam_1.PropsTrasform(extractValue, extractResourceUrl, layoutCss, node.props);
|
|
@@ -1362,8 +1366,8 @@ exports.HtmlUlMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
1362
1366
|
isHtmlTag: true,
|
|
1363
1367
|
themeVars: (0, themeVars_1.parseScssVar)(HtmlTags_module_scss_1.default.themeVarsList), // Use only themeVarsList
|
|
1364
1368
|
defaultThemeVars: {
|
|
1365
|
-
"marginTop-HtmlUl": "$space-
|
|
1366
|
-
"marginBottom-HtmlUl": "$space-
|
|
1369
|
+
"marginTop-HtmlUl": "$space-2",
|
|
1370
|
+
"marginBottom-HtmlUl": "$space-2",
|
|
1367
1371
|
},
|
|
1368
1372
|
});
|
|
1369
1373
|
exports.htmlUlTagRenderer = (0, renderers_1.createComponentRenderer)("ul", exports.HtmlUlMd, // Use HtmlOlMd instead of HtmlListMd
|
|
@@ -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.DarkToLightIcon = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const dark_to_light_svg_react_1 = __importDefault(require("./svg/dark_to_light.svg?react"));
|
|
9
|
+
const DarkToLightIcon = (props) => ((0, jsx_runtime_1.jsx)(dark_to_light_svg_react_1.default, Object.assign({}, props)));
|
|
10
|
+
exports.DarkToLightIcon = DarkToLightIcon;
|
|
@@ -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.LightToDarkIcon = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const light_to_dark_svg_react_1 = __importDefault(require("./svg/light_to_dark.svg?react"));
|
|
9
|
+
const LightToDarkIcon = (props) => ((0, jsx_runtime_1.jsx)(light_to_dark_svg_react_1.default, Object.assign({}, props)));
|
|
10
|
+
exports.LightToDarkIcon = LightToDarkIcon;
|
|
@@ -81,6 +81,8 @@ const TrendingLevelIcon_1 = require("./Icon/TrendingLevelIcon");
|
|
|
81
81
|
const Inspect_1 = require("./Icon/Inspect");
|
|
82
82
|
const MoonIcon_1 = require("./Icon/MoonIcon");
|
|
83
83
|
const StarsIcon_1 = require("./Icon/StarsIcon");
|
|
84
|
+
const LightToDark_1 = require("./Icon/LightToDark");
|
|
85
|
+
const DarkToLightIcon_1 = require("./Icon/DarkToLightIcon");
|
|
84
86
|
const pool = new Map();
|
|
85
87
|
function registerIconRenderer(name, renderer) {
|
|
86
88
|
if (typeof name === "object") {
|
|
@@ -143,6 +145,8 @@ registerIconRenderer("plus", (props) => (0, jsx_runtime_1.jsx)(PlusIcon_1.PlusIc
|
|
|
143
145
|
registerIconRenderer("inspect", (props) => (0, jsx_runtime_1.jsx)(Inspect_1.InspectIcon, Object.assign({}, props)));
|
|
144
146
|
registerIconRenderer("plus-circle", (props) => (0, jsx_runtime_1.jsx)(ai_1.AiOutlinePlusCircle, Object.assign({}, props)));
|
|
145
147
|
registerIconRenderer("filledplus", (props) => (0, jsx_runtime_1.jsx)(FillPlusCricleIcon_1.FillPlusCircleIcon, Object.assign({}, props)));
|
|
148
|
+
registerIconRenderer("darkToLight", (props) => (0, jsx_runtime_1.jsx)(DarkToLightIcon_1.DarkToLightIcon, Object.assign({}, props)));
|
|
149
|
+
registerIconRenderer("lightToDark", (props) => (0, jsx_runtime_1.jsx)(LightToDark_1.LightToDarkIcon, Object.assign({}, props)));
|
|
146
150
|
registerIconRenderer("checkmark", (props) => (0, jsx_runtime_1.jsx)(CheckIcon_1.CheckIcon, Object.assign({}, props)));
|
|
147
151
|
registerIconRenderer("valid", (props) => (0, jsx_runtime_1.jsx)(fi_1.FiCheckCircle, Object.assign({}, props)));
|
|
148
152
|
registerIconRenderer("info", (props) => (0, jsx_runtime_1.jsx)(fi_1.FiAlertOctagon, Object.assign({}, props)));
|
|
@@ -11,5 +11,5 @@ const Image_module_scss_1 = __importDefault(require("./Image.module.scss"));
|
|
|
11
11
|
exports.Image = (0, react_1.forwardRef)(function Img({ src, alt, fit = "contain", style, onClick, aspectRatio, lazyLoad }, ref) {
|
|
12
12
|
return ((0, jsx_runtime_1.jsx)("img", { src: src, ref: ref, alt: alt, loading: lazyLoad ? "lazy" : "eager", className: (0, classnames_1.default)(Image_module_scss_1.default.img, {
|
|
13
13
|
[Image_module_scss_1.default.clickable]: !!onClick,
|
|
14
|
-
}), style: Object.assign(Object.assign({ objectFit: fit, boxShadow: "none" }, style), { aspectRatio: aspectRatio }), onClick: onClick }));
|
|
14
|
+
}), style: Object.assign(Object.assign({ objectFit: fit, boxShadow: "none" }, style), { flexShrink: 1, aspectRatio: aspectRatio }), onClick: onClick }));
|
|
15
15
|
});
|
|
@@ -41,14 +41,14 @@ exports.LinkMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
41
41
|
defaultThemeVars: {
|
|
42
42
|
[`border-${COMP}`]: "0px solid $borderColor",
|
|
43
43
|
[`textColor-${COMP}--hover--active`]: `$textColor-${COMP}--active`,
|
|
44
|
-
[`textDecorationColor-${COMP}--hover`]: "$color-
|
|
45
|
-
[`
|
|
44
|
+
[`textDecorationColor-${COMP}--hover`]: "$color-primary-400",
|
|
45
|
+
[`textColor-${COMP}--hover`]: `$color-primary-400`,
|
|
46
|
+
[`textDecorationColor-${COMP}--active`]: "$color-primary-200",
|
|
46
47
|
[`fontWeight-${COMP}--active`]: "$fontWeight-bold",
|
|
47
|
-
[`textDecorationColor-${COMP}`]: "$color-
|
|
48
|
+
[`textDecorationColor-${COMP}`]: "$color-primary-400",
|
|
48
49
|
[`textUnderlineOffset-${COMP}`]: "$space-1",
|
|
49
50
|
[`textDecorationLine-${COMP}`]: "underline",
|
|
50
|
-
[`textDecorationStyle-${COMP}`]: "
|
|
51
|
-
[`textDecorationThickness-${COMP}`]: "$space-0_5",
|
|
51
|
+
[`textDecorationStyle-${COMP}`]: "solid",
|
|
52
52
|
[`outlineColor-${COMP}--focus`]: "$outlineColor--focus",
|
|
53
53
|
[`outlineWidth-${COMP}--focus`]: "$outlineWidth--focus",
|
|
54
54
|
[`outlineStyle-${COMP}--focus`]: "$outlineStyle--focus",
|
|
@@ -94,7 +94,7 @@ function useListData({ groupsInitiallyExpanded = true, expanded = constants_1.EM
|
|
|
94
94
|
if (!limit) {
|
|
95
95
|
return sortedItems;
|
|
96
96
|
}
|
|
97
|
-
return sortedItems.slice(0, limit
|
|
97
|
+
return sortedItems.slice(0, limit);
|
|
98
98
|
}, [sortedItems, limit]);
|
|
99
99
|
const sectionedItems = (0, react_1.useMemo)(() => {
|
|
100
100
|
if (groupBy === undefined) {
|
|
@@ -10,12 +10,19 @@ const ComponentDefs_1 = require("../../abstractions/ComponentDefs");
|
|
|
10
10
|
const renderers_1 = require("../../components-core/renderers");
|
|
11
11
|
const themeVars_1 = require("../../components-core/theming/themeVars");
|
|
12
12
|
const MarkdownNative_1 = require("./MarkdownNative");
|
|
13
|
+
const react_1 = require("react");
|
|
14
|
+
const parse_binding_expr_1 = require("./parse-binding-expr");
|
|
15
|
+
const utils_1 = require("./utils");
|
|
13
16
|
const COMP = "Markdown";
|
|
14
17
|
exports.MarkdownMd = (0, ComponentDefs_1.createMetadata)({
|
|
15
18
|
description: `\`${COMP}\` displays plain text styled using markdown syntax.`,
|
|
16
19
|
themeVars: (0, themeVars_1.parseScssVar)(Markdown_module_scss_1.default.themeVars),
|
|
17
20
|
props: {
|
|
18
21
|
content: (0, ComponentDefs_1.d)("This property sets the markdown content to display."),
|
|
22
|
+
codeHighlighter: {
|
|
23
|
+
description: "This property sets the code highlighter to use.",
|
|
24
|
+
isInternal: true,
|
|
25
|
+
},
|
|
19
26
|
removeIndents: {
|
|
20
27
|
description: "This boolean property specifies whether leading indents should be " +
|
|
21
28
|
"removed from the markdown content. If set to `true`, the shortest " +
|
|
@@ -26,26 +33,33 @@ exports.MarkdownMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
26
33
|
},
|
|
27
34
|
},
|
|
28
35
|
defaultThemeVars: {
|
|
29
|
-
"backgroundColor-Admonition": "$color-
|
|
30
|
-
"borderRadius-Admonition": "$space-
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
+
"backgroundColor-Admonition": "$color-primary-100",
|
|
37
|
+
"borderRadius-Admonition": "$space-2",
|
|
38
|
+
"border-Admonition": "1px solid $color-primary-300",
|
|
39
|
+
"iconSize-Admonition": "$space-5",
|
|
40
|
+
"paddingLeft-Admonition": "$space-2",
|
|
41
|
+
"paddingRight-Admonition": "$space-6",
|
|
42
|
+
"paddingTop-Admonition": "$space-3",
|
|
43
|
+
"paddingBottom-Admonition": "$space-2",
|
|
44
|
+
"marginLeft-Admonition-content": "$space-1_5",
|
|
45
|
+
"marginTop-Admonition": "$space-7",
|
|
46
|
+
"marginBottom-Admonition": "$space-7",
|
|
47
|
+
"marginTop-Blockquote": "$space-7",
|
|
48
|
+
"marginBottom-Blockquote": "$space-7",
|
|
49
|
+
"paddingHorizontal-Blockquote": "$space-6",
|
|
50
|
+
"paddingTop-Blockquote": "$space-3",
|
|
51
|
+
"paddingBottom-Blockquote": "$space-2_5",
|
|
52
|
+
"backgroundColor-Blockquote": "$color-surface-100",
|
|
36
53
|
"accentWidth-Blockquote": "3px",
|
|
37
54
|
"accentColor-Blockquote": "$color-surface-500",
|
|
38
|
-
"
|
|
39
|
-
"marginBottom-
|
|
40
|
-
"marginBottom-Text-codefence": "$space-2",
|
|
41
|
-
"marginBottom-Text-markdown": "$space-2",
|
|
42
|
-
"marginTop-HtmlLi": "$space-2",
|
|
43
|
-
"marginBottom-HtmlLi": "$space-2",
|
|
55
|
+
"marginTop-HtmlLi": "$space-2_5",
|
|
56
|
+
"marginBottom-HtmlLi": "$space-2_5",
|
|
44
57
|
light: {
|
|
45
58
|
// --- No light-specific theme vars
|
|
46
59
|
},
|
|
47
60
|
dark: {
|
|
48
|
-
|
|
61
|
+
"backgroundColor-Blockquote": "$color-surface-50",
|
|
62
|
+
"backgroundColor-Admonition": "$color-primary-200",
|
|
49
63
|
},
|
|
50
64
|
},
|
|
51
65
|
});
|
|
@@ -56,7 +70,7 @@ exports.markdownComponentRenderer = (0, renderers_1.createComponentRenderer)(COM
|
|
|
56
70
|
if (!renderedChildren) {
|
|
57
71
|
renderedChildren = extractValue.asString(node.props.content);
|
|
58
72
|
}
|
|
59
|
-
// 2. "data" property fallback
|
|
73
|
+
// 2. "data" property fallback
|
|
60
74
|
if (!renderedChildren) {
|
|
61
75
|
renderedChildren = extractValue.asString(node.props.data);
|
|
62
76
|
}
|
|
@@ -69,7 +83,29 @@ exports.markdownComponentRenderer = (0, renderers_1.createComponentRenderer)(COM
|
|
|
69
83
|
}
|
|
70
84
|
});
|
|
71
85
|
}
|
|
72
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
86
|
+
return ((0, jsx_runtime_1.jsx)(TransformedMarkdown, { style: layoutCss, removeIndents: extractValue.asOptionalBoolean(node.props.removeIndents, true), codeHighlighter: extractValue(node.props.codeHighlighter), extractValue: extractValue, children: renderedChildren }));
|
|
73
87
|
});
|
|
88
|
+
const TransformedMarkdown = ({ children, removeIndents, style, extractValue, codeHighlighter, }) => {
|
|
89
|
+
const markdownContent = (0, react_1.useMemo)(() => {
|
|
90
|
+
if (typeof children !== "string") {
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
// --- Resolve binding expression values
|
|
94
|
+
// --- Resolve xmlui playground definitions
|
|
95
|
+
let resolvedMd = children;
|
|
96
|
+
while (true) {
|
|
97
|
+
const nextPlayground = (0, utils_1.observePlaygroundPattern)(resolvedMd);
|
|
98
|
+
if (!nextPlayground)
|
|
99
|
+
break;
|
|
100
|
+
resolvedMd =
|
|
101
|
+
resolvedMd.slice(0, nextPlayground[0]) +
|
|
102
|
+
(0, utils_1.convertPlaygroundPatternToMarkdown)(nextPlayground[2]) +
|
|
103
|
+
resolvedMd.slice(nextPlayground[1]);
|
|
104
|
+
}
|
|
105
|
+
resolvedMd = (0, parse_binding_expr_1.parseBindingExpression)(resolvedMd, extractValue);
|
|
106
|
+
return resolvedMd;
|
|
107
|
+
}, [children, extractValue]);
|
|
108
|
+
return ((0, jsx_runtime_1.jsx)(MarkdownNative_1.Markdown, { removeIndents: removeIndents, codeHighlighter: codeHighlighter, style: style, children: markdownContent }));
|
|
109
|
+
};
|
|
74
110
|
var MarkdownNative_2 = require("./MarkdownNative");
|
|
75
111
|
Object.defineProperty(exports, "Markdown", { enumerable: true, get: function () { return MarkdownNative_2.Markdown; } });
|