xmlui 0.9.12 → 0.9.13

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/index.css CHANGED
@@ -6605,7 +6605,7 @@ button._selectTrigger_nwesf_46._valid_nwesf_37::placeholder {
6605
6605
  * This function allows other CSS modules to get the value of the CSS variable specified in $componentVariable.
6606
6606
  Optionally, you can provide a $fallbackValue to set the variable's value if that is not defined.
6607
6607
  */
6608
- ._markdownContent_1ozt1_13 ._blockquote_1ozt1_13 {
6608
+ ._markdownContent_1anzp_13 ._blockquote_1anzp_13 {
6609
6609
  position: relative;
6610
6610
  margin-top: var(--xmlui-marginTop-Blockquote);
6611
6611
  margin-bottom: var(--xmlui-marginBottom-Blockquote);
@@ -6613,7 +6613,7 @@ button._selectTrigger_nwesf_46._valid_nwesf_37::placeholder {
6613
6613
  border-radius: var(--xmlui-borderRadius-Blockquote);
6614
6614
  padding-left: var(--xmlui-paddingLeft-Blockquote);
6615
6615
  }
6616
- ._markdownContent_1ozt1_13 ._blockquote_1ozt1_13::before {
6616
+ ._markdownContent_1anzp_13 ._blockquote_1anzp_13::before {
6617
6617
  background-color: var(--xmlui-accentColor-Blockquote);
6618
6618
  position: absolute;
6619
6619
  top: 0;
@@ -6623,39 +6623,50 @@ button._selectTrigger_nwesf_46._valid_nwesf_37::placeholder {
6623
6623
  height: 100%;
6624
6624
  width: var(--xmlui-accentWidth-Blockquote);
6625
6625
  }
6626
- ._markdownContent_1ozt1_13 ._blockquoteContainer_1ozt1_31 {
6626
+ ._markdownContent_1anzp_13 ._blockquoteContainer_1anzp_31 {
6627
6627
  padding: 0.5rem;
6628
6628
  }
6629
- ._markdownContent_1ozt1_13 ._admonitionBlockquote_1ozt1_34 {
6629
+ ._markdownContent_1anzp_13 ._admonitionBlockquote_1anzp_34 {
6630
6630
  margin-top: var(--xmlui-marginTop-Admonition);
6631
6631
  margin-bottom: var(--xmlui-marginBottom-Admonition);
6632
6632
  background-color: var(--xmlui-backgroundColor-Admonition);
6633
6633
  border-radius: var(--xmlui-borderRadius-Admonition);
6634
6634
  }
6635
- ._markdownContent_1ozt1_13 ._admonitionContainer_1ozt1_40 {
6635
+ ._markdownContent_1anzp_13 ._admonitionContainer_1anzp_40 {
6636
6636
  padding: 0.5rem;
6637
6637
  display: flex;
6638
6638
  align-items: flex-start;
6639
6639
  }
6640
- ._markdownContent_1ozt1_13 ._admonitionContent_1ozt1_45 {
6640
+ ._markdownContent_1anzp_13 ._admonitionContent_1anzp_45 {
6641
6641
  margin-left: var(--xmlui-marginLeft-Admonition-content);
6642
6642
  }
6643
- ._markdownContent_1ozt1_13 ._admonitionIcon_1ozt1_48 {
6643
+ ._markdownContent_1anzp_13 ._admonitionIcon_1anzp_48 {
6644
6644
  font-size: var(--xmlui-iconSize-Admonition);
6645
6645
  line-height: 1;
6646
6646
  }
6647
- ._markdownContent_1ozt1_13 ._admonitionContent_1ozt1_45 {
6647
+ ._markdownContent_1anzp_13 ._admonitionContent_1anzp_45 {
6648
6648
  flex: 1;
6649
6649
  min-width: 0;
6650
6650
  }
6651
- ._markdownContent_1ozt1_13 ._admonitionBlockquote_1ozt1_34 ._admonitionContent_1ozt1_45 [class*=text_][class*=markdown_] {
6651
+ ._markdownContent_1anzp_13 ._admonitionBlockquote_1anzp_34 ._admonitionContent_1anzp_45 [class*=text_][class*=markdown_] {
6652
6652
  margin-top: 0;
6653
6653
  margin-bottom: 0;
6654
6654
  }
6655
- ._markdownContent_1ozt1_13 > *:first-child {
6655
+ ._markdownContent_1anzp_13 li:has(> input[type=checkbox]),
6656
+ ._markdownContent_1anzp_13 li:has(> input[type=checkbox]) {
6657
+ display: flex;
6658
+ align-items: flex-start;
6659
+ }
6660
+ ._markdownContent_1anzp_13 li:has(> input[type=checkbox]) > input[type=checkbox],
6661
+ ._markdownContent_1anzp_13 li:has(> input[type=checkbox]) > input[type=checkbox] {
6662
+ margin-right: 8px;
6663
+ margin-top: 4px;
6664
+ flex-shrink: 0;
6665
+ }
6666
+ ._markdownContent_1anzp_13 > *:first-child {
6656
6667
  margin-top: 0;
6657
6668
  }
6658
- ._markdownContent_1ozt1_13 > *:last-child {
6669
+ ._markdownContent_1anzp_13 > *:last-child {
6659
6670
  margin-bottom: 0;
6660
6671
  }
6661
6672
 
@@ -6704,7 +6715,7 @@ $color-marker-ListItem: createThemeVar("color-marker-ListItem");
6704
6715
  * This function allows other CSS modules to get the value of the CSS variable specified in $componentVariable.
6705
6716
  Optionally, you can provide a $fallbackValue to set the variable's value if that is not defined.
6706
6717
  */
6707
- ._htmlTable_1wzn5_13 {
6718
+ ._htmlTable_ei3dh_13 {
6708
6719
  background-color: var(--xmlui-backgroundColor-HtmlTable);
6709
6720
  color: var(--xmlui-textColor-HtmlTable);
6710
6721
  font-family: var(--xmlui-fontFamily-HtmlTable);
@@ -6740,7 +6751,7 @@ $color-marker-ListItem: createThemeVar("color-marker-ListItem");
6740
6751
  padding-bottom: var(--xmlui-paddingBottom-HtmlTable, var(--xmlui-paddingVertical-HtmlTable, var(--xmlui-padding-HtmlTable)));
6741
6752
  }
6742
6753
 
6743
- ._htmlThead_1wzn5_49 {
6754
+ ._htmlThead_ei3dh_49 {
6744
6755
  background-color: var(--xmlui-backgroundColor-HtmlThead);
6745
6756
  color: var(--xmlui-textColor-HtmlThead);
6746
6757
  font-weight: var(--xmlui-fontWeight-HtmlThead);
@@ -6773,7 +6784,7 @@ $color-marker-ListItem: createThemeVar("color-marker-ListItem");
6773
6784
  padding-bottom: var(--xmlui-paddingBottom-HtmlThead, var(--xmlui-paddingVertical-HtmlThead, var(--xmlui-padding-HtmlThead)));
6774
6785
  }
6775
6786
 
6776
- ._htmlTbody_1wzn5_82 {
6787
+ ._htmlTbody_ei3dh_82 {
6777
6788
  background-color: var(--xmlui-backgroundColor-HtmlTbody);
6778
6789
  color: var(--xmlui-textColor-HtmlTbody);
6779
6790
  text-align: var(--xmlui-textAlign-HtmlTbody);
@@ -6781,12 +6792,12 @@ $color-marker-ListItem: createThemeVar("color-marker-ListItem");
6781
6792
  text-transform: var(--xmlui-textTransform-HtmlTbody);
6782
6793
  }
6783
6794
 
6784
- ._htmlTfoot_1wzn5_90 {
6795
+ ._htmlTfoot_ei3dh_90 {
6785
6796
  background-color: var(--xmlui-backgroundColor-HtmlTfoot);
6786
6797
  color: var(--xmlui-textColor-HtmlTfoot);
6787
6798
  }
6788
6799
 
6789
- ._htmlTh_1wzn5_49 {
6800
+ ._htmlTh_ei3dh_49 {
6790
6801
  background-color: var(--xmlui-backgroundColor-HtmlTh);
6791
6802
  color: var(--xmlui-textColor-HtmlTh);
6792
6803
  font-weight: var(--xmlui-fontWeight-HtmlTh);
@@ -6817,11 +6828,11 @@ $color-marker-ListItem: createThemeVar("color-marker-ListItem");
6817
6828
  padding-top: var(--xmlui-paddingTop-HtmlTh, var(--xmlui-paddingVertical-HtmlTh, var(--xmlui-padding-HtmlTh)));
6818
6829
  padding-bottom: var(--xmlui-paddingBottom-HtmlTh, var(--xmlui-paddingVertical-HtmlTh, var(--xmlui-padding-HtmlTh)));
6819
6830
  }
6820
- ._htmlTh_1wzn5_49:hover {
6831
+ ._htmlTh_ei3dh_49:hover {
6821
6832
  background-color: var(--xmlui-backgroundColor-HtmlTh--hover);
6822
6833
  }
6823
6834
 
6824
- ._htmlTr_1wzn5_130 {
6835
+ ._htmlTr_ei3dh_130 {
6825
6836
  background-color: var(--xmlui-backgroundColor-HtmlTr);
6826
6837
  color: var(--xmlui-textColor-HtmlTr);
6827
6838
  font-weight: var(--xmlui-fontWeight-HtmlTr);
@@ -6847,18 +6858,18 @@ $color-marker-ListItem: createThemeVar("color-marker-ListItem");
6847
6858
  border-end-start-radius: var(--xmlui-borderEndStartRadius-HtmlTr, var(--xmlui-borderRadius-HtmlTr));
6848
6859
  border-end-end-radius: var(--xmlui-borderEndEndRadius-HtmlTr, var(--xmlui-borderRadius-HtmlTr));
6849
6860
  }
6850
- ._htmlTr_1wzn5_130:nth-child(even) {
6861
+ ._htmlTr_ei3dh_130:nth-child(even) {
6851
6862
  background-color: var(--xmlui-backgroundColor-even-HtmlTr);
6852
6863
  }
6853
- ._htmlTr_1wzn5_130:hover {
6864
+ ._htmlTr_ei3dh_130:hover {
6854
6865
  background-color: var(--xmlui-backgroundColor-HtmlTr--hover);
6855
6866
  color: var(--xmlui-textColor-HtmlTr--hover);
6856
6867
  }
6857
- ._htmlTr_1wzn5_130:hover:not(:has(:not(th))) {
6868
+ ._htmlTr_ei3dh_130:hover:not(:has(:not(th))) {
6858
6869
  background-color: initial;
6859
6870
  }
6860
6871
 
6861
- ._htmlTd_1wzn5_167 {
6872
+ ._htmlTd_ei3dh_167 {
6862
6873
  background-color: var(--xmlui-backgroundColor-HtmlTd);
6863
6874
  text-align: var(--xmlui-text-align-HtmlTd);
6864
6875
  vertical-align: var(--xmlui-verticalAlign-HtmlTd);
@@ -6891,50 +6902,45 @@ $color-marker-ListItem: createThemeVar("color-marker-ListItem");
6891
6902
  padding-bottom: var(--xmlui-paddingBottom-HtmlTd, var(--xmlui-paddingVertical-HtmlTd, var(--xmlui-padding-HtmlTd)));
6892
6903
  }
6893
6904
 
6894
- ._htmlUl_1wzn5_200 {
6905
+ ._htmlUl_ei3dh_200 {
6895
6906
  margin-top: var(--xmlui-marginTop-HtmlUl);
6896
6907
  margin-bottom: var(--xmlui-marginBottom-HtmlUl);
6897
6908
  }
6898
6909
 
6899
- ._htmlOl_1wzn5_205 {
6910
+ ._htmlOl_ei3dh_205 {
6900
6911
  margin-top: var(--xmlui-marginTop-HtmlOl);
6901
6912
  margin-bottom: var(--xmlui-marginBottom-HtmlOl);
6902
6913
  }
6903
6914
 
6904
- li ._htmlUl_1wzn5_200,
6905
- li ._htmlOl_1wzn5_205 {
6906
- margin-top: 0;
6907
- margin-bottom: 0;
6915
+ ._htmlLi_ei3dh_210 {
6916
+ margin-top: var(--xmlui-marginTop-HtmlLi);
6917
+ margin-bottom: var(--xmlui-marginBottom-HtmlLi);
6908
6918
  }
6909
6919
 
6910
- ._htmlUl_1wzn5_200 li:has(> input[type=checkbox]),
6911
- ._htmlOl_1wzn5_205 li:has(> input[type=checkbox]) {
6912
- display: flex;
6913
- align-items: flex-start;
6914
- }
6915
- ._htmlUl_1wzn5_200 li:has(> input[type=checkbox]) > input[type=checkbox],
6916
- ._htmlOl_1wzn5_205 li:has(> input[type=checkbox]) > input[type=checkbox] {
6917
- margin-right: 8px;
6918
- margin-top: 4px;
6919
- flex-shrink: 0;
6920
+ /*
6921
+ // Compress when nested
6922
+ li .htmlUl,
6923
+ li .htmlOl {
6924
+ margin-top: 0;
6925
+ margin-bottom: 0;
6920
6926
  }
6921
-
6922
- ._htmlH1_1wzn5_228, ._htmlH2_1wzn5_228, ._htmlH3_1wzn5_228, ._htmlH4_1wzn5_228, ._htmlH5_1wzn5_228, ._htmlH6_1wzn5_228 {
6927
+ */
6928
+ ._htmlH1_ei3dh_223, ._htmlH2_ei3dh_223, ._htmlH3_ei3dh_223, ._htmlH4_ei3dh_223, ._htmlH5_ei3dh_223, ._htmlH6_ei3dh_223 {
6923
6929
  margin-top: var(--xmlui-marginTop-HtmlHeading);
6924
6930
  margin-bottom: var(--xmlui-marginBottom-HtmlHeading);
6925
6931
  }
6926
6932
 
6927
- ._htmlVideo_1wzn5_233 {
6933
+ ._htmlVideo_ei3dh_228 {
6928
6934
  margin-top: var(--xmlui-marginTop-HtmlVideo);
6929
6935
  margin-bottom: var(--xmlui-marginBottom-HtmlVideo);
6930
6936
  }
6931
6937
 
6932
- ._htmlDetails_1wzn5_238 {
6938
+ ._htmlDetails_ei3dh_233 {
6933
6939
  margin-top: var(--xmlui-marginTop-HtmlDetails);
6934
6940
  margin-bottom: var(--xmlui-marginBottom-HtmlDetails);
6935
6941
  }
6936
6942
 
6937
- ._htmlDetails_1wzn5_238 {
6943
+ ._htmlDetails_ei3dh_233 {
6938
6944
  margin-top: var(--xmlui-marginTop-HtmlDetails);
6939
6945
  margin-bottom: var(--xmlui-marginBottom-HtmlDetails);
6940
6946
  }/*
@@ -140,7 +140,6 @@ const formReducer = (0, immer_1.default)((state, action) => {
140
140
  break;
141
141
  }
142
142
  case formActions_1.FormActionKind.BACKEND_VALIDATION_ARRIVED: {
143
- //console.log(state.validationResults[field]) //action.payload.fieldValidationResults
144
143
  state.submitInProgress = false;
145
144
  state.generalValidationResults = action.payload.generalValidationResults;
146
145
  Object.keys(state.validationResults).forEach((key) => {
@@ -241,7 +240,14 @@ const Form = (0, react_2.forwardRef)(function ({ formState, dispatch, initialVal
241
240
  const prevFocused = document.activeElement;
242
241
  dispatch((0, formActions_1.formSubmitting)());
243
242
  try {
244
- yield (onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(formState.subject, {
243
+ // --- Remove the properties from formState.subject where the property name ends with UNBOUND_FIELD_SUFFIX
244
+ const filteredSubject = Object.entries(formState.subject).reduce((acc, [key, value]) => {
245
+ if (!key.endsWith(formActions_1.UNBOUND_FIELD_SUFFIX)) {
246
+ acc[key] = value;
247
+ }
248
+ return acc;
249
+ }, {});
250
+ yield (onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(filteredSubject, {
245
251
  passAsDefaultBody: true,
246
252
  }));
247
253
  dispatch((0, formActions_1.formSubmitted)());
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FormActionKind = void 0;
3
+ exports.FormActionKind = exports.UNBOUND_FIELD_SUFFIX = void 0;
4
4
  exports.fieldInitialized = fieldInitialized;
5
5
  exports.fieldChanged = fieldChanged;
6
6
  exports.fieldFocused = fieldFocused;
@@ -12,6 +12,7 @@ exports.formSubmitting = formSubmitting;
12
12
  exports.formSubmitted = formSubmitted;
13
13
  exports.formReset = formReset;
14
14
  exports.backendValidationArrived = backendValidationArrived;
15
+ exports.UNBOUND_FIELD_SUFFIX = "__UNBOUND_FIELD__";
15
16
  var FormActionKind;
16
17
  (function (FormActionKind) {
17
18
  FormActionKind["FIELD_LOST_FOCUS"] = "FormActionKind:FIELD_LOST_FOCUS";
@@ -99,16 +100,16 @@ function formReset(originalSubject) {
99
100
  return {
100
101
  type: FormActionKind.RESET,
101
102
  payload: {
102
- originalSubject
103
+ originalSubject,
103
104
  },
104
105
  };
105
106
  }
106
- function backendValidationArrived({ generalValidationResults = [], fieldValidationResults = {} }) {
107
+ function backendValidationArrived({ generalValidationResults = [], fieldValidationResults = {}, }) {
107
108
  return {
108
109
  type: FormActionKind.BACKEND_VALIDATION_ARRIVED,
109
110
  payload: {
110
111
  generalValidationResults,
111
- fieldValidationResults
112
+ fieldValidationResults,
112
113
  },
113
114
  };
114
115
  }
@@ -47,32 +47,36 @@ exports.defaultProps = {
47
47
  };
48
48
  exports.FormItem = (0, react_1.memo)(function FormItem(_a) {
49
49
  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
+ const defaultId = (0, react_1.useId)();
51
+ const [formItemId, setFormItemId] = (0, react_1.useState)(bindTo);
50
52
  const labelWidthValue = (0, FormContext_1.useFormContextPart)((value) => labelWidth || value.itemLabelWidth);
51
53
  const labelBreakValue = (0, FormContext_1.useFormContextPart)((value) => labelBreak !== undefined ? labelBreak : value.itemLabelBreak);
52
54
  const labelPositionValue = (0, FormContext_1.useFormContextPart)((value) => labelPosition || value.itemLabelPosition || DEFAULT_LABEL_POSITIONS[type]);
53
- const initialValueFromSubject = (0, FormContext_1.useFormContextPart)((value) => (0, FormNative_1.getByPath)(value.originalSubject, bindTo));
55
+ const initialValueFromSubject = (0, FormContext_1.useFormContextPart)((value) => (0, FormNative_1.getByPath)(value.originalSubject, formItemId));
54
56
  const initialValue = initialValueFromSubject === undefined ? rest.initialValue : initialValueFromSubject;
55
- const value = (0, FormContext_1.useFormContextPart)((value) => (0, FormNative_1.getByPath)(value.subject, bindTo));
56
- const validationResult = (0, FormContext_1.useFormContextPart)((value) => value.validationResults[bindTo]);
57
+ const value = (0, FormContext_1.useFormContextPart)((value) => (0, FormNative_1.getByPath)(value.subject, formItemId));
58
+ const validationResult = (0, FormContext_1.useFormContextPart)((value) => value.validationResults[formItemId]);
57
59
  const dispatch = (0, FormContext_1.useFormContextPart)((value) => value.dispatch);
58
60
  const formEnabled = (0, FormContext_1.useFormContextPart)((value) => value.enabled);
59
61
  const isEnabled = enabled && formEnabled;
60
62
  (0, react_1.useEffect)(() => {
61
- dispatch((0, formActions_1.fieldInitialized)(bindTo, initialValue));
63
+ const newId = bindTo || `${defaultId}${formActions_1.UNBOUND_FIELD_SUFFIX}`;
64
+ setFormItemId(newId);
65
+ dispatch((0, formActions_1.fieldInitialized)(newId, initialValue));
62
66
  }, [bindTo, dispatch, initialValue]);
63
- (0, Validations_1.useValidation)(validations, onValidate, value, dispatch, bindTo, customValidationsDebounce);
67
+ (0, Validations_1.useValidation)(validations, onValidate, value, dispatch, formItemId, customValidationsDebounce);
64
68
  const onStateChange = (0, react_1.useCallback)(({ value }, options) => {
65
69
  //we already handled the initial value in the useEffect with fieldInitialized(...);
66
70
  if (!(options === null || options === void 0 ? void 0 : options.initial)) {
67
- dispatch((0, formActions_1.fieldChanged)(bindTo, value));
71
+ dispatch((0, formActions_1.fieldChanged)(formItemId, value));
68
72
  }
69
- }, [bindTo, dispatch]);
73
+ }, [formItemId, dispatch]);
70
74
  (0, react_1.useEffect)(() => {
71
75
  return () => {
72
- dispatch((0, formActions_1.fieldRemoved)(bindTo));
76
+ dispatch((0, formActions_1.fieldRemoved)(formItemId));
73
77
  };
74
- }, [bindTo, dispatch]);
75
- const { validationStatus, isHelperTextShown } = (0, Validations_1.useValidationDisplay)(bindTo, value, validationResult, validationMode);
78
+ }, [formItemId, dispatch]);
79
+ const { validationStatus, isHelperTextShown } = (0, Validations_1.useValidationDisplay)(formItemId, value, validationResult, validationMode);
76
80
  let formControl = null;
77
81
  switch (type) {
78
82
  case "select": {
@@ -150,10 +154,10 @@ exports.FormItem = (0, react_1.memo)(function FormItem(_a) {
150
154
  }
151
155
  }
152
156
  const onFocus = (0, misc_1.useEvent)(() => {
153
- dispatch((0, formActions_1.fieldFocused)(bindTo));
157
+ dispatch((0, formActions_1.fieldFocused)(formItemId));
154
158
  });
155
159
  const onBlur = (0, misc_1.useEvent)(() => {
156
- dispatch((0, formActions_1.fieldLostFocus)(bindTo));
160
+ dispatch((0, formActions_1.fieldLostFocus)(formItemId));
157
161
  });
158
162
  const [animateContainerRef] = (0, react_2.useAutoAnimate)({ duration: 100 });
159
163
  return ((0, jsx_runtime_1.jsx)(ItemWithLabel_1.ItemWithLabel, { labelPosition: labelPositionValue, label: label, labelWidth: labelWidthValue, labelBreak: labelBreakValue, enabled: isEnabled, required: validations.required, validationInProgress: validationResult === null || validationResult === void 0 ? void 0 : validationResult.partial, onFocus: onFocus, onBlur: onBlur, style: style, validationResult: (0, jsx_runtime_1.jsx)("div", { ref: animateContainerRef, children: isHelperTextShown &&
@@ -39,6 +39,7 @@ exports.MarkdownMd = (0, ComponentDefs_1.createMetadata)({
39
39
  "marginBottom-Blockquote": "1rem",
40
40
  "marginBottom-Text-codefence": ".5rem",
41
41
  "marginBottom-Text-markdown": ".5rem",
42
+ "marginTop-HtmlLi": "-0.5rem",
42
43
  light: {
43
44
  // --- No light-specific theme vars
44
45
  },
@@ -27,7 +27,6 @@ const HtmlTags_module_scss_1 = __importDefault(require("../HtmlTags/HtmlTags.mod
27
27
  const HeadingNative_1 = require("../Heading/HeadingNative");
28
28
  const TextNative_1 = require("../Text/TextNative");
29
29
  const LinkNative_1 = require("../Link/LinkNative");
30
- const ImageNative_1 = require("../Image/ImageNative");
31
30
  const Toggle_1 = require("../Toggle/Toggle");
32
31
  const ScriptingSourceTree_1 = require("../../abstractions/scripting/ScriptingSourceTree");
33
32
  exports.Markdown = (0, react_1.memo)(function Markdown({ extractValue, removeIndents = true, children, style, }) {
@@ -44,6 +43,10 @@ exports.Markdown = (0, react_1.memo)(function Markdown({ extractValue, removeInd
44
43
  var { children, node } = _a, props = __rest(_a, ["children", "node"]);
45
44
  return (0, jsx_runtime_1.jsx)("video", Object.assign({ className: HtmlTags_module_scss_1.default.htmlVideo }, props, { children: children }));
46
45
  },
46
+ img(_a) {
47
+ var { children, node } = _a, props = __rest(_a, ["children", "node"]);
48
+ return (0, jsx_runtime_1.jsx)("img", Object.assign({ className: HtmlTags_module_scss_1.default.htmlImage }, props, { children: children }));
49
+ },
47
50
  h1({ children }) {
48
51
  return (0, jsx_runtime_1.jsx)(HeadingNative_1.Heading, { level: "h1", children: children });
49
52
  },
@@ -83,14 +86,17 @@ exports.Markdown = (0, react_1.memo)(function Markdown({ extractValue, removeInd
83
86
  blockquote({ children }) {
84
87
  return (0, jsx_runtime_1.jsx)(Blockquote, { children: children });
85
88
  },
86
- ol({ children }) {
87
- return (0, jsx_runtime_1.jsx)("ol", { className: HtmlTags_module_scss_1.default.htmlOl, children: children });
89
+ ol(_a) {
90
+ var { children, node } = _a, props = __rest(_a, ["children", "node"]);
91
+ return (0, jsx_runtime_1.jsx)("ol", Object.assign({ className: HtmlTags_module_scss_1.default.htmlOl }, props, { children: children }));
88
92
  },
89
- ul({ children }) {
90
- return (0, jsx_runtime_1.jsx)("ul", { className: HtmlTags_module_scss_1.default.htmlUl, children: children });
93
+ ul(_a) {
94
+ var { children, node } = _a, props = __rest(_a, ["children", "node"]);
95
+ return (0, jsx_runtime_1.jsx)("ul", Object.assign({ className: HtmlTags_module_scss_1.default.htmlUl }, props, { children: children }));
91
96
  },
92
- li({ children }) {
93
- return (0, jsx_runtime_1.jsx)("li", { children: children }); // No custom styling for li elements
97
+ li(_a) {
98
+ var { children, node } = _a, props = __rest(_a, ["children", "node"]);
99
+ return (0, jsx_runtime_1.jsx)("li", Object.assign({ className: HtmlTags_module_scss_1.default.htmlLi }, props, { children: children }));
94
100
  },
95
101
  hr() {
96
102
  return (0, jsx_runtime_1.jsx)(HorizontalRule, {});
@@ -100,9 +106,6 @@ exports.Markdown = (0, react_1.memo)(function Markdown({ extractValue, removeInd
100
106
  const allowedProps = ['style', 'disabled', 'active', 'icon', 'onClick'];
101
107
  return ((0, jsx_runtime_1.jsx)(LinkNative_1.LocalLink, Object.assign({ to: href }, allowedProps, { children: children })));
102
108
  },
103
- img({ src, alt }) {
104
- return (0, jsx_runtime_1.jsx)(ImageNative_1.Image, { src: src, alt: alt });
105
- },
106
109
  // TODO: somehow get the label from the containing li element
107
110
  input({ disabled, checked }) {
108
111
  return ((0, jsx_runtime_1.jsx)(Toggle_1.Toggle, { variant: "checkbox", readOnly: disabled, value: checked }));
@@ -7,7 +7,7 @@ const renderers_1 = require("../../components-core/renderers");
7
7
  const SelectionStoreNative_1 = require("./SelectionStoreNative");
8
8
  const COMP = "SelectionStore";
9
9
  exports.SelectionStoreMd = (0, ComponentDefs_1.createMetadata)({
10
- status: "deprecated",
10
+ status: "experimental",
11
11
  description: `The \`${COMP}\` is a non-visual component that may wrap components (items) and manage ` +
12
12
  `their selection state to accommodate the usage of other actions.`,
13
13
  props: {
@@ -41,28 +41,31 @@ const lodash_es_1 = require("lodash-es");
41
41
  const misc_1 = require("../../components-core/utils/misc");
42
42
  const constants_1 = require("../../components-core/constants");
43
43
  const EMPTY_SELECTION_STATE = {
44
- value: constants_1.EMPTY_ARRAY
44
+ value: constants_1.EMPTY_ARRAY,
45
45
  };
46
46
  const StandaloneSelectionStore = ({ children }) => {
47
47
  const [selection, setSelection] = (0, react_1.useState)(EMPTY_SELECTION_STATE);
48
- return (0, jsx_runtime_1.jsx)(exports.SelectionStore, { updateState: setSelection, selectedItems: selection.value, children: children });
48
+ return ((0, jsx_runtime_1.jsx)(exports.SelectionStore, { updateState: setSelection, selectedItems: selection.value, children: children }));
49
49
  };
50
50
  exports.StandaloneSelectionStore = StandaloneSelectionStore;
51
51
  const SelectionStore = ({ updateState = lodash_es_1.noop, idKey = "id", children, selectedItems = constants_1.EMPTY_ARRAY, registerComponentApi = lodash_es_1.noop, }) => {
52
52
  const [items, setItems] = (0, react_1.useState)(selectedItems);
53
53
  const valueInitializedRef = (0, react_1.useRef)(false);
54
54
  const refreshSelection = (0, misc_1.useEvent)((allItems = constants_1.EMPTY_ARRAY) => {
55
- setItems(allItems);
56
- let value = allItems.filter((item) => !!selectedItems.find((si) => si[idKey] === item[idKey]));
57
- if (!(0, lodash_es_1.isEqual)(selectedItems, value) || !valueInitializedRef.current) {
55
+ const safeAllItems = allItems || constants_1.EMPTY_ARRAY;
56
+ const safeSelectedItems = selectedItems || constants_1.EMPTY_ARRAY;
57
+ setItems(safeAllItems);
58
+ let value = safeAllItems.filter((item) => !!safeSelectedItems.find((si) => si && item && si[idKey] === item[idKey]));
59
+ if (!(0, lodash_es_1.isEqual)(safeSelectedItems, value) || !valueInitializedRef.current) {
58
60
  valueInitializedRef.current = true;
59
61
  updateState({
60
- value: value,
62
+ value,
61
63
  });
62
64
  }
63
65
  });
64
66
  const setSelectedRowIds = (0, misc_1.useEvent)((rowIds) => {
65
- updateState({ value: items.filter((item) => rowIds.includes(item[idKey])) });
67
+ const safeItems = items || constants_1.EMPTY_ARRAY;
68
+ updateState({ value: safeItems.filter((item) => rowIds.includes(item[idKey])) });
66
69
  });
67
70
  const clearSelection = (0, misc_1.useEvent)(() => {
68
71
  setSelectedRowIds(constants_1.EMPTY_ARRAY);
@@ -182,6 +182,7 @@ function evalArrayLiteralAsync(evaluator, thisStack, expr, evalContext, thread)
182
182
  }
183
183
  // --- Done.
184
184
  (0, eval_tree_common_1.setExprValue)(expr, { value }, thread);
185
+ thisStack.push(value);
185
186
  return value;
186
187
  });
187
188
  }
@@ -310,10 +311,9 @@ function evalFunctionInvocationAsync(evaluator, thisStack, expr, evalContext, th
310
311
  var _a, _b, _c, _d;
311
312
  let functionObj;
312
313
  let implicitContextObject = null;
313
- let hostObject;
314
314
  // --- Check for contexted object
315
315
  if (expr.obj.type === ScriptingSourceTree_1.T_MEMBER_ACCESS_EXPRESSION) {
316
- hostObject = yield evaluator(thisStack, expr.obj.obj, evalContext, thread);
316
+ const hostObject = yield evaluator(thisStack, expr.obj.obj, evalContext, thread);
317
317
  yield completeExprValue(expr.obj.obj, thread);
318
318
  functionObj = (0, eval_tree_common_1.evalMemberAccessCore)(thisStack, expr.obj, evalContext, thread);
319
319
  if (expr.obj.obj.type === ScriptingSourceTree_1.T_IDENTIFIER && (hostObject === null || hostObject === void 0 ? void 0 : hostObject._SUPPORT_IMPLICIT_CONTEXT)) {
@@ -182,6 +182,7 @@ function evalArrayLiteral(evaluator, thisStack, expr, evalContext, thread) {
182
182
  }
183
183
  // --- Done.
184
184
  (0, eval_tree_common_1.setExprValue)(expr, { value }, thread);
185
+ thisStack.push(value);
185
186
  return value;
186
187
  }
187
188
  function evalObjectLiteral(evaluator, thisStack, expr, evalContext, thread) {
@@ -239,10 +240,17 @@ function evalBinary(evaluator, thisStack, expr, evalContext, thread) {
239
240
  const l = (_a = (0, eval_tree_common_1.getExprValue)(expr.left, thread)) === null || _a === void 0 ? void 0 : _a.value;
240
241
  if (expr.op === "&&" && !l) {
241
242
  (0, eval_tree_common_1.setExprValue)(expr, { value: l }, thread);
243
+ thisStack.push(l);
242
244
  return l;
243
245
  }
244
246
  if (expr.op === "||" && l) {
245
247
  (0, eval_tree_common_1.setExprValue)(expr, { value: l }, thread);
248
+ thisStack.push(l);
249
+ return l;
250
+ }
251
+ if (expr.op === "??" && l !== null && l !== undefined) {
252
+ (0, eval_tree_common_1.setExprValue)(expr, { value: l }, thread);
253
+ thisStack.push(l);
246
254
  return l;
247
255
  }
248
256
  evaluator(thisStack, expr.right, evalContext, thread);
@@ -292,10 +300,10 @@ function evalFunctionInvocation(evaluator, thisStack, expr, evalContext, thread)
292
300
  let functionObj;
293
301
  let implicitContextObject = null;
294
302
  // --- Check for contexted object
295
- if (expr.obj.type === ScriptingSourceTree_1.T_MEMBER_ACCESS_EXPRESSION && expr.obj.obj.type === ScriptingSourceTree_1.T_IDENTIFIER) {
303
+ if (expr.obj.type === ScriptingSourceTree_1.T_MEMBER_ACCESS_EXPRESSION) {
296
304
  const hostObject = evaluator(thisStack, expr.obj.obj, evalContext, thread);
297
305
  functionObj = (0, eval_tree_common_1.evalMemberAccessCore)(thisStack, expr.obj, evalContext, thread);
298
- if (hostObject === null || hostObject === void 0 ? void 0 : hostObject._SUPPORT_IMPLICIT_CONTEXT) {
306
+ if (expr.obj.obj.type === ScriptingSourceTree_1.T_IDENTIFIER && (hostObject === null || hostObject === void 0 ? void 0 : hostObject._SUPPORT_IMPLICIT_CONTEXT)) {
299
307
  implicitContextObject = hostObject;
300
308
  }
301
309
  }