@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,121 @@
|
|
|
1
|
+
import { ComponentDefinition, DisplayMode, Element, Schema, Style, StyleItem, StyleState, StyleValue } from '@plitzi/sdk-shared';
|
|
2
|
+
export type InheritData = {
|
|
3
|
+
tree: {
|
|
4
|
+
name: string;
|
|
5
|
+
displayMode: DisplayMode;
|
|
6
|
+
attributes: StyleItem['attributes'];
|
|
7
|
+
componentType?: string;
|
|
8
|
+
isDefault?: boolean;
|
|
9
|
+
isParent: boolean;
|
|
10
|
+
isAncestor: boolean;
|
|
11
|
+
}[];
|
|
12
|
+
style: Record<string, {
|
|
13
|
+
key: string;
|
|
14
|
+
value: StyleValue;
|
|
15
|
+
displayMode: DisplayMode;
|
|
16
|
+
}[]>;
|
|
17
|
+
parentStyle: Record<string, string>;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* ============================================================
|
|
21
|
+
* 🧠 STYLE INHERITANCE FLOW (calculateInheriting)
|
|
22
|
+
* ============================================================
|
|
23
|
+
*
|
|
24
|
+
* 🌳 HIERARCHY (top → bottom priority)
|
|
25
|
+
*
|
|
26
|
+
* Ancestors
|
|
27
|
+
* ↓
|
|
28
|
+
* Parent
|
|
29
|
+
* ↓
|
|
30
|
+
* Current Element
|
|
31
|
+
* ↓
|
|
32
|
+
* DefaultStyle (componentDefinition fallback)
|
|
33
|
+
*
|
|
34
|
+
*
|
|
35
|
+
* 🎯 SOURCE RESOLUTION (per node)
|
|
36
|
+
*
|
|
37
|
+
* styleSelectors (e.g. "btn card")
|
|
38
|
+
* ↓
|
|
39
|
+
* StyleItem.attributes
|
|
40
|
+
* ↓
|
|
41
|
+
* resolveStyleBlock()
|
|
42
|
+
*
|
|
43
|
+
*
|
|
44
|
+
* 🔥 STYLE LAYERING (inside a single StyleBlock)
|
|
45
|
+
*
|
|
46
|
+
* base.default
|
|
47
|
+
* ↓
|
|
48
|
+
* variant.default
|
|
49
|
+
* ↓
|
|
50
|
+
* state
|
|
51
|
+
* ↓
|
|
52
|
+
* variant.state
|
|
53
|
+
*
|
|
54
|
+
* Final:
|
|
55
|
+
*
|
|
56
|
+
* {
|
|
57
|
+
* ...base,
|
|
58
|
+
* ...variant,
|
|
59
|
+
* ...state,
|
|
60
|
+
* ...variantState
|
|
61
|
+
* }
|
|
62
|
+
*
|
|
63
|
+
*
|
|
64
|
+
* 🧩 FINAL MERGE (global result)
|
|
65
|
+
*
|
|
66
|
+
* for each node in tree:
|
|
67
|
+
*
|
|
68
|
+
* style = resolveNodeStyle(node)
|
|
69
|
+
*
|
|
70
|
+
* if node.isAncestor:
|
|
71
|
+
* style = pick(inheritableAttributesBase)
|
|
72
|
+
*
|
|
73
|
+
* for each key in style:
|
|
74
|
+
* finalStyle[key].push({
|
|
75
|
+
* value,
|
|
76
|
+
* source: node.name,
|
|
77
|
+
* displayMode
|
|
78
|
+
* })
|
|
79
|
+
*
|
|
80
|
+
*
|
|
81
|
+
* ⚠️ PRIORITY RULES
|
|
82
|
+
*
|
|
83
|
+
* Between nodes:
|
|
84
|
+
* ancestor < parent < current
|
|
85
|
+
*
|
|
86
|
+
* Inside a node:
|
|
87
|
+
* base < variant < state < variant+state
|
|
88
|
+
*
|
|
89
|
+
*
|
|
90
|
+
* 📱 DISPLAY MODES
|
|
91
|
+
*
|
|
92
|
+
* Current order:
|
|
93
|
+
* desktop → tablet → mobile
|
|
94
|
+
*
|
|
95
|
+
* (Can be extended to support:
|
|
96
|
+
* mobile-first or desktop-first)
|
|
97
|
+
*
|
|
98
|
+
*
|
|
99
|
+
* 🚀 RESULT
|
|
100
|
+
*
|
|
101
|
+
* finalStyle = {
|
|
102
|
+
* color: [
|
|
103
|
+
* { value: 'red', source: 'btn', displayMode: 'desktop' },
|
|
104
|
+
* { value: 'blue', source: 'btn', displayMode: 'tablet' }
|
|
105
|
+
* ]
|
|
106
|
+
* }
|
|
107
|
+
*
|
|
108
|
+
* parentStyle = merged styles from direct parent only
|
|
109
|
+
*
|
|
110
|
+
* ============================================================
|
|
111
|
+
*/
|
|
112
|
+
declare const calculateInheriting: (element: Element | undefined, componentType: string | undefined, flat: Schema["flat"], platform: Style["platform"], componentDefinitions?: Record<string, ComponentDefinition>, params?: {
|
|
113
|
+
componentSubType?: string;
|
|
114
|
+
styleSelector?: string;
|
|
115
|
+
styleState?: StyleState;
|
|
116
|
+
styleVariant?: string;
|
|
117
|
+
includeSelf?: boolean;
|
|
118
|
+
skipSelectors?: string[];
|
|
119
|
+
addSelectors?: string[];
|
|
120
|
+
}) => InheritData;
|
|
121
|
+
export default calculateInheriting;
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { get as e, pick as t } from "@plitzi/plitzi-ui/helpers";
|
|
2
|
+
import { inheritableAttributesBase as n } from "@plitzi/sdk-shared/style";
|
|
3
|
+
//#region src/helpers/calculateInheriting.ts
|
|
4
|
+
var r = (e, t) => {
|
|
5
|
+
let n = [], r = t;
|
|
6
|
+
for (; r;) {
|
|
7
|
+
n.push(r);
|
|
8
|
+
let t = r.definition.parentId;
|
|
9
|
+
r = t ? e[t] : void 0;
|
|
10
|
+
}
|
|
11
|
+
return n;
|
|
12
|
+
}, i = (e, t, n, r, i) => {
|
|
13
|
+
let a = [], o = /* @__PURE__ */ new Set(), { definition: { styleSelectors: s, type: c }, attributes: { subType: l } } = e, u = (s[r] || "").split(" ").filter(Boolean);
|
|
14
|
+
for (let e of [...u, ...i]) {
|
|
15
|
+
if (o.has(e)) continue;
|
|
16
|
+
let t = n[e];
|
|
17
|
+
t?.name && (o.add(e), a.push(t));
|
|
18
|
+
}
|
|
19
|
+
if (t) {
|
|
20
|
+
for (let e of Object.values(n)) if (e.type === "element" && e.componentType === t && e.name) {
|
|
21
|
+
if (o.has(e.name)) continue;
|
|
22
|
+
o.add(e.name), a.push(e);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
let d = n[c];
|
|
26
|
+
if (d && d.name && !["class", "element"].includes(d.type) && (o.has(d.name) || (o.add(d.name), a.push(d))), l) {
|
|
27
|
+
let e = n[l];
|
|
28
|
+
e && e.name && !["class", "element"].includes(e.type) && (o.has(e.name) || (o.add(e.name), a.push(e)));
|
|
29
|
+
}
|
|
30
|
+
return a;
|
|
31
|
+
}, a = (t, n, r, i) => {
|
|
32
|
+
let a = e(i, `${t}.defaultStyle`, void 0);
|
|
33
|
+
if (a) return a.subTypes && !n && (n = Object.keys(a.subTypes)[0]), n && a.subTypes?.[n] && (a = a.subTypes[n]), {
|
|
34
|
+
name: "defaultStyle",
|
|
35
|
+
attributes: { [r]: e(a, `style.${r}`, {}) },
|
|
36
|
+
componentType: t,
|
|
37
|
+
isParent: !1,
|
|
38
|
+
isAncestor: !1,
|
|
39
|
+
isDefault: !0
|
|
40
|
+
};
|
|
41
|
+
}, o = (e, t, n, r) => {
|
|
42
|
+
let i = e[t];
|
|
43
|
+
if (!i) return {};
|
|
44
|
+
let a = i.default ?? {}, o = r ? i.variants?.[r]?.default ?? {} : {}, s = n ? i.states?.[n] ?? {} : {}, c = r && n ? i.variants?.[r]?.states?.[n] ?? {} : {};
|
|
45
|
+
return {
|
|
46
|
+
...a,
|
|
47
|
+
...o,
|
|
48
|
+
...s,
|
|
49
|
+
...c
|
|
50
|
+
};
|
|
51
|
+
}, s = (e, t, n, r) => o(e.attributes, t, n, r), c = (e, o, c, l, u = {}, d = {}) => {
|
|
52
|
+
let { componentSubType: f, styleSelector: p = "base", styleState: m, styleVariant: h, includeSelf: g = !1, skipSelectors: _ = [], addSelectors: v = [] } = d, y = {
|
|
53
|
+
tree: [],
|
|
54
|
+
style: {},
|
|
55
|
+
parentStyle: {}
|
|
56
|
+
}, b = e ? r(c, e) : [], x = /* @__PURE__ */ new Set();
|
|
57
|
+
for (let t of Object.keys(l)) {
|
|
58
|
+
let n = l[t];
|
|
59
|
+
if (n) {
|
|
60
|
+
if (!e && !o) {
|
|
61
|
+
for (let e of v) {
|
|
62
|
+
let r = n[e];
|
|
63
|
+
r && y.tree.push({
|
|
64
|
+
name: e,
|
|
65
|
+
displayMode: t,
|
|
66
|
+
attributes: r.attributes,
|
|
67
|
+
isParent: !1,
|
|
68
|
+
isAncestor: !1
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
if (!e && o) {
|
|
74
|
+
let e = i({
|
|
75
|
+
definition: {
|
|
76
|
+
type: o,
|
|
77
|
+
styleSelectors: {},
|
|
78
|
+
parentId: void 0
|
|
79
|
+
},
|
|
80
|
+
attributes: {}
|
|
81
|
+
}, o, n, p, v);
|
|
82
|
+
for (let n of e) _.includes(n.name) || y.tree.push({
|
|
83
|
+
name: n.name,
|
|
84
|
+
displayMode: t,
|
|
85
|
+
attributes: n.attributes,
|
|
86
|
+
isParent: !1,
|
|
87
|
+
isAncestor: !1
|
|
88
|
+
});
|
|
89
|
+
let r = a(o, f, p, u);
|
|
90
|
+
r && y.tree.push({
|
|
91
|
+
...r,
|
|
92
|
+
displayMode: t
|
|
93
|
+
});
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
for (let r of b) {
|
|
97
|
+
let s = e?.definition.parentId === r.id, c = r.id !== e?.id, l = i(r, r.definition.type === o ? o : void 0, n, p, v);
|
|
98
|
+
!g && !c && !m && !h && Object.keys(l).length && (l = l.filter((e) => e.type === "element"));
|
|
99
|
+
for (let e of l) _.includes(e.name) && !c || y.tree.push({
|
|
100
|
+
name: e.name,
|
|
101
|
+
displayMode: t,
|
|
102
|
+
attributes: e.attributes,
|
|
103
|
+
componentType: e.componentType,
|
|
104
|
+
isParent: s,
|
|
105
|
+
isAncestor: c,
|
|
106
|
+
isDefault: !1
|
|
107
|
+
});
|
|
108
|
+
let d = a(r.definition.type, r.attributes.subType, p, u);
|
|
109
|
+
d && !x.has(r.definition.type) && (x.add(r.definition.type), y.tree.push({
|
|
110
|
+
...d,
|
|
111
|
+
displayMode: t,
|
|
112
|
+
isParent: s,
|
|
113
|
+
isAncestor: !1
|
|
114
|
+
}));
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
let S = {};
|
|
119
|
+
for (let e of y.tree) {
|
|
120
|
+
let r = s(e, p, m, h);
|
|
121
|
+
if (r) {
|
|
122
|
+
e.isAncestor && (r = t(r, n));
|
|
123
|
+
for (let t of Object.keys(r)) e.isAncestor && !n.includes(t) || (S[t] || (S[t] = []), S[t].push({
|
|
124
|
+
key: e.name,
|
|
125
|
+
value: r[t],
|
|
126
|
+
displayMode: e.displayMode
|
|
127
|
+
}));
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
let C = y.tree.filter((e) => e.isParent).reduce((e, t) => ({
|
|
131
|
+
...e,
|
|
132
|
+
...s(t, p, m, h)
|
|
133
|
+
}), {});
|
|
134
|
+
return {
|
|
135
|
+
...y,
|
|
136
|
+
style: S,
|
|
137
|
+
parentStyle: C
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
//#endregion
|
|
141
|
+
export { c as default };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { StyleItem } from '@plitzi/sdk-shared';
|
|
2
|
+
type StyleBasicItem = Omit<StyleItem, 'type' | 'cache'>;
|
|
3
|
+
export declare function cssToSelectors(css?: string): Record<string, StyleBasicItem>;
|
|
4
|
+
export declare const getReadOnlyRangesFromContent: (doc?: string) => {
|
|
5
|
+
from: number;
|
|
6
|
+
to: number;
|
|
7
|
+
}[];
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { set as e } from "@plitzi/plitzi-ui/helpers";
|
|
2
|
+
import { styleConstants as t } from "@plitzi/sdk-shared";
|
|
3
|
+
//#region src/helpers/formatCssFromSelector.ts
|
|
4
|
+
var n = /@media[^{]*\{(?:[^{}]*|\{[^{}]*\})*\}/gim, r = /(?<selector>\.|#|)(?<selectorName>[a-z0-9_-]+)([ ]+|){(?<selectorData>[a-z0-9:; (),.%\n*/#+"'_-]+|)}/gim, i = /(?<propName>[a-z-]+):([ ]+|)(?<propValue>([a-z-]+\([^;]\)|".*"|[a-z0-9 (),.%\n*/#+"':_-]+));/gim, a = /(\/\*.*\*\/)/gim, o = Object.values(t);
|
|
5
|
+
function s(t = "") {
|
|
6
|
+
return [...t.replace(n, "").replaceAll("\n", "").matchAll(r)].reduce((t, n) => {
|
|
7
|
+
let { selectorName: r, selectorData: s } = n.groups, c = {
|
|
8
|
+
name: r.trim(),
|
|
9
|
+
variables: {},
|
|
10
|
+
attributes: {}
|
|
11
|
+
};
|
|
12
|
+
return s && [...s.replaceAll(a, "").trim().matchAll(i)].filter((e) => o.includes(e.groups.propName)).forEach((t) => {
|
|
13
|
+
let { propName: n, propValue: r } = t.groups;
|
|
14
|
+
e(c, `attributes.${n.trim()}`, r.trim());
|
|
15
|
+
}), {
|
|
16
|
+
...t,
|
|
17
|
+
[r]: c
|
|
18
|
+
};
|
|
19
|
+
}, {});
|
|
20
|
+
}
|
|
21
|
+
var c = (e, t) => e.some((e) => t >= e.from && t < e.to), l = (e = "") => {
|
|
22
|
+
let t = [], a, o;
|
|
23
|
+
n.lastIndex = 0;
|
|
24
|
+
let s = [];
|
|
25
|
+
for (; o = n.exec(e);) t.push({
|
|
26
|
+
from: o.index,
|
|
27
|
+
to: n.lastIndex
|
|
28
|
+
}), s.push({
|
|
29
|
+
from: o.index,
|
|
30
|
+
to: n.lastIndex
|
|
31
|
+
});
|
|
32
|
+
let l = 0;
|
|
33
|
+
for (i.lastIndex = 0; a = r.exec(e);) {
|
|
34
|
+
let n = a.index, i = r.lastIndex;
|
|
35
|
+
if (c(s, n)) continue;
|
|
36
|
+
let o = a.groups?.selectorData || "", u = e.indexOf(o, n), d = u + o.length;
|
|
37
|
+
l < n && t.push({
|
|
38
|
+
from: l,
|
|
39
|
+
to: n
|
|
40
|
+
}), n < u && t.push({
|
|
41
|
+
from: n,
|
|
42
|
+
to: u
|
|
43
|
+
}), d < i && t.push({
|
|
44
|
+
from: d,
|
|
45
|
+
to: i
|
|
46
|
+
}), l = i;
|
|
47
|
+
}
|
|
48
|
+
return t.push({
|
|
49
|
+
from: l,
|
|
50
|
+
to: e.length
|
|
51
|
+
}), t;
|
|
52
|
+
};
|
|
53
|
+
//#endregion
|
|
54
|
+
export { s as cssToSelectors, l as getReadOnlyRangesFromContent };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { StyleItem, TagType } from '@plitzi/sdk-shared';
|
|
2
|
+
declare const generateStyleSelector: (selector: string | undefined, selectorType: TagType | undefined, values: StyleItem["attributes"] | undefined, variables: StyleItem["variables"]) => {
|
|
3
|
+
name: string;
|
|
4
|
+
type: TagType;
|
|
5
|
+
attributes: import('@plitzi/sdk-shared').StyleAttributes;
|
|
6
|
+
variables: Partial<import('@plitzi/sdk-shared').StyleVariables> | undefined;
|
|
7
|
+
cache: string;
|
|
8
|
+
} | undefined;
|
|
9
|
+
export default generateStyleSelector;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import e from "./processSelector.mjs";
|
|
2
|
+
//#region src/helpers/generateStyleSelector.ts
|
|
3
|
+
var t = (t = "", n = "class", r = {}, i) => {
|
|
4
|
+
if (!(!t || typeof r != "object")) return {
|
|
5
|
+
name: t,
|
|
6
|
+
type: n,
|
|
7
|
+
attributes: r,
|
|
8
|
+
variables: i,
|
|
9
|
+
cache: e({
|
|
10
|
+
name: t,
|
|
11
|
+
type: n,
|
|
12
|
+
attributes: r,
|
|
13
|
+
variables: i,
|
|
14
|
+
cache: ""
|
|
15
|
+
})
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { t as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as calculateInheriting } from './calculateInheriting';
|
|
2
|
+
import { default as generateStyleSelector } from './generateStyleSelector';
|
|
3
|
+
import { default as processCssTokens } from './processCssTokens';
|
|
4
|
+
import { default as processSelector } from './processSelector';
|
|
5
|
+
export * from './calculateInheriting';
|
|
6
|
+
export * from './formatCssFromSelector';
|
|
7
|
+
export * from './generateStyleSelector';
|
|
8
|
+
export * from './processCssTokens';
|
|
9
|
+
export * from './processSelector';
|
|
10
|
+
export { calculateInheriting, processCssTokens, generateStyleSelector, processSelector };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { __exportAll as e } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
import t, { processSelectors as n } from "./processSelector.mjs";
|
|
3
|
+
import r from "./calculateInheriting.mjs";
|
|
4
|
+
import i from "./generateStyleSelector.mjs";
|
|
5
|
+
import a from "./processCssTokens.mjs";
|
|
6
|
+
import { cssToSelectors as o, getReadOnlyRangesFromContent as s } from "./formatCssFromSelector.mjs";
|
|
7
|
+
//#region src/helpers/index.ts
|
|
8
|
+
var c = /* @__PURE__ */ e({
|
|
9
|
+
calculateInheriting: () => r,
|
|
10
|
+
cssToSelectors: () => o,
|
|
11
|
+
generateStyleSelector: () => i,
|
|
12
|
+
getReadOnlyRangesFromContent: () => s,
|
|
13
|
+
processCssTokens: () => a,
|
|
14
|
+
processSelector: () => t,
|
|
15
|
+
processSelectors: () => n
|
|
16
|
+
});
|
|
17
|
+
//#endregion
|
|
18
|
+
export { r as calculateInheriting, o as cssToSelectors, i as generateStyleSelector, s as getReadOnlyRangesFromContent, c as helpers_exports, a as processCssTokens, t as processSelector, n as processSelectors };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type TokenMapValue = string | number | boolean;
|
|
2
|
+
interface TokenMap {
|
|
3
|
+
[key: string]: TokenMapValue | TokenMap;
|
|
4
|
+
}
|
|
5
|
+
declare const processCssTokens: <T extends TokenMap>(cache: string, variables?: T, opts?: {
|
|
6
|
+
missing?: string;
|
|
7
|
+
}) => string;
|
|
8
|
+
export default processCssTokens;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region src/helpers/processCssTokens.ts
|
|
2
|
+
var e = (e, t = {}, n = { missing: "" }) => {
|
|
3
|
+
let r = n.missing ?? "";
|
|
4
|
+
return e.replace(/\{\{\s*([a-z0-9_\-.$]+)\s*\}\}/gi, (e, n) => {
|
|
5
|
+
let i = n.split("."), a = t;
|
|
6
|
+
for (let e of i) {
|
|
7
|
+
if (typeof a != "object" || !a) return r;
|
|
8
|
+
let t = a;
|
|
9
|
+
if (!(e in t)) return r;
|
|
10
|
+
a = t[e];
|
|
11
|
+
}
|
|
12
|
+
return typeof a == "string" || typeof a == "number" || typeof a == "boolean" ? String(a) : r;
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { e as default };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import e from "./processSelectorAttributes.mjs";
|
|
2
|
+
import t from "./processSelectorName.mjs";
|
|
3
|
+
import n from "./processSelectorVariables.mjs";
|
|
4
|
+
//#region src/helpers/processSelector.ts
|
|
5
|
+
var r = 2, i = (e = r) => " ".repeat(e), a = (e, t, n) => `${n || !t.length ? e : `${e}\n`}${t.join(n ? "" : "\n")}`, o = (e, t, n = !0, a = r) => {
|
|
6
|
+
let o = [], s = i(a), c = i(a + r);
|
|
7
|
+
for (let r of ["light", "dark"]) if (t[r].length) if (n) o.push(`@media(prefers-color-scheme:${r}){${e}{${t[r].join("")}}}`);
|
|
8
|
+
else {
|
|
9
|
+
let n = t[r].map((e) => `${c}${e}`).join("\n").replaceAll(":", ": ");
|
|
10
|
+
o.push(`\n@media(prefers-color-scheme: ${r}) {\n${s}${e} {\n${n}\n${s}}\n}`);
|
|
11
|
+
}
|
|
12
|
+
return o;
|
|
13
|
+
}, s = (e, t, n, a, o = !0, s = r) => {
|
|
14
|
+
let l = o ? t.join("") : t.map((e) => `${i(s + r)}${e}`).join("\n").replaceAll(":", ": "), u = n ? Object.entries(n).map(([e, t]) => c(`&:${e}`, t, void 0, void 0, o, s + r)) : [], d = e.replace("plitzi__", ""), f = a ? Object.entries(a).map(([e, t]) => c(`&[data-variant="${e}"]${o ? "," : ", "}&${d}--${e}`, t.default, t.states, void 0, o, s + r)) : [];
|
|
15
|
+
if (o) return `${l}${u.join("")}${f.join("")}`;
|
|
16
|
+
let p = l ? [l] : [];
|
|
17
|
+
return u.length && p.push(u.join("\n\n")), f.length && p.push(f.join("\n\n")), p.join("\n\n");
|
|
18
|
+
}, c = (e, t, n, a, o = !0, c = r) => {
|
|
19
|
+
let l = s(e, t, n, a, o, c);
|
|
20
|
+
return o ? `${e}{${l}}` : `${i(c)}${e} {\n${l}\n${i(c)}}`;
|
|
21
|
+
}, l = (e, t, n = !0, i = r) => {
|
|
22
|
+
let a = [];
|
|
23
|
+
for (let [o, l] of Object.entries(t)) {
|
|
24
|
+
if (o === "base") {
|
|
25
|
+
let t = s(e, l.default, l.states, l.variants, n, i);
|
|
26
|
+
t && a.push(t);
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
a.push(c(`${e}-${o}`, l.default, l.states, l.variants, n, i + r));
|
|
30
|
+
}
|
|
31
|
+
return n ? `${e}{${a.join("")}}` : `${e} {\n${a.join("\n\n")}\n}`;
|
|
32
|
+
}, u = (r, i = !0) => {
|
|
33
|
+
let s = t(r), c = n(r), u = e(r), d = c ? o(s, c, i) : void 0;
|
|
34
|
+
c && u.attributes.base.default.push(...c.default);
|
|
35
|
+
let f = l(s, u.attributes, i, 0);
|
|
36
|
+
return d ? a(f, d, i) : f;
|
|
37
|
+
}, d = (e, t = !1) => e.map((e) => u(e, t));
|
|
38
|
+
//#endregion
|
|
39
|
+
export { u as default, d as processSelectors };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { StyleItem, StyleState } from '@plitzi/sdk-shared';
|
|
2
|
+
type Attributes = Record<string, {
|
|
3
|
+
default: string[];
|
|
4
|
+
states?: Record<StyleState, string[]>;
|
|
5
|
+
variants?: Record<string, {
|
|
6
|
+
default: string[];
|
|
7
|
+
states?: Record<StyleState, string[]>;
|
|
8
|
+
}>;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const processCssString: (attribute: string, value?: string) => {
|
|
11
|
+
variables: string[];
|
|
12
|
+
value: string;
|
|
13
|
+
};
|
|
14
|
+
declare function processSelectorAttributes(selector?: StyleItem): {
|
|
15
|
+
attributes: Attributes;
|
|
16
|
+
};
|
|
17
|
+
export default processSelectorAttributes;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
//#region src/helpers/processSelectorAttributes.ts
|
|
2
|
+
var e = (e, t, n = !1) => n ? t : `${e}:${t};`, t = (e) => {
|
|
3
|
+
if (!e) return [];
|
|
4
|
+
let t = [];
|
|
5
|
+
for (let [n, r] of Object.entries(e)) {
|
|
6
|
+
let e = a(n, String(r));
|
|
7
|
+
t.push(...e.variables, e.value);
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
}, n = (t, n, r, i = !1) => {
|
|
11
|
+
let a = {
|
|
12
|
+
variables: {},
|
|
13
|
+
value: ""
|
|
14
|
+
}, o = r.replaceAll("\"", "").match(/var\((?<variableName>--[\w-]+)\)(?<extraContent>\S.+)/);
|
|
15
|
+
if (!o || !o.groups) return a.value = e(n, r, i), a;
|
|
16
|
+
let { variableName: s, extraContent: c } = o.groups, l = `${s}-parsed`, u = `var(${s})+"${c}"`;
|
|
17
|
+
return t.variables[l] && t.variables[l] !== u && (l = `${l}-${Object.keys(t.variables).length}`), a.variables[l] = u, a.value = e(n, `var(${l})`, i), a;
|
|
18
|
+
}, r = (t, r, i, a, o = !1) => {
|
|
19
|
+
let s = {
|
|
20
|
+
variables: {},
|
|
21
|
+
value: ""
|
|
22
|
+
};
|
|
23
|
+
if (i === "url") {
|
|
24
|
+
let c = n(t, r, a, !0);
|
|
25
|
+
s.variables = {
|
|
26
|
+
...s.variables,
|
|
27
|
+
...c.variables
|
|
28
|
+
}, s.value = e(r, `${i}(${c.value})`, o);
|
|
29
|
+
} else s.value = e(r, `${i}(${a})`, o);
|
|
30
|
+
return s;
|
|
31
|
+
}, i = (e, t, a, o = !1, s = !1) => {
|
|
32
|
+
let c = {
|
|
33
|
+
variables: {},
|
|
34
|
+
value: ""
|
|
35
|
+
}, l = a.replaceAll(";", "").match(/[a-z-]+\((?:[^()]+|\([^()]*\))*\)|[^\s]+/gi);
|
|
36
|
+
if (!o && l && l.length > 1) return l.forEach((n) => {
|
|
37
|
+
let r = i(e, t, n, !0, s);
|
|
38
|
+
c.variables = {
|
|
39
|
+
...c.variables,
|
|
40
|
+
...r.variables
|
|
41
|
+
}, c.value ? c.value = `${c.value} ${r.value}` : c.value = r.value;
|
|
42
|
+
}), c;
|
|
43
|
+
a = l?.[0] ?? a;
|
|
44
|
+
let u = a.match(/^(?!var\()\s*(?<functionName>[a-z-]+)\s*\(\s*(?<functionContent>[\s\S]*)\s*\)\s*$/i);
|
|
45
|
+
if (!u || !u.groups) return n(c, t, a, o || s);
|
|
46
|
+
let { functionName: d, functionContent: f } = u.groups;
|
|
47
|
+
return r(e, t, d, f, o || s);
|
|
48
|
+
}, a = (e, t) => {
|
|
49
|
+
let n = {
|
|
50
|
+
variables: {},
|
|
51
|
+
value: ""
|
|
52
|
+
};
|
|
53
|
+
return (t?.split(/,(?![^(]*\))/).map((e) => e.trim()) ?? []).forEach((t) => {
|
|
54
|
+
let r = i(n, e, t, !1, !0);
|
|
55
|
+
n.variables = {
|
|
56
|
+
...n.variables,
|
|
57
|
+
...r.variables
|
|
58
|
+
}, n.value ? n.value = `${n.value},${r.value}` : n.value = r.value;
|
|
59
|
+
}), n.value &&= `${e}:${n.value};`, {
|
|
60
|
+
variables: Object.keys(n.variables).map((e) => `${e}:${n.variables[e]};`),
|
|
61
|
+
value: n.value
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
function o(e) {
|
|
65
|
+
if (!e?.attributes || !Object.keys(e.attributes).length) return { attributes: { base: { default: [] } } };
|
|
66
|
+
let n = {};
|
|
67
|
+
for (let r in e.attributes) {
|
|
68
|
+
let i = e.attributes[r], a = t(i.default), o = {};
|
|
69
|
+
if (i.states) for (let [e, n] of Object.entries(i.states)) {
|
|
70
|
+
let r = t(n);
|
|
71
|
+
r.length && (o[e] = r);
|
|
72
|
+
}
|
|
73
|
+
let s = {};
|
|
74
|
+
if (i.variants) for (let e in i.variants) {
|
|
75
|
+
let n = i.variants[e], r = t(n.default), a = {};
|
|
76
|
+
if (n.states) for (let [e, r] of Object.entries(n.states)) {
|
|
77
|
+
let n = t(r);
|
|
78
|
+
n.length && (a[e] = n);
|
|
79
|
+
}
|
|
80
|
+
s[e] = {
|
|
81
|
+
default: r,
|
|
82
|
+
...Object.keys(a).length && { states: a }
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
n[r] = {
|
|
86
|
+
default: a,
|
|
87
|
+
...Object.keys(o).length && { states: o },
|
|
88
|
+
...Object.keys(s).length && { variants: s }
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
return { attributes: n };
|
|
92
|
+
}
|
|
93
|
+
//#endregion
|
|
94
|
+
export { o as default };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/helpers/processSelectorName.ts
|
|
2
|
+
var e = (e) => {
|
|
3
|
+
let { name: t, type: n } = e, r = t;
|
|
4
|
+
switch (n) {
|
|
5
|
+
case "element":
|
|
6
|
+
r = `.plitzi__${t}`;
|
|
7
|
+
break;
|
|
8
|
+
case "class":
|
|
9
|
+
r = `.${t}`;
|
|
10
|
+
break;
|
|
11
|
+
case "id":
|
|
12
|
+
r = `#${t}`;
|
|
13
|
+
break;
|
|
14
|
+
default:
|
|
15
|
+
}
|
|
16
|
+
return r;
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { e as default };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { StyleVariableCategory as e } from "@plitzi/sdk-shared/types";
|
|
2
|
+
//#region src/helpers/processSelectorVariables.ts
|
|
3
|
+
var t = (t) => {
|
|
4
|
+
let { variables: n } = t;
|
|
5
|
+
if (!n || !Object.keys(n).length) return;
|
|
6
|
+
let r = {
|
|
7
|
+
default: [],
|
|
8
|
+
light: [],
|
|
9
|
+
dark: []
|
|
10
|
+
};
|
|
11
|
+
return Object.keys(n).forEach((t) => {
|
|
12
|
+
let i = n[t];
|
|
13
|
+
if (i) switch (t) {
|
|
14
|
+
case e.COLOR:
|
|
15
|
+
Object.keys(i).forEach((e) => {
|
|
16
|
+
let t = i[e];
|
|
17
|
+
r.default.push(`--${e}:${t.default};`), t.light && r.light.push(`--${e}:${t.light};`), t.dark && r.dark.push(`--${e}:${t.dark};`);
|
|
18
|
+
});
|
|
19
|
+
break;
|
|
20
|
+
case e.SPACING:
|
|
21
|
+
case e.SHADOW:
|
|
22
|
+
case e.CUSTOM:
|
|
23
|
+
default: Object.keys(i).forEach((e) => {
|
|
24
|
+
r.default.push(`--${e}:${i[e]};`);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}), r;
|
|
28
|
+
};
|
|
29
|
+
//#endregion
|
|
30
|
+
export { t as default };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { default as BuilderStyleContextProvider } from './BuilderStyleContextProvider';
|
|
2
|
+
import { default as SdkStyleContextProvider } from './SdkStyleContextProvider';
|
|
3
|
+
import { default as StyleAdvanceEditor } from './StyleAdvanceEditor';
|
|
4
|
+
import { default as StyleContext } from './StyleContext';
|
|
5
|
+
import { default as StyleMap } from './StyleMap';
|
|
6
|
+
import { default as StyleReducer } from './StyleReducer';
|
|
7
|
+
import * as components from './components';
|
|
8
|
+
import * as helpers from './helpers';
|
|
9
|
+
export * from './BuilderStyleContextProvider';
|
|
10
|
+
export * from './SdkStyleContextProvider';
|
|
11
|
+
export * from './components';
|
|
12
|
+
export * from './StyleMap';
|
|
13
|
+
export * from './StyleHelper';
|
|
14
|
+
export * from './helpers';
|
|
15
|
+
export * from './StyleContext';
|
|
16
|
+
export * from './StyleAdvanceEditor';
|
|
17
|
+
export * from './StyleReducer';
|
|
18
|
+
export { StyleReducer, BuilderStyleContextProvider, SdkStyleContextProvider, StyleAdvanceEditor, StyleContext, StyleMap, components, helpers };
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import e, { processSelectors as t } from "./helpers/processSelector.mjs";
|
|
2
|
+
import n from "./StyleMap/index.mjs";
|
|
3
|
+
import { generateCache as r, makeSelector as i, selectorToString as a } from "./StyleHelper.mjs";
|
|
4
|
+
import o from "./helpers/calculateInheriting.mjs";
|
|
5
|
+
import s from "./helpers/generateStyleSelector.mjs";
|
|
6
|
+
import c from "./helpers/processCssTokens.mjs";
|
|
7
|
+
import { cssToSelectors as l, getReadOnlyRangesFromContent as u } from "./helpers/formatCssFromSelector.mjs";
|
|
8
|
+
import { helpers_exports as d } from "./helpers/index.mjs";
|
|
9
|
+
import f from "./components/StyleInspector/index.mjs";
|
|
10
|
+
import { components_exports as p } from "./components/index.mjs";
|
|
11
|
+
import m from "./StyleContext.mjs";
|
|
12
|
+
import h, { StyleActions as g } from "./StyleReducer.mjs";
|
|
13
|
+
import _ from "./BuilderStyleContextProvider.mjs";
|
|
14
|
+
import v from "./SdkStyleContextProvider.mjs";
|
|
15
|
+
import y from "./StyleAdvanceEditor.mjs";
|
|
16
|
+
export { _ as BuilderStyleContextProvider, v as SdkStyleContextProvider, g as StyleActions, y as StyleAdvanceEditor, m as StyleContext, f as StyleInspector, n as StyleMap, h as StyleReducer, o as calculateInheriting, p as components, l as cssToSelectors, r as generateCache, s as generateStyleSelector, u as getReadOnlyRangesFromContent, d as helpers, i as makeSelector, c as processCssTokens, e as processSelector, t as processSelectors, a as selectorToString };
|