dist/metaboxes.js 0000666 00000012674 15214141507 0010052 0 ustar 00 // modules are defined as an array
// [ module function, map of requires ]
//
// map of requires is short require name -> numeric require
//
// anything defined in a previous bundle is accessed via the
// orig method which is the require for previous bundles
parcelRequire = (function (modules, cache, entry, globalName) {
// Save the require from previous bundle to this closure if any
var previousRequire = typeof parcelRequire === 'function' && parcelRequire;
var nodeRequire = typeof require === 'function' && require;
function newRequire(name, jumped) {
if (!cache[name]) {
if (!modules[name]) {
// if we cannot find the module within our internal map or
// cache jump to the current global require ie. the last bundle
// that was added to the page.
var currentRequire = typeof parcelRequire === 'function' && parcelRequire;
if (!jumped && currentRequire) {
return currentRequire(name, true);
}
// If there are other bundles on this page the require from the
// previous one is saved to 'previousRequire'. Repeat this as
// many times as there are bundles until the module is found or
// we exhaust the require chain.
if (previousRequire) {
return previousRequire(name, true);
}
// Try the node require function if it exists.
if (nodeRequire && typeof name === 'string') {
return nodeRequire(name);
}
var err = new Error('Cannot find module \'' + name + '\'');
err.code = 'MODULE_NOT_FOUND';
throw err;
}
localRequire.resolve = resolve;
localRequire.cache = {};
var module = cache[name] = new newRequire.Module(name);
modules[name][0].call(module.exports, localRequire, module, module.exports, this);
}
return cache[name].exports;
function localRequire(x){
return newRequire(localRequire.resolve(x));
}
function resolve(x){
return modules[name][1][x] || x;
}
}
function Module(moduleName) {
this.id = moduleName;
this.bundle = newRequire;
this.exports = {};
}
newRequire.isParcelRequire = true;
newRequire.Module = Module;
newRequire.modules = modules;
newRequire.cache = cache;
newRequire.parent = previousRequire;
newRequire.register = function (id, exports) {
modules[id] = [function (require, module) {
module.exports = exports;
}, {}];
};
var error;
for (var i = 0; i < entry.length; i++) {
try {
newRequire(entry[i]);
} catch (e) {
// Save first error but execute all entries
if (!error) {
error = e;
}
}
}
if (entry.length) {
// Expose entry point to Node, AMD or browser globals
// Based on https://github.com/ForbesLindesay/umd/blob/master/template.js
var mainExports = newRequire(entry[entry.length - 1]);
// CommonJS
if (typeof exports === "object" && typeof module !== "undefined") {
module.exports = mainExports;
// RequireJS
} else if (typeof define === "function" && define.amd) {
define(function () {
return mainExports;
});
// ';
do_action( 'wpforms_builder_print_footer_scripts' );
}
/**
* Load the appropriate files to build the page.
*
* @since 1.0.0
*/
public function output() {
if ( ! (bool) apply_filters( 'wpforms_builder_output', true ) ) {
return;
}
$form_id = $this->form ? absint( $this->form->ID ) : '';
$field_id = ! empty( $this->form_data['field_id'] ) ? $this->form_data['field_id'] : '';
?>
We\'d love to hear it. Also, you can create your own templates!', 'wpforms-lite' ),
array(
'a' => array(
'href' => array(),
'target' => array(),
'rel' => array(),
),
)
),
'https://wpforms.com/form-template-suggestion/',
'https://wpforms.com/docs/how-to-create-a-custom-form-template/'
);
?>
';
}
/**
* Output the panel's sidebar if we have one.
*
* @since 1.0.0
*/
public function panel_sidebar() {
}
/**
* Output panel sidebar sections.
*
* @since 1.0.0
*
* @param string $name
* @param string $slug
* @param string $icon
*/
public function panel_sidebar_section( $name, $slug, $icon = '' ) {
$class = '';
$class .= $slug === 'default' ? ' default' : '';
$class .= ! empty( $icon ) ? ' icon' : '';
echo '';
if ( ! empty( $icon ) ) {
echo '';
}
echo esc_html( $name );
echo '';
echo '';
}
/**
* Output the panel's primary content.
*
* @since 1.0.0
*/
public function panel_content() {
}
}
panels/class-fields.php 0000666 00000032636 15214144143 0011125 0 ustar 00 name = esc_html__( 'Fields', 'wpforms-lite' );
$this->slug = 'fields';
$this->icon = 'fa-list-alt';
$this->order = 10;
$this->sidebar = true;
if ( $this->form ) {
add_action( 'wpforms_builder_fields', array( $this, 'fields' ) );
add_action( 'wpforms_builder_fields_options', array( $this, 'fields_options' ) );
add_action( 'wpforms_builder_preview', array( $this, 'preview' ) );
// Template for form builder previews.
add_action( 'wpforms_builder_print_footer_scripts', array( $this, 'field_preview_templates' ) );
}
}
/**
* Enqueue assets for the Fields panel.
*
* @since 1.0.0
*/
public function enqueues() {
// CSS.
wp_enqueue_style(
'wpforms-builder-fields',
WPFORMS_PLUGIN_URL . 'assets/css/admin-builder-fields.css',
null,
WPFORMS_VERSION
);
}
/**
* Output the Field panel sidebar.
*
* @since 1.0.0
*/
public function panel_sidebar() {
// Sidebar contents are not valid unless we have a form.
if ( ! $this->form ) {
return;
}
?>
form ); ?>
form ); ?>
form ) {
echo '
';
echo wp_kses(
__( 'You need to setup your form before you can manage the fields.', 'wpforms-lite' ),
array(
'a' => array(
'href' => array(),
'class' => array(),
'data-panel' => array(),
),
)
);
echo '
';
}
}
/**
* No fields options markup.
*
* @since 1.6.0
*/
public function no_fields_options() {
printf(
'
%s
',
esc_html__( 'You don\'t have any fields yet.', 'wpforms-lite' )
);
}
/**
* No fields preview placeholder markup.
*
* @since 1.6.0
*/
public function no_fields_preview() {
printf(
'
%s
',
esc_html__( 'You don\'t have any fields yet. Add some!', 'wpforms-lite' )
);
}
/**
* Sort Add Field buttons by order provided.
*
* @since 1.0.0
*
* @param array $a
* @param array $b
*
* @return array
*/
public function field_order( $a, $b ) {
return $a['order'] - $b['order'];
}
/**
* Template for form builder preview.
*
* @since 1.4.5
*/
public function field_preview_templates() {
// Checkbox, Radio, and Payment Multiple/Checkbox field choices.
?>
name = esc_html__( 'Payments', 'wpforms-lite' );
$this->slug = 'payments';
$this->icon = 'fa-usd';
$this->order = 10;
$this->sidebar = true;
}
/**
* Output the Payments panel sidebar.
*
* @since 1.0.0
*/
public function panel_sidebar() {
// Sidebar contents are not valid unless we have a form.
if ( ! $this->form ) {
return;
}
$this->panel_sidebar_section( esc_html__( 'Default', 'wpforms-lite' ), 'default' );
do_action( 'wpforms_payments_panel_sidebar', $this->form );
}
/**
* Output the Payments panel primary content.
*
* @since 1.0.0
*/
public function panel_content() {
// An array of all the active provider addons.
$payments_active = apply_filters( 'wpforms_payments_available', array() );
if ( ! $this->form ) {
// Check if there is a form created. When no form has been created
// yet let the user know we need a form to setup a payment.
echo '
';
echo wp_kses(
__( 'You need to setup your form before you can manage these settings.', 'wpforms-lite' ),
array(
'a' => array(
'href' => array(),
'class' => array(),
'data-panel' => array(),
),
)
);
echo '
';
return;
}
if ( ! wpforms()->pro ) {
// WPForms Lite users.
echo '
';
echo '
Payment integrations are not available on your plan.
';
echo '
Please upgrade to PRO to unlock all the payment integrations and more awesome features.
';
} elseif ( empty( $payments_active ) ) {
// Check for active payment addons. When no payment addons are
// activated let the user know they need to install/activate an
// addon to setup a payment.
echo '
' .
sprintf(
wp_kses(
/* translators: %s - Addons page URL. */
__( 'It seems you do not have any payment addons activated. You can head over to the Addons page to install and activate the addon for your payment service.', 'wpforms-lite' ),
array(
'a' => array(
'href' => array(),
),
)
),
esc_url( admin_url( 'admin.php?page=wpforms-addons' ) )
) .
'
';
echo '
';
} else {
// Everything is good - display default instructions.
echo '
' . esc_html__( 'Select your payment provider from the options on the left. If you don\'t see your payment service listed, then let us know and we\'ll do our best to get it added as fast as possible.', 'wpforms-lite' ) . '
';
echo '
';
}
do_action( 'wpforms_payments_panel_content', $this->form );
}
}
new WPForms_Builder_Panel_Payments();
panels/class-settings.php 0000666 00000013150 15214144143 0011505 0 ustar 00 name = esc_html__( 'Settings', 'wpforms-lite' );
$this->slug = 'settings';
$this->icon = 'fa-sliders';
$this->order = 10;
$this->sidebar = true;
}
/**
* Output the Settings panel sidebar.
*
* @since 1.0.0
*/
public function panel_sidebar() {
// Sidebar contents are not valid unless we have a form.
if ( ! $this->form ) {
return;
}
$sections = array(
'general' => esc_html__( 'General', 'wpforms-lite' ),
'notifications' => esc_html__( 'Notifications', 'wpforms-lite' ),
'confirmation' => esc_html__( 'Confirmations', 'wpforms-lite' ),
);
$sections = apply_filters( 'wpforms_builder_settings_sections', $sections, $this->form_data );
foreach ( $sections as $slug => $section ) {
$this->panel_sidebar_section( $section, $slug );
}
}
/**
* Output the Settings panel primary content.
*
* @since 1.0.0
*/
public function panel_content() {
// Check if there is a form created.
if ( ! $this->form ) {
echo '
';
echo wp_kses(
__( 'You need to setup your form before you can manage the settings.', 'wpforms-lite' ),
array(
'a' => array(
'href' => array(),
'class' => array(),
'data-panel' => array(),
),
)
);
echo '
';
/*
* Custom panels can be added below.
*/
do_action( 'wpforms_form_settings_panel_content', $this );
}
}
new WPForms_Builder_Panel_Settings();
panels/class-providers.php 0000666 00000010310 15214144143 0011655 0 ustar 00 name = esc_html__( 'Marketing', 'wpforms-lite' );
$this->slug = 'providers';
$this->icon = 'fa-bullhorn';
$this->order = 10;
$this->sidebar = true;
}
/**
* Enqueue assets for the Providers panel.
*
* @since 1.0.0
*/
public function enqueues() {
wp_enqueue_style(
'wpforms-builder-providers',
WPFORMS_PLUGIN_URL . 'assets/css/admin-builder-providers.css',
null,
WPFORMS_VERSION
);
wp_enqueue_script(
'wpforms-builder-providers',
WPFORMS_PLUGIN_URL . 'assets/js/admin-builder-providers.js',
array( 'jquery' ),
WPFORMS_VERSION,
false
);
wp_localize_script(
'wpforms-builder-providers',
'wpforms_builder_providers',
array(
'url' => esc_url( add_query_arg( array( 'view' => 'providers' ) ) ),
'confirm_save' => esc_html__( 'We need to save your progress to continue to the Marketing panel. Is that OK?', 'wpforms-lite' ),
'confirm_connection' => esc_html__( 'Are you sure you want to delete this connection?', 'wpforms-lite' ),
'prompt_connection' => esc_html__( 'Enter a %type% nickname', 'wpforms-lite' ),
'prompt_placeholder' => esc_html__( 'Eg: Newsletter Optin', 'wpforms-lite' ),
'error_name' => esc_html__( 'You must provide a connection nickname.', 'wpforms-lite' ),
'required_field' => esc_html__( 'Field required', 'wpforms-lite' ),
)
);
}
/**
* Output the Provider panel sidebar.
*
* @since 1.0.0
*/
public function panel_sidebar() {
// Sidebar contents are not valid unless we have a form.
if ( ! $this->form ) {
return;
}
$this->panel_sidebar_section( 'Default', 'default' );
do_action( 'wpforms_providers_panel_sidebar', $this->form );
}
/**
* Output the Provider panel primary content.
*
* @since 1.0.0
*/
public function panel_content() {
if ( ! $this->form ) {
// Check if there is a form created. When no form has been created
// yet let the user know we need a form to setup a provider.
echo '
';
echo wp_kses(
__( 'You need to setup your form before you can manage these settings.', 'wpforms-lite' ),
array(
'a' => array(
'href' => array(),
'class' => array(),
'data-panel' => array(),
),
)
);
echo '
';
return;
}
// An array of all the active provider addons.
$providers_active = wpforms_get_providers_available();
if ( empty( $providers_active ) ) {
// Check for active provider addons. When no provider addons are
// activated let the user know they need to install/activate an
// addon to setup a provider.
echo '
' .
sprintf(
wp_kses(
/* translators: %s - plugin admin area Addons page. */
__( 'It seems you do not have any marketing addons activated. You can head over to the Addons page to install and activate the addon for your provider.', 'wpforms-lite' ),
array(
'a' => array(
'href' => array(),
),
)
),
esc_url( admin_url( 'admin.php?page=wpforms-addons' ) )
) .
'
';
echo '
';
} else {
// Everything is good - display default instructions.
echo '
' . esc_html__( 'Select your email marketing service provider or CRM from the options on the left. If you don\'t see your email marketing service listed, then let us know and we\'ll do our best to get it added as fast as possible.', 'wpforms-lite' ) . '
';
echo '
';
}
do_action( 'wpforms_providers_panel_content', $this->form );
}
}
new WPForms_Builder_Panel_Providers();