@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,12 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { StyleReducerActions } from './StyleReducer';
|
|
3
|
+
import { ReducerMiddlewareCallback } from '@plitzi/plitzi-ui/hooks/useReducerWithMiddleware';
|
|
4
|
+
import { Style } from '@plitzi/sdk-shared';
|
|
5
|
+
export type BuilderStyleContextProviderProps = {
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
style?: Style;
|
|
8
|
+
includeSubscriptions?: boolean;
|
|
9
|
+
middlewares?: ReducerMiddlewareCallback<Style, [action: StyleReducerActions]>[];
|
|
10
|
+
};
|
|
11
|
+
declare const BuilderStyleContextProvider: ({ children, style: styleProp, includeSubscriptions, middlewares: middlewaresProp }: BuilderStyleContextProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export default BuilderStyleContextProvider;
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { makeSelector as e } from "./StyleHelper.mjs";
|
|
2
|
+
import t from "./StyleContext.mjs";
|
|
3
|
+
import n, { StyleActions as r } from "./StyleReducer.mjs";
|
|
4
|
+
import { get as i } from "@plitzi/plitzi-ui/helpers";
|
|
5
|
+
import { use as a, useCallback as o, useEffect as s, useMemo as c } from "react";
|
|
6
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
7
|
+
import { createStoreHook as u } from "@plitzi/sdk-store/createStore";
|
|
8
|
+
import d from "@plitzi/plitzi-ui/hooks/useReducerWithMiddleware";
|
|
9
|
+
import f from "@plitzi/sdk-event-bridge/hooks/useEventBridge";
|
|
10
|
+
import p from "@plitzi/sdk-shared/network/NetworkContext";
|
|
11
|
+
import { EMPTY_STYLE_SCHEMA as m } from "@plitzi/sdk-shared/style/styleConstants";
|
|
12
|
+
//#region src/BuilderStyleContextProvider.tsx
|
|
13
|
+
var h = ({ children: h, style: g, includeSubscriptions: _ = !0, middlewares: v = [] }) => {
|
|
14
|
+
let { subscriptionManager: y } = a(p), b = c(() => v.map((e) => ({
|
|
15
|
+
middleware: e,
|
|
16
|
+
filterCallback: (e) => !e.fromSubscriptions
|
|
17
|
+
})), [v]), [x, S] = d(n, g ?? m, b), { useStoreSync: C } = u();
|
|
18
|
+
C("style", x);
|
|
19
|
+
let w = o((e, t = !1) => S({
|
|
20
|
+
type: r.STYLE_UPDATE,
|
|
21
|
+
style: e,
|
|
22
|
+
fromSubscriptions: t
|
|
23
|
+
}), [S]), T = o((t, n, i, a, o, s, c = !1) => {
|
|
24
|
+
n ||= e(i), S({
|
|
25
|
+
type: r.STYLE_ADD_SELECTOR,
|
|
26
|
+
displayMode: t,
|
|
27
|
+
selector: n,
|
|
28
|
+
selectorType: i,
|
|
29
|
+
path: a,
|
|
30
|
+
value: o,
|
|
31
|
+
params: s,
|
|
32
|
+
fromSubscriptions: c
|
|
33
|
+
});
|
|
34
|
+
}, [S]), E = o((e, t, n, i, a, o = !1) => S({
|
|
35
|
+
type: r.STYLE_UPDATE_SELECTOR,
|
|
36
|
+
displayMode: e,
|
|
37
|
+
selector: t,
|
|
38
|
+
path: n,
|
|
39
|
+
value: i,
|
|
40
|
+
params: a,
|
|
41
|
+
fromSubscriptions: o
|
|
42
|
+
}), [S]), D = o((e, t, n = !1) => S({
|
|
43
|
+
type: r.STYLE_REMOVE_SELECTOR,
|
|
44
|
+
displayMode: e,
|
|
45
|
+
selector: t,
|
|
46
|
+
fromSubscriptions: n
|
|
47
|
+
}), [S]), O = o((e, t, n, i, a, o = !1) => {
|
|
48
|
+
S({
|
|
49
|
+
type: r.STYLE_ADD_SELECTOR_VARIABLE,
|
|
50
|
+
displayMode: e,
|
|
51
|
+
selector: t,
|
|
52
|
+
category: n,
|
|
53
|
+
name: i,
|
|
54
|
+
value: a,
|
|
55
|
+
fromSubscriptions: o
|
|
56
|
+
});
|
|
57
|
+
}, [S]), k = o((e, t, n, i, a, o = !1) => {
|
|
58
|
+
S({
|
|
59
|
+
type: r.STYLE_UPDATE_SELECTOR_VARIABLE,
|
|
60
|
+
displayMode: e,
|
|
61
|
+
selector: t,
|
|
62
|
+
category: n,
|
|
63
|
+
name: i,
|
|
64
|
+
value: a,
|
|
65
|
+
fromSubscriptions: o
|
|
66
|
+
});
|
|
67
|
+
}, [S]), A = o((e, t, n, i, a = !1) => {
|
|
68
|
+
S({
|
|
69
|
+
type: r.STYLE_REMOVE_SELECTOR_VARIABLE,
|
|
70
|
+
displayMode: e,
|
|
71
|
+
selector: t,
|
|
72
|
+
category: n,
|
|
73
|
+
name: i,
|
|
74
|
+
fromSubscriptions: a
|
|
75
|
+
});
|
|
76
|
+
}, [S]), j = o((e, t, n, i = !1) => S({
|
|
77
|
+
type: r.STYLE_ADD_VARIABLE,
|
|
78
|
+
category: e,
|
|
79
|
+
name: t,
|
|
80
|
+
value: n,
|
|
81
|
+
fromSubscriptions: i
|
|
82
|
+
}), [S]), M = o((e, t, n, i = !1) => S({
|
|
83
|
+
type: r.STYLE_UPDATE_VARIABLE,
|
|
84
|
+
category: e,
|
|
85
|
+
name: t,
|
|
86
|
+
value: n,
|
|
87
|
+
fromSubscriptions: i
|
|
88
|
+
}), [S]), N = o((e, t, n = !1) => S({
|
|
89
|
+
type: r.STYLE_REMOVE_VARIABLE,
|
|
90
|
+
category: e,
|
|
91
|
+
name: t,
|
|
92
|
+
fromSubscriptions: n
|
|
93
|
+
}), [S]), P = o((e, t = !1) => S({
|
|
94
|
+
type: r.STYLE_ADD_TEMPLATE,
|
|
95
|
+
platform: e,
|
|
96
|
+
fromSubscriptions: t
|
|
97
|
+
}), [S]), F = o((e, t, n = !1) => {
|
|
98
|
+
S({
|
|
99
|
+
type: r.STYLE_UPDATE_SETTINGS,
|
|
100
|
+
path: e,
|
|
101
|
+
value: t,
|
|
102
|
+
fromSubscriptions: n
|
|
103
|
+
});
|
|
104
|
+
}, [S]);
|
|
105
|
+
s(() => (_ && (y.subscribe("StyleUpdated", {}, (e) => {
|
|
106
|
+
!e.data || e.error || w(i(e, "data.StyleUpdated", {}), !0);
|
|
107
|
+
}), y.subscribe("StyleAddSelector", {}, (e) => {
|
|
108
|
+
if (!e.data || e.error) return;
|
|
109
|
+
let { displayMode: t, selector: n, type: r, path: a, style: o, params: s } = i(e, "data.StyleAddSelector", {});
|
|
110
|
+
T(t, n, r, a, o, s, !0);
|
|
111
|
+
}), y.subscribe("StyleUpdateSelector", {}, (e) => {
|
|
112
|
+
if (!e.data || e.error) return;
|
|
113
|
+
let { displayMode: t, selector: n, path: r, style: a, params: o } = i(e, "data.StyleUpdateSelector", {});
|
|
114
|
+
E(t, n, r, a, o, !0);
|
|
115
|
+
}), y.subscribe("StyleRemoveSelector", {}, (e) => {
|
|
116
|
+
if (!e.data || e.error) return;
|
|
117
|
+
let { displayMode: t, selector: n } = i(e, "data.StyleRemoveSelector", {});
|
|
118
|
+
D(t, n, !0);
|
|
119
|
+
}), y.subscribe("StyleAddSelectorVariable", {}, (e) => {
|
|
120
|
+
if (!e.data || e.error) return;
|
|
121
|
+
let { displayMode: t, selector: n, category: r, name: a, value: o } = i(e, "data.StyleAddSelectorVariable", {});
|
|
122
|
+
O(t, n, r, a, o, !0);
|
|
123
|
+
}), y.subscribe("StyleUpdateSelectorVariable", {}, (e) => {
|
|
124
|
+
if (!e.data || e.error) return;
|
|
125
|
+
let { displayMode: t, selector: n, category: r, name: a, value: o } = i(e, "data.StyleUpdateSelectorVariable", {});
|
|
126
|
+
k(t, n, r, a, o, !0);
|
|
127
|
+
}), y.subscribe("StyleRemoveSelectorVariable", {}, (e) => {
|
|
128
|
+
if (!e.data || e.error) return;
|
|
129
|
+
let { displayMode: t, selector: n, category: r, name: a } = i(e, "data.StyleRemoveSelectorVariable", {});
|
|
130
|
+
A(t, n, r, a, !0);
|
|
131
|
+
}), y.subscribe("StyleAddVariable", {}, (e) => {
|
|
132
|
+
if (!e.data || e.error) return;
|
|
133
|
+
let { category: t, name: n, value: r } = i(e, "data.StyleAddVariable", {});
|
|
134
|
+
j(t, n, r, !0);
|
|
135
|
+
}), y.subscribe("StyleUpdateVariable", {}, (e) => {
|
|
136
|
+
if (!e.data || e.error) return;
|
|
137
|
+
let { category: t, name: n, value: r } = i(e, "data.StyleUpdateVariable", {});
|
|
138
|
+
M(t, n, r, !0);
|
|
139
|
+
}), y.subscribe("StyleRemoveVariable", {}, (e) => {
|
|
140
|
+
if (!e.data || e.error) return;
|
|
141
|
+
let { category: t, name: n } = i(e, "data.StyleRemoveVariable", {});
|
|
142
|
+
N(t, n, !0);
|
|
143
|
+
}), y.subscribe("StyleUpdateSettings", {}, (e) => {
|
|
144
|
+
if (!e.data || e.error) return;
|
|
145
|
+
let { path: t, value: n } = i(e, "data.StyleUpdateSettings", {});
|
|
146
|
+
F(t, n, !0);
|
|
147
|
+
})), () => {
|
|
148
|
+
_ && y.unsubscribe([
|
|
149
|
+
"StyleUpdated",
|
|
150
|
+
"StyleAddSelector",
|
|
151
|
+
"StyleUpdateSelector",
|
|
152
|
+
"StyleRemoveSelector",
|
|
153
|
+
"StyleAddSelectorVariable",
|
|
154
|
+
"StyleUpdateSelectorVariable",
|
|
155
|
+
"StyleRemoveSelectorVariable",
|
|
156
|
+
"StyleAddVariable",
|
|
157
|
+
"StyleUpdateVariable",
|
|
158
|
+
"StyleRemoveVariable",
|
|
159
|
+
"StyleUpdateSettings"
|
|
160
|
+
]);
|
|
161
|
+
}), [
|
|
162
|
+
y,
|
|
163
|
+
_,
|
|
164
|
+
w,
|
|
165
|
+
T,
|
|
166
|
+
E,
|
|
167
|
+
D,
|
|
168
|
+
O,
|
|
169
|
+
k,
|
|
170
|
+
A,
|
|
171
|
+
j,
|
|
172
|
+
M,
|
|
173
|
+
N,
|
|
174
|
+
F
|
|
175
|
+
]);
|
|
176
|
+
let I = c(() => ({
|
|
177
|
+
styleUpdate: w,
|
|
178
|
+
styleAddSelector: T,
|
|
179
|
+
styleUpdateSelector: E,
|
|
180
|
+
styleRemoveSelector: D,
|
|
181
|
+
styleAddSelectorVariable: O,
|
|
182
|
+
styleUpdateSelectorVariable: k,
|
|
183
|
+
styleRemoveSelectorVariable: A,
|
|
184
|
+
styleAddVariable: j,
|
|
185
|
+
styleUpdateVariable: M,
|
|
186
|
+
styleRemoveVariable: N,
|
|
187
|
+
styleAddTemplate: P,
|
|
188
|
+
styleUpdateSettings: F
|
|
189
|
+
}), [
|
|
190
|
+
w,
|
|
191
|
+
T,
|
|
192
|
+
E,
|
|
193
|
+
D,
|
|
194
|
+
O,
|
|
195
|
+
k,
|
|
196
|
+
A,
|
|
197
|
+
j,
|
|
198
|
+
M,
|
|
199
|
+
N,
|
|
200
|
+
P,
|
|
201
|
+
F
|
|
202
|
+
]);
|
|
203
|
+
return f("main", I), /* @__PURE__ */ l(t, {
|
|
204
|
+
value: I,
|
|
205
|
+
children: h
|
|
206
|
+
});
|
|
207
|
+
};
|
|
208
|
+
//#endregion
|
|
209
|
+
export { h as default };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Style } from '@plitzi/sdk-shared';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
export type SdkStyleContextProviderProps = {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
style?: Style;
|
|
6
|
+
};
|
|
7
|
+
declare const SdkStyleContextProvider: ({ children, style: styleProp }: SdkStyleContextProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default SdkStyleContextProvider;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import e from "./StyleContext.mjs";
|
|
2
|
+
import { use as t, useMemo as n } from "react";
|
|
3
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
4
|
+
import { createStoreHook as i } from "@plitzi/sdk-store/createStore";
|
|
5
|
+
import { EMPTY_STYLE_SCHEMA as a } from "@plitzi/sdk-shared/style/styleConstants";
|
|
6
|
+
import o from "@plitzi/sdk-shared/network/NetworkInternalContext";
|
|
7
|
+
//#region src/SdkStyleContextProvider.tsx
|
|
8
|
+
var s = ({ children: s, style: c }) => {
|
|
9
|
+
let { style: l } = t(o), u = n(() => ({}), []), { useStoreSync: d } = i();
|
|
10
|
+
return d("style", c ?? (l || a)), /* @__PURE__ */ r(e, {
|
|
11
|
+
value: u,
|
|
12
|
+
children: s
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { s as default };
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { debounce as e, get as t } from "@plitzi/plitzi-ui/helpers";
|
|
2
|
+
import { use as n, useCallback as r, useMemo as i, useState as a } from "react";
|
|
3
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
4
|
+
import c from "@plitzi/plitzi-ui/ContainerFloating";
|
|
5
|
+
import l from "@plitzi/plitzi-ui/Button";
|
|
6
|
+
import { createStoreHook as u } from "@plitzi/sdk-store/createStore";
|
|
7
|
+
import d from "@plitzi/plitzi-ui/CodeMirror";
|
|
8
|
+
import { ThemeContext as f } from "@plitzi/sdk-shared/theme/ThemeProvider";
|
|
9
|
+
import p from "@plitzi/sdk-shared/network/NetworkContext";
|
|
10
|
+
import m from "@plitzi/sdk-shared/hooks/useNetwork";
|
|
11
|
+
import h from "@plitzi/sdk-shared/schema/SchemaContext";
|
|
12
|
+
//#region src/StyleAdvanceEditor.tsx
|
|
13
|
+
var g = () => {
|
|
14
|
+
let { theme: g } = n(f), { useStore: _ } = u(), [[v, y]] = _(["schema.settings.customCss", "style.variables"], { defaultValue: ["", void 0] }), { schemaUpdateSettings: b } = n(h), [x, S] = a(() => typeof v == "string" ? v : ""), C = i(() => b && e(b, 500), [b]), { server: w, webKey: T } = n(p), { networkQuery: E, networkLoading: D } = m({
|
|
15
|
+
initLoading: !1,
|
|
16
|
+
server: w,
|
|
17
|
+
webKey: T
|
|
18
|
+
}), O = r((e) => {
|
|
19
|
+
C?.(e, "customCss"), S(e);
|
|
20
|
+
}, [S, C]), k = r(async () => {
|
|
21
|
+
let e = await E("/utils/prettier-parser", {
|
|
22
|
+
data: x,
|
|
23
|
+
parser: "css"
|
|
24
|
+
}, "post");
|
|
25
|
+
if (!e || !e.data) return;
|
|
26
|
+
let n = t(e, "data", x);
|
|
27
|
+
n !== x && (S(n), C?.(n, "customCss"));
|
|
28
|
+
}, [
|
|
29
|
+
E,
|
|
30
|
+
x,
|
|
31
|
+
C
|
|
32
|
+
]);
|
|
33
|
+
return /* @__PURE__ */ s("div", {
|
|
34
|
+
className: "relative flex h-full w-full flex-col",
|
|
35
|
+
children: [/* @__PURE__ */ o(d, {
|
|
36
|
+
className: "h-full",
|
|
37
|
+
value: x,
|
|
38
|
+
autoComplete: i(() => y ? Object.keys(y).flatMap((e) => Object.keys(y[e] ?? {})).map((e) => ({
|
|
39
|
+
type: "css-token",
|
|
40
|
+
value: e
|
|
41
|
+
})) : [], [y]),
|
|
42
|
+
theme: g === "dark" ? "dark" : "light",
|
|
43
|
+
lineWrapping: !0,
|
|
44
|
+
onChange: O
|
|
45
|
+
}), /* @__PURE__ */ s("div", {
|
|
46
|
+
className: "absolute top-3 right-3 flex",
|
|
47
|
+
children: [/* @__PURE__ */ o(l, {
|
|
48
|
+
intent: "custom",
|
|
49
|
+
size: "custom",
|
|
50
|
+
className: "mr-2 rounded-sm bg-white p-2 text-zinc-800 shadow dark:bg-zinc-700 dark:text-zinc-200",
|
|
51
|
+
onClick: k,
|
|
52
|
+
title: "Auto format",
|
|
53
|
+
disabled: D,
|
|
54
|
+
children: /* @__PURE__ */ o("i", { className: "fa-solid fa-wand-magic-sparkles" })
|
|
55
|
+
}), /* @__PURE__ */ s(c, {
|
|
56
|
+
containerLeftOffset: -208,
|
|
57
|
+
containerTopOffset: 4,
|
|
58
|
+
children: [/* @__PURE__ */ o(c.Trigger, { children: /* @__PURE__ */ o(l, {
|
|
59
|
+
intent: "custom",
|
|
60
|
+
size: "custom",
|
|
61
|
+
className: "rounded-sm bg-white p-2 text-zinc-800 shadow dark:bg-zinc-700 dark:text-zinc-200",
|
|
62
|
+
children: /* @__PURE__ */ o("i", { className: "fa-solid fa-circle-info" })
|
|
63
|
+
}) }), /* @__PURE__ */ o(c.Content, { children: /* @__PURE__ */ s("div", {
|
|
64
|
+
className: "flex w-60 flex-col items-center justify-center p-4 text-center text-zinc-700 dark:text-zinc-300",
|
|
65
|
+
children: [
|
|
66
|
+
/* @__PURE__ */ o("p", { children: "Add your own CSS code here to customize the appearance and layout of your site." }),
|
|
67
|
+
/* @__PURE__ */ s("a", {
|
|
68
|
+
href: "https://codex.wordpress.org/CSS",
|
|
69
|
+
target: "_blank",
|
|
70
|
+
rel: "noopener noreferrer",
|
|
71
|
+
className: "text-blue-400 underline",
|
|
72
|
+
children: ["Learn more about CSS", /* @__PURE__ */ o("span", {
|
|
73
|
+
className: "text-sm",
|
|
74
|
+
children: " (opens in a new tab)"
|
|
75
|
+
})]
|
|
76
|
+
}),
|
|
77
|
+
/* @__PURE__ */ s("p", { children: [/* @__PURE__ */ o("span", {
|
|
78
|
+
className: "font-bold",
|
|
79
|
+
children: "Ctrl + Space"
|
|
80
|
+
}), " to autocomplete."] })
|
|
81
|
+
]
|
|
82
|
+
}) })]
|
|
83
|
+
})]
|
|
84
|
+
})]
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
//#endregion
|
|
88
|
+
export { g as default };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Style, TagType } from '@plitzi/sdk-shared';
|
|
2
|
+
export declare const selectorToString: (tags?: {
|
|
3
|
+
type: TagType;
|
|
4
|
+
value: string;
|
|
5
|
+
}[], filters?: string[], includePrefix?: boolean, separator?: string) => string;
|
|
6
|
+
export declare const generateCache: (style: Style) => string;
|
|
7
|
+
export declare const makeSelector: (type: string, styleSelector?: string, length?: number) => string;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { makeId as e } from "@plitzi/sdk-shared/helpers/utils";
|
|
2
|
+
import { styleVariablesToCss as t } from "@plitzi/sdk-variables/VariablesHelper";
|
|
3
|
+
//#region src/StyleHelper.ts
|
|
4
|
+
var n = (e, t = [], n = !0, r = "") => {
|
|
5
|
+
if (!e || e.length === 0) return "";
|
|
6
|
+
let i = [];
|
|
7
|
+
return i = e.filter((e) => t.length === 0 || t.includes(e.type)).map((e) => {
|
|
8
|
+
if (!n) return e.value;
|
|
9
|
+
switch (e.type) {
|
|
10
|
+
case "class": return `.${e.value}`;
|
|
11
|
+
case "element": return e.value;
|
|
12
|
+
case "id": return `#${e.value}`;
|
|
13
|
+
default: return "";
|
|
14
|
+
}
|
|
15
|
+
}), i.join(r);
|
|
16
|
+
}, r = {
|
|
17
|
+
desktop: "64rem",
|
|
18
|
+
tablet: "48rem",
|
|
19
|
+
mobile: "0"
|
|
20
|
+
}, i = (e) => {
|
|
21
|
+
if (e === "mobile") return 0;
|
|
22
|
+
if (e === "tablet") return 768;
|
|
23
|
+
if (e === "desktop") return 1024;
|
|
24
|
+
let t = e.match(/(\d*\.?\d+)(px|rem)/);
|
|
25
|
+
if (!t) return 0;
|
|
26
|
+
let n = parseFloat(t[1]);
|
|
27
|
+
return t[2] === "rem" ? n * 16 : n;
|
|
28
|
+
}, a = (e) => {
|
|
29
|
+
let { platform: n, mode: a = "desktop-first", variables: o } = e, s = [], c = Object.keys(n).sort((e, t) => a === "mobile-first" ? i(e) - i(t) : i(t) - i(e));
|
|
30
|
+
return c.forEach((e, t) => {
|
|
31
|
+
let i = Object.values(n[e]).sort((e, t) => Number(t.type === "element") - Number(e.type === "element")).map((e) => e.cache).join("\n");
|
|
32
|
+
if (!i) return;
|
|
33
|
+
let o = r[e] ?? e;
|
|
34
|
+
if (a === "mobile-first") o === "0" || e === "mobile" ? s.push(i) : s.push(`@media (min-width: ${o}) {${i}}`);
|
|
35
|
+
else {
|
|
36
|
+
let n = c[t - 1], a = n ? r[n] ?? n : void 0;
|
|
37
|
+
e === "desktop" ? s.push(i) : a ? s.push(`@media (max-width: ${a}) and (min-width: ${o}) {${i}}`) : s.push(`@media (max-width: ${o}) {${i}}`);
|
|
38
|
+
}
|
|
39
|
+
}), o && Object.keys(o).length && s.push(t(o)), s.join("\n");
|
|
40
|
+
}, o = (t, n = "base", r = 4) => {
|
|
41
|
+
let i = `${t}-${e(r)}`;
|
|
42
|
+
return n !== "base" && (i = `${t}-${n}-${e(r)}`), i;
|
|
43
|
+
};
|
|
44
|
+
//#endregion
|
|
45
|
+
export { a as generateCache, o as makeSelector, n as selectorToString };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { DisplayMode, Style, StyleCategory, StyleItem, StyleObject, StyleState, StyleValue, StyleVariableCategory, StyleVariableValue, TagType } from '@plitzi/sdk-shared';
|
|
2
|
+
export type StyleMapProps = {
|
|
3
|
+
platform: Style['platform'];
|
|
4
|
+
variables?: Style['variables'];
|
|
5
|
+
};
|
|
6
|
+
declare class StyleMap {
|
|
7
|
+
platform: Style['platform'];
|
|
8
|
+
variables: Style['variables'];
|
|
9
|
+
constructor(props: StyleMapProps);
|
|
10
|
+
static getInstance: (props: StyleMapProps) => StyleMap;
|
|
11
|
+
addSelector(displayMode: DisplayMode, selector: string, type: TagType, path: StyleCategory | undefined, value: StyleItem['attributes'] | Partial<StyleObject> | StyleValue | undefined, params: {
|
|
12
|
+
componentType?: string;
|
|
13
|
+
styleSelector?: string;
|
|
14
|
+
styleState?: StyleState;
|
|
15
|
+
styleVariant?: string;
|
|
16
|
+
}): boolean;
|
|
17
|
+
static addSelector(style: Pick<Style, 'platform' | 'variables'>, displayMode: DisplayMode, selector: string, type: TagType, path: StyleCategory | undefined, value: StyleItem['attributes'] | Partial<StyleObject> | StyleValue | undefined, params: {
|
|
18
|
+
componentType?: string;
|
|
19
|
+
styleSelector?: string;
|
|
20
|
+
styleState?: StyleState;
|
|
21
|
+
styleVariant?: string;
|
|
22
|
+
}): boolean;
|
|
23
|
+
getSelector: (displayMode: DisplayMode, selector: string) => StyleItem | undefined;
|
|
24
|
+
static getSelector: (style: Pick<Style, "platform" | "variables">, displayMode: DisplayMode, selector: string) => StyleItem | undefined;
|
|
25
|
+
updateSelector(displayMode: DisplayMode, selector: string, path: StyleCategory | undefined, value: StyleItem['attributes'] | Partial<StyleObject> | StyleValue | undefined, params: {
|
|
26
|
+
componentType?: string;
|
|
27
|
+
styleSelector: string;
|
|
28
|
+
styleState?: StyleState;
|
|
29
|
+
styleVariant?: string;
|
|
30
|
+
}): boolean;
|
|
31
|
+
static updateSelector(style: Pick<Style, 'platform' | 'variables'>, displayMode: DisplayMode, selector: string, path: StyleCategory | undefined, value: StyleItem['attributes'] | Partial<StyleObject> | StyleValue | undefined, params: {
|
|
32
|
+
componentType?: string;
|
|
33
|
+
styleSelector: string;
|
|
34
|
+
styleState?: StyleState;
|
|
35
|
+
styleVariant?: string;
|
|
36
|
+
}): boolean;
|
|
37
|
+
removeSelector: (displayMode: DisplayMode | undefined, selector: string) => boolean;
|
|
38
|
+
static removeSelector: (style: Pick<Style, "platform" | "variables">, displayMode: DisplayMode | undefined, selector: string) => boolean;
|
|
39
|
+
addSelectorVariable: (displayMode: DisplayMode, selector: string, category: StyleVariableCategory, name: string, value: StyleVariableValue) => boolean;
|
|
40
|
+
static addSelectorVariable: (style: Pick<Style, "platform" | "variables">, displayMode: DisplayMode, selector: string, category: StyleVariableCategory, name: string, value: StyleVariableValue) => boolean;
|
|
41
|
+
updateSelectorVariable: (displayMode: DisplayMode, selector: string, category: StyleVariableCategory, name: string, value: StyleVariableValue) => boolean;
|
|
42
|
+
static updateSelectorVariable: (style: Pick<Style, "platform" | "variables">, displayMode: DisplayMode, selector: string, category: StyleVariableCategory, name: string, value: StyleVariableValue) => boolean;
|
|
43
|
+
removeSelectorVariable: (displayMode: DisplayMode, selector: string, category: StyleVariableCategory, name: string) => boolean;
|
|
44
|
+
static removeSelectorVariable: (style: Pick<Style, "platform" | "variables">, displayMode: DisplayMode, selector: string, category: StyleVariableCategory, name: string) => boolean;
|
|
45
|
+
addVariable: (category: StyleVariableCategory, name: string, value: StyleVariableValue) => boolean;
|
|
46
|
+
static addVariable: (style: Pick<Style, "platform" | "variables">, category: StyleVariableCategory, name: string, value: StyleVariableValue) => boolean;
|
|
47
|
+
updateVariable: (category: StyleVariableCategory, name: string, value: StyleVariableValue) => boolean;
|
|
48
|
+
static updateVariable: (style: Pick<Style, "platform" | "variables">, category: StyleVariableCategory, name: string, value: StyleVariableValue) => boolean;
|
|
49
|
+
removeVariable: (category: StyleVariableCategory, name: string) => boolean;
|
|
50
|
+
static removeVariable: (style: Pick<Style, "platform" | "variables">, category: StyleVariableCategory, name: string) => boolean;
|
|
51
|
+
}
|
|
52
|
+
export default StyleMap;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import e from "../helpers/processSelector.mjs";
|
|
2
|
+
import t from "./helpers/getStyleItem.mjs";
|
|
3
|
+
import n from "./methods/addSelector.mjs";
|
|
4
|
+
import r from "./methods/updateSelector.mjs";
|
|
5
|
+
import { get as i, set as a } from "@plitzi/plitzi-ui/helpers";
|
|
6
|
+
//#region src/StyleMap/StyleMap.ts
|
|
7
|
+
var o = class {
|
|
8
|
+
platform;
|
|
9
|
+
variables;
|
|
10
|
+
constructor(e) {
|
|
11
|
+
let { platform: t, variables: n } = e;
|
|
12
|
+
if (!t) throw Error("Platform Required");
|
|
13
|
+
this.platform = t, this.variables = n ?? {};
|
|
14
|
+
}
|
|
15
|
+
static getInstance = (e) => new this(e);
|
|
16
|
+
addSelector(e, t, r, i, a, o) {
|
|
17
|
+
return n(this.platform, e, t, r, i, a, o);
|
|
18
|
+
}
|
|
19
|
+
static addSelector(e, t, n, r, i, a, o) {
|
|
20
|
+
return this.getInstance(e).addSelector(t, n, r, i, a, o);
|
|
21
|
+
}
|
|
22
|
+
getSelector = (e, n) => t(this.platform, e, n);
|
|
23
|
+
static getSelector = (e, t, n) => this.getInstance(e).getSelector(t, n);
|
|
24
|
+
updateSelector(e, t, n, i, a) {
|
|
25
|
+
return r(this.platform, e, t, n, i, a);
|
|
26
|
+
}
|
|
27
|
+
static updateSelector(e, t, n, r, i, a) {
|
|
28
|
+
return this.getInstance(e).updateSelector(t, n, r, i, a);
|
|
29
|
+
}
|
|
30
|
+
removeSelector = (e, t) => {
|
|
31
|
+
if (e) return this.platform[e][t] ? (delete this.platform[e][t], !0) : !1;
|
|
32
|
+
let n = !1;
|
|
33
|
+
return Object.keys(this.platform).forEach((e) => {
|
|
34
|
+
this.platform[e][t] && (n = !0, delete this.platform[e][t]);
|
|
35
|
+
}), n;
|
|
36
|
+
};
|
|
37
|
+
static removeSelector = (e, t, n) => this.getInstance(e).removeSelector(t, n);
|
|
38
|
+
addSelectorVariable = (n, r, o, s, c) => {
|
|
39
|
+
let l = t(this.platform, n, r);
|
|
40
|
+
return !l || i(l, `variables.${o}.${s}`, "") ? !1 : (a(l, `variables.${o}.${s}`, c), a(this.platform, `${n}.${r}.cache`, e(l)), !0);
|
|
41
|
+
};
|
|
42
|
+
static addSelectorVariable = (e, t, n, r, i, a) => this.getInstance(e).addSelectorVariable(t, n, r, i, a);
|
|
43
|
+
updateSelectorVariable = (n, r, i, o, s) => {
|
|
44
|
+
let c = t(this.platform, n, r);
|
|
45
|
+
return c ? (a(c, `variables.${i}.${o}`, s), a(this.platform, `${n}.${r}.cache`, e(c)), !0) : !1;
|
|
46
|
+
};
|
|
47
|
+
static updateSelectorVariable = (e, t, n, r, i, a) => this.getInstance(e).updateSelectorVariable(t, n, r, i, a);
|
|
48
|
+
removeSelectorVariable = (n, r, i, o) => {
|
|
49
|
+
let s = t(this.platform, n, r);
|
|
50
|
+
return !s || !s.variables || !s.variables[i] || !s.variables[i][o] ? !1 : (delete s.variables[i][o], Object.keys(s.variables[i]).length === 0 && delete s.variables[i], Object.keys(s.variables).length === 0 && delete s.variables, a(this.platform, `${n}.${r}.cache`, e(s)), !0);
|
|
51
|
+
};
|
|
52
|
+
static removeSelectorVariable = (e, t, n, r, i) => this.getInstance(e).removeSelectorVariable(t, n, r, i);
|
|
53
|
+
addVariable = (e, t, n) => (this.variables[e] || (this.variables[e] = {}), this.variables[e][t] ? !1 : (this.variables[e][t] = n, !0));
|
|
54
|
+
static addVariable = (e, t, n, r) => this.getInstance(e).addVariable(t, n, r);
|
|
55
|
+
updateVariable = (e, t, n) => !this.variables[e] || !this.variables[e][t] ? !1 : (this.variables[e][t] = n, !0);
|
|
56
|
+
static updateVariable = (e, t, n, r) => this.getInstance(e).updateVariable(t, n, r);
|
|
57
|
+
removeVariable = (e, t) => !this.variables[e] || !this.variables[e][t] ? !1 : (delete this.variables[e][t], Object.keys(this.variables[e]).length === 0 && delete this.variables[e], !0);
|
|
58
|
+
static removeVariable = (e, t, n) => this.getInstance(e).removeVariable(t, n);
|
|
59
|
+
};
|
|
60
|
+
//#endregion
|
|
61
|
+
export { o as default };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { StyleAttributes, StyleBlock, StyleCategory, StyleObject, StyleState, StyleStates, StyleValue, StyleVariants } from '@plitzi/sdk-shared';
|
|
2
|
+
export declare const isStyleObject: (obj: Partial<StyleObject>) => boolean;
|
|
3
|
+
export declare const isStyleStates: (obj: NonNullable<StyleBlock["states"]>) => boolean;
|
|
4
|
+
export declare const isStyleVariants: (obj: NonNullable<StyleBlock["variants"]>) => boolean;
|
|
5
|
+
export declare const isStyleBlock: (obj: StyleBlock) => boolean;
|
|
6
|
+
export declare const isStyleAttributes: (obj?: StyleAttributes) => boolean;
|
|
7
|
+
declare const isValidValue: (path?: StyleCategory, value?: StyleAttributes | StyleValue | Partial<StyleObject> | StyleBlock | StyleVariants | StyleStates, params?: {
|
|
8
|
+
styleSelector?: string;
|
|
9
|
+
styleVariant?: string;
|
|
10
|
+
styleState?: StyleState;
|
|
11
|
+
}) => boolean;
|
|
12
|
+
export default isValidValue;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
//#region src/StyleMap/helpers/isValueValid.ts
|
|
2
|
+
var e = (e) => typeof e == "string" || typeof e == "number" || e === void 0, t = (e) => typeof e == "object" && !!e && !Array.isArray(e), n = (n) => t(n) && Object.values(n).every(e), r = (e) => t(e) && Object.values(e).every(n), i = (e) => t(e) && Object.values(e).every((e) => !(!t(e) || "variants" in e || "default" in e && e.default && !n(e.default) || "states" in e && e.states && !r(e.states))), a = (e) => !(!t(e) || !e.default || !n(e.default) || e.states && !r(e.states) || e.variants && !i(e.variants)), o = (e) => e === void 0 || t(e) && !Object.keys(e).length || t(e) && "base" in e && Object.values(e).every(a), s = (s, c, l) => {
|
|
3
|
+
let { styleSelector: u, styleVariant: d, styleState: f } = l ?? {};
|
|
4
|
+
return !s && !u && !d && !f ? o(c) : !s && !u && d && f ? !1 : !s && !u && d ? i(c) : !s && !u && f ? r(c) : s ? e(c) : u ? c === void 0 ? !0 : e(c) || !t(c) ? !1 : n(c) || a(c) : !1;
|
|
5
|
+
};
|
|
6
|
+
//#endregion
|
|
7
|
+
export { s as default, o as isStyleAttributes, n as isStyleObject };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { StyleBlock, StyleCategory, StyleItem, StyleObject, StyleState, StyleStates, StyleValue, StyleVariants } from '@plitzi/sdk-shared';
|
|
2
|
+
declare const parseValue: (path: StyleCategory | undefined, value: StyleItem["attributes"] | StyleValue | Partial<StyleObject> | StyleVariants | StyleStates | StyleBlock | undefined, prevValue: StyleObject) => StyleObject;
|
|
3
|
+
declare const getTargetPath: (styleSelector: string, styleVariant?: string, styleState?: string) => string;
|
|
4
|
+
declare const isEmptyObject: (v: unknown) => v is Record<string, unknown>;
|
|
5
|
+
declare const writeStyle: (mode: "add" | "update" | undefined, styleItem: StyleItem, styleSelector: string, path?: StyleCategory, value?: StyleItem["attributes"] | StyleValue | Partial<StyleObject> | StyleVariants | StyleStates | StyleBlock, styleState?: StyleState, styleVariant?: string) => void;
|
|
6
|
+
export { getTargetPath, isEmptyObject, parseValue, writeStyle };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { isStyleObject as e } from "./isValueValid.mjs";
|
|
2
|
+
import { get as t, omit as n, set as r } from "@plitzi/plitzi-ui/helpers";
|
|
3
|
+
//#region src/StyleMap/helpers/utils.ts
|
|
4
|
+
var i = (t, n, r) => {
|
|
5
|
+
if (t && (typeof n == "string" || typeof n == "number")) return {
|
|
6
|
+
...r,
|
|
7
|
+
[t]: n
|
|
8
|
+
};
|
|
9
|
+
if (n && e(n)) {
|
|
10
|
+
let e = { ...n };
|
|
11
|
+
for (let t in n) e[t] === void 0 && delete e[t];
|
|
12
|
+
return e;
|
|
13
|
+
}
|
|
14
|
+
return r;
|
|
15
|
+
}, a = (e, t, n) => t && n ? `attributes.${e}.variants.${t}.states.${n}` : t ? `attributes.${e}.variants.${t}.default` : n ? `attributes.${e}.states.${n}` : `attributes.${e}.default`, o = (e) => !!e && typeof e == "object" && !Array.isArray(e) && Object.keys(e).length === 0, s = (s = "add", c, l, u, d, f, p) => {
|
|
16
|
+
let m = a(l, p, f), h = !!f || !!p;
|
|
17
|
+
if (d !== void 0) {
|
|
18
|
+
if (e(d) && o(d)) {
|
|
19
|
+
if (s === "update" && h && !t(c, p ? `attributes.${l}.variants` : `attributes.${l}.states`)) return;
|
|
20
|
+
r(c, m, {});
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
r(c, m, i(u, d, t(c, m, {})));
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
if (s === "add" && !u && h) {
|
|
27
|
+
t(c, p ? `attributes.${l}.variants` : `attributes.${l}.states`) || r(c, m, {});
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
if (u) {
|
|
31
|
+
r(c, m, n(t(c, m, {}), [u]));
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
if (p) {
|
|
35
|
+
let e = `attributes.${l}.variants`, i = t(c, e);
|
|
36
|
+
if (!i) return;
|
|
37
|
+
let a = n(i, [p]);
|
|
38
|
+
Object.keys(a).length ? r(c, e, a) : r(c, `attributes.${l}`, n(t(c, `attributes.${l}`), ["variants"]));
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
if (f) {
|
|
42
|
+
let e = `attributes.${l}.states`, i = t(c, e);
|
|
43
|
+
if (!i) return;
|
|
44
|
+
let a = n(i, [f]);
|
|
45
|
+
Object.keys(a).length ? r(c, e, a) : r(c, `attributes.${l}`, n(t(c, `attributes.${l}`), ["states"]));
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
r(c, m, {});
|
|
49
|
+
};
|
|
50
|
+
//#endregion
|
|
51
|
+
export { s as writeStyle };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DisplayMode, Style, StyleBlock, StyleCategory, StyleItem, StyleObject, StyleState, StyleStates, StyleValue, StyleVariants, TagType } from '@plitzi/sdk-shared';
|
|
2
|
+
declare const addSelector: (platform: Style["platform"], displayMode: DisplayMode, selector: string, type: TagType, path: StyleCategory | undefined, value: StyleItem["attributes"] | StyleValue | Partial<StyleObject> | StyleVariants | StyleStates | StyleBlock | undefined, params: {
|
|
3
|
+
componentType?: string;
|
|
4
|
+
styleSelector?: string;
|
|
5
|
+
styleState?: StyleState;
|
|
6
|
+
styleVariant?: string;
|
|
7
|
+
}) => boolean;
|
|
8
|
+
export default addSelector;
|