xmlui 0.9.51 → 0.9.53
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-BtGYrMWj.mjs → apiInterceptorWorker-CZW6DSTB.mjs} +3 -3
- package/dist/lib/{index-hS5S81ba.mjs → index-qpGKk07J.mjs} +13827 -12206
- 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/{metadata-utils-QekhOD-W.mjs → metadata-utils-4EQ6kQIM.mjs} +7 -7
- package/dist/lib/{server-common-CtY73qos.mjs → server-common-SNl_47nE.mjs} +2 -2
- package/dist/lib/{transform-DXcw0gGl.mjs → transform-CgRMkbb0.mjs} +1472 -1440
- package/dist/lib/xmlui-parser.d.ts +84 -62
- package/dist/lib/xmlui-parser.mjs +41 -49
- package/dist/lib/{xmlui-serializer-CAZCkpXP.mjs → xmlui-serializer-EDw51UFN.mjs} +10 -10
- package/dist/lib/xmlui.d.ts +17 -7
- package/dist/lib/xmlui.mjs +19 -18
- package/dist/metadata/apiInterceptorWorker-CC40OeUC.mjs +15414 -0
- package/dist/metadata/collectedComponentMetadata-C5DVNC6p.mjs +41262 -0
- package/dist/metadata/core-D3puiNN6.mjs +5771 -0
- package/dist/metadata/style.css +1 -1
- package/dist/metadata/wasm-DQxwEHae.mjs +7 -0
- package/dist/metadata/xmlui-metadata.mjs +3 -18398
- package/dist/metadata/xmlui-metadata.umd.js +549 -10
- package/dist/scripts/package.json +5 -6
- package/dist/scripts/src/components/APICall/APICall.js +13 -12
- package/dist/scripts/src/components/APICall/APICallNative.js +5 -0
- package/dist/scripts/src/components/Accordion/Accordion.js +4 -2
- package/dist/scripts/src/components/Accordion/AccordionItem.js +2 -2
- package/dist/scripts/src/components/Accordion/AccordionItemNative.js +6 -2
- package/dist/scripts/src/components/App/App.js +22 -9
- package/dist/scripts/src/components/App/AppNative.js +9 -1
- package/dist/scripts/src/components/AppHeader/AppHeader.js +2 -2
- package/dist/scripts/src/components/AppHeader/AppHeaderNative.js +5 -2
- package/dist/scripts/src/components/AppState/AppState.js +2 -2
- package/dist/scripts/src/components/AppState/AppStateNative.js +5 -1
- package/dist/scripts/src/components/AutoComplete/AutoComplete.js +8 -8
- package/dist/scripts/src/components/AutoComplete/AutoCompleteNative.js +16 -2
- package/dist/scripts/src/components/Avatar/Avatar.js +4 -2
- package/dist/scripts/src/components/Backdrop/Backdrop.js +2 -2
- package/dist/scripts/src/components/Badge/Badge.js +7 -5
- package/dist/scripts/src/components/Bookmark/Bookmark.js +5 -4
- package/dist/scripts/src/components/Card/Card.js +6 -4
- package/dist/scripts/src/components/ChangeListener/ChangeListener.js +2 -1
- package/dist/scripts/src/components/Charts/BarChart/BarChart.js +76 -0
- package/dist/scripts/src/components/Charts/BarChart/BarChartNative.js +108 -0
- package/dist/scripts/src/components/Charts/DonutChart/DonutChart.js +59 -0
- package/dist/scripts/src/components/Charts/LabelList/LabelList.js +38 -0
- package/dist/scripts/src/components/Charts/LabelList/LabelListNative.js +24 -0
- package/dist/scripts/src/components/Charts/Legend/Legend.js +30 -0
- package/dist/scripts/src/components/Charts/Legend/LegendNative.js +64 -0
- package/dist/scripts/src/components/Charts/LineChart/LineChart.js +53 -0
- package/dist/scripts/src/components/Charts/LineChart/LineChartNative.js +103 -0
- package/dist/scripts/src/components/Charts/PieChart/PieChart.js +58 -0
- package/dist/scripts/src/components/Charts/PieChart/PieChartNative.js +127 -0
- package/dist/scripts/src/components/Charts/Tooltip/TooltipContent.js +27 -0
- package/dist/scripts/src/components/Charts/utils/ChartProvider.js +65 -0
- package/dist/scripts/src/components/Charts/utils/abstractions.js +26 -0
- package/dist/scripts/src/components/CodeBlock/CodeBlock.js +4 -4
- package/dist/scripts/src/components/CodeBlock/CodeBlockNative.js +5 -1
- package/dist/scripts/src/components/Column/Column.js +15 -9
- package/dist/scripts/src/components/Column/ColumnNative.js +5 -0
- package/dist/scripts/src/components/ComponentProvider.js +14 -6
- package/dist/scripts/src/components/ContentSeparator/ContentSeparator.js +4 -3
- package/dist/scripts/src/components/DatePicker/DatePicker.js +5 -3
- package/dist/scripts/src/components/EmojiSelector/EmojiSelector.js +1 -1
- package/dist/scripts/src/components/EmojiSelector/EmojiSelectorNative.js +7 -2
- package/dist/scripts/src/components/ExpandableItem/ExpandableItem.js +88 -0
- package/dist/scripts/src/components/ExpandableItem/ExpandableItemNative.js +91 -0
- package/dist/scripts/src/components/FileInput/FileInput.js +8 -9
- package/dist/scripts/src/components/FileInput/FileInputNative.js +14 -2
- package/dist/scripts/src/components/FileUploadDropZone/FileUploadDropZone.js +2 -2
- package/dist/scripts/src/components/FileUploadDropZone/FileUploadDropZoneNative.js +9 -2
- package/dist/scripts/src/components/Footer/Footer.js +1 -0
- package/dist/scripts/src/components/Footer/FooterNative.js +4 -1
- package/dist/scripts/src/components/Form/Form.js +9 -5
- package/dist/scripts/src/components/Form/FormNative.js +2 -1
- package/dist/scripts/src/components/FormItem/FormItem.js +25 -15
- package/dist/scripts/src/components/FormItem/FormItemNative.js +1 -0
- package/dist/scripts/src/components/Heading/Heading.js +12 -6
- package/dist/scripts/src/components/Heading/HeadingNative.js +7 -0
- package/dist/scripts/src/components/Icon/Icon.js +7 -5
- package/dist/scripts/src/components/Image/Image.js +19 -9
- package/dist/scripts/src/components/Image/ImageNative.js +7 -2
- package/dist/scripts/src/components/Items/Items.js +2 -0
- package/dist/scripts/src/components/Items/ItemsNative.js +5 -1
- package/dist/scripts/src/components/Link/Link.js +3 -4
- package/dist/scripts/src/components/Link/LinkNative.js +6 -2
- package/dist/scripts/src/components/List/List.js +12 -11
- package/dist/scripts/src/components/List/ListNative.js +10 -2
- package/dist/scripts/src/components/Logo/Logo.js +7 -0
- package/dist/scripts/src/components/Logo/LogoNative.js +6 -2
- package/dist/scripts/src/components/Markdown/Markdown.js +5 -4
- package/dist/scripts/src/components/Markdown/MarkdownNative.js +64 -21
- package/dist/scripts/src/components/Markdown/utils.js +23 -1
- package/dist/scripts/src/components/ModalDialog/ModalDialog.js +2 -2
- package/dist/scripts/src/components/ModalDialog/ModalDialogNative.js +7 -2
- package/dist/scripts/src/components/NavGroup/NavGroup.js +2 -1
- package/dist/scripts/src/components/NavLink/NavLink.js +5 -7
- package/dist/scripts/src/components/NavLink/NavLinkNative.js +7 -2
- package/dist/scripts/src/components/NavPanel/NavPanel.js +6 -0
- package/dist/scripts/src/components/NavPanel/NavPanelNative.js +6 -2
- package/dist/scripts/src/components/NestedApp/NestedApp.js +16 -4
- package/dist/scripts/src/components/NestedApp/NestedAppNative.js +37 -34
- package/dist/scripts/src/components/NestedApp/defaultProps.js +10 -0
- package/dist/scripts/src/components/NoResult/NoResult.js +6 -2
- package/dist/scripts/src/components/NoResult/NoResultNative.js +8 -3
- package/dist/scripts/src/components/NumberBox/NumberBox.js +8 -6
- package/dist/scripts/src/components/NumberBox/NumberBox2.js +6 -6
- package/dist/scripts/src/components/NumberBox/NumberBox2Native.js +15 -2
- package/dist/scripts/src/components/NumberBox/NumberBoxNative.js +16 -2
- package/dist/scripts/src/components/Option/Option.js +10 -15
- package/dist/scripts/src/components/Option/OptionNative.js +18 -0
- package/dist/scripts/src/components/PageMetaTitle/PageMetaTilteNative.js +6 -2
- package/dist/scripts/src/components/PageMetaTitle/PageMetaTitle.js +4 -1
- package/dist/scripts/src/components/Pages/Pages.js +7 -3
- package/dist/scripts/src/components/Pages/PagesNative.js +5 -0
- package/dist/scripts/src/components/ProgressBar/ProgressBar.js +1 -1
- package/dist/scripts/src/components/ProgressBar/ProgressBarNative.js +5 -2
- package/dist/scripts/src/components/Queue/Queue.js +11 -6
- package/dist/scripts/src/components/Queue/QueueNative.js +7 -1
- package/dist/scripts/src/components/RadioGroup/RadioGroup.js +5 -5
- package/dist/scripts/src/components/RadioGroup/RadioGroupNative.js +9 -2
- package/dist/scripts/src/components/RadioGroup/RadioItem.js +8 -2
- package/dist/scripts/src/components/RadioGroup/RadioItemNative.js +6 -2
- package/dist/scripts/src/components/RealTimeAdapter/RealTimeAdapter.js +4 -1
- package/dist/scripts/src/components/RealTimeAdapter/RealTimeAdapterNative.js +4 -0
- package/dist/scripts/src/components/Redirect/Redirect.js +8 -2
- package/dist/scripts/src/components/Select/Select.js +21 -12
- package/dist/scripts/src/components/Select/SelectNative.js +15 -2
- package/dist/scripts/src/components/SelectionStore/SelectionStore.js +6 -3
- package/dist/scripts/src/components/SelectionStore/SelectionStoreNative.js +6 -2
- package/dist/scripts/src/components/Slider/Slider.js +28 -9
- package/dist/scripts/src/components/Slider/SliderNative.js +14 -3
- package/dist/scripts/src/components/Spinner/Spinner.js +2 -2
- package/dist/scripts/src/components/Spinner/SpinnerNative.js +6 -2
- package/dist/scripts/src/components/Splitter/Splitter.js +6 -6
- package/dist/scripts/src/components/Splitter/SplitterNative.js +10 -2
- package/dist/scripts/src/components/Stack/Stack.js +4 -4
- package/dist/scripts/src/components/Stack/StackNative.js +8 -2
- package/dist/scripts/src/components/StickyBox/StickyBox.js +1 -1
- package/dist/scripts/src/components/StickyBox/StickyBoxNative.js +7 -1
- package/dist/scripts/src/components/Table/Table.js +15 -14
- package/dist/scripts/src/components/Table/TableNative.js +25 -9
- package/dist/scripts/src/components/TableOfContents/TableOfContents.js +12 -3
- package/dist/scripts/src/components/TableOfContents/TableOfContentsNative.js +6 -2
- package/dist/scripts/src/components/Tabs/Tabs.js +2 -2
- package/dist/scripts/src/components/Tabs/TabsNative.js +7 -2
- package/dist/scripts/src/components/Text/Text.js +14 -13
- package/dist/scripts/src/components/Text/TextNative.js +7 -2
- package/dist/scripts/src/components/TextArea/TextArea.js +8 -5
- package/dist/scripts/src/components/TextArea/TextAreaNative.js +19 -2
- package/dist/scripts/src/components/TextBox/TextBox.js +5 -4
- package/dist/scripts/src/components/TextBox/TextBoxNative.js +14 -2
- package/dist/scripts/src/components/Theme/Theme.js +1 -1
- package/dist/scripts/src/components/Theme/ThemeNative.js +10 -14
- package/dist/scripts/src/components/ToneChangerButton/ToneChangerButton.js +18 -8
- package/dist/scripts/src/components/TreeDisplay/TreeDisplay.js +1 -1
- package/dist/scripts/src/components/TreeDisplay/TreeDisplayNative.js +2 -1
- package/dist/scripts/src/components/ValidationSummary/ValidationSummary.js +3 -57
- package/dist/scripts/src/components/ValidationSummary/ValidationSummaryNative.js +64 -0
- package/dist/scripts/src/components/metadata-helpers.js +11 -8
- package/dist/scripts/src/components-core/InspectorContext.js +2 -7
- package/dist/scripts/src/components-core/interception/ApiInterceptor.js +1 -1
- package/dist/scripts/src/components-core/interception/ApiInterceptorProvider.js +6 -2
- package/dist/scripts/src/components-core/loader/DataLoader.js +1 -1
- package/dist/scripts/src/components-core/loader/Loader.js +7 -3
- package/dist/scripts/src/components-core/theming/themes/palette.js +5 -4
- package/dist/scripts/src/components-core/theming/themes/root.js +5 -4
- package/dist/scripts/src/components-core/theming/transformThemeVars.js +1 -17
- package/dist/scripts/src/parsers/xmlui-parser/diagnostics.js +92 -48
- package/dist/scripts/src/parsers/xmlui-parser/parser.js +179 -189
- package/dist/standalone/xmlui-standalone.es.d.ts +235 -223
- package/dist/standalone/xmlui-standalone.umd.js +288 -316
- package/package.json +5 -6
|
@@ -14,7 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.LinkNative = void 0;
|
|
17
|
+
exports.LinkNative = exports.defaultProps = void 0;
|
|
18
18
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
19
|
const react_1 = require("react");
|
|
20
20
|
const react_2 = require("@remix-run/react");
|
|
@@ -22,8 +22,12 @@ const classnames_1 = __importDefault(require("classnames"));
|
|
|
22
22
|
const Link_module_scss_1 = __importDefault(require("./Link.module.scss"));
|
|
23
23
|
const component_utils_1 = require("../component-utils");
|
|
24
24
|
const IconNative_1 = require("../Icon/IconNative");
|
|
25
|
+
exports.defaultProps = {
|
|
26
|
+
active: false,
|
|
27
|
+
disabled: false,
|
|
28
|
+
};
|
|
25
29
|
exports.LinkNative = (0, react_1.forwardRef)(function LinkNative(props, forwardedRef) {
|
|
26
|
-
const _a = specifyTypes(props), { to, children, icon, active, onClick, target, disabled, style } = _a, anchorProps = __rest(_a, ["to", "children", "icon", "active", "onClick", "target", "disabled", "style"]);
|
|
30
|
+
const _a = specifyTypes(props), { to, children, icon, active = exports.defaultProps.active, onClick, target, disabled = exports.defaultProps.disabled, style } = _a, anchorProps = __rest(_a, ["to", "children", "icon", "active", "onClick", "target", "disabled", "style"]);
|
|
27
31
|
const iconLink = !!icon && !children;
|
|
28
32
|
const smartTo = (0, react_1.useMemo)(() => {
|
|
29
33
|
return (0, component_utils_1.createUrlWithQueryParams)(to);
|
|
@@ -28,17 +28,18 @@ exports.ListMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
28
28
|
`When both \`items\` and \`data\` are used, \`items\` has priority.`),
|
|
29
29
|
loading: (0, ComponentDefs_1.d)(`This property delays the rendering of children until it is set to \`false\`, or the ` +
|
|
30
30
|
`component receives usable list items via the [\`data\`](#data) property.`),
|
|
31
|
-
limit: (0, ComponentDefs_1.d)(`This property limits the number of items displayed in the \`${COMP}
|
|
31
|
+
limit: (0, ComponentDefs_1.d)(`This property limits the number of items displayed in the \`${COMP}\`. If not set, all items are displayed.`),
|
|
32
32
|
scrollAnchor: {
|
|
33
33
|
description: `This property pins the scroll position to a specified location of the list. Available values are shown below.`,
|
|
34
34
|
availableValues: abstractions_1.scrollAnchoringValues,
|
|
35
35
|
type: "string",
|
|
36
|
-
defaultValue:
|
|
36
|
+
defaultValue: ListNative_1.defaultProps.scrollAnchor,
|
|
37
37
|
},
|
|
38
|
-
groupBy: (0, ComponentDefs_1.d)(
|
|
39
|
-
|
|
40
|
-
orderBy: (0, ComponentDefs_1.d)(`This property enables the ordering of list items by specifying an attribute in the data.`),
|
|
41
|
-
availableGroups: (0, ComponentDefs_1.d)(`This property is an array of group names that the \`${COMP}\` will display
|
|
38
|
+
groupBy: (0, ComponentDefs_1.d)("This property sets which data item property is used to group the list items. If not set, " +
|
|
39
|
+
"no grouping is done."),
|
|
40
|
+
orderBy: (0, ComponentDefs_1.d)(`This optioanl property enables the ordering of list items by specifying an attribute in the data.`),
|
|
41
|
+
availableGroups: (0, ComponentDefs_1.d)(`This property is an array of group names that the \`${COMP}\` will display. ` +
|
|
42
|
+
"If not set, all groups in the data are displayed."),
|
|
42
43
|
groupHeaderTemplate: (0, metadata_helpers_1.dComponent)(`Enables the customization of how the groups are displayed, similarly to the ` +
|
|
43
44
|
`[\`itemTemplate\`](#itemtemplate). You can use the \`$item\` context variable to access ` +
|
|
44
45
|
`an item group and map its individual attributes.`),
|
|
@@ -53,22 +54,22 @@ exports.ListMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
53
54
|
idKey: {
|
|
54
55
|
description: "Denotes which attribute of an item acts as the ID or key of the item",
|
|
55
56
|
type: "string",
|
|
56
|
-
defaultValue:
|
|
57
|
+
defaultValue: ListNative_1.defaultProps.idKey,
|
|
57
58
|
},
|
|
58
|
-
groupsInitiallyExpanded: (0, ComponentDefs_1.d)(`This Boolean property defines whether the list groups are initially expanded
|
|
59
|
-
defaultGroups: (0, ComponentDefs_1.d)(`This property adds
|
|
59
|
+
groupsInitiallyExpanded: (0, ComponentDefs_1.d)(`This Boolean property defines whether the list groups are initially expanded.`, undefined, "boolean", ListNative_1.defaultProps.groupsInitiallyExpanded),
|
|
60
|
+
defaultGroups: (0, ComponentDefs_1.d)(`This property adds an optional list of default groups for the \`${COMP}\` and displays the group ` +
|
|
60
61
|
`headers in the specified order. If the data contains group headers not in this list, ` +
|
|
61
62
|
`those headers are also displayed (after the ones in this list); however, their order ` +
|
|
62
63
|
`is not deterministic.`),
|
|
63
64
|
hideEmptyGroups: {
|
|
64
65
|
description: "This boolean property indicates if empty groups should be hidden (no header and footer are displayed).",
|
|
65
66
|
valueType: "boolean",
|
|
66
|
-
defaultValue:
|
|
67
|
+
defaultValue: ListNative_1.defaultProps.hideEmptyGroups,
|
|
67
68
|
},
|
|
68
69
|
borderCollapse: {
|
|
69
70
|
description: "Collapse items borders",
|
|
70
71
|
valueType: "boolean",
|
|
71
|
-
defaultValue:
|
|
72
|
+
defaultValue: ListNative_1.defaultProps.borderCollapse,
|
|
72
73
|
},
|
|
73
74
|
},
|
|
74
75
|
childrenAsTemplate: "itemTemplate",
|
|
@@ -45,7 +45,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
45
45
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
46
46
|
};
|
|
47
47
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
-
exports.ListNative = exports.ListContext = void 0;
|
|
48
|
+
exports.ListNative = exports.ListContext = exports.defaultProps = void 0;
|
|
49
49
|
exports.useListData = useListData;
|
|
50
50
|
exports.MemoizedSection = MemoizedSection;
|
|
51
51
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
@@ -63,6 +63,14 @@ const misc_1 = require("../../components-core/utils/misc");
|
|
|
63
63
|
const SpinnerNative_1 = require("../Spinner/SpinnerNative");
|
|
64
64
|
const TextNative_1 = require("../Text/TextNative");
|
|
65
65
|
const container_helpers_1 = require("../container-helpers");
|
|
66
|
+
// Default props for List component
|
|
67
|
+
exports.defaultProps = {
|
|
68
|
+
idKey: "id",
|
|
69
|
+
scrollAnchor: "top",
|
|
70
|
+
hideEmptyGroups: true,
|
|
71
|
+
borderCollapse: true,
|
|
72
|
+
groupsInitiallyExpanded: true,
|
|
73
|
+
};
|
|
66
74
|
exports.ListContext = react_1.default.createContext({
|
|
67
75
|
isExpanded: (id) => false,
|
|
68
76
|
toggleExpanded: (id, isExpanded) => { },
|
|
@@ -208,7 +216,7 @@ const useShift = (listData, idKey) => {
|
|
|
208
216
|
}
|
|
209
217
|
return shouldShift.current;
|
|
210
218
|
};
|
|
211
|
-
exports.ListNative = (0, react_1.forwardRef)(function DynamicHeightList({ items = constants_1.EMPTY_ARRAY, itemRenderer = defaultItemRenderer, sectionRenderer, sectionFooterRenderer, loading, limit, groupBy, orderBy, availableGroups, scrollAnchor =
|
|
219
|
+
exports.ListNative = (0, react_1.forwardRef)(function DynamicHeightList({ items = constants_1.EMPTY_ARRAY, itemRenderer = defaultItemRenderer, sectionRenderer, sectionFooterRenderer, loading, limit, groupBy, orderBy, availableGroups, scrollAnchor = exports.defaultProps.scrollAnchor, requestFetchPrevPage = lodash_es_1.noop, requestFetchNextPage = lodash_es_1.noop, pageInfo, idKey = exports.defaultProps.idKey, style, emptyListPlaceholder, groupsInitiallyExpanded = true, defaultGroups = constants_1.EMPTY_ARRAY, registerComponentApi, borderCollapse = exports.defaultProps.borderCollapse, }, ref) {
|
|
212
220
|
var _a;
|
|
213
221
|
const virtualizerRef = (0, react_1.useRef)(null);
|
|
214
222
|
const scrollRef = (0, react_1.useContext)(ScrollContext_1.ScrollContext);
|
|
@@ -10,6 +10,13 @@ exports.LogoMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
10
10
|
status: "experimental",
|
|
11
11
|
description: `The \`${COMP}\` component represents a logo or a brand symbol. Usually, you use ` +
|
|
12
12
|
`this component in the [\`AppHeader\`](./AppHeader.mdx#logotemplate).`,
|
|
13
|
+
props: {
|
|
14
|
+
alt: {
|
|
15
|
+
description: "Alternative text for the logo image for accessibility.",
|
|
16
|
+
type: "string",
|
|
17
|
+
defaultValue: LogoNative_1.defaultProps.alt,
|
|
18
|
+
}
|
|
19
|
+
}
|
|
13
20
|
});
|
|
14
21
|
exports.logoComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.LogoMd, ({ node, layoutCss, extractValue }) => {
|
|
15
22
|
return (0, jsx_runtime_1.jsx)(LogoNative_1.Logo, { style: layoutCss });
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Logo = void 0;
|
|
3
|
+
exports.Logo = exports.defaultProps = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const ImageNative_1 = require("../Image/ImageNative");
|
|
7
7
|
const AppHeaderNative_1 = require("../AppHeader/AppHeaderNative");
|
|
8
|
+
// Default props for Logo component
|
|
9
|
+
exports.defaultProps = {
|
|
10
|
+
alt: "Logo",
|
|
11
|
+
};
|
|
8
12
|
exports.Logo = (0, react_1.forwardRef)(function Logo({ style, }, forwardedRef) {
|
|
9
13
|
const logoUrl = (0, AppHeaderNative_1.useLogoUrl)();
|
|
10
14
|
if (!logoUrl) {
|
|
11
15
|
return null;
|
|
12
16
|
}
|
|
13
17
|
//width auto for safari
|
|
14
|
-
return ((0, jsx_runtime_1.jsx)(ImageNative_1.Image, { ref: forwardedRef, src: logoUrl, alt:
|
|
18
|
+
return ((0, jsx_runtime_1.jsx)(ImageNative_1.Image, { ref: forwardedRef, src: logoUrl, alt: exports.defaultProps.alt, style: Object.assign({ width: "auto", boxShadow: "none" }, style) }));
|
|
15
19
|
});
|
|
@@ -18,7 +18,9 @@ exports.MarkdownMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
18
18
|
description: `\`${COMP}\` displays plain text styled using markdown syntax.`,
|
|
19
19
|
themeVars: (0, themeVars_1.parseScssVar)(Markdown_module_scss_1.default.themeVars),
|
|
20
20
|
props: {
|
|
21
|
-
content: (0, ComponentDefs_1.d)("This property sets the markdown content to display."
|
|
21
|
+
content: (0, ComponentDefs_1.d)("This property sets the markdown content to display. Alternatively, you can nest " +
|
|
22
|
+
"the markdown content as a child in a CDATA section. In neither this property " +
|
|
23
|
+
"value nor any child is defined, empty content is displayed."),
|
|
22
24
|
codeHighlighter: {
|
|
23
25
|
description: "This property sets the code highlighter to use.",
|
|
24
26
|
isInternal: true,
|
|
@@ -29,14 +31,13 @@ exports.MarkdownMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
29
31
|
"indent found at the start of the content lines is removed from the " +
|
|
30
32
|
"beginning of every line.",
|
|
31
33
|
valueType: "boolean",
|
|
32
|
-
defaultValue:
|
|
34
|
+
defaultValue: MarkdownNative_1.defaultProps.removeIndents,
|
|
33
35
|
},
|
|
34
36
|
showHeadingAnchors: {
|
|
35
37
|
description: "This boolean property specifies whether heading anchors should be " +
|
|
36
38
|
"displayed. If set to `true`, heading anchors will be displayed on hover " +
|
|
37
39
|
"next to headings.",
|
|
38
40
|
valueType: "boolean",
|
|
39
|
-
defaultValue: false,
|
|
40
41
|
},
|
|
41
42
|
},
|
|
42
43
|
defaultThemeVars: {
|
|
@@ -98,7 +99,7 @@ exports.markdownComponentRenderer = (0, renderers_1.createComponentRenderer)(COM
|
|
|
98
99
|
}
|
|
99
100
|
});
|
|
100
101
|
}
|
|
101
|
-
return ((0, jsx_runtime_1.jsx)(TransformedMarkdown, { style: layoutCss, removeIndents: extractValue.asOptionalBoolean(node.props.removeIndents, true), codeHighlighter: extractValue(node.props.codeHighlighter), extractValue: extractValue, showHeadingAnchors: extractValue.asOptionalBoolean(node.props.showHeadingAnchors
|
|
102
|
+
return ((0, jsx_runtime_1.jsx)(TransformedMarkdown, { style: layoutCss, removeIndents: extractValue.asOptionalBoolean(node.props.removeIndents, true), codeHighlighter: extractValue(node.props.codeHighlighter), extractValue: extractValue, showHeadingAnchors: extractValue.asOptionalBoolean(node.props.showHeadingAnchors), children: renderedChildren }));
|
|
102
103
|
});
|
|
103
104
|
const TransformedMarkdown = ({ children, removeIndents, style, extractValue, codeHighlighter, showHeadingAnchors, }) => {
|
|
104
105
|
const markdownContent = (0, react_1.useMemo)(() => {
|
|
@@ -47,7 +47,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
47
47
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
48
48
|
};
|
|
49
49
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
|
-
exports.Markdown = void 0;
|
|
50
|
+
exports.Markdown = exports.defaultProps = void 0;
|
|
51
51
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
52
52
|
const react_1 = __importStar(require("react"));
|
|
53
53
|
const react_markdown_1 = __importDefault(require("react-markdown"));
|
|
@@ -68,6 +68,11 @@ const classnames_1 = __importDefault(require("classnames"));
|
|
|
68
68
|
const IconNative_1 = __importDefault(require("../Icon/IconNative"));
|
|
69
69
|
const TreeDisplayNative_1 = require("../TreeDisplay/TreeDisplayNative");
|
|
70
70
|
const unist_util_visit_1 = require("unist-util-visit");
|
|
71
|
+
const ExpandableItemNative_1 = require("../ExpandableItem/ExpandableItemNative");
|
|
72
|
+
// Default props for the Markdown component
|
|
73
|
+
exports.defaultProps = {
|
|
74
|
+
removeIndents: true,
|
|
75
|
+
};
|
|
71
76
|
function PreTagComponent({ id, children, codeHighlighter }) {
|
|
72
77
|
// TEMP: After ironing out theming for syntax highlighting, this should be removed
|
|
73
78
|
const { activeThemeTone } = (0, ThemeContext_1.useTheme)();
|
|
@@ -91,7 +96,7 @@ function PreTagComponent({ id, children, codeHighlighter }) {
|
|
|
91
96
|
}
|
|
92
97
|
return ((0, jsx_runtime_1.jsx)(CodeBlockNative_1.CodeBlock, { meta: highlighterResult.meta, textToCopy: highlighterResult.codeStr, children: (0, jsx_runtime_1.jsx)(TextNative_1.Text, { uid: id, variant: "codefence", syntaxHighlightClasses: highlighterResult.classNames, dangerouslySetInnerHTML: { __html: highlighterResult.cleanedHtmlStr } }) }));
|
|
93
98
|
}
|
|
94
|
-
exports.Markdown = (0, react_1.memo)(function Markdown({ removeIndents =
|
|
99
|
+
exports.Markdown = (0, react_1.memo)(function Markdown({ removeIndents = exports.defaultProps.removeIndents, children, style, codeHighlighter, showHeadingAnchors, }) {
|
|
95
100
|
if (typeof children !== "string") {
|
|
96
101
|
return null;
|
|
97
102
|
}
|
|
@@ -110,6 +115,7 @@ exports.Markdown = (0, react_1.memo)(function Markdown({ removeIndents = true, c
|
|
|
110
115
|
return ((0, jsx_runtime_1.jsx)("div", { className: Markdown_module_scss_1.default.markdownContent, style: style, children: (0, jsx_runtime_1.jsx)(react_markdown_1.default, { remarkPlugins: [remark_gfm_1.default, CodeBlockNative_1.markdownCodeBlockParser, markdownImgParser], rehypePlugins: [rehype_raw_1.default], components: {
|
|
111
116
|
details(_a) {
|
|
112
117
|
var { children, node } = _a, props = __rest(_a, ["children", "node"]);
|
|
118
|
+
console.log("details", children);
|
|
113
119
|
return ((0, jsx_runtime_1.jsx)("details", Object.assign({ className: HtmlTags_module_scss_1.default.htmlDetails }, props, { children: children })));
|
|
114
120
|
},
|
|
115
121
|
video(_a) {
|
|
@@ -118,7 +124,6 @@ exports.Markdown = (0, react_1.memo)(function Markdown({ removeIndents = true, c
|
|
|
118
124
|
},
|
|
119
125
|
img(_a) {
|
|
120
126
|
var { children, node } = _a, props = __rest(_a, ["children", "node"]);
|
|
121
|
-
console.log("img", node);
|
|
122
127
|
const src = props === null || props === void 0 ? void 0 : props.src;
|
|
123
128
|
const popOut = props === null || props === void 0 ? void 0 : props["data-popout"];
|
|
124
129
|
const alt = (props === null || props === void 0 ? void 0 : props.alt) || "";
|
|
@@ -267,19 +272,12 @@ const Blockquote = ({ children, style }) => {
|
|
|
267
272
|
};
|
|
268
273
|
// Extract all text content
|
|
269
274
|
const allText = react_1.default.Children.toArray(children).map(extractTextContent).join("");
|
|
270
|
-
// Check for
|
|
275
|
+
// Check for adornment pattern
|
|
271
276
|
const match = allText.match(/\[!([A-Z]+)\]/);
|
|
272
|
-
const
|
|
273
|
-
if (
|
|
277
|
+
const isAdornment = !!match;
|
|
278
|
+
if (isAdornment && match && match[1]) {
|
|
274
279
|
const type = match[1].toLowerCase();
|
|
275
|
-
|
|
276
|
-
info: (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "admonition_info" }),
|
|
277
|
-
warning: (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "admonition_warning" }),
|
|
278
|
-
danger: (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "admonition_danger" }),
|
|
279
|
-
note: (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "admonition_note" }),
|
|
280
|
-
tip: (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "admonition_tip" }),
|
|
281
|
-
};
|
|
282
|
-
// Process children to remove the admonition marker
|
|
280
|
+
// Process children to remove the adornment marker
|
|
283
281
|
const processNode = (node) => {
|
|
284
282
|
if (typeof node === "string") {
|
|
285
283
|
return node.replace(/\[!([A-Z]+)\]\s*/, "");
|
|
@@ -303,7 +301,49 @@ const Blockquote = ({ children, style }) => {
|
|
|
303
301
|
return node;
|
|
304
302
|
};
|
|
305
303
|
const processedChildren = react_1.default.Children.map(children, processNode);
|
|
306
|
-
//
|
|
304
|
+
// Handle [!DETAILS] or [!SDETAILS] adornment
|
|
305
|
+
if (type === "details" || type === "sdetails") {
|
|
306
|
+
// Extract summary from the original text
|
|
307
|
+
const originalText = allText;
|
|
308
|
+
const detailsMatch = originalText.match(/\[!(S?DETAILS)\](.*?)(?:\n|$)/);
|
|
309
|
+
const summaryText = detailsMatch && detailsMatch[2] ? detailsMatch[2].trim() : "Details";
|
|
310
|
+
const withSwitch = type === "sdetails";
|
|
311
|
+
// Create separate content children without the summary line
|
|
312
|
+
// We need to find the first Text element and remove the summary from it
|
|
313
|
+
let contentWithoutSummary = [];
|
|
314
|
+
let foundFirstTextElement = false;
|
|
315
|
+
react_1.default.Children.forEach(processedChildren, (child, index) => {
|
|
316
|
+
var _a;
|
|
317
|
+
// Process the first text element to remove the summary line
|
|
318
|
+
if (!foundFirstTextElement && react_1.default.isValidElement(child) && ((_a = child.props) === null || _a === void 0 ? void 0 : _a.children)) {
|
|
319
|
+
foundFirstTextElement = true;
|
|
320
|
+
// Get the child's text content
|
|
321
|
+
const childText = extractTextContent(child.props.children);
|
|
322
|
+
// Skip the first line which contains the summary
|
|
323
|
+
const lines = childText.split('\n');
|
|
324
|
+
if (lines.length > 1) {
|
|
325
|
+
// Create modified element with remaining content
|
|
326
|
+
const remainingContent = lines.slice(1).join('\n');
|
|
327
|
+
if (remainingContent.trim()) {
|
|
328
|
+
contentWithoutSummary.push(react_1.default.cloneElement(child, child.props, remainingContent));
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
else {
|
|
333
|
+
// Keep all other elements unchanged
|
|
334
|
+
contentWithoutSummary.push(child);
|
|
335
|
+
}
|
|
336
|
+
});
|
|
337
|
+
return ((0, jsx_runtime_1.jsx)(ExpandableItemNative_1.ExpandableItem, { summary: summaryText, withSwitch: withSwitch, children: contentWithoutSummary }));
|
|
338
|
+
}
|
|
339
|
+
const iconMap = {
|
|
340
|
+
info: (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "admonition_info" }),
|
|
341
|
+
warning: (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "admonition_warning" }),
|
|
342
|
+
danger: (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "admonition_danger" }),
|
|
343
|
+
note: (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "admonition_note" }),
|
|
344
|
+
tip: (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "admonition_tip" }),
|
|
345
|
+
};
|
|
346
|
+
// Render adornment blockquote with the updated structure
|
|
307
347
|
return ((0, jsx_runtime_1.jsx)("blockquote", { className: (0, classnames_1.default)(Markdown_module_scss_1.default.admonitionBlockquote, {
|
|
308
348
|
[Markdown_module_scss_1.default.info]: type === "info",
|
|
309
349
|
[Markdown_module_scss_1.default.warning]: type === "warning",
|
|
@@ -314,13 +354,12 @@ const Blockquote = ({ children, style }) => {
|
|
|
314
354
|
}
|
|
315
355
|
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 }) }));
|
|
316
356
|
};
|
|
317
|
-
const OrderedList = ({ children, style }) => {
|
|
318
|
-
return ((0, jsx_runtime_1.jsx)("ol", { className: Markdown_module_scss_1.default.orderedList, style: style, children: children }));
|
|
319
|
-
};
|
|
320
|
-
const ListItem = ({ children, style }) => {
|
|
321
|
-
return ((0, jsx_runtime_1.jsx)("li", { className: Markdown_module_scss_1.default.listItem, style: style, children: children }));
|
|
322
|
-
};
|
|
323
357
|
function LinkAwareHeading({ children, level, showHeadingAnchors }) {
|
|
358
|
+
var _a, _b;
|
|
359
|
+
const appContext = (0, AppContext_1.useAppContext)();
|
|
360
|
+
if (showHeadingAnchors === undefined) {
|
|
361
|
+
showHeadingAnchors = (_b = (_a = appContext === null || appContext === void 0 ? void 0 : appContext.appGlobals) === null || _a === void 0 ? void 0 : _a.showHeadingAnchors) !== null && _b !== void 0 ? _b : false;
|
|
362
|
+
}
|
|
324
363
|
let headingLabel = "";
|
|
325
364
|
let anchorId = "";
|
|
326
365
|
if (!children)
|
|
@@ -344,6 +383,10 @@ function LinkAwareHeading({ children, level, showHeadingAnchors }) {
|
|
|
344
383
|
if (match && match.length > 0) {
|
|
345
384
|
anchorId = match[1];
|
|
346
385
|
}
|
|
386
|
+
else {
|
|
387
|
+
// --- Generate a valid anchor ID from the last element
|
|
388
|
+
anchorId = headingToAnchorLink(extractTextNodes(last));
|
|
389
|
+
}
|
|
347
390
|
}
|
|
348
391
|
}
|
|
349
392
|
}
|
|
@@ -77,6 +77,20 @@ function parseSegmentProps(input) {
|
|
|
77
77
|
if (heightMatch) {
|
|
78
78
|
segment.height = heightMatch[1];
|
|
79
79
|
}
|
|
80
|
+
// Match patterns enclosed in /pattern/ format
|
|
81
|
+
const patternMatches = input.match(/\/([^\/]+)\//g);
|
|
82
|
+
if (patternMatches) {
|
|
83
|
+
segment.patterns = patternMatches.map(pattern =>
|
|
84
|
+
// Remove the surrounding slashes
|
|
85
|
+
pattern.substring(1, pattern.length - 1));
|
|
86
|
+
}
|
|
87
|
+
// Match bordered patterns enclosed in !/pattern/ format
|
|
88
|
+
const borderedPatternMatches = input.match(/!\/(.[^\/]+)\//g);
|
|
89
|
+
if (borderedPatternMatches) {
|
|
90
|
+
segment.borderedPatterns = borderedPatternMatches.map(pattern =>
|
|
91
|
+
// Remove the leading !/ and trailing /
|
|
92
|
+
pattern.substring(2, pattern.length - 1));
|
|
93
|
+
}
|
|
80
94
|
return segment;
|
|
81
95
|
}
|
|
82
96
|
function parsePlaygroundPattern(content) {
|
|
@@ -246,6 +260,12 @@ function convertPlaygroundPatternToMarkdown(content) {
|
|
|
246
260
|
.join(",");
|
|
247
261
|
segmentAttrs += `{${highlights}}`;
|
|
248
262
|
}
|
|
263
|
+
if (segment.patterns && segment.patterns.length > 0) {
|
|
264
|
+
segmentAttrs += " " + segment.patterns.map((p) => `/${p}/`).join(" ");
|
|
265
|
+
}
|
|
266
|
+
if (segment.borderedPatterns && segment.borderedPatterns.length > 0) {
|
|
267
|
+
segmentAttrs += " " + segment.borderedPatterns.map((p) => `!/` + p + `/`).join(" ");
|
|
268
|
+
}
|
|
249
269
|
segmentAttrs = segmentAttrs.trim().replace(/\s+/g, " ");
|
|
250
270
|
switch (type) {
|
|
251
271
|
case "app":
|
|
@@ -314,7 +334,9 @@ function observeTreeDisplay(content) {
|
|
|
314
334
|
}
|
|
315
335
|
function convertTreeDisplayToMarkdown(content) {
|
|
316
336
|
if (content.startsWith("```xmlui-tree") && content.endsWith("```")) {
|
|
317
|
-
const treeContent = content
|
|
337
|
+
const treeContent = content
|
|
338
|
+
.slice("```xmlui-tree".length, content.indexOf("```", "```xmlui-tree".length))
|
|
339
|
+
.trim();
|
|
318
340
|
return `<section data-tree-content="${btoa(treeContent)}"></section>\n\n`;
|
|
319
341
|
}
|
|
320
342
|
}
|
|
@@ -21,13 +21,13 @@ exports.ModalDialogMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
21
21
|
description: `Toggles whether the dialog encompasses the whole UI (\`true\`) or not and has a minimum ` +
|
|
22
22
|
`width and height (\`false\`).`,
|
|
23
23
|
valueType: "boolean",
|
|
24
|
-
defaultValue:
|
|
24
|
+
defaultValue: ModalDialogNative_1.defaultProps.fullScreen,
|
|
25
25
|
},
|
|
26
26
|
title: (0, ComponentDefs_1.d)(`Provides a prestyled heading to display the intent of the dialog.`),
|
|
27
27
|
closeButtonVisible: {
|
|
28
28
|
description: `Shows (\`true\`) or hides (\`false\`) the visibility of the close button on the dialog.`,
|
|
29
29
|
valueType: "boolean",
|
|
30
|
-
defaultValue:
|
|
30
|
+
defaultValue: ModalDialogNative_1.defaultProps.closeButtonVisible,
|
|
31
31
|
},
|
|
32
32
|
},
|
|
33
33
|
events: {
|
|
@@ -45,7 +45,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
45
45
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
46
46
|
};
|
|
47
47
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
-
exports.ModalDialog = exports.ModalDialogFrame = void 0;
|
|
48
|
+
exports.ModalDialog = exports.ModalDialogFrame = exports.defaultProps = void 0;
|
|
49
49
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
50
50
|
const react_1 = __importStar(require("react"));
|
|
51
51
|
const Dialog = __importStar(require("@radix-ui/react-dialog"));
|
|
@@ -57,6 +57,11 @@ const misc_1 = require("../../components-core/utils/misc");
|
|
|
57
57
|
const IconNative_1 = require("../Icon/IconNative");
|
|
58
58
|
const ButtonNative_1 = require("../Button/ButtonNative");
|
|
59
59
|
const ModalVisibilityContext_1 = require("./ModalVisibilityContext");
|
|
60
|
+
// Default props for ModalDialog component
|
|
61
|
+
exports.defaultProps = {
|
|
62
|
+
fullScreen: false,
|
|
63
|
+
closeButtonVisible: true,
|
|
64
|
+
};
|
|
60
65
|
exports.ModalDialogFrame = react_1.default.forwardRef(({ isInitiallyOpen, onOpen, onClose, registerComponentApi, renderDialog }, ref) => {
|
|
61
66
|
const modalContextStateValue = useModalLocalOpenState(isInitiallyOpen, onOpen, onClose);
|
|
62
67
|
const { doOpen, doClose, isOpen, openParams } = modalContextStateValue;
|
|
@@ -110,7 +115,7 @@ function useModalOpenState(isInitiallyOpen = true, onOpen, onClose) {
|
|
|
110
115
|
const modalLocalOpenState = useModalLocalOpenState(isInitiallyOpen, onOpen, onClose);
|
|
111
116
|
return modalStateContext || modalLocalOpenState;
|
|
112
117
|
}
|
|
113
|
-
exports.ModalDialog = react_1.default.forwardRef(({ children, style, isInitiallyOpen, fullScreen, title, closeButtonVisible =
|
|
118
|
+
exports.ModalDialog = react_1.default.forwardRef(({ children, style, isInitiallyOpen, fullScreen = exports.defaultProps.fullScreen, title, closeButtonVisible = exports.defaultProps.closeButtonVisible, onOpen, onClose, }, ref) => {
|
|
114
119
|
const { root } = (0, ThemeContext_1.useTheme)();
|
|
115
120
|
const modalRef = (0, react_1.useRef)(null);
|
|
116
121
|
const composedRef = ref ? (0, react_compose_refs_1.composeRefs)(ref, modalRef) : modalRef;
|
|
@@ -19,7 +19,8 @@ exports.NavGroupMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
19
19
|
`(\`NavLink\` components). It can be displayed as a submenu in the App's UI.`,
|
|
20
20
|
props: {
|
|
21
21
|
label: (0, metadata_helpers_1.dLabel)(),
|
|
22
|
-
initiallyExpanded: (0, ComponentDefs_1.d)(
|
|
22
|
+
initiallyExpanded: (0, ComponentDefs_1.d)("This property defines whether the group is initially expanded or collapsed. If not " +
|
|
23
|
+
"defined, the group is collapsed by default."),
|
|
23
24
|
enabled: (0, metadata_helpers_1.dEnabled)(),
|
|
24
25
|
to: {
|
|
25
26
|
description: `This property defines an optional navigation link.`,
|
|
@@ -25,29 +25,27 @@ exports.NavLinkMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
25
25
|
`has a particular visual appearance, provided its [\`displayActive\`](#displayactive) ` +
|
|
26
26
|
`property is set to \`true\`.`,
|
|
27
27
|
valueType: "boolean",
|
|
28
|
-
defaultValue:
|
|
28
|
+
defaultValue: NavLinkNative_1.defaultProps.active,
|
|
29
29
|
},
|
|
30
30
|
target: {
|
|
31
|
-
description: `This property specifies how to open the clicked link.`,
|
|
31
|
+
description: `This optionally property specifies how to open the clicked link.`,
|
|
32
32
|
availableValues: abstractions_1.LinkTargetMd,
|
|
33
33
|
type: "string",
|
|
34
|
-
defaultValue: "_self",
|
|
35
34
|
},
|
|
36
35
|
label: (0, metadata_helpers_1.dLabel)(),
|
|
37
36
|
vertical: {
|
|
38
37
|
description: `This property sets how the active status is displayed on the \`${COMP}\` component. If ` +
|
|
39
38
|
`set to true, the indicator is displayed on the side which lends itself to a vertically ` +
|
|
40
|
-
`aligned navigation menu.`,
|
|
39
|
+
`aligned navigation menu. By default, it displays a horizontal indicator.`,
|
|
41
40
|
valueType: "boolean",
|
|
42
|
-
defaultValue: false,
|
|
43
41
|
},
|
|
44
42
|
displayActive: {
|
|
45
43
|
description: `This Boolean property indicates if the active state of a link should have a visual ` +
|
|
46
44
|
`indication. Setting it to \`false\` removes the visual indication of an active link.`,
|
|
47
45
|
valueType: "boolean",
|
|
48
|
-
defaultValue:
|
|
46
|
+
defaultValue: NavLinkNative_1.defaultProps.displayActive,
|
|
49
47
|
},
|
|
50
|
-
icon: (0, ComponentDefs_1.d)(`This property allows you to add an icon (specify the icon's name) to the navigation link.`),
|
|
48
|
+
icon: (0, ComponentDefs_1.d)(`This property allows you to add an optional icon (specify the icon's name) to the navigation link.`),
|
|
51
49
|
},
|
|
52
50
|
events: {
|
|
53
51
|
click: (0, metadata_helpers_1.dClick)(COMP),
|
|
@@ -14,7 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.NavLink = void 0;
|
|
17
|
+
exports.NavLink = exports.defaultProps = void 0;
|
|
18
18
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
19
|
const react_1 = require("react");
|
|
20
20
|
const react_2 = require("@remix-run/react");
|
|
@@ -25,10 +25,15 @@ const AppNative_1 = require("../App/AppNative");
|
|
|
25
25
|
const AppLayoutContext_1 = require("../App/AppLayoutContext");
|
|
26
26
|
const NavPanelNative_1 = require("../NavPanel/NavPanelNative");
|
|
27
27
|
const NavGroupContext_1 = require("../NavGroup/NavGroupContext");
|
|
28
|
+
// Default props for NavLink component
|
|
29
|
+
exports.defaultProps = {
|
|
30
|
+
active: false,
|
|
31
|
+
displayActive: true
|
|
32
|
+
};
|
|
28
33
|
exports.NavLink = (0, react_1.forwardRef)(function NavLink(_a, ref) {
|
|
29
34
|
var {
|
|
30
35
|
/* eslint-disable react/prop-types */
|
|
31
|
-
uid, children, disabled, to, displayActive =
|
|
36
|
+
uid, children, disabled, to, displayActive = exports.defaultProps.displayActive, vertical, style, onClick, icon, forceActive } = _a, rest = __rest(_a, ["uid", "children", "disabled", "to", "displayActive", "vertical", "style", "onClick", "icon", "forceActive"]);
|
|
32
37
|
const appLayoutContext = (0, AppLayoutContext_1.useAppLayoutContext)();
|
|
33
38
|
const navPanelContext = (0, react_1.useContext)(NavPanelNative_1.NavPanelContext);
|
|
34
39
|
const { level } = (0, react_1.useContext)(NavGroupContext_1.NavGroupContext);
|
|
@@ -17,12 +17,18 @@ exports.NavPanelMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
17
17
|
props: {
|
|
18
18
|
logoTemplate: (0, metadata_helpers_1.dComponent)(`This property defines the logo template to display in the navigation panel with the ` +
|
|
19
19
|
`\`vertical\` and \`vertical-sticky\` layout.`),
|
|
20
|
+
inDrawer: {
|
|
21
|
+
description: `This property determines if the navigation panel is displayed in a drawer.`,
|
|
22
|
+
valueType: "boolean",
|
|
23
|
+
defaultValue: NavPanelNative_1.defaultProps.inDrawer,
|
|
24
|
+
},
|
|
20
25
|
},
|
|
21
26
|
themeVars: (0, themeVars_1.parseScssVar)(NavPanel_module_scss_1.default.themeVars),
|
|
22
27
|
limitThemeVarsToComponent: true,
|
|
23
28
|
defaultThemeVars: {
|
|
24
29
|
[`horizontalAlignment-logo-${COMP}`]: "center",
|
|
25
30
|
[`backgroundColor-${COMP}`]: "$backgroundColor",
|
|
31
|
+
[`backgroundColor-${COMP}-horizontal`]: "$backgroundColor-AppHeader",
|
|
26
32
|
[`border-${COMP}`]: '0px solid $borderColor',
|
|
27
33
|
[`paddingHorizontal-${COMP}`]: "0",
|
|
28
34
|
[`paddingVertical-logo-${COMP}`]: "$space-4",
|
|
@@ -36,7 +36,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
36
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.NavPanel = exports.NavPanelContext = void 0;
|
|
39
|
+
exports.NavPanel = exports.NavPanelContext = exports.defaultProps = void 0;
|
|
40
40
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
41
41
|
const react_1 = __importStar(require("react"));
|
|
42
42
|
const react_compose_refs_1 = require("@radix-ui/react-compose-refs");
|
|
@@ -46,6 +46,10 @@ const ScrollContext_1 = require("../../components-core/ScrollContext");
|
|
|
46
46
|
const LogoNative_1 = require("../Logo/LogoNative");
|
|
47
47
|
const AppLayoutContext_1 = require("../App/AppLayoutContext");
|
|
48
48
|
const AppNative_1 = require("../App/AppNative");
|
|
49
|
+
// Default props for NavPanel component
|
|
50
|
+
exports.defaultProps = {
|
|
51
|
+
inDrawer: false,
|
|
52
|
+
};
|
|
49
53
|
exports.NavPanelContext = react_1.default.createContext(null);
|
|
50
54
|
const contextValue = {
|
|
51
55
|
inDrawer: true,
|
|
@@ -54,7 +58,7 @@ function DrawerNavPanel({ logoContent, children, className, style, }) {
|
|
|
54
58
|
const scrollContainerRef = (0, react_1.useRef)(null);
|
|
55
59
|
return ((0, jsx_runtime_1.jsx)(exports.NavPanelContext.Provider, { value: contextValue, children: (0, jsx_runtime_1.jsx)("div", { ref: scrollContainerRef, className: (0, classnames_1.default)(NavPanel_module_scss_1.default.wrapper, className), children: (0, jsx_runtime_1.jsxs)(ScrollContext_1.ScrollContext.Provider, { value: scrollContainerRef, children: [(0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(NavPanel_module_scss_1.default.logoWrapper, NavPanel_module_scss_1.default.inDrawer), children: logoContent || (0, jsx_runtime_1.jsx)(LogoNative_1.Logo, {}) }), (0, jsx_runtime_1.jsx)("div", { className: NavPanel_module_scss_1.default.wrapperInner, style: style, children: children })] }) }) }));
|
|
56
60
|
}
|
|
57
|
-
exports.NavPanel = (0, react_1.forwardRef)(function NavPanel({ children, style, logoContent, className, inDrawer, renderChild, }, forwardedRef) {
|
|
61
|
+
exports.NavPanel = (0, react_1.forwardRef)(function NavPanel({ children, style, logoContent, className, inDrawer = exports.defaultProps.inDrawer, renderChild, }, forwardedRef) {
|
|
58
62
|
var _a, _b;
|
|
59
63
|
const scrollContainerRef = (0, react_1.useRef)(null);
|
|
60
64
|
const ref = forwardedRef ? (0, react_compose_refs_1.composeRefs)(scrollContainerRef, forwardedRef) : scrollContainerRef;
|
|
@@ -10,6 +10,7 @@ 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 NestedAppNative_1 = require("./NestedAppNative");
|
|
13
|
+
const defaultProps_1 = require("./defaultProps");
|
|
13
14
|
const COMP = "NestedApp";
|
|
14
15
|
exports.NestedAppMd = (0, ComponentDefs_1.createMetadata)({
|
|
15
16
|
description: `The ${COMP} component allows you to nest an entire xmlui app into another one.
|
|
@@ -23,24 +24,34 @@ exports.NestedAppMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
23
24
|
},
|
|
24
25
|
components: {
|
|
25
26
|
description: "This property defines an optional list of components to be used with the nested app.",
|
|
27
|
+
defaultValue: defaultProps_1.defaultProps.components,
|
|
26
28
|
},
|
|
27
29
|
config: {
|
|
28
30
|
description: "You can define the nested app's configuration with this property.",
|
|
29
31
|
},
|
|
30
32
|
activeTheme: {
|
|
31
|
-
description: "This property defines the active theme for the nested app."
|
|
33
|
+
description: "This property defines the active theme for the nested app. " +
|
|
34
|
+
"If not set, the default theme is used.",
|
|
32
35
|
},
|
|
33
36
|
activeTone: {
|
|
34
|
-
description: "This property defines the active tone for the nested app."
|
|
37
|
+
description: "This property defines the active tone for the nested app. " +
|
|
38
|
+
"If not set, the default tone is used.",
|
|
35
39
|
},
|
|
36
40
|
title: {
|
|
37
|
-
description: "The title of the nested app.",
|
|
41
|
+
description: "The optional title of the nested app. If not set, no title is displayed.",
|
|
38
42
|
},
|
|
39
43
|
height: {
|
|
40
|
-
description: "The height of the nested app.",
|
|
44
|
+
description: "The height of the nested app. If not set, the height is determined automatically.",
|
|
41
45
|
},
|
|
42
46
|
allowPlaygroundPopup: {
|
|
43
47
|
description: "This property defines whether the nested app can be opened in the xmlui playground.",
|
|
48
|
+
valueType: "boolean",
|
|
49
|
+
defaultValue: defaultProps_1.defaultProps.allowPlaygroundPopup,
|
|
50
|
+
},
|
|
51
|
+
withFrame: {
|
|
52
|
+
description: "This property defines whether the nested app should be displayed with a frame.",
|
|
53
|
+
valueType: "boolean",
|
|
54
|
+
defaultValue: defaultProps_1.defaultProps.withFrame,
|
|
44
55
|
},
|
|
45
56
|
},
|
|
46
57
|
themeVars: (0, themeVars_1.parseScssVar)(NestedApp_module_scss_1.default.themeVars),
|
|
@@ -49,6 +60,7 @@ exports.NestedAppMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
49
60
|
[`marginBottom-${COMP}`]: "$space-3",
|
|
50
61
|
[`padding-${COMP}`]: "$space-4",
|
|
51
62
|
[`paddingTop-${COMP}`]: "$space-2",
|
|
63
|
+
[`border-${COMP}`]: "1px solid $color-surface-100",
|
|
52
64
|
[`borderRadius-${COMP}`]: "$space-4",
|
|
53
65
|
[`backgroundColor-frame-${COMP}`]: "$color-primary-50",
|
|
54
66
|
[`gap-frame-${COMP}`]: "$space-4",
|