diff --git a/classes/class-admin.php b/classes/class-admin.php
index 888006b..2234613 100644
--- a/classes/class-admin.php
+++ b/classes/class-admin.php
@@ -18,6 +18,8 @@ class Mind_Admin {
*/
public function __construct() {
add_action( 'admin_menu', [ $this, 'register_admin_menu' ], 20 );
+
+ add_filter( 'admin_body_class', [ $this, 'admin_body_class' ] );
}
/**
@@ -35,11 +37,60 @@ class Mind_Admin {
esc_html__( 'Mind', 'mind' ),
'manage_options',
'mind',
- [ 'Mind_Settings', 'print_settings_page' ],
+ [ $this, 'print_admin_page' ],
// phpcs:ignore
'data:image/svg+xml;base64,' . base64_encode( file_get_contents( mind()->plugin_path . 'assets/images/admin-icon.svg' ) ),
'58.7'
);
+
+ add_submenu_page(
+ 'mind',
+ '',
+ esc_html__( 'Welcome', 'mind' ),
+ 'manage_options',
+ 'mind'
+ );
+ add_submenu_page(
+ 'mind',
+ '',
+ esc_html__( 'Settings', 'mind' ),
+ 'manage_options',
+ 'admin.php?page=mind&sub_page=settings'
+ );
+ }
+
+ /**
+ * Print admin page.
+ */
+ public function print_admin_page() {
+ ?>
+
+ id ) {
+ return $classes;
+ }
+
+ $page_name = 'welcome';
+
+ // phpcs:ignore
+ if ( isset( $_GET['sub_page'] ) && $_GET['sub_page'] ) {
+ // phpcs:ignore
+ $page_name = $_GET['sub_page'];
+ }
+
+ $classes .= ' mind-admin-page mind-admin-page-' . esc_attr( $page_name );
+
+ return $classes;
}
}
diff --git a/classes/class-assets.php b/classes/class-assets.php
index 3e3d7be..51a393f 100644
--- a/classes/class-assets.php
+++ b/classes/class-assets.php
@@ -18,6 +18,7 @@ class Mind_Assets {
*/
public function __construct() {
add_action( 'enqueue_block_editor_assets', [ $this, 'enqueue_block_editor_assets' ] );
+ add_action( 'admin_enqueue_scripts', [ $this, 'admin_enqueue_scripts' ] );
}
/**
@@ -45,12 +46,14 @@ class Mind_Assets {
* Enqueue editor assets
*/
public function enqueue_block_editor_assets() {
- $openai_key = Mind_Settings::get_option( 'openai_key', 'mind_general' );
- $asset_data = $this->get_asset_file( 'build/index' );
+ $settings = get_option( 'mind_settings', array() );
+
+ $openai_key = $settings['openai_api_key'] ?? '';
+ $asset_data = $this->get_asset_file( 'build/editor' );
wp_enqueue_script(
'mind-editor',
- mind()->plugin_url . 'build/index.js',
+ mind()->plugin_url . 'build/editor.js',
$asset_data['dependencies'],
$asset_data['version'],
true
@@ -59,15 +62,52 @@ class Mind_Assets {
wp_localize_script(
'mind-editor',
'mindData',
- array(
+ [
'connected' => ! ! $openai_key,
- 'settingsPageURL' => admin_url( 'admin.php?page=mind' ),
- )
+ 'settingsPageURL' => admin_url( 'admin.php?page=mind&sub_page=settings' ),
+ ]
);
wp_enqueue_style(
'mind-editor',
- mind()->plugin_url . 'build/style-index.css',
+ mind()->plugin_url . 'build/style-editor.css',
+ [],
+ $asset_data['version']
+ );
+ }
+
+
+ /**
+ * Enqueue admin pages assets.
+ */
+ public function admin_enqueue_scripts() {
+ $screen = get_current_screen();
+
+ if ( 'toplevel_page_mind' !== $screen->id ) {
+ return;
+ }
+
+ $asset_data = $this->get_asset_file( 'build/admin' );
+
+ wp_enqueue_script(
+ 'mind-admin',
+ mind()->plugin_url . 'build/admin.js',
+ $asset_data['dependencies'],
+ $asset_data['version'],
+ true
+ );
+
+ wp_localize_script(
+ 'mind-admin',
+ 'mindAdminData',
+ [
+ 'settings' => get_option( 'mind_settings', array() ),
+ ]
+ );
+
+ wp_enqueue_style(
+ 'mind-admin',
+ mind()->plugin_url . 'build/style-admin.css',
[],
$asset_data['version']
);
diff --git a/classes/class-rest.php b/classes/class-rest.php
index a7c26c1..299927c 100644
--- a/classes/class-rest.php
+++ b/classes/class-rest.php
@@ -40,7 +40,18 @@ class Mind_Rest extends WP_REST_Controller {
public function register_routes() {
$namespace = $this->namespace . $this->version;
- // Get layouts list.
+ // Update Settings.
+ register_rest_route(
+ $namespace,
+ '/update_settings/',
+ [
+ 'methods' => [ 'POST' ],
+ 'callback' => [ $this, 'update_settings' ],
+ 'permission_callback' => [ $this, 'update_settings_permission' ],
+ ]
+ );
+
+ // Request OpenAI API.
register_rest_route(
$namespace,
'/request_ai/',
@@ -52,6 +63,19 @@ class Mind_Rest extends WP_REST_Controller {
);
}
+ /**
+ * Get edit options permissions.
+ *
+ * @return bool
+ */
+ public function update_settings_permission() {
+ if ( ! current_user_can( 'manage_options' ) ) {
+ return $this->error( 'user_dont_have_permission', __( 'User don\'t have permissions to change options.', 'mind' ), true );
+ }
+
+ return true;
+ }
+
/**
* Get permissions for OpenAI api request.
*
@@ -65,6 +89,24 @@ class Mind_Rest extends WP_REST_Controller {
return true;
}
+ /**
+ * Update Settings.
+ *
+ * @param WP_REST_Request $req request object.
+ *
+ * @return mixed
+ */
+ public function update_settings( WP_REST_Request $req ) {
+ $new_settings = $req->get_param( 'settings' );
+
+ if ( is_array( $new_settings ) ) {
+ $current_settings = get_option( 'mind_settings', [] );
+ update_option( 'mind_settings', array_merge( $current_settings, $new_settings ) );
+ }
+
+ return $this->success( true );
+ }
+
/**
* Send request to OpenAI.
*
@@ -73,9 +115,11 @@ class Mind_Rest extends WP_REST_Controller {
* @return mixed
*/
public function request_ai( WP_REST_Request $req ) {
- $openai_key = Mind_Settings::get_option( 'openai_key', 'mind_general' );
- $request = $req->get_param( 'request' ) ?? '';
- $context = $req->get_param( 'context' ) ?? '';
+ $settings = get_option( 'mind_settings', array() );
+ $openai_key = $settings['openai_api_key'] ?? '';
+
+ $request = $req->get_param( 'request' ) ?? '';
+ $context = $req->get_param( 'context' ) ?? '';
if ( ! $openai_key ) {
return $this->error( 'no_openai_key_found', __( 'Provide OpenAI key in the plugin settings.', 'mind' ) );
diff --git a/classes/class-settings.php b/classes/class-settings.php
deleted file mode 100644
index 6310491..0000000
--- a/classes/class-settings.php
+++ /dev/null
@@ -1,209 +0,0 @@
-plugin_path . 'vendors/class-settings-api.php';
-
-/**
- * Mind Settings Class
- */
-class Mind_Settings {
- /**
- * Settings API instance
- *
- * @var object
- */
- public static $settings_api;
-
- /**
- * Cached settings fields. We call settings fields method a lot of times to get default values.
- * So, for performance reasons we need to cache the output.
- *
- * @var object
- */
- public static $cached_settings_fields;
-
- /**
- * Mind_Settings constructor.
- */
- public function __construct() {
- self::init_actions();
- }
-
- /**
- * Get Option Value
- *
- * @param string $option - option name.
- * @param string $section - section name.
- *
- * @return bool|string
- */
- public static function get_option( $option, $section ) {
- $options = get_option( $section );
- $result = '';
-
- if ( isset( $options[ $option ] ) ) {
- $result = $options[ $option ];
- } else {
- // find default.
- $fields = self::get_settings_fields();
-
- if ( isset( $fields[ $section ] ) && is_array( $fields[ $section ] ) ) {
- foreach ( $fields[ $section ] as $field_data ) {
- if ( $option === $field_data['name'] && isset( $field_data['default'] ) ) {
- $result = $field_data['default'];
- }
- }
- }
- }
-
- return 'off' === $result ? false : ( 'on' === $result ? true : $result );
- }
-
- /**
- * Update Option Value
- *
- * @param string $option - option name.
- * @param string $section - section name.
- * @param string $value - new option value.
- */
- public static function update_option( $option, $section, $value ) {
- $options = get_option( $section );
-
- if ( ! is_array( $options ) ) {
- $options = [];
- }
-
- $options[ $option ] = $value;
-
- update_option( $section, $options );
- }
-
- /**
- * Init actions
- */
- public static function init_actions() {
- self::$settings_api = new Mind_Settings_API();
-
- add_action( 'admin_init', [ __CLASS__, 'admin_init' ] );
- }
-
- /**
- * Initialize the settings
- *
- * @return void
- */
- public static function admin_init() {
- // set the settings.
- self::$settings_api->set_sections( self::get_settings_sections() );
- self::$settings_api->set_fields( self::get_settings_fields() );
-
- // initialize settings.
- self::$settings_api->admin_init();
- }
-
- /**
- * Plugin settings sections
- *
- * @return array
- */
- public static function get_settings_sections() {
- $sections = [
- [
- 'id' => 'mind_general',
- 'title' => esc_html__( 'General', 'mind' ),
- 'icon' => '',
- ],
- ];
-
- return apply_filters( 'mind_settings_sections', $sections );
- }
-
- /**
- * Returns all the settings fields
- *
- * @return array settings fields
- */
- public static function get_settings_fields() {
- if ( ! empty( self::$cached_settings_fields ) ) {
- return self::$cached_settings_fields;
- }
-
- // retrieve openai key from the DB.
- // we can't use Mind Settings API as it will result a stack trace error.
- $openai_key = false;
- $general_settings = get_option( 'mind_general' );
- if ( isset( $general_settings['openai_key'] ) ) {
- $openai_key = $general_settings['openai_key'];
- }
-
- $settings_fields = [
- 'mind_general' => [
- [
- 'name' => 'openai_key',
- 'label' => esc_html__( 'OpenAI API Key', 'mind' ),
- 'desc' => esc_html__( 'This setting is required, since our plugin works with OpenAI.', 'mind' ) . ' Create API key',
- 'type' => $openai_key ? 'password' : 'text',
- 'default' => '',
- ],
- ],
- ];
-
- self::$cached_settings_fields = apply_filters( 'mind_settings_fields', $settings_fields );
-
- return self::$cached_settings_fields;
- }
-
- /**
- * The plugin page handler
- *
- * @return void
- */
- public static function print_settings_page() {
- self::$settings_api->admin_enqueue_scripts();
-
- echo '';
- echo '
' . esc_html__( 'Settings', 'mind' ) . '
';
-
- self::$settings_api->show_navigation();
- self::$settings_api->show_forms();
-
- echo '';
-
- ?>
-
- plugin_path . 'classes/class-settings.php';
require_once $this->plugin_path . 'classes/class-admin.php';
require_once $this->plugin_path . 'classes/class-assets.php';
require_once $this->plugin_path . 'classes/class-rest.php';
diff --git a/src/_variables.scss b/src/_variables.scss
new file mode 100644
index 0000000..e51c0b5
--- /dev/null
+++ b/src/_variables.scss
@@ -0,0 +1,5 @@
+:root {
+ --mind-brand-color: #e455df;
+ --mind-brand-darken-color: #bb56df;
+ --mind-brand-color-2: #4376ec;
+}
diff --git a/src/admin/index.js b/src/admin/index.js
new file mode 100644
index 0000000..8ba568f
--- /dev/null
+++ b/src/admin/index.js
@@ -0,0 +1,125 @@
+/**
+ * Styles
+ */
+import './style.scss';
+
+/**
+ * External dependencies
+ */
+import clsx from 'clsx';
+
+/**
+ * WordPress dependencies
+ */
+import { __ } from '@wordpress/i18n';
+import { render, useEffect } from '@wordpress/element';
+import { useSelect, useDispatch } from '@wordpress/data';
+
+/**
+ * Internal dependencies
+ */
+import './store/admin';
+import './store/settings';
+
+import pages from './pages';
+import { ReactComponent as MindLogoIcon } from '../icons/mind-logo.svg';
+
+function PageWrapper() {
+ const { setActivePage } = useDispatch('mind/admin');
+
+ const { activePage } = useSelect((select) => {
+ const { getActivePage } = select('mind/admin');
+
+ return {
+ activePage: getActivePage(),
+ };
+ });
+
+ useEffect(() => {
+ // disable active links.
+ document
+ .querySelectorAll('.toplevel_page_mind .current')
+ .forEach(($el) => {
+ $el.classList.remove('current');
+ });
+
+ // find new active link.
+ let $links = document.querySelectorAll(
+ `.toplevel_page_mind [href="admin.php?page=mind&sub_page=${activePage}"]`
+ );
+
+ if (!$links || !$links.length) {
+ $links = document.querySelectorAll(
+ '.toplevel_page_mind [href="admin.php?page=mind"]'
+ );
+ }
+
+ $links.forEach(($link) => {
+ $link.parentNode.classList.add('current');
+ });
+
+ // Change body class.
+ document.body.classList.forEach((className) => {
+ if (/mind-admin-page-/.test(className)) {
+ document.body.classList.remove(className);
+ }
+ });
+ document.body.classList.add(`mind-admin-page-${activePage}`);
+
+ // change address bar link
+ if ($links && $links.length) {
+ window.history.pushState(
+ document.title,
+ document.title,
+ $links[0].href
+ );
+ }
+ }, [activePage]);
+
+ const resultTabs = [];
+ let resultContent = '';
+
+ Object.keys(pages).forEach((k) => {
+ resultTabs.push(
+
+ {/* eslint-disable-next-line react/button-has-type */}
+
+
+ );
+ });
+
+ if (activePage && pages[activePage]) {
+ const NewBlock = pages[activePage].block;
+
+ resultContent = ;
+ }
+
+ return (
+ <>
+
+
+
+
+
{__('Mind', 'mind')}
+
+
+
+
+ {resultContent}
+ >
+ );
+}
+
+window.addEventListener('load', () => {
+ render(, document.querySelector('.mind-admin-root'));
+});
diff --git a/src/admin/page-settings/index.js b/src/admin/page-settings/index.js
new file mode 100644
index 0000000..758be45
--- /dev/null
+++ b/src/admin/page-settings/index.js
@@ -0,0 +1,99 @@
+/**
+ * Styles
+ */
+import './style.scss';
+
+/**
+ * WordPress dependencies
+ */
+// eslint-disable-next-line import/no-extraneous-dependencies
+import { isEqual } from 'lodash';
+import { useState, useEffect } from '@wordpress/element';
+import { useSelect, useDispatch } from '@wordpress/data';
+import { __ } from '@wordpress/i18n';
+
+/**
+ * Internal dependencies
+ */
+import { ReactComponent as LoadingIcon } from '../../icons/loading.svg';
+
+export default function PageSettings() {
+ const [pendingSettings, setPendingSettings] = useState({});
+ const [settingsChanged, setSettingsChanged] = useState(false);
+
+ const { updateSettings } = useDispatch('mind/settings');
+
+ const { settings, updating, error } = useSelect((select) => {
+ const settingsSelect = select('mind/settings');
+
+ return {
+ settings: settingsSelect.getSettings(),
+ updating: settingsSelect.getUpdating(),
+ error: settingsSelect.getError(),
+ };
+ });
+
+ // Update pending settings from actual settings object.
+ useEffect(() => {
+ setPendingSettings(settings);
+ }, [settings]);
+
+ // Check if settings changed.
+ useEffect(() => {
+ setSettingsChanged(!isEqual(settings, pendingSettings));
+ }, [settings, pendingSettings]);
+
+ return (
+ <>
+
+
+
+
+
+
+ {
+ e.preventDefault();
+ setPendingSettings({
+ ...pendingSettings,
+ openai_api_key: e.target.value,
+ });
+ }}
+ />
+
+
+ {error && {error}
}
+
+
+
+ >
+ );
+}
diff --git a/src/admin/page-settings/style.scss b/src/admin/page-settings/style.scss
new file mode 100644
index 0000000..eb1fdf7
--- /dev/null
+++ b/src/admin/page-settings/style.scss
@@ -0,0 +1,102 @@
+.mind-admin-page-settings .mind-admin-content {
+ max-width: 700px;
+}
+
+.mind-admin-settings-card {
+ display: flex;
+ gap: 20px;
+
+ .mind-admin-settings-card-name {
+ flex: 1;
+ max-width: 250px;
+
+ label {
+ display: block;
+ margin-top: 8px;
+ font-size: 18px;
+ font-weight: 300;
+ }
+ }
+ .mind-admin-settings-card-description {
+ font-size: 12px;
+ margin-top: 16px;
+ color: #646464;
+ }
+
+ .mind-admin-settings-card-input {
+ flex: 1;
+
+ input {
+ width: 100%;
+ padding: 6px 15px;
+ font-size: 1em;
+ border: 1px solid #000;
+ border-radius: 7px;
+
+ &:focus {
+ box-shadow: 0 0 0 2px rgba(#000, 30%);
+ outline: 2px solid transparent;
+ }
+ }
+ }
+}
+
+.mind-admin-settings-error {
+ padding: 20px;
+ margin-top: 20px;
+ margin-bottom: -20px;
+ background-color: #faf4f4;
+ color: #e74f4f;
+ border-left: 3px solid #e74f4f;
+}
+
+.mind-admin-settings-actions {
+ margin-top: 50px;
+
+ button {
+ display: inline-flex;
+ align-items: center;
+ gap: 10px;
+ padding: 10px 18px;
+ border-radius: 7px;
+ background-color: #000;
+ border: 1px solid #000;
+ color: #fff;
+ cursor: pointer;
+
+ &:hover,
+ &:focus {
+ background-color: #303030;
+ }
+
+ &:focus {
+ box-shadow: 0 0 0 2px rgba(#000, 30%);
+ outline: 2px solid transparent;
+ }
+
+ &:disabled {
+ border: 1px solid #bfbfbf;
+ background-color: #dcdcdc;
+ color: #000;
+ opacity: 0.3;
+ pointer-events: none;
+ }
+
+ svg {
+ width: 20px;
+ height: auto;
+ margin: -5px;
+ margin-left: 0;
+ animation: 1s mind-settings-loading-icon infinite linear;
+ }
+ }
+}
+
+@keyframes mind-settings-loading-icon {
+ 0% {
+ transform: rotate(0);
+ }
+ 100% {
+ transform: rotate(360deg);
+ }
+}
diff --git a/src/admin/page-welcome/index.js b/src/admin/page-welcome/index.js
new file mode 100644
index 0000000..9ae88f5
--- /dev/null
+++ b/src/admin/page-welcome/index.js
@@ -0,0 +1,45 @@
+/**
+ * Styles
+ */
+import './style.scss';
+
+/**
+ * WordPress dependencies
+ */
+import { __, sprintf } from '@wordpress/i18n';
+import { useDispatch } from '@wordpress/data';
+
+export default function PageWelcome() {
+ const { setActivePage } = useDispatch('mind/admin');
+
+ return (
+ <>
+ Mind`
+ ),
+ }}
+ />
+
+ {__(
+ 'I am an AI assistant designed to help you in writing content for your blog',
+ 'mind'
+ )}
+
+
+ {__('To get started, enter your', 'mind')}
+
+
+ >
+ );
+}
diff --git a/src/admin/page-welcome/style.scss b/src/admin/page-welcome/style.scss
new file mode 100644
index 0000000..6c75769
--- /dev/null
+++ b/src/admin/page-welcome/style.scss
@@ -0,0 +1,49 @@
+.mind-admin-page-welcome {
+ .mind-inline-logo {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ gap: 12px;
+ vertical-align: bottom;
+ letter-spacing: 0;
+ font-size: 0.95em;
+
+ // Gradient.
+ @supports (-webkit-background-clip: text) {
+ background: linear-gradient(to right, var(--mind-brand-color), var(--mind-brand-color-2));
+ background-clip: text;
+ -webkit-text-fill-color: transparent;
+ }
+ }
+
+ .mind-admin-content {
+ display: flex;
+ flex-direction: column;
+ gap: 25px;
+
+ > * {
+ margin: 0;
+ font-size: 40px;
+ font-weight: 300;
+ line-height: 1.3;
+ }
+
+ p {
+ letter-spacing: 0.03em;
+ }
+
+ button {
+ border: none;
+ background: none;
+ cursor: pointer;
+ margin-left: 8px;
+
+ // Gradient.
+ @supports (-webkit-background-clip: text) {
+ background: linear-gradient(to right, var(--mind-brand-color), var(--mind-brand-color-2));
+ background-clip: text;
+ -webkit-text-fill-color: transparent;
+ }
+ }
+ }
+}
diff --git a/src/admin/pages/index.js b/src/admin/pages/index.js
new file mode 100644
index 0000000..b4df599
--- /dev/null
+++ b/src/admin/pages/index.js
@@ -0,0 +1,21 @@
+/**
+ * WordPress dependencies
+ */
+import { __ } from '@wordpress/i18n';
+
+/**
+ * Internal dependencies
+ */
+import PageWelcome from '../page-welcome';
+import PageSettings from '../page-settings';
+
+export default {
+ welcome: {
+ label: __('Welcome', 'mind'),
+ block: PageWelcome,
+ },
+ settings: {
+ label: __('Settings', 'mind'),
+ block: PageSettings,
+ },
+};
diff --git a/src/admin/store/admin/actions.js b/src/admin/store/admin/actions.js
new file mode 100644
index 0000000..090c1d8
--- /dev/null
+++ b/src/admin/store/admin/actions.js
@@ -0,0 +1,6 @@
+export function setActivePage(activePage) {
+ return {
+ type: 'SET_ACTIVE_PAGE',
+ activePage,
+ };
+}
diff --git a/src/admin/store/admin/index.js b/src/admin/store/admin/index.js
new file mode 100644
index 0000000..e66624b
--- /dev/null
+++ b/src/admin/store/admin/index.js
@@ -0,0 +1,19 @@
+/**
+ * Internal dependencies
+ */
+import reducer from './reducer';
+import * as actions from './actions';
+import * as selectors from './selectors';
+
+/**
+ * WordPress dependencies
+ */
+import { createReduxStore, register } from '@wordpress/data';
+
+const store = createReduxStore('mind/admin', {
+ reducer,
+ actions,
+ selectors,
+});
+
+register(store);
diff --git a/src/admin/store/admin/reducer.js b/src/admin/store/admin/reducer.js
new file mode 100644
index 0000000..f4a3e30
--- /dev/null
+++ b/src/admin/store/admin/reducer.js
@@ -0,0 +1,32 @@
+/**
+ * Internal dependencies
+ */
+import pages from '../../pages';
+
+// get variable.
+const $_GET = [];
+window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, (a, name, value) => {
+ $_GET[name] = value;
+});
+
+function reducer(
+ state = {
+ activePage: $_GET.sub_page || Object.keys(pages)[0],
+ },
+ action = {}
+) {
+ switch (action.type) {
+ case 'SET_ACTIVE_PAGE':
+ if (state.activePage !== action.activePage) {
+ return {
+ ...state,
+ activePage: action.activePage,
+ };
+ }
+ break;
+ }
+
+ return state;
+}
+
+export default reducer;
diff --git a/src/admin/store/admin/selectors.js b/src/admin/store/admin/selectors.js
new file mode 100644
index 0000000..456226a
--- /dev/null
+++ b/src/admin/store/admin/selectors.js
@@ -0,0 +1,3 @@
+export function getActivePage(state) {
+ return state?.activePage || '';
+}
diff --git a/src/admin/store/settings/actions.js b/src/admin/store/settings/actions.js
new file mode 100644
index 0000000..abaae57
--- /dev/null
+++ b/src/admin/store/settings/actions.js
@@ -0,0 +1,39 @@
+/**
+ * WordPress dependencies.
+ */
+import { __ } from '@wordpress/i18n';
+import apiFetch from '@wordpress/api-fetch';
+
+export function updateSettings(settings) {
+ return ({ dispatch }) => {
+ if (!settings || !Object.keys(settings).length) {
+ return;
+ }
+
+ dispatch({ type: 'UPDATE_SETTINGS_PENDING' });
+
+ const data = { settings };
+
+ apiFetch({
+ path: '/mind/v1/update_settings',
+ method: 'POST',
+ data,
+ })
+ .then((res) => {
+ dispatch({
+ type: 'UPDATE_SETTINGS_SUCCESS',
+ settings,
+ });
+ return res.response;
+ })
+ .catch((err) => {
+ dispatch({
+ type: 'UPDATE_SETTINGS_ERROR',
+ error:
+ err?.response ||
+ err?.error_code ||
+ __('Something went wrong, please, try again…', 'mind'),
+ });
+ });
+ };
+}
diff --git a/src/admin/store/settings/index.js b/src/admin/store/settings/index.js
new file mode 100644
index 0000000..ba97f61
--- /dev/null
+++ b/src/admin/store/settings/index.js
@@ -0,0 +1,19 @@
+/**
+ * Internal dependencies
+ */
+import reducer from './reducer';
+import * as actions from './actions';
+import * as selectors from './selectors';
+
+/**
+ * WordPress dependencies
+ */
+import { createReduxStore, register } from '@wordpress/data';
+
+const store = createReduxStore('mind/settings', {
+ reducer,
+ actions,
+ selectors,
+});
+
+register(store);
diff --git a/src/admin/store/settings/reducer.js b/src/admin/store/settings/reducer.js
new file mode 100644
index 0000000..25e1113
--- /dev/null
+++ b/src/admin/store/settings/reducer.js
@@ -0,0 +1,37 @@
+const { settings } = window.mindAdminData;
+
+function reducer(
+ state = {
+ settings,
+ updating: false,
+ error: '',
+ },
+ action = {}
+) {
+ switch (action.type) {
+ case 'UPDATE_SETTINGS_PENDING':
+ return {
+ ...state,
+ updating: true,
+ };
+ case 'UPDATE_SETTINGS_SUCCESS':
+ return {
+ ...state,
+ updating: false,
+ settings: {
+ ...state.settings,
+ ...action.settings,
+ },
+ };
+ case 'UPDATE_SETTINGS_ERROR':
+ return {
+ ...state,
+ updating: false,
+ error: action.error || '',
+ };
+ }
+
+ return state;
+}
+
+export default reducer;
diff --git a/src/admin/store/settings/selectors.js b/src/admin/store/settings/selectors.js
new file mode 100644
index 0000000..99705c4
--- /dev/null
+++ b/src/admin/store/settings/selectors.js
@@ -0,0 +1,15 @@
+export function getSettings(state) {
+ return state?.settings || {};
+}
+
+export function getSetting(state, name) {
+ return state?.settings[name] || '';
+}
+
+export function getUpdating(state) {
+ return state?.updating || false;
+}
+
+export function getError(state) {
+ return state?.error || false;
+}
diff --git a/src/admin/style.scss b/src/admin/style.scss
new file mode 100644
index 0000000..4a15605
--- /dev/null
+++ b/src/admin/style.scss
@@ -0,0 +1,151 @@
+@import "../variables";
+
+$offset: 15px;
+
+.mind-admin-page {
+ background-color: #1d2327;
+
+ #wpcontent {
+ min-height: calc(100vh - var(--wp-admin--admin-bar--height, 0) - $offset);
+ border-radius: 10px;
+ margin-right: $offset;
+ margin-bottom: $offset;
+ background-color: #fff;
+ }
+ #wpfooter {
+ bottom: $offset;
+ right: $offset;
+ }
+ ul#adminmenu a.wp-has-current-submenu::after,
+ ul#adminmenu > li.current > a.current::after {
+ border-right-color: #fff;
+ }
+}
+
+.mind-admin-root {
+ color: #000;
+}
+
+.mind-admin-head {
+ position: sticky;
+ top: var(--wp-admin--admin-bar--height, 0);
+ padding: 5px 20px;
+ margin-left: -20px;
+ margin-bottom: 100px;
+}
+
+.mind-admin-head-container {
+ display: flex;
+ flex-wrap: wrap;
+ align-items: center;
+ // max-width: 1200px;
+ margin: 0 auto;
+}
+
+.mind-admin-head-logo {
+ display: flex;
+ flex-wrap: wrap;
+ align-items: center;
+ margin-right: auto;
+
+ h1 {
+ margin: 6px 10px;
+ font-size: 14px;
+ font-weight: 500;
+ }
+
+ svg {
+ display: block;
+ width: 20px;
+ height: auto;
+ color: var(--mind-brand-color);
+ }
+
+ // Gradient.
+ @supports (-webkit-background-clip: text) {
+ background: linear-gradient(to right, var(--mind-brand-color), var(--mind-brand-color-2));
+ background-clip: text;
+ -webkit-text-fill-color: transparent;
+ }
+}
+
+.mind-admin-content {
+ max-width: 1000px;
+ margin: 0 auto;
+
+ > h2 {
+ margin-bottom: 35px;
+ font-size: 1.8em;
+ font-weight: 400;
+ }
+}
+
+.mind-admin-tabs {
+ display: flex;
+ flex-wrap: wrap;
+ margin: 0;
+ margin-left: 15px;
+ list-style: none;
+
+ > li {
+ margin: 0;
+ }
+
+ button {
+ position: relative;
+ padding: 10px;
+ margin: 0 2px;
+ font-size: 1.1em;
+ cursor: pointer;
+ background: none;
+ border: none;
+ outline: none;
+
+ &:hover,
+ &:focus {
+ color: var(--mind-brand-darken-color);
+ }
+
+ &.mind-admin-tabs-button-active::after {
+ content: "";
+ position: absolute;
+ right: 4px;
+ bottom: 2px;
+ left: 4px;
+ display: block;
+ height: 1.5px;
+ background: currentColor;
+ }
+ }
+}
+
+
+// .visible .sc-6c118e8c-6 {
+// animation-range-start: normal;
+// animation-range-end: normal;
+// animation: 4.1s ease-out 1 normal forwards running fbvaXF auto normal normal;
+
+// ///
+// ///
+// animation-duration: 4.1s;
+// animation-timing-function: ease-out;
+// animation-iteration-count: 1;
+// animation-direction: normal;
+// animation-fill-mode: forwards;
+// animation-play-state: running;
+// animation-name: fbvaXF;
+// animation-timeline: auto;
+// animation-range: normal;
+// animation-delay: calc(var(--base-delay) + 600ms);
+// }
+
+// .NXHGL > * {
+// grid-row: 1 / 1;
+// grid-column: 1 / 1;
+// }
+// .kGaiuY {
+// opacity: 0;
+// filter: blur(160px);
+// transform: translateZ(0);
+// background: conic-gradient(from 230.29deg at 51.63% 52.16%, rgb(36, 0, 255) 0deg, rgb(0, 135, 255) 67.5deg, rgb(108, 39, 157) 198.75deg, rgb(24, 38, 163) 251.25deg, rgb(54, 103, 196) 301.88deg, rgb(105, 30, 255) 360deg);
+// }
diff --git a/src/components/editor-styles/index.js b/src/editor/components/editor-styles/index.js
similarity index 100%
rename from src/components/editor-styles/index.js
rename to src/editor/components/editor-styles/index.js
diff --git a/src/extensions/block-toolbar/index.js b/src/editor/extensions/block-toolbar/index.js
similarity index 88%
rename from src/extensions/block-toolbar/index.js
rename to src/editor/extensions/block-toolbar/index.js
index e7d0119..8150bf3 100644
--- a/src/extensions/block-toolbar/index.js
+++ b/src/editor/extensions/block-toolbar/index.js
@@ -22,17 +22,17 @@ import {
/**
* Internal dependencies
*/
-import { ReactComponent as ArrowRightIcon } from '../../icons/arrow-right.svg';
-import { ReactComponent as AIImproveIcon } from '../../icons/ai-improve.svg';
-import { ReactComponent as AIFixSpellingIcon } from '../../icons/ai-fix-spelling.svg';
-import { ReactComponent as AIShorterIcon } from '../../icons/ai-shorter.svg';
-import { ReactComponent as AILongerIcon } from '../../icons/ai-longer.svg';
-import { ReactComponent as AISummarizeIcon } from '../../icons/ai-summarize.svg';
-import { ReactComponent as AIToneIcon } from '../../icons/ai-tone.svg';
-import { ReactComponent as AIParaphraseIcon } from '../../icons/ai-paraphrase.svg';
-import { ReactComponent as AITranslateIcon } from '../../icons/ai-translate.svg';
-import wrapEmoji from '../../utils/wrap-emoji';
-import TOOLBAR_ICON from '../../utils/icon';
+import { ReactComponent as ArrowRightIcon } from '../../../icons/arrow-right.svg';
+import { ReactComponent as AIImproveIcon } from '../../../icons/ai-improve.svg';
+import { ReactComponent as AIFixSpellingIcon } from '../../../icons/ai-fix-spelling.svg';
+import { ReactComponent as AIShorterIcon } from '../../../icons/ai-shorter.svg';
+import { ReactComponent as AILongerIcon } from '../../../icons/ai-longer.svg';
+import { ReactComponent as AISummarizeIcon } from '../../../icons/ai-summarize.svg';
+import { ReactComponent as AIToneIcon } from '../../../icons/ai-tone.svg';
+import { ReactComponent as AIParaphraseIcon } from '../../../icons/ai-paraphrase.svg';
+import { ReactComponent as AITranslateIcon } from '../../../icons/ai-translate.svg';
+import { ReactComponent as MindLogoIcon } from '../../../icons/mind-logo.svg';
+import wrapEmoji from '../../../utils/wrap-emoji';
const ALLOWED_BLOCKS = ['core/paragraph', 'core/heading'];
@@ -88,8 +88,9 @@ function Toolbar() {
return (
}
label={__('Mind', '@@text_domain')}
+ className="mind-toolbar-toggle"
popoverProps={{ className: 'mind-toolbar-dropdown' }}
>
{() => {
diff --git a/src/extensions/block-toolbar/style.scss b/src/editor/extensions/block-toolbar/style.scss
similarity index 87%
rename from src/extensions/block-toolbar/style.scss
rename to src/editor/extensions/block-toolbar/style.scss
index 595b2da..9341e00 100644
--- a/src/extensions/block-toolbar/style.scss
+++ b/src/editor/extensions/block-toolbar/style.scss
@@ -1,3 +1,7 @@
+.mind-toolbar-toggle svg {
+ color: var(--mind-brand-color);
+}
+
.mind-toolbar-dropdown {
--wp-admin-theme-color: var(--mind-brand-darken-color);
diff --git a/src/extensions/editor-styles/index.js b/src/editor/extensions/editor-styles/index.js
similarity index 100%
rename from src/extensions/editor-styles/index.js
rename to src/editor/extensions/editor-styles/index.js
diff --git a/src/extensions/paragraph/index.js b/src/editor/extensions/paragraph/index.js
similarity index 100%
rename from src/extensions/paragraph/index.js
rename to src/editor/extensions/paragraph/index.js
diff --git a/src/extensions/post-toolbar/index.js b/src/editor/extensions/post-toolbar/index.js
similarity index 94%
rename from src/extensions/post-toolbar/index.js
rename to src/editor/extensions/post-toolbar/index.js
index 6dfad6b..a642524 100644
--- a/src/extensions/post-toolbar/index.js
+++ b/src/editor/extensions/post-toolbar/index.js
@@ -13,7 +13,7 @@ import { throttle } from 'lodash';
/**
* Internal dependencies
*/
-import TOOLBAR_ICON from '../../utils/icon';
+import { ReactComponent as MindLogoIcon } from '../../../icons/mind-logo.svg';
const TOOLBAR_TOGGLE_CONTAINER_CLASS = 'mind-post-toolbar-toggle';
@@ -30,7 +30,7 @@ function Toggle() {
toggle();
}}
>
- {TOOLBAR_ICON}
+
{__('Open Mind', '@@text_domain')}
);
diff --git a/src/extensions/post-toolbar/style.scss b/src/editor/extensions/post-toolbar/style.scss
similarity index 100%
rename from src/extensions/post-toolbar/style.scss
rename to src/editor/extensions/post-toolbar/style.scss
diff --git a/src/index.js b/src/editor/index.js
similarity index 100%
rename from src/index.js
rename to src/editor/index.js
diff --git a/src/popup/components/content/index.js b/src/editor/popup/components/content/index.js
similarity index 91%
rename from src/popup/components/content/index.js
rename to src/editor/popup/components/content/index.js
index 59c36ca..bdb32a8 100644
--- a/src/popup/components/content/index.js
+++ b/src/editor/popup/components/content/index.js
@@ -13,12 +13,12 @@ import { Button } from '@wordpress/components';
*/
import LoadingText from '../loading-text';
import Notice from '../notice';
-import { ReactComponent as PopupPostTitleAboutIcon } from '../../../icons/popup-post-title-about.svg';
-import { ReactComponent as PopupPostAboutIcon } from '../../../icons/popup-post-about.svg';
-import { ReactComponent as PopupOutlineAboutIcon } from '../../../icons/popup-outline-about.svg';
-import { ReactComponent as PopupParagraphAboutIcon } from '../../../icons/popup-paragraph-about.svg';
-import { ReactComponent as PopupListAboutIcon } from '../../../icons/popup-list-about.svg';
-import { ReactComponent as PopupTableAboutIcon } from '../../../icons/popup-table-about.svg';
+import { ReactComponent as PopupPostTitleAboutIcon } from '../../../../icons/popup-post-title-about.svg';
+import { ReactComponent as PopupPostAboutIcon } from '../../../../icons/popup-post-about.svg';
+import { ReactComponent as PopupOutlineAboutIcon } from '../../../../icons/popup-outline-about.svg';
+import { ReactComponent as PopupParagraphAboutIcon } from '../../../../icons/popup-paragraph-about.svg';
+import { ReactComponent as PopupListAboutIcon } from '../../../../icons/popup-list-about.svg';
+import { ReactComponent as PopupTableAboutIcon } from '../../../../icons/popup-table-about.svg';
const commands = [
{
diff --git a/src/popup/components/content/style.scss b/src/editor/popup/components/content/style.scss
similarity index 100%
rename from src/popup/components/content/style.scss
rename to src/editor/popup/components/content/style.scss
diff --git a/src/popup/components/footer/index.js b/src/editor/popup/components/footer/index.js
similarity index 100%
rename from src/popup/components/footer/index.js
rename to src/editor/popup/components/footer/index.js
diff --git a/src/popup/components/footer/style.scss b/src/editor/popup/components/footer/style.scss
similarity index 100%
rename from src/popup/components/footer/style.scss
rename to src/editor/popup/components/footer/style.scss
diff --git a/src/popup/components/input/index.js b/src/editor/popup/components/input/index.js
similarity index 95%
rename from src/popup/components/input/index.js
rename to src/editor/popup/components/input/index.js
index 400ba99..0297375 100644
--- a/src/popup/components/input/index.js
+++ b/src/editor/popup/components/input/index.js
@@ -11,7 +11,7 @@ import { useSelect, useDispatch } from '@wordpress/data';
/**
* Internal dependencies
*/
-import TOOLBAR_ICON from '../../../utils/icon';
+import { ReactComponent as MindLogoIcon } from '../../../../icons/mind-logo.svg';
export default function Input(props) {
const { onInsert } = props;
@@ -99,7 +99,7 @@ export default function Input(props) {
return (
- {TOOLBAR_ICON}
+
.components-base-control {
diff --git a/src/popup/components/loading-line/index.js b/src/editor/popup/components/loading-line/index.js
similarity index 100%
rename from src/popup/components/loading-line/index.js
rename to src/editor/popup/components/loading-line/index.js
diff --git a/src/popup/components/loading-line/style.scss b/src/editor/popup/components/loading-line/style.scss
similarity index 100%
rename from src/popup/components/loading-line/style.scss
rename to src/editor/popup/components/loading-line/style.scss
diff --git a/src/popup/components/loading-text/index.js b/src/editor/popup/components/loading-text/index.js
similarity index 100%
rename from src/popup/components/loading-text/index.js
rename to src/editor/popup/components/loading-text/index.js
diff --git a/src/popup/components/loading-text/style.scss b/src/editor/popup/components/loading-text/style.scss
similarity index 100%
rename from src/popup/components/loading-text/style.scss
rename to src/editor/popup/components/loading-text/style.scss
diff --git a/src/popup/components/not-connected-screen/index.js b/src/editor/popup/components/not-connected-screen/index.js
similarity index 92%
rename from src/popup/components/not-connected-screen/index.js
rename to src/editor/popup/components/not-connected-screen/index.js
index 244ca90..1a7deea 100644
--- a/src/popup/components/not-connected-screen/index.js
+++ b/src/editor/popup/components/not-connected-screen/index.js
@@ -12,7 +12,7 @@ import { useSelect } from '@wordpress/data';
/**
* Internal dependencies
*/
-import { ReactComponent as KeyIcon } from '../../../icons/key.svg';
+import { ReactComponent as KeyIcon } from '../../../../icons/key.svg';
export default function NotConnectedScreen() {
const { settingsPageURL } = useSelect((select) => {
diff --git a/src/popup/components/not-connected-screen/style.scss b/src/editor/popup/components/not-connected-screen/style.scss
similarity index 100%
rename from src/popup/components/not-connected-screen/style.scss
rename to src/editor/popup/components/not-connected-screen/style.scss
diff --git a/src/popup/components/notice/index.js b/src/editor/popup/components/notice/index.js
similarity index 100%
rename from src/popup/components/notice/index.js
rename to src/editor/popup/components/notice/index.js
diff --git a/src/popup/components/notice/style.scss b/src/editor/popup/components/notice/style.scss
similarity index 100%
rename from src/popup/components/notice/style.scss
rename to src/editor/popup/components/notice/style.scss
diff --git a/src/popup/index.js b/src/editor/popup/index.js
similarity index 100%
rename from src/popup/index.js
rename to src/editor/popup/index.js
diff --git a/src/popup/style.scss b/src/editor/popup/style.scss
similarity index 100%
rename from src/popup/style.scss
rename to src/editor/popup/style.scss
diff --git a/src/store/blocks/actions.js b/src/editor/store/blocks/actions.js
similarity index 100%
rename from src/store/blocks/actions.js
rename to src/editor/store/blocks/actions.js
diff --git a/src/store/blocks/index.js b/src/editor/store/blocks/index.js
similarity index 100%
rename from src/store/blocks/index.js
rename to src/editor/store/blocks/index.js
diff --git a/src/store/blocks/reducer.js b/src/editor/store/blocks/reducer.js
similarity index 100%
rename from src/store/blocks/reducer.js
rename to src/editor/store/blocks/reducer.js
diff --git a/src/store/blocks/selectors.js b/src/editor/store/blocks/selectors.js
similarity index 100%
rename from src/store/blocks/selectors.js
rename to src/editor/store/blocks/selectors.js
diff --git a/src/store/core/index.js b/src/editor/store/core/index.js
similarity index 100%
rename from src/store/core/index.js
rename to src/editor/store/core/index.js
diff --git a/src/store/core/selectors.js b/src/editor/store/core/selectors.js
similarity index 100%
rename from src/store/core/selectors.js
rename to src/editor/store/core/selectors.js
diff --git a/src/store/popup/actions.js b/src/editor/store/popup/actions.js
similarity index 95%
rename from src/store/popup/actions.js
rename to src/editor/store/popup/actions.js
index 7bc0474..50d1109 100644
--- a/src/store/popup/actions.js
+++ b/src/editor/store/popup/actions.js
@@ -7,7 +7,7 @@ import apiFetch from '@wordpress/api-fetch';
/**
* Internal dependencies.
*/
-import getSelectedBlocksContent from '../../utils/get-selected-blocks-content';
+import getSelectedBlocksContent from '../../../utils/get-selected-blocks-content';
import { isConnected } from '../core/selectors';
export function open() {
diff --git a/src/store/popup/index.js b/src/editor/store/popup/index.js
similarity index 100%
rename from src/store/popup/index.js
rename to src/editor/store/popup/index.js
diff --git a/src/store/popup/reducer.js b/src/editor/store/popup/reducer.js
similarity index 97%
rename from src/store/popup/reducer.js
rename to src/editor/store/popup/reducer.js
index d3215bf..829a52c 100644
--- a/src/store/popup/reducer.js
+++ b/src/editor/store/popup/reducer.js
@@ -1,4 +1,4 @@
-import mdToHtml from '../../utils/md-to-html';
+import mdToHtml from '../../../utils/md-to-html';
function reducer(
state = {
diff --git a/src/store/popup/selectors.js b/src/editor/store/popup/selectors.js
similarity index 100%
rename from src/store/popup/selectors.js
rename to src/editor/store/popup/selectors.js
diff --git a/src/style.scss b/src/editor/style.scss
similarity index 63%
rename from src/style.scss
rename to src/editor/style.scss
index 9182941..899b484 100644
--- a/src/style.scss
+++ b/src/editor/style.scss
@@ -1,14 +1,11 @@
-:root {
- --mind-brand-color: #e455df;
- --mind-brand-darken-color: #bb56df;
-}
+@import "../variables";
// Gradients for logos.
@supports (-webkit-background-clip: text) {
.mind-post-toolbar-toggle button,
.mind-popup-footer-logo,
.mind-popup-connected-screen-button {
- background: linear-gradient(to right, #e455df, #4376ec);
+ background: linear-gradient(to right, var(--mind-brand-color), var(--mind-brand-color-2));
background-clip: text;
-webkit-text-fill-color: transparent;
}
diff --git a/src/icons/loading.svg b/src/icons/loading.svg
new file mode 100644
index 0000000..ab6e05e
--- /dev/null
+++ b/src/icons/loading.svg
@@ -0,0 +1,7 @@
+
\ No newline at end of file
diff --git a/src/icons/mind-logo.svg b/src/icons/mind-logo.svg
new file mode 100644
index 0000000..373a2ab
--- /dev/null
+++ b/src/icons/mind-logo.svg
@@ -0,0 +1,14 @@
+
\ No newline at end of file
diff --git a/src/utils/icon/index.js b/src/utils/icon/index.js
deleted file mode 100644
index debf4b3..0000000
--- a/src/utils/icon/index.js
+++ /dev/null
@@ -1,29 +0,0 @@
-import './style.scss';
-
-export default (
-
-);
diff --git a/src/utils/icon/style.scss b/src/utils/icon/style.scss
deleted file mode 100644
index f550745..0000000
--- a/src/utils/icon/style.scss
+++ /dev/null
@@ -1,5 +0,0 @@
-.mind-icon {
- color: var(--mind-brand-color);
- width: 20px;
- height: 20px;
-}
diff --git a/vendors/assets/conditionize/conditionize.min.js b/vendors/assets/conditionize/conditionize.min.js
deleted file mode 100644
index d55e575..0000000
--- a/vendors/assets/conditionize/conditionize.min.js
+++ /dev/null
@@ -1,7 +0,0 @@
-/*!
- * Name : Conditionize - jQuery conditions for forms
- * Version : 1.0.5
- * Author : nK
- * GitHub : https://github.com/nk-o/conditionize
- */!function(n){var o={};function r(t){if(o[t])return o[t].exports;var e=o[t]={i:t,l:!1,exports:{}};return n[t].call(e.exports,e,e.exports,r),e.l=!0,e.exports}r.m=n,r.c=o,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=0)}([function(t,e,n){t.exports=n(1)},function(t,e,n){"use strict";n.r(e);var r=n(2),o=n(3);function u(t){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function c(e,t){var n,o=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),o.push.apply(o,n)),o}function i(r){for(var t=1;t=":{eval:function(t,e){return e<=t},sort:d},"<":{eval:function(t,e){return t":{eval:function(t,e){return e=","<",">","&&","||","container","userOptions","instance","Constructor","TypeError","_classCallCheck","self","$container","defaults","selector","conditionAttr","checkDebounce","customToggle","onInit","onDestroy","onCheck","runCheck","init","protoProps","staticProps","find","hide","on","$items","each","$this","conditionString","attr","toString","conditionResult","checkCondition","str","tokens","match","parserRelations","token","stack","index","pop","compare","isNumeric","error","operator","arr","condition","isValidSelector","$listenTo","result","is","val","off","show","jQueryPlugin","res","oldJqPlugin","fn","conditionize","noConflict","throttle","delay","noTrailing","callback","debounceMode","timeoutID","cancelled","lastExec","clearExistingTimeout","clearTimeout","wrapper","elapsed","Date","now","exec","undefined","setTimeout","cancel","debounce","atBegin","global","win","window","g","Function"],"mappings":";;;;;IAAA,SAAAA,GAEA,IAAAC,EAAA,GAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAC,QAGA,IAAAC,EAAAJ,EAAAE,GAAA,CACAG,EAAAH,EACAI,GAAA,EACAH,QAAA,IAUA,OANAJ,EAAAG,GAAAK,KAAAH,EAAAD,QAAAC,EAAAA,EAAAD,QAAAF,GAGAG,EAAAE,GAAA,EAGAF,EAAAD,QAKAF,EAAAO,EAAAT,EAGAE,EAAAQ,EAAAT,EAGAC,EAAAS,EAAA,SAAAP,EAAAQ,EAAAC,GACAX,EAAAY,EAAAV,EAAAQ,IACAG,OAAAC,eAAAZ,EAAAQ,EAAA,CAAAK,YAAA,EAAAC,IAAAL,KAKAX,EAAAiB,EAAA,SAAAf,GACA,oBAAAgB,QAAAA,OAAAC,aACAN,OAAAC,eAAAZ,EAAAgB,OAAAC,YAAA,CAAAC,MAAA,WAEAP,OAAAC,eAAAZ,EAAA,aAAA,CAAAkB,OAAA,KAQApB,EAAAqB,EAAA,SAAAD,EAAAE,GAEA,GADA,EAAAA,IAAAF,EAAApB,EAAAoB,IACA,EAAAE,EAAA,OAAAF,EACA,GAAA,EAAAE,GAAA,iBAAAF,GAAAA,GAAAA,EAAAG,WAAA,OAAAH,EACA,IAAAI,EAAAX,OAAAY,OAAA,MAGA,GAFAzB,EAAAiB,EAAAO,GACAX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AO,IAAAX,GAAAH,EAAAU,EAKAG,KACA,IAAAZ,IAYAG,EAAAW,WAAAZ,EAhCA,WACAC,OAAAU,GA+BAD,OAAAC,IAAAX,EAAAH,EAAAU,EAAAV,KAMA,MAtEA,kBAAAC,IACAE,EAAAD,EACAA,EAAAD,EACAA,OAAAa,GAiEAL,EAAAO,OA1EA,WACAT,IACAF,GAAA,GA0EAI,EAoBA,SAAAQ,EAAAjB,EAAAkB,EAAAhB,GACA,YAAAY,IAAAZ,EAAAH,EAAAC,EAAAkB,GAAA,GAAAnB,EAAAC,EAAAE,GAAA,IAAAgB,GAxIA7L,EAAAiB,EAAAkB,GACAnC,EAAAS,EAAA0B,EAAA,WAAA,WAAA,OAAAuI,IACA1K,EAAAS,EAAA0B,EAAA,WAAA,WAAA,OAAAyJ,KA6IA,SAAAzL,EAAAD,EAAAF,IAEA,SAAA8L,GAAA,IAGAC,EADA,oBAAAC,OACAA,YACA,IAAAF,EACAA,EACA,oBAAAxE,KACAA,KAEA,GAGAnH,EAAAD,QAAA6L,IACAzL,KAAAgE,KAAAtE,EAAA,KAIA,SAAAG,EAAAD,GAEA,SAAAoC,EAAAC,GAAA,OAAAD,EAAA,mBAAApB,QAAA,iBAAAA,OAAAsB,SAAA,SAAAD,GAAA,cAAAA,GAAA,SAAAA,GAAA,OAAAA,GAAA,mBAAArB,QAAAqB,EAAAE,cAAAvB,QAAAqB,IAAArB,OAAAa,UAAA,gBAAAQ,IAAAA,GAEA,IAEA0J,EAAA,WACA,OAAA3H,KADA,GAIA,IAEA2H,EAAAA,GAAA,IAAAC,SAAA,cAAA,GACA,MAAA7H,GAEA,YAAA,oBAAA2H,OAAA,YAAA1J,EAAA0J,WAAAC,EAAAD,QAMA7L,EAAAD,QAAA+L","file":"conditionize.min.js","sourcesContent":["/*!\n * Name : Conditionize - jQuery conditions for forms\n * Version : 1.0.5\n * Author : nK \n * GitHub : https://github.com/nk-o/conditionize\n */\n/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// define __esModule on exports\n/******/ \t__webpack_require__.r = function(exports) {\n/******/ \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n/******/ \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n/******/ \t\t}\n/******/ \t\tObject.defineProperty(exports, '__esModule', { value: true });\n/******/ \t};\n/******/\n/******/ \t// create a fake namespace object\n/******/ \t// mode & 1: value is a module id, require it\n/******/ \t// mode & 2: merge all properties of value into the ns\n/******/ \t// mode & 4: return value when already ns object\n/******/ \t// mode & 8|1: behave like require\n/******/ \t__webpack_require__.t = function(value, mode) {\n/******/ \t\tif(mode & 1) value = __webpack_require__(value);\n/******/ \t\tif(mode & 8) return value;\n/******/ \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n/******/ \t\tvar ns = Object.create(null);\n/******/ \t\t__webpack_require__.r(ns);\n/******/ \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n/******/ \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n/******/ \t\treturn ns;\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\nmodule.exports = __webpack_require__(1);\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var throttle_debounce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);\n/* harmony import */ var global__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3);\n/* harmony import */ var global__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(global__WEBPACK_IMPORTED_MODULE_1__);\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n\n\nvar $ = global__WEBPACK_IMPORTED_MODULE_1__[\"window\"].jQuery;\nvar instanceID = 0; // https://gist.github.com/aaditmshah/6683499\n\n/* eslint-disable */\n\nfunction Parser(e) {\n this.table = e;\n}\n\nParser.prototype.parse = function (e) {\n for (var r = e.length, t = this.table, s = [], a = [], h = 0; r > h;) {\n var i = e[h++];\n\n switch (i) {\n case \"(\":\n a.unshift(i);\n break;\n\n case \")\":\n for (; a.length;) {\n var i = a.shift();\n if (\"(\" === i) break;\n s.push(i);\n }\n\n if (\"(\" !== i) throw new Error(\"Mismatched parentheses.\");\n break;\n\n default:\n if (t.hasOwnProperty(i)) {\n for (; a.length;) {\n var f = a[0];\n if (\"(\" === f) break;\n var n = t[i],\n o = n.precedence,\n c = t[f].precedence;\n if (o > c || o === c && \"right\" === n.associativity) break;\n s.push(a.shift());\n }\n\n a.unshift(i);\n } else s.push(i);\n\n }\n }\n\n for (; a.length;) {\n var i = a.shift();\n if (\"(\" === i) throw new Error(\"Mismatched parentheses.\");\n s.push(i);\n }\n\n return s;\n};\n/* eslint-enable */\n\n\nvar sortRelational = {\n precedence: 3,\n associativity: 'left'\n};\nvar sortEquality = {\n precedence: 2,\n associativity: 'left'\n}; // available relations\n\nvar relations = {\n '==': {\n eval: function _eval(a, b) {\n return a == b; // eslint-disable-line\n },\n sort: sortEquality\n },\n '!=': {\n eval: function _eval(a, b) {\n return a != b; // eslint-disable-line\n },\n sort: sortEquality\n },\n '===': {\n eval: function _eval(a, b) {\n return a === b;\n },\n sort: sortEquality\n },\n '!==': {\n eval: function _eval(a, b) {\n return a !== b;\n },\n sort: sortEquality\n },\n '*=': {\n eval: function _eval(a, b) {\n return a.indexOf(b) !== -1;\n },\n sort: sortEquality\n },\n '<=': {\n eval: function _eval(a, b) {\n return a <= b;\n },\n sort: sortRelational\n },\n '>=': {\n eval: function _eval(a, b) {\n return a >= b;\n },\n sort: sortRelational\n },\n '<': {\n eval: function _eval(a, b) {\n return a < b;\n },\n sort: sortRelational\n },\n '>': {\n eval: function _eval(a, b) {\n return a > b;\n },\n sort: sortRelational\n },\n '&&': {\n eval: function _eval(a, b) {\n return a && b;\n },\n sort: {\n precedence: 1,\n associativity: 'right'\n }\n },\n '||': {\n eval: function _eval(a, b) {\n return a || b;\n },\n sort: {\n precedence: 0,\n associativity: 'right'\n }\n }\n}; // Conditionize class\n\nvar Conditionize = /*#__PURE__*/function () {\n function Conditionize(container, userOptions) {\n _classCallCheck(this, Conditionize);\n\n var self = this;\n self.instanceID = instanceID++;\n self.$container = $(container);\n self.defaults = {\n selector: '[data-cond]',\n conditionAttr: 'data-cond',\n checkDebounce: 150,\n // custom toggle function\n customToggle: null,\n // function( $item, show ) { $item[ show ? 'show' : 'hide' ](); }\n // events\n onInit: null,\n // function() {}\n onDestroy: null,\n // function() {}\n onCheck: null // function( $item, show ) {}\n\n };\n self.options = _objectSpread(_objectSpread({}, self.defaults), userOptions);\n self.runCheck = Object(throttle_debounce__WEBPACK_IMPORTED_MODULE_0__[\"debounce\"])(self.options.checkDebounce, self.runCheck);\n self.init();\n }\n\n _createClass(Conditionize, [{\n key: \"init\",\n value: function init() {\n var self = this; // hide all controls by default\n\n if (self.options.customToggle) {\n self.options.customToggle.call(self, self.$container.find(self.options.selector), false);\n } else {\n self.$container.find(self.options.selector).hide();\n } // event listener\n\n\n self.$container.on('change.conditionize', 'input, select, textarea', function () {\n self.runCheck(self.$container.find(self.options.selector));\n });\n self.runCheck(self.$container.find(self.options.selector)); // call onInit event\n\n if (self.options.onInit) {\n self.options.onInit.call(self);\n }\n }\n }, {\n key: \"runCheck\",\n value: function runCheck($items) {\n var self = this;\n $items.each(function () {\n var $this = $(this);\n var conditionString = $this.attr(self.options.conditionAttr).toString();\n var conditionResult = self.checkCondition(conditionString);\n\n if (self.options.customToggle) {\n self.options.customToggle.call(self, $this, conditionResult);\n } else {\n $this[conditionResult ? 'show' : 'hide']();\n }\n\n if (self.options.onCheck) {\n self.options.onCheck($this, conditionResult);\n }\n });\n } // parse condition\n\n }, {\n key: \"checkCondition\",\n value: function checkCondition(str) {\n var self = this;\n var tokens = str.match(/[^\\s]+/g);\n var token;\n var parserRelations = {};\n Object.keys(relations).forEach(function (k) {\n parserRelations[k] = relations[k].sort;\n });\n var parser = new Parser(parserRelations);\n tokens = parser.parse(tokens);\n var stack = [];\n var index = 0;\n\n while (index < tokens.length) {\n token = tokens[index++];\n\n if (token in relations) {\n var b = stack.pop();\n var a = stack.pop();\n stack.push([a, token, b]);\n } else {\n stack.push(token);\n }\n }\n\n return self.compare(stack.length && stack[0]);\n } // check if is valid jquery selector\n\n }, {\n key: \"isValidSelector\",\n value: function isValidSelector(selector) {\n if (typeof selector !== 'string' || $.isNumeric(selector) || selector === 'false' || selector === 'true' || selector == false // eslint-disable-line\n || selector == true // eslint-disable-line\n ) {\n return false;\n }\n\n try {\n $(selector);\n } catch (error) {\n return false;\n }\n\n return true;\n } // eval\n\n }, {\n key: \"condition\",\n value: function condition(a, operator, b) {\n if (operator in relations) {\n if (a === 'false') {\n a = false;\n } else if (a === 'true') {\n a = true;\n }\n\n if (b === 'false') {\n b = false;\n } else if (b === 'true') {\n b = true;\n }\n\n return relations[operator].eval(a, b);\n }\n\n return false;\n } // compare items\n\n }, {\n key: \"compare\",\n value: function compare(arr) {\n var self = this;\n\n if (arr instanceof Array) {\n if (arr.length === 3) {\n arr[0] = self.compare(arr[0]);\n\n if (arr[2] instanceof Array) {\n arr[2] = self.compare(arr[2]);\n }\n\n return self.condition(arr[0], arr[1], arr[2]);\n }\n\n return arr.length === 1 ? self.compare(arr[0]) : false;\n }\n\n if (self.isValidSelector(arr)) {\n var $listenTo = $(arr);\n var result = false;\n\n if ($listenTo.is('[type=checkbox]')) {\n result = $listenTo.is(':checked');\n } else if ($listenTo.is('[type=radio]')) {\n result = $listenTo.filter(':checked').val();\n } else if ($listenTo.is('textarea, select, input')) {\n result = $listenTo.val();\n }\n\n return result;\n }\n\n return arr;\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n var self = this; // call onDestroy event\n\n if (self.options.onDestroy) {\n self.options.onDestroy.call(self);\n } // disable event.\n\n\n self.$container.off('change.conditionize'); // show all controls\n\n if (self.options.customToggle) {\n self.options.customToggle.call(self, self.$container.find(self.options.selector), true);\n } else {\n self.$container.find(self.options.selector).show();\n } // delete Conditionize instance from container\n\n\n delete self.$container.Conditionize;\n }\n }]);\n\n return Conditionize;\n}(); // global definition\n\n\nvar plugin = function plugin(items) {\n // check for dom element\n // thanks: http://stackoverflow.com/questions/384286/javascript-isdom-how-do-you-check-if-a-javascript-object-is-a-dom-object\n if ((typeof HTMLElement === \"undefined\" ? \"undefined\" : _typeof(HTMLElement)) === 'object' ? items instanceof HTMLElement : items && _typeof(items) === 'object' && items !== null && items.nodeType === 1 && typeof items.nodeName === 'string') {\n items = [items];\n }\n\n var options = arguments[1];\n var args = Array.prototype.slice.call(arguments, 2);\n var len = items.length;\n var k = 0;\n var ret;\n\n for (k; k < len; k++) {\n if (_typeof(options) === 'object' || typeof options === 'undefined') {\n if (!items[k].Conditionize) {\n // eslint-disable-next-line new-cap\n items[k].Conditionize = new Conditionize(items[k], options);\n }\n } else if (items[k].Conditionize) {\n // eslint-disable-next-line prefer-spread\n ret = items[k].Conditionize[options].apply(items[k].Conditionize, args);\n }\n\n if (typeof ret !== 'undefined') {\n return ret;\n }\n }\n\n return items;\n};\n\nplugin.constructor = Conditionize;\nglobal__WEBPACK_IMPORTED_MODULE_1__[\"window\"].Conditionize = Conditionize;\n\nvar jQueryPlugin = function jQueryPlugin() {\n var args = arguments || [];\n Array.prototype.unshift.call(args, this);\n var res = plugin.apply(global__WEBPACK_IMPORTED_MODULE_1__[\"window\"], args);\n return _typeof(res) !== 'object' ? res : this;\n};\n\njQueryPlugin.constructor = plugin.constructor; // no conflict\n\nvar oldJqPlugin = $.fn.conditionize;\n$.fn.conditionize = jQueryPlugin;\n\n$.fn.conditionize.noConflict = function () {\n $.fn.conditionize = oldJqPlugin;\n return this;\n};\n\n/***/ }),\n/* 2 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"throttle\", function() { return throttle; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"debounce\", function() { return debounce; });\n/* eslint-disable no-undefined,no-param-reassign,no-shadow */\n\n/**\n * Throttle execution of a function. Especially useful for rate limiting\n * execution of handlers on events like resize and scroll.\n *\n * @param {Number} delay A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.\n * @param {Boolean} [noTrailing] Optional, defaults to false. If noTrailing is true, callback will only execute every `delay` milliseconds while the\n * throttled-function is being called. If noTrailing is false or unspecified, callback will be executed one final time\n * after the last throttled-function call. (After the throttled-function has not been called for `delay` milliseconds,\n * the internal counter is reset)\n * @param {Function} callback A function to be executed after delay milliseconds. The `this` context and all arguments are passed through, as-is,\n * to `callback` when the throttled-function is executed.\n * @param {Boolean} [debounceMode] If `debounceMode` is true (at begin), schedule `clear` to execute after `delay` ms. If `debounceMode` is false (at end),\n * schedule `callback` to execute after `delay` ms.\n *\n * @return {Function} A new, throttled, function.\n */\nfunction throttle(delay, noTrailing, callback, debounceMode) {\n /*\n * After wrapper has stopped being called, this timeout ensures that\n * `callback` is executed at the proper times in `throttle` and `end`\n * debounce modes.\n */\n var timeoutID;\n var cancelled = false; // Keep track of the last time `callback` was executed.\n\n var lastExec = 0; // Function to clear existing timeout\n\n function clearExistingTimeout() {\n if (timeoutID) {\n clearTimeout(timeoutID);\n }\n } // Function to cancel next exec\n\n\n function cancel() {\n clearExistingTimeout();\n cancelled = true;\n } // `noTrailing` defaults to falsy.\n\n\n if (typeof noTrailing !== 'boolean') {\n debounceMode = callback;\n callback = noTrailing;\n noTrailing = undefined;\n }\n /*\n * The `wrapper` function encapsulates all of the throttling / debouncing\n * functionality and when executed will limit the rate at which `callback`\n * is executed.\n */\n\n\n function wrapper() {\n var self = this;\n var elapsed = Date.now() - lastExec;\n var args = arguments;\n\n if (cancelled) {\n return;\n } // Execute `callback` and update the `lastExec` timestamp.\n\n\n function exec() {\n lastExec = Date.now();\n callback.apply(self, args);\n }\n /*\n * If `debounceMode` is true (at begin) this is used to clear the flag\n * to allow future `callback` executions.\n */\n\n\n function clear() {\n timeoutID = undefined;\n }\n\n if (debounceMode && !timeoutID) {\n /*\n * Since `wrapper` is being called for the first time and\n * `debounceMode` is true (at begin), execute `callback`.\n */\n exec();\n }\n\n clearExistingTimeout();\n\n if (debounceMode === undefined && elapsed > delay) {\n /*\n * In throttle mode, if `delay` time has been exceeded, execute\n * `callback`.\n */\n exec();\n } else if (noTrailing !== true) {\n /*\n * In trailing throttle mode, since `delay` time has not been\n * exceeded, schedule `callback` to execute `delay` ms after most\n * recent execution.\n *\n * If `debounceMode` is true (at begin), schedule `clear` to execute\n * after `delay` ms.\n *\n * If `debounceMode` is false (at end), schedule `callback` to\n * execute after `delay` ms.\n */\n timeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay);\n }\n }\n\n wrapper.cancel = cancel; // Return the wrapper function.\n\n return wrapper;\n}\n/* eslint-disable no-undefined */\n\n/**\n * Debounce execution of a function. Debouncing, unlike throttling,\n * guarantees that a function is only executed a single time, either at the\n * very beginning of a series of calls, or at the very end.\n *\n * @param {Number} delay A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.\n * @param {Boolean} [atBegin] Optional, defaults to false. If atBegin is false or unspecified, callback will only be executed `delay` milliseconds\n * after the last debounced-function call. If atBegin is true, callback will be executed only at the first debounced-function call.\n * (After the throttled-function has not been called for `delay` milliseconds, the internal counter is reset).\n * @param {Function} callback A function to be executed after delay milliseconds. The `this` context and all arguments are passed through, as-is,\n * to `callback` when the debounced-function is executed.\n *\n * @return {Function} A new, debounced function.\n */\n\n\nfunction debounce(delay, atBegin, callback) {\n return callback === undefined ? throttle(delay, atBegin, false) : throttle(delay, callback, atBegin !== false);\n}\n\n\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/* WEBPACK VAR INJECTION */(function(global) {var win;\n\nif (typeof window !== \"undefined\") {\n win = window;\n} else if (typeof global !== \"undefined\") {\n win = global;\n} else if (typeof self !== \"undefined\") {\n win = self;\n} else {\n win = {};\n}\n\nmodule.exports = win;\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(4)))\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports) {\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nvar g; // This works in non-strict mode\n\ng = function () {\n return this;\n}();\n\ntry {\n // This works if eval is allowed (see CSP)\n g = g || new Function(\"return this\")();\n} catch (e) {\n // This works if the window reference is available\n if ((typeof window === \"undefined\" ? \"undefined\" : _typeof(window)) === \"object\") g = window;\n} // g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\n\nmodule.exports = g;\n\n/***/ })\n/******/ ]);"]}
diff --git a/vendors/assets/select2/select2.min.css b/vendors/assets/select2/select2.min.css
deleted file mode 100644
index 7c18ad5..0000000
--- a/vendors/assets/select2/select2.min.css
+++ /dev/null
@@ -1 +0,0 @@
-.select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background-color:white;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;user-select:none;-webkit-user-select:none}.select2-results__option[aria-selected]{cursor:pointer}.select2-container--open .select2-dropdown{left:0}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0)}.select2-hidden-accessible{border:0 !important;clip:rect(0 0 0 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:4px}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px}.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow{left:1px;right:auto}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--default .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-top:5px;margin-right:10px;padding:1px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline{float:right}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--default.select2-container--focus .select2-selection--multiple{border:solid black 1px;outline:0}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa}.select2-container--default .select2-search--inline .select2-search__field{background:transparent;border:none;outline:0;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999}.select2-container--default .select2-results__option[aria-selected=true]{background-color:#ddd}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#5897fb;color:white}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top, #fff 50%, #eee 100%);background-image:-o-linear-gradient(top, #fff 50%, #eee 100%);background-image:linear-gradient(to bottom, #fff 50%, #eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-right:10px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top, #eee 50%, #ccc 100%);background-image:-o-linear-gradient(top, #eee 50%, #ccc 100%);background-image:linear-gradient(to bottom, #eee 50%, #ccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0)}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:transparent;border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top, #fff 0%, #eee 50%);background-image:-o-linear-gradient(top, #fff 0%, #eee 50%);background-image:linear-gradient(to bottom, #fff 0%, #eee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top, #eee 50%, #fff 100%);background-image:-o-linear-gradient(top, #eee 50%, #fff 100%);background-image:linear-gradient(to bottom, #eee 50%, #fff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{float:right;margin-left:5px;margin-right:auto}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;box-shadow:none}.select2-container--classic .select2-dropdown{background-color:#fff;border:1px solid transparent}.select2-container--classic .select2-dropdown--above{border-bottom:none}.select2-container--classic .select2-dropdown--below{border-top:none}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--classic .select2-results__option[role=group]{padding:0}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey}.select2-container--classic .select2-results__option--highlighted[aria-selected]{background-color:#3875d7;color:#fff}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb}
diff --git a/vendors/assets/select2/select2.min.js b/vendors/assets/select2/select2.min.js
deleted file mode 100644
index b073e95..0000000
--- a/vendors/assets/select2/select2.min.js
+++ /dev/null
@@ -1,2 +0,0 @@
-/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
-!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return void 0===t&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t),t}:n(jQuery)}(function(u){var e=function(){if(u&&u.fn&&u.fn.select2&&u.fn.select2.amd)var e=u.fn.select2.amd;var t,n,r,h,o,s,f,g,m,v,y,_,i,a,b;function w(e,t){return i.call(e,t)}function l(e,t){var n,r,i,o,s,a,l,c,u,d,p,h=t&&t.split("/"),f=y.map,g=f&&f["*"]||{};if(e){for(s=(e=e.split("/")).length-1,y.nodeIdCompat&&b.test(e[s])&&(e[s]=e[s].replace(b,"")),"."===e[0].charAt(0)&&h&&(e=h.slice(0,h.length-1).concat(e)),u=0;u":">",'"':""","'":"'","/":"/"};return"string"!=typeof e?e:String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})},i.appendMany=function(e,t){if("1.7"===o.fn.jquery.substr(0,3)){var n=o();o.map(t,function(e){n=n.add(e)}),t=n}e.append(t)},i.__cache={};var n=0;return i.GetUniqueElementId=function(e){var t=e.getAttribute("data-select2-id");return null==t&&(e.id?(t=e.id,e.setAttribute("data-select2-id",t)):(e.setAttribute("data-select2-id",++n),t=n.toString())),t},i.StoreData=function(e,t,n){var r=i.GetUniqueElementId(e);i.__cache[r]||(i.__cache[r]={}),i.__cache[r][t]=n},i.GetData=function(e,t){var n=i.GetUniqueElementId(e);return t?i.__cache[n]&&null!=i.__cache[n][t]?i.__cache[n][t]:o(e).data(t):i.__cache[n]},i.RemoveData=function(e){var t=i.GetUniqueElementId(e);null!=i.__cache[t]&&delete i.__cache[t],e.removeAttribute("data-select2-id")},i}),e.define("select2/results",["jquery","./utils"],function(h,f){function r(e,t,n){this.$element=e,this.data=n,this.options=t,r.__super__.constructor.call(this)}return f.Extend(r,f.Observable),r.prototype.render=function(){var e=h('');return this.options.get("multiple")&&e.attr("aria-multiselectable","true"),this.$results=e},r.prototype.clear=function(){this.$results.empty()},r.prototype.displayMessage=function(e){var t=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var n=h(''),r=this.options.get("translations").get(e.message);n.append(t(r(e.args))),n[0].className+=" select2-results__message",this.$results.append(n)},r.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},r.prototype.append=function(e){this.hideLoading();var t=[];if(null!=e.results&&0!==e.results.length){e.results=this.sort(e.results);for(var n=0;n",{class:"select2-results__options select2-results__options--nested"});p.append(l),s.append(a),s.append(p)}else this.template(e,t);return f.StoreData(t,"data",e),t},r.prototype.bind=function(t,e){var l=this,n=t.id+"-results";this.$results.attr("id",n),t.on("results:all",function(e){l.clear(),l.append(e.data),t.isOpen()&&(l.setClasses(),l.highlightFirstItem())}),t.on("results:append",function(e){l.append(e.data),t.isOpen()&&l.setClasses()}),t.on("query",function(e){l.hideMessages(),l.showLoading(e)}),t.on("select",function(){t.isOpen()&&(l.setClasses(),l.options.get("scrollAfterSelect")&&l.highlightFirstItem())}),t.on("unselect",function(){t.isOpen()&&(l.setClasses(),l.options.get("scrollAfterSelect")&&l.highlightFirstItem())}),t.on("open",function(){l.$results.attr("aria-expanded","true"),l.$results.attr("aria-hidden","false"),l.setClasses(),l.ensureHighlightVisible()}),t.on("close",function(){l.$results.attr("aria-expanded","false"),l.$results.attr("aria-hidden","true"),l.$results.removeAttr("aria-activedescendant")}),t.on("results:toggle",function(){var e=l.getHighlightedResults();0!==e.length&&e.trigger("mouseup")}),t.on("results:select",function(){var e=l.getHighlightedResults();if(0!==e.length){var t=f.GetData(e[0],"data");"true"==e.attr("aria-selected")?l.trigger("close",{}):l.trigger("select",{data:t})}}),t.on("results:previous",function(){var e=l.getHighlightedResults(),t=l.$results.find("[aria-selected]"),n=t.index(e);if(!(n<=0)){var r=n-1;0===e.length&&(r=0);var i=t.eq(r);i.trigger("mouseenter");var o=l.$results.offset().top,s=i.offset().top,a=l.$results.scrollTop()+(s-o);0===r?l.$results.scrollTop(0):s-o<0&&l.$results.scrollTop(a)}}),t.on("results:next",function(){var e=l.getHighlightedResults(),t=l.$results.find("[aria-selected]"),n=t.index(e)+1;if(!(n>=t.length)){var r=t.eq(n);r.trigger("mouseenter");var i=l.$results.offset().top+l.$results.outerHeight(!1),o=r.offset().top+r.outerHeight(!1),s=l.$results.scrollTop()+o-i;0===n?l.$results.scrollTop(0):ithis.$results.outerHeight()||o<0)&&this.$results.scrollTop(i)}},r.prototype.template=function(e,t){var n=this.options.get("templateResult"),r=this.options.get("escapeMarkup"),i=n(e,t);null==i?t.style.display="none":"string"==typeof i?t.innerHTML=r(i):h(t).append(i)},r}),e.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),e.define("select2/selection/base",["jquery","../utils","../keys"],function(n,r,i){function o(e,t){this.$element=e,this.options=t,o.__super__.constructor.call(this)}return r.Extend(o,r.Observable),o.prototype.render=function(){var e=n('');return this._tabindex=0,null!=r.GetData(this.$element[0],"old-tabindex")?this._tabindex=r.GetData(this.$element[0],"old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),e.attr("title",this.$element.attr("title")),e.attr("tabindex",this._tabindex),e.attr("aria-disabled","false"),this.$selection=e},o.prototype.bind=function(e,t){var n=this,r=e.id+"-results";this.container=e,this.$selection.on("focus",function(e){n.trigger("focus",e)}),this.$selection.on("blur",function(e){n._handleBlur(e)}),this.$selection.on("keydown",function(e){n.trigger("keypress",e),e.which===i.SPACE&&e.preventDefault()}),e.on("results:focus",function(e){n.$selection.attr("aria-activedescendant",e.data._resultId)}),e.on("selection:update",function(e){n.update(e.data)}),e.on("open",function(){n.$selection.attr("aria-expanded","true"),n.$selection.attr("aria-owns",r),n._attachCloseHandler(e)}),e.on("close",function(){n.$selection.attr("aria-expanded","false"),n.$selection.removeAttr("aria-activedescendant"),n.$selection.removeAttr("aria-owns"),n.$selection.trigger("focus"),n._detachCloseHandler(e)}),e.on("enable",function(){n.$selection.attr("tabindex",n._tabindex),n.$selection.attr("aria-disabled","false")}),e.on("disable",function(){n.$selection.attr("tabindex","-1"),n.$selection.attr("aria-disabled","true")})},o.prototype._handleBlur=function(e){var t=this;window.setTimeout(function(){document.activeElement==t.$selection[0]||n.contains(t.$selection[0],document.activeElement)||t.trigger("blur",e)},1)},o.prototype._attachCloseHandler=function(e){n(document.body).on("mousedown.select2."+e.id,function(e){var t=n(e.target).closest(".select2");n(".select2.select2-container--open").each(function(){this!=t[0]&&r.GetData(this,"element").select2("close")})})},o.prototype._detachCloseHandler=function(e){n(document.body).off("mousedown.select2."+e.id)},o.prototype.position=function(e,t){t.find(".selection").append(e)},o.prototype.destroy=function(){this._detachCloseHandler(this.container)},o.prototype.update=function(e){throw new Error("The `update` method must be defined in child classes.")},o.prototype.isEnabled=function(){return!this.isDisabled()},o.prototype.isDisabled=function(){return this.options.get("disabled")},o}),e.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(e,t,n,r){function i(){i.__super__.constructor.apply(this,arguments)}return n.Extend(i,t),i.prototype.render=function(){var e=i.__super__.render.call(this);return e.addClass("select2-selection--single"),e.html(''),e},i.prototype.bind=function(t,e){var n=this;i.__super__.bind.apply(this,arguments);var r=t.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",r).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",r),this.$selection.on("mousedown",function(e){1===e.which&&n.trigger("toggle",{originalEvent:e})}),this.$selection.on("focus",function(e){}),this.$selection.on("blur",function(e){}),t.on("focus",function(e){t.isOpen()||n.$selection.trigger("focus")})},i.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},i.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},i.prototype.selectionContainer=function(){return e("")},i.prototype.update=function(e){if(0!==e.length){var t=e[0],n=this.$selection.find(".select2-selection__rendered"),r=this.display(t,n);n.empty().append(r);var i=t.title||t.text;i?n.attr("title",i):n.removeAttr("title")}else this.clear()},i}),e.define("select2/selection/multiple",["jquery","./base","../utils"],function(i,e,l){function n(e,t){n.__super__.constructor.apply(this,arguments)}return l.Extend(n,e),n.prototype.render=function(){var e=n.__super__.render.call(this);return e.addClass("select2-selection--multiple"),e.html(''),e},n.prototype.bind=function(e,t){var r=this;n.__super__.bind.apply(this,arguments),this.$selection.on("click",function(e){r.trigger("toggle",{originalEvent:e})}),this.$selection.on("click",".select2-selection__choice__remove",function(e){if(!r.isDisabled()){var t=i(this).parent(),n=l.GetData(t[0],"data");r.trigger("unselect",{originalEvent:e,data:n})}})},n.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},n.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},n.prototype.selectionContainer=function(){return i('×')},n.prototype.update=function(e){if(this.clear(),0!==e.length){for(var t=[],n=0;n×');a.StoreData(r[0],"data",t),this.$selection.find(".select2-selection__rendered").prepend(r)}},e}),e.define("select2/selection/search",["jquery","../utils","../keys"],function(r,a,l){function e(e,t,n){e.call(this,t,n)}return e.prototype.render=function(e){var t=r('');this.$searchContainer=t,this.$search=t.find("input");var n=e.call(this);return this._transferTabIndex(),n},e.prototype.bind=function(e,t,n){var r=this,i=t.id+"-results";e.call(this,t,n),t.on("open",function(){r.$search.attr("aria-controls",i),r.$search.trigger("focus")}),t.on("close",function(){r.$search.val(""),r.$search.removeAttr("aria-controls"),r.$search.removeAttr("aria-activedescendant"),r.$search.trigger("focus")}),t.on("enable",function(){r.$search.prop("disabled",!1),r._transferTabIndex()}),t.on("disable",function(){r.$search.prop("disabled",!0)}),t.on("focus",function(e){r.$search.trigger("focus")}),t.on("results:focus",function(e){e.data._resultId?r.$search.attr("aria-activedescendant",e.data._resultId):r.$search.removeAttr("aria-activedescendant")}),this.$selection.on("focusin",".select2-search--inline",function(e){r.trigger("focus",e)}),this.$selection.on("focusout",".select2-search--inline",function(e){r._handleBlur(e)}),this.$selection.on("keydown",".select2-search--inline",function(e){if(e.stopPropagation(),r.trigger("keypress",e),r._keyUpPrevented=e.isDefaultPrevented(),e.which===l.BACKSPACE&&""===r.$search.val()){var t=r.$searchContainer.prev(".select2-selection__choice");if(0this.maximumInputLength?this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),e.define("select2/data/maximumSelectionLength",[],function(){function e(e,t,n){this.maximumSelectionLength=n.get("maximumSelectionLength"),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var r=this;e.call(this,t,n),t.on("select",function(){r._checkIfMaximumSelected()})},e.prototype.query=function(e,t,n){var r=this;this._checkIfMaximumSelected(function(){e.call(r,t,n)})},e.prototype._checkIfMaximumSelected=function(e,n){var r=this;this.current(function(e){var t=null!=e?e.length:0;0=r.maximumSelectionLength?r.trigger("results:message",{message:"maximumSelected",args:{maximum:r.maximumSelectionLength}}):n&&n()})},e}),e.define("select2/dropdown",["jquery","./utils"],function(t,e){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return e.Extend(n,e.Observable),n.prototype.render=function(){var e=t('');return e.attr("dir",this.options.get("dir")),this.$dropdown=e},n.prototype.bind=function(){},n.prototype.position=function(e,t){},n.prototype.destroy=function(){this.$dropdown.remove()},n}),e.define("select2/dropdown/search",["jquery","../utils"],function(o,e){function t(){}return t.prototype.render=function(e){var t=e.call(this),n=o('');return this.$searchContainer=n,this.$search=n.find("input"),t.prepend(n),t},t.prototype.bind=function(e,t,n){var r=this,i=t.id+"-results";e.call(this,t,n),this.$search.on("keydown",function(e){r.trigger("keypress",e),r._keyUpPrevented=e.isDefaultPrevented()}),this.$search.on("input",function(e){o(this).off("keyup")}),this.$search.on("keyup input",function(e){r.handleSearch(e)}),t.on("open",function(){r.$search.attr("tabindex",0),r.$search.attr("aria-controls",i),r.$search.trigger("focus"),window.setTimeout(function(){r.$search.trigger("focus")},0)}),t.on("close",function(){r.$search.attr("tabindex",-1),r.$search.removeAttr("aria-controls"),r.$search.removeAttr("aria-activedescendant"),r.$search.val(""),r.$search.trigger("blur")}),t.on("focus",function(){t.isOpen()||r.$search.trigger("focus")}),t.on("results:all",function(e){null!=e.query.term&&""!==e.query.term||(r.showSearch(e)?r.$searchContainer.removeClass("select2-search--hide"):r.$searchContainer.addClass("select2-search--hide"))}),t.on("results:focus",function(e){e.data._resultId?r.$search.attr("aria-activedescendant",e.data._resultId):r.$search.removeAttr("aria-activedescendant")})},t.prototype.handleSearch=function(e){if(!this._keyUpPrevented){var t=this.$search.val();this.trigger("query",{term:t})}this._keyUpPrevented=!1},t.prototype.showSearch=function(e,t){return!0},t}),e.define("select2/dropdown/hidePlaceholder",[],function(){function e(e,t,n,r){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n,r)}return e.prototype.append=function(e,t){t.results=this.removePlaceholder(t.results),e.call(this,t)},e.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},e.prototype.removePlaceholder=function(e,t){for(var n=t.slice(0),r=t.length-1;0<=r;r--){var i=t[r];this.placeholder.id===i.id&&n.splice(r,1)}return n},e}),e.define("select2/dropdown/infiniteScroll",["jquery"],function(n){function e(e,t,n,r){this.lastParams={},e.call(this,t,n,r),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return e.prototype.append=function(e,t){this.$loadingMore.remove(),this.loading=!1,e.call(this,t),this.showLoadingMore(t)&&(this.$results.append(this.$loadingMore),this.loadMoreIfNeeded())},e.prototype.bind=function(e,t,n){var r=this;e.call(this,t,n),t.on("query",function(e){r.lastParams=e,r.loading=!0}),t.on("query:append",function(e){r.lastParams=e,r.loading=!0}),this.$results.on("scroll",this.loadMoreIfNeeded.bind(this))},e.prototype.loadMoreIfNeeded=function(){var e=n.contains(document.documentElement,this.$loadingMore[0]);if(!this.loading&&e){var t=this.$results.offset().top+this.$results.outerHeight(!1);this.$loadingMore.offset().top+this.$loadingMore.outerHeight(!1)<=t+50&&this.loadMore()}},e.prototype.loadMore=function(){this.loading=!0;var e=n.extend({},{page:1},this.lastParams);e.page++,this.trigger("query:append",e)},e.prototype.showLoadingMore=function(e,t){return t.pagination&&t.pagination.more},e.prototype.createLoadingMore=function(){var e=n(''),t=this.options.get("translations").get("loadingMore");return e.html(t(this.lastParams)),e},e}),e.define("select2/dropdown/attachBody",["jquery","../utils"],function(f,a){function e(e,t,n){this.$dropdownParent=f(n.get("dropdownParent")||document.body),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var r=this;e.call(this,t,n),t.on("open",function(){r._showDropdown(),r._attachPositioningHandler(t),r._bindContainerResultHandlers(t)}),t.on("close",function(){r._hideDropdown(),r._detachPositioningHandler(t)}),this.$dropdownContainer.on("mousedown",function(e){e.stopPropagation()})},e.prototype.destroy=function(e){e.call(this),this.$dropdownContainer.remove()},e.prototype.position=function(e,t,n){t.attr("class",n.attr("class")),t.removeClass("select2"),t.addClass("select2-container--open"),t.css({position:"absolute",top:-999999}),this.$container=n},e.prototype.render=function(e){var t=f(""),n=e.call(this);return t.append(n),this.$dropdownContainer=t},e.prototype._hideDropdown=function(e){this.$dropdownContainer.detach()},e.prototype._bindContainerResultHandlers=function(e,t){if(!this._containerResultsHandlersBound){var n=this;t.on("results:all",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("results:append",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("results:message",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("select",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("unselect",function(){n._positionDropdown(),n._resizeDropdown()}),this._containerResultsHandlersBound=!0}},e.prototype._attachPositioningHandler=function(e,t){var n=this,r="scroll.select2."+t.id,i="resize.select2."+t.id,o="orientationchange.select2."+t.id,s=this.$container.parents().filter(a.hasScroll);s.each(function(){a.StoreData(this,"select2-scroll-position",{x:f(this).scrollLeft(),y:f(this).scrollTop()})}),s.on(r,function(e){var t=a.GetData(this,"select2-scroll-position");f(this).scrollTop(t.y)}),f(window).on(r+" "+i+" "+o,function(e){n._positionDropdown(),n._resizeDropdown()})},e.prototype._detachPositioningHandler=function(e,t){var n="scroll.select2."+t.id,r="resize.select2."+t.id,i="orientationchange.select2."+t.id;this.$container.parents().filter(a.hasScroll).off(n),f(window).off(n+" "+r+" "+i)},e.prototype._positionDropdown=function(){var e=f(window),t=this.$dropdown.hasClass("select2-dropdown--above"),n=this.$dropdown.hasClass("select2-dropdown--below"),r=null,i=this.$container.offset();i.bottom=i.top+this.$container.outerHeight(!1);var o={height:this.$container.outerHeight(!1)};o.top=i.top,o.bottom=i.top+o.height;var s=this.$dropdown.outerHeight(!1),a=e.scrollTop(),l=e.scrollTop()+e.height(),c=ai.bottom+s,d={left:i.left,top:o.bottom},p=this.$dropdownParent;"static"===p.css("position")&&(p=p.offsetParent());var h={top:0,left:0};(f.contains(document.body,p[0])||p[0].isConnected)&&(h=p.offset()),d.top-=h.top,d.left-=h.left,t||n||(r="below"),u||!c||t?!c&&u&&t&&(r="below"):r="above",("above"==r||t&&"below"!==r)&&(d.top=o.top-h.top-s),null!=r&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+r),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+r)),this.$dropdownContainer.css(d)},e.prototype._resizeDropdown=function(){var e={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(e.minWidth=e.width,e.position="relative",e.width="auto"),this.$dropdown.css(e)},e.prototype._showDropdown=function(e){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},e}),e.define("select2/dropdown/minimumResultsForSearch",[],function(){function e(e,t,n,r){this.minimumResultsForSearch=n.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),e.call(this,t,n,r)}return e.prototype.showSearch=function(e,t){return!(function e(t){for(var n=0,r=0;r');return e.attr("dir",this.options.get("dir")),this.$container=e,this.$container.addClass("select2-container--"+this.options.get("theme")),u.StoreData(e[0],"element",this.$element),e},d}),e.define("jquery-mousewheel",["jquery"],function(e){return e}),e.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults","./select2/utils"],function(i,e,o,t,s){if(null==i.fn.select2){var a=["open","close","destroy"];i.fn.select2=function(t){if("object"==typeof(t=t||{}))return this.each(function(){var e=i.extend(!0,{},t);new o(i(this),e)}),this;if("string"!=typeof t)throw new Error("Invalid arguments for Select2: "+t);var n,r=Array.prototype.slice.call(arguments,1);return this.each(function(){var e=s.GetData(this,"select2");null==e&&window.console&&console.error&&console.error("The select2('"+t+"') method was called on an element that is not using Select2."),n=e[t].apply(e,r)}),-1
- * @link https://tareq.co Tareq Hasan
- */
-class Mind_Settings_API {
-
- /**
- * Settings sections array
- *
- * @var array
- */
- protected $settings_sections = [];
-
- /**
- * Settings fields array
- *
- * @var array
- */
- protected $settings_fields = [];
-
- /**
- * Mind_Settings_API constructor.
- */
- public function __construct() {
- // add_action( 'admin_enqueue_scripts', [ $this, 'admin_enqueue_scripts' ] );
- }
-
- /**
- * Enqueue scripts and styles
- */
- public function admin_enqueue_scripts() {
- wp_enqueue_style( 'wp-color-picker' );
-
- wp_enqueue_media();
- wp_enqueue_script( 'wp-color-picker' );
- wp_enqueue_script( 'jquery' );
- wp_enqueue_script( 'conditionize', mind()->plugin_url . 'vendors/assets/conditionize/conditionize.min.js', [ 'jquery' ], '1.0.5' );
-
- wp_enqueue_style( 'select2', mind()->plugin_url . 'vendors/assets/select2/select2.min.css', [], '4.0.13' );
- wp_enqueue_script( 'select2', mind()->plugin_url . 'vendors/assets/select2/select2.min.js', [ 'jquery' ], '4.0.13' );
- }
-
- /**
- * Set settings sections
- *
- * @param array $sections setting sections array
- */
- public function set_sections( $sections ) {
- $this->settings_sections = $sections;
-
- return $this;
- }
-
- /**
- * Add a single section
- *
- * @param array $section
- */
- public function add_section( $section ) {
- $this->settings_sections[] = $section;
-
- return $this;
- }
-
- /**
- * Set settings fields
- *
- * @param array $fields settings fields array
- */
- public function set_fields( $fields ) {
- $this->settings_fields = $fields;
-
- return $this;
- }
-
- public function add_field( $section, $field ) {
- $defaults = [
- 'name' => '',
- 'label' => '',
- 'desc' => '',
- 'type' => 'text',
- 'is_pro' => false,
- ];
-
- $arg = wp_parse_args( $field, $defaults );
- $this->settings_fields[ $section ][] = $arg;
-
- return $this;
- }
-
- /**
- * Initialize and registers the settings sections and fileds to WordPress
- *
- * Usually this should be called at `admin_init` hook.
- *
- * This function gets the initiated settings sections and fields. Then
- * registers them to WordPress and ready for use.
- */
- public function admin_init() {
- // register settings sections
- foreach ( $this->settings_sections as $section ) {
- if ( false == get_option( $section['id'] ) ) {
- add_option( $section['id'] );
- }
-
- if ( isset( $section['desc'] ) && ! empty( $section['desc'] ) ) {
- $section['desc'] = '' . $section['desc'] . '
';
- $callback = create_function( '', 'echo "' . str_replace( '"', '\"', $section['desc'] ) . '";' );
- } elseif ( isset( $section['callback'] ) ) {
- $callback = $section['callback'];
- } else {
- $callback = null;
- }
-
- add_settings_section( $section['id'], $section['title'], $callback, $section['id'] );
- }
-
- // register settings fields
- foreach ( $this->settings_fields as $section => $field ) {
- foreach ( $field as $option ) {
-
- $name = $option['name'];
- $type = isset( $option['type'] ) ? $option['type'] : 'text';
- $label = isset( $option['label'] ) ? $option['label'] : '';
- $callback = isset( $option['callback'] ) ? $option['callback'] : [ $this, 'callback_' . $type ];
- $class_name = isset( $option['class'] ) ? $option['class'] : $name;
- $is_pro = isset( $option['is_pro'] ) ? $option['is_pro'] : false;
-
- if ( $is_pro ) {
- $class_name .= ' mind-settings-control-pro';
- $go_pro_url = Visual_Portfolio_Admin::get_plugin_site_url(
- [
- 'utm_medium' => 'settings_page',
- 'utm_campaign' => esc_attr( $name ),
- ]
- );
- $label .= '?' . esc_html__( 'This feature is available in the Pro plugin only.', '@@text_domain' ) . '';
- }
-
- $args = [
- 'id' => $name,
- 'class' => $class_name,
- 'label_for' => "{$section}[{$name}]",
- 'desc' => isset( $option['desc'] ) ? $option['desc'] : '',
- 'name' => $label,
- 'section' => $section,
- 'size' => isset( $option['size'] ) ? $option['size'] : null,
- 'options' => isset( $option['options'] ) ? $option['options'] : '',
- 'std' => isset( $option['default'] ) ? $option['default'] : '',
- 'sanitize_callback' => isset( $option['sanitize_callback'] ) ? $option['sanitize_callback'] : '',
- 'type' => $type,
- 'placeholder' => isset( $option['placeholder'] ) ? $option['placeholder'] : '',
- 'min' => isset( $option['min'] ) ? $option['min'] : '',
- 'max' => isset( $option['max'] ) ? $option['max'] : '',
- 'step' => isset( $option['step'] ) ? $option['step'] : '',
- 'is_pro' => isset( $option['is_pro'] ) ? $option['is_pro'] : false,
- 'condition' => isset( $option['condition'] ) ? $option['condition'] : null,
- 'conditionize' => isset( $option['condition'] ) ? $this->convert_arguments_to_conditionize_string( $option['condition'] ) : '',
- ];
-
- add_settings_field( "{$section}[{$name}]", $label, $callback, $section, $section, $args );
- }
- }
-
- // creates our settings in the options table
- foreach ( $this->settings_sections as $section ) {
- register_setting( $section['id'], $section['id'], [ $this, 'sanitize_options' ] );
- }
- }
-
- /**
- * Get field description for display
- *
- * @param array $args settings field args
- */
- public function get_field_description( $args ) {
- if ( ! empty( $args['desc'] ) ) {
- $desc = sprintf( '%s
', $args['desc'] );
- } else {
- $desc = '';
- }
-
- return $desc;
- }
-
- /**
- * Displays a text field for a settings field
- *
- * @param array $args settings field args
- */
- public function callback_text( $args ) {
-
- $value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
- $size = isset( $args['size'] ) && ! is_null( $args['size'] ) ? $args['size'] : 'regular';
- $type = isset( $args['type'] ) ? $args['type'] : 'text';
- $placeholder = empty( $args['placeholder'] ) ? '' : ' placeholder="' . $args['placeholder'] . '"';
-
- $html = sprintf( '', $type, $size, $args['section'], $args['id'], $value, $placeholder );
- $html .= $this->get_field_description( $args );
-
- echo $html;
- }
-
- /**
- * Displays a url field for a settings field
- *
- * @param array $args settings field args
- */
- public function callback_url( $args ) {
- $this->callback_text( $args );
- }
-
- /**
- * Displays a number field for a settings field
- *
- * @param array $args settings field args
- */
- public function callback_number( $args ) {
- $value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
- $size = isset( $args['size'] ) && ! is_null( $args['size'] ) ? $args['size'] : 'regular';
- $type = isset( $args['type'] ) ? $args['type'] : 'number';
- $placeholder = empty( $args['placeholder'] ) ? '' : ' placeholder="' . $args['placeholder'] . '"';
- $min = empty( $args['min'] ) ? '' : ' min="' . $args['min'] . '"';
- $max = empty( $args['max'] ) ? '' : ' max="' . $args['max'] . '"';
- $step = empty( $args['max'] ) ? '' : ' step="' . $args['step'] . '"';
-
- $html = sprintf( '', $type, $size, $args['section'], $args['id'], $value, $placeholder, $min, $max, $step );
- $html .= $this->get_field_description( $args );
-
- echo $html;
- }
-
- /**
- * Displays a checkbox for a settings field
- *
- * @param array $args settings field args
- */
- public function callback_checkbox( $args ) {
-
- $value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
-
- $html = '';
-
- echo $html;
- }
-
- /**
- * Displays a multicheckbox for a settings field
- *
- * @param array $args settings field args
- */
- public function callback_multicheck( $args ) {
-
- $value = $this->get_option( $args['id'], $args['section'], $args['std'] );
- $html = '';
-
- echo $html;
- }
-
- /**
- * Displays a radio button for a settings field
- *
- * @param array $args settings field args
- */
- public function callback_radio( $args ) {
-
- $value = $this->get_option( $args['id'], $args['section'], $args['std'] );
- $html = '';
-
- echo $html;
- }
-
- /**
- * Displays a selectbox for a settings field
- *
- * @param array $args settings field args
- */
- public function callback_select( $args ) {
-
- $value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
- $classes = isset( $args['size'] ) && ! is_null( $args['size'] ) ? $args['size'] : 'regular';
- $html = sprintf( '' );
- $html .= $this->get_field_description( $args );
-
- echo $html;
- }
-
- /**
- * Displays a textarea for a settings field
- *
- * @param array $args settings field args
- */
- public function callback_textarea( $args ) {
-
- $value = esc_textarea( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
- $size = isset( $args['size'] ) && ! is_null( $args['size'] ) ? $args['size'] : 'regular';
- $placeholder = empty( $args['placeholder'] ) ? '' : ' placeholder="' . $args['placeholder'] . '"';
-
- $html = sprintf( '', $size, $args['section'], $args['id'], $placeholder, $value );
- $html .= $this->get_field_description( $args );
-
- echo $html;
- }
-
- /**
- * Displays the html for a settings field
- *
- * @param array $args settings field args
- * @return string
- */
- public function callback_html( $args ) {
- echo $this->get_field_description( $args );
- }
-
- /**
- * Displays the section title for a settings field
- *
- * @param array $args settings field args
- * @return string
- */
- public function callback_section_title( $args ) {
- echo $this->get_field_description( $args );
- }
-
- /**
- * Displays a rich text textarea for a settings field
- *
- * @param array $args settings field args
- */
- public function callback_wysiwyg( $args ) {
-
- $value = $this->get_option( $args['id'], $args['section'], $args['std'] );
- $size = isset( $args['size'] ) && ! is_null( $args['size'] ) ? $args['size'] : '500px';
-
- echo '';
-
- $editor_settings = [
- 'teeny' => true,
- 'textarea_name' => $args['section'] . '[' . $args['id'] . ']',
- 'textarea_rows' => 10,
- ];
-
- if ( isset( $args['options'] ) && is_array( $args['options'] ) ) {
- $editor_settings = array_merge( $editor_settings, $args['options'] );
- }
-
- wp_editor( $value, $args['section'] . '-' . $args['id'], $editor_settings );
-
- echo '
';
-
- echo $this->get_field_description( $args );
- }
-
- /**
- * Displays a file upload field for a settings field
- *
- * @param array $args settings field args
- */
- public function callback_file( $args ) {
-
- $value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
- $size = isset( $args['size'] ) && ! is_null( $args['size'] ) ? $args['size'] : 'regular';
- $id = $args['section'] . '[' . $args['id'] . ']';
- $label = isset( $args['options']['button_label'] ) ? $args['options']['button_label'] : __( 'Choose File' );
-
- $html = sprintf( '', $size, $args['section'], $args['id'], $value );
- $html .= '';
- $html .= $this->get_field_description( $args );
-
- echo $html;
- }
-
- /**
- * Displays a image upload field for a settings field
- *
- * @param array $args settings field args
- */
- public function callback_image( $args ) {
-
- $value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
- $size = isset( $args['size'] ) && ! is_null( $args['size'] ) ? $args['size'] : 'regular';
- $id = $args['section'] . '[' . $args['id'] . ']';
- $label = isset( $args['options']['button_label'] ) ? $args['options']['button_label'] : __( 'Choose Image' );
- $label_remove = isset( $args['options']['button_remove_label'] ) ? $args['options']['button_remove_label'] : __( 'Remove Image' );
- $img = wp_get_attachment_image_src( $value, $args['size'] ? $args['size'] : 'thumbnail' );
- $img_url = $img ? $img[0] : '';
-
- $html = sprintf( '', $size, $id, $value );
- $html .= '
';
- $html .= '';
- $html .= '';
- $html .= $this->get_field_description( $args );
-
- echo $html;
- }
-
- /**
- * Displays a password field for a settings field
- *
- * @param array $args settings field args
- */
- public function callback_password( $args ) {
- $value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
- $size = isset( $args['size'] ) && ! is_null( $args['size'] ) ? $args['size'] : 'regular';
-
- $html = sprintf( '', $size, $args['section'], $args['id'], $value );
- $html .= $this->get_field_description( $args );
-
- echo $html;
- }
-
- /**
- * Displays a color picker field for a settings field
- *
- * @param array $args settings field args
- */
- public function callback_color( $args ) {
-
- $value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
- $size = isset( $args['size'] ) && ! is_null( $args['size'] ) ? $args['size'] : 'regular';
-
- $html = sprintf( '', $size, $args['section'], $args['id'], $value, $args['std'] );
- $html .= $this->get_field_description( $args );
-
- echo $html;
- }
-
-
- /**
- * Displays a select box for creating the pages select box
- *
- * @param array $args settings field args
- */
- public function callback_pages( $args ) {
-
- $dropdown_args = [
- 'selected' => esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) ),
- 'name' => $args['section'] . '[' . $args['id'] . ']',
- 'id' => $args['section'] . '[' . $args['id'] . ']',
- 'echo' => 0,
- ];
- $html = wp_dropdown_pages( $dropdown_args );
- echo $html;
- }
-
- /**
- * Displays a toggle field for a settings field
- *
- * @param array $args settings field args.
- */
- public function callback_toggle( $args ) {
- $value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
-
- $html = sprintf( '', $args['desc'] );
-
- echo $html;
- }
-
- /**
- * Displays a range field for a settings field
- *
- * @param array $args settings field args.
- */
- public function callback_range( $args ) {
-
- $value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) );
- $size = isset( $args['size'] ) && ! is_null( $args['size'] ) ? $args['size'] : 'regular';
- $type = isset( $args['type'] ) ? $args['type'] : 'range';
- $placeholder = empty( $args['placeholder'] ) ? '' : ' placeholder="' . $args['placeholder'] . '"';
- $min = empty( $args['min'] ) ? '' : ' min="' . $args['min'] . '"';
- $max = empty( $args['max'] ) ? '' : ' max="' . $args['max'] . '"';
- $step = empty( $args['max'] ) ? '' : ' step="' . $args['step'] . '"';
- ?>
- ',
- esc_attr( $type ),
- esc_attr( $size ),
- esc_attr( $args['section'] ),
- esc_attr( $args['id'] ),
- esc_attr( $value ),
- esc_attr( $placeholder ),
- esc_attr( $min ),
- esc_attr( $max ),
- esc_attr( $step )
- );
- echo sprintf(
- '',
- esc_attr( $args['section'] ),
- esc_attr( $args['id'] ),
- esc_attr( $value ),
- esc_attr( $placeholder ),
- esc_attr( $min ),
- esc_attr( $max ),
- esc_attr( $step )
- );
- echo wp_kses_post( $this->get_field_description( $args ) );
- ?>
- get_option( $args['id'], $args['section'], $args['std'] ) );
- $size = isset( $args['size'] ) && ! is_null( $args['size'] ) ? $args['size'] : 'regular';
- $type = isset( $args['type'] ) ? $args['type'] : 'hidden';
- $placeholder = empty( $args['placeholder'] ) ? '' : ' placeholder="' . $args['placeholder'] . '"';
-
- echo sprintf(
- '',
- esc_attr( $type ),
- esc_attr( $size ),
- esc_attr( $args['section'] ),
- esc_attr( $args['id'] ),
- esc_attr( $value ),
- esc_attr( $placeholder )
- );
- echo wp_kses_post( $this->get_field_description( $args ) );
- }
-
- /**
- * Sanitize callback for Settings API
- *
- * @return mixed
- */
- public function sanitize_options( $options ) {
-
- if ( ! $options ) {
- return $options;
- }
-
- foreach ( $options as $option_slug => $option_value ) {
- $sanitize_callback = $this->get_sanitize_callback( $option_slug );
-
- // If callback is set, call it
- if ( $sanitize_callback ) {
- $options[ $option_slug ] = call_user_func( $sanitize_callback, $option_value );
- continue;
- }
- }
-
- return $options;
- }
-
- /**
- * Get sanitization callback for given option slug
- *
- * @param string $slug option slug
- *
- * @return mixed string or bool false
- */
- public function get_sanitize_callback( $slug = '' ) {
- if ( empty( $slug ) ) {
- return false;
- }
-
- // Iterate over registered fields and see if we can find proper callback
- foreach ( $this->settings_fields as $section => $options ) {
- foreach ( $options as $option ) {
- if ( $option['name'] != $slug ) {
- continue;
- }
-
- // Return the callback name
- return isset( $option['sanitize_callback'] ) && is_callable( $option['sanitize_callback'] ) ? $option['sanitize_callback'] : false;
- }
- }
-
- return false;
- }
-
- /**
- * Get the value of a settings field
- *
- * @param string $option settings field name
- * @param string $section the section name this field belongs to
- * @param string $default default text if it's not found
- * @return string
- */
- public function get_option( $option, $section, $default = '' ) {
-
- $options = get_option( $section );
-
- if ( isset( $options[ $option ] ) ) {
- return $options[ $option ];
- }
-
- return $default;
- }
-
- /**
- * Show navigations as tab
- *
- * Shows all the settings section labels as tab
- */
- public function show_navigation() {
- $html = '';
-
- $count = count( $this->settings_sections );
-
- // don't show the navigation if only one section exists
- if ( $count === 1 ) {
- return;
- }
-
- foreach ( $this->settings_sections as $tab ) {
- $html .= sprintf( '%2$s%3$s', $tab['id'], isset( $tab['icon'] ) ? $tab['icon'] : '', $tab['title'] );
- }
-
- $html .= '
';
-
- echo $html;
- }
-
- /**
- * Tabbable JavaScript codes & Initiate Color Picker
- *
- * This code uses localstorage for displaying active tabs
- */
- public function script() {
- ?>
-
-
-
- settings_sections as $form ) {
- echo apply_filters( 'mind_settings_show_section_form', $this->get_form( $form ), $form );
- } ?>
-
- script();
- }
-
- /**
- * Prints out all settings sections added to a particular settings page
- *
- * Part of the Settings API. Use this in a settings page callback function
- * to output all the sections and fields that were added to that $page with
- * add_settings_section() and add_settings_field()
- *
- * @global array $wp_settings_sections Storage array of all settings sections added to admin pages.
- * @global array $wp_settings_fields Storage array of settings fields and info about their pages/sections.
- *
- * @param string $page The slug name of the page whose settings sections you want to output.
- */
- public function do_settings_sections( $page ) {
- global $wp_settings_sections, $wp_settings_fields;
-
- if ( ! isset( $wp_settings_sections[ $page ] ) ) {
- return;
- }
-
- foreach ( (array) $wp_settings_sections[ $page ] as $section ) {
- if ( $section['callback'] ) {
- call_user_func( $section['callback'], $section );
- }
-
- if ( ! isset( $wp_settings_fields ) || ! isset( $wp_settings_fields[ $page ] ) || ! isset( $wp_settings_fields[ $page ][ $section['id'] ] ) ) {
- continue;
- }
- echo '';
- }
- }
-
- /**
- * Get the section settings form.
- * This function return displays detailed section in a each of forms.
- *
- * @param array $form - Form item.
- * @return string
- */
- public function get_form( $form ) {
- ob_start();
- ?>
-
-
-
- ";
-
- if ( ! empty( $field['args']['label_for'] ) ) {
- echo ' | ';
- } else {
- echo '' . $field['title'] . ' | ';
- }
-
- echo '';
- call_user_func( $field['callback'], $field['args'] );
- echo ' | ';
- echo '';
- }
- }
-
- /**
- * Convert condition arguments to Conditionize string.
- *
- * @param array $conditions - Array with Condition arguments.
- * @return string
- */
- public function convert_arguments_to_conditionize_string( $conditions ) {
- $data_condition = '';
- if ( isset( $conditions ) && is_array( $conditions ) && ! empty( $conditions ) ) {
- foreach ( $conditions as $key => $condition ) {
- $condition['value'] = empty( $condition['value'] ) ? "''" : ( '' . $condition['value'] );
-
- $data_condition .= $condition['control'];
-
- if ( isset( $condition['operator'] ) && isset( $condition['value'] ) ) {
- $data_condition .= ' ' . $condition['operator'] . ' ' . $condition['value'];
- }
-
- if ( 1 < count( $conditions ) && ( count( $conditions ) - 1 ) !== $key ) {
- $data_condition .= ' && ';
- }
- }
- }
-
- return $data_condition;
- }
-}
diff --git a/webpack.config.js b/webpack.config.js
index 5af425d..8e3e9d8 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -1,9 +1,19 @@
+/**
+ * External Dependencies
+ */
+const { resolve } = require('path');
const defaultConfig = require('@wordpress/scripts/config/webpack.config');
const isProduction = process.env.NODE_ENV === 'production';
const newConfig = {
...defaultConfig,
+ ...{
+ entry: {
+ admin: resolve(process.cwd(), 'src/admin', 'index.js'),
+ editor: resolve(process.cwd(), 'src/editor', 'index.js'),
+ },
+ },
// Display minimum info in terminal.
stats: 'minimal',