xmlui 0.9.20 → 0.9.21
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-BBls674G.mjs → apiInterceptorWorker-7aKQ2rBj.mjs} +1 -1
- package/dist/{index-CbU44pSb.mjs → index-B3CWFAxa.mjs} +1773 -2148
- package/dist/index.css +1862 -713
- package/dist/{lint-Cd70ckJ6.mjs → lint-EcgF-9Wr.mjs} +22 -46
- package/dist/scripts/src/components/ComponentProvider.js +0 -10
- package/dist/scripts/src/components/DropdownMenu/DropdownMenu.js +3 -1
- package/dist/scripts/src/components/DropdownMenu/DropdownMenuNative.js +10 -2
- package/dist/scripts/src/components/Form/FormContext.js +4 -0
- package/dist/scripts/src/components/Form/FormNative.js +6 -4
- package/dist/scripts/src/components/Form/formActions.js +2 -1
- package/dist/scripts/src/components/FormItem/FormItemNative.js +7 -0
- package/dist/scripts/src/components/Icon/MoonIcon.js +10 -0
- package/dist/scripts/src/components/Icon/StarsIcon.js +10 -0
- package/dist/scripts/src/components/IconProvider.js +4 -1
- package/dist/scripts/src/components/InspectButton/InspectButton.js +5 -3
- package/dist/scripts/src/components/ToneChangerButton/ToneChangerButton.js +1 -1
- package/dist/scripts/src/components-core/InspectorContext.js +4 -5
- package/dist/scripts/src/components-core/rendering/Container.js +1 -6
- package/dist/style.css +1837 -631
- package/dist/xmlui-metadata.mjs +1283 -1438
- package/dist/xmlui-metadata.umd.js +1282 -1437
- package/dist/xmlui-parser.mjs +17 -17
- package/dist/xmlui-standalone.umd.js +4012 -3257
- package/dist/xmlui.d.ts +1 -1
- package/dist/xmlui.mjs +1 -1
- package/package.json +2 -2
- package/dist/scripts/src/components/Alert/Alert.js +0 -61
- package/dist/scripts/src/components/Alert/AlertNative.js +0 -8
- package/dist/scripts/src/components/ButtonGroup/ButtonGroup.js +0 -55
- package/dist/scripts/src/components/ButtonGroup/ButtonGroupNative.js +0 -8
- package/dist/scripts/src/components/OffCanvas/OffCanvas.js +0 -57
- package/dist/scripts/src/components/OffCanvas/OffCanvasNative.js +0 -48
- package/dist/scripts/src/components/StateViewer/StateViewerNative.js +0 -19
- package/dist/scripts/src/components/SubNavPanel/SubNavPanel.js +0 -22
- package/dist/scripts/src/components/SubNavPanel/SubNavPanelNative.js +0 -9
|
@@ -105,28 +105,6 @@ const iconPositionMd = [
|
|
|
105
105
|
description: "The icon will appear at the end (right side when the left-to-right direction is set)"
|
|
106
106
|
}
|
|
107
107
|
];
|
|
108
|
-
const statusColorMd = [
|
|
109
|
-
{ value: "primary", description: "Primary theme color, no default icon" },
|
|
110
|
-
{ value: "secondary", description: "Secondary theme color, no default icon" },
|
|
111
|
-
{ value: "success", description: 'Success theme color, "success" icon' },
|
|
112
|
-
{ value: "danger", description: 'Warning theme color, "warning" icon' },
|
|
113
|
-
{ value: "warning", description: 'Danger theme color, "danger" icon' },
|
|
114
|
-
{ value: "info", description: 'Info theme color, "info" icon' },
|
|
115
|
-
{ value: "light", description: "Light theme color, no default icon" },
|
|
116
|
-
{ value: "dark", description: "Dark theme color, no default icon" }
|
|
117
|
-
];
|
|
118
|
-
const placementMd = [
|
|
119
|
-
{
|
|
120
|
-
value: "start",
|
|
121
|
-
description: "The left side of the window (left-to-right) or the right side of the window (right-to-left)"
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
value: "end",
|
|
125
|
-
description: "The right side of the window (left-to-right) or the left side of the window (right-to-left)"
|
|
126
|
-
},
|
|
127
|
-
{ value: "top", description: "The top of the window" },
|
|
128
|
-
{ value: "bottom", description: "The bottom of the window" }
|
|
129
|
-
];
|
|
130
108
|
const labelPositionMd = [
|
|
131
109
|
{
|
|
132
110
|
value: "start",
|
|
@@ -6265,30 +6243,28 @@ export {
|
|
|
6265
6243
|
buttonVariantNames as a4,
|
|
6266
6244
|
nodeToComponentDef as a5,
|
|
6267
6245
|
triggerPositionNames as a6,
|
|
6268
|
-
|
|
6269
|
-
|
|
6270
|
-
|
|
6271
|
-
|
|
6272
|
-
|
|
6273
|
-
|
|
6274
|
-
|
|
6275
|
-
|
|
6276
|
-
|
|
6277
|
-
|
|
6278
|
-
|
|
6279
|
-
|
|
6280
|
-
|
|
6281
|
-
|
|
6282
|
-
|
|
6283
|
-
|
|
6284
|
-
|
|
6285
|
-
|
|
6286
|
-
|
|
6287
|
-
|
|
6288
|
-
|
|
6289
|
-
|
|
6290
|
-
onPrefixRegex as at,
|
|
6291
|
-
CORE_NAMESPACE_VALUE as au,
|
|
6246
|
+
httpMethodNames as a7,
|
|
6247
|
+
PARSED_MARK_PROP as a8,
|
|
6248
|
+
layoutOptionKeys as a9,
|
|
6249
|
+
viewportSizeNames as aa,
|
|
6250
|
+
componentFileExtension as ab,
|
|
6251
|
+
codeBehindFileExtension as ac,
|
|
6252
|
+
getLintSeverity as ad,
|
|
6253
|
+
LintSeverity as ae,
|
|
6254
|
+
lintApp as af,
|
|
6255
|
+
printComponentLints as ag,
|
|
6256
|
+
lintErrorsComponent as ah,
|
|
6257
|
+
collectCodeBehindFromSource as ai,
|
|
6258
|
+
removeCodeBehindTokensFromTree as aj,
|
|
6259
|
+
COMPOUND_COMP_ID as ak,
|
|
6260
|
+
moduleFileExtension as al,
|
|
6261
|
+
LintDiagKind as am,
|
|
6262
|
+
lint as an,
|
|
6263
|
+
ParserError2 as ao,
|
|
6264
|
+
errorMessages as ap,
|
|
6265
|
+
UCRegex as aq,
|
|
6266
|
+
onPrefixRegex as ar,
|
|
6267
|
+
CORE_NAMESPACE_VALUE as as,
|
|
6292
6268
|
alignmentOptionMd as b,
|
|
6293
6269
|
buttonTypesMd as c,
|
|
6294
6270
|
buttonThemeMd as d,
|
|
@@ -81,13 +81,10 @@ const Bookmark_1 = require("./Bookmark/Bookmark");
|
|
|
81
81
|
const AppState_1 = require("./AppState/AppState");
|
|
82
82
|
const TableOfContents_1 = require("./TableOfContents/TableOfContents");
|
|
83
83
|
const Accordion_1 = require("./Accordion/Accordion");
|
|
84
|
-
const Alert_1 = require("./Alert/Alert");
|
|
85
|
-
const OffCanvas_1 = require("./OffCanvas/OffCanvas");
|
|
86
84
|
const XmluiCodeHighlighter_1 = require("../components-core/XmluiCodeHighlighter");
|
|
87
85
|
const TabItem_1 = require("./Tabs/TabItem");
|
|
88
86
|
const AccordionItem_1 = require("./Accordion/AccordionItem");
|
|
89
87
|
const Slider_1 = require("./Slider/Slider");
|
|
90
|
-
const ButtonGroup_1 = require("./ButtonGroup/ButtonGroup");
|
|
91
88
|
const Carousel_1 = require("./Carousel/Carousel");
|
|
92
89
|
const CarouselItem_1 = require("./Carousel/CarouselItem");
|
|
93
90
|
const renderers_1 = require("../components-core/renderers");
|
|
@@ -100,7 +97,6 @@ const Backdrop_1 = require("./Backdrop/Backdrop");
|
|
|
100
97
|
const HtmlTags_1 = require("./HtmlTags/HtmlTags");
|
|
101
98
|
const ColorPicker_1 = require("./ColorPicker/ColorPicker");
|
|
102
99
|
const RadioItem_1 = require("./RadioGroup/RadioItem");
|
|
103
|
-
const SubNavPanel_1 = require("./SubNavPanel/SubNavPanel");
|
|
104
100
|
const InspectButton_1 = require("./InspectButton/InspectButton");
|
|
105
101
|
/**
|
|
106
102
|
* The framework has a specialized component concept, the "property holder
|
|
@@ -275,9 +271,6 @@ class ComponentRegistry {
|
|
|
275
271
|
if (process.env.VITE_USED_COMPONENTS_NavPanel !== "false") {
|
|
276
272
|
this.registerCoreComponent(NavPanel_1.navPanelRenderer);
|
|
277
273
|
}
|
|
278
|
-
if (process.env.VITE_USED_COMPONENTS_SubNavPanel !== "false") {
|
|
279
|
-
this.registerCoreComponent(SubNavPanel_1.subNavPanelRenderer);
|
|
280
|
-
}
|
|
281
274
|
if (process.env.VITE_USED_COMPONENTS_Pages !== "false") {
|
|
282
275
|
this.registerCoreComponent(Pages_1.pagesRenderer);
|
|
283
276
|
this.registerCoreComponent(Pages_1.pageRenderer);
|
|
@@ -390,10 +383,7 @@ class ComponentRegistry {
|
|
|
390
383
|
// --- New Bootstrap-inspired components
|
|
391
384
|
this.registerCoreComponent(Carousel_1.carouselComponentRenderer);
|
|
392
385
|
this.registerCoreComponent(Accordion_1.accordionComponentRenderer);
|
|
393
|
-
this.registerCoreComponent(Alert_1.alertComponentRenderer);
|
|
394
|
-
this.registerCoreComponent(OffCanvas_1.offCanvasComponentRenderer);
|
|
395
386
|
this.registerCoreComponent(Slider_1.sliderComponentRenderer);
|
|
396
|
-
this.registerCoreComponent(ButtonGroup_1.buttonGroupComponentRenderer);
|
|
397
387
|
this.registerCoreComponent(Backdrop_1.backdropComponentRenderer);
|
|
398
388
|
this.registerCoreComponent(HtmlTags_1.htmlATagRenderer);
|
|
399
389
|
this.registerCoreComponent(HtmlTags_1.htmlAbbrTagRenderer);
|
|
@@ -99,6 +99,7 @@ exports.MenuItemMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
99
99
|
valueType: "boolean",
|
|
100
100
|
defaultValue: DropdownMenuNative_1.defaultMenuItemProps.active,
|
|
101
101
|
},
|
|
102
|
+
enabled: (0, metadata_helpers_1.dEnabled)(),
|
|
102
103
|
},
|
|
103
104
|
events: {
|
|
104
105
|
click: (0, metadata_helpers_1.dClick)(MICOMP),
|
|
@@ -107,6 +108,7 @@ exports.MenuItemMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
107
108
|
defaultThemeVars: {
|
|
108
109
|
[`backgroundColor-${MICOMP}`]: "$backgroundColor-dropdown-item",
|
|
109
110
|
[`color-${MICOMP}`]: "$textColor-primary",
|
|
111
|
+
[`color-${MICOMP}--disabled`]: "$textColor--disabled",
|
|
110
112
|
[`fontFamily-${MICOMP}`]: "$fontFamily",
|
|
111
113
|
[`fontSize-${MICOMP}`]: "$fontSize-small",
|
|
112
114
|
[`paddingVertical-${MICOMP}`]: "$space-2",
|
|
@@ -131,7 +133,7 @@ exports.menuItemRenderer = (0, renderers_1.createComponentRenderer)(MICOMP, expo
|
|
|
131
133
|
navigateAction === null || navigateAction === void 0 ? void 0 : navigateAction({ pathname: to });
|
|
132
134
|
};
|
|
133
135
|
}
|
|
134
|
-
return ((0, jsx_runtime_1.jsx)(DropdownMenuNative_1.MenuItem, { onClick: clickHandler, label: extractValue((_a = node.props) === null || _a === void 0 ? void 0 : _a.label), style: layoutCss, iconPosition: extractValue(node.props.iconPosition), icon: ((_b = node.props) === null || _b === void 0 ? void 0 : _b.icon) && (0, jsx_runtime_1.jsx)(IconNative_1.Icon, { name: extractValue(node.props.icon) }), active: extractValue.asOptionalBoolean(node.props.active, false), children: renderChild(node.children) }));
|
|
136
|
+
return ((0, jsx_runtime_1.jsx)(DropdownMenuNative_1.MenuItem, { onClick: clickHandler, label: extractValue((_a = node.props) === null || _a === void 0 ? void 0 : _a.label), style: layoutCss, iconPosition: extractValue(node.props.iconPosition), icon: ((_b = node.props) === null || _b === void 0 ? void 0 : _b.icon) && (0, jsx_runtime_1.jsx)(IconNative_1.Icon, { name: extractValue(node.props.icon) }), active: extractValue.asOptionalBoolean(node.props.active, false), enabled: extractValue.asOptionalBoolean(node.props.enabled, true), children: renderChild(node.children) }));
|
|
135
137
|
});
|
|
136
138
|
const SMCOMP = "SubMenuItem";
|
|
137
139
|
exports.SubMenuItemMd = (0, ComponentDefs_1.createMetadata)({
|
|
@@ -87,13 +87,21 @@ exports.defaultMenuItemProps = {
|
|
|
87
87
|
iconPosition: "start",
|
|
88
88
|
active: false,
|
|
89
89
|
};
|
|
90
|
-
exports.MenuItem = (0, react_1.forwardRef)(function MenuItem({ children, onClick = constants_1.noop, label, style, icon, iconPosition = exports.defaultMenuItemProps.iconPosition, active = exports.defaultMenuItemProps.active, }, ref) {
|
|
90
|
+
exports.MenuItem = (0, react_1.forwardRef)(function MenuItem({ children, onClick = constants_1.noop, label, style, icon, iconPosition = exports.defaultMenuItemProps.iconPosition, active = exports.defaultMenuItemProps.active, enabled = true, }, ref) {
|
|
91
91
|
const iconToStart = iconPosition === "start";
|
|
92
92
|
return ((0, jsx_runtime_1.jsxs)(ReactDropdownMenu.Item, { style: style, className: (0, classnames_1.default)(DropdownMenu_module_scss_1.default.DropdownMenuItem, {
|
|
93
93
|
[DropdownMenu_module_scss_1.default.active]: active,
|
|
94
|
+
[DropdownMenu_module_scss_1.default.disabled]: !enabled,
|
|
94
95
|
}), onClick: (event) => {
|
|
96
|
+
if (!enabled) {
|
|
97
|
+
event.preventDefault();
|
|
98
|
+
event.stopPropagation();
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
95
101
|
event.stopPropagation();
|
|
96
|
-
|
|
102
|
+
if (enabled) {
|
|
103
|
+
onClick(event);
|
|
104
|
+
}
|
|
97
105
|
}, ref: ref, children: [iconToStart && icon, (0, jsx_runtime_1.jsx)("div", { className: DropdownMenu_module_scss_1.default.wrapper, children: label !== null && label !== void 0 ? label : children }), !iconToStart && icon] }));
|
|
98
106
|
});
|
|
99
107
|
function SubMenuItem({ children, label, triggerTemplate }) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.formControlTypesMd = exports.formControlTypes = exports.FormContext = exports.validationModeMd = exports.defaultValidationMode = exports.validationModeValues = exports.validationSeverityMd = exports.validationSeverityValues = void 0;
|
|
4
|
+
exports.useFormContext = useFormContext;
|
|
4
5
|
exports.useFormContextPart = useFormContextPart;
|
|
5
6
|
const use_context_selector_1 = require("use-context-selector");
|
|
6
7
|
exports.validationSeverityValues = ["error", "warning", "valid", "none"];
|
|
@@ -27,6 +28,9 @@ exports.validationModeMd = [
|
|
|
27
28
|
}
|
|
28
29
|
];
|
|
29
30
|
exports.FormContext = (0, use_context_selector_1.createContext)(undefined);
|
|
31
|
+
function useFormContext() {
|
|
32
|
+
return (0, use_context_selector_1.useContext)(exports.FormContext);
|
|
33
|
+
}
|
|
30
34
|
function useFormContextPart(selector) {
|
|
31
35
|
return (0, use_context_selector_1.useContextSelector)(exports.FormContext, selector);
|
|
32
36
|
}
|
|
@@ -56,7 +56,7 @@ const getByPath = (obj, path) => {
|
|
|
56
56
|
};
|
|
57
57
|
exports.getByPath = getByPath;
|
|
58
58
|
const formReducer = (0, immer_1.default)((state, action) => {
|
|
59
|
-
var _a, _b, _c, _d;
|
|
59
|
+
var _a, _b, _c, _d, _e;
|
|
60
60
|
const { uid } = action.payload;
|
|
61
61
|
if (uid !== undefined && !state.interactionFlags[uid]) {
|
|
62
62
|
state.interactionFlags[uid] = {
|
|
@@ -70,7 +70,7 @@ const formReducer = (0, immer_1.default)((state, action) => {
|
|
|
70
70
|
}
|
|
71
71
|
switch (action.type) {
|
|
72
72
|
case formActions_1.FormActionKind.FIELD_INITIALIZED: {
|
|
73
|
-
if (!state.interactionFlags[uid].isDirty) {
|
|
73
|
+
if (!state.interactionFlags[uid].isDirty || action.payload.force) {
|
|
74
74
|
setByPath(state.subject, uid, action.payload.value);
|
|
75
75
|
}
|
|
76
76
|
break;
|
|
@@ -167,8 +167,7 @@ const formReducer = (0, immer_1.default)((state, action) => {
|
|
|
167
167
|
}
|
|
168
168
|
case formActions_1.FormActionKind.RESET: {
|
|
169
169
|
const { originalSubject } = action.payload;
|
|
170
|
-
return Object.assign(Object.assign({}, initialState), { subject: originalSubject });
|
|
171
|
-
break;
|
|
170
|
+
return Object.assign(Object.assign({}, initialState), { subject: originalSubject, resetVersion: ((_e = state.resetVersion) !== null && _e !== void 0 ? _e : 0) + 1 });
|
|
172
171
|
}
|
|
173
172
|
default:
|
|
174
173
|
}
|
|
@@ -179,6 +178,7 @@ const initialState = {
|
|
|
179
178
|
generalValidationResults: [],
|
|
180
179
|
interactionFlags: {},
|
|
181
180
|
submitInProgress: false,
|
|
181
|
+
resetVersion: 0,
|
|
182
182
|
};
|
|
183
183
|
exports.defaultProps = {
|
|
184
184
|
cancelLabel: "Cancel",
|
|
@@ -203,6 +203,7 @@ const Form = (0, react_2.forwardRef)(function ({ formState, dispatch, initialVal
|
|
|
203
203
|
originalSubject: initialValue,
|
|
204
204
|
validationResults: formState.validationResults,
|
|
205
205
|
interactionFlags: formState.interactionFlags,
|
|
206
|
+
resetVersion: formState.resetVersion,
|
|
206
207
|
dispatch,
|
|
207
208
|
enabled: isEnabled,
|
|
208
209
|
};
|
|
@@ -211,6 +212,7 @@ const Form = (0, react_2.forwardRef)(function ({ formState, dispatch, initialVal
|
|
|
211
212
|
formState.interactionFlags,
|
|
212
213
|
formState.subject,
|
|
213
214
|
formState.validationResults,
|
|
215
|
+
formState.resetVersion,
|
|
214
216
|
initialValue,
|
|
215
217
|
isEnabled,
|
|
216
218
|
itemLabelBreak,
|
|
@@ -27,12 +27,13 @@ var FormActionKind;
|
|
|
27
27
|
FormActionKind["SUBMITTED"] = "FormActionKind:SUBMITTED";
|
|
28
28
|
FormActionKind["RESET"] = "FormActionKind:RESET";
|
|
29
29
|
})(FormActionKind || (exports.FormActionKind = FormActionKind = {}));
|
|
30
|
-
function fieldInitialized(uid, value) {
|
|
30
|
+
function fieldInitialized(uid, value, force = false) {
|
|
31
31
|
return {
|
|
32
32
|
type: FormActionKind.FIELD_INITIALIZED,
|
|
33
33
|
payload: {
|
|
34
34
|
uid,
|
|
35
35
|
value,
|
|
36
|
+
force
|
|
36
37
|
},
|
|
37
38
|
};
|
|
38
39
|
}
|
|
@@ -46,12 +46,14 @@ exports.defaultProps = {
|
|
|
46
46
|
customValidationsDebounce: 0,
|
|
47
47
|
};
|
|
48
48
|
exports.FormItem = (0, react_1.memo)(function FormItem(_a) {
|
|
49
|
+
var _b;
|
|
49
50
|
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 } = _a, rest = __rest(_a, ["style", "bindTo", "type", "label", "enabled", "labelPosition", "labelWidth", "labelBreak", "children", "validations", "onValidate", "customValidationsDebounce", "validationMode", "registerComponentApi", "maxTextLength", "inputRenderer"]);
|
|
50
51
|
const defaultId = (0, react_1.useId)();
|
|
51
52
|
const [formItemId, setFormItemId] = (0, react_1.useState)(bindTo);
|
|
52
53
|
const labelWidthValue = (0, FormContext_1.useFormContextPart)((value) => labelWidth || value.itemLabelWidth);
|
|
53
54
|
const labelBreakValue = (0, FormContext_1.useFormContextPart)((value) => labelBreak !== undefined ? labelBreak : value.itemLabelBreak);
|
|
54
55
|
const labelPositionValue = (0, FormContext_1.useFormContextPart)((value) => labelPosition || value.itemLabelPosition || DEFAULT_LABEL_POSITIONS[type]);
|
|
56
|
+
const resetVersion = (_b = (0, FormContext_1.useFormContext)()) === null || _b === void 0 ? void 0 : _b.resetVersion;
|
|
55
57
|
const initialValueFromSubject = (0, FormContext_1.useFormContextPart)((value) => (0, FormNative_1.getByPath)(value.originalSubject, formItemId));
|
|
56
58
|
const initialValue = initialValueFromSubject === undefined ? rest.initialValue : initialValueFromSubject;
|
|
57
59
|
const value = (0, FormContext_1.useFormContextPart)((value) => (0, FormNative_1.getByPath)(value.subject, formItemId));
|
|
@@ -64,6 +66,11 @@ exports.FormItem = (0, react_1.memo)(function FormItem(_a) {
|
|
|
64
66
|
setFormItemId(newId);
|
|
65
67
|
dispatch((0, formActions_1.fieldInitialized)(newId, initialValue));
|
|
66
68
|
}, [bindTo, dispatch, initialValue]);
|
|
69
|
+
(0, react_1.useEffect)(() => {
|
|
70
|
+
if (resetVersion) {
|
|
71
|
+
dispatch((0, formActions_1.fieldInitialized)(formItemId, initialValue, true));
|
|
72
|
+
}
|
|
73
|
+
}, [resetVersion, formItemId, initialValue, dispatch]);
|
|
67
74
|
(0, Validations_1.useValidation)(validations, onValidate, value, dispatch, formItemId, customValidationsDebounce);
|
|
68
75
|
const onStateChange = (0, react_1.useCallback)(({ value }, options) => {
|
|
69
76
|
//we already handled the initial value in the useEffect with fieldInitialized(...);
|
|
@@ -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.MoonIcon = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const moon_svg_react_1 = __importDefault(require("./svg/moon.svg?react"));
|
|
9
|
+
const MoonIcon = (props) => ((0, jsx_runtime_1.jsx)(moon_svg_react_1.default, Object.assign({}, props)));
|
|
10
|
+
exports.MoonIcon = MoonIcon;
|
|
@@ -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.StarsIcon = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const stars_svg_react_1 = __importDefault(require("./svg/stars.svg?react"));
|
|
9
|
+
const StarsIcon = (props) => ((0, jsx_runtime_1.jsx)(stars_svg_react_1.default, Object.assign({}, props)));
|
|
10
|
+
exports.StarsIcon = StarsIcon;
|
|
@@ -79,6 +79,8 @@ const SortDescendingIcon_1 = require("./Icon/SortDescendingIcon");
|
|
|
79
79
|
const NoSortIcon_1 = require("./Icon/NoSortIcon");
|
|
80
80
|
const TrendingLevelIcon_1 = require("./Icon/TrendingLevelIcon");
|
|
81
81
|
const Inspect_1 = require("./Icon/Inspect");
|
|
82
|
+
const MoonIcon_1 = require("./Icon/MoonIcon");
|
|
83
|
+
const StarsIcon_1 = require("./Icon/StarsIcon");
|
|
82
84
|
const pool = new Map();
|
|
83
85
|
function registerIconRenderer(name, renderer) {
|
|
84
86
|
if (typeof name === "object") {
|
|
@@ -194,7 +196,8 @@ registerIconRenderer("duplicate", (props) => (0, jsx_runtime_1.jsx)(hi_1.HiOutli
|
|
|
194
196
|
registerIconRenderer("connect", (props) => (0, jsx_runtime_1.jsx)(rx_1.RxLightningBolt, Object.assign({}, props)));
|
|
195
197
|
registerIconRenderer("cog", (props) => (0, jsx_runtime_1.jsx)(hi_1.HiOutlineCog, Object.assign({}, props)));
|
|
196
198
|
registerIconRenderer("sun", (props) => (0, jsx_runtime_1.jsx)(hi2_1.HiSun, Object.assign({}, props)));
|
|
197
|
-
registerIconRenderer("moon", (props) => (0, jsx_runtime_1.jsx)(
|
|
199
|
+
registerIconRenderer("moon", (props) => (0, jsx_runtime_1.jsx)(MoonIcon_1.MoonIcon, Object.assign({}, props)));
|
|
200
|
+
registerIconRenderer("stars", (props) => (0, jsx_runtime_1.jsx)(StarsIcon_1.StarsIcon, Object.assign({}, props)));
|
|
198
201
|
registerIconRenderer("share", (props) => (0, jsx_runtime_1.jsx)(ShareIcon_1.ShareIcon, Object.assign({}, props)));
|
|
199
202
|
registerIconRenderer("new-window", (props) => (0, jsx_runtime_1.jsx)(rx_1.RxOpenInNewWindow, Object.assign({}, props)));
|
|
200
203
|
registerIconRenderer("paint", (props) => (0, jsx_runtime_1.jsx)(hi2_1.HiOutlinePaintBrush, Object.assign({}, props)));
|
|
@@ -11,18 +11,20 @@ const ButtonNative_1 = require("../Button/ButtonNative");
|
|
|
11
11
|
const InspectorContext_1 = require("../../components-core/InspectorContext");
|
|
12
12
|
const InspectButton_module_scss_1 = __importDefault(require("./InspectButton.module.scss"));
|
|
13
13
|
const themeVars_1 = require("../../components-core/theming/themeVars");
|
|
14
|
+
const pi_1 = require("react-icons/pi");
|
|
14
15
|
const COMP = "InspectButton";
|
|
15
16
|
exports.InspectButtonMd = (0, ComponentDefs_1.createMetadata)({
|
|
16
17
|
status: "experimental",
|
|
17
|
-
description:
|
|
18
|
+
description: "This component displays a button that can turn the inspection " +
|
|
19
|
+
"mode of a running XMLUI app on or off.",
|
|
18
20
|
props: {},
|
|
19
21
|
themeVars: (0, themeVars_1.parseScssVar)(InspectButton_module_scss_1.default.themeVars),
|
|
20
22
|
});
|
|
21
23
|
function InspectButton({ children, style }) {
|
|
22
24
|
const { setInspectMode, inspectMode } = (0, InspectorContext_1.useInspectMode)();
|
|
23
|
-
return ((0, jsx_runtime_1.
|
|
25
|
+
return ((0, jsx_runtime_1.jsxs)(ButtonNative_1.Button, { style: style, className: InspectButton_module_scss_1.default.inspectButton, themeColor: inspectMode ? "primary" : "secondary", variant: inspectMode ? "solid" : "outlined", onClick: () => {
|
|
24
26
|
setInspectMode((prev) => !prev);
|
|
25
|
-
}, children: children }));
|
|
27
|
+
}, children: [(0, jsx_runtime_1.jsx)(pi_1.PiFileCode, { className: InspectButton_module_scss_1.default.icon }), children] }));
|
|
26
28
|
}
|
|
27
29
|
/**
|
|
28
30
|
* Define the renderer for the Button component
|
|
@@ -15,7 +15,7 @@ exports.ToneChangerButtonMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
15
15
|
});
|
|
16
16
|
function ToneChangerButton() {
|
|
17
17
|
const { activeThemeTone, setActiveThemeTone } = (0, ThemeContext_1.useThemes)();
|
|
18
|
-
return ((0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { variant: "ghost", icon: (0, jsx_runtime_1.jsx)(IconNative_1.Icon, { name: activeThemeTone === "light" ? "
|
|
18
|
+
return ((0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { variant: "ghost", icon: (0, jsx_runtime_1.jsx)(IconNative_1.Icon, { name: activeThemeTone === "light" ? "stars" : "sun" }), onClick: () => {
|
|
19
19
|
activeThemeTone === "light" ? setActiveThemeTone("dark") : setActiveThemeTone("light");
|
|
20
20
|
} }));
|
|
21
21
|
}
|
|
@@ -15,9 +15,9 @@ const react_dom_1 = require("react-dom");
|
|
|
15
15
|
const ThemeContext_1 = require("./theming/ThemeContext");
|
|
16
16
|
const classnames_1 = __importDefault(require("classnames"));
|
|
17
17
|
const ButtonNative_1 = require("../components/Button/ButtonNative");
|
|
18
|
-
const IconNative_1 = __importDefault(require("../components/Icon/IconNative"));
|
|
19
18
|
const InspectorButton_module_scss_1 = __importDefault(require("./InspectorButton.module.scss"));
|
|
20
19
|
const ComponentRegistryContext_1 = require("../components/ComponentRegistryContext");
|
|
20
|
+
const pi_1 = require("react-icons/pi");
|
|
21
21
|
// --- The context object that is used to store the inspector information.
|
|
22
22
|
exports.InspectorContext = (0, react_1.createContext)(null);
|
|
23
23
|
function InspectorProvider({ children, sources, projectCompilation, mockApi, }) {
|
|
@@ -28,7 +28,6 @@ function InspectorProvider({ children, sources, projectCompilation, mockApi, })
|
|
|
28
28
|
const [devToolsSize, setDevToolsSize] = (0, react_1.useState)(0);
|
|
29
29
|
const [devToolsSide, setDevToolsSide] = (0, react_1.useState)("bottom");
|
|
30
30
|
const [inspectMode, setInspectMode] = (0, react_1.useState)(false);
|
|
31
|
-
const [lastInspectedElement, setLastInspectedElement] = (0, react_1.useState)(null);
|
|
32
31
|
const componentRegistry = (0, ComponentRegistryContext_1.useComponentRegistry)();
|
|
33
32
|
const devToolsEntry = componentRegistry.lookupComponentRenderer("XMLUIDevtools.DevTools");
|
|
34
33
|
const contextValue = (0, react_1.useMemo)(() => {
|
|
@@ -97,7 +96,7 @@ function InspectButton({ inspectId, node, inspectedNode, setInspectedNode, setSh
|
|
|
97
96
|
{
|
|
98
97
|
name: "offset",
|
|
99
98
|
options: {
|
|
100
|
-
offset: [
|
|
99
|
+
offset: [-4, -18],
|
|
101
100
|
},
|
|
102
101
|
},
|
|
103
102
|
{
|
|
@@ -184,7 +183,7 @@ function InspectButton({ inspectId, node, inspectedNode, setInspectedNode, setSh
|
|
|
184
183
|
htmlElement.removeEventListener("mouseenter", mouseenter);
|
|
185
184
|
htmlElement.removeEventListener("mouseleave", mouseleave);
|
|
186
185
|
};
|
|
187
|
-
}, [inspectId, node, inspectMode,
|
|
186
|
+
}, [inspectId, node, inspectMode, setShowCode]);
|
|
188
187
|
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: inspectMode
|
|
189
188
|
? null
|
|
190
189
|
: visible &&
|
|
@@ -201,7 +200,7 @@ function InspectButton({ inspectId, node, inspectedNode, setInspectedNode, setSh
|
|
|
201
200
|
}, onClick: () => {
|
|
202
201
|
setInspectedNode(node);
|
|
203
202
|
setShowCode(true);
|
|
204
|
-
}, children: (0, jsx_runtime_1.jsx)(
|
|
203
|
+
}, children: (0, jsx_runtime_1.jsx)(pi_1.PiFileCode, { className: InspectorButton_module_scss_1.default.inspectIcon }) })), root) }));
|
|
205
204
|
}
|
|
206
205
|
function useDevTools() {
|
|
207
206
|
const context = (0, react_1.useContext)(exports.InspectorContext);
|
|
@@ -56,14 +56,12 @@ const ScriptingSourceTree_1 = require("../../abstractions/scripting/ScriptingSou
|
|
|
56
56
|
const containers_1 = require("../abstractions/containers");
|
|
57
57
|
const AppContext_1 = require("../AppContext");
|
|
58
58
|
const buildProxy_1 = require("../rendering/buildProxy");
|
|
59
|
-
const DebugViewProvider_1 = require("../DebugViewProvider");
|
|
60
59
|
const process_statement_async_1 = require("../script-runner/process-statement-async");
|
|
61
60
|
const process_statement_sync_1 = require("../script-runner/process-statement-sync");
|
|
62
61
|
const extractParam_1 = require("../utils/extractParam");
|
|
63
62
|
const hooks_1 = require("../utils/hooks");
|
|
64
63
|
const misc_1 = require("../utils/misc");
|
|
65
64
|
const statementUtils_1 = require("../utils/statementUtils");
|
|
66
|
-
const StateViewerNative_1 = require("../../components/StateViewer/StateViewerNative");
|
|
67
65
|
const renderChild_1 = require("./renderChild");
|
|
68
66
|
const ThemeContext_1 = require("../theming/ThemeContext");
|
|
69
67
|
const LoaderComponent_1 = require("../LoaderComponent");
|
|
@@ -521,9 +519,6 @@ exports.Container = (0, react_1.memo)((0, react_1.forwardRef)(function Container
|
|
|
521
519
|
const uidInfo = {};
|
|
522
520
|
const thisUidInfoRef = (0, react_1.useRef)({});
|
|
523
521
|
const uidInfoRef = node.uses === undefined ? parentUidInfoRef : thisUidInfoRef;
|
|
524
|
-
const debugContext = (0, DebugViewProvider_1.useDebugView)();
|
|
525
|
-
const stateViewProps = debugContext === null || debugContext === void 0 ? void 0 : debugContext.stateViewOptions;
|
|
526
|
-
const showContainer = stateViewProps && debugContext.displayStateView;
|
|
527
522
|
const renderedChildren = stableRenderChild(node.children, layoutContextRef === null || layoutContextRef === void 0 ? void 0 : layoutContextRef.current, parentRenderContext, uidInfoRef, ref);
|
|
528
523
|
const renderedLoaders = renderLoaders({
|
|
529
524
|
uidInfo,
|
|
@@ -545,7 +540,7 @@ exports.Container = (0, react_1.memo)((0, react_1.forwardRef)(function Container
|
|
|
545
540
|
const containerContent = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [renderedLoaders, !!children && (0, react_1.isValidElement)(renderedChildren)
|
|
546
541
|
? (0, react_1.cloneElement)(renderedChildren, null, children)
|
|
547
542
|
: renderedChildren] }));
|
|
548
|
-
return ((0, jsx_runtime_1.
|
|
543
|
+
return ((0, jsx_runtime_1.jsx)(react_1.Fragment, { children: containerContent }, node.uid
|
|
549
544
|
? `${resolvedKey}>${(0, extractParam_1.extractParam)(componentState, node.uid, appContext, true)}`
|
|
550
545
|
: undefined));
|
|
551
546
|
}));
|