@elementor/editor-editing-panel 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/dist/index.js +134 -64
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +125 -55
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -6
- package/src/components/{editing-panel/editing-panel-hooks.tsx → editing-panel-hooks.tsx} +1 -1
- package/src/components/{editing-panel/editing-panel-tabs.tsx → editing-panel-tabs.tsx} +1 -1
- package/src/components/{editing-panel/editing-panel.tsx → editing-panel.tsx} +3 -3
- package/src/components/{editing-panel/settings-tab.tsx → settings-tab.tsx} +5 -5
- package/src/components/{editing-panel/style-tab/sections/size.tsx → style-sections/size-section.tsx} +3 -3
- package/src/components/{editing-panel/style-tab/style-tab.tsx → style-tab.tsx} +4 -4
- package/src/controls/control-types/attachment-control.tsx +101 -0
- package/src/{components/controls → controls}/control-types/select-control.tsx +2 -2
- package/src/{components/controls → controls}/control-types/size-control.tsx +2 -2
- package/src/{components/controls → controls}/control-types/text-area-control.tsx +1 -1
- package/src/{components/controls → controls}/control-types/text-control.tsx +1 -1
- package/src/{components/controls → controls}/get-control-by-type.ts +2 -0
- package/src/{components/controls → controls}/settings-control.tsx +5 -5
- package/src/{components/controls → controls}/style-control.tsx +6 -6
- package/src/init.ts +1 -1
- package/src/panel.ts +1 -1
- package/src/types.ts +1 -1
- /package/src/components/{controls/collapsible-section.tsx → collapsible-section.tsx} +0 -0
- /package/src/{contexts → controls}/control-context.tsx +0 -0
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/panel.ts","../src/components/editing-panel/editing-panel.tsx","../src/hooks/use-selected-elements.ts","../src/sync/get-selected-elements.ts","../src/hooks/use-element-type.ts","../src/sync/get-widgets-cache.ts","../src/contexts/element-context.tsx","../src/components/editing-panel/editing-panel-tabs.tsx","../src/components/editing-panel/settings-tab.tsx","../src/components/controls/settings-control.tsx","../src/contexts/control-context.tsx","../src/hooks/use-widget-settings.ts","../src/sync/get-container.ts","../src/sync/update-settings.ts","../src/components/controls/collapsible-section.tsx","../src/components/controls/control-types/select-control.tsx","../src/components/controls/control-types/text-area-control.tsx","../src/components/controls/control-types/text-control.tsx","../src/components/controls/get-control-by-type.ts","../src/components/editing-panel/style-tab/style-tab.tsx","../src/contexts/style-context.tsx","../src/hooks/use-element-styles.ts","../src/sync/get-element-styles.ts","../src/components/editing-panel/style-tab/sections/size.tsx","../src/components/controls/style-control.tsx","../src/sync/update-style.ts","../src/hooks/use-element-style-prop.ts","../src/components/controls/control-types/size-control.tsx","../src/init.ts","../src/sync/should-use-v2-panel.ts","../src/hooks/use-open-editor-panel.ts","../src/components/editing-panel/editing-panel-hooks.tsx","../src/index.ts"],"sourcesContent":["import { __createPanel as createPanel } from '@elementor/editor-panels';\nimport { EditingPanel } from './components/editing-panel/editing-panel';\n\nexport const { panel, usePanelActions, usePanelStatus } = createPanel( {\n\tid: 'editing-panel',\n\tcomponent: EditingPanel,\n} );\n","import * as React from 'react';\nimport { __ } from '@wordpress/i18n';\nimport useSelectedElements from '../../hooks/use-selected-elements';\nimport useElementType from '../../hooks/use-element-type';\nimport { Panel, PanelBody, PanelHeader, PanelHeaderTitle } from '@elementor/editor-panels';\nimport { ElementContext } from '../../contexts/element-context';\nimport { EditingPanelTabs } from './editing-panel-tabs';\n\nexport const EditingPanel = () => {\n\tconst elements = useSelectedElements();\n\n\tconst [ selectedElement ] = elements;\n\n\tconst elementType = useElementType( selectedElement?.type );\n\n\tif ( elements.length !== 1 || ! elementType ) {\n\t\treturn null;\n\t}\n\n\t/* translators: %s: Element type title. */\n\tconst panelTitle = __( 'Edit %s', 'elementor' ).replace( '%s', elementType.title );\n\n\treturn (\n\t\t<Panel>\n\t\t\t<PanelHeader>\n\t\t\t\t<PanelHeaderTitle>{ panelTitle }</PanelHeaderTitle>\n\t\t\t</PanelHeader>\n\t\t\t<PanelBody>\n\t\t\t\t<ElementContext element={ selectedElement }>\n\t\t\t\t\t<EditingPanelTabs />\n\t\t\t\t</ElementContext>\n\t\t\t</PanelBody>\n\t\t</Panel>\n\t);\n};\n","import { __privateUseListenTo as useListenTo, commandEndEvent } from '@elementor/editor-v1-adapters';\nimport getSelectedElements from '../sync/get-selected-elements';\n\nexport default function useSelectedElements() {\n\treturn useListenTo(\n\t\t[ commandEndEvent( 'document/elements/select' ), commandEndEvent( 'document/elements/deselect' ) ],\n\t\t() => getSelectedElements()\n\t);\n}\n","import { ExtendedWindow } from './types';\nimport { Element } from '../types';\n\nexport default function getSelectedElements(): Element[] {\n\tconst extendedWindow = window as unknown as ExtendedWindow;\n\n\tconst selectedElements = extendedWindow.elementor?.selection?.getElements?.() ?? [];\n\n\treturn selectedElements.reduce< Element[] >( ( acc, el ) => {\n\t\tconst type = el.model.get( 'widgetType' ) || el.model.get( 'elType' );\n\n\t\tif ( type ) {\n\t\t\tacc.push( {\n\t\t\t\tid: el.model.get( 'id' ),\n\t\t\t\ttype,\n\t\t\t} );\n\t\t}\n\n\t\treturn acc;\n\t}, [] );\n}\n","import { __privateUseListenTo as useListenTo, commandEndEvent } from '@elementor/editor-v1-adapters';\nimport getWidgetsCache from '../sync/get-widgets-cache';\nimport { ElementType } from '../types';\n\nexport default function useElementType( type?: string ) {\n\treturn useListenTo(\n\t\tcommandEndEvent( 'editor/documents/load' ),\n\t\t(): ElementType | null => {\n\t\t\tif ( ! type ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst widgetsCache = getWidgetsCache();\n\t\t\tconst elementType = widgetsCache?.[ type ];\n\n\t\t\tif ( ! elementType?.atomic_controls ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tkey: type,\n\t\t\t\tcontrols: elementType.atomic_controls,\n\t\t\t\ttitle: elementType.title,\n\t\t\t};\n\t\t},\n\t\t[ type ]\n\t);\n}\n","import { ExtendedWindow } from './types';\n\nexport default function getWidgetsCache() {\n\tconst extendedWindow = window as unknown as ExtendedWindow;\n\n\treturn extendedWindow?.elementor?.widgetsCache || null;\n}\n","import * as React from 'react';\nimport { createContext, ReactNode, useContext } from 'react';\nimport { Element } from '../types';\n\ntype ContextValue = {\n\telement: Element;\n};\n\nconst Context = createContext< ContextValue | null >( null );\n\ntype Props = {\n\telement: Element;\n\tchildren?: ReactNode;\n};\n\nexport function ElementContext( { children, element }: Props ) {\n\treturn <Context.Provider value={ { element } }>{ children }</Context.Provider>;\n}\n\nexport function useElementContext() {\n\tconst context = useContext( Context );\n\n\tif ( ! context ) {\n\t\tthrow new Error( 'useElementContext must be used within a ElementContextProvider' );\n\t}\n\n\treturn context;\n}\n","import { Stack, Tabs, Tab, TabPanel, useTabs } from '@elementor/ui';\nimport * as React from 'react';\nimport { __ } from '@wordpress/i18n';\nimport { SettingsTab } from './settings-tab';\nimport { StyleTab } from './style-tab/style-tab';\n\ntype TabValue = 'settings' | 'style';\n\nexport const EditingPanelTabs = () => {\n\tconst { getTabProps, getTabPanelProps, getTabsProps } = useTabs< TabValue >( 'settings' );\n\n\treturn (\n\t\t<Stack direction=\"column\" sx={ { width: '100%' } }>\n\t\t\t<Tabs variant=\"fullWidth\" indicatorColor=\"secondary\" textColor=\"inherit\" { ...getTabsProps() }>\n\t\t\t\t<Tab label={ __( 'General', 'elementor' ) } { ...getTabProps( 'settings' ) } />\n\t\t\t\t<Tab label={ __( 'Style', 'elementor' ) } { ...getTabProps( 'style' ) } />\n\t\t\t</Tabs>\n\t\t\t<TabPanel { ...getTabPanelProps( 'settings' ) } disablePadding>\n\t\t\t\t<SettingsTab />\n\t\t\t</TabPanel>\n\t\t\t<TabPanel { ...getTabPanelProps( 'style' ) } disablePadding>\n\t\t\t\t<StyleTab />\n\t\t\t</TabPanel>\n\t\t</Stack>\n\t);\n};\n","import * as React from 'react';\nimport { Stack } from '@elementor/ui';\nimport { SettingsControl } from '../controls/settings-control';\nimport { useElementContext } from '../../contexts/element-context';\nimport useElementType from '../../hooks/use-element-type';\nimport type { Control } from '../../types';\nimport { CollapsibleSection } from '../controls/collapsible-section';\nimport { getControlByType } from '../controls/get-control-by-type';\n\nexport const SettingsTab = () => {\n\tconst { element } = useElementContext();\n\n\tconst elementType = useElementType( element?.type );\n\n\tif ( ! elementType ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Stack>\n\t\t\t{ elementType.controls.map( ( { type, value }, index ) => {\n\t\t\t\tif ( type === 'control' ) {\n\t\t\t\t\treturn <Control key={ value.bind } control={ value } />;\n\t\t\t\t}\n\n\t\t\t\tif ( type === 'section' ) {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<CollapsibleSection key={ type + '.' + index } title={ value.label }>\n\t\t\t\t\t\t\t{ value.items?.map( ( item ) => {\n\t\t\t\t\t\t\t\tif ( item.type === 'control' ) {\n\t\t\t\t\t\t\t\t\treturn <Control key={ item.value.bind } control={ item.value } />;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// TODO: Handle 2nd level sections\n\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t</CollapsibleSection>\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn null;\n\t\t\t} ) }\n\t\t</Stack>\n\t);\n};\n\n// TODO: Create control wrapper by type for different layouts.\nconst Control = ( { control }: { control: Control[ 'value' ] } ) => {\n\tconst ControlComponent = getControlByType( control.type );\n\n\tif ( ! ControlComponent ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<SettingsControl bind={ control.bind }>\n\t\t\t<SettingsControl.Label>{ control.label }</SettingsControl.Label>\n\t\t\t<ControlComponent\n\t\t\t\t/* eslint-disable-next-line @typescript-eslint/no-explicit-any */\n\t\t\t\t{ ...( control.props as any ) }\n\t\t\t/>\n\t\t</SettingsControl>\n\t);\n};\n","import * as React from 'react';\nimport { ControlContext } from '../../contexts/control-context';\nimport { Stack, styled, Typography } from '@elementor/ui';\nimport { PropKey, PropValue } from '../../types';\nimport { useElementContext } from '../../contexts/element-context';\nimport { useWidgetSettings } from '../../hooks/use-widget-settings';\nimport { updateSettings } from '../../sync/update-settings';\n\ntype Props = {\n\tbind: PropKey;\n\tchildren: React.ReactNode;\n};\n\nexport const SettingsControlProvider = ( { bind, children }: Props ) => {\n\tconst { element } = useElementContext();\n\tconst value = useWidgetSettings( { id: element.id, bind } );\n\n\tconst setValue = ( newValue: PropValue ) => {\n\t\tupdateSettings( {\n\t\t\tid: element.id,\n\t\t\tprops: {\n\t\t\t\t[ bind ]: newValue,\n\t\t\t},\n\t\t} );\n\t};\n\n\treturn <ControlContext.Provider value={ { setValue, value, bind } }>{ children }</ControlContext.Provider>;\n};\n\nconst SettingsControl = ( { children, bind }: Props ) => (\n\t<SettingsControlProvider bind={ bind }>\n\t\t<StyledStack gap={ 1 } direction=\"row\" alignItems=\"center\" justifyContent=\"space-between\" flexWrap=\"wrap\">\n\t\t\t{ children }\n\t\t</StyledStack>\n\t</SettingsControlProvider>\n);\n\nconst StyledStack = styled( Stack )`\n\t& > * {\n\t\tflex-grow: 1;\n\t}\n\n\t& > label {\n\t\tmin-width: 50%;\n\t}\n`;\n\nconst Label = ( { children }: { children: React.ReactNode } ) => {\n\treturn (\n\t\t<Typography component=\"label\" variant=\"caption\" color=\"text.secondary\">\n\t\t\t{ children }\n\t\t</Typography>\n\t);\n};\n\nSettingsControl.Label = Label;\n\nexport { SettingsControl };\n","import { createContext, useContext } from 'react';\nimport { PropKey, PropValue } from '../types';\n\nexport type ControlContext< T extends PropValue > = {\n\tbind: PropKey;\n\tsetValue: ( value: T ) => void;\n\tvalue: T;\n};\n\nexport const ControlContext = createContext< ControlContext< PropValue > | null >( null );\n\nexport function useControl< T extends PropValue >(): ControlContext< T | undefined >;\nexport function useControl< T extends PropValue >( defaultValue: T ): ControlContext< T >;\nexport function useControl< T extends PropValue >( defaultValue?: T ) {\n\tconst controlContext = useContext< ControlContext< T > >( ControlContext as never );\n\n\tif ( ! controlContext ) {\n\t\tthrow new Error( 'useControl must be used within a ControlContext' );\n\t}\n\n\treturn { ...controlContext, value: controlContext.value ?? defaultValue };\n}\n","import { commandEndEvent, __privateUseListenTo as useListenTo } from '@elementor/editor-v1-adapters';\nimport { PropValue } from '../types';\nimport getContainer from '../sync/get-container';\n\nexport const useWidgetSettings = ( { id, bind }: { id: string; bind: string } ): PropValue => {\n\treturn useListenTo(\n\t\tcommandEndEvent( 'document/elements/settings' ),\n\t\t() => {\n\t\t\tconst container = getContainer( id );\n\t\t\tconst value = container?.settings?.get( bind ) ?? null;\n\n\t\t\treturn value;\n\t\t},\n\t\t[ id, bind ]\n\t);\n};\n","import { ExtendedWindow } from './types';\n\nexport default function getContainer( id: string ) {\n\tconst extendedWindow = window as unknown as ExtendedWindow;\n\tconst container = extendedWindow.elementor?.getContainer?.( id );\n\n\treturn container ?? null;\n}\n","import { __privateRunCommand as runCommand } from '@elementor/editor-v1-adapters';\nimport { Props } from '../types';\nimport getContainer from './get-container';\n\nexport const updateSettings = ( { id, props }: { id: string; props: Props } ) => {\n\tconst container = getContainer( id );\n\n\trunCommand( 'document/elements/settings', {\n\t\tcontainer,\n\t\tsettings: {\n\t\t\t...props,\n\t\t},\n\t} );\n};\n","import * as React from 'react';\nimport { useId } from 'react';\nimport { Accordion, AccordionSummary, AccordionDetails, AccordionSummaryText, Stack } from '@elementor/ui';\n\nexport type CollapsibleSectionProps = React.PropsWithChildren< {\n\ttitle: React.ReactNode;\n} >;\n\nexport const CollapsibleSection = ( { title, children }: CollapsibleSectionProps ) => {\n\tconst uid = useId();\n\tconst labelId = `label-${ uid }`;\n\tconst contentId = `content-${ uid }`;\n\n\t// TODO: Change to collapsible list item\n\treturn (\n\t\t<Accordion disableGutters defaultExpanded>\n\t\t\t<AccordionSummary aria-controls={ contentId } id={ labelId }>\n\t\t\t\t<AccordionSummaryText primaryTypographyProps={ { variant: 'caption' } }>{ title }</AccordionSummaryText>\n\t\t\t</AccordionSummary>\n\t\t\t<AccordionDetails id={ contentId } aria-labelledby={ labelId }>\n\t\t\t\t<Stack gap={ 2.5 }>{ children }</Stack>\n\t\t\t</AccordionDetails>\n\t\t</Accordion>\n\t);\n};\n","import * as React from 'react';\nimport { MenuItem, Select, SelectChangeEvent } from '@elementor/ui';\nimport { useControl } from '../../../contexts/control-context';\nimport { PropValue } from '../../../types';\n\ntype Props< T > = {\n\toptions: Array< { label: string; value: T; disabled?: boolean } >;\n};\n\nexport const SelectControl = < T extends PropValue >( { options }: Props< T > ) => {\n\tconst { value, setValue } = useControl< T >();\n\n\tconst handleChange = ( event: SelectChangeEvent< T > ) => {\n\t\tsetValue( event.target.value as T );\n\t};\n\n\treturn (\n\t\t<Select size=\"tiny\" value={ value ?? '' } onChange={ handleChange }>\n\t\t\t{ options.map( ( { label, ...props } ) => (\n\t\t\t\t<MenuItem key={ props.value } { ...props }>\n\t\t\t\t\t{ label }\n\t\t\t\t</MenuItem>\n\t\t\t) ) }\n\t\t</Select>\n\t);\n};\n","import * as React from 'react';\nimport { TextField } from '@elementor/ui';\nimport { useControl } from '../../../contexts/control-context';\n\ntype Props = {\n\tplaceholder?: string;\n};\n\nexport const TextAreaControl = ( { placeholder }: Props ) => {\n\tconst { value, setValue } = useControl< string >( '' );\n\n\tconst handleChange = ( event: React.ChangeEvent< HTMLInputElement > ) => {\n\t\tsetValue( event.target.value );\n\t};\n\n\treturn (\n\t\t<TextField\n\t\t\tsize=\"tiny\"\n\t\t\tmultiline\n\t\t\tfullWidth\n\t\t\trows={ 5 }\n\t\t\tvalue={ value }\n\t\t\tonChange={ handleChange }\n\t\t\tplaceholder={ placeholder }\n\t\t/>\n\t);\n};\n","import * as React from 'react';\nimport { TextField } from '@elementor/ui';\nimport { useControl } from '../../../contexts/control-context';\n\nexport const TextControl = ( { placeholder }: { placeholder?: string } ) => {\n\tconst { value, setValue } = useControl< string >( '' );\n\n\tconst handleChange = ( event: React.ChangeEvent< HTMLInputElement > ) => setValue( event.target.value );\n\n\treturn <TextField type=\"text\" size=\"tiny\" value={ value } onChange={ handleChange } placeholder={ placeholder } />;\n};\n","import { SelectControl } from './control-types/select-control';\nimport { TextAreaControl } from './control-types/text-area-control';\nimport { TextControl } from './control-types/text-control';\n\nconst controlTypes = {\n\tselect: SelectControl,\n\ttext: TextControl,\n\ttextarea: TextAreaControl,\n};\n\nexport const getControlByType = ( type: string ) => {\n\treturn controlTypes[ type as keyof typeof controlTypes ] ?? null;\n};\n","import * as React from 'react';\nimport { StyleContext } from '../../../contexts/style-context';\nimport { useElementContext } from '../../../contexts/element-context';\nimport { useElementStyles } from '../../../hooks/use-element-styles';\nimport { Stack } from '@elementor/ui';\nimport { SizeSection } from './sections/size';\n\nexport const StyleTab = () => {\n\tconst { element } = useElementContext();\n\tconst elementStyles = useElementStyles( element.id );\n\t// TODO: Handle selected style state.\n\tconst [ selectedStyleDef = null ] = Object.values( elementStyles || {} );\n\n\treturn (\n\t\t<StyleContext selectedStyleDef={ selectedStyleDef }>\n\t\t\t<Stack>\n\t\t\t\t<SizeSection />\n\t\t\t</Stack>\n\t\t</StyleContext>\n\t);\n};\n","import * as React from 'react';\nimport { createContext, ReactNode, useContext } from 'react';\nimport { useActiveBreakpoint } from '@elementor/editor-responsive';\nimport { StyleDefinition, StyleVariant } from '@elementor/editor-style';\n\ntype ContextValue = {\n\tselectedStyleDef: StyleDefinition | null;\n\tselectedMeta: StyleVariant[ 'meta' ];\n};\n\nconst Context = createContext< ContextValue | null >( null );\n\ntype Props = {\n\tchildren: ReactNode;\n\tselectedStyleDef: StyleDefinition | null;\n};\n\nexport function StyleContext( { children, selectedStyleDef }: Props ) {\n\tconst breakpoint = useActiveBreakpoint();\n\t// TODO: Handle state when we support it.\n\tconst selectedMeta = { breakpoint, state: null } as const;\n\n\treturn <Context.Provider value={ { selectedStyleDef, selectedMeta } }>{ children }</Context.Provider>;\n}\n\nexport function useStyleContext() {\n\tconst context = useContext( Context );\n\n\tif ( ! context ) {\n\t\tthrow new Error( 'UseStyleContext must be used within a StyleContextProvider' );\n\t}\n\n\treturn context;\n}\n","import { __privateUseListenTo as useListenTo, commandEndEvent } from '@elementor/editor-v1-adapters';\nimport { getElementStyles } from '../sync/get-element-styles';\nimport { ElementID } from '../types';\n\nexport const useElementStyles = ( elementID: ElementID ) => {\n\treturn useListenTo(\n\t\tcommandEndEvent( 'document/atomic-widgets/styles' ),\n\t\t() => {\n\t\t\treturn getElementStyles( elementID );\n\t\t},\n\t\t[ elementID ]\n\t);\n};\n","import getContainer from './get-container';\nimport { ElementID } from '../types';\nimport { StyleDefinition } from '@elementor/editor-style';\n\nexport const getElementStyles = ( elementID: ElementID ): Record< string, StyleDefinition > | null => {\n\tconst container = getContainer( elementID );\n\n\treturn container?.model.get( 'styles' ) || null;\n};\n","import * as React from 'react';\nimport { CollapsibleSection } from '../../../controls/collapsible-section';\nimport { StyleControl, StyleControlProps } from '../../../controls/style-control';\nimport { SizeControl, Unit } from '../../../controls/control-types/size-control';\nimport { Stack } from '@elementor/ui';\nimport { __ } from '@wordpress/i18n';\n\nexport const SizeSection = () => {\n\treturn (\n\t\t<CollapsibleSection title={ __( 'Size', 'elementor' ) }>\n\t\t\t<Stack gap={ 1.5 }>\n\t\t\t\t<Stack direction=\"row\" gap={ 2 }>\n\t\t\t\t\t<Control bind=\"width\" label={ __( 'Width', 'elementor' ) } />\n\t\t\t\t\t<Control bind=\"height\" label={ __( 'Height', 'elementor' ) } />\n\t\t\t\t</Stack>\n\t\t\t\t<Stack direction=\"row\" gap={ 2 }>\n\t\t\t\t\t<Control bind=\"min-width\" label={ __( 'Min. Width', 'elementor' ) } />\n\t\t\t\t\t<Control bind=\"min-height\" label={ __( 'Min. Height', 'elementor' ) } />\n\t\t\t\t</Stack>\n\t\t\t\t<Stack direction=\"row\" gap={ 2 }>\n\t\t\t\t\t<Control bind=\"max-width\" label={ __( 'Max. Width', 'elementor' ) } />\n\t\t\t\t\t<Control bind=\"max-height\" label={ __( 'Max. Height', 'elementor' ) } />\n\t\t\t\t</Stack>\n\t\t\t</Stack>\n\t\t</CollapsibleSection>\n\t);\n};\n\nconst units: Unit[] = [ 'px', '%', 'em', 'rem', 'vw' ];\n\ntype ControlProps = {\n\tbind: StyleControlProps[ 'bind' ];\n\tlabel: string;\n};\n\nconst Control = ( { label, bind }: ControlProps ) => {\n\treturn (\n\t\t<StyleControl bind={ bind }>\n\t\t\t<Stack gap={ 1 } sx={ { flex: '0 1 50%' } }>\n\t\t\t\t<StyleControl.Label>{ label }</StyleControl.Label>\n\t\t\t\t<SizeControl units={ units } />\n\t\t\t</Stack>\n\t\t</StyleControl>\n\t);\n};\n","import * as React from 'react';\nimport { PropKey, PropValue } from '../../types';\nimport { ControlContext } from '../../contexts/control-context';\nimport { updateStyle } from '../../sync/update-style';\nimport { useElementStyleProp } from '../../hooks/use-element-style-prop';\nimport { useElementContext } from '../../contexts/element-context';\nimport { useStyleContext } from '../../contexts/style-context';\nimport { Typography } from '@elementor/ui';\n\nexport type StyleControlProps = {\n\tbind: PropKey;\n\tchildren: React.ReactNode;\n};\n\nconst StyleControl = ( { bind, children }: StyleControlProps ) => {\n\tconst { element } = useElementContext();\n\tconst { selectedStyleDef, selectedMeta } = useStyleContext();\n\n\tconst setValue = ( newValue: PropValue ) => {\n\t\tupdateStyle( {\n\t\t\telementID: element.id,\n\t\t\tstyleDefID: selectedStyleDef?.id,\n\t\t\tprops: { [ bind ]: newValue },\n\t\t\tmeta: selectedMeta,\n\t\t} );\n\t};\n\n\tconst value = useElementStyleProp( {\n\t\telementID: element.id,\n\t\tstyleDefID: selectedStyleDef?.id,\n\t\tmeta: selectedMeta,\n\t\tpropName: bind,\n\t} );\n\n\treturn <ControlContext.Provider value={ { bind, value, setValue } }>{ children }</ControlContext.Provider>;\n};\n\nconst Label = ( { children }: { children: React.ReactNode } ) => {\n\treturn (\n\t\t<Typography component=\"label\" variant=\"caption\" color=\"text.secondary\">\n\t\t\t{ children }\n\t\t</Typography>\n\t);\n};\n\nStyleControl.Label = Label;\n\nexport { StyleControl };\n","import { __privateRunCommand as runCommand } from '@elementor/editor-v1-adapters';\nimport { ElementID, PropKey, Props } from '../types';\nimport getContainer from './get-container';\nimport { StyleDefinitionID, StyleVariant } from '@elementor/editor-style';\n\nexport type UpdateStyleProps = {\n\telementID: ElementID;\n\tstyleDefID?: StyleDefinitionID;\n\tmeta: StyleVariant[ 'meta' ];\n\tprops: Props;\n\tbind?: PropKey;\n};\n\nexport const updateStyle = ( { elementID, styleDefID, meta, props, bind = 'classes' }: UpdateStyleProps ) => {\n\tconst container = getContainer( elementID );\n\n\trunCommand( 'document/atomic-widgets/styles', {\n\t\tcontainer,\n\t\tstyleDefID,\n\t\tbind,\n\t\tmeta,\n\t\tprops,\n\t} );\n};\n","import { commandEndEvent, __privateUseListenTo as useListenTo } from '@elementor/editor-v1-adapters';\nimport { ElementID, PropKey, PropValue } from '../types';\nimport { getElementStyles } from '../sync/get-element-styles';\nimport { StyleDefinition, StyleDefinitionID, StyleVariant } from '@elementor/editor-style';\n\nexport type UseElementStylePropArgs = {\n\telementID: ElementID;\n\tstyleDefID?: StyleDefinitionID;\n\tmeta: StyleVariant[ 'meta' ];\n\tpropName: PropKey;\n};\n\nexport const useElementStyleProp = < T extends PropValue >( {\n\telementID,\n\tstyleDefID,\n\tmeta,\n\tpropName,\n}: UseElementStylePropArgs ): T | null => {\n\treturn useListenTo(\n\t\tcommandEndEvent( 'document/atomic-widgets/styles' ),\n\t\t() => {\n\t\t\t// TODO: return default value for style prop\n\t\t\tif ( ! styleDefID ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst styleDef = getElementStyles( elementID )?.[ styleDefID ];\n\n\t\t\tif ( ! styleDef ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst variant = getVariantByMeta( styleDef, meta );\n\n\t\t\treturn variant?.props[ propName ] ?? null;\n\t\t},\n\t\t[ elementID, styleDefID, propName, meta ]\n\t) as T;\n};\n\nfunction getVariantByMeta( styleDef: StyleDefinition, meta: StyleVariant[ 'meta' ] ) {\n\treturn styleDef.variants.find( ( variant ) => {\n\t\treturn variant.meta.breakpoint === meta.breakpoint && variant.meta.state === meta.state;\n\t} );\n}\n","import * as React from 'react';\nimport { MenuItem, Select, SelectChangeEvent, Stack, TextField } from '@elementor/ui';\nimport { useControl } from '../../../contexts/control-context';\nimport { TransformablePropValue } from '../../../types';\n\nexport type SizeControlProps = {\n\tunits: Unit[];\n\tplaceholder?: string;\n};\n\nexport type Unit = 'px' | '%' | 'em' | 'rem' | 'vw';\n\nexport type SizeControlValue = TransformablePropValue< { unit: Unit; size: number } >;\n\nexport const SizeControl = ( { units, placeholder }: SizeControlProps ) => {\n\tconst { value, setValue } = useControl< SizeControlValue >( defaultState );\n\tconst propValue = value.value;\n\n\tconst handleUnitChange = ( event: SelectChangeEvent< Unit > ) => {\n\t\tconst unit = event.target.value as Unit;\n\n\t\tsetValue( { $$type: 'size', value: { ...propValue, unit } } );\n\t};\n\n\tconst handleSizeChange = ( event: React.ChangeEvent< HTMLInputElement > ) => {\n\t\tconst { valueAsNumber: size } = event.target;\n\n\t\tif ( Number.isNaN( size ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetValue( { $$type: 'size', value: { ...propValue, size } } );\n\t};\n\n\treturn (\n\t\t<Stack direction=\"row\">\n\t\t\t<TextField\n\t\t\t\tsize=\"tiny\"\n\t\t\t\ttype=\"number\"\n\t\t\t\tvalue={ propValue.size }\n\t\t\t\tonChange={ handleSizeChange }\n\t\t\t\tplaceholder={ placeholder }\n\t\t\t/>\n\t\t\t<Select\n\t\t\t\tsize=\"tiny\"\n\t\t\t\tvalue={ propValue.unit }\n\t\t\t\tonChange={ handleUnitChange }\n\t\t\t\tMenuProps={ {\n\t\t\t\t\tanchorOrigin: { vertical: 'bottom', horizontal: 'right' },\n\t\t\t\t\ttransformOrigin: { vertical: 'top', horizontal: 'right' },\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ units.map( ( unit ) => (\n\t\t\t\t\t<MenuItem key={ unit } value={ unit }>\n\t\t\t\t\t\t{ unit.toUpperCase() }\n\t\t\t\t\t</MenuItem>\n\t\t\t\t) ) }\n\t\t\t</Select>\n\t\t</Stack>\n\t);\n};\n\nconst defaultState: SizeControlValue = {\n\t$$type: 'size',\n\tvalue: { unit: 'px', size: 0 },\n};\n","import { panel } from './panel';\nimport { injectIntoLogic } from '@elementor/editor';\nimport { shouldUseV2Panel } from './sync/should-use-v2-panel';\nimport { EditingPanelHooks } from './components/editing-panel/editing-panel-hooks';\nimport { __registerPanel as registerPanel } from '@elementor/editor-panels';\nimport { __privateBlockDataCommand as blockDataCommand } from '@elementor/editor-v1-adapters';\n\nexport default function init() {\n\tregisterPanel( panel );\n\tblockV1Panel();\n\n\tinjectIntoLogic( {\n\t\tid: 'editing-panel-hooks',\n\t\tcomponent: EditingPanelHooks,\n\t} );\n}\n\nconst blockV1Panel = () => {\n\tblockDataCommand( {\n\t\tcommand: 'panel/editor/open',\n\t\tcondition: shouldUseV2Panel,\n\t} );\n};\n","import getSelectedElements from './get-selected-elements';\nimport getWidgetsCache from './get-widgets-cache';\n\nexport const shouldUseV2Panel = () => {\n\tconst selectedElements = getSelectedElements();\n\tconst widgetCache = getWidgetsCache();\n\n\tif ( selectedElements.length !== 1 ) {\n\t\treturn false;\n\t}\n\n\t// Check if the selected element has atomic controls, meaning it's a V2 element.\n\treturn !! widgetCache?.[ selectedElements[ 0 ].type ]?.atomic_controls;\n};\n","import { useEffect } from 'react';\nimport { commandStartEvent, __privateListenTo as listenTo } from '@elementor/editor-v1-adapters';\nimport { usePanelActions } from '../panel';\nimport { shouldUseV2Panel } from '../sync/should-use-v2-panel';\n\nexport const useOpenEditorPanel = () => {\n\tconst { open } = usePanelActions();\n\n\tuseEffect( () => {\n\t\treturn listenTo( commandStartEvent( 'panel/editor/open' ), () => {\n\t\t\tif ( shouldUseV2Panel() ) {\n\t\t\t\topen();\n\t\t\t}\n\t\t} );\n\t}, [] ); // eslint-disable-line react-hooks/exhaustive-deps\n};\n","import { useOpenEditorPanel } from '../../hooks/use-open-editor-panel';\n\nexport const EditingPanelHooks = () => {\n\tuseOpenEditorPanel();\n\n\treturn null;\n};\n","import init from './init';\n\ninit();\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,wBAA6C;;;ACA7C,IAAAC,UAAuB;AACvB,IAAAC,eAAmB;;;ACDnB,gCAAqE;;;ACGtD,SAAR,sBAAkD;AACxD,QAAM,iBAAiB;AAEvB,QAAM,mBAAmB,eAAe,WAAW,WAAW,cAAc,KAAK,CAAC;AAElF,SAAO,iBAAiB,OAAqB,CAAE,KAAK,OAAQ;AAC3D,UAAM,OAAO,GAAG,MAAM,IAAK,YAAa,KAAK,GAAG,MAAM,IAAK,QAAS;AAEpE,QAAK,MAAO;AACX,UAAI,KAAM;AAAA,QACT,IAAI,GAAG,MAAM,IAAK,IAAK;AAAA,QACvB;AAAA,MACD,CAAE;AAAA,IACH;AAEA,WAAO;AAAA,EACR,GAAG,CAAC,CAAE;AACP;;;ADjBe,SAAR,sBAAuC;AAC7C,aAAO,0BAAAC;AAAA,IACN,KAAE,2CAAiB,0BAA2B,OAAG,2CAAiB,4BAA6B,CAAE;AAAA,IACjG,MAAM,oBAAoB;AAAA,EAC3B;AACD;;;AERA,IAAAC,6BAAqE;;;ACEtD,SAAR,kBAAmC;AACzC,QAAM,iBAAiB;AAEvB,SAAO,gBAAgB,WAAW,gBAAgB;AACnD;;;ADFe,SAAR,eAAiC,MAAgB;AACvD,aAAO,2BAAAC;AAAA,QACN,4CAAiB,uBAAwB;AAAA,IACzC,MAA0B;AACzB,UAAK,CAAE,MAAO;AACb,eAAO;AAAA,MACR;AAEA,YAAM,eAAe,gBAAgB;AACrC,YAAM,cAAc,eAAgB,IAAK;AAEzC,UAAK,CAAE,aAAa,iBAAkB;AACrC,eAAO;AAAA,MACR;AAEA,aAAO;AAAA,QACN,KAAK;AAAA,QACL,UAAU,YAAY;AAA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AAqB,MAAM;AACvC,QAAM,EAAE,KAAK,IAAI,gBAAgB;AAEjC,+BAAW,MAAM;AAChB,eAAO,2BAAAC,uBAAU,8CAAmB,mBAAoB,GAAG,MAAM;AAChE,UAAK,iBAAiB,GAAI;AACzB,aAAK;AAAA,MACN;AAAA,IACD,CAAE;AAAA,EACH,GAAG,CAAC,CAAE;AACP;;;ACbO,IAAM,oBAAoB,MAAM;AACtC,qBAAmB;AAEnB,SAAO;AACR;;;AHFA,IAAAC,wBAAiD;AACjD,IAAAC,6BAA8D;AAE/C,SAAR,OAAwB;AAC9B,4BAAAC,iBAAe,KAAM;AACrB,eAAa;AAEb,qCAAiB;AAAA,IAChB,IAAI;AAAA,IACJ,WAAW;AAAA,EACZ,CAAE;AACH;AAEA,IAAM,eAAe,MAAM;AAC1B,iCAAAC,2BAAkB;AAAA,IACjB,SAAS;AAAA,IACT,WAAW;AAAA,EACZ,CAAE;AACH;;;AIpBA,KAAK;","names":["import_editor_panels","React","import_i18n","useListenTo","import_editor_v1_adapters","useListenTo","import_ui","React","import_i18n","React","import_ui","React","import_react","import_editor_v1_adapters","useListenTo","import_editor_v1_adapters","runCommand","React","import_react","import_ui","React","import_ui","React","import_ui","React","import_ui","React","React","import_react","Context","import_editor_v1_adapters","useListenTo","import_ui","React","React","import_editor_v1_adapters","runCommand","import_editor_v1_adapters","useListenTo","import_ui","Label","React","import_ui","units","import_ui","Control","createPanel","import_react","import_editor_v1_adapters","listenTo","import_editor_panels","import_editor_v1_adapters","registerPanel","blockDataCommand"]}
|
|
1
|
+
{"version":3,"sources":["../src/panel.ts","../src/components/editing-panel.tsx","../src/hooks/use-selected-elements.ts","../src/sync/get-selected-elements.ts","../src/hooks/use-element-type.ts","../src/sync/get-widgets-cache.ts","../src/contexts/element-context.tsx","../src/components/editing-panel-tabs.tsx","../src/components/settings-tab.tsx","../src/controls/settings-control.tsx","../src/controls/control-context.tsx","../src/hooks/use-widget-settings.ts","../src/sync/get-container.ts","../src/sync/update-settings.ts","../src/components/collapsible-section.tsx","../src/controls/control-types/select-control.tsx","../src/controls/control-types/text-area-control.tsx","../src/controls/control-types/text-control.tsx","../src/controls/control-types/attachment-control.tsx","../src/controls/get-control-by-type.ts","../src/components/style-tab.tsx","../src/contexts/style-context.tsx","../src/hooks/use-element-styles.ts","../src/sync/get-element-styles.ts","../src/components/style-sections/size-section.tsx","../src/controls/style-control.tsx","../src/sync/update-style.ts","../src/hooks/use-element-style-prop.ts","../src/controls/control-types/size-control.tsx","../src/init.ts","../src/sync/should-use-v2-panel.ts","../src/hooks/use-open-editor-panel.ts","../src/components/editing-panel-hooks.tsx","../src/index.ts"],"sourcesContent":["import { __createPanel as createPanel } from '@elementor/editor-panels';\nimport { EditingPanel } from './components/editing-panel';\n\nexport const { panel, usePanelActions, usePanelStatus } = createPanel( {\n\tid: 'editing-panel',\n\tcomponent: EditingPanel,\n} );\n","import * as React from 'react';\nimport { __ } from '@wordpress/i18n';\nimport useSelectedElements from '../hooks/use-selected-elements';\nimport useElementType from '../hooks/use-element-type';\nimport { Panel, PanelBody, PanelHeader, PanelHeaderTitle } from '@elementor/editor-panels';\nimport { ElementContext } from '../contexts/element-context';\nimport { EditingPanelTabs } from './editing-panel-tabs';\n\nexport const EditingPanel = () => {\n\tconst elements = useSelectedElements();\n\n\tconst [ selectedElement ] = elements;\n\n\tconst elementType = useElementType( selectedElement?.type );\n\n\tif ( elements.length !== 1 || ! elementType ) {\n\t\treturn null;\n\t}\n\n\t/* translators: %s: Element type title. */\n\tconst panelTitle = __( 'Edit %s', 'elementor' ).replace( '%s', elementType.title );\n\n\treturn (\n\t\t<Panel>\n\t\t\t<PanelHeader>\n\t\t\t\t<PanelHeaderTitle>{ panelTitle }</PanelHeaderTitle>\n\t\t\t</PanelHeader>\n\t\t\t<PanelBody>\n\t\t\t\t<ElementContext element={ selectedElement }>\n\t\t\t\t\t<EditingPanelTabs />\n\t\t\t\t</ElementContext>\n\t\t\t</PanelBody>\n\t\t</Panel>\n\t);\n};\n","import { __privateUseListenTo as useListenTo, commandEndEvent } from '@elementor/editor-v1-adapters';\nimport getSelectedElements from '../sync/get-selected-elements';\n\nexport default function useSelectedElements() {\n\treturn useListenTo(\n\t\t[ commandEndEvent( 'document/elements/select' ), commandEndEvent( 'document/elements/deselect' ) ],\n\t\t() => getSelectedElements()\n\t);\n}\n","import { ExtendedWindow } from './types';\nimport { Element } from '../types';\n\nexport default function getSelectedElements(): Element[] {\n\tconst extendedWindow = window as unknown as ExtendedWindow;\n\n\tconst selectedElements = extendedWindow.elementor?.selection?.getElements?.() ?? [];\n\n\treturn selectedElements.reduce< Element[] >( ( acc, el ) => {\n\t\tconst type = el.model.get( 'widgetType' ) || el.model.get( 'elType' );\n\n\t\tif ( type ) {\n\t\t\tacc.push( {\n\t\t\t\tid: el.model.get( 'id' ),\n\t\t\t\ttype,\n\t\t\t} );\n\t\t}\n\n\t\treturn acc;\n\t}, [] );\n}\n","import { __privateUseListenTo as useListenTo, commandEndEvent } from '@elementor/editor-v1-adapters';\nimport getWidgetsCache from '../sync/get-widgets-cache';\nimport { ElementType } from '../types';\n\nexport default function useElementType( type?: string ) {\n\treturn useListenTo(\n\t\tcommandEndEvent( 'editor/documents/load' ),\n\t\t(): ElementType | null => {\n\t\t\tif ( ! type ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst widgetsCache = getWidgetsCache();\n\t\t\tconst elementType = widgetsCache?.[ type ];\n\n\t\t\tif ( ! elementType?.atomic_controls ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tkey: type,\n\t\t\t\tcontrols: elementType.atomic_controls,\n\t\t\t\ttitle: elementType.title,\n\t\t\t};\n\t\t},\n\t\t[ type ]\n\t);\n}\n","import { ExtendedWindow } from './types';\n\nexport default function getWidgetsCache() {\n\tconst extendedWindow = window as unknown as ExtendedWindow;\n\n\treturn extendedWindow?.elementor?.widgetsCache || null;\n}\n","import * as React from 'react';\nimport { createContext, ReactNode, useContext } from 'react';\nimport { Element } from '../types';\n\ntype ContextValue = {\n\telement: Element;\n};\n\nconst Context = createContext< ContextValue | null >( null );\n\ntype Props = {\n\telement: Element;\n\tchildren?: ReactNode;\n};\n\nexport function ElementContext( { children, element }: Props ) {\n\treturn <Context.Provider value={ { element } }>{ children }</Context.Provider>;\n}\n\nexport function useElementContext() {\n\tconst context = useContext( Context );\n\n\tif ( ! context ) {\n\t\tthrow new Error( 'useElementContext must be used within a ElementContextProvider' );\n\t}\n\n\treturn context;\n}\n","import { Stack, Tabs, Tab, TabPanel, useTabs } from '@elementor/ui';\nimport * as React from 'react';\nimport { __ } from '@wordpress/i18n';\nimport { SettingsTab } from './settings-tab';\nimport { StyleTab } from './style-tab';\n\ntype TabValue = 'settings' | 'style';\n\nexport const EditingPanelTabs = () => {\n\tconst { getTabProps, getTabPanelProps, getTabsProps } = useTabs< TabValue >( 'settings' );\n\n\treturn (\n\t\t<Stack direction=\"column\" sx={ { width: '100%' } }>\n\t\t\t<Tabs variant=\"fullWidth\" indicatorColor=\"secondary\" textColor=\"inherit\" { ...getTabsProps() }>\n\t\t\t\t<Tab label={ __( 'General', 'elementor' ) } { ...getTabProps( 'settings' ) } />\n\t\t\t\t<Tab label={ __( 'Style', 'elementor' ) } { ...getTabProps( 'style' ) } />\n\t\t\t</Tabs>\n\t\t\t<TabPanel { ...getTabPanelProps( 'settings' ) } disablePadding>\n\t\t\t\t<SettingsTab />\n\t\t\t</TabPanel>\n\t\t\t<TabPanel { ...getTabPanelProps( 'style' ) } disablePadding>\n\t\t\t\t<StyleTab />\n\t\t\t</TabPanel>\n\t\t</Stack>\n\t);\n};\n","import * as React from 'react';\nimport { Stack } from '@elementor/ui';\nimport { SettingsControl } from '../controls/settings-control';\nimport { useElementContext } from '../contexts/element-context';\nimport useElementType from '../hooks/use-element-type';\nimport type { Control } from '../types';\nimport { CollapsibleSection } from './collapsible-section';\nimport { getControlByType } from '../controls/get-control-by-type';\n\nexport const SettingsTab = () => {\n\tconst { element } = useElementContext();\n\n\tconst elementType = useElementType( element?.type );\n\n\tif ( ! elementType ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Stack>\n\t\t\t{ elementType.controls.map( ( { type, value }, index ) => {\n\t\t\t\tif ( type === 'control' ) {\n\t\t\t\t\treturn <Control key={ value.bind } control={ value } />;\n\t\t\t\t}\n\n\t\t\t\tif ( type === 'section' ) {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<CollapsibleSection key={ type + '.' + index } title={ value.label }>\n\t\t\t\t\t\t\t{ value.items?.map( ( item ) => {\n\t\t\t\t\t\t\t\tif ( item.type === 'control' ) {\n\t\t\t\t\t\t\t\t\treturn <Control key={ item.value.bind } control={ item.value } />;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// TODO: Handle 2nd level sections\n\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t</CollapsibleSection>\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn null;\n\t\t\t} ) }\n\t\t</Stack>\n\t);\n};\n\n// TODO: Create control wrapper by type for different layouts.\nconst Control = ( { control }: { control: Control[ 'value' ] } ) => {\n\tconst ControlComponent = getControlByType( control.type );\n\n\tif ( ! ControlComponent ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<SettingsControl bind={ control.bind }>\n\t\t\t{ control.label ? <SettingsControl.Label>{ control.label }</SettingsControl.Label> : null }\n\t\t\t<ControlComponent\n\t\t\t\t/* eslint-disable-next-line @typescript-eslint/no-explicit-any */\n\t\t\t\t{ ...( control.props as any ) }\n\t\t\t/>\n\t\t</SettingsControl>\n\t);\n};\n","import * as React from 'react';\nimport { ControlContext } from '../controls/control-context';\nimport { Stack, styled, Typography } from '@elementor/ui';\nimport { PropKey, PropValue } from '../types';\nimport { useElementContext } from '../contexts/element-context';\nimport { useWidgetSettings } from '../hooks/use-widget-settings';\nimport { updateSettings } from '../sync/update-settings';\n\ntype Props = {\n\tbind: PropKey;\n\tchildren: React.ReactNode;\n};\n\nexport const SettingsControlProvider = ( { bind, children }: Props ) => {\n\tconst { element } = useElementContext();\n\tconst value = useWidgetSettings( { id: element.id, bind } );\n\n\tconst setValue = ( newValue: PropValue ) => {\n\t\tupdateSettings( {\n\t\t\tid: element.id,\n\t\t\tprops: {\n\t\t\t\t[ bind ]: newValue,\n\t\t\t},\n\t\t} );\n\t};\n\n\treturn <ControlContext.Provider value={ { setValue, value, bind } }>{ children }</ControlContext.Provider>;\n};\n\nconst SettingsControl = ( { children, bind }: Props ) => (\n\t<SettingsControlProvider bind={ bind }>\n\t\t<StyledStack gap={ 1 } direction=\"row\" alignItems=\"center\" justifyContent=\"space-between\" flexWrap=\"wrap\">\n\t\t\t{ children }\n\t\t</StyledStack>\n\t</SettingsControlProvider>\n);\n\nconst StyledStack = styled( Stack )`\n\t& > * {\n\t\tflex-grow: 1;\n\t}\n\n\t& > label {\n\t\tmin-width: 50%;\n\t}\n`;\n\nconst Label = ( { children }: { children: React.ReactNode } ) => {\n\treturn (\n\t\t<Typography component=\"label\" variant=\"caption\" color=\"text.secondary\">\n\t\t\t{ children }\n\t\t</Typography>\n\t);\n};\n\nSettingsControl.Label = Label;\n\nexport { SettingsControl };\n","import { createContext, useContext } from 'react';\nimport { PropKey, PropValue } from '../types';\n\nexport type ControlContext< T extends PropValue > = {\n\tbind: PropKey;\n\tsetValue: ( value: T ) => void;\n\tvalue: T;\n};\n\nexport const ControlContext = createContext< ControlContext< PropValue > | null >( null );\n\nexport function useControl< T extends PropValue >(): ControlContext< T | undefined >;\nexport function useControl< T extends PropValue >( defaultValue: T ): ControlContext< T >;\nexport function useControl< T extends PropValue >( defaultValue?: T ) {\n\tconst controlContext = useContext< ControlContext< T > >( ControlContext as never );\n\n\tif ( ! controlContext ) {\n\t\tthrow new Error( 'useControl must be used within a ControlContext' );\n\t}\n\n\treturn { ...controlContext, value: controlContext.value ?? defaultValue };\n}\n","import { commandEndEvent, __privateUseListenTo as useListenTo } from '@elementor/editor-v1-adapters';\nimport { PropValue } from '../types';\nimport getContainer from '../sync/get-container';\n\nexport const useWidgetSettings = ( { id, bind }: { id: string; bind: string } ): PropValue => {\n\treturn useListenTo(\n\t\tcommandEndEvent( 'document/elements/settings' ),\n\t\t() => {\n\t\t\tconst container = getContainer( id );\n\t\t\tconst value = container?.settings?.get( bind ) ?? null;\n\n\t\t\treturn value;\n\t\t},\n\t\t[ id, bind ]\n\t);\n};\n","import { ExtendedWindow } from './types';\n\nexport default function getContainer( id: string ) {\n\tconst extendedWindow = window as unknown as ExtendedWindow;\n\tconst container = extendedWindow.elementor?.getContainer?.( id );\n\n\treturn container ?? null;\n}\n","import { __privateRunCommand as runCommand } from '@elementor/editor-v1-adapters';\nimport { Props } from '../types';\nimport getContainer from './get-container';\n\nexport const updateSettings = ( { id, props }: { id: string; props: Props } ) => {\n\tconst container = getContainer( id );\n\n\trunCommand( 'document/elements/settings', {\n\t\tcontainer,\n\t\tsettings: {\n\t\t\t...props,\n\t\t},\n\t} );\n};\n","import * as React from 'react';\nimport { useId } from 'react';\nimport { Accordion, AccordionSummary, AccordionDetails, AccordionSummaryText, Stack } from '@elementor/ui';\n\nexport type CollapsibleSectionProps = React.PropsWithChildren< {\n\ttitle: React.ReactNode;\n} >;\n\nexport const CollapsibleSection = ( { title, children }: CollapsibleSectionProps ) => {\n\tconst uid = useId();\n\tconst labelId = `label-${ uid }`;\n\tconst contentId = `content-${ uid }`;\n\n\t// TODO: Change to collapsible list item\n\treturn (\n\t\t<Accordion disableGutters defaultExpanded>\n\t\t\t<AccordionSummary aria-controls={ contentId } id={ labelId }>\n\t\t\t\t<AccordionSummaryText primaryTypographyProps={ { variant: 'caption' } }>{ title }</AccordionSummaryText>\n\t\t\t</AccordionSummary>\n\t\t\t<AccordionDetails id={ contentId } aria-labelledby={ labelId }>\n\t\t\t\t<Stack gap={ 2.5 }>{ children }</Stack>\n\t\t\t</AccordionDetails>\n\t\t</Accordion>\n\t);\n};\n","import * as React from 'react';\nimport { MenuItem, Select, SelectChangeEvent } from '@elementor/ui';\nimport { useControl } from '../control-context';\nimport { PropValue } from '../../types';\n\ntype Props< T > = {\n\toptions: Array< { label: string; value: T; disabled?: boolean } >;\n};\n\nexport const SelectControl = < T extends PropValue >( { options }: Props< T > ) => {\n\tconst { value, setValue } = useControl< T >();\n\n\tconst handleChange = ( event: SelectChangeEvent< T > ) => {\n\t\tsetValue( event.target.value as T );\n\t};\n\n\treturn (\n\t\t<Select size=\"tiny\" value={ value ?? '' } onChange={ handleChange }>\n\t\t\t{ options.map( ( { label, ...props } ) => (\n\t\t\t\t<MenuItem key={ props.value } { ...props }>\n\t\t\t\t\t{ label }\n\t\t\t\t</MenuItem>\n\t\t\t) ) }\n\t\t</Select>\n\t);\n};\n","import * as React from 'react';\nimport { TextField } from '@elementor/ui';\nimport { useControl } from '../control-context';\n\ntype Props = {\n\tplaceholder?: string;\n};\n\nexport const TextAreaControl = ( { placeholder }: Props ) => {\n\tconst { value, setValue } = useControl< string >( '' );\n\n\tconst handleChange = ( event: React.ChangeEvent< HTMLInputElement > ) => {\n\t\tsetValue( event.target.value );\n\t};\n\n\treturn (\n\t\t<TextField\n\t\t\tsize=\"tiny\"\n\t\t\tmultiline\n\t\t\tfullWidth\n\t\t\trows={ 5 }\n\t\t\tvalue={ value }\n\t\t\tonChange={ handleChange }\n\t\t\tplaceholder={ placeholder }\n\t\t/>\n\t);\n};\n","import * as React from 'react';\nimport { TextField } from '@elementor/ui';\nimport { useControl } from '../control-context';\n\nexport const TextControl = ( { placeholder }: { placeholder?: string } ) => {\n\tconst { value, setValue } = useControl< string >( '' );\n\n\tconst handleChange = ( event: React.ChangeEvent< HTMLInputElement > ) => setValue( event.target.value );\n\n\treturn <TextField type=\"text\" size=\"tiny\" value={ value } onChange={ handleChange } placeholder={ placeholder } />;\n};\n","import * as React from 'react';\nimport { Button, Card, CardMedia, CardOverlay } from '@elementor/ui';\nimport { useControl } from '../control-context';\nimport { UploadIcon } from '@elementor/icons';\nimport { __ } from '@wordpress/i18n';\nimport { useWpMediaAttachment, useWpMediaFrame } from '@elementor/wp-media';\n\ntype ImageAttachment = {\n\t$$type: 'image-attachment';\n\tvalue: {\n\t\tid: number;\n\t};\n};\n\ntype ImageURL = {\n\t$$type: 'image-url';\n\tvalue: {\n\t\turl: string;\n\t};\n};\n\ntype Props = {\n\tmediaTypes: Array< 'image' >;\n};\n\nconst isImageAttachment = ( value: ImageAttachment | ImageURL ): value is ImageAttachment => {\n\treturn value.$$type === 'image-attachment';\n};\n\nconst isImageUrl = ( value: ImageAttachment | ImageURL ): value is ImageURL => {\n\treturn value.$$type === 'image-url';\n};\n\n// TODO: Use schema to get default image.\nconst defaultState: ImageURL = {\n\t$$type: 'image-url',\n\tvalue: {\n\t\turl: '/wp-content/plugins/elementor/assets/images/placeholder.png',\n\t},\n};\n\nexport const AttachmentControl = ( props: Props ) => {\n\tconst { value, setValue } = useControl< ImageAttachment | ImageURL >( defaultState );\n\tconst { data: attachment } = useWpMediaAttachment( isImageAttachment( value ) ? value.value.id : undefined );\n\n\tconst getImageSrc = () => {\n\t\tif ( attachment?.url ) {\n\t\t\treturn attachment.url;\n\t\t}\n\n\t\tif ( isImageUrl( value ) ) {\n\t\t\treturn value.value.url;\n\t\t}\n\n\t\treturn defaultState.value.url;\n\t};\n\n\tconst { open } = useWpMediaFrame( {\n\t\ttypes: props.mediaTypes,\n\t\tmultiple: false,\n\t\tselected: isImageAttachment( value ) ? value.value?.id : undefined,\n\t\tonSelect: ( val ) => {\n\t\t\tsetValue( {\n\t\t\t\t$$type: 'image-attachment',\n\t\t\t\tvalue: {\n\t\t\t\t\tid: val.id,\n\t\t\t\t},\n\t\t\t} );\n\t\t},\n\t} );\n\n\treturn (\n\t\t<Card variant=\"outlined\">\n\t\t\t<CardMedia image={ getImageSrc() } sx={ { height: 150 } } />\n\t\t\t<CardOverlay>\n\t\t\t\t<Button\n\t\t\t\t\tcolor=\"inherit\"\n\t\t\t\t\tsize=\"small\"\n\t\t\t\t\tvariant=\"outlined\"\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\topen( { mode: 'browse' } );\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Select Image', 'elementor' ) }\n\t\t\t\t</Button>\n\n\t\t\t\t<Button\n\t\t\t\t\tcolor=\"inherit\"\n\t\t\t\t\tsize=\"small\"\n\t\t\t\t\tvariant=\"text\"\n\t\t\t\t\tstartIcon={ <UploadIcon /> }\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\topen( { mode: 'upload' } );\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Upload Image', 'elementor' ) }\n\t\t\t\t</Button>\n\t\t\t</CardOverlay>\n\t\t</Card>\n\t);\n};\n","import { SelectControl } from './control-types/select-control';\nimport { TextAreaControl } from './control-types/text-area-control';\nimport { TextControl } from './control-types/text-control';\nimport { AttachmentControl } from './control-types/attachment-control';\n\nconst controlTypes = {\n\tattachment: AttachmentControl,\n\tselect: SelectControl,\n\ttext: TextControl,\n\ttextarea: TextAreaControl,\n};\n\nexport const getControlByType = ( type: string ) => {\n\treturn controlTypes[ type as keyof typeof controlTypes ] ?? null;\n};\n","import * as React from 'react';\nimport { StyleContext } from '../contexts/style-context';\nimport { useElementContext } from '../contexts/element-context';\nimport { useElementStyles } from '../hooks/use-element-styles';\nimport { Stack } from '@elementor/ui';\nimport { SizeSection } from './style-sections/size-section';\n\nexport const StyleTab = () => {\n\tconst { element } = useElementContext();\n\tconst elementStyles = useElementStyles( element.id );\n\t// TODO: Handle selected style state.\n\tconst [ selectedStyleDef = null ] = Object.values( elementStyles || {} );\n\n\treturn (\n\t\t<StyleContext selectedStyleDef={ selectedStyleDef }>\n\t\t\t<Stack>\n\t\t\t\t<SizeSection />\n\t\t\t</Stack>\n\t\t</StyleContext>\n\t);\n};\n","import * as React from 'react';\nimport { createContext, ReactNode, useContext } from 'react';\nimport { useActiveBreakpoint } from '@elementor/editor-responsive';\nimport { StyleDefinition, StyleVariant } from '@elementor/editor-style';\n\ntype ContextValue = {\n\tselectedStyleDef: StyleDefinition | null;\n\tselectedMeta: StyleVariant[ 'meta' ];\n};\n\nconst Context = createContext< ContextValue | null >( null );\n\ntype Props = {\n\tchildren: ReactNode;\n\tselectedStyleDef: StyleDefinition | null;\n};\n\nexport function StyleContext( { children, selectedStyleDef }: Props ) {\n\tconst breakpoint = useActiveBreakpoint();\n\t// TODO: Handle state when we support it.\n\tconst selectedMeta = { breakpoint, state: null } as const;\n\n\treturn <Context.Provider value={ { selectedStyleDef, selectedMeta } }>{ children }</Context.Provider>;\n}\n\nexport function useStyleContext() {\n\tconst context = useContext( Context );\n\n\tif ( ! context ) {\n\t\tthrow new Error( 'UseStyleContext must be used within a StyleContextProvider' );\n\t}\n\n\treturn context;\n}\n","import { __privateUseListenTo as useListenTo, commandEndEvent } from '@elementor/editor-v1-adapters';\nimport { getElementStyles } from '../sync/get-element-styles';\nimport { ElementID } from '../types';\n\nexport const useElementStyles = ( elementID: ElementID ) => {\n\treturn useListenTo(\n\t\tcommandEndEvent( 'document/atomic-widgets/styles' ),\n\t\t() => {\n\t\t\treturn getElementStyles( elementID );\n\t\t},\n\t\t[ elementID ]\n\t);\n};\n","import getContainer from './get-container';\nimport { ElementID } from '../types';\nimport { StyleDefinition } from '@elementor/editor-style';\n\nexport const getElementStyles = ( elementID: ElementID ): Record< string, StyleDefinition > | null => {\n\tconst container = getContainer( elementID );\n\n\treturn container?.model.get( 'styles' ) || null;\n};\n","import * as React from 'react';\nimport { CollapsibleSection } from '../../components/collapsible-section';\nimport { StyleControl, StyleControlProps } from '../../controls/style-control';\nimport { SizeControl, Unit } from '../../controls/control-types/size-control';\nimport { Stack } from '@elementor/ui';\nimport { __ } from '@wordpress/i18n';\n\nexport const SizeSection = () => {\n\treturn (\n\t\t<CollapsibleSection title={ __( 'Size', 'elementor' ) }>\n\t\t\t<Stack gap={ 1.5 }>\n\t\t\t\t<Stack direction=\"row\" gap={ 2 }>\n\t\t\t\t\t<Control bind=\"width\" label={ __( 'Width', 'elementor' ) } />\n\t\t\t\t\t<Control bind=\"height\" label={ __( 'Height', 'elementor' ) } />\n\t\t\t\t</Stack>\n\t\t\t\t<Stack direction=\"row\" gap={ 2 }>\n\t\t\t\t\t<Control bind=\"min-width\" label={ __( 'Min. Width', 'elementor' ) } />\n\t\t\t\t\t<Control bind=\"min-height\" label={ __( 'Min. Height', 'elementor' ) } />\n\t\t\t\t</Stack>\n\t\t\t\t<Stack direction=\"row\" gap={ 2 }>\n\t\t\t\t\t<Control bind=\"max-width\" label={ __( 'Max. Width', 'elementor' ) } />\n\t\t\t\t\t<Control bind=\"max-height\" label={ __( 'Max. Height', 'elementor' ) } />\n\t\t\t\t</Stack>\n\t\t\t</Stack>\n\t\t</CollapsibleSection>\n\t);\n};\n\nconst units: Unit[] = [ 'px', '%', 'em', 'rem', 'vw' ];\n\ntype ControlProps = {\n\tbind: StyleControlProps[ 'bind' ];\n\tlabel: string;\n};\n\nconst Control = ( { label, bind }: ControlProps ) => {\n\treturn (\n\t\t<StyleControl bind={ bind }>\n\t\t\t<Stack gap={ 1 } sx={ { flex: '0 1 50%' } }>\n\t\t\t\t<StyleControl.Label>{ label }</StyleControl.Label>\n\t\t\t\t<SizeControl units={ units } />\n\t\t\t</Stack>\n\t\t</StyleControl>\n\t);\n};\n","import * as React from 'react';\nimport { PropKey, PropValue } from '../types';\nimport { ControlContext } from '../controls/control-context';\nimport { updateStyle } from '../sync/update-style';\nimport { useElementStyleProp } from '../hooks/use-element-style-prop';\nimport { useElementContext } from '../contexts/element-context';\nimport { useStyleContext } from '../contexts/style-context';\nimport { Typography } from '@elementor/ui';\n\nexport type StyleControlProps = {\n\tbind: PropKey;\n\tchildren: React.ReactNode;\n};\n\nconst StyleControl = ( { bind, children }: StyleControlProps ) => {\n\tconst { element } = useElementContext();\n\tconst { selectedStyleDef, selectedMeta } = useStyleContext();\n\n\tconst setValue = ( newValue: PropValue ) => {\n\t\tupdateStyle( {\n\t\t\telementID: element.id,\n\t\t\tstyleDefID: selectedStyleDef?.id,\n\t\t\tprops: { [ bind ]: newValue },\n\t\t\tmeta: selectedMeta,\n\t\t} );\n\t};\n\n\tconst value = useElementStyleProp( {\n\t\telementID: element.id,\n\t\tstyleDefID: selectedStyleDef?.id,\n\t\tmeta: selectedMeta,\n\t\tpropName: bind,\n\t} );\n\n\treturn <ControlContext.Provider value={ { bind, value, setValue } }>{ children }</ControlContext.Provider>;\n};\n\nconst Label = ( { children }: { children: React.ReactNode } ) => {\n\treturn (\n\t\t<Typography component=\"label\" variant=\"caption\" color=\"text.secondary\">\n\t\t\t{ children }\n\t\t</Typography>\n\t);\n};\n\nStyleControl.Label = Label;\n\nexport { StyleControl };\n","import { __privateRunCommand as runCommand } from '@elementor/editor-v1-adapters';\nimport { ElementID, PropKey, Props } from '../types';\nimport getContainer from './get-container';\nimport { StyleDefinitionID, StyleVariant } from '@elementor/editor-style';\n\nexport type UpdateStyleProps = {\n\telementID: ElementID;\n\tstyleDefID?: StyleDefinitionID;\n\tmeta: StyleVariant[ 'meta' ];\n\tprops: Props;\n\tbind?: PropKey;\n};\n\nexport const updateStyle = ( { elementID, styleDefID, meta, props, bind = 'classes' }: UpdateStyleProps ) => {\n\tconst container = getContainer( elementID );\n\n\trunCommand( 'document/atomic-widgets/styles', {\n\t\tcontainer,\n\t\tstyleDefID,\n\t\tbind,\n\t\tmeta,\n\t\tprops,\n\t} );\n};\n","import { commandEndEvent, __privateUseListenTo as useListenTo } from '@elementor/editor-v1-adapters';\nimport { ElementID, PropKey, PropValue } from '../types';\nimport { getElementStyles } from '../sync/get-element-styles';\nimport { StyleDefinition, StyleDefinitionID, StyleVariant } from '@elementor/editor-style';\n\nexport type UseElementStylePropArgs = {\n\telementID: ElementID;\n\tstyleDefID?: StyleDefinitionID;\n\tmeta: StyleVariant[ 'meta' ];\n\tpropName: PropKey;\n};\n\nexport const useElementStyleProp = < T extends PropValue >( {\n\telementID,\n\tstyleDefID,\n\tmeta,\n\tpropName,\n}: UseElementStylePropArgs ): T | null => {\n\treturn useListenTo(\n\t\tcommandEndEvent( 'document/atomic-widgets/styles' ),\n\t\t() => {\n\t\t\t// TODO: return default value for style prop\n\t\t\tif ( ! styleDefID ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst styleDef = getElementStyles( elementID )?.[ styleDefID ];\n\n\t\t\tif ( ! styleDef ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst variant = getVariantByMeta( styleDef, meta );\n\n\t\t\treturn variant?.props[ propName ] ?? null;\n\t\t},\n\t\t[ elementID, styleDefID, propName, meta ]\n\t) as T;\n};\n\nfunction getVariantByMeta( styleDef: StyleDefinition, meta: StyleVariant[ 'meta' ] ) {\n\treturn styleDef.variants.find( ( variant ) => {\n\t\treturn variant.meta.breakpoint === meta.breakpoint && variant.meta.state === meta.state;\n\t} );\n}\n","import * as React from 'react';\nimport { MenuItem, Select, SelectChangeEvent, Stack, TextField } from '@elementor/ui';\nimport { useControl } from '../control-context';\nimport { TransformablePropValue } from '../../types';\n\nexport type SizeControlProps = {\n\tunits: Unit[];\n\tplaceholder?: string;\n};\n\nexport type Unit = 'px' | '%' | 'em' | 'rem' | 'vw';\n\nexport type SizeControlValue = TransformablePropValue< { unit: Unit; size: number } >;\n\nexport const SizeControl = ( { units, placeholder }: SizeControlProps ) => {\n\tconst { value, setValue } = useControl< SizeControlValue >( defaultState );\n\tconst propValue = value.value;\n\n\tconst handleUnitChange = ( event: SelectChangeEvent< Unit > ) => {\n\t\tconst unit = event.target.value as Unit;\n\n\t\tsetValue( { $$type: 'size', value: { ...propValue, unit } } );\n\t};\n\n\tconst handleSizeChange = ( event: React.ChangeEvent< HTMLInputElement > ) => {\n\t\tconst { valueAsNumber: size } = event.target;\n\n\t\tif ( Number.isNaN( size ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetValue( { $$type: 'size', value: { ...propValue, size } } );\n\t};\n\n\treturn (\n\t\t<Stack direction=\"row\">\n\t\t\t<TextField\n\t\t\t\tsize=\"tiny\"\n\t\t\t\ttype=\"number\"\n\t\t\t\tvalue={ propValue.size }\n\t\t\t\tonChange={ handleSizeChange }\n\t\t\t\tplaceholder={ placeholder }\n\t\t\t/>\n\t\t\t<Select\n\t\t\t\tsize=\"tiny\"\n\t\t\t\tvalue={ propValue.unit }\n\t\t\t\tonChange={ handleUnitChange }\n\t\t\t\tMenuProps={ {\n\t\t\t\t\tanchorOrigin: { vertical: 'bottom', horizontal: 'right' },\n\t\t\t\t\ttransformOrigin: { vertical: 'top', horizontal: 'right' },\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ units.map( ( unit ) => (\n\t\t\t\t\t<MenuItem key={ unit } value={ unit }>\n\t\t\t\t\t\t{ unit.toUpperCase() }\n\t\t\t\t\t</MenuItem>\n\t\t\t\t) ) }\n\t\t\t</Select>\n\t\t</Stack>\n\t);\n};\n\nconst defaultState: SizeControlValue = {\n\t$$type: 'size',\n\tvalue: { unit: 'px', size: 0 },\n};\n","import { panel } from './panel';\nimport { injectIntoLogic } from '@elementor/editor';\nimport { shouldUseV2Panel } from './sync/should-use-v2-panel';\nimport { EditingPanelHooks } from './components/editing-panel-hooks';\nimport { __registerPanel as registerPanel } from '@elementor/editor-panels';\nimport { __privateBlockDataCommand as blockDataCommand } from '@elementor/editor-v1-adapters';\n\nexport default function init() {\n\tregisterPanel( panel );\n\tblockV1Panel();\n\n\tinjectIntoLogic( {\n\t\tid: 'editing-panel-hooks',\n\t\tcomponent: EditingPanelHooks,\n\t} );\n}\n\nconst blockV1Panel = () => {\n\tblockDataCommand( {\n\t\tcommand: 'panel/editor/open',\n\t\tcondition: shouldUseV2Panel,\n\t} );\n};\n","import getSelectedElements from './get-selected-elements';\nimport getWidgetsCache from './get-widgets-cache';\n\nexport const shouldUseV2Panel = () => {\n\tconst selectedElements = getSelectedElements();\n\tconst widgetCache = getWidgetsCache();\n\n\tif ( selectedElements.length !== 1 ) {\n\t\treturn false;\n\t}\n\n\t// Check if the selected element has atomic controls, meaning it's a V2 element.\n\treturn !! widgetCache?.[ selectedElements[ 0 ].type ]?.atomic_controls;\n};\n","import { useEffect } from 'react';\nimport { commandStartEvent, __privateListenTo as listenTo } from '@elementor/editor-v1-adapters';\nimport { usePanelActions } from '../panel';\nimport { shouldUseV2Panel } from '../sync/should-use-v2-panel';\n\nexport const useOpenEditorPanel = () => {\n\tconst { open } = usePanelActions();\n\n\tuseEffect( () => {\n\t\treturn listenTo( commandStartEvent( 'panel/editor/open' ), () => {\n\t\t\tif ( shouldUseV2Panel() ) {\n\t\t\t\topen();\n\t\t\t}\n\t\t} );\n\t}, [] ); // eslint-disable-line react-hooks/exhaustive-deps\n};\n","import { useOpenEditorPanel } from '../hooks/use-open-editor-panel';\n\nexport const EditingPanelHooks = () => {\n\tuseOpenEditorPanel();\n\n\treturn null;\n};\n","import init from './init';\n\ninit();\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,wBAA6C;;;ACA7C,IAAAC,UAAuB;AACvB,IAAAC,eAAmB;;;ACDnB,gCAAqE;;;ACGtD,SAAR,sBAAkD;AACxD,QAAM,iBAAiB;AAEvB,QAAM,mBAAmB,eAAe,WAAW,WAAW,cAAc,KAAK,CAAC;AAElF,SAAO,iBAAiB,OAAqB,CAAE,KAAK,OAAQ;AAC3D,UAAM,OAAO,GAAG,MAAM,IAAK,YAAa,KAAK,GAAG,MAAM,IAAK,QAAS;AAEpE,QAAK,MAAO;AACX,UAAI,KAAM;AAAA,QACT,IAAI,GAAG,MAAM,IAAK,IAAK;AAAA,QACvB;AAAA,MACD,CAAE;AAAA,IACH;AAEA,WAAO;AAAA,EACR,GAAG,CAAC,CAAE;AACP;;;ADjBe,SAAR,sBAAuC;AAC7C,aAAO,0BAAAC;AAAA,IACN,KAAE,2CAAiB,0BAA2B,OAAG,2CAAiB,4BAA6B,CAAE;AAAA,IACjG,MAAM,oBAAoB;AAAA,EAC3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EA,IAAM,eAAe,MAAM;AAC1B,iCAAAC,2BAAkB;AAAA,IACjB,SAAS;AAAA,IACT,WAAW;AAAA,EACZ,CAAE;AACH;;;AIpBA,KAAK;","names":["import_editor_panels","React","import_i18n","useListenTo","import_editor_v1_adapters","useListenTo","import_ui","React","import_i18n","React","import_ui","React","import_react","import_editor_v1_adapters","useListenTo","import_editor_v1_adapters","runCommand","React","import_react","import_ui","React","import_ui","React","import_ui","React","import_ui","React","import_ui","React","React","import_react","Context","import_editor_v1_adapters","useListenTo","import_ui","React","React","import_editor_v1_adapters","runCommand","import_editor_v1_adapters","useListenTo","import_ui","Label","React","import_ui","units","defaultState","import_ui","import_i18n","Control","createPanel","import_react","import_editor_v1_adapters","listenTo","import_editor_panels","import_editor_v1_adapters","registerPanel","blockDataCommand"]}
|
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// src/panel.ts
|
|
2
2
|
import { __createPanel as createPanel } from "@elementor/editor-panels";
|
|
3
3
|
|
|
4
|
-
// src/components/editing-panel
|
|
5
|
-
import * as
|
|
6
|
-
import { __ as
|
|
4
|
+
// src/components/editing-panel.tsx
|
|
5
|
+
import * as React15 from "react";
|
|
6
|
+
import { __ as __4 } from "@wordpress/i18n";
|
|
7
7
|
|
|
8
8
|
// src/hooks/use-selected-elements.ts
|
|
9
9
|
import { __privateUseListenTo as useListenTo, commandEndEvent } from "@elementor/editor-v1-adapters";
|
|
@@ -64,7 +64,7 @@ function useElementType(type) {
|
|
|
64
64
|
);
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
// src/components/editing-panel
|
|
67
|
+
// src/components/editing-panel.tsx
|
|
68
68
|
import { Panel, PanelBody, PanelHeader, PanelHeaderTitle } from "@elementor/editor-panels";
|
|
69
69
|
|
|
70
70
|
// src/contexts/element-context.tsx
|
|
@@ -82,19 +82,19 @@ function useElementContext() {
|
|
|
82
82
|
return context;
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
// src/components/editing-panel
|
|
85
|
+
// src/components/editing-panel-tabs.tsx
|
|
86
86
|
import { Stack as Stack7, Tabs, Tab, TabPanel, useTabs } from "@elementor/ui";
|
|
87
|
-
import * as
|
|
88
|
-
import { __ as
|
|
87
|
+
import * as React14 from "react";
|
|
88
|
+
import { __ as __3 } from "@wordpress/i18n";
|
|
89
89
|
|
|
90
|
-
// src/components/
|
|
91
|
-
import * as
|
|
90
|
+
// src/components/settings-tab.tsx
|
|
91
|
+
import * as React8 from "react";
|
|
92
92
|
import { Stack as Stack3 } from "@elementor/ui";
|
|
93
93
|
|
|
94
|
-
// src/
|
|
94
|
+
// src/controls/settings-control.tsx
|
|
95
95
|
import * as React2 from "react";
|
|
96
96
|
|
|
97
|
-
// src/
|
|
97
|
+
// src/controls/control-context.tsx
|
|
98
98
|
import { createContext as createContext2, useContext as useContext2 } from "react";
|
|
99
99
|
var ControlContext = createContext2(null);
|
|
100
100
|
function useControl(defaultValue) {
|
|
@@ -105,7 +105,7 @@ function useControl(defaultValue) {
|
|
|
105
105
|
return { ...controlContext, value: controlContext.value ?? defaultValue };
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
// src/
|
|
108
|
+
// src/controls/settings-control.tsx
|
|
109
109
|
import { Stack, styled, Typography } from "@elementor/ui";
|
|
110
110
|
|
|
111
111
|
// src/hooks/use-widget-settings.ts
|
|
@@ -143,7 +143,7 @@ var updateSettings = ({ id, props }) => {
|
|
|
143
143
|
});
|
|
144
144
|
};
|
|
145
145
|
|
|
146
|
-
// src/
|
|
146
|
+
// src/controls/settings-control.tsx
|
|
147
147
|
var SettingsControlProvider = ({ bind, children }) => {
|
|
148
148
|
const { element } = useElementContext();
|
|
149
149
|
const value = useWidgetSettings({ id: element.id, bind });
|
|
@@ -172,7 +172,7 @@ var Label = ({ children }) => {
|
|
|
172
172
|
};
|
|
173
173
|
SettingsControl.Label = Label;
|
|
174
174
|
|
|
175
|
-
// src/components/
|
|
175
|
+
// src/components/collapsible-section.tsx
|
|
176
176
|
import * as React3 from "react";
|
|
177
177
|
import { useId } from "react";
|
|
178
178
|
import { Accordion, AccordionSummary, AccordionDetails, AccordionSummaryText, Stack as Stack2 } from "@elementor/ui";
|
|
@@ -183,7 +183,7 @@ var CollapsibleSection = ({ title, children }) => {
|
|
|
183
183
|
return /* @__PURE__ */ React3.createElement(Accordion, { disableGutters: true, defaultExpanded: true }, /* @__PURE__ */ React3.createElement(AccordionSummary, { "aria-controls": contentId, id: labelId }, /* @__PURE__ */ React3.createElement(AccordionSummaryText, { primaryTypographyProps: { variant: "caption" } }, title)), /* @__PURE__ */ React3.createElement(AccordionDetails, { id: contentId, "aria-labelledby": labelId }, /* @__PURE__ */ React3.createElement(Stack2, { gap: 2.5 }, children)));
|
|
184
184
|
};
|
|
185
185
|
|
|
186
|
-
// src/
|
|
186
|
+
// src/controls/control-types/select-control.tsx
|
|
187
187
|
import * as React4 from "react";
|
|
188
188
|
import { MenuItem, Select } from "@elementor/ui";
|
|
189
189
|
var SelectControl = ({ options }) => {
|
|
@@ -194,7 +194,7 @@ var SelectControl = ({ options }) => {
|
|
|
194
194
|
return /* @__PURE__ */ React4.createElement(Select, { size: "tiny", value: value ?? "", onChange: handleChange }, options.map(({ label, ...props }) => /* @__PURE__ */ React4.createElement(MenuItem, { key: props.value, ...props }, label)));
|
|
195
195
|
};
|
|
196
196
|
|
|
197
|
-
// src/
|
|
197
|
+
// src/controls/control-types/text-area-control.tsx
|
|
198
198
|
import * as React5 from "react";
|
|
199
199
|
import { TextField } from "@elementor/ui";
|
|
200
200
|
var TextAreaControl = ({ placeholder }) => {
|
|
@@ -216,7 +216,7 @@ var TextAreaControl = ({ placeholder }) => {
|
|
|
216
216
|
);
|
|
217
217
|
};
|
|
218
218
|
|
|
219
|
-
// src/
|
|
219
|
+
// src/controls/control-types/text-control.tsx
|
|
220
220
|
import * as React6 from "react";
|
|
221
221
|
import { TextField as TextField2 } from "@elementor/ui";
|
|
222
222
|
var TextControl = ({ placeholder }) => {
|
|
@@ -225,8 +225,78 @@ var TextControl = ({ placeholder }) => {
|
|
|
225
225
|
return /* @__PURE__ */ React6.createElement(TextField2, { type: "text", size: "tiny", value, onChange: handleChange, placeholder });
|
|
226
226
|
};
|
|
227
227
|
|
|
228
|
-
// src/
|
|
228
|
+
// src/controls/control-types/attachment-control.tsx
|
|
229
|
+
import * as React7 from "react";
|
|
230
|
+
import { Button, Card, CardMedia, CardOverlay } from "@elementor/ui";
|
|
231
|
+
import { UploadIcon } from "@elementor/icons";
|
|
232
|
+
import { __ } from "@wordpress/i18n";
|
|
233
|
+
import { useWpMediaAttachment, useWpMediaFrame } from "@elementor/wp-media";
|
|
234
|
+
var isImageAttachment = (value) => {
|
|
235
|
+
return value.$$type === "image-attachment";
|
|
236
|
+
};
|
|
237
|
+
var isImageUrl = (value) => {
|
|
238
|
+
return value.$$type === "image-url";
|
|
239
|
+
};
|
|
240
|
+
var defaultState = {
|
|
241
|
+
$$type: "image-url",
|
|
242
|
+
value: {
|
|
243
|
+
url: "/wp-content/plugins/elementor/assets/images/placeholder.png"
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
var AttachmentControl = (props) => {
|
|
247
|
+
const { value, setValue } = useControl(defaultState);
|
|
248
|
+
const { data: attachment } = useWpMediaAttachment(isImageAttachment(value) ? value.value.id : void 0);
|
|
249
|
+
const getImageSrc = () => {
|
|
250
|
+
if (attachment?.url) {
|
|
251
|
+
return attachment.url;
|
|
252
|
+
}
|
|
253
|
+
if (isImageUrl(value)) {
|
|
254
|
+
return value.value.url;
|
|
255
|
+
}
|
|
256
|
+
return defaultState.value.url;
|
|
257
|
+
};
|
|
258
|
+
const { open } = useWpMediaFrame({
|
|
259
|
+
types: props.mediaTypes,
|
|
260
|
+
multiple: false,
|
|
261
|
+
selected: isImageAttachment(value) ? value.value?.id : void 0,
|
|
262
|
+
onSelect: (val) => {
|
|
263
|
+
setValue({
|
|
264
|
+
$$type: "image-attachment",
|
|
265
|
+
value: {
|
|
266
|
+
id: val.id
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
return /* @__PURE__ */ React7.createElement(Card, { variant: "outlined" }, /* @__PURE__ */ React7.createElement(CardMedia, { image: getImageSrc(), sx: { height: 150 } }), /* @__PURE__ */ React7.createElement(CardOverlay, null, /* @__PURE__ */ React7.createElement(
|
|
272
|
+
Button,
|
|
273
|
+
{
|
|
274
|
+
color: "inherit",
|
|
275
|
+
size: "small",
|
|
276
|
+
variant: "outlined",
|
|
277
|
+
onClick: () => {
|
|
278
|
+
open({ mode: "browse" });
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
__("Select Image", "elementor")
|
|
282
|
+
), /* @__PURE__ */ React7.createElement(
|
|
283
|
+
Button,
|
|
284
|
+
{
|
|
285
|
+
color: "inherit",
|
|
286
|
+
size: "small",
|
|
287
|
+
variant: "text",
|
|
288
|
+
startIcon: /* @__PURE__ */ React7.createElement(UploadIcon, null),
|
|
289
|
+
onClick: () => {
|
|
290
|
+
open({ mode: "upload" });
|
|
291
|
+
}
|
|
292
|
+
},
|
|
293
|
+
__("Upload Image", "elementor")
|
|
294
|
+
)));
|
|
295
|
+
};
|
|
296
|
+
|
|
297
|
+
// src/controls/get-control-by-type.ts
|
|
229
298
|
var controlTypes = {
|
|
299
|
+
attachment: AttachmentControl,
|
|
230
300
|
select: SelectControl,
|
|
231
301
|
text: TextControl,
|
|
232
302
|
textarea: TextAreaControl
|
|
@@ -235,21 +305,21 @@ var getControlByType = (type) => {
|
|
|
235
305
|
return controlTypes[type] ?? null;
|
|
236
306
|
};
|
|
237
307
|
|
|
238
|
-
// src/components/
|
|
308
|
+
// src/components/settings-tab.tsx
|
|
239
309
|
var SettingsTab = () => {
|
|
240
310
|
const { element } = useElementContext();
|
|
241
311
|
const elementType = useElementType(element?.type);
|
|
242
312
|
if (!elementType) {
|
|
243
313
|
return null;
|
|
244
314
|
}
|
|
245
|
-
return /* @__PURE__ */
|
|
315
|
+
return /* @__PURE__ */ React8.createElement(Stack3, null, elementType.controls.map(({ type, value }, index) => {
|
|
246
316
|
if (type === "control") {
|
|
247
|
-
return /* @__PURE__ */
|
|
317
|
+
return /* @__PURE__ */ React8.createElement(Control, { key: value.bind, control: value });
|
|
248
318
|
}
|
|
249
319
|
if (type === "section") {
|
|
250
|
-
return /* @__PURE__ */
|
|
320
|
+
return /* @__PURE__ */ React8.createElement(CollapsibleSection, { key: type + "." + index, title: value.label }, value.items?.map((item) => {
|
|
251
321
|
if (item.type === "control") {
|
|
252
|
-
return /* @__PURE__ */
|
|
322
|
+
return /* @__PURE__ */ React8.createElement(Control, { key: item.value.bind, control: item.value });
|
|
253
323
|
}
|
|
254
324
|
return null;
|
|
255
325
|
}));
|
|
@@ -262,7 +332,7 @@ var Control = ({ control }) => {
|
|
|
262
332
|
if (!ControlComponent) {
|
|
263
333
|
return null;
|
|
264
334
|
}
|
|
265
|
-
return /* @__PURE__ */
|
|
335
|
+
return /* @__PURE__ */ React8.createElement(SettingsControl, { bind: control.bind }, control.label ? /* @__PURE__ */ React8.createElement(SettingsControl.Label, null, control.label) : null, /* @__PURE__ */ React8.createElement(
|
|
266
336
|
ControlComponent,
|
|
267
337
|
{
|
|
268
338
|
...control.props
|
|
@@ -270,18 +340,18 @@ var Control = ({ control }) => {
|
|
|
270
340
|
));
|
|
271
341
|
};
|
|
272
342
|
|
|
273
|
-
// src/components/
|
|
274
|
-
import * as
|
|
343
|
+
// src/components/style-tab.tsx
|
|
344
|
+
import * as React13 from "react";
|
|
275
345
|
|
|
276
346
|
// src/contexts/style-context.tsx
|
|
277
|
-
import * as
|
|
347
|
+
import * as React9 from "react";
|
|
278
348
|
import { createContext as createContext3, useContext as useContext3 } from "react";
|
|
279
349
|
import { useActiveBreakpoint } from "@elementor/editor-responsive";
|
|
280
350
|
var Context2 = createContext3(null);
|
|
281
351
|
function StyleContext({ children, selectedStyleDef }) {
|
|
282
352
|
const breakpoint = useActiveBreakpoint();
|
|
283
353
|
const selectedMeta = { breakpoint, state: null };
|
|
284
|
-
return /* @__PURE__ */
|
|
354
|
+
return /* @__PURE__ */ React9.createElement(Context2.Provider, { value: { selectedStyleDef, selectedMeta } }, children);
|
|
285
355
|
}
|
|
286
356
|
function useStyleContext() {
|
|
287
357
|
const context = useContext3(Context2);
|
|
@@ -311,14 +381,14 @@ var useElementStyles = (elementID) => {
|
|
|
311
381
|
);
|
|
312
382
|
};
|
|
313
383
|
|
|
314
|
-
// src/components/
|
|
384
|
+
// src/components/style-tab.tsx
|
|
315
385
|
import { Stack as Stack6 } from "@elementor/ui";
|
|
316
386
|
|
|
317
|
-
// src/components/
|
|
318
|
-
import * as
|
|
387
|
+
// src/components/style-sections/size-section.tsx
|
|
388
|
+
import * as React12 from "react";
|
|
319
389
|
|
|
320
|
-
// src/
|
|
321
|
-
import * as
|
|
390
|
+
// src/controls/style-control.tsx
|
|
391
|
+
import * as React10 from "react";
|
|
322
392
|
|
|
323
393
|
// src/sync/update-style.ts
|
|
324
394
|
import { __privateRunCommand as runCommand2 } from "@elementor/editor-v1-adapters";
|
|
@@ -363,7 +433,7 @@ function getVariantByMeta(styleDef, meta) {
|
|
|
363
433
|
});
|
|
364
434
|
}
|
|
365
435
|
|
|
366
|
-
// src/
|
|
436
|
+
// src/controls/style-control.tsx
|
|
367
437
|
import { Typography as Typography2 } from "@elementor/ui";
|
|
368
438
|
var StyleControl = ({ bind, children }) => {
|
|
369
439
|
const { element } = useElementContext();
|
|
@@ -382,18 +452,18 @@ var StyleControl = ({ bind, children }) => {
|
|
|
382
452
|
meta: selectedMeta,
|
|
383
453
|
propName: bind
|
|
384
454
|
});
|
|
385
|
-
return /* @__PURE__ */
|
|
455
|
+
return /* @__PURE__ */ React10.createElement(ControlContext.Provider, { value: { bind, value, setValue } }, children);
|
|
386
456
|
};
|
|
387
457
|
var Label2 = ({ children }) => {
|
|
388
|
-
return /* @__PURE__ */
|
|
458
|
+
return /* @__PURE__ */ React10.createElement(Typography2, { component: "label", variant: "caption", color: "text.secondary" }, children);
|
|
389
459
|
};
|
|
390
460
|
StyleControl.Label = Label2;
|
|
391
461
|
|
|
392
|
-
// src/
|
|
393
|
-
import * as
|
|
462
|
+
// src/controls/control-types/size-control.tsx
|
|
463
|
+
import * as React11 from "react";
|
|
394
464
|
import { MenuItem as MenuItem2, Select as Select2, Stack as Stack4, TextField as TextField3 } from "@elementor/ui";
|
|
395
465
|
var SizeControl = ({ units: units2, placeholder }) => {
|
|
396
|
-
const { value, setValue } = useControl(
|
|
466
|
+
const { value, setValue } = useControl(defaultState2);
|
|
397
467
|
const propValue = value.value;
|
|
398
468
|
const handleUnitChange = (event) => {
|
|
399
469
|
const unit = event.target.value;
|
|
@@ -406,7 +476,7 @@ var SizeControl = ({ units: units2, placeholder }) => {
|
|
|
406
476
|
}
|
|
407
477
|
setValue({ $$type: "size", value: { ...propValue, size } });
|
|
408
478
|
};
|
|
409
|
-
return /* @__PURE__ */
|
|
479
|
+
return /* @__PURE__ */ React11.createElement(Stack4, { direction: "row" }, /* @__PURE__ */ React11.createElement(
|
|
410
480
|
TextField3,
|
|
411
481
|
{
|
|
412
482
|
size: "tiny",
|
|
@@ -415,7 +485,7 @@ var SizeControl = ({ units: units2, placeholder }) => {
|
|
|
415
485
|
onChange: handleSizeChange,
|
|
416
486
|
placeholder
|
|
417
487
|
}
|
|
418
|
-
), /* @__PURE__ */
|
|
488
|
+
), /* @__PURE__ */ React11.createElement(
|
|
419
489
|
Select2,
|
|
420
490
|
{
|
|
421
491
|
size: "tiny",
|
|
@@ -426,40 +496,40 @@ var SizeControl = ({ units: units2, placeholder }) => {
|
|
|
426
496
|
transformOrigin: { vertical: "top", horizontal: "right" }
|
|
427
497
|
}
|
|
428
498
|
},
|
|
429
|
-
units2.map((unit) => /* @__PURE__ */
|
|
499
|
+
units2.map((unit) => /* @__PURE__ */ React11.createElement(MenuItem2, { key: unit, value: unit }, unit.toUpperCase()))
|
|
430
500
|
));
|
|
431
501
|
};
|
|
432
|
-
var
|
|
502
|
+
var defaultState2 = {
|
|
433
503
|
$$type: "size",
|
|
434
504
|
value: { unit: "px", size: 0 }
|
|
435
505
|
};
|
|
436
506
|
|
|
437
|
-
// src/components/
|
|
507
|
+
// src/components/style-sections/size-section.tsx
|
|
438
508
|
import { Stack as Stack5 } from "@elementor/ui";
|
|
439
|
-
import { __ } from "@wordpress/i18n";
|
|
509
|
+
import { __ as __2 } from "@wordpress/i18n";
|
|
440
510
|
var SizeSection = () => {
|
|
441
|
-
return /* @__PURE__ */
|
|
511
|
+
return /* @__PURE__ */ React12.createElement(CollapsibleSection, { title: __2("Size", "elementor") }, /* @__PURE__ */ React12.createElement(Stack5, { gap: 1.5 }, /* @__PURE__ */ React12.createElement(Stack5, { direction: "row", gap: 2 }, /* @__PURE__ */ React12.createElement(Control2, { bind: "width", label: __2("Width", "elementor") }), /* @__PURE__ */ React12.createElement(Control2, { bind: "height", label: __2("Height", "elementor") })), /* @__PURE__ */ React12.createElement(Stack5, { direction: "row", gap: 2 }, /* @__PURE__ */ React12.createElement(Control2, { bind: "min-width", label: __2("Min. Width", "elementor") }), /* @__PURE__ */ React12.createElement(Control2, { bind: "min-height", label: __2("Min. Height", "elementor") })), /* @__PURE__ */ React12.createElement(Stack5, { direction: "row", gap: 2 }, /* @__PURE__ */ React12.createElement(Control2, { bind: "max-width", label: __2("Max. Width", "elementor") }), /* @__PURE__ */ React12.createElement(Control2, { bind: "max-height", label: __2("Max. Height", "elementor") }))));
|
|
442
512
|
};
|
|
443
513
|
var units = ["px", "%", "em", "rem", "vw"];
|
|
444
514
|
var Control2 = ({ label, bind }) => {
|
|
445
|
-
return /* @__PURE__ */
|
|
515
|
+
return /* @__PURE__ */ React12.createElement(StyleControl, { bind }, /* @__PURE__ */ React12.createElement(Stack5, { gap: 1, sx: { flex: "0 1 50%" } }, /* @__PURE__ */ React12.createElement(StyleControl.Label, null, label), /* @__PURE__ */ React12.createElement(SizeControl, { units })));
|
|
446
516
|
};
|
|
447
517
|
|
|
448
|
-
// src/components/
|
|
518
|
+
// src/components/style-tab.tsx
|
|
449
519
|
var StyleTab = () => {
|
|
450
520
|
const { element } = useElementContext();
|
|
451
521
|
const elementStyles = useElementStyles(element.id);
|
|
452
522
|
const [selectedStyleDef = null] = Object.values(elementStyles || {});
|
|
453
|
-
return /* @__PURE__ */
|
|
523
|
+
return /* @__PURE__ */ React13.createElement(StyleContext, { selectedStyleDef }, /* @__PURE__ */ React13.createElement(Stack6, null, /* @__PURE__ */ React13.createElement(SizeSection, null)));
|
|
454
524
|
};
|
|
455
525
|
|
|
456
|
-
// src/components/editing-panel
|
|
526
|
+
// src/components/editing-panel-tabs.tsx
|
|
457
527
|
var EditingPanelTabs = () => {
|
|
458
528
|
const { getTabProps, getTabPanelProps, getTabsProps } = useTabs("settings");
|
|
459
|
-
return /* @__PURE__ */
|
|
529
|
+
return /* @__PURE__ */ React14.createElement(Stack7, { direction: "column", sx: { width: "100%" } }, /* @__PURE__ */ React14.createElement(Tabs, { variant: "fullWidth", indicatorColor: "secondary", textColor: "inherit", ...getTabsProps() }, /* @__PURE__ */ React14.createElement(Tab, { label: __3("General", "elementor"), ...getTabProps("settings") }), /* @__PURE__ */ React14.createElement(Tab, { label: __3("Style", "elementor"), ...getTabProps("style") })), /* @__PURE__ */ React14.createElement(TabPanel, { ...getTabPanelProps("settings"), disablePadding: true }, /* @__PURE__ */ React14.createElement(SettingsTab, null)), /* @__PURE__ */ React14.createElement(TabPanel, { ...getTabPanelProps("style"), disablePadding: true }, /* @__PURE__ */ React14.createElement(StyleTab, null)));
|
|
460
530
|
};
|
|
461
531
|
|
|
462
|
-
// src/components/editing-panel
|
|
532
|
+
// src/components/editing-panel.tsx
|
|
463
533
|
var EditingPanel = () => {
|
|
464
534
|
const elements = useSelectedElements();
|
|
465
535
|
const [selectedElement] = elements;
|
|
@@ -467,8 +537,8 @@ var EditingPanel = () => {
|
|
|
467
537
|
if (elements.length !== 1 || !elementType) {
|
|
468
538
|
return null;
|
|
469
539
|
}
|
|
470
|
-
const panelTitle =
|
|
471
|
-
return /* @__PURE__ */
|
|
540
|
+
const panelTitle = __4("Edit %s", "elementor").replace("%s", elementType.title);
|
|
541
|
+
return /* @__PURE__ */ React15.createElement(Panel, null, /* @__PURE__ */ React15.createElement(PanelHeader, null, /* @__PURE__ */ React15.createElement(PanelHeaderTitle, null, panelTitle)), /* @__PURE__ */ React15.createElement(PanelBody, null, /* @__PURE__ */ React15.createElement(ElementContext, { element: selectedElement }, /* @__PURE__ */ React15.createElement(EditingPanelTabs, null))));
|
|
472
542
|
};
|
|
473
543
|
|
|
474
544
|
// src/panel.ts
|
|
@@ -504,7 +574,7 @@ var useOpenEditorPanel = () => {
|
|
|
504
574
|
}, []);
|
|
505
575
|
};
|
|
506
576
|
|
|
507
|
-
// src/components/editing-panel
|
|
577
|
+
// src/components/editing-panel-hooks.tsx
|
|
508
578
|
var EditingPanelHooks = () => {
|
|
509
579
|
useOpenEditorPanel();
|
|
510
580
|
return null;
|