@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,201 @@
|
|
|
1
|
+
import e from "./Inspector.mjs";
|
|
2
|
+
import t from "../Selector/index.mjs";
|
|
3
|
+
import { get as n, pick as r, set as i } from "@plitzi/plitzi-ui/helpers";
|
|
4
|
+
import { clsx as a } from "clsx";
|
|
5
|
+
import { use as o, useCallback as s, useEffect as c, useMemo as l, useState as u } from "react";
|
|
6
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
7
|
+
import { createStoreHook as p } from "@plitzi/sdk-store/createStore";
|
|
8
|
+
import { produce as m } from "immer";
|
|
9
|
+
import h from "@plitzi/sdk-shared/builder/contexts/BuilderContext";
|
|
10
|
+
import g from "@plitzi/plitzi-ui/hooks/useDidUpdateEffect";
|
|
11
|
+
import _ from "@plitzi/plitzi-ui/Select";
|
|
12
|
+
import v from "@plitzi/plitzi-ui/Select2";
|
|
13
|
+
//#region src/components/StyleInspector/StyleInspector.tsx
|
|
14
|
+
var y = ({ displayMode: y, selectors: b, value: x, element: S, mode: C = "element", componentType: w, styleSelectors: T, styleSelectorsAvailables: E, componentSubTypesAvailables: D, allowStyleSelector: O = !0, allowStyleState: k = !0, allowStyleVariant: A = !0, onChange: j, onRemoveVariant: M }) => {
|
|
15
|
+
let { useStoreSync: N } = p(), [P, F] = u(void 0), [I, L] = u("base"), [R, z] = u(void 0), [B, V] = u(void 0);
|
|
16
|
+
N("styleSelector", I, { enabled: C === "element" }), N("styleVariant", R, { enabled: C === "element" }), N("styleState", B, { enabled: C === "element" });
|
|
17
|
+
let { builderHandler: H } = o(h), U = l(() => n(T, I, ""), [T, I]), W = l(() => Object.values(r(b ?? {}, S ? [S.definition.type, ...U.split(" ")] : U.split(" "))), [
|
|
18
|
+
b,
|
|
19
|
+
S,
|
|
20
|
+
U
|
|
21
|
+
]), G = l(() => x ? n(b, x) : void 0, [b, x]), K = l(() => Object.keys(G?.attributes[I]?.variants ?? {}).map((e) => ({
|
|
22
|
+
label: e,
|
|
23
|
+
value: e
|
|
24
|
+
})), [G?.attributes, I]);
|
|
25
|
+
c(() => {
|
|
26
|
+
if (L("base"), C !== "element") return;
|
|
27
|
+
let e = n(T, "base", "").split(" "), t = e[e.length - 1];
|
|
28
|
+
j?.(t || ""), V(void 0), F(void 0);
|
|
29
|
+
}, [j, T]), g(() => {
|
|
30
|
+
if (C === "element") {
|
|
31
|
+
if (x !== S?.definition.type) {
|
|
32
|
+
let e = n(T, I, "").split(" ");
|
|
33
|
+
j?.(e[e.length - 1]);
|
|
34
|
+
}
|
|
35
|
+
V(void 0), z(void 0), F(void 0);
|
|
36
|
+
}
|
|
37
|
+
}, [I]), g(() => {
|
|
38
|
+
V(void 0), z(void 0), F(void 0);
|
|
39
|
+
}, [x]);
|
|
40
|
+
let q = s((e, t, r) => {
|
|
41
|
+
if (t && !r) return;
|
|
42
|
+
let { name: i, type: a } = e;
|
|
43
|
+
!t && i !== "" && !b?.[i] ? H("styleAddSelector", y, i, a, void 0, void 0, {
|
|
44
|
+
styleSelector: I,
|
|
45
|
+
componentType: a === "element" ? w : void 0
|
|
46
|
+
}) : t && r && r.name !== i && b?.[r.name] && !b[i] && H("styleAddSelector", y, i, a, void 0, n(b, `${r.name}.attributes`, {}), {
|
|
47
|
+
styleSelector: I,
|
|
48
|
+
componentType: a === "element" ? w : void 0
|
|
49
|
+
});
|
|
50
|
+
}, [
|
|
51
|
+
H,
|
|
52
|
+
w,
|
|
53
|
+
y,
|
|
54
|
+
b,
|
|
55
|
+
I
|
|
56
|
+
]), J = s((e) => {
|
|
57
|
+
if (!e || x && x === e.name) {
|
|
58
|
+
j?.(void 0);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
j?.(e.name);
|
|
62
|
+
}, [j, x]), Y = s((e) => {
|
|
63
|
+
S && H("schemaUpdateElement", m(S, (t) => {
|
|
64
|
+
i(t, `definition.styleSelectors.${I}`, e);
|
|
65
|
+
}));
|
|
66
|
+
}, [
|
|
67
|
+
S,
|
|
68
|
+
H,
|
|
69
|
+
I
|
|
70
|
+
]), X = s((e) => {
|
|
71
|
+
H("styleRemoveSelector", y, e.name);
|
|
72
|
+
}, [H, y]), Z = s((e) => F(e), []), Q = s((e) => {
|
|
73
|
+
L(e);
|
|
74
|
+
}, []), $ = s((e) => V(e?.value), []), ee = s((e) => {
|
|
75
|
+
z(e?.value);
|
|
76
|
+
}, []), te = s((e) => {
|
|
77
|
+
M?.(e.value), B && V(void 0), e.value === R && z(void 0), H("styleUpdateSelector", y, G?.name, void 0, void 0, {
|
|
78
|
+
styleSelector: I,
|
|
79
|
+
styleVariant: e.value,
|
|
80
|
+
styleState: B,
|
|
81
|
+
componentType: G?.componentType
|
|
82
|
+
});
|
|
83
|
+
}, [
|
|
84
|
+
H,
|
|
85
|
+
y,
|
|
86
|
+
M,
|
|
87
|
+
G?.componentType,
|
|
88
|
+
G?.name,
|
|
89
|
+
I,
|
|
90
|
+
B,
|
|
91
|
+
R
|
|
92
|
+
]), ne = O && (A || k || !!E?.length || !!D?.length);
|
|
93
|
+
return /* @__PURE__ */ f("div", {
|
|
94
|
+
className: "flex w-full grow flex-col gap-2",
|
|
95
|
+
children: [/* @__PURE__ */ f("div", {
|
|
96
|
+
className: "flex w-full flex-col gap-2 px-1",
|
|
97
|
+
children: [C === "element" && /* @__PURE__ */ d(t, {
|
|
98
|
+
className: "min-h-0 w-full",
|
|
99
|
+
value: U,
|
|
100
|
+
selectors: b,
|
|
101
|
+
selector: G,
|
|
102
|
+
componentType: w,
|
|
103
|
+
onAdd: q,
|
|
104
|
+
onChange: Y,
|
|
105
|
+
onRemove: X,
|
|
106
|
+
onSelectorSelected: J
|
|
107
|
+
}), ne && /* @__PURE__ */ f("div", {
|
|
108
|
+
className: a("flex w-full items-center gap-2", { "mt-2": C === "manager" }),
|
|
109
|
+
children: [
|
|
110
|
+
!!D?.length && /* @__PURE__ */ d(_, {
|
|
111
|
+
className: "grow basis-0",
|
|
112
|
+
size: "xs",
|
|
113
|
+
value: P,
|
|
114
|
+
onChange: Z,
|
|
115
|
+
children: D.map((e) => /* @__PURE__ */ d("option", {
|
|
116
|
+
value: e,
|
|
117
|
+
children: e
|
|
118
|
+
}, e))
|
|
119
|
+
}),
|
|
120
|
+
E && E.length > 1 && /* @__PURE__ */ d(_, {
|
|
121
|
+
className: "grow basis-0",
|
|
122
|
+
size: "xs",
|
|
123
|
+
onChange: Q,
|
|
124
|
+
value: I,
|
|
125
|
+
children: E.map((e) => /* @__PURE__ */ d("option", {
|
|
126
|
+
value: e,
|
|
127
|
+
children: e
|
|
128
|
+
}, e))
|
|
129
|
+
}),
|
|
130
|
+
A && /* @__PURE__ */ d("div", {
|
|
131
|
+
className: "grow basis-0",
|
|
132
|
+
children: /* @__PURE__ */ d(v, {
|
|
133
|
+
className: "grow basis-0",
|
|
134
|
+
value: R,
|
|
135
|
+
options: K,
|
|
136
|
+
placeholder: "Variant",
|
|
137
|
+
size: "xs",
|
|
138
|
+
allowCreateOptions: !0,
|
|
139
|
+
allowRemoveOptions: !0,
|
|
140
|
+
clearable: !0,
|
|
141
|
+
onChange: ee,
|
|
142
|
+
onRemove: te
|
|
143
|
+
})
|
|
144
|
+
}),
|
|
145
|
+
k && /* @__PURE__ */ d("div", {
|
|
146
|
+
className: "grow basis-0",
|
|
147
|
+
children: /* @__PURE__ */ d(v, {
|
|
148
|
+
className: "grow basis-0",
|
|
149
|
+
value: B,
|
|
150
|
+
options: [
|
|
151
|
+
{
|
|
152
|
+
label: "Hover",
|
|
153
|
+
value: "hover"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
label: "Focus",
|
|
157
|
+
value: "focus"
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
label: "Active",
|
|
161
|
+
value: "active"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
label: "Disabled",
|
|
165
|
+
value: "disabled"
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
label: "checked",
|
|
169
|
+
value: "Checked"
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
label: "visited",
|
|
173
|
+
value: "Visited"
|
|
174
|
+
}
|
|
175
|
+
],
|
|
176
|
+
placeholder: "State",
|
|
177
|
+
size: "xs",
|
|
178
|
+
clearable: !0,
|
|
179
|
+
onChange: $
|
|
180
|
+
})
|
|
181
|
+
})
|
|
182
|
+
]
|
|
183
|
+
})]
|
|
184
|
+
}), /* @__PURE__ */ d("div", {
|
|
185
|
+
className: "flex grow basis-0 flex-col overflow-auto border-t border-gray-300 dark:border-zinc-700",
|
|
186
|
+
children: /* @__PURE__ */ d(e, {
|
|
187
|
+
selectors: W,
|
|
188
|
+
componentType: w,
|
|
189
|
+
selector: G,
|
|
190
|
+
styleSelector: I,
|
|
191
|
+
styleState: B,
|
|
192
|
+
styleVariant: R,
|
|
193
|
+
element: S,
|
|
194
|
+
displayMode: y,
|
|
195
|
+
mode: C
|
|
196
|
+
})
|
|
197
|
+
})]
|
|
198
|
+
});
|
|
199
|
+
};
|
|
200
|
+
//#endregion
|
|
201
|
+
export { y as default };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { InheritData } from '../../helpers';
|
|
2
|
+
import { DisplayMode, StyleCategory, StyleItem, StyleObject, StyleState, StyleValue } from '@plitzi/sdk-shared';
|
|
3
|
+
export type SetValues = {
|
|
4
|
+
(path?: undefined, values?: StyleObject): void;
|
|
5
|
+
(path: StyleCategory, values?: StyleValue): void;
|
|
6
|
+
};
|
|
7
|
+
export type StyleInspectorContextValue = {
|
|
8
|
+
componentType?: string;
|
|
9
|
+
selector?: StyleItem;
|
|
10
|
+
styleSelector: string;
|
|
11
|
+
styleState?: StyleState;
|
|
12
|
+
styleVariant?: string;
|
|
13
|
+
displayMode: DisplayMode;
|
|
14
|
+
variables: Record<string, unknown>;
|
|
15
|
+
inheritData: InheritData['style'];
|
|
16
|
+
bindingData: Partial<Record<StyleCategory, StyleValue>>;
|
|
17
|
+
getValues: () => Partial<Record<StyleCategory, StyleValue>>;
|
|
18
|
+
setValue: SetValues;
|
|
19
|
+
resetValue: (keys: StyleCategory | StyleCategory[]) => void;
|
|
20
|
+
getDefaultValue: (key?: StyleCategory[] | StyleCategory) => StyleValue | Record<StyleCategory, StyleValue>;
|
|
21
|
+
};
|
|
22
|
+
declare const StyleInspectorContext: import('react').Context<StyleInspectorContextValue>;
|
|
23
|
+
export default StyleInspectorContext;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { InheritData } from '../../helpers';
|
|
2
|
+
import { DisplayMode, Element, StyleCategory, StyleItem, StyleObject, StyleState, StyleValue } from '@plitzi/sdk-shared';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
export type StyleInspectorProviderProps = {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
componentType?: string;
|
|
7
|
+
selector?: StyleItem;
|
|
8
|
+
styleSelector?: string;
|
|
9
|
+
styleState?: StyleState;
|
|
10
|
+
styleVariant?: string;
|
|
11
|
+
element?: Element;
|
|
12
|
+
inheritData: InheritData;
|
|
13
|
+
displayMode: DisplayMode;
|
|
14
|
+
onChange?: (path?: StyleCategory, values?: StyleObject | StyleValue) => void;
|
|
15
|
+
};
|
|
16
|
+
declare const StyleInspectorProvider: ({ children, componentType, selector, styleSelector, styleState, styleVariant, element, inheritData, displayMode, onChange }: StyleInspectorProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export default StyleInspectorProvider;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import e from "./StyleInspectorContext.mjs";
|
|
2
|
+
import t from "./hooks/useStyleBinding.mjs";
|
|
3
|
+
import { get as n, omit as r } from "@plitzi/plitzi-ui/helpers";
|
|
4
|
+
import { use as i, useCallback as a, useMemo as o } from "react";
|
|
5
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
6
|
+
import { baseDefaultValue as c } from "@plitzi/sdk-shared";
|
|
7
|
+
import l from "@plitzi/sdk-shared/dataSource/DataSourceContext";
|
|
8
|
+
//#region src/components/StyleInspector/StyleInspectorProvider.tsx
|
|
9
|
+
var u = ({ children: u, componentType: d, selector: f, styleSelector: p = "base", styleState: m, styleVariant: h, element: g, inheritData: _, displayMode: v, onChange: y }) => {
|
|
10
|
+
let b = t({ element: g }), { useDataSource: x } = i(l), { variables: S } = x({
|
|
11
|
+
id: "",
|
|
12
|
+
mode: "read"
|
|
13
|
+
}), C = a(() => {
|
|
14
|
+
let e;
|
|
15
|
+
if (f && p && f.attributes[p]) {
|
|
16
|
+
let t = f.attributes[p];
|
|
17
|
+
e = m && h ? t.variants?.[h].states?.[m] ?? {} : h ? t.variants?.[h]?.default ?? {} : m ? t.states?.[m] ?? {} : t.default ?? {};
|
|
18
|
+
} else e = {};
|
|
19
|
+
return e;
|
|
20
|
+
}, [
|
|
21
|
+
f,
|
|
22
|
+
p,
|
|
23
|
+
m,
|
|
24
|
+
h
|
|
25
|
+
]), w = a((e, t) => {
|
|
26
|
+
if (!(e && typeof t != "string" && typeof t != "number" && t !== void 0 || !e && typeof t != "object" && t !== void 0 || e && n(b, e))) {
|
|
27
|
+
if (!e && t && typeof t == "object" && (t = r(t, Object.keys(b))), !e && f && typeof t == "object") {
|
|
28
|
+
let e = {
|
|
29
|
+
...C(),
|
|
30
|
+
...t
|
|
31
|
+
};
|
|
32
|
+
Object.keys(e).forEach((t) => {
|
|
33
|
+
e[t] === void 0 && delete e[t];
|
|
34
|
+
}), t = e;
|
|
35
|
+
}
|
|
36
|
+
y?.(e, t);
|
|
37
|
+
}
|
|
38
|
+
}, [
|
|
39
|
+
b,
|
|
40
|
+
C,
|
|
41
|
+
y,
|
|
42
|
+
f
|
|
43
|
+
]), T = a((e) => Array.isArray(e) ? e.reduce((e, t) => ({
|
|
44
|
+
...e,
|
|
45
|
+
[t]: n(c, t)
|
|
46
|
+
}), {}) : e ? n(c, e) : c, []), E = a((e) => {
|
|
47
|
+
Array.isArray(e) ? w(void 0, e.reduce((e, t) => ({
|
|
48
|
+
...e,
|
|
49
|
+
[t]: void 0
|
|
50
|
+
}), {})) : w(e);
|
|
51
|
+
}, [w]);
|
|
52
|
+
return /* @__PURE__ */ s(e, {
|
|
53
|
+
value: o(() => ({
|
|
54
|
+
componentType: d,
|
|
55
|
+
selector: f,
|
|
56
|
+
styleSelector: p,
|
|
57
|
+
styleState: m,
|
|
58
|
+
styleVariant: h,
|
|
59
|
+
displayMode: v,
|
|
60
|
+
variables: S,
|
|
61
|
+
inheritData: _.style,
|
|
62
|
+
bindingData: b,
|
|
63
|
+
getValues: C,
|
|
64
|
+
setValue: w,
|
|
65
|
+
resetValue: E,
|
|
66
|
+
getDefaultValue: T
|
|
67
|
+
}), [
|
|
68
|
+
d,
|
|
69
|
+
f,
|
|
70
|
+
p,
|
|
71
|
+
m,
|
|
72
|
+
h,
|
|
73
|
+
v,
|
|
74
|
+
S,
|
|
75
|
+
_.style,
|
|
76
|
+
b,
|
|
77
|
+
C,
|
|
78
|
+
w,
|
|
79
|
+
E,
|
|
80
|
+
T
|
|
81
|
+
]),
|
|
82
|
+
children: u
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
//#endregion
|
|
86
|
+
export { u as default };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type BackgroundProps = {
|
|
2
|
+
replaceTokens?: boolean;
|
|
3
|
+
isCollapsed?: boolean;
|
|
4
|
+
onCollapse?: (category: string, isCollapsed: boolean) => void;
|
|
5
|
+
};
|
|
6
|
+
declare const _default: import('react').MemoExoticComponent<({ replaceTokens, isCollapsed, onCollapse }: BackgroundProps) => import("react/jsx-runtime").JSX.Element>;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import e from "../../StyleInspectorContext.mjs";
|
|
2
|
+
import t from "../../hooks/useInspectorValues.mjs";
|
|
3
|
+
import n from "../../components/InspectorLabel/index.mjs";
|
|
4
|
+
import r from "../../components/CategoryOption/index.mjs";
|
|
5
|
+
import i from "../../components/CategorySection/index.mjs";
|
|
6
|
+
import { DEFAULT_LAYER_PROPS as a, DEFAULT_STOPS as o, newLayerId as s, newStopId as c, serializeLayersToCSS as l } from "./helpers/backgroundParser.mjs";
|
|
7
|
+
import u from "./components/BackgroundLayer/index.mjs";
|
|
8
|
+
import d from "../../components/CategoryContainer/index.mjs";
|
|
9
|
+
import f from "./helpers/parseToBgLayers.mjs";
|
|
10
|
+
import { memo as p, use as m, useCallback as h, useRef as g, useState as _ } from "react";
|
|
11
|
+
import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
12
|
+
import b from "@plitzi/plitzi-ui/hooks/useDidUpdateEffect";
|
|
13
|
+
//#region src/components/StyleInspector/categories/Background/Background.tsx
|
|
14
|
+
var x = [
|
|
15
|
+
"background-color",
|
|
16
|
+
"background-image",
|
|
17
|
+
"background-attachment",
|
|
18
|
+
"background-position",
|
|
19
|
+
"background-repeat",
|
|
20
|
+
"background-clip",
|
|
21
|
+
"background-size",
|
|
22
|
+
"mask-image"
|
|
23
|
+
], S = [
|
|
24
|
+
"background-image",
|
|
25
|
+
"background-size",
|
|
26
|
+
"background-position",
|
|
27
|
+
"background-repeat",
|
|
28
|
+
"background-attachment",
|
|
29
|
+
"background-clip"
|
|
30
|
+
], C = (e) => S.map((t) => String(e[t])).join("||"), w = p(({ replaceTokens: p = !1, isCollapsed: w = !0, onCollapse: T }) => {
|
|
31
|
+
let { setValue: E } = m(e), D = t({
|
|
32
|
+
keys: S,
|
|
33
|
+
asValue: !0,
|
|
34
|
+
strictMode: !0,
|
|
35
|
+
replaceTokens: p
|
|
36
|
+
}), { "background-color": O, "mask-image": k } = t({
|
|
37
|
+
keys: ["background-color", "mask-image"],
|
|
38
|
+
asValue: !0,
|
|
39
|
+
replaceTokens: p
|
|
40
|
+
}), A = C(D), j = g(D);
|
|
41
|
+
j.current = D;
|
|
42
|
+
let M = g(null), [N, P] = _(() => f(D));
|
|
43
|
+
b(() => {
|
|
44
|
+
A !== M.current && (P(f(j.current)), M.current = A);
|
|
45
|
+
}, [A]);
|
|
46
|
+
let [F, I] = _(null), L = h((e) => I((t) => t === e ? null : e), []), R = h((e) => {
|
|
47
|
+
let t = l(e);
|
|
48
|
+
M.current = C(t), P(e), E(void 0, t);
|
|
49
|
+
}, [E]), z = h((e, t) => {
|
|
50
|
+
if (e === t) return;
|
|
51
|
+
let n = [...N], [r] = n.splice(e, 1);
|
|
52
|
+
n.splice(t, 0, r), R(n);
|
|
53
|
+
}, [N, R]), B = h((e) => (t) => {
|
|
54
|
+
R(N.map((n, r) => r === e ? t : n));
|
|
55
|
+
}, [N, R]), V = h(() => {
|
|
56
|
+
let e = s(), t = {
|
|
57
|
+
...a,
|
|
58
|
+
id: e,
|
|
59
|
+
type: "linear-gradient",
|
|
60
|
+
stops: [{
|
|
61
|
+
id: c(),
|
|
62
|
+
color: o[0].color,
|
|
63
|
+
position: "0%"
|
|
64
|
+
}, {
|
|
65
|
+
id: c(),
|
|
66
|
+
color: o[1].color,
|
|
67
|
+
position: "100%"
|
|
68
|
+
}]
|
|
69
|
+
};
|
|
70
|
+
I(e), R([...N, t]);
|
|
71
|
+
}, [N, R]), H = h((e) => () => {
|
|
72
|
+
R(N.filter((t, n) => n !== e));
|
|
73
|
+
}, [N, R]), U = h((e) => {
|
|
74
|
+
E("background-color", e);
|
|
75
|
+
}, [E]), W = h((e) => {
|
|
76
|
+
E("mask-image", e);
|
|
77
|
+
}, [E]);
|
|
78
|
+
return /* @__PURE__ */ v(d, {
|
|
79
|
+
title: "Background",
|
|
80
|
+
dotKeys: x,
|
|
81
|
+
isCollapsed: w,
|
|
82
|
+
onCollapse: h((e) => T?.("background", e), [T]),
|
|
83
|
+
children: /* @__PURE__ */ y("div", {
|
|
84
|
+
className: "flex flex-col gap-2",
|
|
85
|
+
children: [
|
|
86
|
+
/* @__PURE__ */ y("div", {
|
|
87
|
+
className: "flex flex-col gap-1",
|
|
88
|
+
children: [
|
|
89
|
+
/* @__PURE__ */ y("div", {
|
|
90
|
+
className: "flex items-center justify-between",
|
|
91
|
+
children: [/* @__PURE__ */ v(n, {
|
|
92
|
+
keyValue: S,
|
|
93
|
+
children: "Layers"
|
|
94
|
+
}), /* @__PURE__ */ y("button", {
|
|
95
|
+
type: "button",
|
|
96
|
+
className: "flex cursor-pointer items-center gap-1 rounded px-1.5 py-0.5 text-xs text-blue-500 hover:bg-blue-50 hover:text-blue-700 dark:hover:bg-blue-900/30",
|
|
97
|
+
onClick: V,
|
|
98
|
+
title: "Add background layer",
|
|
99
|
+
children: [/* @__PURE__ */ v("i", { className: "fas fa-plus text-[10px]" }), "Add"]
|
|
100
|
+
})]
|
|
101
|
+
}),
|
|
102
|
+
!N.length && /* @__PURE__ */ v("div", {
|
|
103
|
+
className: "rounded border border-dashed border-gray-300 py-3 text-center text-xs text-gray-400 dark:border-zinc-600 dark:text-zinc-500",
|
|
104
|
+
children: "No layers — click Add to start"
|
|
105
|
+
}),
|
|
106
|
+
N.length > 0 && /* @__PURE__ */ v("div", {
|
|
107
|
+
className: "flex flex-col gap-1",
|
|
108
|
+
children: N.map((e, t) => /* @__PURE__ */ v(u, {
|
|
109
|
+
index: t,
|
|
110
|
+
layer: e,
|
|
111
|
+
expanded: F === e.id,
|
|
112
|
+
onExpand: L,
|
|
113
|
+
onChange: B(t),
|
|
114
|
+
onRemove: H(t),
|
|
115
|
+
onReorder: z
|
|
116
|
+
}, e.id))
|
|
117
|
+
})
|
|
118
|
+
]
|
|
119
|
+
}),
|
|
120
|
+
/* @__PURE__ */ v(i, {
|
|
121
|
+
label: "Base Color",
|
|
122
|
+
keys: ["background-color"],
|
|
123
|
+
children: /* @__PURE__ */ v(r, {
|
|
124
|
+
type: "color",
|
|
125
|
+
value: O,
|
|
126
|
+
onChange: U
|
|
127
|
+
})
|
|
128
|
+
}),
|
|
129
|
+
/* @__PURE__ */ v(i, {
|
|
130
|
+
label: "Mask",
|
|
131
|
+
keys: ["mask-image"],
|
|
132
|
+
children: /* @__PURE__ */ v(r, {
|
|
133
|
+
value: k,
|
|
134
|
+
onChange: W
|
|
135
|
+
})
|
|
136
|
+
})
|
|
137
|
+
]
|
|
138
|
+
})
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
//#endregion
|
|
142
|
+
export { w as default };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BackgroundLayer as BackgroundLayerType } from '../../helpers/backgroundParser';
|
|
2
|
+
export type BackgroundLayerProps = {
|
|
3
|
+
layer: BackgroundLayerType;
|
|
4
|
+
index: number;
|
|
5
|
+
expanded: boolean;
|
|
6
|
+
onExpand: (id: string) => void;
|
|
7
|
+
onChange: (layer: BackgroundLayerType) => void;
|
|
8
|
+
onRemove: () => void;
|
|
9
|
+
onReorder: (fromIndex: number, toIndex: number) => void;
|
|
10
|
+
};
|
|
11
|
+
declare const _default: import('react').MemoExoticComponent<({ layer, index, expanded, onExpand, onChange, onRemove, onReorder }: BackgroundLayerProps) => import("react/jsx-runtime").JSX.Element>;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import e from "../../../../components/CategoryOption/index.mjs";
|
|
2
|
+
import t from "../../../../components/CategorySection/index.mjs";
|
|
3
|
+
import { serializeLayerImage as n } from "../../helpers/backgroundParser.mjs";
|
|
4
|
+
import r from "../../modes/ConicGradientMode.mjs";
|
|
5
|
+
import i from "../../modes/ImageMode.mjs";
|
|
6
|
+
import a from "../../modes/LinearGradientMode.mjs";
|
|
7
|
+
import o from "../../modes/RadialGradientMode.mjs";
|
|
8
|
+
import s from "clsx";
|
|
9
|
+
import { memo as c, useCallback as l, useMemo as u, useState as d } from "react";
|
|
10
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
11
|
+
import m from "@plitzi/plitzi-ui/Icon";
|
|
12
|
+
//#region src/components/StyleInspector/categories/Background/components/BackgroundLayer/BackgroundLayer.tsx
|
|
13
|
+
var h = {
|
|
14
|
+
none: "None",
|
|
15
|
+
url: "Image",
|
|
16
|
+
"linear-gradient": "Linear Gradient",
|
|
17
|
+
"radial-gradient": "Radial Gradient",
|
|
18
|
+
"conic-gradient": "Conic Gradient"
|
|
19
|
+
}, g = [
|
|
20
|
+
{
|
|
21
|
+
value: "border-box",
|
|
22
|
+
label: "Border Box"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
value: "padding-box",
|
|
26
|
+
label: "Padding Box"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
value: "content-box",
|
|
30
|
+
label: "Content Box"
|
|
31
|
+
}
|
|
32
|
+
], _ = c(({ layer: c, index: _, expanded: v, onExpand: y, onChange: b, onRemove: x, onReorder: S }) => {
|
|
33
|
+
let [C, w] = d(!1), T = u(() => n(c), [c]), E = l((e) => {
|
|
34
|
+
let t = String(e);
|
|
35
|
+
b({
|
|
36
|
+
...c,
|
|
37
|
+
type: t
|
|
38
|
+
});
|
|
39
|
+
}, [c, b]), D = l(() => y(c.id), [y, c.id]), O = l((e) => b({
|
|
40
|
+
...c,
|
|
41
|
+
clip: String(e)
|
|
42
|
+
}), [c, b]), k = l((e) => {
|
|
43
|
+
e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData("text/plain", String(_));
|
|
44
|
+
}, [_]), A = l(() => {
|
|
45
|
+
w(!1);
|
|
46
|
+
}, []), j = l((e) => {
|
|
47
|
+
e.preventDefault(), w(!0);
|
|
48
|
+
}, []), M = l((e) => {
|
|
49
|
+
e.currentTarget.contains(e.relatedTarget) || w(!1);
|
|
50
|
+
}, []), N = l((e) => {
|
|
51
|
+
e.preventDefault(), w(!1);
|
|
52
|
+
let t = parseInt(e.dataTransfer.getData("text/plain"), 10);
|
|
53
|
+
isNaN(t) || S(t, _);
|
|
54
|
+
}, [_, S]);
|
|
55
|
+
return /* @__PURE__ */ p("div", {
|
|
56
|
+
className: s("rounded-sm border transition-colors", {
|
|
57
|
+
"border-blue-400 bg-blue-50 dark:border-blue-500 dark:bg-blue-900/20": C,
|
|
58
|
+
"border-gray-200 dark:border-zinc-700": !C
|
|
59
|
+
}),
|
|
60
|
+
onDragOver: j,
|
|
61
|
+
onDragLeave: M,
|
|
62
|
+
onDrop: N,
|
|
63
|
+
children: [/* @__PURE__ */ p("div", {
|
|
64
|
+
className: "flex h-8 items-center gap-1 px-1",
|
|
65
|
+
children: [
|
|
66
|
+
/* @__PURE__ */ f("span", {
|
|
67
|
+
draggable: !0,
|
|
68
|
+
className: "cursor-grab px-1 text-gray-400 hover:text-gray-600 active:cursor-grabbing dark:text-zinc-500 dark:hover:text-zinc-300",
|
|
69
|
+
onDragStart: k,
|
|
70
|
+
onDragEnd: A,
|
|
71
|
+
children: /* @__PURE__ */ f(m, {
|
|
72
|
+
icon: "fa-solid fa-grip-lines",
|
|
73
|
+
size: "xs"
|
|
74
|
+
})
|
|
75
|
+
}),
|
|
76
|
+
c.type !== "none" && /* @__PURE__ */ f("div", {
|
|
77
|
+
className: "h-4 w-4 shrink-0 rounded-sm border border-gray-300 dark:border-zinc-600",
|
|
78
|
+
style: { background: T }
|
|
79
|
+
}),
|
|
80
|
+
/* @__PURE__ */ f("span", {
|
|
81
|
+
className: "flex-1 truncate text-xs text-gray-600 dark:text-zinc-400",
|
|
82
|
+
children: h[c.type]
|
|
83
|
+
}),
|
|
84
|
+
/* @__PURE__ */ f("button", {
|
|
85
|
+
type: "button",
|
|
86
|
+
className: "cursor-pointer p-1 text-gray-400 hover:text-gray-600 dark:text-zinc-500 dark:hover:text-zinc-300",
|
|
87
|
+
onClick: D,
|
|
88
|
+
title: v ? "Collapse" : "Expand",
|
|
89
|
+
children: /* @__PURE__ */ f(m, {
|
|
90
|
+
icon: v ? "fa-solid fa-angle-up" : "fa-solid fa-angle-down",
|
|
91
|
+
size: "xs"
|
|
92
|
+
})
|
|
93
|
+
}),
|
|
94
|
+
/* @__PURE__ */ f("button", {
|
|
95
|
+
type: "button",
|
|
96
|
+
className: "cursor-pointer p-1 text-gray-400 hover:text-red-500 dark:text-zinc-500 dark:hover:text-red-400",
|
|
97
|
+
onClick: x,
|
|
98
|
+
title: "Remove layer",
|
|
99
|
+
children: /* @__PURE__ */ f(m, {
|
|
100
|
+
icon: "fas fa-times",
|
|
101
|
+
size: "xs"
|
|
102
|
+
})
|
|
103
|
+
})
|
|
104
|
+
]
|
|
105
|
+
}), v && /* @__PURE__ */ p("div", {
|
|
106
|
+
className: "flex flex-col gap-2 border-t border-gray-200 p-2 dark:border-zinc-700",
|
|
107
|
+
children: [
|
|
108
|
+
/* @__PURE__ */ f(t, {
|
|
109
|
+
label: "Type",
|
|
110
|
+
children: /* @__PURE__ */ p(e, {
|
|
111
|
+
type: "select",
|
|
112
|
+
value: c.type,
|
|
113
|
+
onChange: E,
|
|
114
|
+
children: [
|
|
115
|
+
/* @__PURE__ */ f("option", {
|
|
116
|
+
value: "linear-gradient",
|
|
117
|
+
children: "Linear Gradient"
|
|
118
|
+
}),
|
|
119
|
+
/* @__PURE__ */ f("option", {
|
|
120
|
+
value: "radial-gradient",
|
|
121
|
+
children: "Radial Gradient"
|
|
122
|
+
}),
|
|
123
|
+
/* @__PURE__ */ f("option", {
|
|
124
|
+
value: "conic-gradient",
|
|
125
|
+
children: "Conic Gradient"
|
|
126
|
+
}),
|
|
127
|
+
/* @__PURE__ */ f("option", {
|
|
128
|
+
value: "url",
|
|
129
|
+
children: "Image URL"
|
|
130
|
+
}),
|
|
131
|
+
/* @__PURE__ */ f("option", {
|
|
132
|
+
value: "none",
|
|
133
|
+
children: "None"
|
|
134
|
+
})
|
|
135
|
+
]
|
|
136
|
+
})
|
|
137
|
+
}),
|
|
138
|
+
c.type === "url" && /* @__PURE__ */ f(i, {
|
|
139
|
+
layer: c,
|
|
140
|
+
onChange: b
|
|
141
|
+
}),
|
|
142
|
+
c.type === "linear-gradient" && /* @__PURE__ */ f(a, {
|
|
143
|
+
layer: c,
|
|
144
|
+
onChange: b
|
|
145
|
+
}),
|
|
146
|
+
c.type === "radial-gradient" && /* @__PURE__ */ f(o, {
|
|
147
|
+
layer: c,
|
|
148
|
+
onChange: b
|
|
149
|
+
}),
|
|
150
|
+
c.type === "conic-gradient" && /* @__PURE__ */ f(r, {
|
|
151
|
+
layer: c,
|
|
152
|
+
onChange: b
|
|
153
|
+
}),
|
|
154
|
+
c.type !== "none" && /* @__PURE__ */ f(t, {
|
|
155
|
+
label: "Clip",
|
|
156
|
+
children: /* @__PURE__ */ f(e, {
|
|
157
|
+
type: "select",
|
|
158
|
+
value: c.clip,
|
|
159
|
+
onChange: O,
|
|
160
|
+
children: g.map((e) => /* @__PURE__ */ f("option", {
|
|
161
|
+
value: e.value,
|
|
162
|
+
children: e.label
|
|
163
|
+
}, e.value))
|
|
164
|
+
})
|
|
165
|
+
})
|
|
166
|
+
]
|
|
167
|
+
})]
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
//#endregion
|
|
171
|
+
export { _ as default };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BackgroundLayer } from '../../helpers/backgroundParser';
|
|
2
|
+
export type BackgroundPositionProps = {
|
|
3
|
+
layer: BackgroundLayer;
|
|
4
|
+
onChange?: (layer: BackgroundLayer) => void;
|
|
5
|
+
};
|
|
6
|
+
declare const BackgroundPosition: ({ layer, onChange }: BackgroundPositionProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default BackgroundPosition;
|