@lumiastream/ui 0.2.5 → 0.2.6
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.d.ts +27 -14
- package/dist/index.js +522 -179
- package/package.json +59 -59
package/dist/index.js
CHANGED
|
@@ -21,29 +21,57 @@ function styleInject(css, { insertAt } = {}) {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
// src/lumia-ui.css
|
|
24
|
-
styleInject(".ls-button,\n.ls-button *,\n.ls-color-picker,\n.ls-color-picker *,\n.mui-multi-select,\n.mui-multi-select *,\n.ls-multi-select-value,\n.ls-multi-select-value *,\n.ls-variable-picker,\n.ls-variable-picker *,\n.ls-variable-token,\n.ls-variable-token *,\n.ls-font-picker,\n.ls-font-picker *,\n.mui-ls-input,\n.mui-ls-input * {\n box-sizing: border-box;\n}\n.ls-button,\n.ls-color-picker button,\n.mui-multi-select button {\n font: inherit;\n letter-spacing: inherit;\n color: inherit;\n margin: 0;\n}\n.ls-button,\n.ls-color-picker__preview {\n appearance: none;\n -webkit-appearance: none;\n background-color: transparent;\n background-image: none;\n cursor: pointer;\n text-transform: none;\n user-select: none;\n}\n.ls-button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n border-radius: var(--radiusContainerSm, 0.375rem);\n border: 1px solid color-mix(in srgb, #fff 10%, transparent);\n color: var(--neutralLight1, #f4f3ff);\n font-weight: 500;\n box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);\n transition:\n filter 150ms cubic-bezier(0.4, 0, 0.2, 1),\n opacity 150ms cubic-bezier(0.4, 0, 0.2, 1),\n box-shadow 150ms cubic-bezier(0.4, 0, 0.2, 1);\n white-space: nowrap;\n}\n.ls-button--small {\n padding-inline: 0.75rem;\n padding-block: 0.25rem;\n font-size: 0.875rem;\n line-height: 1.25rem;\n}\n.ls-button--medium {\n padding-inline: 1rem;\n padding-block: 0.5rem;\n font-size: 1rem;\n line-height: 1.5rem;\n}\n.ls-button--large {\n padding-inline: 1.5rem;\n padding-block: 0.75rem;\n font-size: 1.125rem;\n line-height: 1.75rem;\n}\n.ls-button:hover {\n filter: brightness(1.1);\n}\n.ls-button:focus {\n outline: none;\n}\n.ls-button:focus-visible {\n box-shadow:\n 0 0 0 2px var(--primary, #ff4076),\n 0 0 0 4px var(--neutralDark1, #1b1a28),\n 0 8px 18px rgba(0, 0, 0, 0.18);\n}\n.ls-button:active {\n filter: brightness(0.95);\n}\n.ls-button:disabled,\n.ls-button[aria-disabled=true] {\n cursor: not-allowed;\n opacity: 0.5;\n}\n.ls-button:disabled:hover,\n.ls-button[aria-disabled=true]:hover {\n filter: none;\n}\n.mui-ls-input,\n.ls-font-picker,\n.ls-color-picker__input {\n width: 100%;\n}\n.mui-multi-select .MuiSelect-select {\n min-width: 0;\n}\n.ls-multi-select-value {\n display: flex;\n width: 100%;\n min-width: 0;\n flex-wrap: nowrap;\n align-items: center;\n justify-content: space-between;\n gap: 0.5rem;\n overflow: hidden;\n white-space: nowrap;\n}\n.ls-multi-select-value__label {\n min-width: 0;\n flex: 1 1 0%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.ls-multi-select-value__count {\n flex-shrink: 0;\n white-space: nowrap;\n}\n.ls-color-picker__preview {\n position: relative;\n display: inline-block;\n width: 1.5rem;\n height: 1.5rem;\n flex-shrink: 0;\n padding: 0;\n border: 1px solid color-mix(in srgb, #fff 25%, transparent);\n border-radius: var(--radiusContainerSm, 0.375rem);\n background-size: cover;\n background-position: center;\n background-repeat: no-repeat;\n box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);\n color: transparent;\n line-height: 0;\n}\n.ls-color-picker__preview:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n.ls-color-picker__preview:focus {\n outline: none;\n}\n.ls-color-picker__preview:focus-visible {\n box-shadow:\n 0 0 0 2px var(--primary, #ff4076),\n 0 0 0 4px var(--neutralDark1, #1b1a28),\n 0 0 0 1px rgba(0, 0, 0, 0.25);\n}\n.ls-color-picker__gradient circle,\n.ls-color-picker__gradient polyline {\n stroke: #fff;\n}\n.ls-variable-picker {\n --variable-custom-color: var(--customVariables, #69ffd2);\n --variable-function-color: var(--functionVariables, var(--semanticPurple, #b489ff));\n --variable-normal-color: var(--normalVariables, var(--semanticBlue, #65b8ff));\n display: flex;\n width: 92vw;\n max-width: 1100px;\n min-height: 50vh;\n max-height: 55vh;\n flex-direction: column;\n overflow: hidden;\n}\n.ls-variable-picker__intro {\n margin-bottom: 1rem;\n color: var(--neutralLight2, #cac9d5);\n}\n.ls-variable-picker__header,\n.ls-variable-picker__row {\n display: grid;\n grid-template-columns: minmax(300px, 1.5fr) 2fr;\n gap: 2rem;\n}\n.ls-variable-picker__header {\n margin-bottom: 0.25rem;\n padding-inline: 0.25rem;\n color: var(--neutralLight3, #9392a1);\n}\n.ls-variable-picker__list {\n height: 100%;\n overflow: auto;\n padding-right: 1rem;\n}\n.ls-variable-picker__row {\n cursor: pointer;\n align-items: start;\n border-bottom: 1px solid color-mix(in srgb, #fff 10%, transparent);\n padding: 1rem 0.25rem;\n}\n.ls-variable-picker__row:active {\n opacity: 0.8;\n}\n.ls-variable-picker__description {\n max-width: 600px;\n overflow-wrap: break-word;\n line-height: 1.25;\n}\n.ls-variable-token {\n display: flex;\n min-width: 0;\n align-items: center;\n}\n.ls-variable-token--custom {\n color: var(--customVariables, #69ffd2);\n}\n.ls-variable-token--function {\n color: var(--functionVariables, var(--semanticPurple, #b489ff));\n}\n.ls-variable-token--system {\n color: var(--normalVariables, var(--semanticBlue, #65b8ff));\n}\n.ls-variable-token__name {\n min-width: 0;\n word-break: break-all;\n}\n.ls-variable-token__badge {\n display: inline-flex;\n margin-left: 0.5rem;\n flex-shrink: 0;\n align-items: center;\n border: 1px solid currentcolor;\n border-radius: 0.25rem;\n padding-inline: 0.25rem;\n padding-block: 0;\n font-size: 10px;\n font-weight: 600;\n line-height: 1;\n text-transform: uppercase;\n}\n");
|
|
24
|
+
styleInject(".ls-color-picker,\n.ls-color-picker *,\n.mui-multi-select,\n.mui-multi-select *,\n.ls-multi-select-value,\n.ls-multi-select-value *,\n.ls-variable-picker,\n.ls-variable-picker *,\n.ls-variable-token,\n.ls-variable-token *,\n.ls-font-picker,\n.ls-font-picker *,\n.mui-ls-input,\n.mui-ls-input * {\n box-sizing: border-box;\n}\n.ls-color-picker button,\n.mui-multi-select button {\n font: inherit;\n letter-spacing: inherit;\n color: inherit;\n margin: 0;\n}\n.ls-color-picker__preview {\n appearance: none;\n -webkit-appearance: none;\n background-color: transparent;\n background-image: none;\n cursor: pointer;\n text-transform: uppercase;\n user-select: none;\n}\n.mui-ls-button.Mui-disabled {\n color: var(--neutralLight2, var(--white2, #cac9d5));\n opacity: 0.45;\n background-color: var(--separator, #0a0821);\n cursor: not-allowed;\n}\n.mui-ls-button {\n border-radius: var(--radius, 1rem);\n padding: 0.375rem 1.5rem;\n text-transform: uppercase;\n}\n.mui-ls-button.MuiButton-sizeSmall {\n padding: 0.25rem 1rem;\n}\n.mui-ls-button.MuiButton-sizeLarge {\n padding: 0.625rem 2rem;\n}\n.mui-ls-button--extended {\n padding-inline: 3rem;\n}\n.mui-ls-button.MuiButton-containedPrimary,\n.mui-ls-button.Mui-disabled.MuiButton-containedPrimary {\n background: var(--primary, #ff4076);\n color: var(--alwayswhite, #fff) !important;\n}\n.mui-ls-button.MuiButton-containedSecondary {\n background-color: var(--secondary, #535395);\n color: var(--alwayswhite, #fff) !important;\n}\n.mui-ls-button.Mui-disabled.MuiButton-containedSecondary {\n background-color: var(--secondary, #535395);\n color: var(--neutralLight2, var(--white2, #cac9d5));\n opacity: 0.4;\n}\n.mui-ls-button.MuiButton-outlinedPrimary {\n color: var(--primary, #ff4076);\n border-color: var(--primary, #ff4076);\n}\n.mui-ls-button.MuiButton-outlinedPrimary:hover {\n border-color: var(--primary, #ff4076);\n background-color: color-mix(in srgb, var(--primary, #ff4076) 12%, transparent);\n}\n.mui-ls-button.MuiButton-outlinedSecondary {\n color: var(--neutralLight1, var(--white, #fff));\n border-color: var(--secondary, #535395);\n}\n.mui-ls-button.MuiButton-outlinedSecondary.Mui-disabled {\n color: var(--neutralLight2, var(--white2, #cac9d5));\n border-color: var(--neutralDark4, var(--cardborder, #393853));\n background-color: var(--transwhite, rgba(255, 255, 255, 0.05));\n opacity: 0.5;\n}\n.mui-ls-button.MuiButton-outlinedSecondary:hover {\n border-color: var(--secondary, #535395);\n background-color: var(--transwhite, rgba(255, 255, 255, 0.05));\n}\n.mui-ls-button.MuiButton-containedError {\n color: var(--alwayswhite, #fff) !important;\n}\n.mui-ls-button.MuiButton-outlinedError {\n color: var(--error, #fd5454);\n border-color: var(--error, #fd5454);\n}\n.mui-ls-button.MuiButton-outlinedError:hover {\n border-color: var(--error, #fd5454);\n background-color: color-mix(in srgb, var(--error, #fd5454) 12%, transparent);\n}\n.mui-ls-button--neutral.mui-ls-button--contained {\n background-color: var(--neutralDark4, var(--cardborder, #393853));\n color: var(--neutralLight1, var(--white, #fff)) !important;\n}\n.mui-ls-button--neutral.mui-ls-button--contained:hover {\n background-color: color-mix(in srgb, var(--neutralDark4, var(--cardborder, #393853)) 82%, var(--neutralLight1, #fff));\n}\n.mui-ls-button--neutral.mui-ls-button--outlined {\n color: var(--neutralLight1, var(--white, #fff));\n border-color: var(--neutralDark4, var(--cardborder, #393853));\n background-color: transparent;\n}\n.mui-ls-button--neutral.mui-ls-button--outlined:hover {\n border-color: var(--neutralLight3, var(--grey, #9392a1));\n background-color: var(--transwhite, rgba(255, 255, 255, 0.05));\n}\n.mui-ls-button--neutral.mui-ls-button--text {\n color: var(--neutralLight1, var(--white, #fff));\n}\n.mui-ls-button--neutral.mui-ls-button--text:hover {\n background-color: var(--transwhite, rgba(255, 255, 255, 0.05));\n}\n.mui-ls-button svg {\n max-height: 24px;\n max-width: 24px;\n}\n.mui-ls-input,\n.ls-font-picker,\n.ls-color-picker__input {\n width: 100%;\n}\n.mui-ls-input,\n.mui-ls-select-form-control,\n.mui-multi-select,\n.ls-font-picker,\n.mui-ls-slider-input-root {\n --ls-control-height: 55px;\n}\n.mui-ls-input .MuiOutlinedInput-root,\n.mui-ls-input .MuiInputBase-root,\n.mui-ls-input .MuiOutlinedInput-notchedOutline,\n.mui-ls-select.MuiOutlinedInput-root,\n.mui-ls-select .MuiOutlinedInput-notchedOutline,\n.mui-multi-select .mui-ls-select.MuiOutlinedInput-root,\n.mui-multi-select .mui-ls-select .MuiOutlinedInput-notchedOutline,\n.ls-font-picker .MuiOutlinedInput-root,\n.ls-font-picker .MuiInputBase-root,\n.ls-font-picker .MuiOutlinedInput-notchedOutline,\n.ls-color-picker__input .MuiOutlinedInput-root,\n.ls-color-picker__input .MuiInputBase-root,\n.ls-color-picker__input .MuiOutlinedInput-notchedOutline {\n border-radius: var(--radius) !important;\n}\n.mui-ls-input .MuiInputBase-root,\n.mui-ls-select.MuiInputBase-root,\n.mui-multi-select .mui-ls-select.MuiInputBase-root,\n.ls-font-picker .MuiInputBase-root {\n min-height: var(--ls-control-height);\n}\n.mui-ls-input.small .MuiInputBase-root {\n min-height: 25px;\n}\n.mui-ls-input.medium .MuiInputBase-root {\n min-height: 35px;\n}\n.mui-ls-input.noMinHeight .MuiInputBase-root {\n min-height: unset;\n}\n.mui-ls-select .MuiSelect-select,\n.mui-multi-select .MuiSelect-select {\n display: flex;\n min-height: calc(var(--ls-control-height) - 2px);\n align-items: center;\n box-sizing: border-box;\n border-radius: var(--radius);\n}\n.mui-multi-select .MuiSelect-select {\n min-width: 0;\n}\n.MuiSvgIcon-root svg {\n color: var(--neutralLight1, var(--white, #fff)) !important;\n}\n.mui-ls-input .MuiSvgIcon-root svg path {\n fill: currentcolor;\n stroke: currentcolor;\n}\n.mui-ls-input .Mui-focused .MuiOutlinedInput-notchedOutline,\n.mui-ls-input .MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline {\n border-color: var(--primary, #ff4076) !important;\n}\n.ls-variable-autocomplete-popper .MuiAutocomplete-paper,\n.ls-variable-autocomplete-paper {\n border: 1px solid var(--neutralDark4, var(--cardborder, #393853)) !important;\n border-radius: var(--radius, 1rem) !important;\n background: var(--neutralDark2, var(--cardbackground, #211f45)) !important;\n color: var(--neutralLight1, var(--white, #fff)) !important;\n box-shadow: 0 16px 32px rgba(0, 0, 0, 0.32) !important;\n overflow: hidden !important;\n}\n.ls-variable-autocomplete-popper .MuiAutocomplete-listbox,\n.ls-variable-autocomplete-listbox {\n padding: 0.25rem 0 !important;\n background: var(--neutralDark2, var(--cardbackground, #211f45)) !important;\n color: var(--neutralLight1, var(--white, #fff)) !important;\n}\n.ls-variable-autocomplete-popper .MuiAutocomplete-option,\n.ls-variable-autocomplete-listbox .MuiAutocomplete-option {\n display: flex !important;\n min-height: 44px !important;\n align-items: center !important;\n padding: 0.625rem 1rem !important;\n color: var(--neutralLight1, var(--white, #fff)) !important;\n font-size: 1rem !important;\n line-height: 1.35 !important;\n cursor: pointer !important;\n transition: background-color 120ms ease, color 120ms ease !important;\n}\n.ls-variable-autocomplete-popper .MuiAutocomplete-option > *,\n.ls-variable-autocomplete-listbox .MuiAutocomplete-option > * {\n min-width: 0;\n}\n.ls-variable-autocomplete-popper .MuiAutocomplete-option:hover,\n.ls-variable-autocomplete-popper .MuiAutocomplete-option.Mui-focused,\n.ls-variable-autocomplete-popper .MuiAutocomplete-option[data-focus=true],\n.ls-variable-autocomplete-popper .MuiAutocomplete-option[aria-selected=true],\n.ls-variable-autocomplete-listbox .MuiAutocomplete-option:hover,\n.ls-variable-autocomplete-listbox .MuiAutocomplete-option.Mui-focused,\n.ls-variable-autocomplete-listbox .MuiAutocomplete-option[data-focus=true],\n.ls-variable-autocomplete-listbox .MuiAutocomplete-option[aria-selected=true] {\n background: var( --cardHover, var(--transwhite, rgba(255, 255, 255, 0.05)) ) !important;\n color: var(--neutralLight1, var(--white, #fff)) !important;\n}\n.ls-variable-option {\n gap: 0.75rem;\n}\n.ls-variable-option__thumb {\n width: 40px;\n height: 40px;\n flex: 0 0 40px;\n border-radius: var(--radius, 1rem);\n object-fit: cover;\n}\n.ls-variable-option__thumb--placeholder {\n background: var(--neutralDark4, var(--cardborder, #393853));\n}\n.ls-variable-option__body {\n min-width: 0;\n}\n.ls-variable-option__label {\n color: var(--neutralLight1, var(--white, #fff));\n font-weight: 500;\n line-height: 1.25;\n}\n.ls-variable-option__helper {\n margin-top: 0.125rem;\n color: var(--neutralLight3, var(--grey, #9392a1));\n font-size: 0.875rem;\n line-height: 1.25;\n}\n.ls-variable-autocomplete-popup-indicator,\n.ls-variable-autocomplete-popup-indicator.MuiIconButton-root,\n.ls-variable-autocomplete-popup-indicator svg {\n color: var(--neutralLight1, var(--white, #fff)) !important;\n}\n.ls-variable-autocomplete-popup-indicator svg path {\n fill: currentcolor !important;\n stroke: currentcolor !important;\n}\n.ls-variable-input-adornment,\n.ls-variable-input-adornment.MuiInputAdornment-root {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n height: 24px;\n width: 24px;\n min-width: 24px;\n margin-left: 0.35rem;\n border-radius: var(--radius, 1rem);\n background: var(--primary, #ff4076) !important;\n color: var(--alwayswhite, var(--white, #fff)) !important;\n font-weight: 800;\n line-height: 1;\n letter-spacing: 0;\n cursor: pointer;\n user-select: none;\n}\n.ls-variable-input-adornment svg,\n.ls-variable-input-adornment path {\n color: currentcolor !important;\n fill: currentcolor !important;\n stroke: currentcolor !important;\n}\n.ls-variable-input-adornment:hover,\n.ls-variable-input-adornment.MuiInputAdornment-root:hover {\n filter: brightness(1.08);\n}\n.ls-variable-input-adornment:active,\n.ls-variable-input-adornment.MuiInputAdornment-root:active {\n filter: brightness(0.96);\n}\n.mui-ls-slider-input-root {\n width: 100%;\n}\n.mui-ls-slider-input-fieldset {\n position: relative;\n min-width: 0;\n width: 100%;\n min-height: var(--ls-control-height);\n margin: 0;\n border: 2px solid var(--neutralDark4, var(--cardborder, #393853));\n border-radius: var(--radius, 1rem);\n padding: 0 0.875rem 0.5rem 0.875rem;\n background: transparent;\n color: var(--neutralLight1, var(--white, #fff));\n}\n.mui-ls-slider-input-fieldset:hover {\n border-color: var(--primary, #ff4076);\n}\n.mui-ls-slider-input-legend {\n display: block;\n width: auto;\n max-width: calc(100% - 1rem);\n margin: 0;\n padding: 0 0.25rem;\n color: var(--neutralLight1, var(--white, #fff));\n font-size: 0.875rem;\n line-height: 1.1;\n white-space: nowrap;\n}\n.mui-ls-slider-input-row {\n display: flex;\n min-width: 0;\n min-height: calc(var(--ls-control-height) - 14px);\n align-items: center;\n gap: 1rem;\n}\n.mui-ls-slider-input-row--slider {\n flex-wrap: nowrap;\n}\n.mui-ls-slider-input-row--input {\n justify-content: stretch;\n}\n.mui-ls-slider-input-value.mui-ls-input {\n margin: 0;\n}\n.mui-ls-slider-input-value.mui-ls-input .MuiFormControl-root,\n.mui-ls-slider-input-value.mui-ls-input .MuiTextField-root {\n margin: 0;\n}\n.mui-ls-slider-input-value.mui-ls-input .MuiInputBase-root {\n min-height: 36px;\n}\n.mui-ls-slider-input-value.mui-ls-input .MuiOutlinedInput-notchedOutline {\n border-color: var(--neutralDark4, var(--cardborder, #393853));\n}\n.mui-ls-slider-input-helper {\n display: block;\n margin-top: 0.25rem;\n color: var(--neutralLight3, var(--grey, #9392a1));\n font-size: 0.75rem;\n line-height: 1.25;\n}\n.ls-multi-select-value {\n display: flex;\n width: 100%;\n min-width: 0;\n flex-wrap: nowrap;\n align-items: center;\n justify-content: space-between;\n gap: 0.5rem;\n overflow: hidden;\n white-space: nowrap;\n}\n.ls-multi-select-value__label {\n min-width: 0;\n flex: 1 1 0%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.ls-multi-select-value__count {\n flex-shrink: 0;\n white-space: nowrap;\n}\n.ls-color-picker__preview {\n position: relative;\n display: inline-block;\n width: 1.5rem;\n height: 1.5rem;\n flex-shrink: 0;\n padding: 0;\n border: 1px solid color-mix(in srgb, #fff 25%, transparent);\n border-radius: var(--radius, 1rem);\n background-size: cover;\n background-position: center;\n background-repeat: no-repeat;\n box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);\n color: transparent;\n line-height: 0;\n}\n.ls-color-picker__preview:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n.ls-color-picker__preview:focus {\n outline: none;\n}\n.ls-color-picker__preview:focus-visible {\n box-shadow:\n 0 0 0 2px var(--primary, #ff4076),\n 0 0 0 4px var(--neutralDark1, #1b1a28),\n 0 0 0 1px rgba(0, 0, 0, 0.25);\n}\n.ls-color-picker__gradient circle,\n.ls-color-picker__gradient polyline {\n stroke: #fff;\n}\n.ls-variable-picker {\n --variable-custom-color: var(--customVariables, #69ffd2);\n --variable-function-color: var( --functionVariables, var(--semanticPurple, #b489ff) );\n --variable-normal-color: var(--normalVariables, var(--semanticBlue, #65b8ff));\n display: flex;\n width: 92vw;\n max-width: 1100px;\n min-height: 50vh;\n max-height: 55vh;\n flex-direction: column;\n overflow: hidden;\n padding: 1rem;\n}\n.ls-variable-picker__field {\n margin: 0 0 0.75rem;\n border: 1px solid color-mix(in srgb, var(--primary, #ff4076) 42%, var(--neutralDark4, #393853));\n border-radius: var(--radius, 1rem);\n padding: 0.5rem;\n}\n.ls-variable-picker__legend {\n padding-inline: 0.375rem;\n color: var(--primary, #ff4076);\n font-size: 0.75rem;\n font-weight: 700;\n}\n.ls-variable-picker__intro {\n margin-bottom: 1rem;\n color: var(--neutralLight2, #cac9d5);\n}\n.ls-variable-picker__header,\n.ls-variable-picker__row {\n display: grid;\n grid-template-columns: minmax(300px, 1.5fr) 1fr 1fr;\n gap: 2rem;\n}\n.ls-variable-picker__header {\n margin-bottom: 0.25rem;\n padding-inline: 0.25rem;\n padding-right: 1.7rem;\n color: var(--neutralLight3, #9392a1);\n}\n.ls-variable-picker__list {\n height: 100%;\n overflow: auto;\n padding-right: 1rem;\n}\n.ls-variable-picker__row {\n cursor: pointer;\n align-items: start;\n border-bottom: 1px solid color-mix(in srgb, var(--neutralDark4, #393853) 70%, transparent);\n padding: 1rem 0.25rem;\n}\n.ls-variable-picker__row--no-border {\n border-bottom: 0;\n}\n.ls-variable-picker__token-cell {\n display: flex;\n min-width: 0;\n align-items: center;\n gap: 0.375rem;\n}\n.ls-variable-picker__expand-toggle,\n.ls-variable-picker__expand-spacer {\n width: 24px;\n height: 24px;\n flex: 0 0 24px;\n}\n.ls-variable-picker__expand-toggle {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n border: 1px solid color-mix(in srgb, var(--neutralDark4, #393853) 75%, transparent);\n border-radius: var(--radius, 1rem);\n padding: 0;\n background: var(--neutralDark3, var(--containerbackground, #1f1f3a));\n color: var(--neutralLight2, #cac9d5);\n transition:\n background-color 140ms ease,\n border-color 140ms ease,\n color 140ms ease,\n transform 140ms ease;\n}\n.ls-variable-picker__expand-toggle:hover {\n border-color: var(--primary, #ff4076);\n background: color-mix(in srgb, var(--primary, #ff4076) 16%, var(--neutralDark3, #1f1f3a));\n color: var(--neutralLight1, #fff);\n}\n.ls-variable-picker__expand-toggle svg {\n transform: rotate(-90deg);\n transition: transform 140ms ease;\n}\n.ls-variable-picker__expand-toggle--expanded svg {\n transform: rotate(0deg);\n}\n.ls-variable-picker__row:active {\n opacity: 0.8;\n}\n.ls-variable-picker__description {\n max-width: 600px;\n overflow-wrap: break-word;\n line-height: 1.25;\n word-break: break-all;\n}\n.ls-variable-picker__value {\n min-width: 0;\n}\n.ls-variable-picker__value-input {\n width: 100%;\n min-width: 0;\n cursor: text;\n overflow: hidden;\n border: 0;\n background: transparent;\n color: var(--neutralLight1, var(--white, #fff));\n caret-color: transparent;\n font: inherit;\n font-size: 1rem;\n line-height: 1.25;\n outline: 0;\n padding: 0;\n text-overflow: ellipsis;\n}\n.ls-variable-picker__value-input:focus {\n outline: 0;\n}\n.ls-variable-picker__value-input::selection {\n background: color-mix(in srgb, var(--primary, #ff4076) 45%, transparent);\n color: var(--alwayswhite, var(--white, #fff));\n}\n.ls-variable-token {\n display: flex;\n min-width: 0;\n align-items: center;\n}\n.ls-variable-token--custom {\n color: var(--customVariables, #69ffd2);\n}\n.ls-variable-token--function {\n color: var(--functionVariables, var(--semanticPurple, #b489ff));\n}\n.ls-variable-token--system {\n color: var(--normalVariables, var(--semanticBlue, #65b8ff));\n}\n.ls-variable-token__name {\n min-width: 0;\n word-break: break-all;\n}\n.ls-variable-token__badge {\n display: inline-flex;\n margin-left: 0.5rem;\n flex-shrink: 0;\n align-items: center;\n border: 1px solid currentcolor;\n border-radius: var(--radius, 1rem);\n padding-inline: 0.25rem;\n padding-block: 0;\n font-size: 10px;\n font-weight: 600;\n line-height: 1;\n text-transform: uppercase;\n}\n");
|
|
25
25
|
|
|
26
26
|
// src/components/LSButton/LSButton.tsx
|
|
27
|
+
import Button from "@mui/material/Button";
|
|
28
|
+
import classNames from "classnames";
|
|
27
29
|
import { jsx } from "react/jsx-runtime";
|
|
28
30
|
var LSButton = ({
|
|
31
|
+
label,
|
|
32
|
+
disabled = false,
|
|
33
|
+
loading = false,
|
|
34
|
+
variant = "contained",
|
|
35
|
+
extended = 0,
|
|
36
|
+
color,
|
|
29
37
|
primary = false,
|
|
30
|
-
size = "medium",
|
|
31
38
|
backgroundColor,
|
|
32
|
-
|
|
39
|
+
className,
|
|
40
|
+
sx,
|
|
41
|
+
style,
|
|
33
42
|
...props
|
|
34
43
|
}) => {
|
|
35
|
-
const
|
|
44
|
+
const resolvedColor = color ?? (primary ? "primary" : "primary");
|
|
45
|
+
const muiColor = resolvedColor === "neutral" ? void 0 : resolvedColor;
|
|
46
|
+
const backgroundSx = backgroundColor ? { backgroundColor, "&:hover": { backgroundColor } } : null;
|
|
47
|
+
const secondaryOutlinedStyles = resolvedColor === "secondary" && variant === "outlined" ? {
|
|
48
|
+
color: "var(--white) !important",
|
|
49
|
+
"& .MuiButton-startIcon, & .MuiButton-endIcon": {
|
|
50
|
+
color: "inherit"
|
|
51
|
+
}
|
|
52
|
+
} : null;
|
|
36
53
|
return /* @__PURE__ */ jsx(
|
|
37
|
-
|
|
54
|
+
Button,
|
|
38
55
|
{
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
56
|
+
disabled: disabled || loading,
|
|
57
|
+
variant,
|
|
58
|
+
color: muiColor,
|
|
59
|
+
style,
|
|
60
|
+
sx: [
|
|
61
|
+
{ borderRadius: "1rem", transition: "opacity 300ms ease-in-out" },
|
|
62
|
+
...backgroundSx ? [backgroundSx] : [],
|
|
63
|
+
...Array.isArray(sx) ? sx : sx ? [sx] : [],
|
|
64
|
+
...secondaryOutlinedStyles ? [secondaryOutlinedStyles] : []
|
|
65
|
+
],
|
|
66
|
+
className: classNames(
|
|
67
|
+
"mui-ls-button cursor-pointer rounded-2xl pb-1.5 pt-1.5 hover:opacity-80 svg-current-color",
|
|
68
|
+
extended ? "pl-12 pr-12 mui-ls-button--extended" : "pl-6 pr-6",
|
|
69
|
+
`mui-ls-button--${resolvedColor}`,
|
|
70
|
+
`mui-ls-button--${variant}`,
|
|
71
|
+
className
|
|
72
|
+
),
|
|
45
73
|
...props,
|
|
46
|
-
children: label
|
|
74
|
+
children: loading ? "Loading..." : label
|
|
47
75
|
}
|
|
48
76
|
);
|
|
49
77
|
};
|
|
@@ -52,7 +80,7 @@ var LSButton = ({
|
|
|
52
80
|
import FormControl from "@mui/material/FormControl";
|
|
53
81
|
import InputAdornment from "@mui/material/InputAdornment";
|
|
54
82
|
import TextField from "@mui/material/TextField";
|
|
55
|
-
import
|
|
83
|
+
import classNames2 from "classnames";
|
|
56
84
|
import { forwardRef } from "react";
|
|
57
85
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
58
86
|
var LSInput = forwardRef(
|
|
@@ -149,7 +177,7 @@ var LSInput = forwardRef(
|
|
|
149
177
|
FormControl,
|
|
150
178
|
{
|
|
151
179
|
variant: "outlined",
|
|
152
|
-
className:
|
|
180
|
+
className: classNames2("mui-ls-input", className, {
|
|
153
181
|
noMinHeight: $noMinHeight,
|
|
154
182
|
bypassMuiColor: bypasscolor || bypasscolor === "default"
|
|
155
183
|
}),
|
|
@@ -182,7 +210,7 @@ LSInput.displayName = "LSInput";
|
|
|
182
210
|
|
|
183
211
|
// src/components/LSSliderInput/LSSliderInput.tsx
|
|
184
212
|
import Slider from "@mui/material/Slider";
|
|
185
|
-
import
|
|
213
|
+
import classNames3 from "classnames";
|
|
186
214
|
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
187
215
|
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
188
216
|
var normalizeSliderValue = (rawValue) => {
|
|
@@ -301,7 +329,7 @@ var LSSliderInput = ({
|
|
|
301
329
|
const controlsRow = /* @__PURE__ */ jsxs(
|
|
302
330
|
"div",
|
|
303
331
|
{
|
|
304
|
-
className:
|
|
332
|
+
className: classNames3("mui-ls-slider-input-row", {
|
|
305
333
|
"mui-ls-slider-input-row--slider": !hideSlider,
|
|
306
334
|
"mui-ls-slider-input-row--input": hideInput
|
|
307
335
|
}),
|
|
@@ -342,28 +370,20 @@ var LSSliderInput = ({
|
|
|
342
370
|
inputMode: stepPrecision > 0 ? "decimal" : "numeric"
|
|
343
371
|
},
|
|
344
372
|
fullWidth: hideSlider ? fullWidth : false,
|
|
345
|
-
$noMinHeight:
|
|
346
|
-
className: hideSlider ? inputProps?.className : `${inputProps?.className ?? ""}
|
|
347
|
-
style: hideSlider ? inputProps?.style : { width:
|
|
373
|
+
$noMinHeight: false,
|
|
374
|
+
className: hideSlider ? inputProps?.className : `${inputProps?.className ?? ""} mui-ls-slider-input-value`.trim(),
|
|
375
|
+
style: hideSlider ? inputProps?.style : { width: 112, maxWidth: 112, flexShrink: 0 },
|
|
348
376
|
...!hideSlider ? { size: "small" } : {}
|
|
349
377
|
}
|
|
350
378
|
)
|
|
351
379
|
]
|
|
352
380
|
}
|
|
353
381
|
);
|
|
354
|
-
return /* @__PURE__ */ jsxs("div", { className:
|
|
355
|
-
/* @__PURE__ */ jsxs(
|
|
356
|
-
"
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
"mui-ls-slider-input-fieldset--fullWidth": fullWidth
|
|
360
|
-
}),
|
|
361
|
-
children: [
|
|
362
|
-
label && /* @__PURE__ */ jsx3("legend", { className: "mui-ls-slider-input-legend", children: label }),
|
|
363
|
-
controlsRow
|
|
364
|
-
]
|
|
365
|
-
}
|
|
366
|
-
),
|
|
382
|
+
return /* @__PURE__ */ jsxs("div", { className: "mui-ls-slider-input-root", children: [
|
|
383
|
+
/* @__PURE__ */ jsxs("fieldset", { className: "mui-ls-slider-input-fieldset", children: [
|
|
384
|
+
label && /* @__PURE__ */ jsx3("legend", { className: "mui-ls-slider-input-legend", children: label }),
|
|
385
|
+
controlsRow
|
|
386
|
+
] }),
|
|
367
387
|
helperText && /* @__PURE__ */ jsx3("small", { className: "mui-ls-slider-input-helper", children: helperText })
|
|
368
388
|
] });
|
|
369
389
|
};
|
|
@@ -374,8 +394,19 @@ import FormControl2 from "@mui/material/FormControl";
|
|
|
374
394
|
import InputLabel from "@mui/material/InputLabel";
|
|
375
395
|
import Select from "@mui/material/Select";
|
|
376
396
|
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
377
|
-
var LSSelect = ({
|
|
378
|
-
|
|
397
|
+
var LSSelect = ({
|
|
398
|
+
className = "",
|
|
399
|
+
style,
|
|
400
|
+
...props
|
|
401
|
+
}) => {
|
|
402
|
+
const {
|
|
403
|
+
placeholder,
|
|
404
|
+
displayEmpty: displayEmptyProp,
|
|
405
|
+
renderValue: renderValueProp,
|
|
406
|
+
variant: _variant,
|
|
407
|
+
MenuProps,
|
|
408
|
+
...rest
|
|
409
|
+
} = props;
|
|
379
410
|
const labelKey = props.name ?? (typeof props.label === "string" ? props.label : void 0);
|
|
380
411
|
const labelId = props.label && labelKey ? `label_${labelKey}` : void 0;
|
|
381
412
|
const placeholderText = typeof placeholder === "string" ? placeholder : "";
|
|
@@ -398,6 +429,7 @@ var LSSelect = ({ className = "", style, ...props }) => {
|
|
|
398
429
|
backgroundColor: "var(--neutralDark2)",
|
|
399
430
|
color: "var(--neutralLight1)",
|
|
400
431
|
border: "1px solid var(--neutralDark4)",
|
|
432
|
+
borderRadius: "var(--radius, 1rem)",
|
|
401
433
|
boxShadow: "0 16px 32px rgba(0, 0, 0, 0.32)",
|
|
402
434
|
...MenuProps?.slotProps?.paper?.sx
|
|
403
435
|
}
|
|
@@ -418,6 +450,7 @@ var LSSelect = ({ className = "", style, ...props }) => {
|
|
|
418
450
|
backgroundColor: "var(--neutralDark2)",
|
|
419
451
|
color: "var(--neutralLight1)",
|
|
420
452
|
border: "1px solid var(--neutralDark4)",
|
|
453
|
+
borderRadius: "var(--radius, 1rem)",
|
|
421
454
|
boxShadow: "0 16px 32px rgba(0, 0, 0, 0.32)",
|
|
422
455
|
"& .MuiList-root": {
|
|
423
456
|
backgroundColor: "var(--neutralDark2)"
|
|
@@ -433,24 +466,39 @@ var LSSelect = ({ className = "", style, ...props }) => {
|
|
|
433
466
|
}
|
|
434
467
|
}
|
|
435
468
|
};
|
|
436
|
-
return /* @__PURE__ */ jsxs2(
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
{
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
children: props.
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
469
|
+
return /* @__PURE__ */ jsxs2(
|
|
470
|
+
FormControl2,
|
|
471
|
+
{
|
|
472
|
+
variant: "outlined",
|
|
473
|
+
className: `${className} mui-ls-select-form-control`,
|
|
474
|
+
sx: {
|
|
475
|
+
marginBottom: ".3rem",
|
|
476
|
+
marginTop: ".5rem",
|
|
477
|
+
minWidth: "100px",
|
|
478
|
+
width: "100%"
|
|
479
|
+
},
|
|
480
|
+
size: rest.size,
|
|
481
|
+
style,
|
|
482
|
+
children: [
|
|
483
|
+
props.label && /* @__PURE__ */ jsx4(InputLabel, { shrink: true, id: labelId, children: props.label }),
|
|
484
|
+
/* @__PURE__ */ jsx4(
|
|
485
|
+
Select,
|
|
486
|
+
{
|
|
487
|
+
MenuProps: mergedMenuProps,
|
|
488
|
+
className: "mui-ls-select",
|
|
489
|
+
variant: "outlined",
|
|
490
|
+
labelId,
|
|
491
|
+
label: props.label,
|
|
492
|
+
displayEmpty,
|
|
493
|
+
renderValue,
|
|
494
|
+
...rest,
|
|
495
|
+
value,
|
|
496
|
+
children: props.children
|
|
497
|
+
}
|
|
498
|
+
)
|
|
499
|
+
]
|
|
500
|
+
}
|
|
501
|
+
);
|
|
454
502
|
};
|
|
455
503
|
LSSelect.displayName = "LSSelect";
|
|
456
504
|
|
|
@@ -459,7 +507,7 @@ import Checkbox from "@mui/material/Checkbox";
|
|
|
459
507
|
import FormControlLabel from "@mui/material/FormControlLabel";
|
|
460
508
|
import { forwardRef as forwardRef2 } from "react";
|
|
461
509
|
import { useController, useFormContext } from "react-hook-form";
|
|
462
|
-
import
|
|
510
|
+
import classNames4 from "classnames";
|
|
463
511
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
464
512
|
var LSCheckbox = forwardRef2(({ className = "", checked, inputRef, slotProps, ...props }, ref) => {
|
|
465
513
|
const CheckboxComponent = Checkbox;
|
|
@@ -468,7 +516,7 @@ var LSCheckbox = forwardRef2(({ className = "", checked, inputRef, slotProps, ..
|
|
|
468
516
|
{
|
|
469
517
|
...props,
|
|
470
518
|
checked,
|
|
471
|
-
className:
|
|
519
|
+
className: classNames4("ls-checkbox", className, { "Mui-disabled": props.disabled }),
|
|
472
520
|
ref,
|
|
473
521
|
slotProps: {
|
|
474
522
|
...slotProps ?? {},
|
|
@@ -496,7 +544,7 @@ function LSCheckboxField({
|
|
|
496
544
|
return /* @__PURE__ */ jsx5(
|
|
497
545
|
FormControlLabel,
|
|
498
546
|
{
|
|
499
|
-
className:
|
|
547
|
+
className: classNames4("ls-checkbox-row", className),
|
|
500
548
|
labelPlacement,
|
|
501
549
|
disabled,
|
|
502
550
|
control: /* @__PURE__ */ jsx5(
|
|
@@ -534,7 +582,7 @@ var LSColorPicker = ({ value = DEFAULT_COLOR, onChange, onBlur, className, name,
|
|
|
534
582
|
right: 0,
|
|
535
583
|
top: "calc(100% + 0.5rem)",
|
|
536
584
|
zIndex: 1e3,
|
|
537
|
-
borderRadius: "
|
|
585
|
+
borderRadius: "1rem",
|
|
538
586
|
background: "var(--neutralDark1)",
|
|
539
587
|
padding: "0.5rem",
|
|
540
588
|
boxShadow: "0 8px 24px rgba(0, 0, 0, 0.4)"
|
|
@@ -545,7 +593,7 @@ var LSColorPicker = ({ value = DEFAULT_COLOR, onChange, onBlur, className, name,
|
|
|
545
593
|
height: inlinePickerHeight,
|
|
546
594
|
minHeight: inlinePickerHeight,
|
|
547
595
|
marginTop: "0.5rem",
|
|
548
|
-
borderRadius: "
|
|
596
|
+
borderRadius: "1rem",
|
|
549
597
|
background: "var(--neutralDark1)",
|
|
550
598
|
padding: "0.5rem",
|
|
551
599
|
boxSizing: "border-box",
|
|
@@ -675,15 +723,36 @@ var LSColorPicker = ({ value = DEFAULT_COLOR, onChange, onBlur, className, name,
|
|
|
675
723
|
import { KeyboardArrowDown } from "@mui/icons-material";
|
|
676
724
|
import Autocomplete from "@mui/material/Autocomplete";
|
|
677
725
|
import TextField2 from "@mui/material/TextField";
|
|
678
|
-
import {
|
|
726
|
+
import {
|
|
727
|
+
memo,
|
|
728
|
+
startTransition,
|
|
729
|
+
useEffect as useEffect3,
|
|
730
|
+
useMemo as useMemo2,
|
|
731
|
+
useRef as useRef2,
|
|
732
|
+
useState as useState3
|
|
733
|
+
} from "react";
|
|
679
734
|
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
680
|
-
var LSFontPicker = memo(function LSFontPicker2({
|
|
735
|
+
var LSFontPicker = memo(function LSFontPicker2({
|
|
736
|
+
value,
|
|
737
|
+
onChange,
|
|
738
|
+
fonts = [],
|
|
739
|
+
localFonts = [],
|
|
740
|
+
onLoadFonts,
|
|
741
|
+
defaultValue = "Roboto",
|
|
742
|
+
placeholder = "Select a font",
|
|
743
|
+
isAlertManager = false,
|
|
744
|
+
label,
|
|
745
|
+
helperText
|
|
746
|
+
}) {
|
|
681
747
|
const AutocompleteComponent = Autocomplete;
|
|
682
748
|
const TextFieldComponent = TextField2;
|
|
683
749
|
const [inputValue, setInputValue] = useState3(value ?? defaultValue);
|
|
684
750
|
const onLoadFontsRef = useRef2(onLoadFonts);
|
|
685
751
|
const onChangeRef = useRef2(onChange);
|
|
686
|
-
const combinedFonts = useMemo2(
|
|
752
|
+
const combinedFonts = useMemo2(
|
|
753
|
+
() => Array.from(/* @__PURE__ */ new Set([...localFonts, ...fonts])).sort(),
|
|
754
|
+
[fonts, localFonts]
|
|
755
|
+
);
|
|
687
756
|
const currentValue = value ?? defaultValue;
|
|
688
757
|
useEffect3(() => {
|
|
689
758
|
onLoadFontsRef.current = onLoadFonts;
|
|
@@ -719,7 +788,9 @@ var LSFontPicker = memo(function LSFontPicker2({ value, onChange, fonts = [], lo
|
|
|
719
788
|
popupIcon: /* @__PURE__ */ jsx7(KeyboardArrowDown, {}),
|
|
720
789
|
isOptionEqualToValue: (option, selectedValue) => option === selectedValue,
|
|
721
790
|
onChange: (_event, newValue) => {
|
|
722
|
-
handleValueChange(
|
|
791
|
+
handleValueChange(
|
|
792
|
+
typeof newValue === "string" ? newValue : `${newValue ?? ""}`
|
|
793
|
+
);
|
|
723
794
|
},
|
|
724
795
|
onInputChange: (_event, newInputValue, reason) => {
|
|
725
796
|
if (reason === "input" || reason === "clear") {
|
|
@@ -734,7 +805,7 @@ var LSFontPicker = memo(function LSFontPicker2({ value, onChange, fonts = [], lo
|
|
|
734
805
|
sx: {
|
|
735
806
|
background: "var(--neutralDark3)",
|
|
736
807
|
border: "1px solid var(--neutralDark4)",
|
|
737
|
-
borderRadius: "var(--
|
|
808
|
+
borderRadius: "var(--radius, 1rem)",
|
|
738
809
|
boxShadow: "0 4px 12px rgba(0, 0, 0, 0.3)",
|
|
739
810
|
color: "var(--neutralLight1)",
|
|
740
811
|
marginTop: "4px"
|
|
@@ -783,7 +854,7 @@ var LSFontPicker = memo(function LSFontPicker2({ value, onChange, fonts = [], lo
|
|
|
783
854
|
helperText,
|
|
784
855
|
placeholder,
|
|
785
856
|
fullWidth: true,
|
|
786
|
-
className: "mui-ls-input
|
|
857
|
+
className: "mui-ls-input",
|
|
787
858
|
variant: "outlined",
|
|
788
859
|
sx: {
|
|
789
860
|
"& .MuiOutlinedInput-root": {
|
|
@@ -803,7 +874,13 @@ var LSFontPicker = memo(function LSFontPicker2({ value, onChange, fonts = [], lo
|
|
|
803
874
|
// src/components/LSMultiSelect/LSMultiSelect.tsx
|
|
804
875
|
import { MenuItem } from "@mui/material";
|
|
805
876
|
import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
806
|
-
var LSMultiSelect = ({
|
|
877
|
+
var LSMultiSelect = ({
|
|
878
|
+
options,
|
|
879
|
+
placeholder = "Select...",
|
|
880
|
+
value,
|
|
881
|
+
onChange,
|
|
882
|
+
label
|
|
883
|
+
}) => {
|
|
807
884
|
const handleChange = (event) => {
|
|
808
885
|
const {
|
|
809
886
|
target: { value: value2 }
|
|
@@ -821,7 +898,9 @@ var LSMultiSelect = ({ options, placeholder = "Select...", value, onChange, labe
|
|
|
821
898
|
onChange: handleChange,
|
|
822
899
|
displayEmpty: true,
|
|
823
900
|
renderValue: (selected) => /* @__PURE__ */ jsxs4("div", { className: "ls-multi-select-value", children: [
|
|
824
|
-
/* @__PURE__ */ jsx8("div", { className: "ls-multi-select-value__label", children: selected.length > 0 ? selected.map(
|
|
901
|
+
/* @__PURE__ */ jsx8("div", { className: "ls-multi-select-value__label", children: selected.length > 0 ? selected.map(
|
|
902
|
+
(val) => options.find((opt) => opt.value === val)?.label ?? val
|
|
903
|
+
).join(", ") : placeholder }),
|
|
825
904
|
/* @__PURE__ */ jsx8("div", { className: "ls-multi-select-value__count", children: `(${selected.length})` })
|
|
826
905
|
] }),
|
|
827
906
|
MenuProps: {
|
|
@@ -832,6 +911,7 @@ var LSMultiSelect = ({ options, placeholder = "Select...", value, onChange, labe
|
|
|
832
911
|
backgroundColor: "var(--neutralDark2)",
|
|
833
912
|
color: "var(--neutralLight1)",
|
|
834
913
|
border: "1px solid var(--neutralDark4)",
|
|
914
|
+
borderRadius: "var(--radius, 1rem)",
|
|
835
915
|
boxShadow: "0 16px 32px rgba(0, 0, 0, 0.32)",
|
|
836
916
|
backdropFilter: "none",
|
|
837
917
|
opacity: 1,
|
|
@@ -854,6 +934,7 @@ var LSMultiSelect = ({ options, placeholder = "Select...", value, onChange, labe
|
|
|
854
934
|
opacity: 1,
|
|
855
935
|
maxHeight: "280px !important",
|
|
856
936
|
border: "1px solid var(--neutralDark4)",
|
|
937
|
+
borderRadius: "var(--radius, 1rem)",
|
|
857
938
|
"& .MuiList-root": {
|
|
858
939
|
backgroundColor: "var(--neutralDark2)"
|
|
859
940
|
}
|
|
@@ -877,7 +958,14 @@ var LSMultiSelect = ({ options, placeholder = "Select...", value, onChange, labe
|
|
|
877
958
|
}
|
|
878
959
|
},
|
|
879
960
|
children: [
|
|
880
|
-
/* @__PURE__ */ jsx8(
|
|
961
|
+
/* @__PURE__ */ jsx8(
|
|
962
|
+
LSCheckbox,
|
|
963
|
+
{
|
|
964
|
+
checked: (value ?? []).includes(option.value),
|
|
965
|
+
tabIndex: -1,
|
|
966
|
+
disableRipple: true
|
|
967
|
+
}
|
|
968
|
+
),
|
|
881
969
|
/* @__PURE__ */ jsx8("span", { children: option.label })
|
|
882
970
|
]
|
|
883
971
|
},
|
|
@@ -891,16 +979,16 @@ var LSMultiSelect = ({ options, placeholder = "Select...", value, onChange, labe
|
|
|
891
979
|
import FormControlLabel2 from "@mui/material/FormControlLabel";
|
|
892
980
|
import Radio from "@mui/material/Radio";
|
|
893
981
|
import RadioGroup from "@mui/material/RadioGroup";
|
|
894
|
-
import
|
|
982
|
+
import classNames5 from "classnames";
|
|
895
983
|
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
896
984
|
var LSRadio = ({ className = "", ...props }) => {
|
|
897
|
-
return /* @__PURE__ */ jsx9(Radio, { ...props, className:
|
|
985
|
+
return /* @__PURE__ */ jsx9(Radio, { ...props, className: classNames5("ls-radio", className) });
|
|
898
986
|
};
|
|
899
987
|
var LSRadioGroup = ({ selections, className = "", optionClassName = "", row, ...props }) => {
|
|
900
|
-
return /* @__PURE__ */ jsx9(RadioGroup, { ...props, row, className:
|
|
988
|
+
return /* @__PURE__ */ jsx9(RadioGroup, { ...props, row, className: classNames5("ls-radio-group", className, { row }), children: selections.map((selection) => /* @__PURE__ */ jsx9(
|
|
901
989
|
FormControlLabel2,
|
|
902
990
|
{
|
|
903
|
-
className:
|
|
991
|
+
className: classNames5("ls-radio-row", optionClassName),
|
|
904
992
|
value: selection.value,
|
|
905
993
|
disabled: selection.disabled,
|
|
906
994
|
control: /* @__PURE__ */ jsx9(LSRadio, {}),
|
|
@@ -915,47 +1003,65 @@ LSRadioGroup.displayName = "LSRadioGroup";
|
|
|
915
1003
|
import TextField3 from "@mui/material/TextField";
|
|
916
1004
|
import { forwardRef as forwardRef3 } from "react";
|
|
917
1005
|
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
918
|
-
var LSTextField = forwardRef3(
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
...slotProps
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
...
|
|
932
|
-
|
|
1006
|
+
var LSTextField = forwardRef3(
|
|
1007
|
+
(props, ref) => {
|
|
1008
|
+
const { InputLabelProps, InputProps, slotProps, ...rest } = props;
|
|
1009
|
+
return /* @__PURE__ */ jsx10(
|
|
1010
|
+
TextField3,
|
|
1011
|
+
{
|
|
1012
|
+
...rest,
|
|
1013
|
+
variant: "outlined",
|
|
1014
|
+
className: "mui-ls-input",
|
|
1015
|
+
slotProps: {
|
|
1016
|
+
...slotProps ?? {},
|
|
1017
|
+
input: {
|
|
1018
|
+
...slotProps?.input ?? {},
|
|
1019
|
+
...InputProps ?? {},
|
|
1020
|
+
sx: {
|
|
1021
|
+
...slotProps?.input?.sx ?? {},
|
|
1022
|
+
...InputProps?.sx ?? {}
|
|
1023
|
+
}
|
|
1024
|
+
},
|
|
1025
|
+
inputLabel: {
|
|
1026
|
+
...slotProps?.inputLabel ?? {},
|
|
1027
|
+
shrink: true,
|
|
1028
|
+
...InputLabelProps ?? {}
|
|
933
1029
|
}
|
|
934
1030
|
},
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
},
|
|
941
|
-
ref
|
|
942
|
-
}
|
|
943
|
-
);
|
|
944
|
-
});
|
|
1031
|
+
ref
|
|
1032
|
+
}
|
|
1033
|
+
);
|
|
1034
|
+
}
|
|
1035
|
+
);
|
|
945
1036
|
LSTextField.displayName = "LSTextField";
|
|
946
1037
|
|
|
947
1038
|
// src/components/LSVariableInputField/LSVariableInputField.tsx
|
|
948
|
-
import Autocomplete2, {
|
|
1039
|
+
import Autocomplete2, {
|
|
1040
|
+
createFilterOptions
|
|
1041
|
+
} from "@mui/material/Autocomplete";
|
|
949
1042
|
import InputAdornment2 from "@mui/material/InputAdornment";
|
|
950
1043
|
import Popover from "@mui/material/Popover";
|
|
951
1044
|
import Search from "@mui/icons-material/Search";
|
|
952
|
-
import
|
|
1045
|
+
import KeyboardArrowDown2 from "@mui/icons-material/KeyboardArrowDown";
|
|
953
1046
|
import Tooltip from "@mui/material/Tooltip";
|
|
954
|
-
import {
|
|
1047
|
+
import {
|
|
1048
|
+
Fragment,
|
|
1049
|
+
createContext,
|
|
1050
|
+
forwardRef as forwardRef4,
|
|
1051
|
+
useCallback as useCallback2,
|
|
1052
|
+
useContext,
|
|
1053
|
+
useEffect as useEffect4,
|
|
1054
|
+
useMemo as useMemo3,
|
|
1055
|
+
useRef as useRef3,
|
|
1056
|
+
useState as useState4
|
|
1057
|
+
} from "react";
|
|
955
1058
|
import { Fragment as Fragment2, jsx as jsx11, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
956
1059
|
import { createElement } from "react";
|
|
957
1060
|
var LSVariableInputContext = createContext({});
|
|
958
|
-
var LSVariableInputProvider = ({
|
|
1061
|
+
var LSVariableInputProvider = ({
|
|
1062
|
+
children,
|
|
1063
|
+
value
|
|
1064
|
+
}) => {
|
|
959
1065
|
return /* @__PURE__ */ jsx11(LSVariableInputContext.Provider, { value, children });
|
|
960
1066
|
};
|
|
961
1067
|
var DEFAULT_FUNCTION_VARIABLES = [
|
|
@@ -1007,7 +1113,9 @@ var renderPrimitiveValue = (value) => {
|
|
|
1007
1113
|
};
|
|
1008
1114
|
var renderComplexPreview = (value) => {
|
|
1009
1115
|
if (Array.isArray(value)) {
|
|
1010
|
-
return `Array(${value.length}) [${value.slice(0, 3).map(
|
|
1116
|
+
return `Array(${value.length}) [${value.slice(0, 3).map(
|
|
1117
|
+
(item) => typeof item === "string" ? `"${item}"` : typeof item === "object" ? "{...}" : String(item)
|
|
1118
|
+
).join(", ")}${value.length > 3 ? "..." : ""}]`;
|
|
1011
1119
|
}
|
|
1012
1120
|
const keys = Object.keys(value);
|
|
1013
1121
|
return `Object {${keys.slice(0, 2).join(", ")}${keys.length > 2 ? "..." : ""}}`;
|
|
@@ -1076,9 +1184,12 @@ var normalizeVariableRecords = (systemVariables) => {
|
|
|
1076
1184
|
};
|
|
1077
1185
|
var defaultTranslate = (key, fallback, options) => {
|
|
1078
1186
|
if (fallback && fallback !== "-") return fallback;
|
|
1079
|
-
if (key === "overlay-variables.variables-description")
|
|
1080
|
-
|
|
1081
|
-
if (key === "overlay-variables.
|
|
1187
|
+
if (key === "overlay-variables.variables-description")
|
|
1188
|
+
return "Use variables that will automatically be replaced before sending out the text";
|
|
1189
|
+
if (key === "overlay-variables.variable" || key === "commands.variable")
|
|
1190
|
+
return "Variable";
|
|
1191
|
+
if (key === "overlay-variables.description" || key === "commands.description")
|
|
1192
|
+
return "Description";
|
|
1082
1193
|
if (key === "commands.suggested-variables") return "Suggested Variables";
|
|
1083
1194
|
if (key === "common.value") return "Value";
|
|
1084
1195
|
if (key === "common.search" || key === "assets.search") return "Search";
|
|
@@ -1104,7 +1215,11 @@ var normalizeAllowedDefinitions = (allowedVariables) => {
|
|
|
1104
1215
|
variableName = variable.trim();
|
|
1105
1216
|
} else if (variable && typeof variable === "object") {
|
|
1106
1217
|
const typedVariable = variable;
|
|
1107
|
-
const candidateName = [
|
|
1218
|
+
const candidateName = [
|
|
1219
|
+
typedVariable.name,
|
|
1220
|
+
typedVariable.key,
|
|
1221
|
+
typedVariable.variable
|
|
1222
|
+
].find((value) => typeof value === "string");
|
|
1108
1223
|
variableName = typeof candidateName === "string" ? candidateName.trim() : "";
|
|
1109
1224
|
description = typeof typedVariable.description === "string" ? typedVariable.description.trim() : void 0;
|
|
1110
1225
|
origin = typeof typedVariable.origin === "string" ? typedVariable.origin.trim().toLowerCase() : void 0;
|
|
@@ -1119,10 +1234,13 @@ var normalizeAllowedDefinitions = (allowedVariables) => {
|
|
|
1119
1234
|
var filter = createFilterOptions({
|
|
1120
1235
|
stringify: (option) => {
|
|
1121
1236
|
if (typeof option === "string") return option;
|
|
1122
|
-
if (typeof option === "number" || typeof option === "boolean" || typeof option === "bigint")
|
|
1237
|
+
if (typeof option === "number" || typeof option === "boolean" || typeof option === "bigint")
|
|
1238
|
+
return String(option);
|
|
1123
1239
|
if (!option || typeof option !== "object") return "";
|
|
1124
1240
|
const typed = option;
|
|
1125
|
-
return [typed.label, typed.value, typed.helperText, typed.searchText].filter(
|
|
1241
|
+
return [typed.label, typed.value, typed.helperText, typed.searchText].filter(
|
|
1242
|
+
(value) => typeof value === "string" || typeof value === "number" || typeof value === "boolean"
|
|
1243
|
+
).map((value) => String(value)).join(" ");
|
|
1126
1244
|
}
|
|
1127
1245
|
});
|
|
1128
1246
|
var visualTypeFromRecord = (variable) => {
|
|
@@ -1136,7 +1254,11 @@ var visualTypeRank = (variableType) => {
|
|
|
1136
1254
|
return 2;
|
|
1137
1255
|
};
|
|
1138
1256
|
var orderItemsByVariableType = (items, getType) => {
|
|
1139
|
-
const grouped = {
|
|
1257
|
+
const grouped = {
|
|
1258
|
+
custom: [],
|
|
1259
|
+
func: [],
|
|
1260
|
+
system: []
|
|
1261
|
+
};
|
|
1140
1262
|
items.forEach((item) => grouped[getType(item)].push(item));
|
|
1141
1263
|
return [...grouped.custom, ...grouped.func, ...grouped.system];
|
|
1142
1264
|
};
|
|
@@ -1152,7 +1274,8 @@ var humanizeVariableName = (rawName) => {
|
|
|
1152
1274
|
return rawName.replace(/^_+|_+$/g, "").replace(/_/g, " ").replace(/\s+/g, " ").trim().replace(/\b\w/g, (char) => char.toUpperCase());
|
|
1153
1275
|
};
|
|
1154
1276
|
var getVariableColorClass = (variableType, isSuggested) => {
|
|
1155
|
-
if (isSuggested && variableType !== "func")
|
|
1277
|
+
if (isSuggested && variableType !== "func")
|
|
1278
|
+
return "ls-variable-token--custom";
|
|
1156
1279
|
if (variableType === "func") return "ls-variable-token--function";
|
|
1157
1280
|
if (variableType === "system") return "ls-variable-token--system";
|
|
1158
1281
|
return "ls-variable-token--custom";
|
|
@@ -1205,8 +1328,14 @@ var LSVariableInputField = forwardRef4((props, ref) => {
|
|
|
1205
1328
|
} = props;
|
|
1206
1329
|
const t = translate ?? context.translate ?? defaultTranslate;
|
|
1207
1330
|
const rawSystemVariables = systemVariablesProp ?? context.systemVariables ?? {};
|
|
1208
|
-
const variableRecords = useMemo3(
|
|
1209
|
-
|
|
1331
|
+
const variableRecords = useMemo3(
|
|
1332
|
+
() => normalizeVariableRecords(rawSystemVariables),
|
|
1333
|
+
[rawSystemVariables]
|
|
1334
|
+
);
|
|
1335
|
+
const functionVariables = useMemo3(
|
|
1336
|
+
() => functionVariablesProp ?? context.functionVariables ?? DEFAULT_FUNCTION_VARIABLES,
|
|
1337
|
+
[context.functionVariables, functionVariablesProp]
|
|
1338
|
+
);
|
|
1210
1339
|
const requestTranslations = onVariableTranslationsNeeded ?? context.onVariableTranslationsNeeded;
|
|
1211
1340
|
const isOriginConnected = isOriginConnectedProp ?? context.isOriginConnected;
|
|
1212
1341
|
const translationKeyExists = translationKeyExistsProp ?? context.translationKeyExists;
|
|
@@ -1214,18 +1343,33 @@ var LSVariableInputField = forwardRef4((props, ref) => {
|
|
|
1214
1343
|
const variableId = useRef3(`variable-input-${name ?? "field"}`);
|
|
1215
1344
|
const [showVariables, setShowVariables] = useState4(false);
|
|
1216
1345
|
const [searchQuery, setSearchQuery] = useState4("");
|
|
1217
|
-
const functionVariableSet = useMemo3(
|
|
1218
|
-
|
|
1346
|
+
const functionVariableSet = useMemo3(
|
|
1347
|
+
() => new Set(functionVariables),
|
|
1348
|
+
[functionVariables]
|
|
1349
|
+
);
|
|
1350
|
+
const allowedVariableDefinitions = useMemo3(
|
|
1351
|
+
() => normalizeAllowedDefinitions(allowedVariables),
|
|
1352
|
+
[allowedVariables]
|
|
1353
|
+
);
|
|
1219
1354
|
const allowedVariableDefinitionLookup = useMemo3(() => {
|
|
1220
1355
|
const lookup = /* @__PURE__ */ new Map();
|
|
1221
|
-
allowedVariableDefinitions.forEach(
|
|
1356
|
+
allowedVariableDefinitions.forEach(
|
|
1357
|
+
(definition) => lookup.set(definition.name, definition)
|
|
1358
|
+
);
|
|
1222
1359
|
return lookup;
|
|
1223
1360
|
}, [allowedVariableDefinitions]);
|
|
1224
|
-
const allowedVariableNames = useMemo3(
|
|
1361
|
+
const allowedVariableNames = useMemo3(
|
|
1362
|
+
() => allowedVariableDefinitions.map((definition) => definition.name),
|
|
1363
|
+
[allowedVariableDefinitions]
|
|
1364
|
+
);
|
|
1225
1365
|
const [filteredAllowedVariables, setFilteredAllowedVariables] = useState4(allowedVariableDefinitions);
|
|
1226
1366
|
const [filteredSystemVariables, setFilteredSystemVariables] = useState4([]);
|
|
1227
|
-
const [expandedPaths, setExpandedPaths] = useState4(
|
|
1228
|
-
|
|
1367
|
+
const [expandedPaths, setExpandedPaths] = useState4(
|
|
1368
|
+
() => /* @__PURE__ */ new Set()
|
|
1369
|
+
);
|
|
1370
|
+
const [autoExpandPaths, setAutoExpandPaths] = useState4(
|
|
1371
|
+
() => /* @__PURE__ */ new Set()
|
|
1372
|
+
);
|
|
1229
1373
|
const systemVariableValueTrees = useMemo3(() => {
|
|
1230
1374
|
const map = /* @__PURE__ */ new Map();
|
|
1231
1375
|
Object.values(variableRecords).forEach((variable) => {
|
|
@@ -1247,7 +1391,10 @@ var LSVariableInputField = forwardRef4((props, ref) => {
|
|
|
1247
1391
|
useEffect4(() => {
|
|
1248
1392
|
requestTranslations?.();
|
|
1249
1393
|
}, [requestTranslations]);
|
|
1250
|
-
const isPathExpanded = useCallback2(
|
|
1394
|
+
const isPathExpanded = useCallback2(
|
|
1395
|
+
(path) => expandedPaths.has(path) || autoExpandPaths.has(path),
|
|
1396
|
+
[autoExpandPaths, expandedPaths]
|
|
1397
|
+
);
|
|
1251
1398
|
const toggleExpand = useCallback2(
|
|
1252
1399
|
(path) => {
|
|
1253
1400
|
const expanded = expandedPaths.has(path) || autoExpandPaths.has(path);
|
|
@@ -1293,12 +1440,16 @@ var LSVariableInputField = forwardRef4((props, ref) => {
|
|
|
1293
1440
|
if (!normalizedNamespace) return null;
|
|
1294
1441
|
const normalizedName = variableName.trim().toLowerCase();
|
|
1295
1442
|
if (!normalizedName) return null;
|
|
1296
|
-
const unprefixedName = normalizedName.startsWith(
|
|
1443
|
+
const unprefixedName = normalizedName.startsWith(
|
|
1444
|
+
`${normalizedNamespace}_`
|
|
1445
|
+
) ? normalizedName.slice(normalizedNamespace.length + 1) : normalizedName;
|
|
1297
1446
|
const prefixedName = normalizedName.startsWith(`${normalizedNamespace}_`) ? normalizedName : `${normalizedNamespace}_${normalizedName}`;
|
|
1298
1447
|
const candidateKeys = [prefixedName, unprefixedName];
|
|
1299
1448
|
for (const key of candidateKeys) {
|
|
1300
|
-
if (namespaceHas(key, normalizedNamespace))
|
|
1301
|
-
|
|
1449
|
+
if (namespaceHas(key, normalizedNamespace))
|
|
1450
|
+
return t(key, void 0, { ns: normalizedNamespace });
|
|
1451
|
+
if (namespaceHas(`variables.${key}`, normalizedNamespace))
|
|
1452
|
+
return t(`variables.${key}`, void 0, { ns: normalizedNamespace });
|
|
1302
1453
|
}
|
|
1303
1454
|
return null;
|
|
1304
1455
|
},
|
|
@@ -1307,7 +1458,9 @@ var LSVariableInputField = forwardRef4((props, ref) => {
|
|
|
1307
1458
|
const knownOrigins = useMemo3(() => {
|
|
1308
1459
|
return Array.from(
|
|
1309
1460
|
new Set(
|
|
1310
|
-
Object.values(variableRecords).map(
|
|
1461
|
+
Object.values(variableRecords).map(
|
|
1462
|
+
(variable) => typeof variable?.origin === "string" ? variable.origin.trim().toLowerCase() : ""
|
|
1463
|
+
).filter((origin) => origin.length > 0)
|
|
1311
1464
|
)
|
|
1312
1465
|
);
|
|
1313
1466
|
}, [variableRecords]);
|
|
@@ -1321,10 +1474,18 @@ var LSVariableInputField = forwardRef4((props, ref) => {
|
|
|
1321
1474
|
if (!normalizedName) return void 0;
|
|
1322
1475
|
const prefixCandidate = normalizedName.split("_")[0];
|
|
1323
1476
|
if (prefixCandidate) {
|
|
1324
|
-
const hasScopedTranslation = namespaceHas(normalizedName, prefixCandidate) || namespaceHas(`variables.${normalizedName}`, prefixCandidate) || namespaceHas(
|
|
1477
|
+
const hasScopedTranslation = namespaceHas(normalizedName, prefixCandidate) || namespaceHas(`variables.${normalizedName}`, prefixCandidate) || namespaceHas(
|
|
1478
|
+
normalizedName.slice(prefixCandidate.length + 1),
|
|
1479
|
+
prefixCandidate
|
|
1480
|
+
) || namespaceHas(
|
|
1481
|
+
`variables.${normalizedName.slice(prefixCandidate.length + 1)}`,
|
|
1482
|
+
prefixCandidate
|
|
1483
|
+
);
|
|
1325
1484
|
if (hasScopedTranslation) return prefixCandidate;
|
|
1326
1485
|
}
|
|
1327
|
-
const prefixedMatch = knownOrigins.find(
|
|
1486
|
+
const prefixedMatch = knownOrigins.find(
|
|
1487
|
+
(origin) => normalizedName.startsWith(`${origin}_`)
|
|
1488
|
+
);
|
|
1328
1489
|
if (prefixedMatch) return prefixedMatch;
|
|
1329
1490
|
const matchingOrigins = knownOrigins.filter(
|
|
1330
1491
|
(origin) => namespaceHas(normalizedName, origin) || namespaceHas(`variables.${normalizedName}`, origin) || namespaceHas(`${origin}_${normalizedName}`, origin)
|
|
@@ -1342,7 +1503,13 @@ var LSVariableInputField = forwardRef4((props, ref) => {
|
|
|
1342
1503
|
);
|
|
1343
1504
|
return inferredOrigins.length === 1 ? inferredOrigins[0] : void 0;
|
|
1344
1505
|
},
|
|
1345
|
-
[
|
|
1506
|
+
[
|
|
1507
|
+
allowedVariableDefinitionLookup,
|
|
1508
|
+
allowedVariableOrigin,
|
|
1509
|
+
knownOrigins,
|
|
1510
|
+
namespaceHas,
|
|
1511
|
+
variableRecords
|
|
1512
|
+
]
|
|
1346
1513
|
);
|
|
1347
1514
|
const resolveVariableDescription = useCallback2(
|
|
1348
1515
|
(variableName, fallbackDescription, origin) => {
|
|
@@ -1350,8 +1517,10 @@ var LSVariableInputField = forwardRef4((props, ref) => {
|
|
|
1350
1517
|
if (fromOrigin && fromOrigin.trim().length > 0) return fromOrigin;
|
|
1351
1518
|
const defaultTranslationKey = `variables.${variableName}`;
|
|
1352
1519
|
const defaultTranslated = t(defaultTranslationKey);
|
|
1353
|
-
if (typeof defaultTranslated === "string" && defaultTranslated !== defaultTranslationKey)
|
|
1354
|
-
|
|
1520
|
+
if (typeof defaultTranslated === "string" && defaultTranslated !== defaultTranslationKey)
|
|
1521
|
+
return defaultTranslated;
|
|
1522
|
+
if (fallbackDescription && fallbackDescription.trim().length > 0)
|
|
1523
|
+
return fallbackDescription;
|
|
1355
1524
|
return humanizeVariableName(variableName);
|
|
1356
1525
|
},
|
|
1357
1526
|
[resolveTranslationFromNamespace, t]
|
|
@@ -1359,9 +1528,16 @@ var LSVariableInputField = forwardRef4((props, ref) => {
|
|
|
1359
1528
|
const getSystemVariableDescription = useCallback2(
|
|
1360
1529
|
(variable) => {
|
|
1361
1530
|
if (variable?.system && !variable?.pluginId) {
|
|
1362
|
-
return t(`variables.${variable.description}`, void 0, {
|
|
1531
|
+
return t(`variables.${variable.description}`, void 0, {
|
|
1532
|
+
example: variable.example,
|
|
1533
|
+
interpolation: { escapeValue: false, prefix: "{{{", suffix: "}}}" }
|
|
1534
|
+
});
|
|
1363
1535
|
}
|
|
1364
|
-
return resolveVariableDescription(
|
|
1536
|
+
return resolveVariableDescription(
|
|
1537
|
+
variable?.name ?? "",
|
|
1538
|
+
variable?.description,
|
|
1539
|
+
variable?.origin
|
|
1540
|
+
);
|
|
1365
1541
|
},
|
|
1366
1542
|
[resolveVariableDescription, t]
|
|
1367
1543
|
);
|
|
@@ -1382,9 +1558,19 @@ var LSVariableInputField = forwardRef4((props, ref) => {
|
|
|
1382
1558
|
if (variable) return getSystemVariableDescription(variable);
|
|
1383
1559
|
const fromDefinition = allowedVariableDefinitionLookup.get(variableName);
|
|
1384
1560
|
const origin = resolveAllowedVariableOrigin(variableName);
|
|
1385
|
-
return resolveVariableDescription(
|
|
1561
|
+
return resolveVariableDescription(
|
|
1562
|
+
variableName,
|
|
1563
|
+
fromDefinition?.description,
|
|
1564
|
+
origin
|
|
1565
|
+
);
|
|
1386
1566
|
},
|
|
1387
|
-
[
|
|
1567
|
+
[
|
|
1568
|
+
allowedVariableDefinitionLookup,
|
|
1569
|
+
getSystemVariableDescription,
|
|
1570
|
+
resolveAllowedVariableOrigin,
|
|
1571
|
+
resolveVariableDescription,
|
|
1572
|
+
variableRecords
|
|
1573
|
+
]
|
|
1388
1574
|
);
|
|
1389
1575
|
const getAllowedVariableValue = useCallback2(
|
|
1390
1576
|
(variableName) => {
|
|
@@ -1440,14 +1626,21 @@ var LSVariableInputField = forwardRef4((props, ref) => {
|
|
|
1440
1626
|
};
|
|
1441
1627
|
if (allowedVariableNames.length > 0) {
|
|
1442
1628
|
if (!query) {
|
|
1443
|
-
setFilteredAllowedVariables(
|
|
1629
|
+
setFilteredAllowedVariables(
|
|
1630
|
+
orderItemsByVariableType(
|
|
1631
|
+
allowedVariableDefinitions,
|
|
1632
|
+
(definition) => getAllowedVariableVisualType(definition.name)
|
|
1633
|
+
)
|
|
1634
|
+
);
|
|
1444
1635
|
} else {
|
|
1445
1636
|
const nameMatches = [];
|
|
1446
1637
|
const descMatches = [];
|
|
1447
1638
|
const nestedMatches = [];
|
|
1448
1639
|
allowedVariableDefinitions.forEach((definition) => {
|
|
1449
1640
|
const nameLower = definition.name?.toLowerCase();
|
|
1450
|
-
const descLower = getAllowedVariableDescription(
|
|
1641
|
+
const descLower = getAllowedVariableDescription(
|
|
1642
|
+
definition.name
|
|
1643
|
+
)?.toLowerCase();
|
|
1451
1644
|
if (nameLower?.includes(query)) {
|
|
1452
1645
|
nameMatches.push(definition);
|
|
1453
1646
|
return;
|
|
@@ -1461,8 +1654,16 @@ var LSVariableInputField = forwardRef4((props, ref) => {
|
|
|
1461
1654
|
nestedMatches.push(definition);
|
|
1462
1655
|
}
|
|
1463
1656
|
});
|
|
1464
|
-
const sortByDef = (items) => sortItemsByVariableTypeThenName(
|
|
1465
|
-
|
|
1657
|
+
const sortByDef = (items) => sortItemsByVariableTypeThenName(
|
|
1658
|
+
items,
|
|
1659
|
+
(definition) => getAllowedVariableVisualType(definition.name),
|
|
1660
|
+
(definition) => definition.name
|
|
1661
|
+
);
|
|
1662
|
+
setFilteredAllowedVariables([
|
|
1663
|
+
...sortByDef(nameMatches),
|
|
1664
|
+
...sortByDef(descMatches),
|
|
1665
|
+
...sortByDef(nestedMatches)
|
|
1666
|
+
]);
|
|
1466
1667
|
}
|
|
1467
1668
|
} else {
|
|
1468
1669
|
setFilteredAllowedVariables([]);
|
|
@@ -1477,7 +1678,12 @@ var LSVariableInputField = forwardRef4((props, ref) => {
|
|
|
1477
1678
|
const allRecords = Object.values(variableRecords);
|
|
1478
1679
|
if (!query) {
|
|
1479
1680
|
const visible = allRecords.filter(shouldKeep);
|
|
1480
|
-
setFilteredSystemVariables(
|
|
1681
|
+
setFilteredSystemVariables(
|
|
1682
|
+
orderItemsByVariableType(
|
|
1683
|
+
visible,
|
|
1684
|
+
(variable) => visualTypeFromRecord(variable)
|
|
1685
|
+
)
|
|
1686
|
+
);
|
|
1481
1687
|
} else {
|
|
1482
1688
|
const nameMatches = [];
|
|
1483
1689
|
const descMatches = [];
|
|
@@ -1500,8 +1706,16 @@ var LSVariableInputField = forwardRef4((props, ref) => {
|
|
|
1500
1706
|
nestedMatches.push(variable);
|
|
1501
1707
|
}
|
|
1502
1708
|
});
|
|
1503
|
-
const sortSys = (items) => sortItemsByVariableTypeThenName(
|
|
1504
|
-
|
|
1709
|
+
const sortSys = (items) => sortItemsByVariableTypeThenName(
|
|
1710
|
+
items,
|
|
1711
|
+
(variable) => visualTypeFromRecord(variable),
|
|
1712
|
+
(variable) => variable?.name ?? ""
|
|
1713
|
+
);
|
|
1714
|
+
setFilteredSystemVariables([
|
|
1715
|
+
...sortSys(nameMatches),
|
|
1716
|
+
...sortSys(descMatches),
|
|
1717
|
+
...sortSys(nestedMatches)
|
|
1718
|
+
]);
|
|
1505
1719
|
}
|
|
1506
1720
|
setAutoExpandPaths(nextAutoExpand);
|
|
1507
1721
|
}, [
|
|
@@ -1532,10 +1746,23 @@ var LSVariableInputField = forwardRef4((props, ref) => {
|
|
|
1532
1746
|
afterFilter?.(filtered);
|
|
1533
1747
|
return filtered;
|
|
1534
1748
|
};
|
|
1535
|
-
const renderVariableToken = (variableName, variableType, isSuggested = false) => /* @__PURE__ */ jsxs5(
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1749
|
+
const renderVariableToken = (variableName, variableType, isSuggested = false) => /* @__PURE__ */ jsxs5(
|
|
1750
|
+
"div",
|
|
1751
|
+
{
|
|
1752
|
+
className: `ls-variable-token ${getVariableColorClass(variableType, isSuggested)}`,
|
|
1753
|
+
children: [
|
|
1754
|
+
/* @__PURE__ */ jsx11("span", { className: "ls-variable-token__name", children: `{{${variableName}}}` }),
|
|
1755
|
+
variableType === "func" && /* @__PURE__ */ jsx11(
|
|
1756
|
+
"span",
|
|
1757
|
+
{
|
|
1758
|
+
className: "ls-variable-token__badge",
|
|
1759
|
+
title: t("variables.functionvariables", "Function variables"),
|
|
1760
|
+
children: "fx"
|
|
1761
|
+
}
|
|
1762
|
+
)
|
|
1763
|
+
]
|
|
1764
|
+
}
|
|
1765
|
+
);
|
|
1539
1766
|
const renderExpandToggle = (path, expanded) => /* @__PURE__ */ jsx11(
|
|
1540
1767
|
"button",
|
|
1541
1768
|
{
|
|
@@ -1547,7 +1774,7 @@ var LSVariableInputField = forwardRef4((props, ref) => {
|
|
|
1547
1774
|
className: `ls-variable-picker__expand-toggle${expanded ? " ls-variable-picker__expand-toggle--expanded" : ""}`,
|
|
1548
1775
|
"aria-label": expanded ? "Collapse" : "Expand",
|
|
1549
1776
|
"aria-expanded": expanded,
|
|
1550
|
-
children: /* @__PURE__ */ jsx11(
|
|
1777
|
+
children: /* @__PURE__ */ jsx11(KeyboardArrowDown2, { style: { width: 16, height: 16 } })
|
|
1551
1778
|
}
|
|
1552
1779
|
);
|
|
1553
1780
|
const renderExpandSpacer = () => /* @__PURE__ */ jsx11("span", { className: "ls-variable-picker__expand-spacer", "aria-hidden": true });
|
|
@@ -1555,6 +1782,19 @@ var LSVariableInputField = forwardRef4((props, ref) => {
|
|
|
1555
1782
|
const { displayValue, fullValue } = getVariableValueDisplay(variableValue);
|
|
1556
1783
|
return { displayValue, fullValue };
|
|
1557
1784
|
};
|
|
1785
|
+
const renderVariableValueInput = (displayValue, fullValue) => /* @__PURE__ */ jsx11(
|
|
1786
|
+
"input",
|
|
1787
|
+
{
|
|
1788
|
+
className: "ls-variable-picker__value-input",
|
|
1789
|
+
title: fullValue,
|
|
1790
|
+
readOnly: true,
|
|
1791
|
+
value: fullValue || displayValue,
|
|
1792
|
+
onClick: (e) => e.stopPropagation(),
|
|
1793
|
+
onMouseDown: (e) => e.stopPropagation(),
|
|
1794
|
+
onKeyDown: (e) => e.stopPropagation(),
|
|
1795
|
+
"aria-label": t("common.value", "Value")
|
|
1796
|
+
}
|
|
1797
|
+
);
|
|
1558
1798
|
const renderValueChildRows = (rootToken, nodes) => nodes.map((node) => {
|
|
1559
1799
|
const fullToken = `${rootToken}.${node.relativePath}`;
|
|
1560
1800
|
const expanded = node.isExpandable && isPathExpanded(fullToken);
|
|
@@ -1569,12 +1809,25 @@ var LSVariableInputField = forwardRef4((props, ref) => {
|
|
|
1569
1809
|
else insertVariable(fullToken);
|
|
1570
1810
|
},
|
|
1571
1811
|
children: [
|
|
1572
|
-
/* @__PURE__ */ jsxs5(
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1812
|
+
/* @__PURE__ */ jsxs5(
|
|
1813
|
+
"div",
|
|
1814
|
+
{
|
|
1815
|
+
className: "ls-variable-picker__token-cell",
|
|
1816
|
+
style: { paddingLeft: `${node.depth * 1.25}rem` },
|
|
1817
|
+
children: [
|
|
1818
|
+
node.isExpandable ? renderExpandToggle(fullToken, expanded) : renderExpandSpacer(),
|
|
1819
|
+
/* @__PURE__ */ jsx11(
|
|
1820
|
+
"div",
|
|
1821
|
+
{
|
|
1822
|
+
className: `ls-variable-token ${CHILD_VARIABLE_COLOR_CLASS}`,
|
|
1823
|
+
children: /* @__PURE__ */ jsx11("span", { className: "ls-variable-token__name", children: `{{${fullToken}}}` })
|
|
1824
|
+
}
|
|
1825
|
+
)
|
|
1826
|
+
]
|
|
1827
|
+
}
|
|
1828
|
+
),
|
|
1576
1829
|
/* @__PURE__ */ jsx11("div", { className: "ls-variable-picker__description", children: node.displayKey }),
|
|
1577
|
-
/* @__PURE__ */ jsx11("div", { className: "ls-variable-picker__value", title: fullValue, children: displayValue })
|
|
1830
|
+
/* @__PURE__ */ jsx11("div", { className: "ls-variable-picker__value", title: fullValue, children: renderVariableValueInput(displayValue, fullValue) })
|
|
1578
1831
|
]
|
|
1579
1832
|
}
|
|
1580
1833
|
),
|
|
@@ -1583,15 +1836,18 @@ var LSVariableInputField = forwardRef4((props, ref) => {
|
|
|
1583
1836
|
});
|
|
1584
1837
|
const toOptionLabelString = (input) => {
|
|
1585
1838
|
if (typeof input === "string") return input;
|
|
1586
|
-
if (typeof input === "number" || typeof input === "boolean" || typeof input === "bigint")
|
|
1839
|
+
if (typeof input === "number" || typeof input === "boolean" || typeof input === "bigint")
|
|
1840
|
+
return String(input);
|
|
1587
1841
|
if (input === null || input === void 0) return "";
|
|
1588
1842
|
if (typeof input === "object") {
|
|
1589
1843
|
const labelCandidate = input.label;
|
|
1590
1844
|
if (typeof labelCandidate === "string") return labelCandidate;
|
|
1591
|
-
if (typeof labelCandidate === "number" || typeof labelCandidate === "boolean" || typeof labelCandidate === "bigint")
|
|
1845
|
+
if (typeof labelCandidate === "number" || typeof labelCandidate === "boolean" || typeof labelCandidate === "bigint")
|
|
1846
|
+
return String(labelCandidate);
|
|
1592
1847
|
const valueCandidate = input.value;
|
|
1593
1848
|
if (typeof valueCandidate === "string") return valueCandidate;
|
|
1594
|
-
if (typeof valueCandidate === "number" || typeof valueCandidate === "boolean" || typeof valueCandidate === "bigint")
|
|
1849
|
+
if (typeof valueCandidate === "number" || typeof valueCandidate === "boolean" || typeof valueCandidate === "bigint")
|
|
1850
|
+
return String(valueCandidate);
|
|
1595
1851
|
try {
|
|
1596
1852
|
return JSON.stringify(input);
|
|
1597
1853
|
} catch {
|
|
@@ -1604,7 +1860,9 @@ var LSVariableInputField = forwardRef4((props, ref) => {
|
|
|
1604
1860
|
if (typeof getOptionLabel === "function") {
|
|
1605
1861
|
try {
|
|
1606
1862
|
const customLabel = getOptionLabel(option);
|
|
1607
|
-
return toOptionLabelString(
|
|
1863
|
+
return toOptionLabelString(
|
|
1864
|
+
customLabel === void 0 ? option : customLabel
|
|
1865
|
+
);
|
|
1608
1866
|
} catch {
|
|
1609
1867
|
return toOptionLabelString(option);
|
|
1610
1868
|
}
|
|
@@ -1621,9 +1879,20 @@ var LSVariableInputField = forwardRef4((props, ref) => {
|
|
|
1621
1879
|
{
|
|
1622
1880
|
...optionProps,
|
|
1623
1881
|
key: String(opt?.label ?? opt?.value ?? ""),
|
|
1624
|
-
className:
|
|
1882
|
+
className: [
|
|
1883
|
+
optionProps.className,
|
|
1884
|
+
"ls-variable-option",
|
|
1885
|
+
isSelected ? "ls-variable-option--selected" : ""
|
|
1886
|
+
].filter(Boolean).join(" ")
|
|
1625
1887
|
},
|
|
1626
|
-
thumb ? /* @__PURE__ */ jsx11(
|
|
1888
|
+
thumb ? /* @__PURE__ */ jsx11(
|
|
1889
|
+
"img",
|
|
1890
|
+
{
|
|
1891
|
+
src: thumb,
|
|
1892
|
+
className: "ls-variable-option__thumb",
|
|
1893
|
+
alt: ""
|
|
1894
|
+
}
|
|
1895
|
+
) : null,
|
|
1627
1896
|
/* @__PURE__ */ jsxs5("div", { className: "ls-variable-option__body", children: [
|
|
1628
1897
|
/* @__PURE__ */ jsx11("div", { className: "ls-variable-option__label", children: resolveOptionLabel(opt) }),
|
|
1629
1898
|
helperText ? /* @__PURE__ */ jsx11("div", { className: "ls-variable-option__helper", children: helperText }) : null
|
|
@@ -1633,22 +1902,24 @@ var LSVariableInputField = forwardRef4((props, ref) => {
|
|
|
1633
1902
|
const showSuggestedSection = allowedVariableNames.length > 0 && filteredAllowedVariables.length > 0;
|
|
1634
1903
|
const pickerBody = /* @__PURE__ */ jsxs5("div", { className: "ls-variable-picker ls-variable-picker--three-col", children: [
|
|
1635
1904
|
/* @__PURE__ */ jsxs5("div", { className: "ls-variable-picker__intro", children: [
|
|
1636
|
-
/* @__PURE__ */ jsx11("div", { className: "ls-variable-picker__intro-text", children: t(
|
|
1905
|
+
/* @__PURE__ */ jsx11("div", { className: "ls-variable-picker__intro-text", children: t(
|
|
1906
|
+
"overlay-variables.variables-description",
|
|
1907
|
+
"Use variables that will automatically be replaced before sending out the text"
|
|
1908
|
+
) }),
|
|
1637
1909
|
/* @__PURE__ */ jsx11(
|
|
1638
1910
|
LSInput,
|
|
1639
1911
|
{
|
|
1640
1912
|
autoFocus: true,
|
|
1641
|
-
startAdornment: /* @__PURE__ */ jsx11(Search, { style: { width:
|
|
1913
|
+
startAdornment: /* @__PURE__ */ jsx11(Search, { style: { color: "#fff", width: 20, height: 20 } }),
|
|
1642
1914
|
placeholder: t("common.search", "Search"),
|
|
1643
1915
|
value: searchQuery,
|
|
1644
1916
|
onChange: (e) => setSearchQuery(e.target.value),
|
|
1645
|
-
type: "text"
|
|
1646
|
-
style: { padding: "1rem 0 0" }
|
|
1917
|
+
type: "text"
|
|
1647
1918
|
}
|
|
1648
1919
|
)
|
|
1649
1920
|
] }),
|
|
1650
1921
|
/* @__PURE__ */ jsxs5("div", { className: "ls-variable-picker__header", children: [
|
|
1651
|
-
/* @__PURE__ */ jsx11("div", { children: t("commands.variable", "Variable") }),
|
|
1922
|
+
/* @__PURE__ */ jsx11("div", { style: { paddingLeft: "2.2rem" }, children: t("commands.variable", "Variable") }),
|
|
1652
1923
|
/* @__PURE__ */ jsx11("div", { children: t("commands.description", "Description") }),
|
|
1653
1924
|
/* @__PURE__ */ jsx11("div", { children: t("common.value", "Value") })
|
|
1654
1925
|
] }),
|
|
@@ -1656,9 +1927,13 @@ var LSVariableInputField = forwardRef4((props, ref) => {
|
|
|
1656
1927
|
showSuggestedSection && /* @__PURE__ */ jsxs5("fieldset", { className: "ls-variable-picker__field", children: [
|
|
1657
1928
|
/* @__PURE__ */ jsx11("legend", { className: "ls-variable-picker__legend", children: t("commands.suggested-variables", "Suggested Variables") }),
|
|
1658
1929
|
filteredAllowedVariables.map((definition, idx) => {
|
|
1659
|
-
const variableType = getAllowedVariableVisualType(
|
|
1930
|
+
const variableType = getAllowedVariableVisualType(
|
|
1931
|
+
definition.name
|
|
1932
|
+
);
|
|
1660
1933
|
const tree = getAllowedVariableTree(definition);
|
|
1661
|
-
const { displayValue, fullValue } = getVariableValuePreview(
|
|
1934
|
+
const { displayValue, fullValue } = getVariableValuePreview(
|
|
1935
|
+
getAllowedVariableValue(definition.name) ?? definition.example
|
|
1936
|
+
);
|
|
1662
1937
|
const expandable = !!tree && tree.length > 0;
|
|
1663
1938
|
const expanded = expandable && isPathExpanded(definition.name);
|
|
1664
1939
|
const isLast = idx === filteredAllowedVariables.length - 1;
|
|
@@ -1669,7 +1944,8 @@ var LSVariableInputField = forwardRef4((props, ref) => {
|
|
|
1669
1944
|
{
|
|
1670
1945
|
className: rowCls,
|
|
1671
1946
|
onClick: () => {
|
|
1672
|
-
if (expandable && !expanded)
|
|
1947
|
+
if (expandable && !expanded)
|
|
1948
|
+
toggleExpand(definition.name);
|
|
1673
1949
|
else insertVariable(definition.name);
|
|
1674
1950
|
},
|
|
1675
1951
|
children: [
|
|
@@ -1678,7 +1954,14 @@ var LSVariableInputField = forwardRef4((props, ref) => {
|
|
|
1678
1954
|
renderVariableToken(definition.name, variableType, true)
|
|
1679
1955
|
] }),
|
|
1680
1956
|
/* @__PURE__ */ jsx11("div", { className: "ls-variable-picker__description", children: getAllowedVariableDescription(definition.name) }),
|
|
1681
|
-
/* @__PURE__ */ jsx11(
|
|
1957
|
+
/* @__PURE__ */ jsx11(
|
|
1958
|
+
"div",
|
|
1959
|
+
{
|
|
1960
|
+
className: "ls-variable-picker__value",
|
|
1961
|
+
title: fullValue,
|
|
1962
|
+
children: renderVariableValueInput(displayValue, fullValue)
|
|
1963
|
+
}
|
|
1964
|
+
)
|
|
1682
1965
|
]
|
|
1683
1966
|
}
|
|
1684
1967
|
),
|
|
@@ -1688,7 +1971,9 @@ var LSVariableInputField = forwardRef4((props, ref) => {
|
|
|
1688
1971
|
] }),
|
|
1689
1972
|
filteredSystemVariables?.map((variable) => {
|
|
1690
1973
|
const variableType = visualTypeFromRecord(variable);
|
|
1691
|
-
const { displayValue, fullValue } = getVariableValuePreview(
|
|
1974
|
+
const { displayValue, fullValue } = getVariableValuePreview(
|
|
1975
|
+
variable.value
|
|
1976
|
+
);
|
|
1692
1977
|
const rootToken = variable.example ?? variable.name;
|
|
1693
1978
|
const tree = systemVariableValueTrees.get(variable.name);
|
|
1694
1979
|
const expandable = !!tree && tree.length > 0;
|
|
@@ -1708,7 +1993,7 @@ var LSVariableInputField = forwardRef4((props, ref) => {
|
|
|
1708
1993
|
renderVariableToken(variable.name, variableType)
|
|
1709
1994
|
] }),
|
|
1710
1995
|
/* @__PURE__ */ jsx11("div", { className: "ls-variable-picker__description", children: getSystemVariableDescription(variable) }),
|
|
1711
|
-
/* @__PURE__ */ jsx11("div", { className: "ls-variable-picker__value", title: fullValue, children: displayValue })
|
|
1996
|
+
/* @__PURE__ */ jsx11("div", { className: "ls-variable-picker__value", title: fullValue, children: renderVariableValueInput(displayValue, fullValue) })
|
|
1712
1997
|
]
|
|
1713
1998
|
}
|
|
1714
1999
|
),
|
|
@@ -1739,7 +2024,7 @@ var LSVariableInputField = forwardRef4((props, ref) => {
|
|
|
1739
2024
|
clickedVariableIcon,
|
|
1740
2025
|
inputProps,
|
|
1741
2026
|
allowedVariables,
|
|
1742
|
-
showVariableIcon: !hideVariables,
|
|
2027
|
+
showVariableIcon: !hideVariables && (!isAutoComplete || allowedVariableDefinitions.length > 0),
|
|
1743
2028
|
ref
|
|
1744
2029
|
}
|
|
1745
2030
|
);
|
|
@@ -1761,7 +2046,9 @@ var LSVariableInputField = forwardRef4((props, ref) => {
|
|
|
1761
2046
|
// single source of internal spacing. Adding paper padding on top of
|
|
1762
2047
|
// that compounds the inset and forces premature horizontal scroll.
|
|
1763
2048
|
padding: 0,
|
|
1764
|
-
border: "1px solid var(--neutralDark4, #393853)"
|
|
2049
|
+
border: "1px solid var(--neutralDark4, #393853)",
|
|
2050
|
+
borderRadius: "var(--radius, 1rem)",
|
|
2051
|
+
overflow: "hidden"
|
|
1765
2052
|
}
|
|
1766
2053
|
}
|
|
1767
2054
|
},
|
|
@@ -1810,7 +2097,55 @@ var LSVariableInputField = forwardRef4((props, ref) => {
|
|
|
1810
2097
|
filterOptions: handleFilterOptions,
|
|
1811
2098
|
renderOption: $renderOption ?? renderOption ?? defaultRenderOption,
|
|
1812
2099
|
slots: ListboxComponent ? { listbox: ListboxComponent } : void 0,
|
|
1813
|
-
slotProps: {
|
|
2100
|
+
slotProps: {
|
|
2101
|
+
popper: {
|
|
2102
|
+
className: "ls-variable-autocomplete-popper"
|
|
2103
|
+
},
|
|
2104
|
+
paper: {
|
|
2105
|
+
className: "ls-variable-autocomplete-paper",
|
|
2106
|
+
sx: {
|
|
2107
|
+
border: "1px solid var(--neutralDark4, var(--cardborder, #393853))",
|
|
2108
|
+
borderRadius: "var(--radius, 1rem)",
|
|
2109
|
+
backgroundColor: "var(--neutralDark2, var(--cardbackground, #211f45))",
|
|
2110
|
+
color: "var(--neutralLight1, var(--white, #fff))",
|
|
2111
|
+
boxShadow: "0 16px 32px rgba(0, 0, 0, 0.32)",
|
|
2112
|
+
overflow: "hidden"
|
|
2113
|
+
}
|
|
2114
|
+
},
|
|
2115
|
+
listbox: {
|
|
2116
|
+
className: "ls-variable-autocomplete-listbox",
|
|
2117
|
+
onScroll: onScrollListBox,
|
|
2118
|
+
sx: {
|
|
2119
|
+
padding: "0.25rem 0",
|
|
2120
|
+
backgroundColor: "var(--neutralDark2, var(--cardbackground, #211f45))",
|
|
2121
|
+
color: "var(--neutralLight1, var(--white, #fff))",
|
|
2122
|
+
"& .MuiAutocomplete-option": {
|
|
2123
|
+
display: "flex",
|
|
2124
|
+
minHeight: 44,
|
|
2125
|
+
alignItems: "center",
|
|
2126
|
+
padding: "0.625rem 1rem",
|
|
2127
|
+
color: "var(--neutralLight1, var(--white, #fff))",
|
|
2128
|
+
fontSize: "1rem",
|
|
2129
|
+
lineHeight: 1.35,
|
|
2130
|
+
transition: "background-color 120ms ease, color 120ms ease"
|
|
2131
|
+
},
|
|
2132
|
+
"& .MuiAutocomplete-option:hover, & .MuiAutocomplete-option.Mui-focused, & .MuiAutocomplete-option[data-focus='true'], & .MuiAutocomplete-option[aria-selected='true']": {
|
|
2133
|
+
backgroundColor: "var(--cardHover, var(--transwhite, rgba(255, 255, 255, 0.05)))",
|
|
2134
|
+
color: "var(--neutralLight1, var(--white, #fff))"
|
|
2135
|
+
}
|
|
2136
|
+
}
|
|
2137
|
+
},
|
|
2138
|
+
popupIndicator: {
|
|
2139
|
+
className: "ls-variable-autocomplete-popup-indicator",
|
|
2140
|
+
sx: {
|
|
2141
|
+
color: "var(--neutralLight1, var(--white, #fff))",
|
|
2142
|
+
"& svg": {
|
|
2143
|
+
color: "var(--neutralLight1, var(--white, #fff))",
|
|
2144
|
+
fill: "currentColor"
|
|
2145
|
+
}
|
|
2146
|
+
}
|
|
2147
|
+
}
|
|
2148
|
+
},
|
|
1814
2149
|
onHighlightChange,
|
|
1815
2150
|
onOpen: onPopupOpen,
|
|
1816
2151
|
onClose: onPopupClose,
|
|
@@ -1846,7 +2181,9 @@ var VariableInputTextField = forwardRef4(
|
|
|
1846
2181
|
const paramsInputProps = params?.InputProps ?? {};
|
|
1847
2182
|
const inputPropsSlotInputProps = inputProps?.slotProps?.input ?? {};
|
|
1848
2183
|
const paramsSlotInputProps = params?.slotProps?.input ?? {};
|
|
1849
|
-
const
|
|
2184
|
+
const explicitStartAdornment = inputProps?.startAdornment;
|
|
2185
|
+
const resolvedExplicitStartAdornment = explicitStartAdornment ? /* @__PURE__ */ jsx11(InputAdornment2, { position: "start", children: explicitStartAdornment }) : void 0;
|
|
2186
|
+
const startAdornment = paramsInputProps.startAdornment ?? paramsSlotInputProps.startAdornment ?? inputPropsInputProps.startAdornment ?? inputPropsSlotInputProps.startAdornment ?? resolvedExplicitStartAdornment;
|
|
1850
2187
|
const endAdornment = paramsInputProps.endAdornment ?? paramsSlotInputProps.endAdornment ?? inputPropsInputProps.endAdornment ?? inputPropsSlotInputProps.endAdornment;
|
|
1851
2188
|
return /* @__PURE__ */ jsx11(
|
|
1852
2189
|
LSTextField,
|
|
@@ -1855,7 +2192,7 @@ var VariableInputTextField = forwardRef4(
|
|
|
1855
2192
|
name,
|
|
1856
2193
|
label,
|
|
1857
2194
|
type,
|
|
1858
|
-
color: "
|
|
2195
|
+
color: "primary",
|
|
1859
2196
|
variant,
|
|
1860
2197
|
disabled,
|
|
1861
2198
|
autoFocus,
|
|
@@ -1865,8 +2202,8 @@ var VariableInputTextField = forwardRef4(
|
|
|
1865
2202
|
maxRows,
|
|
1866
2203
|
value,
|
|
1867
2204
|
fullWidth: true,
|
|
1868
|
-
className: `mui-ls-input
|
|
1869
|
-
onChange: onChange ? (
|
|
2205
|
+
className: `mui-ls-input ${params?.className ?? ""} ${inputProps?.className ?? ""}`.trim(),
|
|
2206
|
+
onChange: onChange ? (e) => onChange(e.target.value) : void 0,
|
|
1870
2207
|
...inputProps,
|
|
1871
2208
|
...params,
|
|
1872
2209
|
InputProps: {
|
|
@@ -1877,16 +2214,22 @@ var VariableInputTextField = forwardRef4(
|
|
|
1877
2214
|
startAdornment,
|
|
1878
2215
|
endAdornment: /* @__PURE__ */ jsxs5(Fragment2, { children: [
|
|
1879
2216
|
endAdornment ?? null,
|
|
1880
|
-
showVariableIcon ? /* @__PURE__ */ jsx11(
|
|
1881
|
-
|
|
2217
|
+
showVariableIcon ? /* @__PURE__ */ jsx11(
|
|
2218
|
+
Tooltip,
|
|
1882
2219
|
{
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
2220
|
+
title: t("chatbot.allowed-variables", "Allowed Variables"),
|
|
2221
|
+
children: /* @__PURE__ */ jsx11(
|
|
2222
|
+
InputAdornment2,
|
|
2223
|
+
{
|
|
2224
|
+
position: "end",
|
|
2225
|
+
onClick: clickedVariableIcon,
|
|
2226
|
+
ref: containerRef,
|
|
2227
|
+
className: "ls-variable-input-adornment",
|
|
2228
|
+
children: "{}"
|
|
2229
|
+
}
|
|
2230
|
+
)
|
|
1888
2231
|
}
|
|
1889
|
-
)
|
|
2232
|
+
) : null
|
|
1890
2233
|
] })
|
|
1891
2234
|
},
|
|
1892
2235
|
inputRef: ref
|