@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
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import react from "react";
|
|
2
|
+
import { DragCursor } from "@webiny/admin-ui";
|
|
3
|
+
import { useComponent } from "../../hooks/useComponent.js";
|
|
4
|
+
import { InlineSvg } from "../../defaultConfig/Toolbar/InsertElements/InlineSvg.js";
|
|
5
|
+
const DragCursorWrapper = ({ componentName, isOverSlot })=>{
|
|
6
|
+
const component = useComponent(componentName);
|
|
7
|
+
return /*#__PURE__*/ react.createElement(DragCursor, {
|
|
8
|
+
label: component?.label ?? componentName,
|
|
9
|
+
icon: component?.image ? /*#__PURE__*/ react.createElement(InlineSvg, {
|
|
10
|
+
src: component.image
|
|
11
|
+
}) : void 0,
|
|
12
|
+
isOverSlot: isOverSlot
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
export { DragCursorWrapper };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=DragCursorWrapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseEditor/components/DragPreview/DragCursorWrapper.js","sources":["../../../../src/BaseEditor/components/DragPreview/DragCursorWrapper.tsx"],"sourcesContent":["import React from \"react\";\nimport { DragCursor } from \"@webiny/admin-ui\";\nimport { useComponent } from \"~/BaseEditor/hooks/useComponent.js\";\nimport { InlineSvg } from \"~/BaseEditor/defaultConfig/Toolbar/InsertElements/InlineSvg.js\";\n\ninterface DragCursorWrapperProps {\n componentName: string;\n isOverSlot: boolean;\n}\n\nexport const DragCursorWrapper = ({ componentName, isOverSlot }: DragCursorWrapperProps) => {\n const component = useComponent(componentName);\n\n return (\n <DragCursor\n label={component?.label ?? componentName}\n icon={component?.image ? <InlineSvg src={component.image} /> : undefined}\n isOverSlot={isOverSlot}\n />\n );\n};\n"],"names":["DragCursorWrapper","componentName","isOverSlot","component","useComponent","DragCursor","InlineSvg","undefined"],"mappings":";;;;AAUO,MAAMA,oBAAoB,CAAC,EAAEC,aAAa,EAAEC,UAAU,EAA0B;IACnF,MAAMC,YAAYC,aAAaH;IAE/B,OAAO,WAAP,GACI,oBAACI,YAAUA;QACP,OAAOF,WAAW,SAASF;QAC3B,MAAME,WAAW,QAAQ,WAAR,GAAQ,oBAACG,WAASA;YAAC,KAAKH,UAAU,KAAK;aAAOI;QAC/D,YAAYL;;AAGxB"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import react, { useEffect, useState } from "react";
|
|
2
|
+
import { useDragLayer } from "react-dnd";
|
|
3
|
+
import { useDropZoneManager } from "../../defaultConfig/Content/Preview/DropZoneManagerProvider.js";
|
|
4
|
+
import { resetDragPosition, setDragPreviewRef, setupDragPosition } from "./useDragPosition.js";
|
|
5
|
+
import { DragCursorWrapper } from "./DragCursorWrapper.js";
|
|
6
|
+
const DragPreview = ()=>{
|
|
7
|
+
const [isOverSlot, setIsOverSlot] = useState(false);
|
|
8
|
+
const dropZoneManager = useDropZoneManager();
|
|
9
|
+
const { isDragging, item } = useDragLayer((monitor)=>{
|
|
10
|
+
setupDragPosition(monitor);
|
|
11
|
+
return {
|
|
12
|
+
isDragging: monitor.isDragging(),
|
|
13
|
+
item: monitor.getItem()
|
|
14
|
+
};
|
|
15
|
+
});
|
|
16
|
+
useEffect(()=>dropZoneManager.subscribeToMatchChange(setIsOverSlot), [
|
|
17
|
+
dropZoneManager
|
|
18
|
+
]);
|
|
19
|
+
useEffect(()=>()=>{
|
|
20
|
+
resetDragPosition();
|
|
21
|
+
}, []);
|
|
22
|
+
if (!isDragging) return null;
|
|
23
|
+
if (item && item.dragInNavigator) return null;
|
|
24
|
+
return /*#__PURE__*/ react.createElement("div", {
|
|
25
|
+
className: "fixed pointer-events-none left-0 top-0 w-full h-full z-[1001]"
|
|
26
|
+
}, /*#__PURE__*/ react.createElement("div", {
|
|
27
|
+
ref: setDragPreviewRef,
|
|
28
|
+
className: "absolute"
|
|
29
|
+
}, /*#__PURE__*/ react.createElement(DragCursorWrapper, {
|
|
30
|
+
componentName: item?.componentName,
|
|
31
|
+
isOverSlot: isOverSlot
|
|
32
|
+
})));
|
|
33
|
+
};
|
|
34
|
+
const DragPreview_DragPreview = DragPreview;
|
|
35
|
+
export default DragPreview_DragPreview;
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=DragPreview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseEditor/components/DragPreview/DragPreview.js","sources":["../../../../src/BaseEditor/components/DragPreview/DragPreview.tsx"],"sourcesContent":["import React, { useEffect, useState } from \"react\";\nimport type { DragLayerMonitor } from \"react-dnd\";\nimport { useDragLayer } from \"react-dnd\";\nimport { useDropZoneManager } from \"~/BaseEditor/defaultConfig/Content/Preview/DropZoneManagerProvider.js\";\nimport { setupDragPosition, setDragPreviewRef, resetDragPosition } from \"./useDragPosition.js\";\nimport { DragCursorWrapper } from \"./DragCursorWrapper.js\";\n\nconst DragPreview = () => {\n const [isOverSlot, setIsOverSlot] = useState(false);\n const dropZoneManager = useDropZoneManager();\n\n const { isDragging, item } = useDragLayer((monitor: DragLayerMonitor) => {\n setupDragPosition(monitor);\n\n return {\n isDragging: monitor.isDragging(),\n item: monitor.getItem()\n };\n });\n\n useEffect(() => {\n return dropZoneManager.subscribeToMatchChange(setIsOverSlot);\n }, [dropZoneManager]);\n\n useEffect(() => {\n return () => {\n resetDragPosition();\n };\n }, []);\n\n if (!isDragging) {\n return null;\n }\n\n if (item && item.dragInNavigator) {\n return null;\n }\n\n return (\n <div className=\"fixed pointer-events-none left-0 top-0 w-full h-full z-[1001]\">\n <div ref={setDragPreviewRef} className=\"absolute\">\n <DragCursorWrapper componentName={item?.componentName} isOverSlot={isOverSlot} />\n </div>\n </div>\n );\n};\n\nexport default DragPreview;\n"],"names":["DragPreview","isOverSlot","setIsOverSlot","useState","dropZoneManager","useDropZoneManager","isDragging","item","useDragLayer","monitor","setupDragPosition","useEffect","resetDragPosition","setDragPreviewRef","DragCursorWrapper"],"mappings":";;;;;AAOA,MAAMA,cAAc;IAChB,MAAM,CAACC,YAAYC,cAAc,GAAGC,SAAS;IAC7C,MAAMC,kBAAkBC;IAExB,MAAM,EAAEC,UAAU,EAAEC,IAAI,EAAE,GAAGC,aAAa,CAACC;QACvCC,kBAAkBD;QAElB,OAAO;YACH,YAAYA,QAAQ,UAAU;YAC9B,MAAMA,QAAQ,OAAO;QACzB;IACJ;IAEAE,UAAU,IACCP,gBAAgB,sBAAsB,CAACF,gBAC/C;QAACE;KAAgB;IAEpBO,UAAU,IACC;YACHC;QACJ,GACD,EAAE;IAEL,IAAI,CAACN,YACD,OAAO;IAGX,IAAIC,QAAQA,KAAK,eAAe,EAC5B,OAAO;IAGX,OAAO,WAAP,GACI,oBAAC;QAAI,WAAU;qBACX,oBAAC;QAAI,KAAKM;QAAmB,WAAU;qBACnC,oBAACC,mBAAiBA;QAAC,eAAeP,MAAM;QAAe,YAAYN;;AAInF;AAEA,gCAAeD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./DragPreview.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./DragPreview.js";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
let subscribedToOffsetChange = false;
|
|
2
|
+
let dragPreviewRef = null;
|
|
3
|
+
const onOffsetChange = (monitor)=>()=>{
|
|
4
|
+
if (!dragPreviewRef) return;
|
|
5
|
+
const offset = monitor.getClientOffset();
|
|
6
|
+
if (!offset) return;
|
|
7
|
+
const transform = `translate(${offset.x + 8}px, ${offset.y + 8}px)`;
|
|
8
|
+
dragPreviewRef.style["transform"] = transform;
|
|
9
|
+
dragPreviewRef.style["-webkit-transform"] = transform;
|
|
10
|
+
};
|
|
11
|
+
function setupDragPosition(monitor) {
|
|
12
|
+
if (!subscribedToOffsetChange) {
|
|
13
|
+
monitor.subscribeToOffsetChange(onOffsetChange(monitor));
|
|
14
|
+
subscribedToOffsetChange = true;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function setDragPreviewRef(el) {
|
|
18
|
+
dragPreviewRef = el;
|
|
19
|
+
}
|
|
20
|
+
function resetDragPosition() {
|
|
21
|
+
subscribedToOffsetChange = false;
|
|
22
|
+
dragPreviewRef = null;
|
|
23
|
+
}
|
|
24
|
+
export { resetDragPosition, setDragPreviewRef, setupDragPosition };
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=useDragPosition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseEditor/components/DragPreview/useDragPosition.js","sources":["../../../../src/BaseEditor/components/DragPreview/useDragPosition.ts"],"sourcesContent":["import type { DragLayerMonitor } from \"react-dnd\";\n\nlet subscribedToOffsetChange = false;\nlet dragPreviewRef: HTMLDivElement | null = null;\n\nconst onOffsetChange = (monitor: DragLayerMonitor) => () => {\n if (!dragPreviewRef) {\n return;\n }\n\n const offset = monitor.getClientOffset();\n if (!offset) {\n return;\n }\n\n const transform = `translate(${offset.x + 8}px, ${offset.y + 8}px)`;\n dragPreviewRef.style[\"transform\"] = transform;\n // @ts-expect-error\n dragPreviewRef.style[\"-webkit-transform\"] = transform;\n};\n\nexport function setupDragPosition(monitor: DragLayerMonitor) {\n if (!subscribedToOffsetChange) {\n // @ts-expect-error\n monitor.subscribeToOffsetChange(onOffsetChange(monitor));\n subscribedToOffsetChange = true;\n }\n}\n\nexport function setDragPreviewRef(el: HTMLDivElement | null) {\n dragPreviewRef = el;\n}\n\nexport function resetDragPosition() {\n subscribedToOffsetChange = false;\n dragPreviewRef = null;\n}\n"],"names":["subscribedToOffsetChange","dragPreviewRef","onOffsetChange","monitor","offset","transform","setupDragPosition","setDragPreviewRef","el","resetDragPosition"],"mappings":"AAEA,IAAIA,2BAA2B;AAC/B,IAAIC,iBAAwC;AAE5C,MAAMC,iBAAiB,CAACC,UAA8B;QAClD,IAAI,CAACF,gBACD;QAGJ,MAAMG,SAASD,QAAQ,eAAe;QACtC,IAAI,CAACC,QACD;QAGJ,MAAMC,YAAY,CAAC,UAAU,EAAED,OAAO,CAAC,GAAG,EAAE,IAAI,EAAEA,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC;QACnEH,eAAe,KAAK,CAAC,YAAY,GAAGI;QAEpCJ,eAAe,KAAK,CAAC,oBAAoB,GAAGI;IAChD;AAEO,SAASC,kBAAkBH,OAAyB;IACvD,IAAI,CAACH,0BAA0B;QAE3BG,QAAQ,uBAAuB,CAACD,eAAeC;QAC/CH,2BAA2B;IAC/B;AACJ;AAEO,SAASO,kBAAkBC,EAAyB;IACvDP,iBAAiBO;AACrB;AAEO,SAASC;IACZT,2BAA2B;IAC3BC,iBAAiB;AACrB"}
|
|
@@ -2,7 +2,6 @@ import react, { useEffect, useState } from "react";
|
|
|
2
2
|
import classnames from "classnames";
|
|
3
3
|
import { allNodes } from "@webiny/lexical-nodes";
|
|
4
4
|
import { useLexicalContext } from "@webiny/app-admin/presentation/lexicalContext/useLexicalContext.js";
|
|
5
|
-
import DragPreview from "./DragPreview.js";
|
|
6
5
|
import { EditorConfig, EditorWithConfig } from "../config/index.js";
|
|
7
6
|
import { useDocumentEditor } from "../../DocumentEditor/index.js";
|
|
8
7
|
import { Commands } from "../index.js";
|
|
@@ -22,7 +21,7 @@ const Editor = ()=>{
|
|
|
22
21
|
theme: theme
|
|
23
22
|
}, /*#__PURE__*/ react.createElement("div", {
|
|
24
23
|
className: classnames("w-full")
|
|
25
|
-
}, /*#__PURE__*/ react.createElement(EditorWithConfig, null, /*#__PURE__*/ react.createElement(EditorConfig.Ui.Layout, null))
|
|
24
|
+
}, /*#__PURE__*/ react.createElement(EditorWithConfig, null, /*#__PURE__*/ react.createElement(EditorConfig.Ui.Layout, null))));
|
|
26
25
|
};
|
|
27
26
|
export { Editor };
|
|
28
27
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseEditor/components/Editor.js","sources":["../../../src/BaseEditor/components/Editor.tsx"],"sourcesContent":["import React, { useEffect, useState } from \"react\";\nimport classSet from \"classnames\";\nimport { allNodes } from \"@webiny/lexical-nodes\";\nimport type { WebsiteBuilderTheme } from \"@webiny/website-builder-sdk\";\nimport { useLexicalContext } from \"@webiny/app-admin/presentation/lexicalContext/useLexicalContext.js\";\nimport
|
|
1
|
+
{"version":3,"file":"BaseEditor/components/Editor.js","sources":["../../../src/BaseEditor/components/Editor.tsx"],"sourcesContent":["import React, { useEffect, useState } from \"react\";\nimport classSet from \"classnames\";\nimport { allNodes } from \"@webiny/lexical-nodes\";\nimport type { WebsiteBuilderTheme } from \"@webiny/website-builder-sdk\";\nimport { useLexicalContext } from \"@webiny/app-admin/presentation/lexicalContext/useLexicalContext.js\";\nimport { EditorConfig, EditorWithConfig } from \"../config/index.js\";\nimport { useDocumentEditor } from \"~/DocumentEditor/index.js\";\nimport { Commands } from \"~/BaseEditor/index.js\";\nimport { ThemeProvider } from \"~/BaseEditor/components/ThemeProvider.js\";\n\nexport const Editor = () => {\n const { lexicalContext } = useLexicalContext();\n const editor = useDocumentEditor();\n const [theme, setTheme] = useState<WebsiteBuilderTheme | undefined>(undefined);\n\n useEffect(() => {\n editor.registerCommandHandler(Commands.SetTheme, ({ theme }) => {\n setTheme(theme);\n lexicalContext.setTheme(theme);\n lexicalContext.setNodes(allNodes);\n });\n }, []);\n\n return (\n <ThemeProvider theme={theme}>\n <div className={classSet(\"w-full\")}>\n <EditorWithConfig>\n <EditorConfig.Ui.Layout />\n </EditorWithConfig>\n </div>\n </ThemeProvider>\n );\n};\n"],"names":["Editor","lexicalContext","useLexicalContext","editor","useDocumentEditor","theme","setTheme","useState","undefined","useEffect","Commands","allNodes","ThemeProvider","classSet","EditorWithConfig","EditorConfig"],"mappings":";;;;;;;;AAUO,MAAMA,SAAS;IAClB,MAAM,EAAEC,cAAc,EAAE,GAAGC;IAC3B,MAAMC,SAASC;IACf,MAAM,CAACC,OAAOC,SAAS,GAAGC,SAA0CC;IAEpEC,UAAU;QACNN,OAAO,sBAAsB,CAACO,SAAS,QAAQ,EAAE,CAAC,EAAEL,KAAK,EAAE;YACvDC,SAASD;YACTJ,eAAe,QAAQ,CAACI;YACxBJ,eAAe,QAAQ,CAACU;QAC5B;IACJ,GAAG,EAAE;IAEL,OAAO,WAAP,GACI,oBAACC,eAAaA;QAAC,OAAOP;qBAClB,oBAAC;QAAI,WAAWQ,WAAS;qBACrB,oBAACC,kBAAgBA,MAAAA,WAAAA,GACb,oBAACC,aAAa,EAAE,CAAC,MAAM;AAK3C"}
|
|
@@ -284,6 +284,7 @@ export declare const EditorConfigComponents: {
|
|
|
284
284
|
displayName: string;
|
|
285
285
|
}>) => (props: unknown) => React.JSX.Element;
|
|
286
286
|
};
|
|
287
|
+
Tab: ({ name, label, icon, element, disabled, visible }: import("./Toolbar/Tab.js").TabProps) => import("react").JSX.Element;
|
|
287
288
|
};
|
|
288
289
|
Sidebar: (() => import("react").JSX.Element) & {
|
|
289
290
|
original: () => import("react").JSX.Element;
|
|
@@ -380,7 +381,7 @@ export declare const EditorConfigComponents: {
|
|
|
380
381
|
displayName: string;
|
|
381
382
|
}>) => (props: unknown) => React.JSX.Element;
|
|
382
383
|
} & {
|
|
383
|
-
Tab: ({ name, label, disabled, element, visible
|
|
384
|
+
Tab: ({ name, label, icon, disabled, element, visible }: import("./Sidebar/Tab.js").TabProps) => import("react").JSX.Element;
|
|
384
385
|
};
|
|
385
386
|
ScrollableContainer: ({ children }: any) => import("react").JSX.Element;
|
|
386
387
|
};
|
|
@@ -761,6 +762,7 @@ export declare const EditorConfig: (({ priority, children }: import("@webiny/rea
|
|
|
761
762
|
displayName: string;
|
|
762
763
|
}>) => (props: unknown) => React.JSX.Element;
|
|
763
764
|
};
|
|
765
|
+
Tab: ({ name, label, icon, element, disabled, visible }: import("./Toolbar/Tab.js").TabProps) => import("react").JSX.Element;
|
|
764
766
|
};
|
|
765
767
|
Sidebar: (() => import("react").JSX.Element) & {
|
|
766
768
|
original: () => import("react").JSX.Element;
|
|
@@ -857,7 +859,7 @@ export declare const EditorConfig: (({ priority, children }: import("@webiny/rea
|
|
|
857
859
|
displayName: string;
|
|
858
860
|
}>) => (props: unknown) => React.JSX.Element;
|
|
859
861
|
} & {
|
|
860
|
-
Tab: ({ name, label, disabled, element, visible
|
|
862
|
+
Tab: ({ name, label, icon, disabled, element, visible }: import("./Sidebar/Tab.js").TabProps) => import("react").JSX.Element;
|
|
861
863
|
};
|
|
862
864
|
ScrollableContainer: ({ children }: any) => import("react").JSX.Element;
|
|
863
865
|
};
|
|
@@ -24,7 +24,7 @@ const Layout = makeDecoratable("EditorLayout", ()=>{
|
|
|
24
24
|
};
|
|
25
25
|
}, []);
|
|
26
26
|
return /*#__PURE__*/ react.createElement(EditorLayoutContainer, null, /*#__PURE__*/ react.createElement(EditorConfig.Ui.TopBar, null), /*#__PURE__*/ react.createElement("div", {
|
|
27
|
-
className: "flex flex-row
|
|
27
|
+
className: "flex flex-row"
|
|
28
28
|
}, /*#__PURE__*/ react.createElement(IsNotReadOnly, null, /*#__PURE__*/ react.createElement(EditorConfig.Ui.Toolbar, null)), /*#__PURE__*/ react.createElement("div", {
|
|
29
29
|
className: "flex-auto"
|
|
30
30
|
}, /*#__PURE__*/ react.createElement(EditorConfig.Ui.Content, null)), /*#__PURE__*/ react.createElement(IsNotReadOnly, null, /*#__PURE__*/ react.createElement(EditorConfig.Ui.Sidebar, null))), /*#__PURE__*/ react.createElement(EditorConfig.Ui.Elements, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseEditor/config/Layout.js","sources":["../../../src/BaseEditor/config/Layout.tsx"],"sourcesContent":["import React, { useEffect } from \"react\";\nimport { makeDecoratable } from \"@webiny/react-composition\";\nimport { EditorConfig } from \"./EditorConfig.js\";\nimport styled from \"@emotion/styled\";\nimport { IsNotReadOnly } from \"~/BaseEditor/config/IsNotReadOnly.js\";\nimport { useReservedUISpace } from \"~/BaseEditor/hooks/useReservedUISpace.js\";\nimport { useDocumentEditor } from \"~/DocumentEditor/index.js\";\n\nconst EditorLayoutContainer = styled.div`\n height: 100%;\n overflow: hidden;\n`;\n\nexport const Layout = makeDecoratable(\"EditorLayout\", () => {\n const editor = useDocumentEditor();\n\n useReservedUISpace(dimensions => {\n editor.updateEditor(state => {\n state.uiReservedSpace = dimensions;\n });\n });\n\n useEffect(() => {\n const currentOverflow = document.body.style.overflow;\n document.body.style.overflow = \"hidden\";\n return () => {\n document.body.style.overflow = currentOverflow;\n };\n }, []);\n\n return (\n <EditorLayoutContainer>\n <EditorConfig.Ui.TopBar />\n <div className={\"flex flex-row
|
|
1
|
+
{"version":3,"file":"BaseEditor/config/Layout.js","sources":["../../../src/BaseEditor/config/Layout.tsx"],"sourcesContent":["import React, { useEffect } from \"react\";\nimport { makeDecoratable } from \"@webiny/react-composition\";\nimport { EditorConfig } from \"./EditorConfig.js\";\nimport styled from \"@emotion/styled\";\nimport { IsNotReadOnly } from \"~/BaseEditor/config/IsNotReadOnly.js\";\nimport { useReservedUISpace } from \"~/BaseEditor/hooks/useReservedUISpace.js\";\nimport { useDocumentEditor } from \"~/DocumentEditor/index.js\";\n\nconst EditorLayoutContainer = styled.div`\n height: 100%;\n overflow: hidden;\n`;\n\nexport const Layout = makeDecoratable(\"EditorLayout\", () => {\n const editor = useDocumentEditor();\n\n useReservedUISpace(dimensions => {\n editor.updateEditor(state => {\n state.uiReservedSpace = dimensions;\n });\n });\n\n useEffect(() => {\n const currentOverflow = document.body.style.overflow;\n document.body.style.overflow = \"hidden\";\n return () => {\n document.body.style.overflow = currentOverflow;\n };\n }, []);\n\n return (\n <EditorLayoutContainer>\n <EditorConfig.Ui.TopBar />\n <div className={\"flex flex-row\"}>\n <IsNotReadOnly>\n <EditorConfig.Ui.Toolbar />\n </IsNotReadOnly>\n <div className={\"flex-auto\"}>\n <EditorConfig.Ui.Content />\n </div>\n <IsNotReadOnly>\n <EditorConfig.Ui.Sidebar />\n </IsNotReadOnly>\n </div>\n <EditorConfig.Ui.Elements group={\"overlays\"} />\n </EditorLayoutContainer>\n );\n});\n"],"names":["EditorLayoutContainer","styled","Layout","makeDecoratable","editor","useDocumentEditor","useReservedUISpace","dimensions","state","useEffect","currentOverflow","document","EditorConfig","IsNotReadOnly"],"mappings":";;;;;;;AAQA,MAAMA,wBAAwBC,OAAO,GAAG,CAAC;;;AAGzC,CAAC;AAEM,MAAMC,SAASC,gBAAgB,gBAAgB;IAClD,MAAMC,SAASC;IAEfC,mBAAmBC,CAAAA;QACfH,OAAO,YAAY,CAACI,CAAAA;YAChBA,MAAM,eAAe,GAAGD;QAC5B;IACJ;IAEAE,UAAU;QACN,MAAMC,kBAAkBC,SAAS,IAAI,CAAC,KAAK,CAAC,QAAQ;QACpDA,SAAS,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG;QAC/B,OAAO;YACHA,SAAS,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAGD;QACnC;IACJ,GAAG,EAAE;IAEL,OAAO,WAAP,GACI,oBAACV,uBAAqBA,MAAAA,WAAAA,GAClB,oBAACY,aAAa,EAAE,CAAC,MAAM,uBACvB,oBAAC;QAAI,WAAW;qBACZ,oBAACC,eAAaA,MAAAA,WAAAA,GACV,oBAACD,aAAa,EAAE,CAAC,OAAO,wBAE5B,oBAAC;QAAI,WAAW;qBACZ,oBAACA,aAAa,EAAE,CAAC,OAAO,wBAE5B,oBAACC,eAAaA,MAAAA,WAAAA,GACV,oBAACD,aAAa,EAAE,CAAC,OAAO,yBAGhC,oBAACA,aAAa,EAAE,CAAC,QAAQ;QAAC,OAAO;;AAG7C"}
|
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
import react from "react";
|
|
2
2
|
import { makeDecoratable } from "@webiny/app-admin";
|
|
3
|
-
import {
|
|
3
|
+
import { SegmentedControl } from "@webiny/admin-ui";
|
|
4
4
|
import { Sidebar } from "./Sidebar.js";
|
|
5
5
|
const Layout = makeDecoratable("SidebarLayout", ()=>/*#__PURE__*/ react.createElement("div", {
|
|
6
6
|
"data-role": "editor-sidebar",
|
|
7
7
|
"data-affects-preview": "width",
|
|
8
|
-
className: "bg-neutral-base border-l-sm border-l-neutral-dimmed"
|
|
9
|
-
}, /*#__PURE__*/ react.createElement(Tabs, {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
/*#__PURE__*/ react.createElement(Sidebar.Elements, {
|
|
16
|
-
group: "groups",
|
|
17
|
-
key: "groups"
|
|
18
|
-
})
|
|
19
|
-
]
|
|
20
|
-
})));
|
|
8
|
+
className: "bg-neutral-base border-l-sm border-l-neutral-dimmed h-full flex flex-col p-sm"
|
|
9
|
+
}, /*#__PURE__*/ react.createElement(SegmentedControl.Tabs, {
|
|
10
|
+
className: "flex-1 flex flex-col min-h-0",
|
|
11
|
+
variant: "dimmed"
|
|
12
|
+
}, /*#__PURE__*/ react.createElement(Sidebar.Elements, {
|
|
13
|
+
group: "groups"
|
|
14
|
+
}))));
|
|
21
15
|
export { Layout };
|
|
22
16
|
|
|
23
17
|
//# sourceMappingURL=Layout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseEditor/config/Sidebar/Layout.js","sources":["../../../../src/BaseEditor/config/Sidebar/Layout.tsx"],"sourcesContent":["import React from \"react\";\nimport { makeDecoratable } from \"@webiny/app-admin\";\nimport {
|
|
1
|
+
{"version":3,"file":"BaseEditor/config/Sidebar/Layout.js","sources":["../../../../src/BaseEditor/config/Sidebar/Layout.tsx"],"sourcesContent":["import React from \"react\";\nimport { makeDecoratable } from \"@webiny/app-admin\";\nimport { SegmentedControl } from \"@webiny/admin-ui\";\nimport { Sidebar } from \"./Sidebar.js\";\n\nexport const Layout = makeDecoratable(\"SidebarLayout\", () => {\n return (\n <div\n data-role=\"editor-sidebar\"\n data-affects-preview={\"width\"}\n className={\n \"bg-neutral-base border-l-sm border-l-neutral-dimmed h-full flex flex-col p-sm\"\n }\n >\n <SegmentedControl.Tabs className={\"flex-1 flex flex-col min-h-0\"} variant={\"dimmed\"}>\n <Sidebar.Elements group={\"groups\"} />\n </SegmentedControl.Tabs>\n </div>\n );\n});\n"],"names":["Layout","makeDecoratable","SegmentedControl","Sidebar"],"mappings":";;;;AAKO,MAAMA,SAASC,gBAAgB,iBAAiB,IAC5C,WAAP,GACI,oBAAC;QACG,aAAU;QACV,wBAAsB;QACtB,WACI;qBAGJ,oBAACC,iBAAiB,IAAI;QAAC,WAAW;QAAgC,SAAS;qBACvE,oBAACC,QAAQ,QAAQ;QAAC,OAAO"}
|
|
@@ -100,7 +100,7 @@ export declare const Sidebar: (() => React.JSX.Element) & {
|
|
|
100
100
|
displayName: string;
|
|
101
101
|
}>) => (props: unknown) => React.JSX.Element;
|
|
102
102
|
} & {
|
|
103
|
-
Tab: ({ name, label, disabled, element, visible
|
|
103
|
+
Tab: ({ name, label, icon, disabled, element, visible }: import("./Tab.js").TabProps) => React.JSX.Element;
|
|
104
104
|
};
|
|
105
105
|
ScrollableContainer: ({ children }: any) => React.JSX.Element;
|
|
106
106
|
};
|
|
@@ -8,7 +8,7 @@ import { createGetId } from "../createGetId.js";
|
|
|
8
8
|
import { ScrollableContainer } from "./ScrollableContainer.js";
|
|
9
9
|
const SCOPE = "sidebar";
|
|
10
10
|
const BaseSidebar = makeDecoratable("SidebarScopedLayout", ()=>/*#__PURE__*/ react.createElement("div", {
|
|
11
|
-
className: "w-[
|
|
11
|
+
className: "w-[var(--wb-spacing-sidebar)] flex-none"
|
|
12
12
|
}, /*#__PURE__*/ react.createElement(Layout, null)));
|
|
13
13
|
const ScopedElement = makeDecoratable("SidebarScopedElement", (props)=>/*#__PURE__*/ react.createElement(Element, {
|
|
14
14
|
...props,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseEditor/config/Sidebar/Sidebar.js","sources":["../../../../src/BaseEditor/config/Sidebar/Sidebar.tsx"],"sourcesContent":["import React from \"react\";\nimport { makeDecoratable } from \"@webiny/app-admin\";\nimport type { ElementProps as CoreElementProps } from \"../Element.js\";\nimport { Element as CoreElement } from \"../Element.js\";\nimport { Layout } from \"./Layout.js\";\nimport type { ElementsProps as BaseElementsProps } from \"../Elements.js\";\nimport { Elements as BaseElements } from \"../Elements.js\";\nimport { Tab } from \"./Tab.js\";\nimport { createGetId } from \"../createGetId.js\";\nimport { ScrollableContainer } from \"../Sidebar/ScrollableContainer.js\";\n\nconst SCOPE = \"sidebar\";\n\nconst BaseSidebar = makeDecoratable(\"SidebarScopedLayout\", () => {\n return (\n <div className={\"w-[
|
|
1
|
+
{"version":3,"file":"BaseEditor/config/Sidebar/Sidebar.js","sources":["../../../../src/BaseEditor/config/Sidebar/Sidebar.tsx"],"sourcesContent":["import React from \"react\";\nimport { makeDecoratable } from \"@webiny/app-admin\";\nimport type { ElementProps as CoreElementProps } from \"../Element.js\";\nimport { Element as CoreElement } from \"../Element.js\";\nimport { Layout } from \"./Layout.js\";\nimport type { ElementsProps as BaseElementsProps } from \"../Elements.js\";\nimport { Elements as BaseElements } from \"../Elements.js\";\nimport { Tab } from \"./Tab.js\";\nimport { createGetId } from \"../createGetId.js\";\nimport { ScrollableContainer } from \"../Sidebar/ScrollableContainer.js\";\n\nconst SCOPE = \"sidebar\";\n\nconst BaseSidebar = makeDecoratable(\"SidebarScopedLayout\", () => {\n return (\n <div className={\"w-[var(--wb-spacing-sidebar)] flex-none\"}>\n <Layout />\n </div>\n );\n});\n\nexport type ScopedElementProps = Omit<CoreElementProps, \"scope\">;\n\nconst ScopedElement = makeDecoratable(\"SidebarScopedElement\", (props: ScopedElementProps) => {\n return <CoreElement {...props} scope={SCOPE} />;\n});\n\nconst getElementId = createGetId(SCOPE)();\n\nexport type BaseElementProps = Omit<ScopedElementProps, \"id\">;\n\nconst BaseElement = makeDecoratable(\"SidebarElement\", (props: BaseElementProps) => {\n return (\n <ScopedElement\n {...props}\n id={getElementId(props.name)}\n before={props.before ? getElementId(props.before) : undefined}\n after={props.after ? getElementId(props.after) : undefined}\n />\n );\n});\n\nexport type ElementsProps = Omit<BaseElementsProps, \"scope\">;\n\nconst Elements = makeDecoratable(\"SidebarElements\", (props: ElementsProps) => {\n return <BaseElements {...props} scope={SCOPE} />;\n});\n\nexport type GroupProps = Omit<BaseElementProps, \"group\">;\n\nconst BaseGroup = makeDecoratable(\"SidebarGroup\", (props: GroupProps) => {\n return (\n <ScopedElement\n {...props}\n group={\"groups\"}\n id={getElementId(props.name)}\n before={props.before ? getElementId(props.before) : undefined}\n after={props.after ? getElementId(props.after) : undefined}\n />\n );\n});\n\nexport const Sidebar = Object.assign(BaseSidebar, {\n Layout,\n Element: BaseElement,\n Elements,\n Group: Object.assign(BaseGroup, { Tab }),\n ScrollableContainer\n});\n"],"names":["SCOPE","BaseSidebar","makeDecoratable","Layout","ScopedElement","props","CoreElement","getElementId","createGetId","BaseElement","undefined","Elements","BaseElements","BaseGroup","Sidebar","Object","Tab","ScrollableContainer"],"mappings":";;;;;;;;AAWA,MAAMA,QAAQ;AAEd,MAAMC,cAAcC,gBAAgB,uBAAuB,IAChD,WAAP,GACI,oBAAC;QAAI,WAAW;qBACZ,oBAACC,QAAMA;AAOnB,MAAMC,gBAAgBF,gBAAgB,wBAAwB,CAACG,QACpD,WAAP,GAAO,oBAACC,SAAWA;QAAE,GAAGD,KAAK;QAAE,OAAOL;;AAG1C,MAAMO,eAAeC,YAAYR;AAIjC,MAAMS,cAAcP,gBAAgB,kBAAkB,CAACG,QAC5C,WAAP,GACI,oBAACD,eAAaA;QACT,GAAGC,KAAK;QACT,IAAIE,aAAaF,MAAM,IAAI;QAC3B,QAAQA,MAAM,MAAM,GAAGE,aAAaF,MAAM,MAAM,IAAIK;QACpD,OAAOL,MAAM,KAAK,GAAGE,aAAaF,MAAM,KAAK,IAAIK;;AAO7D,MAAMC,mBAAWT,gBAAgB,mBAAmB,CAACG,QAC1C,WAAP,GAAO,oBAACO,UAAYA;QAAE,GAAGP,KAAK;QAAE,OAAOL;;AAK3C,MAAMa,YAAYX,gBAAgB,gBAAgB,CAACG,QACxC,WAAP,GACI,oBAACD,eAAaA;QACT,GAAGC,KAAK;QACT,OAAO;QACP,IAAIE,aAAaF,MAAM,IAAI;QAC3B,QAAQA,MAAM,MAAM,GAAGE,aAAaF,MAAM,MAAM,IAAIK;QACpD,OAAOL,MAAM,KAAK,GAAGE,aAAaF,MAAM,KAAK,IAAIK;;AAKtD,MAAMI,UAAUC,OAAO,MAAM,CAACd,aAAa;IAC9CE,QAAMA;IACN,SAASM;IACTE,UAAAA;IACA,OAAOI,OAAO,MAAM,CAACF,WAAW;QAAEG,KAAGA;IAAC;IACtCC,qBAAmBA;AACvB"}
|
|
@@ -6,9 +6,9 @@ export declare const TabContainer: import("@emotion/styled").StyledComponent<{
|
|
|
6
6
|
export interface TabProps {
|
|
7
7
|
name: string;
|
|
8
8
|
label: string;
|
|
9
|
-
|
|
9
|
+
icon?: React.ReactElement;
|
|
10
10
|
element: React.JSX.Element;
|
|
11
11
|
disabled?: boolean;
|
|
12
12
|
visible?: boolean;
|
|
13
13
|
}
|
|
14
|
-
export declare const Tab: ({ name, label, disabled, element, visible
|
|
14
|
+
export declare const Tab: ({ name, label, icon, disabled, element, visible }: TabProps) => React.JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import react from "react";
|
|
2
2
|
import styled from "@emotion/styled";
|
|
3
|
-
import {
|
|
3
|
+
import { SegmentedControl } from "@webiny/admin-ui";
|
|
4
4
|
const TabContainer = styled("div")({
|
|
5
5
|
display: "flex",
|
|
6
6
|
position: "relative",
|
|
@@ -18,10 +18,10 @@ const TabContainer = styled("div")({
|
|
|
18
18
|
outline: "1px solid slategrey"
|
|
19
19
|
}
|
|
20
20
|
});
|
|
21
|
-
const Tab = ({ name, label, disabled, element, visible
|
|
22
|
-
className: noPadding ? "p-0" : void 0,
|
|
21
|
+
const Tab = ({ name, label, icon, disabled, element, visible })=>/*#__PURE__*/ react.createElement(SegmentedControl.Tabs.Tab, {
|
|
23
22
|
value: name,
|
|
24
23
|
trigger: label,
|
|
24
|
+
icon: icon,
|
|
25
25
|
disabled: disabled,
|
|
26
26
|
visible: visible,
|
|
27
27
|
content: /*#__PURE__*/ react.createElement(TabContainer, null, element)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseEditor/config/Sidebar/Tab.js","sources":["../../../../src/BaseEditor/config/Sidebar/Tab.tsx"],"sourcesContent":["import React from \"react\";\nimport styled from \"@emotion/styled\";\nimport {
|
|
1
|
+
{"version":3,"file":"BaseEditor/config/Sidebar/Tab.js","sources":["../../../../src/BaseEditor/config/Sidebar/Tab.tsx"],"sourcesContent":["import React from \"react\";\nimport styled from \"@emotion/styled\";\nimport { SegmentedControl } from \"@webiny/admin-ui\";\n\nexport const TabContainer = styled(\"div\")({\n display: \"flex\",\n position: \"relative\",\n flexDirection: \"column\",\n height: \"calc(100vh - 44px - 49px)\", // Subtract top-bar and tab-header height\n overflowY: \"auto\",\n // Style scrollbar\n \"&::-webkit-scrollbar\": {\n width: 1\n },\n \"&::-webkit-scrollbar-track\": {\n boxShadow: \"inset 0 0 6px rgba(0, 0, 0, 0.3)\"\n },\n \"&::-webkit-scrollbar-thumb\": {\n backgroundColor: \"darkgrey\",\n outline: \"1px solid slategrey\"\n }\n});\n\nexport interface TabProps {\n name: string;\n label: string;\n icon?: React.ReactElement;\n element: React.JSX.Element;\n disabled?: boolean;\n visible?: boolean;\n}\n\nexport const Tab = ({ name, label, icon, disabled, element, visible }: TabProps) => {\n return (\n <SegmentedControl.Tabs.Tab\n value={name}\n trigger={label}\n icon={icon}\n disabled={disabled}\n visible={visible}\n content={<TabContainer>{element}</TabContainer>}\n />\n );\n};\n"],"names":["TabContainer","styled","Tab","name","label","icon","disabled","element","visible","SegmentedControl"],"mappings":";;;AAIO,MAAMA,eAAeC,OAAO,OAAO;IACtC,SAAS;IACT,UAAU;IACV,eAAe;IACf,QAAQ;IACR,WAAW;IAEX,wBAAwB;QACpB,OAAO;IACX;IACA,8BAA8B;QAC1B,WAAW;IACf;IACA,8BAA8B;QAC1B,iBAAiB;QACjB,SAAS;IACb;AACJ;AAWO,MAAMC,MAAM,CAAC,EAAEC,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,EAAY,GACpE,WAAP,GACI,oBAACC,iBAAiB,IAAI,CAAC,GAAG;QACtB,OAAON;QACP,SAASC;QACT,MAAMC;QACN,UAAUC;QACV,SAASE;QACT,uBAAS,oBAACR,cAAYA,MAAEO"}
|
|
@@ -1,21 +1,15 @@
|
|
|
1
1
|
import react from "react";
|
|
2
|
+
import { SegmentedControl } from "@webiny/admin-ui";
|
|
2
3
|
import { Toolbar } from "./Toolbar.js";
|
|
3
|
-
import { Tabs } from "@webiny/admin-ui/Tabs/index.js";
|
|
4
4
|
const Layout = ()=>/*#__PURE__*/ react.createElement("div", {
|
|
5
5
|
"data-role": "editor-toolbar",
|
|
6
|
-
className: "bg-neutral-base border-r-sm border-r-neutral-dimmed
|
|
7
|
-
}, /*#__PURE__*/ react.createElement(Tabs, {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
key: "tabs",
|
|
14
|
-
group: "tabs"
|
|
15
|
-
})
|
|
16
|
-
],
|
|
17
|
-
separator: true
|
|
18
|
-
}));
|
|
6
|
+
className: "bg-neutral-base border-r-sm border-r-neutral-dimmed h-full flex flex-col p-sm"
|
|
7
|
+
}, /*#__PURE__*/ react.createElement(SegmentedControl.Tabs, {
|
|
8
|
+
className: "flex-1 flex flex-col min-h-0",
|
|
9
|
+
variant: "dimmed"
|
|
10
|
+
}, /*#__PURE__*/ react.createElement(Toolbar.Elements, {
|
|
11
|
+
group: "tabs"
|
|
12
|
+
})));
|
|
19
13
|
export { Layout };
|
|
20
14
|
|
|
21
15
|
//# sourceMappingURL=Layout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseEditor/config/Toolbar/Layout.js","sources":["../../../../src/BaseEditor/config/Toolbar/Layout.tsx"],"sourcesContent":["import React from \"react\";\nimport {
|
|
1
|
+
{"version":3,"file":"BaseEditor/config/Toolbar/Layout.js","sources":["../../../../src/BaseEditor/config/Toolbar/Layout.tsx"],"sourcesContent":["import React from \"react\";\nimport { SegmentedControl } from \"@webiny/admin-ui\";\nimport { Toolbar } from \"./Toolbar.js\";\n\nexport const Layout = () => {\n return (\n <div\n data-role={\"editor-toolbar\"}\n className={\n \"bg-neutral-base border-r-sm border-r-neutral-dimmed h-full flex flex-col p-sm\"\n }\n >\n <SegmentedControl.Tabs className={\"flex-1 flex flex-col min-h-0\"} variant={\"dimmed\"}>\n <Toolbar.Elements group={\"tabs\"} />\n </SegmentedControl.Tabs>\n </div>\n );\n};\n"],"names":["Layout","SegmentedControl","Toolbar"],"mappings":";;;AAIO,MAAMA,SAAS,IACX,WAAP,GACI,oBAAC;QACG,aAAW;QACX,WACI;qBAGJ,oBAACC,iBAAiB,IAAI;QAAC,WAAW;QAAgC,SAAS;qBACvE,oBAACC,QAAQ,QAAQ;QAAC,OAAO"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface TabProps {
|
|
3
|
+
name: string;
|
|
4
|
+
label: string;
|
|
5
|
+
icon?: React.ReactElement;
|
|
6
|
+
element: React.JSX.Element;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
visible?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const Tab: ({ name, label, icon, element, disabled, visible }: TabProps) => React.JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import react from "react";
|
|
2
|
+
import { SegmentedControl } from "@webiny/admin-ui";
|
|
3
|
+
const Tab = ({ name, label, icon, element, disabled, visible })=>/*#__PURE__*/ react.createElement(SegmentedControl.Tabs.Tab, {
|
|
4
|
+
value: name,
|
|
5
|
+
trigger: label,
|
|
6
|
+
icon: icon,
|
|
7
|
+
disabled: disabled,
|
|
8
|
+
visible: visible,
|
|
9
|
+
content: element
|
|
10
|
+
});
|
|
11
|
+
export { Tab };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=Tab.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseEditor/config/Toolbar/Tab.js","sources":["../../../../src/BaseEditor/config/Toolbar/Tab.tsx"],"sourcesContent":["import React from \"react\";\nimport { SegmentedControl } from \"@webiny/admin-ui\";\n\nexport interface TabProps {\n name: string;\n label: string;\n icon?: React.ReactElement;\n element: React.JSX.Element;\n disabled?: boolean;\n visible?: boolean;\n}\n\nexport const Tab = ({ name, label, icon, element, disabled, visible }: TabProps) => (\n <SegmentedControl.Tabs.Tab\n value={name}\n trigger={label}\n icon={icon}\n disabled={disabled}\n visible={visible}\n content={element}\n />\n);\n"],"names":["Tab","name","label","icon","element","disabled","visible","SegmentedControl"],"mappings":";;AAYO,MAAMA,MAAM,CAAC,EAAEC,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,OAAO,EAAY,iBAC3E,oBAACC,iBAAiB,IAAI,CAAC,GAAG;QACtB,OAAON;QACP,SAASC;QACT,MAAMC;QACN,UAAUE;QACV,SAASC;QACT,SAASF"}
|
|
@@ -4,9 +4,10 @@ import { Element } from "../Element.js";
|
|
|
4
4
|
import { Layout } from "./Layout.js";
|
|
5
5
|
import { Elements } from "../Elements.js";
|
|
6
6
|
import { createGetId } from "../createGetId.js";
|
|
7
|
+
import { Tab } from "./Tab.js";
|
|
7
8
|
const SCOPE = "toolbar";
|
|
8
9
|
const BaseToolbar = makeDecoratable("ToolbarLayout", ()=>/*#__PURE__*/ react.createElement("div", {
|
|
9
|
-
className: "w-[
|
|
10
|
+
className: "w-[var(--wb-spacing-toolbar)] flex-none",
|
|
10
11
|
"data-affects-preview": "width"
|
|
11
12
|
}, /*#__PURE__*/ react.createElement(Layout, null)));
|
|
12
13
|
const getElementId = createGetId(SCOPE)();
|
|
@@ -24,7 +25,8 @@ const Toolbar_Elements = makeDecoratable("ToolbarElements", (props)=>/*#__PURE__
|
|
|
24
25
|
const Toolbar = Object.assign(BaseToolbar, {
|
|
25
26
|
Layout: Layout,
|
|
26
27
|
Element: BaseToolbarElement,
|
|
27
|
-
Elements: Toolbar_Elements
|
|
28
|
+
Elements: Toolbar_Elements,
|
|
29
|
+
Tab: Tab
|
|
28
30
|
});
|
|
29
31
|
export { Toolbar };
|
|
30
32
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseEditor/config/Toolbar/Toolbar.js","sources":["../../../../src/BaseEditor/config/Toolbar/Toolbar.tsx"],"sourcesContent":["import React from \"react\";\nimport { makeDecoratable } from \"@webiny/app-admin\";\nimport type { ElementProps as BaseElementProps } from \"../Element.js\";\nimport { Element as BaseElement } from \"../Element.js\";\nimport { Layout } from \"./Layout.js\";\nimport type { ElementsProps as BaseElementsProps } from \"../Elements.js\";\nimport { Elements as BaseElements } from \"../Elements.js\";\nimport { createGetId } from \"../createGetId.js\";\n\nconst SCOPE = \"toolbar\";\n\nconst BaseToolbar = makeDecoratable(\"ToolbarLayout\", () => {\n return (\n <div className={\"w-[
|
|
1
|
+
{"version":3,"file":"BaseEditor/config/Toolbar/Toolbar.js","sources":["../../../../src/BaseEditor/config/Toolbar/Toolbar.tsx"],"sourcesContent":["import React from \"react\";\nimport { makeDecoratable } from \"@webiny/app-admin\";\nimport type { ElementProps as BaseElementProps } from \"../Element.js\";\nimport { Element as BaseElement } from \"../Element.js\";\nimport { Layout } from \"./Layout.js\";\nimport type { ElementsProps as BaseElementsProps } from \"../Elements.js\";\nimport { Elements as BaseElements } from \"../Elements.js\";\nimport { createGetId } from \"../createGetId.js\";\nimport { Tab } from \"./Tab.js\";\n\nconst SCOPE = \"toolbar\";\n\nconst BaseToolbar = makeDecoratable(\"ToolbarLayout\", () => {\n return (\n <div className={\"w-[var(--wb-spacing-toolbar)] flex-none\"} data-affects-preview={\"width\"}>\n <Layout />\n </div>\n );\n});\n\nconst getElementId = createGetId(SCOPE)();\n\nexport type ElementProps = Omit<BaseElementProps, \"scope\" | \"id\">;\n\nconst BaseToolbarElement = makeDecoratable(\"ToolbarElement\", (props: ElementProps) => {\n return (\n <BaseElement\n {...props}\n scope={SCOPE}\n id={getElementId(props.name)}\n before={props.before ? getElementId(props.before) : undefined}\n after={props.after ? getElementId(props.after) : undefined}\n />\n );\n});\n\nexport type ElementsProps = Omit<BaseElementsProps, \"scope\">;\n\nconst Elements = makeDecoratable(\"ToolbarElements\", (props: ElementsProps) => {\n return <BaseElements {...props} scope={SCOPE} />;\n});\n\nexport const Toolbar = Object.assign(BaseToolbar, {\n Layout,\n Element: BaseToolbarElement,\n Elements,\n Tab\n});\n"],"names":["SCOPE","BaseToolbar","makeDecoratable","Layout","getElementId","createGetId","BaseToolbarElement","props","BaseElement","undefined","Elements","BaseElements","Toolbar","Object","Tab"],"mappings":";;;;;;;AAUA,MAAMA,QAAQ;AAEd,MAAMC,cAAcC,gBAAgB,iBAAiB,IAC1C,WAAP,GACI,oBAAC;QAAI,WAAW;QAA2C,wBAAsB;qBAC7E,oBAACC,QAAMA;AAKnB,MAAMC,eAAeC,YAAYL;AAIjC,MAAMM,qBAAqBJ,gBAAgB,kBAAkB,CAACK,QACnD,WAAP,GACI,oBAACC,SAAWA;QACP,GAAGD,KAAK;QACT,OAAOP;QACP,IAAII,aAAaG,MAAM,IAAI;QAC3B,QAAQA,MAAM,MAAM,GAAGH,aAAaG,MAAM,MAAM,IAAIE;QACpD,OAAOF,MAAM,KAAK,GAAGH,aAAaG,MAAM,KAAK,IAAIE;;AAO7D,MAAMC,mBAAWR,gBAAgB,mBAAmB,CAACK,QAC1C,WAAP,GAAO,oBAACI,UAAYA;QAAE,GAAGJ,KAAK;QAAE,OAAOP;;AAGpC,MAAMY,UAAUC,OAAO,MAAM,CAACZ,aAAa;IAC9CE,QAAMA;IACN,SAASG;IACTI,UAAAA;IACAI,KAAGA;AACP"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import react, { useEffect, useState } from "react";
|
|
2
|
-
import { BreakpointSelector } from "./BreakpointSelector.js";
|
|
3
2
|
import { PreviewInNewTab } from "./PreviewInNewTab.js";
|
|
4
3
|
import { OpenInNewTab } from "./OpenInNewTab.js";
|
|
5
4
|
import { RefreshPreview } from "./RefreshPreview.js";
|
|
@@ -26,9 +25,7 @@ const AddressBar = ()=>{
|
|
|
26
25
|
className: "w-full absolute -top-px py-xs-plus pl-xl border-sm text-md peer cursor-not-allowed rounded-md border-neutral-subtle text-neutral-muted bg-neutral-disabled text-neutral-disabled"
|
|
27
26
|
}, /*#__PURE__*/ react.createElement(PreviewDomain, null), addressBarUrl), /*#__PURE__*/ react.createElement("div", {
|
|
28
27
|
className: "absolute right-0 top-0"
|
|
29
|
-
}, /*#__PURE__*/ react.createElement(RefreshPreview, null), /*#__PURE__*/ react.createElement(PreviewInNewTab, null), /*#__PURE__*/ react.createElement(OpenInNewTab, null)))
|
|
30
|
-
className: "flex-none"
|
|
31
|
-
}, /*#__PURE__*/ react.createElement(BreakpointSelector, null)));
|
|
28
|
+
}, /*#__PURE__*/ react.createElement(RefreshPreview, null), /*#__PURE__*/ react.createElement(PreviewInNewTab, null), /*#__PURE__*/ react.createElement(OpenInNewTab, null))));
|
|
32
29
|
};
|
|
33
30
|
export { AddressBar };
|
|
34
31
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseEditor/defaultConfig/Content/AddressBar/AddressBar.js","sources":["../../../../../src/BaseEditor/defaultConfig/Content/AddressBar/AddressBar.tsx"],"sourcesContent":["import React, { useEffect, useState } from \"react\";\nimport {
|
|
1
|
+
{"version":3,"file":"BaseEditor/defaultConfig/Content/AddressBar/AddressBar.js","sources":["../../../../../src/BaseEditor/defaultConfig/Content/AddressBar/AddressBar.tsx"],"sourcesContent":["import React, { useEffect, useState } from \"react\";\nimport { PreviewInNewTab } from \"./PreviewInNewTab.js\";\nimport { OpenInNewTab } from \"./OpenInNewTab.js\";\nimport { RefreshPreview } from \"./RefreshPreview.js\";\nimport { useSelectFromDocument } from \"~/BaseEditor/hooks/useSelectFromDocument.js\";\nimport { PreviewDomain } from \"./PreviewDomain.js\";\nimport { usePreviewDomain } from \"../usePreviewDomain.js\";\n\nexport const AddressBar = () => {\n const path = useSelectFromDocument(document => document.properties.path);\n\n const { previewDomain } = usePreviewDomain();\n const [addressBarUrl, setAddressBarUrl] = useState<string>(\"\");\n\n useEffect(() => {\n if (!previewDomain) {\n return;\n }\n\n setAddressBarUrl(`${previewDomain}${path}`);\n }, [path, previewDomain]);\n\n return (\n <div\n className=\"w-full h-[49px] flex flex-row p-sm bg-neutral-base border-solid border-b-sm border-neutral-dimmed gap-sm\"\n data-affects-preview={\"height\"}\n >\n <div className={\"relative flex-auto\"}>\n <div\n className={\n \"w-full absolute -top-px py-xs-plus pl-xl border-sm text-md peer cursor-not-allowed rounded-md border-neutral-subtle text-neutral-muted bg-neutral-disabled text-neutral-disabled\"\n }\n >\n <PreviewDomain />\n {addressBarUrl}\n </div>\n <div className={\"absolute right-0 top-0\"}>\n <RefreshPreview />\n <PreviewInNewTab />\n <OpenInNewTab />\n </div>\n </div>\n </div>\n );\n};\n"],"names":["AddressBar","path","useSelectFromDocument","document","previewDomain","usePreviewDomain","addressBarUrl","setAddressBarUrl","useState","useEffect","PreviewDomain","RefreshPreview","PreviewInNewTab","OpenInNewTab"],"mappings":";;;;;;;AAQO,MAAMA,aAAa;IACtB,MAAMC,OAAOC,sBAAsBC,CAAAA,WAAYA,SAAS,UAAU,CAAC,IAAI;IAEvE,MAAM,EAAEC,aAAa,EAAE,GAAGC;IAC1B,MAAM,CAACC,eAAeC,iBAAiB,GAAGC,SAAiB;IAE3DC,UAAU;QACN,IAAI,CAACL,eACD;QAGJG,iBAAiB,GAAGH,gBAAgBH,MAAM;IAC9C,GAAG;QAACA;QAAMG;KAAc;IAExB,OAAO,WAAP,GACI,oBAAC;QACG,WAAU;QACV,wBAAsB;qBAEtB,oBAAC;QAAI,WAAW;qBACZ,oBAAC;QACG,WACI;qBAGJ,oBAACM,eAAaA,OACbJ,gBAAAA,WAAAA,GAEL,oBAAC;QAAI,WAAW;qBACZ,oBAACK,gBAAcA,OAAAA,WAAAA,GACf,oBAACC,iBAAeA,OAAAA,WAAAA,GAChB,oBAACC,cAAYA;AAKjC"}
|
|
@@ -1,32 +1,29 @@
|
|
|
1
|
-
import react from "react";
|
|
2
|
-
import
|
|
3
|
-
import { Heading, IconButton, Text, Tooltip } from "@webiny/admin-ui";
|
|
1
|
+
import react, { useMemo } from "react";
|
|
2
|
+
import { Text, ToggleGroupPrimitive } from "@webiny/admin-ui";
|
|
4
3
|
import { useBreakpoint } from "../../../hooks/useBreakpoint.js";
|
|
5
4
|
import { InlineSvg } from "../../Toolbar/InsertElements/InlineSvg.js";
|
|
6
5
|
const BreakpointSelector = ()=>{
|
|
7
6
|
const { breakpoint, breakpoints, setBreakpoint } = useBreakpoint();
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}, breakpoints.map((bp)=>/*#__PURE__*/ react.createElement(Tooltip, {
|
|
11
|
-
key: bp.name,
|
|
12
|
-
content: /*#__PURE__*/ react.createElement("div", null, /*#__PURE__*/ react.createElement(Heading, {
|
|
13
|
-
level: 5
|
|
14
|
-
}, bp.title), /*#__PURE__*/ react.createElement(Text, {
|
|
15
|
-
size: "md"
|
|
16
|
-
}, bp.description)),
|
|
17
|
-
side: "bottom",
|
|
18
|
-
className: classnames("action-wrapper", {
|
|
19
|
-
active: bp === breakpoint
|
|
20
|
-
}),
|
|
21
|
-
trigger: /*#__PURE__*/ react.createElement(IconButton, {
|
|
22
|
-
size: "md",
|
|
7
|
+
const items = useMemo(()=>breakpoints.map((bp)=>({
|
|
8
|
+
value: bp.name,
|
|
23
9
|
icon: /*#__PURE__*/ react.createElement(InlineSvg, {
|
|
24
|
-
src: bp.icon
|
|
10
|
+
src: bp.icon,
|
|
11
|
+
className: "size-md"
|
|
25
12
|
}),
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
13
|
+
tooltip: /*#__PURE__*/ react.createElement(Text, {
|
|
14
|
+
size: "md"
|
|
15
|
+
}, /*#__PURE__*/ react.createElement("strong", null, bp.title), bp.description && /*#__PURE__*/ react.createElement(react.Fragment, null, /*#__PURE__*/ react.createElement("br", null), bp.description))
|
|
16
|
+
})), [
|
|
17
|
+
breakpoints
|
|
18
|
+
]);
|
|
19
|
+
return /*#__PURE__*/ react.createElement(ToggleGroupPrimitive, {
|
|
20
|
+
size: "md",
|
|
21
|
+
items: items,
|
|
22
|
+
value: breakpoint.name,
|
|
23
|
+
onChange: setBreakpoint,
|
|
24
|
+
variant: "ghost",
|
|
25
|
+
bordered: false
|
|
26
|
+
});
|
|
30
27
|
};
|
|
31
28
|
export { BreakpointSelector };
|
|
32
29
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseEditor/defaultConfig/Content/AddressBar/BreakpointSelector.js","sources":["../../../../../src/BaseEditor/defaultConfig/Content/AddressBar/BreakpointSelector.tsx"],"sourcesContent":["import React
|
|
1
|
+
{"version":3,"file":"BaseEditor/defaultConfig/Content/AddressBar/BreakpointSelector.js","sources":["../../../../../src/BaseEditor/defaultConfig/Content/AddressBar/BreakpointSelector.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport { Text, ToggleGroupPrimitive } from \"@webiny/admin-ui\";\nimport { useBreakpoint } from \"~/BaseEditor/hooks/useBreakpoint.js\";\nimport { InlineSvg } from \"~/BaseEditor/defaultConfig/Toolbar/InsertElements/InlineSvg.js\";\n\nexport const BreakpointSelector = () => {\n const { breakpoint, breakpoints, setBreakpoint } = useBreakpoint();\n\n const items = useMemo(() => {\n return breakpoints.map(bp => ({\n value: bp.name,\n icon: <InlineSvg src={bp.icon} className={\"size-md\"} />,\n tooltip: (\n <Text size=\"md\">\n <strong>{bp.title}</strong>\n {bp.description && (\n <>\n <br />\n {bp.description}\n </>\n )}\n </Text>\n )\n }));\n }, [breakpoints]);\n\n return (\n <ToggleGroupPrimitive\n size={\"md\"}\n items={items}\n value={breakpoint.name}\n onChange={setBreakpoint}\n variant={\"ghost\"}\n bordered={false}\n />\n );\n};\n"],"names":["BreakpointSelector","breakpoint","breakpoints","setBreakpoint","useBreakpoint","items","useMemo","bp","InlineSvg","Text","ToggleGroupPrimitive"],"mappings":";;;;AAKO,MAAMA,qBAAqB;IAC9B,MAAM,EAAEC,UAAU,EAAEC,WAAW,EAAEC,aAAa,EAAE,GAAGC;IAEnD,MAAMC,QAAQC,QAAQ,IACXJ,YAAY,GAAG,CAACK,CAAAA,KAAO;gBAC1B,OAAOA,GAAG,IAAI;gBACd,MAAM,WAAN,GAAM,oBAACC,WAASA;oBAAC,KAAKD,GAAG,IAAI;oBAAE,WAAW;;gBAC1C,SAAS,WAAT,GACI,oBAACE,MAAIA;oBAAC,MAAK;iCACP,oBAAC,gBAAQF,GAAG,KAAK,GAChBA,GAAG,WAAW,IAAI,WAAJ,GACX,wDACI,oBAAC,aACAA,GAAG,WAAW;YAKnC,KACD;QAACL;KAAY;IAEhB,OAAO,WAAP,GACI,oBAACQ,sBAAoBA;QACjB,MAAM;QACN,OAAOL;QACP,OAAOJ,WAAW,IAAI;QACtB,UAAUE;QACV,SAAS;QACT,UAAU;;AAGtB"}
|
|
@@ -26,7 +26,7 @@ const PreviewDomain = ()=>{
|
|
|
26
26
|
}, [
|
|
27
27
|
previewDomain
|
|
28
28
|
]);
|
|
29
|
-
const classNames = cn("absolute left-0 top-0", isOverridden ? "fill-accent-default" : "
|
|
29
|
+
const classNames = cn("absolute left-0 top-0", isOverridden ? "fill-accent-default" : "");
|
|
30
30
|
return /*#__PURE__*/ react.createElement(DropdownMenu, {
|
|
31
31
|
open: isOpen,
|
|
32
32
|
align: "center",
|