@plitzi/sdk-style 0.30.19
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/CHANGELOG.md +1398 -0
- package/dist/BuilderStyleContextProvider.d.ts +12 -0
- package/dist/BuilderStyleContextProvider.mjs +209 -0
- package/dist/SdkStyleContextProvider.d.ts +8 -0
- package/dist/SdkStyleContextProvider.mjs +16 -0
- package/dist/StyleAdvanceEditor.d.ts +2 -0
- package/dist/StyleAdvanceEditor.mjs +88 -0
- package/dist/StyleContext.d.ts +3 -0
- package/dist/StyleContext.mjs +5 -0
- package/dist/StyleHelper.d.ts +7 -0
- package/dist/StyleHelper.mjs +45 -0
- package/dist/StyleMap/StyleMap.d.ts +52 -0
- package/dist/StyleMap/StyleMap.mjs +61 -0
- package/dist/StyleMap/helpers/getStyleItem.d.ts +3 -0
- package/dist/StyleMap/helpers/getStyleItem.mjs +5 -0
- package/dist/StyleMap/helpers/isValueValid.d.ts +12 -0
- package/dist/StyleMap/helpers/isValueValid.mjs +7 -0
- package/dist/StyleMap/helpers/utils.d.ts +6 -0
- package/dist/StyleMap/helpers/utils.mjs +51 -0
- package/dist/StyleMap/index.d.ts +3 -0
- package/dist/StyleMap/index.mjs +5 -0
- package/dist/StyleMap/methods/addSelector.d.ts +8 -0
- package/dist/StyleMap/methods/addSelector.mjs +24 -0
- package/dist/StyleMap/methods/updateSelector.d.ts +8 -0
- package/dist/StyleMap/methods/updateSelector.mjs +13 -0
- package/dist/StyleReducer.d.ts +82 -0
- package/dist/StyleReducer.mjs +101 -0
- package/dist/_virtual/_rolldown/runtime.mjs +11 -0
- package/dist/components/InputEasing/BezierEasing.d.ts +1 -0
- package/dist/components/InputEasing/BezierEasing.mjs +34 -0
- package/dist/components/InputEasing/Curve.d.ts +9 -0
- package/dist/components/InputEasing/Curve.mjs +11 -0
- package/dist/components/InputEasing/Grid.d.ts +8 -0
- package/dist/components/InputEasing/Grid.mjs +51 -0
- package/dist/components/InputEasing/InputEasing.d.ts +31 -0
- package/dist/components/InputEasing/InputEasing.mjs +121 -0
- package/dist/components/InputEasing/InputEasingButton.d.ts +9 -0
- package/dist/components/InputEasing/InputEasingButton.mjs +16 -0
- package/dist/components/InputEasing/InputEasingHelper.d.ts +1 -0
- package/dist/components/InputEasing/InputEasingHelper.mjs +179 -0
- package/dist/components/InputEasing/InputEasingList.d.ts +6 -0
- package/dist/components/InputEasing/InputEasingList.mjs +291 -0
- package/dist/components/InputEasing/Progress.d.ts +10 -0
- package/dist/components/InputEasing/Progress.mjs +15 -0
- package/dist/components/InputEasing/index.d.ts +3 -0
- package/dist/components/InputEasing/index.mjs +5 -0
- package/dist/components/Selector/Selector.d.ts +16 -0
- package/dist/components/Selector/Selector.mjs +171 -0
- package/dist/components/Selector/SelectorHelper.d.ts +1 -0
- package/dist/components/Selector/SelectorHelper.mjs +4 -0
- package/dist/components/Selector/SelectorItem/ItemOptions.d.ts +9 -0
- package/dist/components/Selector/SelectorItem/ItemOptions.mjs +57 -0
- package/dist/components/Selector/SelectorItem/SelectorItem.d.ts +15 -0
- package/dist/components/Selector/SelectorItem/SelectorItem.mjs +50 -0
- package/dist/components/Selector/SelectorItem/index.d.ts +3 -0
- package/dist/components/Selector/SelectorItem/index.mjs +5 -0
- package/dist/components/Selector/SelectorSuggestions/SelectorSuggestions.d.ts +9 -0
- package/dist/components/Selector/SelectorSuggestions/SelectorSuggestions.mjs +23 -0
- package/dist/components/Selector/SelectorSuggestions/SuggestionsCreator.d.ts +7 -0
- package/dist/components/Selector/SelectorSuggestions/SuggestionsCreator.mjs +20 -0
- package/dist/components/Selector/SelectorSuggestions/SuggestionsList.d.ts +7 -0
- package/dist/components/Selector/SelectorSuggestions/SuggestionsList.mjs +25 -0
- package/dist/components/Selector/SelectorSuggestions/index.d.ts +3 -0
- package/dist/components/Selector/SelectorSuggestions/index.mjs +5 -0
- package/dist/components/Selector/index.d.ts +3 -0
- package/dist/components/Selector/index.mjs +5 -0
- package/dist/components/StyleInspector/Inspector.d.ts +15 -0
- package/dist/components/StyleInspector/Inspector.mjs +178 -0
- package/dist/components/StyleInspector/StyleInspector.d.ts +21 -0
- package/dist/components/StyleInspector/StyleInspector.mjs +201 -0
- package/dist/components/StyleInspector/StyleInspectorContext.d.ts +23 -0
- package/dist/components/StyleInspector/StyleInspectorContext.mjs +5 -0
- package/dist/components/StyleInspector/StyleInspectorProvider.d.ts +17 -0
- package/dist/components/StyleInspector/StyleInspectorProvider.mjs +86 -0
- package/dist/components/StyleInspector/categories/Background/Background.d.ts +7 -0
- package/dist/components/StyleInspector/categories/Background/Background.mjs +142 -0
- package/dist/components/StyleInspector/categories/Background/components/BackgroundLayer/BackgroundLayer.d.ts +12 -0
- package/dist/components/StyleInspector/categories/Background/components/BackgroundLayer/BackgroundLayer.mjs +171 -0
- package/dist/components/StyleInspector/categories/Background/components/BackgroundLayer/index.d.ts +3 -0
- package/dist/components/StyleInspector/categories/Background/components/BackgroundLayer/index.mjs +5 -0
- package/dist/components/StyleInspector/categories/Background/components/BackgroundPosition/BackgroundPosition.d.ts +7 -0
- package/dist/components/StyleInspector/categories/Background/components/BackgroundPosition/BackgroundPosition.mjs +39 -0
- package/dist/components/StyleInspector/categories/Background/components/BackgroundPosition/index.d.ts +3 -0
- package/dist/components/StyleInspector/categories/Background/components/BackgroundPosition/index.mjs +5 -0
- package/dist/components/StyleInspector/categories/Background/components/BackgroundSize/BackgroundSize.d.ts +7 -0
- package/dist/components/StyleInspector/categories/Background/components/BackgroundSize/BackgroundSize.mjs +86 -0
- package/dist/components/StyleInspector/categories/Background/components/BackgroundSize/index.d.ts +3 -0
- package/dist/components/StyleInspector/categories/Background/components/BackgroundSize/index.mjs +5 -0
- package/dist/components/StyleInspector/categories/Background/components/BackgroundTile/BackgroundTile.d.ts +7 -0
- package/dist/components/StyleInspector/categories/Background/components/BackgroundTile/BackgroundTile.mjs +47 -0
- package/dist/components/StyleInspector/categories/Background/components/BackgroundTile/index.d.ts +3 -0
- package/dist/components/StyleInspector/categories/Background/components/BackgroundTile/index.mjs +5 -0
- package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientPreviewBar.d.ts +7 -0
- package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientPreviewBar.mjs +20 -0
- package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopBar.d.ts +7 -0
- package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopBar.mjs +94 -0
- package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopEditor.d.ts +10 -0
- package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopEditor.mjs +48 -0
- package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopHandle.d.ts +11 -0
- package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopHandle.mjs +44 -0
- package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopTrack.d.ts +9 -0
- package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopTrack.mjs +27 -0
- package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/index.d.ts +3 -0
- package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/index.mjs +5 -0
- package/dist/components/StyleInspector/categories/Background/helpers/backgroundParser.d.ts +56 -0
- package/dist/components/StyleInspector/categories/Background/helpers/backgroundParser.mjs +182 -0
- package/dist/components/StyleInspector/categories/Background/helpers/normalizeLeft.d.ts +2 -0
- package/dist/components/StyleInspector/categories/Background/helpers/normalizeLeft.mjs +10 -0
- package/dist/components/StyleInspector/categories/Background/helpers/parseToBgLayers.d.ts +5 -0
- package/dist/components/StyleInspector/categories/Background/helpers/parseToBgLayers.mjs +19 -0
- package/dist/components/StyleInspector/categories/Background/index.d.ts +3 -0
- package/dist/components/StyleInspector/categories/Background/index.mjs +5 -0
- package/dist/components/StyleInspector/categories/Background/modes/ConicGradientMode.d.ts +7 -0
- package/dist/components/StyleInspector/categories/Background/modes/ConicGradientMode.mjs +100 -0
- package/dist/components/StyleInspector/categories/Background/modes/ImageMode.d.ts +7 -0
- package/dist/components/StyleInspector/categories/Background/modes/ImageMode.mjs +80 -0
- package/dist/components/StyleInspector/categories/Background/modes/LinearGradientMode.d.ts +7 -0
- package/dist/components/StyleInspector/categories/Background/modes/LinearGradientMode.mjs +76 -0
- package/dist/components/StyleInspector/categories/Background/modes/RadialGradientMode.d.ts +7 -0
- package/dist/components/StyleInspector/categories/Background/modes/RadialGradientMode.mjs +120 -0
- package/dist/components/StyleInspector/categories/Border/Border.d.ts +7 -0
- package/dist/components/StyleInspector/categories/Border/Border.mjs +126 -0
- package/dist/components/StyleInspector/categories/Border/BorderColor.d.ts +8 -0
- package/dist/components/StyleInspector/categories/Border/BorderColor.mjs +34 -0
- package/dist/components/StyleInspector/categories/Border/BorderPlacements.d.ts +7 -0
- package/dist/components/StyleInspector/categories/Border/BorderPlacements.mjs +55 -0
- package/dist/components/StyleInspector/categories/Border/BorderRadius.d.ts +8 -0
- package/dist/components/StyleInspector/categories/Border/BorderRadius.mjs +132 -0
- package/dist/components/StyleInspector/categories/Border/BorderStyle.d.ts +8 -0
- package/dist/components/StyleInspector/categories/Border/BorderStyle.mjs +63 -0
- package/dist/components/StyleInspector/categories/Border/BorderWidth.d.ts +8 -0
- package/dist/components/StyleInspector/categories/Border/BorderWidth.mjs +34 -0
- package/dist/components/StyleInspector/categories/Border/index.d.ts +3 -0
- package/dist/components/StyleInspector/categories/Border/index.mjs +5 -0
- package/dist/components/StyleInspector/categories/Display/Display.d.ts +7 -0
- package/dist/components/StyleInspector/categories/Display/Display.mjs +120 -0
- package/dist/components/StyleInspector/categories/Display/DisplayElements.d.ts +7 -0
- package/dist/components/StyleInspector/categories/Display/DisplayElements.mjs +64 -0
- package/dist/components/StyleInspector/categories/Display/DisplayFlex.d.ts +8 -0
- package/dist/components/StyleInspector/categories/Display/DisplayFlex.mjs +46 -0
- package/dist/components/StyleInspector/categories/Display/DisplayFlexAlignContent.d.ts +9 -0
- package/dist/components/StyleInspector/categories/Display/DisplayFlexAlignContent.mjs +97 -0
- package/dist/components/StyleInspector/categories/Display/DisplayFlexAlignItems.d.ts +9 -0
- package/dist/components/StyleInspector/categories/Display/DisplayFlexAlignItems.mjs +102 -0
- package/dist/components/StyleInspector/categories/Display/DisplayFlexDirection.d.ts +8 -0
- package/dist/components/StyleInspector/categories/Display/DisplayFlexDirection.mjs +46 -0
- package/dist/components/StyleInspector/categories/Display/DisplayFlexJustify.d.ts +9 -0
- package/dist/components/StyleInspector/categories/Display/DisplayFlexJustify.mjs +88 -0
- package/dist/components/StyleInspector/categories/Display/DisplayGap.d.ts +8 -0
- package/dist/components/StyleInspector/categories/Display/DisplayGap.mjs +27 -0
- package/dist/components/StyleInspector/categories/Display/DisplayGridGap.d.ts +8 -0
- package/dist/components/StyleInspector/categories/Display/DisplayGridGap.mjs +27 -0
- package/dist/components/StyleInspector/categories/Display/DisplayGridTemplate.d.ts +12 -0
- package/dist/components/StyleInspector/categories/Display/DisplayGridTemplate.mjs +83 -0
- package/dist/components/StyleInspector/categories/Display/index.d.ts +3 -0
- package/dist/components/StyleInspector/categories/Display/index.mjs +5 -0
- package/dist/components/StyleInspector/categories/DisplayFlexChild/DisplayAlignSelf.d.ts +8 -0
- package/dist/components/StyleInspector/categories/DisplayFlexChild/DisplayAlignSelf.mjs +60 -0
- package/dist/components/StyleInspector/categories/DisplayFlexChild/DisplayFlexChild.d.ts +8 -0
- package/dist/components/StyleInspector/categories/DisplayFlexChild/DisplayFlexChild.mjs +125 -0
- package/dist/components/StyleInspector/categories/DisplayFlexChild/DisplayOrder.d.ts +7 -0
- package/dist/components/StyleInspector/categories/DisplayFlexChild/DisplayOrder.mjs +51 -0
- package/dist/components/StyleInspector/categories/DisplayFlexChild/index.d.ts +3 -0
- package/dist/components/StyleInspector/categories/DisplayFlexChild/index.mjs +5 -0
- package/dist/components/StyleInspector/categories/Effects/BoxShadow/BoxShadow.d.ts +7 -0
- package/dist/components/StyleInspector/categories/Effects/BoxShadow/BoxShadow.mjs +37 -0
- package/dist/components/StyleInspector/categories/Effects/BoxShadow/BoxShadowItem.d.ts +8 -0
- package/dist/components/StyleInspector/categories/Effects/BoxShadow/BoxShadowItem.mjs +130 -0
- package/dist/components/StyleInspector/categories/Effects/BoxShadow/index.d.ts +3 -0
- package/dist/components/StyleInspector/categories/Effects/BoxShadow/index.mjs +5 -0
- package/dist/components/StyleInspector/categories/Effects/Effects.d.ts +7 -0
- package/dist/components/StyleInspector/categories/Effects/Effects.mjs +247 -0
- package/dist/components/StyleInspector/categories/Effects/Filters/Filter.d.ts +7 -0
- package/dist/components/StyleInspector/categories/Effects/Filters/Filter.mjs +37 -0
- package/dist/components/StyleInspector/categories/Effects/Filters/FilterItem.d.ts +8 -0
- package/dist/components/StyleInspector/categories/Effects/Filters/FilterItem.mjs +129 -0
- package/dist/components/StyleInspector/categories/Effects/Filters/index.d.ts +3 -0
- package/dist/components/StyleInspector/categories/Effects/Filters/index.mjs +5 -0
- package/dist/components/StyleInspector/categories/Effects/Transform/Transform.d.ts +7 -0
- package/dist/components/StyleInspector/categories/Effects/Transform/Transform.mjs +37 -0
- package/dist/components/StyleInspector/categories/Effects/Transform/TransformItem.d.ts +8 -0
- package/dist/components/StyleInspector/categories/Effects/Transform/TransformItem.mjs +148 -0
- package/dist/components/StyleInspector/categories/Effects/Transform/index.d.ts +3 -0
- package/dist/components/StyleInspector/categories/Effects/Transform/index.mjs +5 -0
- package/dist/components/StyleInspector/categories/Effects/Transition/Transition.d.ts +7 -0
- package/dist/components/StyleInspector/categories/Effects/Transition/Transition.mjs +41 -0
- package/dist/components/StyleInspector/categories/Effects/Transition/TransitionItem.d.ts +8 -0
- package/dist/components/StyleInspector/categories/Effects/Transition/TransitionItem.mjs +365 -0
- package/dist/components/StyleInspector/categories/Effects/Transition/index.d.ts +3 -0
- package/dist/components/StyleInspector/categories/Effects/Transition/index.mjs +5 -0
- package/dist/components/StyleInspector/categories/Effects/index.d.ts +3 -0
- package/dist/components/StyleInspector/categories/Effects/index.mjs +5 -0
- package/dist/components/StyleInspector/categories/List/List.d.ts +7 -0
- package/dist/components/StyleInspector/categories/List/List.mjs +82 -0
- package/dist/components/StyleInspector/categories/List/index.d.ts +3 -0
- package/dist/components/StyleInspector/categories/List/index.mjs +5 -0
- package/dist/components/StyleInspector/categories/ListItem/ListItem.d.ts +7 -0
- package/dist/components/StyleInspector/categories/ListItem/ListItem.mjs +82 -0
- package/dist/components/StyleInspector/categories/ListItem/index.d.ts +3 -0
- package/dist/components/StyleInspector/categories/ListItem/index.mjs +5 -0
- package/dist/components/StyleInspector/categories/Position/Position.d.ts +7 -0
- package/dist/components/StyleInspector/categories/Position/Position.mjs +129 -0
- package/dist/components/StyleInspector/categories/Position/PositionAdvanced.d.ts +7 -0
- package/dist/components/StyleInspector/categories/Position/PositionAdvanced.mjs +88 -0
- package/dist/components/StyleInspector/categories/Position/PositionAdvancedButtons.d.ts +7 -0
- package/dist/components/StyleInspector/categories/Position/PositionAdvancedButtons.mjs +132 -0
- package/dist/components/StyleInspector/categories/Position/PositionClear.d.ts +7 -0
- package/dist/components/StyleInspector/categories/Position/PositionClear.mjs +45 -0
- package/dist/components/StyleInspector/categories/Position/PositionFloat.d.ts +7 -0
- package/dist/components/StyleInspector/categories/Position/PositionFloat.mjs +38 -0
- package/dist/components/StyleInspector/categories/Position/index.d.ts +3 -0
- package/dist/components/StyleInspector/categories/Position/index.mjs +5 -0
- package/dist/components/StyleInspector/categories/RawStyle/RawStyle.d.ts +8 -0
- package/dist/components/StyleInspector/categories/RawStyle/RawStyle.mjs +27 -0
- package/dist/components/StyleInspector/categories/RawStyle/index.d.ts +3 -0
- package/dist/components/StyleInspector/categories/RawStyle/index.mjs +5 -0
- package/dist/components/StyleInspector/categories/Size/Size.d.ts +7 -0
- package/dist/components/StyleInspector/categories/Size/Size.mjs +101 -0
- package/dist/components/StyleInspector/categories/Size/SizeFit.d.ts +7 -0
- package/dist/components/StyleInspector/categories/Size/SizeFit.mjs +39 -0
- package/dist/components/StyleInspector/categories/Size/SizeOverflow.d.ts +7 -0
- package/dist/components/StyleInspector/categories/Size/SizeOverflow.mjs +49 -0
- package/dist/components/StyleInspector/categories/Size/SizePosition.d.ts +7 -0
- package/dist/components/StyleInspector/categories/Size/SizePosition.mjs +30 -0
- package/dist/components/StyleInspector/categories/Size/index.d.ts +3 -0
- package/dist/components/StyleInspector/categories/Size/index.mjs +5 -0
- package/dist/components/StyleInspector/categories/Spacing/Spacing.d.ts +7 -0
- package/dist/components/StyleInspector/categories/Spacing/Spacing.mjs +72 -0
- package/dist/components/StyleInspector/categories/Spacing/SpacingEditor.d.ts +8 -0
- package/dist/components/StyleInspector/categories/Spacing/SpacingEditor.mjs +155 -0
- package/dist/components/StyleInspector/categories/Spacing/SpacingMargin.d.ts +19 -0
- package/dist/components/StyleInspector/categories/Spacing/SpacingMargin.mjs +72 -0
- package/dist/components/StyleInspector/categories/Spacing/SpacingNumber.d.ts +8 -0
- package/dist/components/StyleInspector/categories/Spacing/SpacingNumber.mjs +17 -0
- package/dist/components/StyleInspector/categories/Spacing/SpacingPadding.d.ts +15 -0
- package/dist/components/StyleInspector/categories/Spacing/SpacingPadding.mjs +69 -0
- package/dist/components/StyleInspector/categories/Spacing/index.d.ts +3 -0
- package/dist/components/StyleInspector/categories/Spacing/index.mjs +5 -0
- package/dist/components/StyleInspector/categories/Typography/Typography.d.ts +11 -0
- package/dist/components/StyleInspector/categories/Typography/Typography.mjs +224 -0
- package/dist/components/StyleInspector/categories/Typography/TypographyAlign.d.ts +7 -0
- package/dist/components/StyleInspector/categories/Typography/TypographyAlign.mjs +41 -0
- package/dist/components/StyleInspector/categories/Typography/TypographyConstants.d.ts +5 -0
- package/dist/components/StyleInspector/categories/Typography/TypographyConstants.mjs +172 -0
- package/dist/components/StyleInspector/categories/Typography/TypographyFont.d.ts +10 -0
- package/dist/components/StyleInspector/categories/Typography/TypographyFont.mjs +22 -0
- package/dist/components/StyleInspector/categories/Typography/TypographyStyle.d.ts +8 -0
- package/dist/components/StyleInspector/categories/Typography/TypographyStyle.mjs +64 -0
- package/dist/components/StyleInspector/categories/Typography/TypographyTextShadow.d.ts +7 -0
- package/dist/components/StyleInspector/categories/Typography/TypographyTextShadow.mjs +43 -0
- package/dist/components/StyleInspector/categories/Typography/TypographyTextShadowItem.d.ts +8 -0
- package/dist/components/StyleInspector/categories/Typography/TypographyTextShadowItem.mjs +83 -0
- package/dist/components/StyleInspector/categories/Typography/TypographyTransform.d.ts +8 -0
- package/dist/components/StyleInspector/categories/Typography/TypographyTransform.mjs +68 -0
- package/dist/components/StyleInspector/categories/Typography/index.d.ts +3 -0
- package/dist/components/StyleInspector/categories/Typography/index.mjs +5 -0
- package/dist/components/StyleInspector/categories/Variables/Variables.d.ts +7 -0
- package/dist/components/StyleInspector/categories/Variables/Variables.mjs +55 -0
- package/dist/components/StyleInspector/categories/Variables/index.d.ts +3 -0
- package/dist/components/StyleInspector/categories/Variables/index.mjs +5 -0
- package/dist/components/StyleInspector/components/CategoryContainer/CategoryContainer.d.ts +13 -0
- package/dist/components/StyleInspector/components/CategoryContainer/CategoryContainer.mjs +27 -0
- package/dist/components/StyleInspector/components/CategoryContainer/index.d.ts +3 -0
- package/dist/components/StyleInspector/components/CategoryContainer/index.mjs +5 -0
- package/dist/components/StyleInspector/components/CategoryOption/CategoryOption.d.ts +39 -0
- package/dist/components/StyleInspector/components/CategoryOption/CategoryOption.mjs +30 -0
- package/dist/components/StyleInspector/components/CategoryOption/categoryTypes/OptionColor.d.ts +8 -0
- package/dist/components/StyleInspector/components/CategoryOption/categoryTypes/OptionColor.mjs +16 -0
- package/dist/components/StyleInspector/components/CategoryOption/categoryTypes/OptionIconGroup.d.ts +15 -0
- package/dist/components/StyleInspector/components/CategoryOption/categoryTypes/OptionIconGroup.mjs +27 -0
- package/dist/components/StyleInspector/components/CategoryOption/categoryTypes/OptionInput.d.ts +8 -0
- package/dist/components/StyleInspector/components/CategoryOption/categoryTypes/OptionInput.mjs +14 -0
- package/dist/components/StyleInspector/components/CategoryOption/categoryTypes/OptionMetricInput.d.ts +18 -0
- package/dist/components/StyleInspector/components/CategoryOption/categoryTypes/OptionMetricInput.mjs +69 -0
- package/dist/components/StyleInspector/components/CategoryOption/categoryTypes/OptionSelect.d.ts +10 -0
- package/dist/components/StyleInspector/components/CategoryOption/categoryTypes/OptionSelect.mjs +13 -0
- package/dist/components/StyleInspector/components/CategoryOption/index.d.ts +3 -0
- package/dist/components/StyleInspector/components/CategoryOption/index.mjs +5 -0
- package/dist/components/StyleInspector/components/CategorySection/CategorySection.d.ts +12 -0
- package/dist/components/StyleInspector/components/CategorySection/CategorySection.mjs +18 -0
- package/dist/components/StyleInspector/components/CategorySection/index.d.ts +3 -0
- package/dist/components/StyleInspector/components/CategorySection/index.mjs +5 -0
- package/dist/components/StyleInspector/components/InspectorDots/InspectorDots.d.ts +6 -0
- package/dist/components/StyleInspector/components/InspectorDots/InspectorDots.mjs +32 -0
- package/dist/components/StyleInspector/components/InspectorDots/index.d.ts +3 -0
- package/dist/components/StyleInspector/components/InspectorDots/index.mjs +5 -0
- package/dist/components/StyleInspector/components/InspectorLabel/InspectorLabel.d.ts +11 -0
- package/dist/components/StyleInspector/components/InspectorLabel/InspectorLabel.mjs +40 -0
- package/dist/components/StyleInspector/components/InspectorLabel/index.d.ts +3 -0
- package/dist/components/StyleInspector/components/InspectorLabel/index.mjs +5 -0
- package/dist/components/StyleInspector/hooks/useInspectorValues.d.ts +21 -0
- package/dist/components/StyleInspector/hooks/useInspectorValues.mjs +55 -0
- package/dist/components/StyleInspector/hooks/useStyleBinding.d.ts +6 -0
- package/dist/components/StyleInspector/hooks/useStyleBinding.mjs +20 -0
- package/dist/components/StyleInspector/hooks/useStyleInherit.d.ts +12 -0
- package/dist/components/StyleInspector/hooks/useStyleInherit.mjs +33 -0
- package/dist/components/StyleInspector/index.d.ts +3 -0
- package/dist/components/StyleInspector/index.mjs +5 -0
- package/dist/components/StyleManager/ManagerSelector.d.ts +11 -0
- package/dist/components/StyleManager/ManagerSelector.mjs +137 -0
- package/dist/components/StyleManager/StyleManager.d.ts +2 -0
- package/dist/components/StyleManager/StyleManager.mjs +47 -0
- package/dist/components/StyleManager/StyleSelectorTag.d.ts +12 -0
- package/dist/components/StyleManager/StyleSelectorTag.mjs +43 -0
- package/dist/components/StyleManager/index.d.ts +3 -0
- package/dist/components/StyleManager/index.mjs +5 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.mjs +6 -0
- package/dist/helpers/calculateInheriting.d.ts +121 -0
- package/dist/helpers/calculateInheriting.mjs +141 -0
- package/dist/helpers/formatCssFromSelector.d.ts +8 -0
- package/dist/helpers/formatCssFromSelector.mjs +54 -0
- package/dist/helpers/generateStyleSelector.d.ts +9 -0
- package/dist/helpers/generateStyleSelector.mjs +19 -0
- package/dist/helpers/index.d.ts +10 -0
- package/dist/helpers/index.mjs +18 -0
- package/dist/helpers/processCssTokens.d.ts +8 -0
- package/dist/helpers/processCssTokens.mjs +16 -0
- package/dist/helpers/processSelector.d.ts +4 -0
- package/dist/helpers/processSelector.mjs +39 -0
- package/dist/helpers/processSelectorAttributes.d.ts +17 -0
- package/dist/helpers/processSelectorAttributes.mjs +94 -0
- package/dist/helpers/processSelectorName.d.ts +3 -0
- package/dist/helpers/processSelectorName.mjs +19 -0
- package/dist/helpers/processSelectorVariables.d.ts +7 -0
- package/dist/helpers/processSelectorVariables.mjs +30 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.mjs +16 -0
- package/dist/models/SelectorForm/SelectorForm.d.ts +21 -0
- package/dist/models/SelectorForm/SelectorForm.mjs +73 -0
- package/dist/models/SelectorForm/index.d.ts +3 -0
- package/dist/models/SelectorForm/index.mjs +5 -0
- package/package.json +849 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import e from "../../../../components/CategoryOption/index.mjs";
|
|
2
|
+
import t from "../../../../components/CategorySection/index.mjs";
|
|
3
|
+
import { useCallback as n } from "react";
|
|
4
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/StyleInspector/categories/Background/components/BackgroundPosition/BackgroundPosition.tsx
|
|
6
|
+
var a = [
|
|
7
|
+
"center",
|
|
8
|
+
"top",
|
|
9
|
+
"right",
|
|
10
|
+
"bottom",
|
|
11
|
+
"left",
|
|
12
|
+
"auto"
|
|
13
|
+
], o = ({ layer: o, onChange: s }) => {
|
|
14
|
+
let c = n((e) => s?.({
|
|
15
|
+
...o,
|
|
16
|
+
positionX: String(e)
|
|
17
|
+
}), [o, s]), l = n((e) => s?.({
|
|
18
|
+
...o,
|
|
19
|
+
positionY: String(e)
|
|
20
|
+
}), [o, s]);
|
|
21
|
+
return /* @__PURE__ */ i(t, {
|
|
22
|
+
label: "Position",
|
|
23
|
+
children: [/* @__PURE__ */ r(e, {
|
|
24
|
+
label: "X",
|
|
25
|
+
type: "metric",
|
|
26
|
+
value: o.positionX,
|
|
27
|
+
allowedWords: a,
|
|
28
|
+
onChange: c
|
|
29
|
+
}), /* @__PURE__ */ r(e, {
|
|
30
|
+
label: "Y",
|
|
31
|
+
type: "metric",
|
|
32
|
+
value: o.positionY,
|
|
33
|
+
allowedWords: a,
|
|
34
|
+
onChange: l
|
|
35
|
+
})]
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
//#endregion
|
|
39
|
+
export { o as default };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BackgroundLayer } from '../../helpers/backgroundParser';
|
|
2
|
+
export type BackgroundSizeProps = {
|
|
3
|
+
layer: BackgroundLayer;
|
|
4
|
+
onChange?: (layer: BackgroundLayer) => void;
|
|
5
|
+
};
|
|
6
|
+
declare const BackgroundSize: ({ layer, onChange }: BackgroundSizeProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default BackgroundSize;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import e from "../../../../components/CategoryOption/index.mjs";
|
|
2
|
+
import t from "../../../../components/CategorySection/index.mjs";
|
|
3
|
+
import { useCallback as n, useMemo as r } from "react";
|
|
4
|
+
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/StyleInspector/categories/Background/components/BackgroundSize/BackgroundSize.tsx
|
|
6
|
+
var s = ({ layer: s, onChange: c }) => {
|
|
7
|
+
let l = s.size === "auto" || s.size.includes(" ") || /^\d/.test(s.size), u = r(() => s.size.includes(" ") ? s.size.split(" ") : ["auto", "auto"], [s.size]), d = n((e) => {
|
|
8
|
+
let t = String(e);
|
|
9
|
+
if (t === "cover" || t === "contain") c?.({
|
|
10
|
+
...s,
|
|
11
|
+
size: t
|
|
12
|
+
});
|
|
13
|
+
else {
|
|
14
|
+
let e = s.size;
|
|
15
|
+
c?.({
|
|
16
|
+
...s,
|
|
17
|
+
size: e === "cover" || e === "contain" ? "auto auto" : e
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
}, [s, c]), f = s.size === "cover" ? "cover" : s.size === "contain" ? "contain" : "auto", p = n((e) => c?.({
|
|
21
|
+
...s,
|
|
22
|
+
size: `${String(e)} ${u[1] ?? "auto"}`
|
|
23
|
+
}), [
|
|
24
|
+
s,
|
|
25
|
+
c,
|
|
26
|
+
u
|
|
27
|
+
]), m = n((e) => c?.({
|
|
28
|
+
...s,
|
|
29
|
+
size: `${u[0] ?? "auto"} ${String(e)}`
|
|
30
|
+
}), [
|
|
31
|
+
s,
|
|
32
|
+
c,
|
|
33
|
+
u
|
|
34
|
+
]);
|
|
35
|
+
return /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a(t, {
|
|
36
|
+
label: "Size",
|
|
37
|
+
children: /* @__PURE__ */ a(e, {
|
|
38
|
+
type: "iconGroup",
|
|
39
|
+
items: r(() => [
|
|
40
|
+
{
|
|
41
|
+
value: "auto",
|
|
42
|
+
icon: /* @__PURE__ */ a("div", {
|
|
43
|
+
className: "px-1 text-xs select-none",
|
|
44
|
+
children: "Custom"
|
|
45
|
+
}),
|
|
46
|
+
description: "Custom dimensions",
|
|
47
|
+
active: f === "auto",
|
|
48
|
+
size: "custom"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
value: "cover",
|
|
52
|
+
icon: /* @__PURE__ */ a("div", {
|
|
53
|
+
className: "px-1 text-xs select-none",
|
|
54
|
+
children: "Cover"
|
|
55
|
+
}),
|
|
56
|
+
description: "Cover the element",
|
|
57
|
+
active: f === "cover",
|
|
58
|
+
size: "custom"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
value: "contain",
|
|
62
|
+
icon: /* @__PURE__ */ a("div", {
|
|
63
|
+
className: "px-1 text-xs select-none",
|
|
64
|
+
children: "Contain"
|
|
65
|
+
}),
|
|
66
|
+
description: "Fit inside the element",
|
|
67
|
+
active: f === "contain",
|
|
68
|
+
size: "custom"
|
|
69
|
+
}
|
|
70
|
+
], [f]),
|
|
71
|
+
onChange: d
|
|
72
|
+
})
|
|
73
|
+
}), l && /* @__PURE__ */ o(t, { children: [/* @__PURE__ */ a(e, {
|
|
74
|
+
label: "W",
|
|
75
|
+
type: "metric",
|
|
76
|
+
value: u[0],
|
|
77
|
+
onChange: p
|
|
78
|
+
}), /* @__PURE__ */ a(e, {
|
|
79
|
+
label: "H",
|
|
80
|
+
type: "metric",
|
|
81
|
+
value: u[1],
|
|
82
|
+
onChange: m
|
|
83
|
+
})] })] });
|
|
84
|
+
};
|
|
85
|
+
//#endregion
|
|
86
|
+
export { s as default };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BackgroundLayer } from '../../helpers/backgroundParser';
|
|
2
|
+
export type BackgroundTileProps = {
|
|
3
|
+
layer: BackgroundLayer;
|
|
4
|
+
onChange?: (layer: BackgroundLayer) => void;
|
|
5
|
+
};
|
|
6
|
+
declare const BackgroundTile: ({ layer, onChange }: BackgroundTileProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default BackgroundTile;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import e from "../../../../components/CategoryOption/index.mjs";
|
|
2
|
+
import t from "../../../../components/CategorySection/index.mjs";
|
|
3
|
+
import { useCallback as n, useMemo as r } from "react";
|
|
4
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
5
|
+
import a from "@plitzi/plitzi-ui/icons/BackgroundTileX";
|
|
6
|
+
import o from "@plitzi/plitzi-ui/icons/BackgroundTileXY";
|
|
7
|
+
import s from "@plitzi/plitzi-ui/icons/BackgroundTileY";
|
|
8
|
+
import c from "@plitzi/plitzi-ui/icons/XMark";
|
|
9
|
+
//#region src/components/StyleInspector/categories/Background/components/BackgroundTile/BackgroundTile.tsx
|
|
10
|
+
var l = ({ layer: l, onChange: u }) => /* @__PURE__ */ i(t, {
|
|
11
|
+
label: "Tile",
|
|
12
|
+
children: /* @__PURE__ */ i(e, {
|
|
13
|
+
type: "iconGroup",
|
|
14
|
+
items: r(() => [
|
|
15
|
+
{
|
|
16
|
+
value: "repeat",
|
|
17
|
+
icon: /* @__PURE__ */ i(o, {}),
|
|
18
|
+
description: "Horizontally and Vertically",
|
|
19
|
+
active: l.repeat === "repeat"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
value: "repeat-x",
|
|
23
|
+
icon: /* @__PURE__ */ i(a, {}),
|
|
24
|
+
description: "Horizontally",
|
|
25
|
+
active: l.repeat === "repeat-x"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
value: "repeat-y",
|
|
29
|
+
icon: /* @__PURE__ */ i(s, {}),
|
|
30
|
+
description: "Vertically",
|
|
31
|
+
active: l.repeat === "repeat-y"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
value: "no-repeat",
|
|
35
|
+
icon: /* @__PURE__ */ i(c, {}),
|
|
36
|
+
description: "Don't tile",
|
|
37
|
+
active: l.repeat === "no-repeat"
|
|
38
|
+
}
|
|
39
|
+
], [l.repeat]),
|
|
40
|
+
onChange: n((e) => u?.({
|
|
41
|
+
...l,
|
|
42
|
+
repeat: String(e)
|
|
43
|
+
}), [l, u])
|
|
44
|
+
})
|
|
45
|
+
});
|
|
46
|
+
//#endregion
|
|
47
|
+
export { l as default };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MouseEvent } from 'react';
|
|
2
|
+
type GradientPreviewBarProps = {
|
|
3
|
+
gradientCSS: string;
|
|
4
|
+
onClick: (e: MouseEvent<HTMLDivElement>) => void;
|
|
5
|
+
};
|
|
6
|
+
declare const GradientPreviewBar: ({ gradientCSS, onClick }: GradientPreviewBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default GradientPreviewBar;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
2
|
+
//#region src/components/StyleInspector/categories/Background/components/GradientStopBar/GradientPreviewBar.tsx
|
|
3
|
+
var n = ({ gradientCSS: n, onClick: r }) => /* @__PURE__ */ t("div", {
|
|
4
|
+
className: "relative h-6 w-full cursor-crosshair overflow-hidden rounded-sm border border-gray-300 dark:border-zinc-600",
|
|
5
|
+
onClick: r,
|
|
6
|
+
title: "Click to add a color stop",
|
|
7
|
+
children: [/* @__PURE__ */ e("div", {
|
|
8
|
+
className: "absolute inset-0",
|
|
9
|
+
style: {
|
|
10
|
+
backgroundImage: "linear-gradient(45deg,#ccc 25%,transparent 25%),linear-gradient(-45deg,#ccc 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#ccc 75%),linear-gradient(-45deg,transparent 75%,#ccc 75%)",
|
|
11
|
+
backgroundSize: "10px 10px",
|
|
12
|
+
backgroundPosition: "0 0,0 5px,5px -5px,-5px 0"
|
|
13
|
+
}
|
|
14
|
+
}), /* @__PURE__ */ e("div", {
|
|
15
|
+
className: "absolute inset-0",
|
|
16
|
+
style: { background: n }
|
|
17
|
+
})]
|
|
18
|
+
});
|
|
19
|
+
//#endregion
|
|
20
|
+
export { n as default };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { GradientStop } from '../../helpers/backgroundParser';
|
|
2
|
+
export type GradientStopBarProps = {
|
|
3
|
+
stops: GradientStop[];
|
|
4
|
+
onChange?: (stops: GradientStop[]) => void;
|
|
5
|
+
};
|
|
6
|
+
declare const GradientStopBar: ({ stops, onChange }: GradientStopBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default GradientStopBar;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { newStopId as e } from "../../helpers/backgroundParser.mjs";
|
|
2
|
+
import t from "./GradientPreviewBar.mjs";
|
|
3
|
+
import n from "./GradientStopEditor.mjs";
|
|
4
|
+
import r from "./GradientStopTrack.mjs";
|
|
5
|
+
import i from "clsx";
|
|
6
|
+
import { useCallback as a, useMemo as o, useRef as s, useState as c } from "react";
|
|
7
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
8
|
+
import d from "@plitzi/plitzi-ui/Icon";
|
|
9
|
+
//#region src/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopBar.tsx
|
|
10
|
+
function f(e) {
|
|
11
|
+
let t = parseFloat(e);
|
|
12
|
+
return isNaN(t) ? 0 : Math.max(0, Math.min(100, t));
|
|
13
|
+
}
|
|
14
|
+
var p = ({ stops: p, onChange: m }) => {
|
|
15
|
+
let h = s(p);
|
|
16
|
+
h.current = p;
|
|
17
|
+
let [g, _] = c(p[0]?.id ?? ""), v = o(() => [...p].sort((e, t) => f(e.position) - f(t.position)), [p]), y = o(() => `linear-gradient(90deg, ${v.map((e) => e.position ? `${e.color} ${e.position}` : e.color).join(", ")})`, [v]), b = p.find((e) => e.id === g) ?? p[0], x = a((t) => {
|
|
18
|
+
let { left: n, width: r } = t.currentTarget.getBoundingClientRect(), i = Math.round(Math.max(0, Math.min(100, (t.clientX - n) / r * 100))), a = h.current, o = [...a].sort((e, t) => Math.abs(f(e.position) - i) - Math.abs(f(t.position) - i)).at(0), s = {
|
|
19
|
+
id: e(),
|
|
20
|
+
color: o?.color ?? "#808080",
|
|
21
|
+
position: `${i}%`
|
|
22
|
+
}, c = [...a, s].sort((e, t) => f(e.position) - f(t.position));
|
|
23
|
+
m?.(c), _(s.id);
|
|
24
|
+
}, [m]), S = a((e) => {
|
|
25
|
+
b && m?.(h.current.map((t) => t.id === b.id ? {
|
|
26
|
+
...t,
|
|
27
|
+
color: e
|
|
28
|
+
} : t));
|
|
29
|
+
}, [m, b]), C = a((e) => {
|
|
30
|
+
m?.(e.sort((e, t) => f(e.position) - f(t.position)));
|
|
31
|
+
}, [m]), w = a((e) => {
|
|
32
|
+
b && m?.(h.current.map((t) => t.id === b.id ? {
|
|
33
|
+
...t,
|
|
34
|
+
position: String(e)
|
|
35
|
+
} : t).sort((e, t) => f(e.position) - f(t.position)));
|
|
36
|
+
}, [m, b]), T = a(() => {
|
|
37
|
+
if (!b || h.current.length <= 2) return;
|
|
38
|
+
let e = h.current.filter((e) => e.id !== b.id);
|
|
39
|
+
m?.(e), _(e[0]?.id ?? "");
|
|
40
|
+
}, [m, b]), E = a(() => {
|
|
41
|
+
let t = {
|
|
42
|
+
id: e(),
|
|
43
|
+
color: "#808080",
|
|
44
|
+
position: "50%"
|
|
45
|
+
}, n = [...h.current, t].sort((e, t) => f(e.position) - f(t.position));
|
|
46
|
+
m?.(n), _(t.id);
|
|
47
|
+
}, [m]);
|
|
48
|
+
return /* @__PURE__ */ u("div", {
|
|
49
|
+
className: "flex flex-col gap-2",
|
|
50
|
+
children: [
|
|
51
|
+
/* @__PURE__ */ l(t, {
|
|
52
|
+
gradientCSS: y,
|
|
53
|
+
onClick: x
|
|
54
|
+
}),
|
|
55
|
+
/* @__PURE__ */ l("div", {
|
|
56
|
+
className: "flex px-2",
|
|
57
|
+
children: /* @__PURE__ */ l(r, {
|
|
58
|
+
stops: p,
|
|
59
|
+
selectedId: g,
|
|
60
|
+
onChange: C,
|
|
61
|
+
onSelect: _
|
|
62
|
+
})
|
|
63
|
+
}),
|
|
64
|
+
b && /* @__PURE__ */ l(n, {
|
|
65
|
+
stop: b,
|
|
66
|
+
showRemove: p.length > 2,
|
|
67
|
+
onColorChange: S,
|
|
68
|
+
onPositionChange: w,
|
|
69
|
+
onRemove: T
|
|
70
|
+
}),
|
|
71
|
+
/* @__PURE__ */ u("div", {
|
|
72
|
+
className: "flex flex-wrap gap-1",
|
|
73
|
+
children: [v.map((e) => /* @__PURE__ */ l("button", {
|
|
74
|
+
type: "button",
|
|
75
|
+
className: i("h-5 w-5 cursor-pointer rounded-sm border shadow-sm", g === e.id ? "border-blue-500 ring-1 ring-blue-300 dark:ring-blue-700" : "border-gray-300 hover:border-gray-400 dark:border-zinc-600"),
|
|
76
|
+
style: { backgroundColor: e.color },
|
|
77
|
+
onClick: () => _(e.id),
|
|
78
|
+
title: `${e.color} • ${e.position}`
|
|
79
|
+
}, e.id)), /* @__PURE__ */ l("button", {
|
|
80
|
+
type: "button",
|
|
81
|
+
className: "flex h-5 w-5 cursor-pointer items-center justify-center rounded-sm border border-dashed border-gray-300 text-gray-400 hover:border-blue-400 hover:text-blue-500 dark:border-zinc-600 dark:text-zinc-500",
|
|
82
|
+
title: "Add stop at 50%",
|
|
83
|
+
onClick: E,
|
|
84
|
+
children: /* @__PURE__ */ l(d, {
|
|
85
|
+
icon: "fas fa-plus",
|
|
86
|
+
size: "xs"
|
|
87
|
+
})
|
|
88
|
+
})]
|
|
89
|
+
})
|
|
90
|
+
]
|
|
91
|
+
});
|
|
92
|
+
};
|
|
93
|
+
//#endregion
|
|
94
|
+
export { p as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { GradientStop } from '../../helpers/backgroundParser';
|
|
2
|
+
type GradientStopEditorProps = {
|
|
3
|
+
stop: GradientStop;
|
|
4
|
+
showRemove: boolean;
|
|
5
|
+
onColorChange: (color: string) => void;
|
|
6
|
+
onPositionChange: (value: unknown) => void;
|
|
7
|
+
onRemove: () => void;
|
|
8
|
+
};
|
|
9
|
+
declare const GradientStopEditor: ({ stop, showRemove, onColorChange, onPositionChange, onRemove }: GradientStopEditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export default GradientStopEditor;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
2
|
+
import n from "@plitzi/plitzi-ui/Icon";
|
|
3
|
+
import r from "@plitzi/plitzi-ui/ColorPicker";
|
|
4
|
+
import i from "@plitzi/plitzi-ui/MetricInput";
|
|
5
|
+
//#region src/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopEditor.tsx
|
|
6
|
+
var a = ({ stop: a, showRemove: o, onColorChange: s, onPositionChange: c, onRemove: l }) => /* @__PURE__ */ t("div", {
|
|
7
|
+
className: "flex items-center gap-1.5 rounded border border-gray-200 bg-gray-50 p-1.5 dark:border-zinc-700 dark:bg-zinc-800/50",
|
|
8
|
+
children: [
|
|
9
|
+
/* @__PURE__ */ e("div", {
|
|
10
|
+
className: "min-w-0 flex-1",
|
|
11
|
+
children: /* @__PURE__ */ e(r, {
|
|
12
|
+
size: "xs",
|
|
13
|
+
className: { root: "w-full min-w-0" },
|
|
14
|
+
value: a.color,
|
|
15
|
+
allowVariables: !0,
|
|
16
|
+
showAlpha: !0,
|
|
17
|
+
onChange: s
|
|
18
|
+
})
|
|
19
|
+
}),
|
|
20
|
+
/* @__PURE__ */ e(i, {
|
|
21
|
+
size: "xs",
|
|
22
|
+
className: "w-20 shrink-0",
|
|
23
|
+
value: a.position,
|
|
24
|
+
units: [{
|
|
25
|
+
label: "%",
|
|
26
|
+
value: "%"
|
|
27
|
+
}, {
|
|
28
|
+
label: "PX",
|
|
29
|
+
value: "px"
|
|
30
|
+
}],
|
|
31
|
+
allowedWords: [],
|
|
32
|
+
min: Infinity,
|
|
33
|
+
onChange: c
|
|
34
|
+
}),
|
|
35
|
+
o && /* @__PURE__ */ e("button", {
|
|
36
|
+
type: "button",
|
|
37
|
+
className: "shrink-0 cursor-pointer rounded p-0.5 text-gray-400 hover:text-red-500 dark:text-zinc-500 dark:hover:text-red-400",
|
|
38
|
+
title: "Remove stop",
|
|
39
|
+
onClick: l,
|
|
40
|
+
children: /* @__PURE__ */ e(n, {
|
|
41
|
+
icon: "fas fa-times",
|
|
42
|
+
size: "xs"
|
|
43
|
+
})
|
|
44
|
+
})
|
|
45
|
+
]
|
|
46
|
+
});
|
|
47
|
+
//#endregion
|
|
48
|
+
export { a as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { GradientStop } from '../../helpers/backgroundParser';
|
|
2
|
+
import { RefObject } from 'react';
|
|
3
|
+
type GradientStopHandleProps = {
|
|
4
|
+
stop: GradientStop;
|
|
5
|
+
selected: boolean;
|
|
6
|
+
trackRef: RefObject<HTMLDivElement | null>;
|
|
7
|
+
onPositionChange: (stopId: string, pct: number) => void;
|
|
8
|
+
onSelect: (stopId: string) => void;
|
|
9
|
+
};
|
|
10
|
+
declare const GradientStopHandle: ({ stop, selected, trackRef, onPositionChange, onSelect }: GradientStopHandleProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export default GradientStopHandle;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import e from "../../helpers/normalizeLeft.mjs";
|
|
2
|
+
import t from "clsx";
|
|
3
|
+
import { useCallback as n, useLayoutEffect as r, useMemo as i, useRef as a } from "react";
|
|
4
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopHandle.tsx
|
|
6
|
+
var s = ({ stop: s, selected: c, trackRef: l, onPositionChange: u, onSelect: d }) => {
|
|
7
|
+
let f = a(null), p = a(!1), m = a(!1), h = i(() => e(s.position, (f.current?.parentNode)?.getBoundingClientRect().width ?? Infinity), [s.position]), g = n((e) => {
|
|
8
|
+
let t = l.current;
|
|
9
|
+
if (!t) return 0;
|
|
10
|
+
let { left: n, width: r } = t.getBoundingClientRect();
|
|
11
|
+
return Math.round(Math.max(0, Math.min(100, (e - n) / r * 100)));
|
|
12
|
+
}, [l]);
|
|
13
|
+
r(() => {
|
|
14
|
+
!p.current && f.current && (f.current.style.left = h);
|
|
15
|
+
}, [h]);
|
|
16
|
+
let _ = n((e) => {
|
|
17
|
+
e.preventDefault(), m.current = !1, p.current = !0, f.current?.setPointerCapture(e.pointerId), d(s.id);
|
|
18
|
+
}, [d, s.id]), v = n((e) => {
|
|
19
|
+
!p.current || !f.current || (m.current = !0, f.current.style.left = `${g(e.clientX)}%`);
|
|
20
|
+
}, [g]), y = n((e) => {
|
|
21
|
+
if (p.current && (p.current = !1, m.current && f.current)) {
|
|
22
|
+
let t = g(e.clientX);
|
|
23
|
+
f.current.style.left = `${t}%`, u(s.id, t);
|
|
24
|
+
}
|
|
25
|
+
}, [
|
|
26
|
+
g,
|
|
27
|
+
u,
|
|
28
|
+
s.id
|
|
29
|
+
]);
|
|
30
|
+
return /* @__PURE__ */ o("div", {
|
|
31
|
+
ref: f,
|
|
32
|
+
className: t("absolute top-1/2 h-4 w-4 -translate-x-1/2 -translate-y-1/2 cursor-grab rounded-full border-2 shadow-sm", c ? "z-10 border-blue-500 ring-1 ring-blue-300 dark:ring-blue-700" : "z-0 border-white hover:border-gray-300 dark:border-zinc-500"),
|
|
33
|
+
style: {
|
|
34
|
+
left: h,
|
|
35
|
+
backgroundColor: s.color
|
|
36
|
+
},
|
|
37
|
+
onPointerDown: _,
|
|
38
|
+
onPointerMove: v,
|
|
39
|
+
onPointerUp: y,
|
|
40
|
+
title: `${s.color} • ${s.position}`
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
//#endregion
|
|
44
|
+
export { s as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { GradientStop } from '../../helpers/backgroundParser';
|
|
2
|
+
type GradientStopTrackProps = {
|
|
3
|
+
stops: GradientStop[];
|
|
4
|
+
selectedId: string;
|
|
5
|
+
onChange?: (stops: GradientStop[]) => void;
|
|
6
|
+
onSelect: (id: string) => void;
|
|
7
|
+
};
|
|
8
|
+
declare const GradientStopTrack: ({ stops, selectedId, onChange, onSelect }: GradientStopTrackProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default GradientStopTrack;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import e from "./GradientStopHandle.mjs";
|
|
2
|
+
import { useCallback as t, useRef as n } from "react";
|
|
3
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopTrack.tsx
|
|
5
|
+
var a = ({ stops: a, selectedId: o, onChange: s, onSelect: c }) => {
|
|
6
|
+
let l = n(null), u = n(a);
|
|
7
|
+
u.current = a;
|
|
8
|
+
let d = t((e, t) => {
|
|
9
|
+
s?.(u.current.map((n) => n.id === e ? {
|
|
10
|
+
...n,
|
|
11
|
+
position: `${t}%`
|
|
12
|
+
} : n));
|
|
13
|
+
}, [s]);
|
|
14
|
+
return /* @__PURE__ */ i("div", {
|
|
15
|
+
ref: l,
|
|
16
|
+
className: "relative h-5 w-full select-none",
|
|
17
|
+
children: [/* @__PURE__ */ r("div", { className: "absolute top-1/2 right-0 left-0 h-px -translate-y-1/2 bg-gray-300 dark:bg-zinc-600" }), a.map((t) => /* @__PURE__ */ r(e, {
|
|
18
|
+
trackRef: l,
|
|
19
|
+
stop: t,
|
|
20
|
+
selected: o === t.id,
|
|
21
|
+
onPositionChange: d,
|
|
22
|
+
onSelect: c
|
|
23
|
+
}, t.id))]
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
//#endregion
|
|
27
|
+
export { a as default };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export type GradientStop = {
|
|
2
|
+
id: string;
|
|
3
|
+
color: string;
|
|
4
|
+
position: string;
|
|
5
|
+
};
|
|
6
|
+
export type BackgroundLayerType = 'none' | 'url' | 'linear-gradient' | 'radial-gradient' | 'conic-gradient';
|
|
7
|
+
export type BackgroundLayer = {
|
|
8
|
+
id: string;
|
|
9
|
+
type: BackgroundLayerType;
|
|
10
|
+
url: string;
|
|
11
|
+
angle: string;
|
|
12
|
+
radialShape: 'circle' | 'ellipse';
|
|
13
|
+
radialExtent: string;
|
|
14
|
+
radialPosition: string;
|
|
15
|
+
conicAngle: string;
|
|
16
|
+
conicPosition: string;
|
|
17
|
+
stops: GradientStop[];
|
|
18
|
+
size: string;
|
|
19
|
+
positionX: string;
|
|
20
|
+
positionY: string;
|
|
21
|
+
repeat: string;
|
|
22
|
+
attachment: string;
|
|
23
|
+
clip: string;
|
|
24
|
+
};
|
|
25
|
+
export declare const DEFAULT_STOPS: GradientStop[];
|
|
26
|
+
export declare const DEFAULT_LAYER_PROPS: {
|
|
27
|
+
url: string;
|
|
28
|
+
angle: string;
|
|
29
|
+
radialShape: "ellipse";
|
|
30
|
+
radialExtent: string;
|
|
31
|
+
radialPosition: string;
|
|
32
|
+
conicAngle: string;
|
|
33
|
+
conicPosition: string;
|
|
34
|
+
stops: GradientStop[];
|
|
35
|
+
size: string;
|
|
36
|
+
positionX: string;
|
|
37
|
+
positionY: string;
|
|
38
|
+
repeat: string;
|
|
39
|
+
attachment: string;
|
|
40
|
+
clip: string;
|
|
41
|
+
};
|
|
42
|
+
export declare const newLayerId: () => string;
|
|
43
|
+
export declare const newStopId: () => string;
|
|
44
|
+
export declare function splitTopLevelCommas(str: string): string[];
|
|
45
|
+
export type BackgroundCSSValues = {
|
|
46
|
+
'background-image'?: string;
|
|
47
|
+
'background-size'?: string;
|
|
48
|
+
'background-position'?: string;
|
|
49
|
+
'background-repeat'?: string;
|
|
50
|
+
'background-attachment'?: string;
|
|
51
|
+
'background-clip'?: string;
|
|
52
|
+
};
|
|
53
|
+
export declare function parseBackgroundLayers(values: BackgroundCSSValues): BackgroundLayer[];
|
|
54
|
+
export declare function serializeStop(stop: GradientStop): string;
|
|
55
|
+
export declare function serializeLayerImage(layer: BackgroundLayer): string;
|
|
56
|
+
export declare function serializeLayersToCSS(layers: BackgroundLayer[]): BackgroundCSSValues;
|