@webiny/app-website-builder 6.4.0-beta.2 → 6.4.0-beta.4
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/BaseEditor/components/DragPreview/DragCursorWrapper.d.ts +7 -0
- package/BaseEditor/components/DragPreview/DragCursorWrapper.js +17 -0
- package/BaseEditor/components/DragPreview/DragCursorWrapper.js.map +1 -0
- package/BaseEditor/components/DragPreview/DragPreview.js +37 -0
- package/BaseEditor/components/DragPreview/DragPreview.js.map +1 -0
- package/BaseEditor/components/DragPreview/index.d.ts +1 -0
- package/BaseEditor/components/DragPreview/index.js +1 -0
- package/BaseEditor/components/DragPreview/useDragPosition.d.ts +4 -0
- package/BaseEditor/components/DragPreview/useDragPosition.js +26 -0
- package/BaseEditor/components/DragPreview/useDragPosition.js.map +1 -0
- package/BaseEditor/components/Editor.js +1 -2
- package/BaseEditor/components/Editor.js.map +1 -1
- package/BaseEditor/config/EditorConfig.d.ts +4 -2
- package/BaseEditor/config/Layout.js +1 -1
- package/BaseEditor/config/Layout.js.map +1 -1
- package/BaseEditor/config/Sidebar/Layout.js +8 -14
- package/BaseEditor/config/Sidebar/Layout.js.map +1 -1
- package/BaseEditor/config/Sidebar/Sidebar.d.ts +1 -1
- package/BaseEditor/config/Sidebar/Sidebar.js +1 -1
- package/BaseEditor/config/Sidebar/Sidebar.js.map +1 -1
- package/BaseEditor/config/Sidebar/Tab.d.ts +2 -2
- package/BaseEditor/config/Sidebar/Tab.js +3 -3
- package/BaseEditor/config/Sidebar/Tab.js.map +1 -1
- package/BaseEditor/config/Toolbar/Layout.js +8 -14
- package/BaseEditor/config/Toolbar/Layout.js.map +1 -1
- package/BaseEditor/config/Toolbar/Tab.d.ts +10 -0
- package/BaseEditor/config/Toolbar/Tab.js +13 -0
- package/BaseEditor/config/Toolbar/Tab.js.map +1 -0
- package/BaseEditor/config/Toolbar/Toolbar.d.ts +1 -0
- package/BaseEditor/config/Toolbar/Toolbar.js +4 -2
- package/BaseEditor/config/Toolbar/Toolbar.js.map +1 -1
- package/BaseEditor/defaultConfig/Content/AddressBar/AddressBar.js +1 -4
- package/BaseEditor/defaultConfig/Content/AddressBar/AddressBar.js.map +1 -1
- package/BaseEditor/defaultConfig/Content/AddressBar/BreakpointSelector.js +20 -23
- package/BaseEditor/defaultConfig/Content/AddressBar/BreakpointSelector.js.map +1 -1
- package/BaseEditor/defaultConfig/Content/AddressBar/PreviewDomain.js +1 -1
- package/BaseEditor/defaultConfig/Content/AddressBar/PreviewDomain.js.map +1 -1
- package/BaseEditor/defaultConfig/Content/Breadcrumbs/styles.js +2 -2
- package/BaseEditor/defaultConfig/Content/Breadcrumbs/styles.js.map +1 -1
- package/BaseEditor/defaultConfig/Content/ContentPreviewConfig.js +6 -1
- package/BaseEditor/defaultConfig/Content/ContentPreviewConfig.js.map +1 -1
- package/BaseEditor/defaultConfig/Content/Preview/DropZoneManager.d.ts +3 -0
- package/BaseEditor/defaultConfig/Content/Preview/DropZoneManager.js +6 -0
- package/BaseEditor/defaultConfig/Content/Preview/DropZoneManager.js.map +1 -1
- package/BaseEditor/defaultConfig/Content/Preview/Iframe.js +1 -1
- package/BaseEditor/defaultConfig/Content/Preview/Iframe.js.map +1 -1
- package/BaseEditor/defaultConfig/Content/Preview/Overlays/ElementOverlay.js +10 -6
- package/BaseEditor/defaultConfig/Content/Preview/Overlays/ElementOverlay.js.map +1 -1
- package/BaseEditor/defaultConfig/Content/Preview/Preview.js +2 -1
- package/BaseEditor/defaultConfig/Content/Preview/Preview.js.map +1 -1
- package/BaseEditor/defaultConfig/Content/Preview/PreviewContainer.js +12 -2
- package/BaseEditor/defaultConfig/Content/Preview/PreviewContainer.js.map +1 -1
- package/BaseEditor/defaultConfig/Content/Preview/PreviewEvents.js +1 -2
- package/BaseEditor/defaultConfig/Content/Preview/PreviewEvents.js.map +1 -1
- package/BaseEditor/defaultConfig/Content/Preview/useResponsiveContainer.js +1 -1
- package/BaseEditor/defaultConfig/Content/Preview/useResponsiveContainer.js.map +1 -1
- package/BaseEditor/defaultConfig/DefaultEditorConfig.js +3 -5
- package/BaseEditor/defaultConfig/DefaultEditorConfig.js.map +1 -1
- package/BaseEditor/defaultConfig/Sidebar/ElementPreview.d.ts +7 -0
- package/BaseEditor/defaultConfig/Sidebar/ElementPreview.js +23 -0
- package/BaseEditor/defaultConfig/Sidebar/ElementPreview.js.map +1 -0
- package/BaseEditor/defaultConfig/Sidebar/ElementSettings/ElementInputs.js +12 -3
- package/BaseEditor/defaultConfig/Sidebar/ElementSettings/ElementInputs.js.map +1 -1
- package/BaseEditor/defaultConfig/Sidebar/ElementSettings/ElementSettingsGroup.js +6 -0
- package/BaseEditor/defaultConfig/Sidebar/ElementSettings/ElementSettingsGroup.js.map +1 -1
- package/BaseEditor/defaultConfig/Sidebar/ElementSettings/useBindingsForElement.d.ts +5 -5
- package/BaseEditor/defaultConfig/Sidebar/InfoMessage.js +2 -2
- package/BaseEditor/defaultConfig/Sidebar/InfoMessage.js.map +1 -1
- package/BaseEditor/defaultConfig/Sidebar/InheritanceLabel.js +2 -0
- package/BaseEditor/defaultConfig/Sidebar/InheritanceLabel.js.map +1 -1
- package/BaseEditor/defaultConfig/Sidebar/SidebarEmptyState.d.ts +4 -0
- package/BaseEditor/defaultConfig/Sidebar/SidebarEmptyState.js +12 -0
- package/BaseEditor/defaultConfig/Sidebar/SidebarEmptyState.js.map +1 -0
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Background/BackgroundColor.js +8 -5
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Background/BackgroundColor.js.map +1 -1
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Background/BackgroundImage.js +11 -9
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Background/BackgroundImage.js.map +1 -1
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Background/BackgroundPosition.js +7 -4
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Background/BackgroundPosition.js.map +1 -1
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Background/BackgroundScaling.js +7 -4
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Background/BackgroundScaling.js.map +1 -1
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Background.js +8 -4
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Background.js.map +1 -1
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border/Border.js +1 -1
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border/Border.js.map +1 -1
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border/BorderColor.js +7 -4
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border/BorderColor.js.map +1 -1
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border/BorderRadius.js +11 -14
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border/BorderRadius.js.map +1 -1
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border/BorderStyle.js +7 -4
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border/BorderStyle.js.map +1 -1
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border/BorderWidth.js +11 -14
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border/BorderWidth.js.map +1 -1
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border.js +6 -9
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border.js.map +1 -1
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Layout/Alignment.js +8 -5
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Layout/Alignment.js.map +1 -1
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Layout/LengthWithUnitInput.js +9 -8
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Layout/LengthWithUnitInput.js.map +1 -1
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Layout.js +8 -4
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Layout.js.map +1 -1
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/MarginPadding/LinkedEditing.js +1 -5
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/MarginPadding/LinkedEditing.js.map +1 -1
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/MarginPadding/Margin.js +10 -21
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/MarginPadding/Margin.js.map +1 -1
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/MarginPadding/MarginPadding.js +2 -1
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/MarginPadding/MarginPadding.js.map +1 -1
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/MarginPadding/Padding.js +13 -16
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/MarginPadding/Padding.js.map +1 -1
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/MarginPadding.js +6 -9
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/MarginPadding.js.map +1 -1
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Visibility/Visibility.js +21 -7
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Visibility/Visibility.js.map +1 -1
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/VisibilityGroup.js +4 -3
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/VisibilityGroup.js.map +1 -1
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/SidebarRow.d.ts +8 -0
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/SidebarRow.js +24 -0
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/SidebarRow.js.map +1 -0
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/StyleAccordion.d.ts +8 -0
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/StyleAccordion.js +11 -0
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/StyleAccordion.js.map +1 -0
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/StyleAccordionItem.d.ts +9 -0
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/StyleAccordionItem.js +45 -0
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/StyleAccordionItem.js.map +1 -0
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/StyleProperties.js +8 -3
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/StyleProperties.js.map +1 -1
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/StyleSettingsGroup.js +8 -7
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/StyleSettingsGroup.js.map +1 -1
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/StylesStore.js +2 -2
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/StylesStore.js.map +1 -1
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/UnitValuePicker.js +3 -1
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/UnitValuePicker.js.map +1 -1
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/ValueSelector.js +9 -8
- package/BaseEditor/defaultConfig/Sidebar/StyleSettings/ValueSelector.js.map +1 -1
- package/BaseEditor/defaultConfig/Toolbar/InsertElements/GridItem.d.ts +5 -0
- package/BaseEditor/defaultConfig/Toolbar/InsertElements/GridItem.js +24 -0
- package/BaseEditor/defaultConfig/Toolbar/InsertElements/GridItem.js.map +1 -0
- package/BaseEditor/defaultConfig/Toolbar/InsertElements/GroupItemsGrid.d.ts +7 -0
- package/BaseEditor/defaultConfig/Toolbar/InsertElements/GroupItemsGrid.js +18 -0
- package/BaseEditor/defaultConfig/Toolbar/InsertElements/GroupItemsGrid.js.map +1 -0
- package/BaseEditor/defaultConfig/Toolbar/InsertElements/GroupItemsList.d.ts +7 -0
- package/BaseEditor/defaultConfig/Toolbar/InsertElements/GroupItemsList.js +18 -0
- package/BaseEditor/defaultConfig/Toolbar/InsertElements/GroupItemsList.js.map +1 -0
- package/BaseEditor/defaultConfig/Toolbar/InsertElements/InsertElements.js +72 -36
- package/BaseEditor/defaultConfig/Toolbar/InsertElements/InsertElements.js.map +1 -1
- package/BaseEditor/defaultConfig/Toolbar/InsertElements/InsertElementsTab.js +6 -7
- package/BaseEditor/defaultConfig/Toolbar/InsertElements/InsertElementsTab.js.map +1 -1
- package/BaseEditor/defaultConfig/Toolbar/InsertElements/ListItem.d.ts +5 -0
- package/BaseEditor/defaultConfig/Toolbar/InsertElements/ListItem.js +23 -0
- package/BaseEditor/defaultConfig/Toolbar/InsertElements/ListItem.js.map +1 -0
- package/BaseEditor/defaultConfig/Toolbar/Navigator/ElementActions.d.ts +4 -0
- package/BaseEditor/defaultConfig/Toolbar/Navigator/ElementActions.js +29 -0
- package/BaseEditor/defaultConfig/Toolbar/Navigator/ElementActions.js.map +1 -0
- package/BaseEditor/defaultConfig/Toolbar/Navigator/LayoutIllustration.d.ts +2 -0
- package/BaseEditor/defaultConfig/Toolbar/Navigator/LayoutIllustration.js +94 -0
- package/BaseEditor/defaultConfig/Toolbar/Navigator/LayoutIllustration.js.map +1 -0
- package/BaseEditor/defaultConfig/Toolbar/Navigator/Navigator.js +12 -111
- package/BaseEditor/defaultConfig/Toolbar/Navigator/Navigator.js.map +1 -1
- package/BaseEditor/defaultConfig/Toolbar/Navigator/NavigatorEmptyState.d.ts +2 -0
- package/BaseEditor/defaultConfig/Toolbar/Navigator/NavigatorEmptyState.js +20 -0
- package/BaseEditor/defaultConfig/Toolbar/Navigator/NavigatorEmptyState.js.map +1 -0
- package/BaseEditor/defaultConfig/Toolbar/Navigator/NavigatorTab.js +6 -7
- package/BaseEditor/defaultConfig/Toolbar/Navigator/NavigatorTab.js.map +1 -1
- package/BaseEditor/defaultConfig/Toolbar/Navigator/Placeholder.d.ts +7 -0
- package/BaseEditor/defaultConfig/Toolbar/Navigator/Placeholder.js +16 -0
- package/BaseEditor/defaultConfig/Toolbar/Navigator/Placeholder.js.map +1 -0
- package/BaseEditor/defaultConfig/Toolbar/Navigator/navigatorUtils.d.ts +32 -0
- package/BaseEditor/defaultConfig/Toolbar/Navigator/navigatorUtils.js +70 -0
- package/BaseEditor/defaultConfig/Toolbar/Navigator/navigatorUtils.js.map +1 -0
- package/BaseEditor/hooks/useCreateElement.d.ts +1 -1
- package/BaseEditor/hooks/useCreateElement.js +1 -3
- package/BaseEditor/hooks/useCreateElement.js.map +1 -1
- package/ecommerce/EcommerceIntegration.js +1 -1
- package/ecommerce/EcommerceIntegration.js.map +1 -1
- package/ecommerce/components/ResourcePage.d.ts +1 -1
- package/ecommerce/components/ResourcePage.js +1 -1
- package/ecommerce/components/ResourcePage.js.map +1 -1
- package/exports/admin/website-builder/lexical.d.ts +18 -17
- package/exports/admin/website-builder/lexical.js +3 -2
- package/features/ecommerce/apis/useEcommerceApi.js +3 -1
- package/features/ecommerce/apis/useEcommerceApi.js.map +1 -1
- package/inputRenderers/BooleanInput.js +15 -4
- package/inputRenderers/BooleanInput.js.map +1 -1
- package/inputRenderers/FileInput.js.map +1 -1
- package/inputRenderers/LexicalInput/DefaultLexicalConfig.js +4 -1
- package/inputRenderers/LexicalInput/DefaultLexicalConfig.js.map +1 -1
- package/inputRenderers/LexicalInput/ExpandEditorAction.js +4 -1
- package/inputRenderers/LexicalInput/ExpandEditorAction.js.map +1 -1
- package/inputRenderers/LexicalInput/LexicalEditor.d.ts +4 -1
- package/inputRenderers/LexicalInput/LexicalEditor.js +13 -2
- package/inputRenderers/LexicalInput/LexicalEditor.js.map +1 -1
- package/inputRenderers/LexicalInput/LexicalEditorConfig.d.ts +18 -0
- package/inputRenderers/LexicalInput/LexicalEditorConfig.js +5 -1
- package/inputRenderers/LexicalInput/LexicalEditorConfig.js.map +1 -1
- package/inputRenderers/LexicalInput/LexicalInput.js +5 -9
- package/inputRenderers/LexicalInput/LexicalInput.js.map +1 -1
- package/inputRenderers/LexicalInput/wbStaticToolbar.css +1 -1
- package/inputRenderers/TextInput.js +3 -1
- package/inputRenderers/TextInput.js.map +1 -1
- package/modules/pages/PageEditor/PageEditorConfig.d.ts +4 -2
- package/modules/pages/PageEditor/PageSettings/PageSettingsPresenter.js +2 -2
- package/modules/pages/PageEditor/PageSettings/PageSettingsPresenter.js.map +1 -1
- package/package.json +31 -29
- package/BaseEditor/components/DragPreview.js +0 -59
- package/BaseEditor/components/DragPreview.js.map +0 -1
- package/ecommerce/components/adaptInputToBind.d.ts +0 -6
- package/ecommerce/components/adaptInputToBind.js +0 -26
- package/ecommerce/components/adaptInputToBind.js.map +0 -1
- /package/BaseEditor/components/{DragPreview.d.ts → DragPreview/DragPreview.d.ts} +0 -0
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import react from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { Grid } from "@webiny/admin-ui";
|
|
3
|
+
import { ReactComponent } from "@webiny/icons/bento.svg";
|
|
4
|
+
import { StyleAccordion } from "../StyleAccordion.js";
|
|
3
5
|
import { BackgroundImage } from "./Background/BackgroundImage.js";
|
|
4
6
|
import { BackgroundColor } from "./Background/BackgroundColor.js";
|
|
5
7
|
import { BackgroundPosition } from "./Background/BackgroundPosition.js";
|
|
6
8
|
import { BackgroundScaling } from "./Background/BackgroundScaling.js";
|
|
7
|
-
const Background = ({ elementId })=>/*#__PURE__*/ react.createElement(
|
|
9
|
+
const Background = ({ elementId })=>/*#__PURE__*/ react.createElement(StyleAccordion.Item, {
|
|
8
10
|
title: "Background",
|
|
9
|
-
|
|
10
|
-
}, /*#__PURE__*/ react.createElement(Grid,
|
|
11
|
+
icon: /*#__PURE__*/ react.createElement(ReactComponent, null)
|
|
12
|
+
}, /*#__PURE__*/ react.createElement(Grid, {
|
|
13
|
+
gap: "small"
|
|
14
|
+
}, /*#__PURE__*/ react.createElement(Grid.Column, {
|
|
11
15
|
span: 12
|
|
12
16
|
}, /*#__PURE__*/ react.createElement(BackgroundColor, {
|
|
13
17
|
elementId: elementId
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Background.js","sources":["../../../../../../src/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Background.tsx"],"sourcesContent":["import React from \"react\";\nimport {
|
|
1
|
+
{"version":3,"file":"BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Background.js","sources":["../../../../../../src/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Background.tsx"],"sourcesContent":["import React from \"react\";\nimport { Grid } from \"@webiny/admin-ui\";\nimport { ReactComponent as BackgroundIcon } from \"@webiny/icons/bento.svg\";\nimport { StyleAccordion } from \"../StyleAccordion.js\";\nimport { BackgroundImage } from \"./Background/BackgroundImage.js\";\nimport { BackgroundColor } from \"./Background/BackgroundColor.js\";\nimport { BackgroundPosition } from \"./Background/BackgroundPosition.js\";\nimport { BackgroundScaling } from \"./Background/BackgroundScaling.js\";\n\ninterface BackgroundProps {\n elementId: string;\n}\n\nexport const Background = ({ elementId }: BackgroundProps) => {\n return (\n <StyleAccordion.Item title={\"Background\"} icon={<BackgroundIcon />}>\n <Grid gap={\"small\"}>\n <Grid.Column span={12}>\n <BackgroundColor elementId={elementId} />\n </Grid.Column>\n <Grid.Column span={12}>\n <BackgroundImage elementId={elementId} />\n </Grid.Column>\n <Grid.Column span={12}>\n <BackgroundPosition elementId={elementId} />\n </Grid.Column>\n <Grid.Column span={12}>\n <BackgroundScaling elementId={elementId} />\n </Grid.Column>\n </Grid>\n </StyleAccordion.Item>\n );\n};\n"],"names":["Background","elementId","StyleAccordion","BackgroundIcon","Grid","BackgroundColor","BackgroundImage","BackgroundPosition","BackgroundScaling"],"mappings":";;;;;;;;AAaO,MAAMA,aAAa,CAAC,EAAEC,SAAS,EAAmB,GAC9C,WAAP,GACI,oBAACC,eAAe,IAAI;QAAC,OAAO;QAAc,oBAAM,oBAACC,gBAAcA;qBAC3D,oBAACC,MAAIA;QAAC,KAAK;qBACP,oBAACA,KAAK,MAAM;QAAC,MAAM;qBACf,oBAACC,iBAAeA;QAAC,WAAWJ;uBAEhC,oBAACG,KAAK,MAAM;QAAC,MAAM;qBACf,oBAACE,iBAAeA;QAAC,WAAWL;uBAEhC,oBAACG,KAAK,MAAM;QAAC,MAAM;qBACf,oBAACG,oBAAkBA;QAAC,WAAWN;uBAEnC,oBAACG,KAAK,MAAM;QAAC,MAAM;qBACf,oBAACI,mBAAiBA;QAAC,WAAWP"}
|
|
@@ -4,7 +4,7 @@ import { BorderRadius } from "./BorderRadius.js";
|
|
|
4
4
|
import { BorderStyle } from "./BorderStyle.js";
|
|
5
5
|
import { BorderColor } from "./BorderColor.js";
|
|
6
6
|
const BorderControl = ({ elementId })=>/*#__PURE__*/ react.createElement("div", {
|
|
7
|
-
className: "flex flex-col gap-
|
|
7
|
+
className: "flex flex-col gap-md w-full"
|
|
8
8
|
}, /*#__PURE__*/ react.createElement(BorderWidth, {
|
|
9
9
|
elementId: elementId
|
|
10
10
|
}), /*#__PURE__*/ react.createElement(BorderRadius, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border/Border.js","sources":["../../../../../../../src/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border/Border.tsx"],"sourcesContent":["import React from \"react\";\nimport { BorderWidth } from \"./BorderWidth.js\";\nimport { BorderRadius } from \"./BorderRadius.js\";\nimport { BorderStyle } from \"./BorderStyle.js\";\nimport { BorderColor } from \"./BorderColor.js\";\n\nexport const BorderControl = ({ elementId }: { elementId: string }) => {\n return (\n <div className=\"flex flex-col gap-
|
|
1
|
+
{"version":3,"file":"BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border/Border.js","sources":["../../../../../../../src/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border/Border.tsx"],"sourcesContent":["import React from \"react\";\nimport { BorderWidth } from \"./BorderWidth.js\";\nimport { BorderRadius } from \"./BorderRadius.js\";\nimport { BorderStyle } from \"./BorderStyle.js\";\nimport { BorderColor } from \"./BorderColor.js\";\n\nexport const BorderControl = ({ elementId }: { elementId: string }) => {\n return (\n <div className=\"flex flex-col gap-md w-full\">\n <BorderWidth elementId={elementId} />\n <BorderRadius elementId={elementId} />\n <BorderStyle elementId={elementId} />\n <BorderColor elementId={elementId} />\n </div>\n );\n};\n"],"names":["BorderControl","elementId","BorderWidth","BorderRadius","BorderStyle","BorderColor"],"mappings":";;;;;AAMO,MAAMA,gBAAgB,CAAC,EAAEC,SAAS,EAAyB,GACvD,WAAP,GACI,oBAAC;QAAI,WAAU;qBACX,oBAACC,aAAWA;QAAC,WAAWD;sBACxB,oBAACE,cAAYA;QAAC,WAAWF;sBACzB,oBAACG,aAAWA;QAAC,WAAWH;sBACxB,oBAACI,aAAWA;QAAC,WAAWJ"}
|
|
@@ -3,6 +3,7 @@ import { observer } from "mobx-react-lite";
|
|
|
3
3
|
import { ColorPicker } from "@webiny/admin-ui";
|
|
4
4
|
import { useStyles } from "../../useStyles.js";
|
|
5
5
|
import { InheritanceLabel } from "../../../InheritanceLabel.js";
|
|
6
|
+
import { SidebarRow } from "../../SidebarRow.js";
|
|
6
7
|
const BorderColor = observer(({ elementId })=>{
|
|
7
8
|
const { styles, onChange, onPreviewChange, inheritanceMap } = useStyles(elementId);
|
|
8
9
|
const handleDrag = (value)=>{
|
|
@@ -21,18 +22,20 @@ const BorderColor = observer(({ elementId })=>{
|
|
|
21
22
|
});
|
|
22
23
|
};
|
|
23
24
|
const inheritance = inheritanceMap?.borderColor ?? {};
|
|
24
|
-
return /*#__PURE__*/ react.createElement(
|
|
25
|
+
return /*#__PURE__*/ react.createElement(SidebarRow, {
|
|
25
26
|
label: /*#__PURE__*/ react.createElement(InheritanceLabel, {
|
|
26
27
|
onReset: onReset,
|
|
27
28
|
isOverridden: inheritance?.overridden ?? false,
|
|
28
29
|
inheritedFrom: inheritance?.inheritedFrom,
|
|
29
30
|
text: "Border color"
|
|
30
|
-
})
|
|
31
|
-
|
|
31
|
+
})
|
|
32
|
+
}, /*#__PURE__*/ react.createElement(ColorPicker, {
|
|
33
|
+
size: "md",
|
|
34
|
+
variant: "secondary",
|
|
32
35
|
value: styles.borderColor ?? "transparent",
|
|
33
36
|
onChange: handleDrag,
|
|
34
37
|
onChangeComplete: handleCommit
|
|
35
|
-
});
|
|
38
|
+
}));
|
|
36
39
|
});
|
|
37
40
|
export { BorderColor };
|
|
38
41
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border/BorderColor.js","sources":["../../../../../../../src/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border/BorderColor.tsx"],"sourcesContent":["import React from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { ColorPicker } from \"@webiny/admin-ui\";\nimport { useStyles } from \"../../useStyles.js\";\nimport { InheritanceLabel } from \"~/BaseEditor/defaultConfig/Sidebar/InheritanceLabel.js\";\n\ninterface BorderColorProps {\n elementId: string;\n}\n\nexport const BorderColor = observer(({ elementId }: BorderColorProps) => {\n const { styles, onChange, onPreviewChange, inheritanceMap } = useStyles(elementId);\n\n const handleDrag = (value: string) => {\n onPreviewChange(({ styles }) => {\n styles.set(\"borderColor\", value);\n });\n };\n\n const handleCommit = (value: string) => {\n onChange(({ styles }) => {\n styles.set(\"borderColor\", value);\n });\n };\n\n const onReset = () => {\n onChange(({ styles }) => {\n styles.unset(\"borderColor\");\n });\n };\n\n const inheritance = inheritanceMap?.borderColor ?? {};\n\n return (\n <
|
|
1
|
+
{"version":3,"file":"BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border/BorderColor.js","sources":["../../../../../../../src/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border/BorderColor.tsx"],"sourcesContent":["import React from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { ColorPicker } from \"@webiny/admin-ui\";\nimport { useStyles } from \"../../useStyles.js\";\nimport { InheritanceLabel } from \"~/BaseEditor/defaultConfig/Sidebar/InheritanceLabel.js\";\nimport { SidebarRow } from \"~/BaseEditor/defaultConfig/Sidebar/StyleSettings/SidebarRow.js\";\n\ninterface BorderColorProps {\n elementId: string;\n}\n\nexport const BorderColor = observer(({ elementId }: BorderColorProps) => {\n const { styles, onChange, onPreviewChange, inheritanceMap } = useStyles(elementId);\n\n const handleDrag = (value: string) => {\n onPreviewChange(({ styles }) => {\n styles.set(\"borderColor\", value);\n });\n };\n\n const handleCommit = (value: string) => {\n onChange(({ styles }) => {\n styles.set(\"borderColor\", value);\n });\n };\n\n const onReset = () => {\n onChange(({ styles }) => {\n styles.unset(\"borderColor\");\n });\n };\n\n const inheritance = inheritanceMap?.borderColor ?? {};\n\n return (\n <SidebarRow\n label={\n <InheritanceLabel\n onReset={onReset}\n isOverridden={inheritance?.overridden ?? false}\n inheritedFrom={inheritance?.inheritedFrom}\n text={\"Border color\"}\n />\n }\n >\n <ColorPicker\n size={\"md\"}\n variant={\"secondary\"}\n value={styles.borderColor ?? \"transparent\"}\n onChange={handleDrag}\n onChangeComplete={handleCommit}\n />\n </SidebarRow>\n );\n});\n"],"names":["BorderColor","observer","elementId","styles","onChange","onPreviewChange","inheritanceMap","useStyles","handleDrag","value","handleCommit","onReset","inheritance","SidebarRow","InheritanceLabel","ColorPicker"],"mappings":";;;;;;AAWO,MAAMA,cAAcC,SAAS,CAAC,EAAEC,SAAS,EAAoB;IAChE,MAAM,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,eAAe,EAAEC,cAAc,EAAE,GAAGC,UAAUL;IAExE,MAAMM,aAAa,CAACC;QAChBJ,gBAAgB,CAAC,EAAEF,MAAM,EAAE;YACvBA,OAAO,GAAG,CAAC,eAAeM;QAC9B;IACJ;IAEA,MAAMC,eAAe,CAACD;QAClBL,SAAS,CAAC,EAAED,MAAM,EAAE;YAChBA,OAAO,GAAG,CAAC,eAAeM;QAC9B;IACJ;IAEA,MAAME,UAAU;QACZP,SAAS,CAAC,EAAED,MAAM,EAAE;YAChBA,OAAO,KAAK,CAAC;QACjB;IACJ;IAEA,MAAMS,cAAcN,gBAAgB,eAAe,CAAC;IAEpD,OAAO,WAAP,GACI,oBAACO,YAAUA;QACP,qBACI,oBAACC,kBAAgBA;YACb,SAASH;YACT,cAAcC,aAAa,cAAc;YACzC,eAAeA,aAAa;YAC5B,MAAM;;qBAId,oBAACG,aAAWA;QACR,MAAM;QACN,SAAS;QACT,OAAOZ,OAAO,WAAW,IAAI;QAC7B,UAAUK;QACV,kBAAkBE;;AAIlC"}
|
|
@@ -53,21 +53,13 @@ const BorderRadius = observer(({ elementId })=>{
|
|
|
53
53
|
};
|
|
54
54
|
const rowClassname = "flex flex-row w-full justify-center items-center py-xs";
|
|
55
55
|
return /*#__PURE__*/ react.createElement("div", {
|
|
56
|
-
className: "flex flex-col items-center bg-neutral-light
|
|
56
|
+
className: "flex flex-col items-center bg-neutral-light text-neutral-strong rounded-xl p-sm"
|
|
57
|
+
}, /*#__PURE__*/ react.createElement("div", {
|
|
58
|
+
className: "grid grid-cols-3 items-center w-full relative"
|
|
57
59
|
}, /*#__PURE__*/ react.createElement("span", {
|
|
58
|
-
className: "
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
left: 5
|
|
62
|
-
}
|
|
63
|
-
}, "Border radius"), /*#__PURE__*/ react.createElement(LinkedEditing, {
|
|
64
|
-
linked: linked,
|
|
65
|
-
onToggle: onToggleLinkedEditing
|
|
66
|
-
}), /*#__PURE__*/ react.createElement("div", {
|
|
67
|
-
className: rowClassname,
|
|
68
|
-
style: {
|
|
69
|
-
paddingTop: "8px"
|
|
70
|
-
}
|
|
60
|
+
className: "text-sm"
|
|
61
|
+
}, "Border radius"), /*#__PURE__*/ react.createElement("div", {
|
|
62
|
+
className: "flex justify-center"
|
|
71
63
|
}, /*#__PURE__*/ react.createElement(ValueSelector, {
|
|
72
64
|
label: linked ? "Border radius" : "Top-left radius",
|
|
73
65
|
...topLeft,
|
|
@@ -76,6 +68,11 @@ const BorderRadius = observer(({ elementId })=>{
|
|
|
76
68
|
onChange: onTopLeftChange,
|
|
77
69
|
onChangePreview: onTopLeftPreviewChange
|
|
78
70
|
})), /*#__PURE__*/ react.createElement("div", {
|
|
71
|
+
className: "flex justify-end"
|
|
72
|
+
}, /*#__PURE__*/ react.createElement(LinkedEditing, {
|
|
73
|
+
linked: linked,
|
|
74
|
+
onToggle: onToggleLinkedEditing
|
|
75
|
+
}))), /*#__PURE__*/ react.createElement("div", {
|
|
79
76
|
className: rowClassname,
|
|
80
77
|
style: {
|
|
81
78
|
width: 168,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border/BorderRadius.js","sources":["../../../../../../../src/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border/BorderRadius.tsx"],"sourcesContent":["import React from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { LinkedEditing } from \"./LinkedEditing.js\";\nimport { useStyles } from \"../../useStyles.js\";\nimport { ValueSelector } from \"../../ValueSelector.js\";\nimport { useStyleValue } from \"../../useStyleValue.js\";\nimport { UnitsOptions } from \"../../UnitsOptions.js\";\n\nconst radiusOptions = UnitsOptions.widthUnits().getOptions();\n\ninterface BorderRadiusProps {\n elementId: string;\n}\n\nexport const BorderRadius = observer(({ elementId }: BorderRadiusProps) => {\n const { onChange, onPreviewChange, metadata } = useStyles(elementId);\n\n const topLeft = useStyleValue(elementId, \"borderTopLeftRadius\");\n const topRight = useStyleValue(elementId, \"borderTopRightRadius\");\n const bottomRight = useStyleValue(elementId, \"borderBottomRightRadius\");\n const bottomLeft = useStyleValue(elementId, \"borderBottomLeftRadius\");\n\n const linked = metadata.get<boolean>(\"borderRadiusLinkedEditing\") ?? true;\n\n const onToggleLinkedEditing = (linked: boolean) => {\n onChange(({ styles, metadata }) => {\n if (linked) {\n const value = `${topLeft.value ?? 0}${topLeft.unit}`;\n styles.set(\"borderTopRightRadius\", value);\n styles.set(\"borderBottomRightRadius\", value);\n styles.set(\"borderBottomLeftRadius\", value);\n }\n metadata.set(\"borderRadiusLinkedEditing\", linked);\n });\n };\n\n const onTopLeftChange = (value: string) => {\n if (linked) {\n onChange(({ styles }) => {\n styles.set(\"borderTopLeftRadius\", value);\n styles.set(\"borderTopRightRadius\", value);\n styles.set(\"borderBottomRightRadius\", value);\n styles.set(\"borderBottomLeftRadius\", value);\n });\n } else {\n topLeft.onChange(value);\n }\n };\n\n const onTopLeftPreviewChange = (value: string) => {\n if (linked) {\n onPreviewChange(({ styles }) => {\n styles.set(\"borderTopLeftRadius\", value);\n styles.set(\"borderTopRightRadius\", value);\n styles.set(\"borderBottomRightRadius\", value);\n styles.set(\"borderBottomLeftRadius\", value);\n });\n } else {\n topLeft.onChangePreview(value);\n }\n };\n\n const onReset = () => {\n if (linked) {\n onChange(({ styles }) => {\n styles.unset(\"borderTopLeftRadius\");\n styles.unset(\"borderTopRightRadius\");\n styles.unset(\"borderBottomRightRadius\");\n styles.unset(\"borderBottomLeftRadius\");\n });\n } else {\n topLeft.onReset();\n }\n };\n\n const rowClassname = \"flex flex-row w-full justify-center items-center py-xs\";\n\n return (\n <div className=\"flex flex-col items-center bg-neutral-light
|
|
1
|
+
{"version":3,"file":"BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border/BorderRadius.js","sources":["../../../../../../../src/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border/BorderRadius.tsx"],"sourcesContent":["import React from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { LinkedEditing } from \"./LinkedEditing.js\";\nimport { useStyles } from \"../../useStyles.js\";\nimport { ValueSelector } from \"../../ValueSelector.js\";\nimport { useStyleValue } from \"../../useStyleValue.js\";\nimport { UnitsOptions } from \"../../UnitsOptions.js\";\n\nconst radiusOptions = UnitsOptions.widthUnits().getOptions();\n\ninterface BorderRadiusProps {\n elementId: string;\n}\n\nexport const BorderRadius = observer(({ elementId }: BorderRadiusProps) => {\n const { onChange, onPreviewChange, metadata } = useStyles(elementId);\n\n const topLeft = useStyleValue(elementId, \"borderTopLeftRadius\");\n const topRight = useStyleValue(elementId, \"borderTopRightRadius\");\n const bottomRight = useStyleValue(elementId, \"borderBottomRightRadius\");\n const bottomLeft = useStyleValue(elementId, \"borderBottomLeftRadius\");\n\n const linked = metadata.get<boolean>(\"borderRadiusLinkedEditing\") ?? true;\n\n const onToggleLinkedEditing = (linked: boolean) => {\n onChange(({ styles, metadata }) => {\n if (linked) {\n const value = `${topLeft.value ?? 0}${topLeft.unit}`;\n styles.set(\"borderTopRightRadius\", value);\n styles.set(\"borderBottomRightRadius\", value);\n styles.set(\"borderBottomLeftRadius\", value);\n }\n metadata.set(\"borderRadiusLinkedEditing\", linked);\n });\n };\n\n const onTopLeftChange = (value: string) => {\n if (linked) {\n onChange(({ styles }) => {\n styles.set(\"borderTopLeftRadius\", value);\n styles.set(\"borderTopRightRadius\", value);\n styles.set(\"borderBottomRightRadius\", value);\n styles.set(\"borderBottomLeftRadius\", value);\n });\n } else {\n topLeft.onChange(value);\n }\n };\n\n const onTopLeftPreviewChange = (value: string) => {\n if (linked) {\n onPreviewChange(({ styles }) => {\n styles.set(\"borderTopLeftRadius\", value);\n styles.set(\"borderTopRightRadius\", value);\n styles.set(\"borderBottomRightRadius\", value);\n styles.set(\"borderBottomLeftRadius\", value);\n });\n } else {\n topLeft.onChangePreview(value);\n }\n };\n\n const onReset = () => {\n if (linked) {\n onChange(({ styles }) => {\n styles.unset(\"borderTopLeftRadius\");\n styles.unset(\"borderTopRightRadius\");\n styles.unset(\"borderBottomRightRadius\");\n styles.unset(\"borderBottomLeftRadius\");\n });\n } else {\n topLeft.onReset();\n }\n };\n\n const rowClassname = \"flex flex-row w-full justify-center items-center py-xs\";\n\n return (\n <div className=\"flex flex-col items-center bg-neutral-light text-neutral-strong rounded-xl p-sm\">\n {/* Top-left (master when linked) */}\n <div className={\"grid grid-cols-3 items-center w-full relative\"}>\n <span className=\"text-sm\">Border radius</span>\n <div className={\"flex justify-center\"}>\n <ValueSelector\n label={linked ? \"Border radius\" : \"Top-left radius\"}\n {...topLeft}\n onReset={onReset}\n units={radiusOptions}\n onChange={onTopLeftChange}\n onChangePreview={onTopLeftPreviewChange}\n />\n </div>\n <div className={\"flex justify-end\"}>\n <LinkedEditing linked={linked} onToggle={onToggleLinkedEditing} />\n </div>\n </div>\n\n {/* Center row: bottom-left | box | top-right */}\n <div className={rowClassname} style={{ width: 168, paddingTop: \"8px\" }}>\n <ValueSelector\n label={\"Bottom-left radius\"}\n {...bottomLeft}\n units={radiusOptions}\n disabled={linked}\n />\n <div\n className=\"flex border-sm border-neutral-muted bg-neutral-light items-center justify-center\"\n style={{ width: 170, height: 30, borderRadius: 8 }}\n >\n -\n </div>\n <ValueSelector\n label={\"Top-right radius\"}\n {...topRight}\n units={radiusOptions}\n disabled={linked}\n />\n </div>\n\n {/* Bottom-right */}\n <div className={rowClassname} style={{ padding: \"8px 0\" }}>\n <ValueSelector\n label={\"Bottom-right radius\"}\n {...bottomRight}\n units={radiusOptions}\n disabled={linked}\n />\n </div>\n </div>\n );\n});\n"],"names":["radiusOptions","UnitsOptions","BorderRadius","observer","elementId","onChange","onPreviewChange","metadata","useStyles","topLeft","useStyleValue","topRight","bottomRight","bottomLeft","linked","onToggleLinkedEditing","styles","value","onTopLeftChange","onTopLeftPreviewChange","onReset","rowClassname","ValueSelector","LinkedEditing"],"mappings":";;;;;;;AAQA,MAAMA,gBAAgBC,aAAa,UAAU,GAAG,UAAU;AAMnD,MAAMC,eAAeC,SAAS,CAAC,EAAEC,SAAS,EAAqB;IAClE,MAAM,EAAEC,QAAQ,EAAEC,eAAe,EAAEC,QAAQ,EAAE,GAAGC,UAAUJ;IAE1D,MAAMK,UAAUC,cAAcN,WAAW;IACzC,MAAMO,WAAWD,cAAcN,WAAW;IAC1C,MAAMQ,cAAcF,cAAcN,WAAW;IAC7C,MAAMS,aAAaH,cAAcN,WAAW;IAE5C,MAAMU,SAASP,SAAS,GAAG,CAAU,gCAAgC;IAErE,MAAMQ,wBAAwB,CAACD;QAC3BT,SAAS,CAAC,EAAEW,MAAM,EAAET,QAAQ,EAAE;YAC1B,IAAIO,QAAQ;gBACR,MAAMG,QAAQ,GAAGR,QAAQ,KAAK,IAAI,IAAIA,QAAQ,IAAI,EAAE;gBACpDO,OAAO,GAAG,CAAC,wBAAwBC;gBACnCD,OAAO,GAAG,CAAC,2BAA2BC;gBACtCD,OAAO,GAAG,CAAC,0BAA0BC;YACzC;YACAV,SAAS,GAAG,CAAC,6BAA6BO;QAC9C;IACJ;IAEA,MAAMI,kBAAkB,CAACD;QACrB,IAAIH,QACAT,SAAS,CAAC,EAAEW,MAAM,EAAE;YAChBA,OAAO,GAAG,CAAC,uBAAuBC;YAClCD,OAAO,GAAG,CAAC,wBAAwBC;YACnCD,OAAO,GAAG,CAAC,2BAA2BC;YACtCD,OAAO,GAAG,CAAC,0BAA0BC;QACzC;aAEAR,QAAQ,QAAQ,CAACQ;IAEzB;IAEA,MAAME,yBAAyB,CAACF;QAC5B,IAAIH,QACAR,gBAAgB,CAAC,EAAEU,MAAM,EAAE;YACvBA,OAAO,GAAG,CAAC,uBAAuBC;YAClCD,OAAO,GAAG,CAAC,wBAAwBC;YACnCD,OAAO,GAAG,CAAC,2BAA2BC;YACtCD,OAAO,GAAG,CAAC,0BAA0BC;QACzC;aAEAR,QAAQ,eAAe,CAACQ;IAEhC;IAEA,MAAMG,UAAU;QACZ,IAAIN,QACAT,SAAS,CAAC,EAAEW,MAAM,EAAE;YAChBA,OAAO,KAAK,CAAC;YACbA,OAAO,KAAK,CAAC;YACbA,OAAO,KAAK,CAAC;YACbA,OAAO,KAAK,CAAC;QACjB;aAEAP,QAAQ,OAAO;IAEvB;IAEA,MAAMY,eAAe;IAErB,OAAO,WAAP,GACI,oBAAC;QAAI,WAAU;qBAEX,oBAAC;QAAI,WAAW;qBACZ,oBAAC;QAAK,WAAU;OAAU,gCAC1B,oBAAC;QAAI,WAAW;qBACZ,oBAACC,eAAaA;QACV,OAAOR,SAAS,kBAAkB;QACjC,GAAGL,OAAO;QACX,SAASW;QACT,OAAOpB;QACP,UAAUkB;QACV,iBAAiBC;uBAGzB,oBAAC;QAAI,WAAW;qBACZ,oBAACI,eAAaA;QAAC,QAAQT;QAAQ,UAAUC;wBAKjD,oBAAC;QAAI,WAAWM;QAAc,OAAO;YAAE,OAAO;YAAK,YAAY;QAAM;qBACjE,oBAACC,eAAaA;QACV,OAAO;QACN,GAAGT,UAAU;QACd,OAAOb;QACP,UAAUc;sBAEd,oBAAC;QACG,WAAU;QACV,OAAO;YAAE,OAAO;YAAK,QAAQ;YAAI,cAAc;QAAE;OACpD,oBAGD,oBAACQ,eAAaA;QACV,OAAO;QACN,GAAGX,QAAQ;QACZ,OAAOX;QACP,UAAUc;uBAKlB,oBAAC;QAAI,WAAWO;QAAc,OAAO;YAAE,SAAS;QAAQ;qBACpD,oBAACC,eAAaA;QACV,OAAO;QACN,GAAGV,WAAW;QACf,OAAOZ;QACP,UAAUc;;AAK9B"}
|
|
@@ -3,6 +3,7 @@ import { observer } from "mobx-react-lite";
|
|
|
3
3
|
import { Select } from "@webiny/admin-ui";
|
|
4
4
|
import { useStyles } from "../../useStyles.js";
|
|
5
5
|
import { InheritanceLabel } from "../../../InheritanceLabel.js";
|
|
6
|
+
import { SidebarRow } from "../../SidebarRow.js";
|
|
6
7
|
const options = [
|
|
7
8
|
{
|
|
8
9
|
label: "None",
|
|
@@ -38,19 +39,21 @@ const BorderStyle = observer(({ elementId })=>{
|
|
|
38
39
|
});
|
|
39
40
|
};
|
|
40
41
|
const inheritance = inheritanceMap?.borderStyle ?? {};
|
|
41
|
-
return /*#__PURE__*/ react.createElement(
|
|
42
|
+
return /*#__PURE__*/ react.createElement(SidebarRow, {
|
|
42
43
|
label: /*#__PURE__*/ react.createElement(InheritanceLabel, {
|
|
43
44
|
onReset: onReset,
|
|
44
45
|
isOverridden: inheritance?.overridden ?? false,
|
|
45
46
|
inheritedFrom: inheritance?.inheritedFrom,
|
|
46
47
|
text: "Border style"
|
|
47
|
-
})
|
|
48
|
-
|
|
48
|
+
})
|
|
49
|
+
}, /*#__PURE__*/ react.createElement(Select, {
|
|
50
|
+
size: "md",
|
|
51
|
+
variant: "secondary",
|
|
49
52
|
value: styles.borderStyle ?? "none",
|
|
50
53
|
displayResetAction: false,
|
|
51
54
|
onChange: onValueChange,
|
|
52
55
|
options: options
|
|
53
|
-
});
|
|
56
|
+
}));
|
|
54
57
|
});
|
|
55
58
|
export { BorderStyle };
|
|
56
59
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border/BorderStyle.js","sources":["../../../../../../../src/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border/BorderStyle.tsx"],"sourcesContent":["import React from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { Select } from \"@webiny/admin-ui\";\nimport { useStyles } from \"../../useStyles.js\";\nimport { InheritanceLabel } from \"~/BaseEditor/defaultConfig/Sidebar/InheritanceLabel.js\";\n\nconst options = [\n { label: \"None\", value: \"none\" },\n { label: \"Solid\", value: \"solid\" },\n { label: \"Dashed\", value: \"dashed\" },\n { label: \"Dotted\", value: \"dotted\" },\n { label: \"Double\", value: \"double\" }\n];\n\ninterface BorderStyleProps {\n elementId: string;\n}\n\nexport const BorderStyle = observer(({ elementId }: BorderStyleProps) => {\n const { styles, onChange, inheritanceMap } = useStyles(elementId);\n\n const onValueChange = (value: string) => {\n onChange(({ styles }) => {\n styles.set(\"borderStyle\", value);\n });\n };\n\n const onReset = () => {\n onChange(({ styles }) => {\n styles.unset(\"borderStyle\");\n });\n };\n\n const inheritance = inheritanceMap?.borderStyle ?? {};\n\n return (\n <
|
|
1
|
+
{"version":3,"file":"BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border/BorderStyle.js","sources":["../../../../../../../src/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border/BorderStyle.tsx"],"sourcesContent":["import React from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { Select } from \"@webiny/admin-ui\";\nimport { useStyles } from \"../../useStyles.js\";\nimport { InheritanceLabel } from \"~/BaseEditor/defaultConfig/Sidebar/InheritanceLabel.js\";\nimport { SidebarRow } from \"~/BaseEditor/defaultConfig/Sidebar/StyleSettings/SidebarRow.js\";\n\nconst options = [\n { label: \"None\", value: \"none\" },\n { label: \"Solid\", value: \"solid\" },\n { label: \"Dashed\", value: \"dashed\" },\n { label: \"Dotted\", value: \"dotted\" },\n { label: \"Double\", value: \"double\" }\n];\n\ninterface BorderStyleProps {\n elementId: string;\n}\n\nexport const BorderStyle = observer(({ elementId }: BorderStyleProps) => {\n const { styles, onChange, inheritanceMap } = useStyles(elementId);\n\n const onValueChange = (value: string) => {\n onChange(({ styles }) => {\n styles.set(\"borderStyle\", value);\n });\n };\n\n const onReset = () => {\n onChange(({ styles }) => {\n styles.unset(\"borderStyle\");\n });\n };\n\n const inheritance = inheritanceMap?.borderStyle ?? {};\n\n return (\n <SidebarRow\n label={\n <InheritanceLabel\n onReset={onReset}\n isOverridden={inheritance?.overridden ?? false}\n inheritedFrom={inheritance?.inheritedFrom}\n text={\"Border style\"}\n />\n }\n >\n <Select\n size={\"md\"}\n variant={\"secondary\"}\n value={styles.borderStyle ?? \"none\"}\n displayResetAction={false}\n onChange={onValueChange}\n options={options}\n />\n </SidebarRow>\n );\n});\n"],"names":["options","BorderStyle","observer","elementId","styles","onChange","inheritanceMap","useStyles","onValueChange","value","onReset","inheritance","SidebarRow","InheritanceLabel","Select"],"mappings":";;;;;;AAOA,MAAMA,UAAU;IACZ;QAAE,OAAO;QAAQ,OAAO;IAAO;IAC/B;QAAE,OAAO;QAAS,OAAO;IAAQ;IACjC;QAAE,OAAO;QAAU,OAAO;IAAS;IACnC;QAAE,OAAO;QAAU,OAAO;IAAS;IACnC;QAAE,OAAO;QAAU,OAAO;IAAS;CACtC;AAMM,MAAMC,cAAcC,SAAS,CAAC,EAAEC,SAAS,EAAoB;IAChE,MAAM,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,cAAc,EAAE,GAAGC,UAAUJ;IAEvD,MAAMK,gBAAgB,CAACC;QACnBJ,SAAS,CAAC,EAAED,MAAM,EAAE;YAChBA,OAAO,GAAG,CAAC,eAAeK;QAC9B;IACJ;IAEA,MAAMC,UAAU;QACZL,SAAS,CAAC,EAAED,MAAM,EAAE;YAChBA,OAAO,KAAK,CAAC;QACjB;IACJ;IAEA,MAAMO,cAAcL,gBAAgB,eAAe,CAAC;IAEpD,OAAO,WAAP,GACI,oBAACM,YAAUA;QACP,qBACI,oBAACC,kBAAgBA;YACb,SAASH;YACT,cAAcC,aAAa,cAAc;YACzC,eAAeA,aAAa;YAC5B,MAAM;;qBAId,oBAACG,QAAMA;QACH,MAAM;QACN,SAAS;QACT,OAAOV,OAAO,WAAW,IAAI;QAC7B,oBAAoB;QACpB,UAAUI;QACV,SAASR;;AAIzB"}
|
|
@@ -54,21 +54,13 @@ const BorderWidth = observer(({ elementId })=>{
|
|
|
54
54
|
};
|
|
55
55
|
const rowClassname = "flex flex-row w-full justify-center items-center py-xs";
|
|
56
56
|
return /*#__PURE__*/ react.createElement("div", {
|
|
57
|
-
className: "flex flex-col items-center bg-neutral-light
|
|
57
|
+
className: "flex flex-col items-center bg-neutral-light text-neutral-strong rounded-xl p-sm"
|
|
58
|
+
}, /*#__PURE__*/ react.createElement("div", {
|
|
59
|
+
className: "grid grid-cols-3 items-center w-full relative"
|
|
58
60
|
}, /*#__PURE__*/ react.createElement("span", {
|
|
59
|
-
className: "
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
left: 5
|
|
63
|
-
}
|
|
64
|
-
}, "Border width"), /*#__PURE__*/ react.createElement(LinkedEditing, {
|
|
65
|
-
linked: linked,
|
|
66
|
-
onToggle: onToggleLinkedEditing
|
|
67
|
-
}), /*#__PURE__*/ react.createElement("div", {
|
|
68
|
-
className: rowClassname,
|
|
69
|
-
style: {
|
|
70
|
-
paddingTop: "8px"
|
|
71
|
-
}
|
|
61
|
+
className: "text-sm"
|
|
62
|
+
}, "Border width"), /*#__PURE__*/ react.createElement("div", {
|
|
63
|
+
className: "flex justify-center"
|
|
72
64
|
}, /*#__PURE__*/ react.createElement(ValueSelector, {
|
|
73
65
|
label: linked ? "Border width" : "Top border width",
|
|
74
66
|
...borderTopWidth,
|
|
@@ -77,6 +69,11 @@ const BorderWidth = observer(({ elementId })=>{
|
|
|
77
69
|
onChange: onBorderTopWidthChange,
|
|
78
70
|
onChangePreview: onBorderTopWidthPreviewChange
|
|
79
71
|
})), /*#__PURE__*/ react.createElement("div", {
|
|
72
|
+
className: "flex justify-end"
|
|
73
|
+
}, /*#__PURE__*/ react.createElement(LinkedEditing, {
|
|
74
|
+
linked: linked,
|
|
75
|
+
onToggle: onToggleLinkedEditing
|
|
76
|
+
}))), /*#__PURE__*/ react.createElement("div", {
|
|
80
77
|
className: rowClassname,
|
|
81
78
|
style: {
|
|
82
79
|
width: 168,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border/BorderWidth.js","sources":["../../../../../../../src/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border/BorderWidth.tsx"],"sourcesContent":["import React from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { LinkedEditing } from \"./LinkedEditing.js\";\nimport { useStyles } from \"../../useStyles.js\";\nimport { ValueSelector } from \"../../ValueSelector.js\";\nimport { useStyleValue } from \"../../useStyleValue.js\";\nimport { UnitsOptions } from \"../../UnitsOptions.js\";\n\nconst widthOptions = UnitsOptions.widthUnits().getOptions();\nconst heightOptions = UnitsOptions.heightUnits().getOptions();\n\ninterface BorderWidthProps {\n elementId: string;\n}\n\nexport const BorderWidth = observer(({ elementId }: BorderWidthProps) => {\n const { onChange, onPreviewChange, metadata } = useStyles(elementId);\n\n const borderTopWidth = useStyleValue(elementId, \"borderTopWidth\");\n const borderRightWidth = useStyleValue(elementId, \"borderRightWidth\");\n const borderBottomWidth = useStyleValue(elementId, \"borderBottomWidth\");\n const borderLeftWidth = useStyleValue(elementId, \"borderLeftWidth\");\n\n const linked = metadata.get<boolean>(\"borderWidthLinkedEditing\") ?? true;\n\n const onToggleLinkedEditing = (linked: boolean) => {\n onChange(({ styles, metadata }) => {\n if (linked) {\n const value = `${borderTopWidth.value ?? 0}${borderTopWidth.unit}`;\n styles.set(\"borderRightWidth\", value);\n styles.set(\"borderBottomWidth\", value);\n styles.set(\"borderLeftWidth\", value);\n }\n metadata.set(\"borderWidthLinkedEditing\", linked);\n });\n };\n\n const onBorderTopWidthChange = (value: string) => {\n if (linked) {\n onChange(({ styles }) => {\n styles.set(\"borderTopWidth\", value);\n styles.set(\"borderRightWidth\", value);\n styles.set(\"borderBottomWidth\", value);\n styles.set(\"borderLeftWidth\", value);\n });\n } else {\n borderTopWidth.onChange(value);\n }\n };\n\n const onBorderTopWidthPreviewChange = (value: string) => {\n if (linked) {\n onPreviewChange(({ styles }) => {\n styles.set(\"borderTopWidth\", value);\n styles.set(\"borderRightWidth\", value);\n styles.set(\"borderBottomWidth\", value);\n styles.set(\"borderLeftWidth\", value);\n });\n } else {\n borderTopWidth.onChangePreview(value);\n }\n };\n\n const onReset = () => {\n if (linked) {\n onChange(({ styles }) => {\n styles.unset(\"borderTopWidth\");\n styles.unset(\"borderRightWidth\");\n styles.unset(\"borderBottomWidth\");\n styles.unset(\"borderLeftWidth\");\n });\n } else {\n borderTopWidth.onReset();\n }\n };\n\n const rowClassname = \"flex flex-row w-full justify-center items-center py-xs\";\n\n return (\n <div className=\"flex flex-col items-center bg-neutral-light
|
|
1
|
+
{"version":3,"file":"BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border/BorderWidth.js","sources":["../../../../../../../src/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border/BorderWidth.tsx"],"sourcesContent":["import React from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { LinkedEditing } from \"./LinkedEditing.js\";\nimport { useStyles } from \"../../useStyles.js\";\nimport { ValueSelector } from \"../../ValueSelector.js\";\nimport { useStyleValue } from \"../../useStyleValue.js\";\nimport { UnitsOptions } from \"../../UnitsOptions.js\";\n\nconst widthOptions = UnitsOptions.widthUnits().getOptions();\nconst heightOptions = UnitsOptions.heightUnits().getOptions();\n\ninterface BorderWidthProps {\n elementId: string;\n}\n\nexport const BorderWidth = observer(({ elementId }: BorderWidthProps) => {\n const { onChange, onPreviewChange, metadata } = useStyles(elementId);\n\n const borderTopWidth = useStyleValue(elementId, \"borderTopWidth\");\n const borderRightWidth = useStyleValue(elementId, \"borderRightWidth\");\n const borderBottomWidth = useStyleValue(elementId, \"borderBottomWidth\");\n const borderLeftWidth = useStyleValue(elementId, \"borderLeftWidth\");\n\n const linked = metadata.get<boolean>(\"borderWidthLinkedEditing\") ?? true;\n\n const onToggleLinkedEditing = (linked: boolean) => {\n onChange(({ styles, metadata }) => {\n if (linked) {\n const value = `${borderTopWidth.value ?? 0}${borderTopWidth.unit}`;\n styles.set(\"borderRightWidth\", value);\n styles.set(\"borderBottomWidth\", value);\n styles.set(\"borderLeftWidth\", value);\n }\n metadata.set(\"borderWidthLinkedEditing\", linked);\n });\n };\n\n const onBorderTopWidthChange = (value: string) => {\n if (linked) {\n onChange(({ styles }) => {\n styles.set(\"borderTopWidth\", value);\n styles.set(\"borderRightWidth\", value);\n styles.set(\"borderBottomWidth\", value);\n styles.set(\"borderLeftWidth\", value);\n });\n } else {\n borderTopWidth.onChange(value);\n }\n };\n\n const onBorderTopWidthPreviewChange = (value: string) => {\n if (linked) {\n onPreviewChange(({ styles }) => {\n styles.set(\"borderTopWidth\", value);\n styles.set(\"borderRightWidth\", value);\n styles.set(\"borderBottomWidth\", value);\n styles.set(\"borderLeftWidth\", value);\n });\n } else {\n borderTopWidth.onChangePreview(value);\n }\n };\n\n const onReset = () => {\n if (linked) {\n onChange(({ styles }) => {\n styles.unset(\"borderTopWidth\");\n styles.unset(\"borderRightWidth\");\n styles.unset(\"borderBottomWidth\");\n styles.unset(\"borderLeftWidth\");\n });\n } else {\n borderTopWidth.onReset();\n }\n };\n\n const rowClassname = \"flex flex-row w-full justify-center items-center py-xs\";\n\n return (\n <div className=\"flex flex-col items-center bg-neutral-light text-neutral-strong rounded-xl p-sm\">\n {/* Top border width */}\n <div className={\"grid grid-cols-3 items-center w-full relative\"}>\n <span className=\"text-sm\">Border width</span>\n <div className={\"flex justify-center\"}>\n <ValueSelector\n label={linked ? \"Border width\" : \"Top border width\"}\n {...borderTopWidth}\n onReset={onReset}\n units={heightOptions}\n onChange={onBorderTopWidthChange}\n onChangePreview={onBorderTopWidthPreviewChange}\n />\n </div>\n <div className={\"flex justify-end\"}>\n <LinkedEditing linked={linked} onToggle={onToggleLinkedEditing} />\n </div>\n </div>\n\n {/* Center Row (Left + placeholder + Right) */}\n <div className={rowClassname} style={{ width: 168, paddingTop: \"8px\" }}>\n <ValueSelector\n label={\"Left border width\"}\n {...borderLeftWidth}\n units={widthOptions}\n disabled={linked}\n />\n <div\n className=\"flex border-sm border-neutral-muted bg-neutral-light rounded-md items-center justify-center\"\n style={{ width: 170, height: 30 }}\n >\n -\n </div>\n <ValueSelector\n label={\"Right border width\"}\n {...borderRightWidth}\n units={widthOptions}\n disabled={linked}\n />\n </div>\n\n {/* Bottom border width */}\n <div className={rowClassname} style={{ padding: \"8px 0\" }}>\n <ValueSelector\n label={\"Bottom border width\"}\n {...borderBottomWidth}\n units={heightOptions}\n disabled={linked}\n />\n </div>\n </div>\n );\n});\n"],"names":["widthOptions","UnitsOptions","heightOptions","BorderWidth","observer","elementId","onChange","onPreviewChange","metadata","useStyles","borderTopWidth","useStyleValue","borderRightWidth","borderBottomWidth","borderLeftWidth","linked","onToggleLinkedEditing","styles","value","onBorderTopWidthChange","onBorderTopWidthPreviewChange","onReset","rowClassname","ValueSelector","LinkedEditing"],"mappings":";;;;;;;AAQA,MAAMA,eAAeC,aAAa,UAAU,GAAG,UAAU;AACzD,MAAMC,gBAAgBD,aAAa,WAAW,GAAG,UAAU;AAMpD,MAAME,cAAcC,SAAS,CAAC,EAAEC,SAAS,EAAoB;IAChE,MAAM,EAAEC,QAAQ,EAAEC,eAAe,EAAEC,QAAQ,EAAE,GAAGC,UAAUJ;IAE1D,MAAMK,iBAAiBC,cAAcN,WAAW;IAChD,MAAMO,mBAAmBD,cAAcN,WAAW;IAClD,MAAMQ,oBAAoBF,cAAcN,WAAW;IACnD,MAAMS,kBAAkBH,cAAcN,WAAW;IAEjD,MAAMU,SAASP,SAAS,GAAG,CAAU,+BAA+B;IAEpE,MAAMQ,wBAAwB,CAACD;QAC3BT,SAAS,CAAC,EAAEW,MAAM,EAAET,QAAQ,EAAE;YAC1B,IAAIO,QAAQ;gBACR,MAAMG,QAAQ,GAAGR,eAAe,KAAK,IAAI,IAAIA,eAAe,IAAI,EAAE;gBAClEO,OAAO,GAAG,CAAC,oBAAoBC;gBAC/BD,OAAO,GAAG,CAAC,qBAAqBC;gBAChCD,OAAO,GAAG,CAAC,mBAAmBC;YAClC;YACAV,SAAS,GAAG,CAAC,4BAA4BO;QAC7C;IACJ;IAEA,MAAMI,yBAAyB,CAACD;QAC5B,IAAIH,QACAT,SAAS,CAAC,EAAEW,MAAM,EAAE;YAChBA,OAAO,GAAG,CAAC,kBAAkBC;YAC7BD,OAAO,GAAG,CAAC,oBAAoBC;YAC/BD,OAAO,GAAG,CAAC,qBAAqBC;YAChCD,OAAO,GAAG,CAAC,mBAAmBC;QAClC;aAEAR,eAAe,QAAQ,CAACQ;IAEhC;IAEA,MAAME,gCAAgC,CAACF;QACnC,IAAIH,QACAR,gBAAgB,CAAC,EAAEU,MAAM,EAAE;YACvBA,OAAO,GAAG,CAAC,kBAAkBC;YAC7BD,OAAO,GAAG,CAAC,oBAAoBC;YAC/BD,OAAO,GAAG,CAAC,qBAAqBC;YAChCD,OAAO,GAAG,CAAC,mBAAmBC;QAClC;aAEAR,eAAe,eAAe,CAACQ;IAEvC;IAEA,MAAMG,UAAU;QACZ,IAAIN,QACAT,SAAS,CAAC,EAAEW,MAAM,EAAE;YAChBA,OAAO,KAAK,CAAC;YACbA,OAAO,KAAK,CAAC;YACbA,OAAO,KAAK,CAAC;YACbA,OAAO,KAAK,CAAC;QACjB;aAEAP,eAAe,OAAO;IAE9B;IAEA,MAAMY,eAAe;IAErB,OAAO,WAAP,GACI,oBAAC;QAAI,WAAU;qBAEX,oBAAC;QAAI,WAAW;qBACZ,oBAAC;QAAK,WAAU;OAAU,+BAC1B,oBAAC;QAAI,WAAW;qBACZ,oBAACC,eAAaA;QACV,OAAOR,SAAS,iBAAiB;QAChC,GAAGL,cAAc;QAClB,SAASW;QACT,OAAOnB;QACP,UAAUiB;QACV,iBAAiBC;uBAGzB,oBAAC;QAAI,WAAW;qBACZ,oBAACI,eAAaA;QAAC,QAAQT;QAAQ,UAAUC;wBAKjD,oBAAC;QAAI,WAAWM;QAAc,OAAO;YAAE,OAAO;YAAK,YAAY;QAAM;qBACjE,oBAACC,eAAaA;QACV,OAAO;QACN,GAAGT,eAAe;QACnB,OAAOd;QACP,UAAUe;sBAEd,oBAAC;QACG,WAAU;QACV,OAAO;YAAE,OAAO;YAAK,QAAQ;QAAG;OACnC,oBAGD,oBAACQ,eAAaA;QACV,OAAO;QACN,GAAGX,gBAAgB;QACpB,OAAOZ;QACP,UAAUe;uBAKlB,oBAAC;QAAI,WAAWO;QAAc,OAAO;YAAE,SAAS;QAAQ;qBACpD,oBAACC,eAAaA;QACV,OAAO;QACN,GAAGV,iBAAiB;QACrB,OAAOX;QACP,UAAUa;;AAK9B"}
|
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
import react from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { ReactComponent } from "@webiny/icons/border_all.svg";
|
|
3
|
+
import { StyleAccordion } from "../StyleAccordion.js";
|
|
3
4
|
import { BorderControl } from "./Border/Border.js";
|
|
4
|
-
const Border = ({ elementId })=>/*#__PURE__*/ react.createElement(
|
|
5
|
+
const Border = ({ elementId })=>/*#__PURE__*/ react.createElement(StyleAccordion.Item, {
|
|
5
6
|
title: "Border",
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
style: {
|
|
9
|
-
width: 280,
|
|
10
|
-
marginLeft: -8
|
|
11
|
-
}
|
|
7
|
+
icon: /*#__PURE__*/ react.createElement(ReactComponent, null),
|
|
8
|
+
noPadding: true
|
|
12
9
|
}, /*#__PURE__*/ react.createElement(BorderControl, {
|
|
13
10
|
elementId: elementId
|
|
14
|
-
}))
|
|
11
|
+
}));
|
|
15
12
|
export { Border };
|
|
16
13
|
|
|
17
14
|
//# sourceMappingURL=Border.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border.js","sources":["../../../../../../src/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border.tsx"],"sourcesContent":["import React from \"react\";\nimport {
|
|
1
|
+
{"version":3,"file":"BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border.js","sources":["../../../../../../src/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Border.tsx"],"sourcesContent":["import React from \"react\";\nimport { ReactComponent as BorderIcon } from \"@webiny/icons/border_all.svg\";\nimport { StyleAccordion } from \"../StyleAccordion.js\";\nimport { BorderControl } from \"./Border/Border.js\";\n\ninterface BorderProps {\n elementId: string;\n}\n\nexport const Border = ({ elementId }: BorderProps) => {\n return (\n <StyleAccordion.Item title={\"Border\"} icon={<BorderIcon />} noPadding>\n <BorderControl elementId={elementId} />\n </StyleAccordion.Item>\n );\n};\n"],"names":["Border","elementId","StyleAccordion","BorderIcon","BorderControl"],"mappings":";;;;AASO,MAAMA,SAAS,CAAC,EAAEC,SAAS,EAAe,GACtC,WAAP,GACI,oBAACC,eAAe,IAAI;QAAC,OAAO;QAAU,oBAAM,oBAACC,gBAAUA;QAAK;qBACxD,oBAACC,eAAaA;QAAC,WAAWH"}
|
|
@@ -8,6 +8,7 @@ import { ReactComponent as align_horizontal_right_svg_ReactComponent } from "@we
|
|
|
8
8
|
import { ReactComponent as align_horizontal_center_svg_ReactComponent } from "@webiny/icons/align_horizontal_center.svg";
|
|
9
9
|
import { useStyles } from "../../useStyles.js";
|
|
10
10
|
import { InheritanceLabel } from "../../../InheritanceLabel.js";
|
|
11
|
+
import { SidebarRow } from "../../SidebarRow.js";
|
|
11
12
|
import { IconButton } from "./IconButton.js";
|
|
12
13
|
const activeVariant = "secondary";
|
|
13
14
|
const inactiveVariant = "ghost";
|
|
@@ -70,11 +71,13 @@ const Alignment = observer(({ elementId })=>{
|
|
|
70
71
|
inheritanceMap.marginBottom,
|
|
71
72
|
inheritanceMap.marginLeft
|
|
72
73
|
].filter(Boolean).some((item)=>item.overridden);
|
|
73
|
-
return /*#__PURE__*/ react.createElement(
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
return /*#__PURE__*/ react.createElement(SidebarRow, {
|
|
75
|
+
label: /*#__PURE__*/ react.createElement(InheritanceLabel, {
|
|
76
|
+
text: "Align",
|
|
77
|
+
onReset: onReset,
|
|
78
|
+
isOverridden: isOverridden
|
|
79
|
+
})
|
|
80
|
+
}, /*#__PURE__*/ react.createElement("div", {
|
|
78
81
|
className: "flex flex-row w-full justify-between"
|
|
79
82
|
}, /*#__PURE__*/ react.createElement(IconButton, {
|
|
80
83
|
icon: /*#__PURE__*/ react.createElement(align_horizontal_left_svg_ReactComponent, null),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Layout/Alignment.js","sources":["../../../../../../../src/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Layout/Alignment.tsx"],"sourcesContent":["import React from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { ReactComponent as AlignToBottom } from \"@webiny/icons/vertical_align_bottom.svg\";\nimport { ReactComponent as AlignToTop } from \"@webiny/icons/vertical_align_top.svg\";\nimport { ReactComponent as CenterVertically } from \"@webiny/icons/vertical_align_center.svg\";\nimport { ReactComponent as AlignLeft } from \"@webiny/icons/align_horizontal_left.svg\";\nimport { ReactComponent as AlignRight } from \"@webiny/icons/align_horizontal_right.svg\";\nimport { ReactComponent as CenterHorizontally } from \"@webiny/icons/align_horizontal_center.svg\";\nimport { useStyles } from \"~/BaseEditor/defaultConfig/Sidebar/StyleSettings/useStyles.js\";\nimport { InheritanceLabel } from \"../../../InheritanceLabel.js\";\nimport { IconButton } from \"./IconButton.js\";\n\nconst activeVariant = \"secondary\";\nconst inactiveVariant = \"ghost\";\n\n/**\n * Alignment is controlled with margin and display: flex.\n * -----\n * Align to the left => margin-right: auto;\n * Align to the right => margin-left: auto;\n * Center horizontally => margin-left: auto; margin-right: auto;\n * Full width: unset margin-left and margin-right.\n * -----\n * Align to the top => margin-bottom: auto;\n * Align to the bottom => margin-top: auto;\n * Center vertically => margin-top: auto; margin-bottom: auto;\n */\nexport const Alignment = observer(({ elementId }: { elementId: string }) => {\n const { styles, onChange, inheritanceMap } = useStyles(elementId);\n\n /**\n * Horizontal alignment\n */\n const onAlignLeft = () => {\n onChange(({ styles }) => {\n styles.set(\"marginRight\", \"auto\");\n if (styles.get(\"marginLeft\") === \"auto\") {\n styles.set(\"marginLeft\", \"unset\");\n }\n });\n };\n\n const onAlignRight = () => {\n onChange(({ styles }) => {\n styles.set(\"marginLeft\", \"auto\");\n if (styles.get(\"marginRight\") === \"auto\") {\n styles.set(\"marginRight\", \"unset\");\n }\n });\n };\n\n const onCenterHorizontally = () => {\n onChange(({ styles }) => {\n styles.set(\"marginLeft\", \"auto\");\n styles.set(\"marginRight\", \"auto\");\n });\n };\n\n /**\n * Vertical alignment\n */\n const onAlignTop = () => {\n onChange(({ styles }) => {\n styles.set(\"marginBottom\", \"auto\");\n if (styles.get(\"marginTop\") === \"auto\") {\n styles.set(\"marginTop\", \"unset\");\n }\n });\n };\n\n const onCenterVertically = () => {\n onChange(({ styles }) => {\n styles.set(\"marginTop\", \"auto\");\n styles.set(\"marginBottom\", \"auto\");\n });\n };\n\n const onAlignBottom = () => {\n onChange(({ styles }) => {\n styles.set(\"marginTop\", \"auto\");\n if (styles.get(\"marginBottom\") === \"auto\") {\n styles.set(\"marginBottom\", \"unset\");\n }\n });\n };\n\n const onReset = () => {\n onChange(({ styles }) => {\n styles.unset(\"width\");\n styles.unset(\"marginTop\");\n styles.unset(\"marginRight\");\n styles.unset(\"marginBottom\");\n styles.unset(\"marginLeft\");\n });\n };\n\n const isLeftAligned = styles.marginRight === \"auto\" && styles.marginLeft !== \"auto\";\n const isHorizontallyCentered = styles.marginRight === \"auto\" && styles.marginLeft === \"auto\";\n const isRightAligned = styles.marginRight !== \"auto\" && styles.marginLeft === \"auto\";\n const isAlignedToTop = styles.marginBottom === \"auto\" && styles.marginTop !== \"auto\";\n const isAlignedToBottom = styles.marginBottom !== \"auto\" && styles.marginTop === \"auto\";\n const isVerticallyCentered = styles.marginBottom === \"auto\" && styles.marginTop === \"auto\";\n\n const isOverridden = [\n inheritanceMap.marginTop,\n inheritanceMap.marginRight,\n inheritanceMap.marginBottom,\n inheritanceMap.marginLeft\n ]\n .filter(Boolean)\n .some(item => item.overridden);\n\n return (\n <
|
|
1
|
+
{"version":3,"file":"BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Layout/Alignment.js","sources":["../../../../../../../src/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Layout/Alignment.tsx"],"sourcesContent":["import React from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { ReactComponent as AlignToBottom } from \"@webiny/icons/vertical_align_bottom.svg\";\nimport { ReactComponent as AlignToTop } from \"@webiny/icons/vertical_align_top.svg\";\nimport { ReactComponent as CenterVertically } from \"@webiny/icons/vertical_align_center.svg\";\nimport { ReactComponent as AlignLeft } from \"@webiny/icons/align_horizontal_left.svg\";\nimport { ReactComponent as AlignRight } from \"@webiny/icons/align_horizontal_right.svg\";\nimport { ReactComponent as CenterHorizontally } from \"@webiny/icons/align_horizontal_center.svg\";\nimport { useStyles } from \"~/BaseEditor/defaultConfig/Sidebar/StyleSettings/useStyles.js\";\nimport { InheritanceLabel } from \"../../../InheritanceLabel.js\";\nimport { SidebarRow } from \"~/BaseEditor/defaultConfig/Sidebar/StyleSettings/SidebarRow.js\";\nimport { IconButton } from \"./IconButton.js\";\n\nconst activeVariant = \"secondary\";\nconst inactiveVariant = \"ghost\";\n\n/**\n * Alignment is controlled with margin and display: flex.\n * -----\n * Align to the left => margin-right: auto;\n * Align to the right => margin-left: auto;\n * Center horizontally => margin-left: auto; margin-right: auto;\n * Full width: unset margin-left and margin-right.\n * -----\n * Align to the top => margin-bottom: auto;\n * Align to the bottom => margin-top: auto;\n * Center vertically => margin-top: auto; margin-bottom: auto;\n */\nexport const Alignment = observer(({ elementId }: { elementId: string }) => {\n const { styles, onChange, inheritanceMap } = useStyles(elementId);\n\n /**\n * Horizontal alignment\n */\n const onAlignLeft = () => {\n onChange(({ styles }) => {\n styles.set(\"marginRight\", \"auto\");\n if (styles.get(\"marginLeft\") === \"auto\") {\n styles.set(\"marginLeft\", \"unset\");\n }\n });\n };\n\n const onAlignRight = () => {\n onChange(({ styles }) => {\n styles.set(\"marginLeft\", \"auto\");\n if (styles.get(\"marginRight\") === \"auto\") {\n styles.set(\"marginRight\", \"unset\");\n }\n });\n };\n\n const onCenterHorizontally = () => {\n onChange(({ styles }) => {\n styles.set(\"marginLeft\", \"auto\");\n styles.set(\"marginRight\", \"auto\");\n });\n };\n\n /**\n * Vertical alignment\n */\n const onAlignTop = () => {\n onChange(({ styles }) => {\n styles.set(\"marginBottom\", \"auto\");\n if (styles.get(\"marginTop\") === \"auto\") {\n styles.set(\"marginTop\", \"unset\");\n }\n });\n };\n\n const onCenterVertically = () => {\n onChange(({ styles }) => {\n styles.set(\"marginTop\", \"auto\");\n styles.set(\"marginBottom\", \"auto\");\n });\n };\n\n const onAlignBottom = () => {\n onChange(({ styles }) => {\n styles.set(\"marginTop\", \"auto\");\n if (styles.get(\"marginBottom\") === \"auto\") {\n styles.set(\"marginBottom\", \"unset\");\n }\n });\n };\n\n const onReset = () => {\n onChange(({ styles }) => {\n styles.unset(\"width\");\n styles.unset(\"marginTop\");\n styles.unset(\"marginRight\");\n styles.unset(\"marginBottom\");\n styles.unset(\"marginLeft\");\n });\n };\n\n const isLeftAligned = styles.marginRight === \"auto\" && styles.marginLeft !== \"auto\";\n const isHorizontallyCentered = styles.marginRight === \"auto\" && styles.marginLeft === \"auto\";\n const isRightAligned = styles.marginRight !== \"auto\" && styles.marginLeft === \"auto\";\n const isAlignedToTop = styles.marginBottom === \"auto\" && styles.marginTop !== \"auto\";\n const isAlignedToBottom = styles.marginBottom !== \"auto\" && styles.marginTop === \"auto\";\n const isVerticallyCentered = styles.marginBottom === \"auto\" && styles.marginTop === \"auto\";\n\n const isOverridden = [\n inheritanceMap.marginTop,\n inheritanceMap.marginRight,\n inheritanceMap.marginBottom,\n inheritanceMap.marginLeft\n ]\n .filter(Boolean)\n .some(item => item.overridden);\n\n return (\n <SidebarRow\n label={\n <InheritanceLabel text={\"Align\"} onReset={onReset} isOverridden={isOverridden} />\n }\n >\n <div className={\"flex flex-row w-full justify-between\"}>\n {/* Horizontal Alignment */}\n <IconButton\n icon={<AlignLeft />}\n variant={isLeftAligned ? activeVariant : inactiveVariant}\n onClick={onAlignLeft}\n tooltip={\"Align to the left side\"}\n />\n <IconButton\n icon={<CenterHorizontally />}\n variant={isHorizontallyCentered ? activeVariant : inactiveVariant}\n onClick={onCenterHorizontally}\n tooltip={\"Center horizontally\"}\n />\n <IconButton\n icon={<AlignRight />}\n variant={isRightAligned ? activeVariant : inactiveVariant}\n onClick={onAlignRight}\n tooltip={\"Align to the right side\"}\n />\n {/* Vertical Alignment */}\n <IconButton\n icon={<AlignToTop />}\n variant={isAlignedToTop ? activeVariant : inactiveVariant}\n onClick={onAlignTop}\n tooltip={\"Align to the top side\"}\n />\n <IconButton\n icon={<CenterVertically />}\n variant={isVerticallyCentered ? activeVariant : inactiveVariant}\n onClick={onCenterVertically}\n tooltip={\"Center vertically\"}\n />\n <IconButton\n icon={<AlignToBottom />}\n variant={isAlignedToBottom ? activeVariant : inactiveVariant}\n onClick={onAlignBottom}\n tooltip={\"Align to the bottom side\"}\n />\n </div>\n </SidebarRow>\n );\n});\n"],"names":["activeVariant","inactiveVariant","Alignment","observer","elementId","styles","onChange","inheritanceMap","useStyles","onAlignLeft","onAlignRight","onCenterHorizontally","onAlignTop","onCenterVertically","onAlignBottom","onReset","isLeftAligned","isHorizontallyCentered","isRightAligned","isAlignedToTop","isAlignedToBottom","isVerticallyCentered","isOverridden","Boolean","item","SidebarRow","InheritanceLabel","IconButton","AlignLeft","CenterHorizontally","AlignRight","AlignToTop","CenterVertically","AlignToBottom"],"mappings":";;;;;;;;;;;;AAaA,MAAMA,gBAAgB;AACtB,MAAMC,kBAAkB;AAcjB,MAAMC,YAAYC,SAAS,CAAC,EAAEC,SAAS,EAAyB;IACnE,MAAM,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,cAAc,EAAE,GAAGC,UAAUJ;IAKvD,MAAMK,cAAc;QAChBH,SAAS,CAAC,EAAED,MAAM,EAAE;YAChBA,OAAO,GAAG,CAAC,eAAe;YAC1B,IAAIA,AAA6B,WAA7BA,OAAO,GAAG,CAAC,eACXA,OAAO,GAAG,CAAC,cAAc;QAEjC;IACJ;IAEA,MAAMK,eAAe;QACjBJ,SAAS,CAAC,EAAED,MAAM,EAAE;YAChBA,OAAO,GAAG,CAAC,cAAc;YACzB,IAAIA,AAA8B,WAA9BA,OAAO,GAAG,CAAC,gBACXA,OAAO,GAAG,CAAC,eAAe;QAElC;IACJ;IAEA,MAAMM,uBAAuB;QACzBL,SAAS,CAAC,EAAED,MAAM,EAAE;YAChBA,OAAO,GAAG,CAAC,cAAc;YACzBA,OAAO,GAAG,CAAC,eAAe;QAC9B;IACJ;IAKA,MAAMO,aAAa;QACfN,SAAS,CAAC,EAAED,MAAM,EAAE;YAChBA,OAAO,GAAG,CAAC,gBAAgB;YAC3B,IAAIA,AAA4B,WAA5BA,OAAO,GAAG,CAAC,cACXA,OAAO,GAAG,CAAC,aAAa;QAEhC;IACJ;IAEA,MAAMQ,qBAAqB;QACvBP,SAAS,CAAC,EAAED,MAAM,EAAE;YAChBA,OAAO,GAAG,CAAC,aAAa;YACxBA,OAAO,GAAG,CAAC,gBAAgB;QAC/B;IACJ;IAEA,MAAMS,gBAAgB;QAClBR,SAAS,CAAC,EAAED,MAAM,EAAE;YAChBA,OAAO,GAAG,CAAC,aAAa;YACxB,IAAIA,AAA+B,WAA/BA,OAAO,GAAG,CAAC,iBACXA,OAAO,GAAG,CAAC,gBAAgB;QAEnC;IACJ;IAEA,MAAMU,UAAU;QACZT,SAAS,CAAC,EAAED,MAAM,EAAE;YAChBA,OAAO,KAAK,CAAC;YACbA,OAAO,KAAK,CAAC;YACbA,OAAO,KAAK,CAAC;YACbA,OAAO,KAAK,CAAC;YACbA,OAAO,KAAK,CAAC;QACjB;IACJ;IAEA,MAAMW,gBAAgBX,AAAuB,WAAvBA,OAAO,WAAW,IAAeA,AAAsB,WAAtBA,OAAO,UAAU;IACxE,MAAMY,yBAAyBZ,AAAuB,WAAvBA,OAAO,WAAW,IAAeA,AAAsB,WAAtBA,OAAO,UAAU;IACjF,MAAMa,iBAAiBb,AAAuB,WAAvBA,OAAO,WAAW,IAAeA,AAAsB,WAAtBA,OAAO,UAAU;IACzE,MAAMc,iBAAiBd,AAAwB,WAAxBA,OAAO,YAAY,IAAeA,AAAqB,WAArBA,OAAO,SAAS;IACzE,MAAMe,oBAAoBf,AAAwB,WAAxBA,OAAO,YAAY,IAAeA,AAAqB,WAArBA,OAAO,SAAS;IAC5E,MAAMgB,uBAAuBhB,AAAwB,WAAxBA,OAAO,YAAY,IAAeA,AAAqB,WAArBA,OAAO,SAAS;IAE/E,MAAMiB,eAAe;QACjBf,eAAe,SAAS;QACxBA,eAAe,WAAW;QAC1BA,eAAe,YAAY;QAC3BA,eAAe,UAAU;KAC5B,CACI,MAAM,CAACgB,SACP,IAAI,CAACC,CAAAA,OAAQA,KAAK,UAAU;IAEjC,OAAO,WAAP,GACI,oBAACC,YAAUA;QACP,qBACI,oBAACC,kBAAgBA;YAAC,MAAM;YAAS,SAASX;YAAS,cAAcO;;qBAGrE,oBAAC;QAAI,WAAW;qBAEZ,oBAACK,YAAUA;QACP,oBAAM,oBAACC,0CAASA;QAChB,SAASZ,gBAAgBhB,gBAAgBC;QACzC,SAASQ;QACT,SAAS;sBAEb,oBAACkB,YAAUA;QACP,oBAAM,oBAACE,4CAAkBA;QACzB,SAASZ,yBAAyBjB,gBAAgBC;QAClD,SAASU;QACT,SAAS;sBAEb,oBAACgB,YAAUA;QACP,oBAAM,oBAACG,2CAAUA;QACjB,SAASZ,iBAAiBlB,gBAAgBC;QAC1C,SAASS;QACT,SAAS;sBAGb,oBAACiB,YAAUA;QACP,oBAAM,oBAACI,uCAAUA;QACjB,SAASZ,iBAAiBnB,gBAAgBC;QAC1C,SAASW;QACT,SAAS;sBAEb,oBAACe,YAAUA;QACP,oBAAM,oBAACK,0CAAgBA;QACvB,SAASX,uBAAuBrB,gBAAgBC;QAChD,SAASY;QACT,SAAS;sBAEb,oBAACc,YAAUA;QACP,oBAAM,oBAACM,gBAAaA;QACpB,SAASb,oBAAoBpB,gBAAgBC;QAC7C,SAASa;QACT,SAAS;;AAK7B"}
|
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import react from "react";
|
|
2
2
|
import { observer } from "mobx-react-lite";
|
|
3
3
|
import { InheritanceLabel } from "../../../InheritanceLabel.js";
|
|
4
|
+
import { SidebarRow } from "../../SidebarRow.js";
|
|
4
5
|
import { useStyleValue } from "../../useStyleValue.js";
|
|
5
6
|
import { UnitValuePicker } from "../../UnitValuePicker.js";
|
|
6
7
|
const LengthWithUnitInput = observer(({ elementId, label, propertyName, defaultValue, unitOptions })=>{
|
|
7
8
|
const style = useStyleValue(elementId, propertyName, defaultValue);
|
|
8
|
-
return /*#__PURE__*/ react.createElement(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
return /*#__PURE__*/ react.createElement(SidebarRow, {
|
|
10
|
+
label: /*#__PURE__*/ react.createElement(InheritanceLabel, {
|
|
11
|
+
text: label,
|
|
12
|
+
onReset: style.onReset,
|
|
13
|
+
isOverridden: style.overridden,
|
|
14
|
+
inheritedFrom: style.inheritedFrom
|
|
15
|
+
})
|
|
15
16
|
}, /*#__PURE__*/ react.createElement(UnitValuePicker, {
|
|
16
17
|
value: style.value,
|
|
17
18
|
unit: style.unit,
|
|
18
19
|
units: unitOptions,
|
|
19
20
|
onChange: style.onChange,
|
|
20
21
|
onChangePreview: style.onChangePreview
|
|
21
|
-
}))
|
|
22
|
+
}));
|
|
22
23
|
});
|
|
23
24
|
export { LengthWithUnitInput };
|
|
24
25
|
|
package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Layout/LengthWithUnitInput.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Layout/LengthWithUnitInput.js","sources":["../../../../../../../src/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Layout/LengthWithUnitInput.tsx"],"sourcesContent":["import React from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { InheritanceLabel } from \"../../../InheritanceLabel.js\";\nimport { useStyleValue } from \"../../useStyleValue.js\";\nimport { UnitValuePicker, type UnitOption } from \"../../UnitValuePicker.js\";\n\ninterface LengthWithUnitInputProps {\n elementId: string;\n label: string;\n propertyName: string;\n unitOptions: UnitOption[];\n defaultValue?: string;\n}\n\nexport const LengthWithUnitInput = observer(\n ({ elementId, label, propertyName, defaultValue, unitOptions }: LengthWithUnitInputProps) => {\n const style = useStyleValue(elementId, propertyName, defaultValue);\n\n return (\n <
|
|
1
|
+
{"version":3,"file":"BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Layout/LengthWithUnitInput.js","sources":["../../../../../../../src/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Layout/LengthWithUnitInput.tsx"],"sourcesContent":["import React from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { InheritanceLabel } from \"../../../InheritanceLabel.js\";\nimport { SidebarRow } from \"~/BaseEditor/defaultConfig/Sidebar/StyleSettings/SidebarRow.js\";\nimport { useStyleValue } from \"../../useStyleValue.js\";\nimport { UnitValuePicker, type UnitOption } from \"../../UnitValuePicker.js\";\n\ninterface LengthWithUnitInputProps {\n elementId: string;\n label: string;\n propertyName: string;\n unitOptions: UnitOption[];\n defaultValue?: string;\n}\n\nexport const LengthWithUnitInput = observer(\n ({ elementId, label, propertyName, defaultValue, unitOptions }: LengthWithUnitInputProps) => {\n const style = useStyleValue(elementId, propertyName, defaultValue);\n\n return (\n <SidebarRow\n label={\n <InheritanceLabel\n text={label}\n onReset={style.onReset}\n isOverridden={style.overridden}\n inheritedFrom={style.inheritedFrom}\n />\n }\n >\n <UnitValuePicker\n value={style.value}\n unit={style.unit}\n units={unitOptions}\n onChange={style.onChange}\n onChangePreview={style.onChangePreview}\n />\n </SidebarRow>\n );\n }\n);\n"],"names":["LengthWithUnitInput","observer","elementId","label","propertyName","defaultValue","unitOptions","style","useStyleValue","SidebarRow","InheritanceLabel","UnitValuePicker"],"mappings":";;;;;;AAeO,MAAMA,sBAAsBC,SAC/B,CAAC,EAAEC,SAAS,EAAEC,KAAK,EAAEC,YAAY,EAAEC,YAAY,EAAEC,WAAW,EAA4B;IACpF,MAAMC,QAAQC,cAAcN,WAAWE,cAAcC;IAErD,OAAO,WAAP,GACI,oBAACI,YAAUA;QACP,qBACI,oBAACC,kBAAgBA;YACb,MAAMP;YACN,SAASI,MAAM,OAAO;YACtB,cAAcA,MAAM,UAAU;YAC9B,eAAeA,MAAM,aAAa;;qBAI1C,oBAACI,iBAAeA;QACZ,OAAOJ,MAAM,KAAK;QAClB,MAAMA,MAAM,IAAI;QAChB,OAAOD;QACP,UAAUC,MAAM,QAAQ;QACxB,iBAAiBA,MAAM,eAAe;;AAItD"}
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import react from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { Grid } from "@webiny/admin-ui";
|
|
3
|
+
import { ReactComponent } from "@webiny/icons/auto_awesome_mosaic.svg";
|
|
4
|
+
import { StyleAccordion } from "../StyleAccordion.js";
|
|
3
5
|
import { Alignment } from "./Layout/Alignment.js";
|
|
4
6
|
import { LengthWithUnitInput } from "./Layout/LengthWithUnitInput.js";
|
|
5
7
|
import { UnitsOptions } from "../UnitsOptions.js";
|
|
6
8
|
const widthOptions = UnitsOptions.widthUnits().add("auto").getOptions();
|
|
7
9
|
const heightOptions = UnitsOptions.heightUnits().add("auto").getOptions();
|
|
8
|
-
const Layout = ({ elementId })=>/*#__PURE__*/ react.createElement(
|
|
10
|
+
const Layout = ({ elementId })=>/*#__PURE__*/ react.createElement(StyleAccordion.Item, {
|
|
9
11
|
title: "Layout",
|
|
10
|
-
|
|
11
|
-
}, /*#__PURE__*/ react.createElement(Grid,
|
|
12
|
+
icon: /*#__PURE__*/ react.createElement(ReactComponent, null)
|
|
13
|
+
}, /*#__PURE__*/ react.createElement(Grid, {
|
|
14
|
+
gap: "small"
|
|
15
|
+
}, /*#__PURE__*/ react.createElement(Grid.Column, {
|
|
12
16
|
span: 12
|
|
13
17
|
}, /*#__PURE__*/ react.createElement(Alignment, {
|
|
14
18
|
elementId: elementId
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Layout.js","sources":["../../../../../../src/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Layout.tsx"],"sourcesContent":["import React from \"react\";\nimport {
|
|
1
|
+
{"version":3,"file":"BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Layout.js","sources":["../../../../../../src/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/Layout.tsx"],"sourcesContent":["import React from \"react\";\nimport { Grid } from \"@webiny/admin-ui\";\nimport { ReactComponent as LayoutIcon } from \"@webiny/icons/auto_awesome_mosaic.svg\";\nimport { StyleAccordion } from \"../StyleAccordion.js\";\nimport { Alignment } from \"./Layout/Alignment.js\";\nimport { LengthWithUnitInput } from \"./Layout/LengthWithUnitInput.js\";\nimport { UnitsOptions } from \"../UnitsOptions.js\";\n\ninterface LayoutProps {\n elementId: string;\n}\n\nconst widthOptions = UnitsOptions.widthUnits().add(\"auto\").getOptions();\nconst heightOptions = UnitsOptions.heightUnits().add(\"auto\").getOptions();\n\nexport const Layout = ({ elementId }: LayoutProps) => {\n return (\n <StyleAccordion.Item title={\"Layout\"} icon={<LayoutIcon />}>\n <Grid gap={\"small\"}>\n <Grid.Column span={12}>\n <Alignment elementId={elementId} />\n </Grid.Column>\n <Grid.Column span={12}>\n <LengthWithUnitInput\n elementId={elementId}\n label={\"Width\"}\n propertyName={\"width\"}\n defaultValue={\"100%\"}\n unitOptions={widthOptions}\n />\n </Grid.Column>\n <Grid.Column span={12}>\n <LengthWithUnitInput\n elementId={elementId}\n label={\"Height\"}\n propertyName={\"height\"}\n defaultValue={\"auto\"}\n unitOptions={heightOptions}\n />\n </Grid.Column>\n <Grid.Column span={12}>\n <LengthWithUnitInput\n elementId={elementId}\n label={\"Max width\"}\n propertyName={\"maxWidth\"}\n defaultValue={\"auto\"}\n unitOptions={widthOptions}\n />\n </Grid.Column>\n <Grid.Column span={12}>\n <LengthWithUnitInput\n elementId={elementId}\n label={\"Max height\"}\n propertyName={\"maxHeight\"}\n defaultValue={\"auto\"}\n unitOptions={heightOptions}\n />\n </Grid.Column>\n </Grid>\n </StyleAccordion.Item>\n );\n};\n"],"names":["widthOptions","UnitsOptions","heightOptions","Layout","elementId","StyleAccordion","LayoutIcon","Grid","Alignment","LengthWithUnitInput"],"mappings":";;;;;;;AAYA,MAAMA,eAAeC,aAAa,UAAU,GAAG,GAAG,CAAC,QAAQ,UAAU;AACrE,MAAMC,gBAAgBD,aAAa,WAAW,GAAG,GAAG,CAAC,QAAQ,UAAU;AAEhE,MAAME,SAAS,CAAC,EAAEC,SAAS,EAAe,GACtC,WAAP,GACI,oBAACC,eAAe,IAAI;QAAC,OAAO;QAAU,oBAAM,oBAACC,gBAAUA;qBACnD,oBAACC,MAAIA;QAAC,KAAK;qBACP,oBAACA,KAAK,MAAM;QAAC,MAAM;qBACf,oBAACC,WAASA;QAAC,WAAWJ;uBAE1B,oBAACG,KAAK,MAAM;QAAC,MAAM;qBACf,oBAACE,qBAAmBA;QAChB,WAAWL;QACX,OAAO;QACP,cAAc;QACd,cAAc;QACd,aAAaJ;uBAGrB,oBAACO,KAAK,MAAM;QAAC,MAAM;qBACf,oBAACE,qBAAmBA;QAChB,WAAWL;QACX,OAAO;QACP,cAAc;QACd,cAAc;QACd,aAAaF;uBAGrB,oBAACK,KAAK,MAAM;QAAC,MAAM;qBACf,oBAACE,qBAAmBA;QAChB,WAAWL;QACX,OAAO;QACP,cAAc;QACd,cAAc;QACd,aAAaJ;uBAGrB,oBAACO,KAAK,MAAM;QAAC,MAAM;qBACf,oBAACE,qBAAmBA;QAChB,WAAWL;QACX,OAAO;QACP,cAAc;QACd,cAAc;QACd,aAAaF"}
|
package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/MarginPadding/LinkedEditing.js
CHANGED
|
@@ -3,11 +3,7 @@ import { Icon } from "@webiny/admin-ui";
|
|
|
3
3
|
import { ReactComponent } from "@webiny/icons/link.svg";
|
|
4
4
|
import { ReactComponent as link_off_svg_ReactComponent } from "@webiny/icons/link_off.svg";
|
|
5
5
|
const LinkedEditing = ({ linked, onToggle })=>/*#__PURE__*/ react.createElement("div", {
|
|
6
|
-
className: "
|
|
7
|
-
style: {
|
|
8
|
-
top: 2,
|
|
9
|
-
right: 4
|
|
10
|
-
}
|
|
6
|
+
className: "cursor-pointer fill-neutral-strong right-md"
|
|
11
7
|
}, linked ? /*#__PURE__*/ react.createElement(Icon, {
|
|
12
8
|
icon: /*#__PURE__*/ react.createElement(link_off_svg_ReactComponent, null),
|
|
13
9
|
label: "Disable linked editing.",
|
package/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/MarginPadding/LinkedEditing.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/MarginPadding/LinkedEditing.js","sources":["../../../../../../../src/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/MarginPadding/LinkedEditing.tsx"],"sourcesContent":["import React from \"react\";\nimport { Icon } from \"@webiny/admin-ui\";\nimport { ReactComponent as LinkOn } from \"@webiny/icons/link.svg\";\nimport { ReactComponent as LinkOff } from \"@webiny/icons/link_off.svg\";\n\ninterface LinkedEditingProps {\n linked: boolean;\n onToggle: (linked: boolean) => void;\n}\n\nexport const LinkedEditing = ({ linked, onToggle }: LinkedEditingProps) => {\n return (\n <div className={\"
|
|
1
|
+
{"version":3,"file":"BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/MarginPadding/LinkedEditing.js","sources":["../../../../../../../src/BaseEditor/defaultConfig/Sidebar/StyleSettings/Groups/MarginPadding/LinkedEditing.tsx"],"sourcesContent":["import React from \"react\";\nimport { Icon } from \"@webiny/admin-ui\";\nimport { ReactComponent as LinkOn } from \"@webiny/icons/link.svg\";\nimport { ReactComponent as LinkOff } from \"@webiny/icons/link_off.svg\";\n\ninterface LinkedEditingProps {\n linked: boolean;\n onToggle: (linked: boolean) => void;\n}\n\nexport const LinkedEditing = ({ linked, onToggle }: LinkedEditingProps) => {\n return (\n <div className={\"cursor-pointer fill-neutral-strong right-md\"}>\n {linked ? (\n <Icon\n icon={<LinkOff />}\n label={\"Disable linked editing.\"}\n size={\"sm\"}\n onClick={() => onToggle(false)}\n />\n ) : (\n <Icon\n icon={<LinkOn />}\n label={\"Enable linked editing.\"}\n size={\"sm\"}\n onClick={() => onToggle(true)}\n />\n )}\n </div>\n );\n};\n"],"names":["LinkedEditing","linked","onToggle","Icon","LinkOff","LinkOn"],"mappings":";;;;AAUO,MAAMA,gBAAgB,CAAC,EAAEC,MAAM,EAAEC,QAAQ,EAAsB,GAC3D,WAAP,GACI,oBAAC;QAAI,WAAW;OACXD,SAAS,WAATA,GACG,oBAACE,MAAIA;QACD,oBAAM,oBAACC,6BAAOA;QACd,OAAO;QACP,MAAM;QACN,SAAS,IAAMF,SAAS;uBAG5B,oBAACC,MAAIA;QACD,oBAAM,oBAACE,gBAAMA;QACb,OAAO;QACP,MAAM;QACN,SAAS,IAAMH,SAAS"}
|