__( 'Save as a template', 'elementor' );
__( 'New', 'elementor' );
__( 'Create component', 'elementor' );
__( 'To create new components, update Elementor Pro to the latest version.', 'elementor' );
__( 'Update Now', 'elementor' );
__( 'Add %s', 'elementor' );
__( 'Edit %s', 'elementor' );
__( 'Duplicate %s', 'elementor' );
__( 'Delete %s', 'elementor' );# Members - EDD Integration
The Members - EDD Integration add-on more nicely integrates the [Easy Digital Downloads](https://easydigitaldownloads.com/) plugin capabilities into the Members plugin's role manager.
The [Members plugin](https://themehybrid.com/plugins/members) and the Easy Digital Downloads plugin are required to be installed and activated for this plugin to work.
## Shop Role Group
The plugin creates a new "Shop" role group for Easy Digital Downloads, which is located under the Users > Roles screen in the admin. This role group lists the following roles:
- Shop Accountant
- Shop Manager
- Shop Vendor
- Shop Worker
- Any other roles that have EDD-related capabilities.
This allows you to see any roles that have EDD permissions at a glance.
## Downloads Capability Group
When editing or creating a new role in Members, this add-on creates a new "Downloads" tab (cap group). This tab combines all of the Easy Digital Downloads capabilities in one place. That way, you can see all available caps without jumping between different tabs.
## Copyright and License
This project is licensed under the [GNU GPL](http://www.gnu.org/licenses/old-licenses/gpl-2.0.html), version 2 or later.
2019 © [Justin Tadlock](http://justintadlock.com).
/******/ (function() { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ({
/***/ "./node_modules/@monaco-editor/loader/lib/es/_virtual/_rollupPluginBabelHelpers.js":
/*!*****************************************************************************************!*\
!*** ./node_modules/@monaco-editor/loader/lib/es/_virtual/_rollupPluginBabelHelpers.js ***!
\*****************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ arrayLikeToArray: function() { return /* binding */ _arrayLikeToArray; },
/* harmony export */ arrayWithHoles: function() { return /* binding */ _arrayWithHoles; },
/* harmony export */ defineProperty: function() { return /* binding */ _defineProperty; },
/* harmony export */ iterableToArrayLimit: function() { return /* binding */ _iterableToArrayLimit; },
/* harmony export */ nonIterableRest: function() { return /* binding */ _nonIterableRest; },
/* harmony export */ objectSpread2: function() { return /* binding */ _objectSpread2; },
/* harmony export */ objectWithoutProperties: function() { return /* binding */ _objectWithoutProperties; },
/* harmony export */ objectWithoutPropertiesLoose: function() { return /* binding */ _objectWithoutPropertiesLoose; },
/* harmony export */ slicedToArray: function() { return /* binding */ _slicedToArray; },
/* harmony export */ toPrimitive: function() { return /* binding */ _toPrimitive; },
/* harmony export */ toPropertyKey: function() { return /* binding */ _toPropertyKey; },
/* harmony export */ unsupportedIterableToArray: function() { return /* binding */ _unsupportedIterableToArray; }
/* harmony export */ });
function _arrayLikeToArray(r, a) {
(null == a || a > r.length) && (a = r.length);
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
return n;
}
function _arrayWithHoles(r) {
if (Array.isArray(r)) return r;
}
function _defineProperty(e, r, t) {
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
value: t,
enumerable: true,
configurable: true,
writable: true
}) : e[r] = t, e;
}
function _iterableToArrayLimit(r, l) {
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
if (null != t) {
var e,
n,
i,
u,
a = [],
f = true,
o = false;
try {
if (i = (t = t.call(r)).next, 0 === l) ; else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
} catch (r) {
o = true, n = r;
} finally {
try {
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
} finally {
if (o) throw n;
}
}
return a;
}
}
function _nonIterableRest() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function ownKeys(e, r) {
var t = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var o = Object.getOwnPropertySymbols(e);
r && (o = o.filter(function (r) {
return Object.getOwnPropertyDescriptor(e, r).enumerable;
})), t.push.apply(t, o);
}
return t;
}
function _objectSpread2(e) {
for (var r = 1; r < arguments.length; r++) {
var t = null != arguments[r] ? arguments[r] : {};
r % 2 ? ownKeys(Object(t), true).forEach(function (r) {
_defineProperty(e, r, t[r]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
});
}
return e;
}
function _objectWithoutProperties(e, t) {
if (null == e) return {};
var o,
r,
i = _objectWithoutPropertiesLoose(e, t);
if (Object.getOwnPropertySymbols) {
var n = Object.getOwnPropertySymbols(e);
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
}
return i;
}
function _objectWithoutPropertiesLoose(r, e) {
if (null == r) return {};
var t = {};
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
if (-1 !== e.indexOf(n)) continue;
t[n] = r[n];
}
return t;
}
function _slicedToArray(r, e) {
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
}
function _toPrimitive(t, r) {
if ("object" != typeof t || !t) return t;
var e = t[Symbol.toPrimitive];
if (void 0 !== e) {
var i = e.call(t, r);
if ("object" != typeof i) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === r ? String : Number)(t);
}
function _toPropertyKey(t) {
var i = _toPrimitive(t, "string");
return "symbol" == typeof i ? i : i + "";
}
function _unsupportedIterableToArray(r, a) {
if (r) {
if ("string" == typeof r) return _arrayLikeToArray(r, a);
var t = {}.toString.call(r).slice(8, -1);
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
}
}
/***/ }),
/***/ "./node_modules/@monaco-editor/loader/lib/es/config/index.js":
/*!*******************************************************************!*\
!*** ./node_modules/@monaco-editor/loader/lib/es/config/index.js ***!
\*******************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": function() { return /* binding */ config; }
/* harmony export */ });
var config = {
paths: {
vs: 'https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs'
}
};
/***/ }),
/***/ "./node_modules/@monaco-editor/loader/lib/es/index.js":
/*!************************************************************!*\
!*** ./node_modules/@monaco-editor/loader/lib/es/index.js ***!
\************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": function() { return /* reexport safe */ _loader_index_js__WEBPACK_IMPORTED_MODULE_0__["default"]; }
/* harmony export */ });
/* harmony import */ var _loader_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./loader/index.js */ "./node_modules/@monaco-editor/loader/lib/es/loader/index.js");
/***/ }),
/***/ "./node_modules/@monaco-editor/loader/lib/es/loader/index.js":
/*!*******************************************************************!*\
!*** ./node_modules/@monaco-editor/loader/lib/es/loader/index.js ***!
\*******************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": function() { return /* binding */ loader; }
/* harmony export */ });
/* harmony import */ var _virtual_rollupPluginBabelHelpers_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_virtual/_rollupPluginBabelHelpers.js */ "./node_modules/@monaco-editor/loader/lib/es/_virtual/_rollupPluginBabelHelpers.js");
/* harmony import */ var state_local__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! state-local */ "./node_modules/state-local/lib/es/state-local.js");
/* harmony import */ var _config_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../config/index.js */ "./node_modules/@monaco-editor/loader/lib/es/config/index.js");
/* harmony import */ var _validators_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../validators/index.js */ "./node_modules/@monaco-editor/loader/lib/es/validators/index.js");
/* harmony import */ var _utils_compose_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/compose.js */ "./node_modules/@monaco-editor/loader/lib/es/utils/compose.js");
/* harmony import */ var _utils_deepMerge_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/deepMerge.js */ "./node_modules/@monaco-editor/loader/lib/es/utils/deepMerge.js");
/* harmony import */ var _utils_makeCancelable_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utils/makeCancelable.js */ "./node_modules/@monaco-editor/loader/lib/es/utils/makeCancelable.js");
var _excluded = ["monaco"];
/** the local state of the module */
var _state$create = state_local__WEBPACK_IMPORTED_MODULE_1__["default"].create({
config: _config_index_js__WEBPACK_IMPORTED_MODULE_2__["default"],
isInitialized: false,
resolve: null,
reject: null,
monaco: null
}),
_state$create2 = (0,_virtual_rollupPluginBabelHelpers_js__WEBPACK_IMPORTED_MODULE_0__.slicedToArray)(_state$create, 2),
getState = _state$create2[0],
setState = _state$create2[1];
/**
* set the loader configuration
* @param {Object} config - the configuration object
*/
function config(globalConfig) {
var _validators$config = _validators_index_js__WEBPACK_IMPORTED_MODULE_3__["default"].config(globalConfig),
monaco = _validators$config.monaco,
config = (0,_virtual_rollupPluginBabelHelpers_js__WEBPACK_IMPORTED_MODULE_0__.objectWithoutProperties)(_validators$config, _excluded);
setState(function (state) {
return {
config: (0,_utils_deepMerge_js__WEBPACK_IMPORTED_MODULE_5__["default"])(state.config, config),
monaco: monaco
};
});
}
/**
* handles the initialization of the monaco-editor
* @return {Promise} - returns an instance of monaco (with a cancelable promise)
*/
function init() {
var state = getState(function (_ref) {
var monaco = _ref.monaco,
isInitialized = _ref.isInitialized,
resolve = _ref.resolve;
return {
monaco: monaco,
isInitialized: isInitialized,
resolve: resolve
};
});
if (!state.isInitialized) {
setState({
isInitialized: true
});
if (state.monaco) {
state.resolve(state.monaco);
return (0,_utils_makeCancelable_js__WEBPACK_IMPORTED_MODULE_6__["default"])(wrapperPromise);
}
if (window.monaco && window.monaco.editor) {
storeMonacoInstance(window.monaco);
state.resolve(window.monaco);
return (0,_utils_makeCancelable_js__WEBPACK_IMPORTED_MODULE_6__["default"])(wrapperPromise);
}
(0,_utils_compose_js__WEBPACK_IMPORTED_MODULE_4__["default"])(injectScripts, getMonacoLoaderScript)(configureLoader);
}
return (0,_utils_makeCancelable_js__WEBPACK_IMPORTED_MODULE_6__["default"])(wrapperPromise);
}
/**
* injects provided scripts into the document.body
* @param {Object} script - an HTML script element
* @return {Object} - the injected HTML script element
*/
function injectScripts(script) {
return document.body.appendChild(script);
}
/**
* creates an HTML script element with/without provided src
* @param {string} [src] - the source path of the script
* @return {Object} - the created HTML script element
*/
function createScript(src) {
var script = document.createElement('script');
return src && (script.src = src), script;
}
/**
* creates an HTML script element with the monaco loader src
* @return {Object} - the created HTML script element
*/
function getMonacoLoaderScript(configureLoader) {
var state = getState(function (_ref2) {
var config = _ref2.config,
reject = _ref2.reject;
return {
config: config,
reject: reject
};
});
var loaderScript = createScript("".concat(state.config.paths.vs, "/loader.js"));
loaderScript.onload = function () {
return configureLoader();
};
loaderScript.onerror = state.reject;
return loaderScript;
}
/**
* configures the monaco loader
*/
function configureLoader() {
var state = getState(function (_ref3) {
var config = _ref3.config,
resolve = _ref3.resolve,
reject = _ref3.reject;
return {
config: config,
resolve: resolve,
reject: reject
};
});
var require = window.require;
require.config(state.config);
require(['vs/editor/editor.main'], function (loaded) {
var monaco = loaded.m /* for 0.53 & 0.54 */ || loaded /* for other versions */;
storeMonacoInstance(monaco);
state.resolve(monaco);
}, function (error) {
state.reject(error);
});
}
/**
* store monaco instance in local state
*/
function storeMonacoInstance(monaco) {
if (!getState().monaco) {
setState({
monaco: monaco
});
}
}
/**
* internal helper function
* extracts stored monaco instance
* @return {Object|null} - the monaco instance
*/
function __getMonacoInstance() {
return getState(function (_ref4) {
var monaco = _ref4.monaco;
return monaco;
});
}
var wrapperPromise = new Promise(function (resolve, reject) {
return setState({
resolve: resolve,
reject: reject
});
});
var loader = {
config: config,
init: init,
__getMonacoInstance: __getMonacoInstance
};
/***/ }),
/***/ "./node_modules/@monaco-editor/loader/lib/es/utils/compose.js":
/*!********************************************************************!*\
!*** ./node_modules/@monaco-editor/loader/lib/es/utils/compose.js ***!
\********************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": function() { return /* binding */ compose; }
/* harmony export */ });
var compose = function compose() {
for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {
fns[_key] = arguments[_key];
}
return function (x) {
return fns.reduceRight(function (y, f) {
return f(y);
}, x);
};
};
/***/ }),
/***/ "./node_modules/@monaco-editor/loader/lib/es/utils/curry.js":
/*!******************************************************************!*\
!*** ./node_modules/@monaco-editor/loader/lib/es/utils/curry.js ***!
\******************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": function() { return /* binding */ curry; }
/* harmony export */ });
function curry(fn) {
return function curried() {
var _this = this;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return args.length >= fn.length ? fn.apply(this, args) : function () {
for (var _len2 = arguments.length, nextArgs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
nextArgs[_key2] = arguments[_key2];
}
return curried.apply(_this, [].concat(args, nextArgs));
};
};
}
/***/ }),
/***/ "./node_modules/@monaco-editor/loader/lib/es/utils/deepMerge.js":
/*!**********************************************************************!*\
!*** ./node_modules/@monaco-editor/loader/lib/es/utils/deepMerge.js ***!
\**********************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": function() { return /* binding */ merge; }
/* harmony export */ });
/* harmony import */ var _virtual_rollupPluginBabelHelpers_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_virtual/_rollupPluginBabelHelpers.js */ "./node_modules/@monaco-editor/loader/lib/es/_virtual/_rollupPluginBabelHelpers.js");
function merge(target, source) {
Object.keys(source).forEach(function (key) {
if (source[key] instanceof Object) {
if (target[key]) {
Object.assign(source[key], merge(target[key], source[key]));
}
}
});
return (0,_virtual_rollupPluginBabelHelpers_js__WEBPACK_IMPORTED_MODULE_0__.objectSpread2)((0,_virtual_rollupPluginBabelHelpers_js__WEBPACK_IMPORTED_MODULE_0__.objectSpread2)({}, target), source);
}
/***/ }),
/***/ "./node_modules/@monaco-editor/loader/lib/es/utils/isObject.js":
/*!*********************************************************************!*\
!*** ./node_modules/@monaco-editor/loader/lib/es/utils/isObject.js ***!
\*********************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": function() { return /* binding */ isObject; }
/* harmony export */ });
function isObject(value) {
return {}.toString.call(value).includes('Object');
}
/***/ }),
/***/ "./node_modules/@monaco-editor/loader/lib/es/utils/makeCancelable.js":
/*!***************************************************************************!*\
!*** ./node_modules/@monaco-editor/loader/lib/es/utils/makeCancelable.js ***!
\***************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ CANCELATION_MESSAGE: function() { return /* binding */ CANCELATION_MESSAGE; },
/* harmony export */ "default": function() { return /* binding */ makeCancelable; }
/* harmony export */ });
// The source (has been changed) is https://github.com/facebook/react/issues/5465#issuecomment-157888325
var CANCELATION_MESSAGE = {
type: 'cancelation',
msg: 'operation is manually canceled'
};
function makeCancelable(promise) {
var hasCanceled_ = false;
var wrappedPromise = new Promise(function (resolve, reject) {
promise.then(function (val) {
return hasCanceled_ ? reject(CANCELATION_MESSAGE) : resolve(val);
});
promise["catch"](reject);
});
return wrappedPromise.cancel = function () {
return hasCanceled_ = true;
}, wrappedPromise;
}
/***/ }),
/***/ "./node_modules/@monaco-editor/loader/lib/es/validators/index.js":
/*!***********************************************************************!*\
!*** ./node_modules/@monaco-editor/loader/lib/es/validators/index.js ***!
\***********************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": function() { return /* binding */ validators; },
/* harmony export */ errorHandler: function() { return /* binding */ errorHandler; },
/* harmony export */ errorMessages: function() { return /* binding */ errorMessages; }
/* harmony export */ });
/* harmony import */ var _utils_curry_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/curry.js */ "./node_modules/@monaco-editor/loader/lib/es/utils/curry.js");
/* harmony import */ var _utils_isObject_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/isObject.js */ "./node_modules/@monaco-editor/loader/lib/es/utils/isObject.js");
/**
* validates the configuration object and informs about deprecation
* @param {Object} config - the configuration object
* @return {Object} config - the validated configuration object
*/
function validateConfig(config) {
if (!config) errorHandler('configIsRequired');
if (!(0,_utils_isObject_js__WEBPACK_IMPORTED_MODULE_1__["default"])(config)) errorHandler('configType');
if (config.urls) {
informAboutDeprecation();
return {
paths: {
vs: config.urls.monacoBase
}
};
}
return config;
}
/**
* logs deprecation message
*/
function informAboutDeprecation() {
console.warn(errorMessages.deprecation);
}
function throwError(errorMessages, type) {
throw new Error(errorMessages[type] || errorMessages["default"]);
}
var errorMessages = {
configIsRequired: 'the configuration object is required',
configType: 'the configuration object should be an object',
"default": 'an unknown error accured in `@monaco-editor/loader` package',
deprecation: "Deprecation warning!\n You are using deprecated way of configuration.\n\n Instead of using\n monaco.config({ urls: { monacoBase: '...' } })\n use\n monaco.config({ paths: { vs: '...' } })\n\n For more please check the link https://github.com/suren-atoyan/monaco-loader#config\n "
};
var errorHandler = (0,_utils_curry_js__WEBPACK_IMPORTED_MODULE_0__["default"])(throwError)(errorMessages);
var validators = {
config: validateConfig
};
/***/ }),
/***/ "./packages/packages/pro/editor-controls-extended/src/components/css-code-editor/css-editor.styles.ts":
/*!************************************************************************************************************!*\
!*** ./packages/packages/pro/editor-controls-extended/src/components/css-code-editor/css-editor.styles.ts ***!
\************************************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ EditorWrapper: function() { return /* binding */ EditorWrapper; },
/* harmony export */ ResizeHandle: function() { return /* binding */ ResizeHandle; }
/* harmony export */ });
/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @elementor/ui */ "@elementor/ui");
/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_elementor_ui__WEBPACK_IMPORTED_MODULE_0__);
const EditorWrapper = (0,_elementor_ui__WEBPACK_IMPORTED_MODULE_0__.styled)((0,_elementor_ui__WEBPACK_IMPORTED_MODULE_0__.Box))`
/* @noflip */
direction: ltr;
border: 1px solid var( --e-a-border-color );
border-radius: 8px;
padding: 4px;
position: relative;
height: 200px;
.monaco-editor .suggest-widget {
width: 220px !important;
max-width: 220px !important;
z-index: 1001;
}
.visual-content-dimmed {
opacity: 0.6;
color: #aaa !important;
pointer-events: none;
}
.monaco-editor {
.margin-view-overlays > div:nth-of-type( 1 ) .cldr.codicon.codicon-folding-expanded {
visibility: hidden;
}
.monaco-scrollable-element {
> .scrollbar {
width: 6px !important;
> .slider {
width: 6px !important;
}
}
}
}
`;
const ResizeHandle = (0,_elementor_ui__WEBPACK_IMPORTED_MODULE_0__.styled)((0,_elementor_ui__WEBPACK_IMPORTED_MODULE_0__.Button))`
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 6px;
cursor: ns-resize;
background: transparent;
border: none;
padding: 0;
&:hover {
background: rgba( 0, 0, 0, 0.05 );
}
&:active {
background: rgba( 0, 0, 0, 0.1 );
}
&::after {
content: '';
position: absolute;
top: 50%;
left: 50%;
transform: translate( -50%, -50% );
width: 30px;
height: 2px;
background: var( --e-a-border-color );
border-radius: 1px;
}
`;
/***/ }),
/***/ "./packages/packages/pro/editor-controls-extended/src/components/css-code-editor/css-editor.tsx":
/*!******************************************************************************************************!*\
!*** ./packages/packages/pro/editor-controls-extended/src/components/css-code-editor/css-editor.tsx ***!
\******************************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ CssEditor: function() { return /* binding */ CssEditor; }
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _elementor_editor_controls__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @elementor/editor-controls */ "@elementor/editor-controls");
/* harmony import */ var _elementor_editor_controls__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_elementor_editor_controls__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _elementor_editor_ui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @elementor/editor-ui */ "@elementor/editor-ui");
/* harmony import */ var _elementor_editor_ui__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_elementor_editor_ui__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @elementor/ui */ "@elementor/ui");
/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_elementor_ui__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _monaco_editor_react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @monaco-editor/react */ "./node_modules/@monaco-editor/react/dist/index.mjs");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _css_editor_styles__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./css-editor.styles */ "./packages/packages/pro/editor-controls-extended/src/components/css-code-editor/css-editor.styles.ts");
/* harmony import */ var _css_validation__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./css-validation */ "./packages/packages/pro/editor-controls-extended/src/components/css-code-editor/css-validation.ts");
/* harmony import */ var _resize_handle__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./resize-handle */ "./packages/packages/pro/editor-controls-extended/src/components/css-code-editor/resize-handle.tsx");
/* harmony import */ var _visual_content_change_protection__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./visual-content-change-protection */ "./packages/packages/pro/editor-controls-extended/src/components/css-code-editor/visual-content-change-protection.ts");
const createEditorDidMountHandler = (editorRef, monacoRef, onUserContentChange, setIsValid, syntaxRuleOptions) => {
return (editor, monaco) => {
editorRef.current = editor;
monacoRef.current = monaco;
(0,_visual_content_change_protection__WEBPACK_IMPORTED_MODULE_9__.preventChangeOnVisualContent)(editor);
(0,_css_validation__WEBPACK_IMPORTED_MODULE_7__.setCustomSyntaxRules)(editor, monaco, syntaxRuleOptions);
const initialCode = editor.getModel()?.getValue() ?? '';
const initialUserContent = (0,_visual_content_change_protection__WEBPACK_IMPORTED_MODULE_9__.getActual)(initialCode);
onUserContentChange(initialUserContent);
monaco.editor.onDidChangeMarkers(() => {
(0,_css_validation__WEBPACK_IMPORTED_MODULE_7__.clearMarkersFromVisualContent)(editor, monaco);
setIsValid((0,_css_validation__WEBPACK_IMPORTED_MODULE_7__.validate)(editor, monaco));
});
editor.setPosition({
lineNumber: 2,
column: (editor.getModel()?.getLineContent(2).length ?? 0) + 1
});
disableFoldingFirstRow(editor);
// eslint-disable-next-line no-bitwise
editor.addCommand(monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyA, () => {
const editorModel = editor.getModel();
if (!editorModel) {
return;
}
const fullRange = editorModel.getFullModelRange();
const contentEndLine = fullRange.endLineNumber - 1;
let endColumn = editorModel.getLineLastNonWhitespaceColumn(contentEndLine);
if (endColumn === 0) {
endColumn = editorModel.getLineMaxColumn(contentEndLine);
}
editor.setSelection(new monaco.Selection(fullRange.startLineNumber + 1, fullRange.startColumn, contentEndLine, endColumn));
});
};
};
function disableFoldingFirstRow(editor) {
if (!(typeof editor.getDomNode === 'function')) {
return;
}
const marginViewOverlays = editor.getDomNode()?.querySelector('.margin-view-overlays');
const handler = event => {
const ev = event;
if (ev.button !== 0) {
return;
}
const target = ev.target;
const firstElem = marginViewOverlays?.children[0];
const isFirstRow = target === firstElem || target.parentElement === firstElem;
if (isFirstRow) {
event.preventDefault();
event.stopPropagation();
}
};
marginViewOverlays?.addEventListener('mousedown', handler);
editor.onDidDispose(() => {
marginViewOverlays?.removeEventListener('mousedown', handler);
});
}
const CssEditor = ({
value,
onChange,
syntaxRuleOptions,
readOnly = false
}) => {
const theme = (0,_elementor_ui__WEBPACK_IMPORTED_MODULE_3__.useTheme)();
const containerRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
const editorRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
const monacoRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
const debounceTimer = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
const [hasContent, setHasContent] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(value.trim() !== '');
const [isValid, setIsValid] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(true);
const [contentVersion, setContentVersion] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0);
useOnUpdate(() => {
const code = editorRef.current?.getModel()?.getValue() ?? '';
const userContent = (0,_visual_content_change_protection__WEBPACK_IMPORTED_MODULE_9__.getActual)(code);
setHasContent(!userContent.trim());
onChange(userContent, isValid);
}, [contentVersion, isValid]);
const handleUserContentChange = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(newValue => {
setHasContent(newValue.trim() !== '');
}, []);
const handleResize = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {
editorRef.current?.layout();
}, []);
const handleHeightChange = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(height => {
if (containerRef.current) {
containerRef.current.style.height = `${height}px`;
}
}, []);
const handleEditorChange = () => {
if (!editorRef.current || !monacoRef.current) {
return;
}
(0,_css_validation__WEBPACK_IMPORTED_MODULE_7__.setCustomSyntaxRules)(editorRef?.current, monacoRef.current, syntaxRuleOptions);
if (debounceTimer.current) {
clearTimeout(debounceTimer.current);
}
debounceTimer.current = setTimeout(() => {
setContentVersion(prev => prev + 1);
}, 500);
};
const handleEditorDidMount = createEditorDidMountHandler(editorRef, monacoRef, handleUserContentChange, setIsValid, syntaxRuleOptions);
const handleReset = () => editorRef.current?.getModel()?.setValue((0,_visual_content_change_protection__WEBPACK_IMPORTED_MODULE_9__.setVisualContent)(''));
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
const timerRef = debounceTimer;
return () => {
const timer = timerRef.current;
if (timer) {
clearTimeout(timer);
}
};
}, []);
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_editor_ui__WEBPACK_IMPORTED_MODULE_2__.FloatingActionsBar, {
actions: hasContent ? [/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_editor_controls__WEBPACK_IMPORTED_MODULE_1__.ClearIconButton, {
key: "clear",
tooltipText: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Clear', 'elementor-pro'),
onClick: handleReset
})] : []
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_3__.Box, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_css_editor_styles__WEBPACK_IMPORTED_MODULE_6__.EditorWrapper, {
ref: containerRef,
dir: "ltr"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_monaco_editor_react__WEBPACK_IMPORTED_MODULE_4__.Editor, {
height: "100%",
language: "css",
theme: theme.palette.mode === 'dark' ? 'vs-dark' : 'vs',
value: (0,_visual_content_change_protection__WEBPACK_IMPORTED_MODULE_9__.setVisualContent)(value),
onMount: handleEditorDidMount,
onChange: handleEditorChange,
options: {
lineNumbers: 'on',
lineNumbersMinChars: 3,
folding: true,
minimap: {
enabled: false
},
fontFamily: 'Roboto, Arial, Helvetica, Verdana, sans-serif',
fontSize: 12,
renderLineHighlight: 'none',
hideCursorInOverviewRuler: true,
overviewRulerBorder: false,
fixedOverflowWidgets: true,
suggestFontSize: 10,
suggestLineHeight: 14,
stickyScroll: {
enabled: false
},
lineDecorationsWidth: 2,
wordWrap: 'on',
scrollBeyondLastLine: false,
readOnly,
editContext: false
}
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_resize_handle__WEBPACK_IMPORTED_MODULE_8__.ResizeHandleComponent, {
onResize: handleResize,
containerRef: containerRef,
onHeightChange: handleHeightChange
}))));
};
function useOnUpdate(callback, dependencies) {
const hasMounted = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(false);
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
if (hasMounted.current) {
callback();
} else {
hasMounted.current = true;
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, dependencies);
}
/***/ }),
/***/ "./packages/packages/pro/editor-controls-extended/src/components/css-code-editor/css-validation.ts":
/*!*********************************************************************************************************!*\
!*** ./packages/packages/pro/editor-controls-extended/src/components/css-code-editor/css-validation.ts ***!
\*********************************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ clearMarkersFromVisualContent: function() { return /* binding */ clearMarkersFromVisualContent; },
/* harmony export */ setCustomSyntaxRules: function() { return /* binding */ setCustomSyntaxRules; },
/* harmony export */ validate: function() { return /* binding */ validate; }
/* harmony export */ });
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
const syntaxRules = {
pseudoState: {
pattern: '^\\s*[&]{0,1}\\s*(?::hover|:active|:focus)',
regex: true,
message: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('The use of pseudo-states is not permitted. Instead, switch to the desired pseudo state and add your custom code there.', 'elementor-pro')
},
mediaQuery: {
pattern: '@media\\s+[^{]*\\b(?:min-width|max-width|width)\\b',
regex: true,
message: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('The use of @media width queries is not permitted. Instead, switch to the desired breakpoint and add your custom code there.', 'elementor-pro')
}
};
function setCustomSyntaxRules(editor, monaco, options) {
const model = editor.getModel();
if (!model) {
return true;
}
const customMarkers = [];
Object.entries(syntaxRules).forEach(([id, rule]) => {
if (options?.rules?.[id] === false) {
return;
}
const matches = model.findMatches(rule.pattern, true, rule.regex ?? false, true, null, true);
matches.forEach(match => {
customMarkers.push({
severity: monaco.MarkerSeverity.Error,
message: rule.message,
startLineNumber: match.range.startLineNumber,
startColumn: match.range.startColumn,
endLineNumber: match.range.endLineNumber,
endColumn: match.range.endColumn,
source: 'custom-css-rules'
});
});
});
monaco.editor.setModelMarkers(model, 'custom-css-rules', customMarkers);
return customMarkers.length === 0;
}
function validate(editor, monaco) {
const model = editor.getModel();
if (!model) {
return true;
}
const allMarkers = monaco.editor.getModelMarkers({
resource: model.uri
});
return allMarkers.filter(marker => marker.severity === monaco.MarkerSeverity.Error).length === 0;
}
function clearMarkersFromVisualContent(editor, monaco) {
const model = editor.getModel();
if (!model) {
return;
}
const allMarkers = monaco.editor.getModelMarkers({
resource: model.uri
});
const filteredMarkers = allMarkers.filter(marker => marker.startLineNumber !== 1);
const nonCustomMarkers = filteredMarkers.filter(m => m.source !== 'custom-css-rules');
if (nonCustomMarkers.length === allMarkers.length) {
return;
}
monaco.editor.setModelMarkers(model, 'css', nonCustomMarkers);
}
/***/ }),
/***/ "./packages/packages/pro/editor-controls-extended/src/components/css-code-editor/resize-handle.tsx":
/*!*********************************************************************************************************!*\
!*** ./packages/packages/pro/editor-controls-extended/src/components/css-code-editor/resize-handle.tsx ***!
\*********************************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ ResizeHandleComponent: function() { return /* binding */ ResizeHandleComponent; }
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _css_editor_styles__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./css-editor.styles */ "./packages/packages/pro/editor-controls-extended/src/components/css-code-editor/css-editor.styles.ts");
const ResizeHandleComponent = ({
onResize,
containerRef,
onHeightChange
}) => {
const handleResizeMove = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(e => {
const container = containerRef.current;
if (!container) {
return;
}
const containerRect = container.getBoundingClientRect();
const newHeight = Math.max(100, e.clientY - containerRect.top);
onHeightChange?.(newHeight);
onResize(newHeight);
}, [containerRef, onResize, onHeightChange]);
const handleResizeEnd = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(() => {
document.removeEventListener('mousemove', handleResizeMove);
document.removeEventListener('mouseup', handleResizeEnd);
}, [handleResizeMove]);
const handleResizeStart = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(e => {
e.preventDefault();
e.stopPropagation();
document.addEventListener('mousemove', handleResizeMove);
document.addEventListener('mouseup', handleResizeEnd);
}, [handleResizeMove, handleResizeEnd]);
react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
return () => {
document.removeEventListener('mousemove', handleResizeMove);
document.removeEventListener('mouseup', handleResizeEnd);
};
}, [handleResizeMove, handleResizeEnd]);
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_css_editor_styles__WEBPACK_IMPORTED_MODULE_1__.ResizeHandle, {
onMouseDown: handleResizeStart,
"aria-label": "Resize editor height",
title: "Drag to resize editor height"
});
};
/***/ }),
/***/ "./packages/packages/pro/editor-controls-extended/src/components/css-code-editor/visual-content-change-protection.ts":
/*!***************************************************************************************************************************!*\
!*** ./packages/packages/pro/editor-controls-extended/src/components/css-code-editor/visual-content-change-protection.ts ***!
\***************************************************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ getActual: function() { return /* binding */ getActual; },
/* harmony export */ preventChangeOnVisualContent: function() { return /* binding */ preventChangeOnVisualContent; },
/* harmony export */ setVisualContent: function() { return /* binding */ setVisualContent; }
/* harmony export */ });
const preventChangeOnVisualContent = editor => {
const model = editor.getModel();
if (!model) {
return;
}
// On first load
applyVisualContentStyling(editor, model);
// On every change
model.onDidChangeContent(() => {
applyVisualContentStyling(editor, model);
});
disableCursorOnVisualContent(editor);
overridePushEditOperations(model);
};
const applyVisualContentStyling = (editor, model) => {
const decorationsCollection = editor.createDecorationsCollection();
const lineCount = model.getLineCount();
const decorations = [];
decorations.push({
range: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 1,
endColumn: model.getLineContent(1).length + 1
},
options: {
inlineClassName: 'visual-content-dimmed',
isWholeLine: false
}
});
if (lineCount > 1) {
decorations.push({
range: {
startLineNumber: lineCount,
startColumn: 1,
endLineNumber: lineCount,
endColumn: model.getLineContent(lineCount).length + 1
},
options: {
inlineClassName: 'visual-content-dimmed',
isWholeLine: false
}
});
}
decorationsCollection.set(decorations);
};
const disableCursorOnVisualContent = editor => {
const model = editor.getModel();
if (!model) {
return;
}
editor.onDidChangeCursorPosition(e => {
const totalLines = model.getLineCount();
const position = e.position;
if (position.lineNumber === 1) {
editor.setPosition({
lineNumber: 2,
column: 1
});
} else if (position.lineNumber === totalLines) {
editor.setPosition({
lineNumber: totalLines - 1,
column: model.getLineContent(totalLines - 1).length + 1
});
}
});
};
const overridePushEditOperations = model => {
const originalPushEditOperations = model.pushEditOperations;
model.pushEditOperations = (beforeCursorState, editOperations, cursorStateComputer) => {
const totalLines = model.getLineCount();
const modelRange = model.getFullModelRange();
const filteredOperations = editOperations.filter(operation => {
const range = operation.range;
const affectsProtectedLine = range.startLineNumber === 1 || range.endLineNumber === 1 || range.startLineNumber === totalLines || range.endLineNumber === totalLines;
if (affectsProtectedLine && isFullContentReplacement(range, modelRange) && hasVisualContent(operation.text)) {
return true;
}
return !affectsProtectedLine;
});
return originalPushEditOperations.call(model, beforeCursorState, filteredOperations, cursorStateComputer);
};
};
const isFullContentReplacement = (range, modelRange) => {
return range.startLineNumber === modelRange.startLineNumber && range.endLineNumber === modelRange.endLineNumber && range.startColumn === modelRange.startColumn && range.endColumn === modelRange.endColumn;
};
const hasVisualContent = text => {
if (!text) {
return false;
}
return text.startsWith('element.style {') && text.endsWith('}');
};
const setVisualContent = value => {
const trimmed = value.trim();
return `element.style {\n${trimmed ? ' ' + trimmed.replace(/\n/g, '\n ') + '\n' : ' \n'}}`;
};
const getActual = value => {
const lines = value.split('\n');
if (lines.length < 2) {
return '';
}
return lines.slice(1, -1).map(line => line.replace(/^ {2}/, '')).join('\n');
};
/***/ }),
/***/ "./packages/packages/pro/editor-controls-extended/src/controls/attributes-control.tsx":
/*!********************************************************************************************!*\
!*** ./packages/packages/pro/editor-controls-extended/src/controls/attributes-control.tsx ***!
\********************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ AttributesControl: function() { return /* binding */ AttributesControl; }
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _elementor_editor_controls__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @elementor/editor-controls */ "@elementor/editor-controls");
/* harmony import */ var _elementor_editor_controls__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_elementor_editor_controls__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
const AttributesControl = (0,_elementor_editor_controls__WEBPACK_IMPORTED_MODULE_1__.createControl)(() => {
const getHelperText = (key, value) => {
if (value && !key) {
return {
keyHelper: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("Empty attribute names aren't valid and won't render on the page.", 'elementor-pro')
};
}
return {};
};
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_editor_controls__WEBPACK_IMPORTED_MODULE_1__.KeyValueControl, {
keyName: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Name', 'elementor-pro'),
valueName: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Value', 'elementor-pro'),
regexKey: "^[a-zA-Z0-9_-]*$",
validationErrorMessage: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Names can only use letters, numbers, dashes (-) and underscores (_).', 'elementor-pro'),
getHelperText: getHelperText
});
});
/***/ }),
/***/ "./packages/packages/pro/editor-controls-extended/src/controls/display-conditions-control.tsx":
/*!****************************************************************************************************!*\
!*** ./packages/packages/pro/editor-controls-extended/src/controls/display-conditions-control.tsx ***!
\****************************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ DisplayConditionsControl: function() { return /* binding */ DisplayConditionsControl; }
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _elementor_editor_controls__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @elementor/editor-controls */ "@elementor/editor-controls");
/* harmony import */ var _elementor_editor_controls__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_elementor_editor_controls__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _elementor_icons__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @elementor/icons */ "@elementor/icons");
/* harmony import */ var _elementor_icons__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_elementor_icons__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @elementor/ui */ "@elementor/ui");
/* harmony import */ var _elementor_ui__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_elementor_ui__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _prop_types_display_conditions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../prop-types/display-conditions */ "./packages/packages/pro/editor-controls-extended/src/prop-types/display-conditions.ts");
/* harmony import */ var _utils_display_conditions_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utils/display-conditions-utils */ "./packages/packages/pro/editor-controls-extended/src/utils/display-conditions-utils.ts");
const OPEN_MODAL_EVENT = 'elementor/display-conditions/open';
const CLOSE_MODAL_EVENT = 'elementor/display-conditions/close';
const SET_CACHE_NOTICE_STATUS_EVENT = 'elementor/display-conditions/set-cache-notice-status';
const ariaLabel = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Display Conditions', 'elementor-pro');
async function setCacheNoticeStatus() {
return new Promise((resolve, reject) => {
window.dispatchEvent(new CustomEvent(SET_CACHE_NOTICE_STATUS_EVENT, {
detail: {
resolve,
reject
}
}));
});
}
const DisplayConditionsControl = (0,_elementor_editor_controls__WEBPACK_IMPORTED_MODULE_1__.createControl)(({
disabled = false
}) => {
const {
setValue,
value: displayConditionsValue
} = (0,_elementor_editor_controls__WEBPACK_IMPORTED_MODULE_1__.useBoundProp)(_prop_types_display_conditions__WEBPACK_IMPORTED_MODULE_5__.displayConditionsPropTypeUtil);
const [isModalOpen, setIsModalOpen] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
const hasValue = !!displayConditionsValue?.length;
const setControlValue = value => setValue((0,_utils_display_conditions_utils__WEBPACK_IMPORTED_MODULE_6__.transformV3ToV4)(JSON.parse(value ?? '[]')));
const getControlValue = () => (0,_utils_display_conditions_utils__WEBPACK_IMPORTED_MODULE_6__.transformV4ToV3)(displayConditionsValue) ?? [];
const onClose = () => {
setIsModalOpen(false);
window.dispatchEvent(new CustomEvent(CLOSE_MODAL_EVENT));
};
const conditions = getControlValue();
const openConditionsModal = () => {
setIsModalOpen(true);
window.dispatchEvent(new CustomEvent(OPEN_MODAL_EVENT, {
detail: {
props: {
getControlValue,
setControlValue,
onClose,
setCacheNoticeStatus
}
}
}));
};
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_3__.Stack, {
direction: "row",
spacing: 2,
sx: {
justifyContent: 'flex-end',
alignItems: 'center'
}
}, disabled && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_3__.Chip, {
icon: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_icons__WEBPACK_IMPORTED_MODULE_2__.CrownFilledIcon, {
fontSize: "tiny"
}),
size: "tiny",
color: "promotion",
variant: "standard",
sx: {
width: '20px',
'& .MuiChip-label': {
display: 'none'
}
}
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_3__.Tooltip, {
title: ariaLabel,
placement: "top"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_3__.Box, {
sx: {
cursor: disabled ? 'not-allowed' : 'pointer',
display: 'inline-flex'
}
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_ui__WEBPACK_IMPORTED_MODULE_3__.ToggleButton, {
value: JSON.stringify(conditions),
size: "tiny",
variant: "outline",
"aria-pressed": hasValue,
"aria-expanded": isModalOpen,
selected: hasValue,
"aria-haspopup": "dialog",
"aria-label": ariaLabel,
onClick: openConditionsModal,
disabled: disabled,
sx: {
pointerEvents: disabled ? 'none' : 'auto'
},
"data-behavior": "display-conditions"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_icons__WEBPACK_IMPORTED_MODULE_2__.SitemapIcon, {
fontSize: "tiny"
}))))));
});
/***/ }),
/***/ "./packages/packages/pro/editor-controls-extended/src/controls/options-control.tsx":
/*!*****************************************************************************************!*\
!*** ./packages/packages/pro/editor-controls-extended/src/controls/options-control.tsx ***!
\*****************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ OptionsControl: function() { return /* binding */ OptionsControl; }
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _elementor_editor_controls__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @elementor/editor-controls */ "@elementor/editor-controls");
/* harmony import */ var _elementor_editor_controls__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_elementor_editor_controls__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
const OptionsControl = (0,_elementor_editor_controls__WEBPACK_IMPORTED_MODULE_1__.createControl)(() => {
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_elementor_editor_controls__WEBPACK_IMPORTED_MODULE_1__.KeyValueControl, {
keyName: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Name', 'elementor-pro'),
valueName: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Value', 'elementor-pro')
});
});
/***/ }),
/***/ "./packages/packages/pro/editor-controls-extended/src/extend-transition-properties.ts":
/*!********************************************************************************************!*\
!*** ./packages/packages/pro/editor-controls-extended/src/extend-transition-properties.ts ***!
\********************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ extendTransitionProperties: function() { return /* binding */ extendTransitionProperties; },
/* harmony export */ transitionProperties: function() { return /* reexport safe */ _elementor_editor_controls__WEBPACK_IMPORTED_MODULE_0__.transitionProperties; },
/* harmony export */ transitionsItemsList: function() { return /* reexport safe */ _elementor_editor_controls__WEBPACK_IMPORTED_MODULE_0__.transitionsItemsList; }
/* harmony export */ });
/* harmony import */ var _elementor_editor_controls__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @elementor/editor-controls */ "@elementor/editor-controls");
/* harmony import */ var _elementor_editor_controls__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_elementor_editor_controls__WEBPACK_IMPORTED_MODULE_0__);
function extendTransitionProperties(isDisabled = false) {
if (!_elementor_editor_controls__WEBPACK_IMPORTED_MODULE_0__.transitionProperties || _elementor_editor_controls__WEBPACK_IMPORTED_MODULE_0__.transitionProperties.length === 0) {
return;
}
_elementor_editor_controls__WEBPACK_IMPORTED_MODULE_0__.transitionProperties.forEach(category => {
category.properties.forEach(property => {
if (property.value !== 'all') {
property.isDisabled = isDisabled;
}
});
});
_elementor_editor_controls__WEBPACK_IMPORTED_MODULE_0__.transitionsItemsList.splice(0, _elementor_editor_controls__WEBPACK_IMPORTED_MODULE_0__.transitionsItemsList.length, ..._elementor_editor_controls__WEBPACK_IMPORTED_MODULE_0__.transitionProperties.map(category => ({
label: category.label,
items: category.properties.map(property => property.label)
})));
}
/***/ }),
/***/ "./packages/packages/pro/editor-controls-extended/src/init.ts":
/*!********************************************************************!*\
!*** ./packages/packages/pro/editor-controls-extended/src/init.ts ***!
\********************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ init: function() { return /* binding */ init; }
/* harmony export */ });
/* harmony import */ var _elementor_license_api__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @elementor/license-api */ "@elementor/license-api");
/* harmony import */ var _elementor_license_api__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_elementor_license_api__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _extend_transition_properties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./extend-transition-properties */ "./packages/packages/pro/editor-controls-extended/src/extend-transition-properties.ts");
async function init() {
const [isExpired, features] = await Promise.all([(0,_elementor_license_api__WEBPACK_IMPORTED_MODULE_0__.fetchLicenseStatus)().catch(() => false), (0,_elementor_license_api__WEBPACK_IMPORTED_MODULE_0__.fetchTierFeatures)().catch(() => [])]);
if (features.includes('transitions')) {
(0,_extend_transition_properties__WEBPACK_IMPORTED_MODULE_1__.extendTransitionProperties)(isExpired);
}
}
/***/ }),
/***/ "./packages/packages/pro/editor-controls-extended/src/prop-types/condition-group.ts":
/*!******************************************************************************************!*\
!*** ./packages/packages/pro/editor-controls-extended/src/prop-types/condition-group.ts ***!
\******************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ conditionGroupPropTypeUtil: function() { return /* binding */ conditionGroupPropTypeUtil; }
/* harmony export */ });
/* harmony import */ var _elementor_editor_props__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @elementor/editor-props */ "@elementor/editor-props");
/* harmony import */ var _elementor_editor_props__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_elementor_editor_props__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _elementor_schema__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @elementor/schema */ "@elementor/schema");
/* harmony import */ var _elementor_schema__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_elementor_schema__WEBPACK_IMPORTED_MODULE_1__);
const unknownChildrenSchema = _elementor_schema__WEBPACK_IMPORTED_MODULE_1__.z.any().nullable();
const conditionGroupPropTypeUtil = (0,_elementor_editor_props__WEBPACK_IMPORTED_MODULE_0__.createPropUtils)('condition-group', _elementor_schema__WEBPACK_IMPORTED_MODULE_1__.z.array(unknownChildrenSchema));
/***/ }),
/***/ "./packages/packages/pro/editor-controls-extended/src/prop-types/display-conditions.ts":
/*!*********************************************************************************************!*\
!*** ./packages/packages/pro/editor-controls-extended/src/prop-types/display-conditions.ts ***!
\*********************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ displayConditionsPropTypeUtil: function() { return /* binding */ displayConditionsPropTypeUtil; }
/* harmony export */ });
/* harmony import */ var _elementor_editor_props__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @elementor/editor-props */ "@elementor/editor-props");
/* harmony import */ var _elementor_editor_props__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_elementor_editor_props__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _elementor_schema__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @elementor/schema */ "@elementor/schema");
/* harmony import */ var _elementor_schema__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_elementor_schema__WEBPACK_IMPORTED_MODULE_1__);
const unknownChildrenSchema = _elementor_schema__WEBPACK_IMPORTED_MODULE_1__.z.any().nullable();
const displayConditionsPropTypeUtil = (0,_elementor_editor_props__WEBPACK_IMPORTED_MODULE_0__.createPropUtils)('display-conditions', _elementor_schema__WEBPACK_IMPORTED_MODULE_1__.z.array(unknownChildrenSchema));
/***/ }),
/***/ "./packages/packages/pro/editor-controls-extended/src/utils/display-conditions-utils.ts":
/*!**********************************************************************************************!*\
!*** ./packages/packages/pro/editor-controls-extended/src/utils/display-conditions-utils.ts ***!
\**********************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ transformV3ToV4: function() { return /* binding */ transformV3ToV4; },
/* harmony export */ transformV4ToV3: function() { return /* binding */ transformV4ToV3; }
/* harmony export */ });
/* harmony import */ var _elementor_editor_props__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @elementor/editor-props */ "@elementor/editor-props");
/* harmony import */ var _elementor_editor_props__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_elementor_editor_props__WEBPACK_IMPORTED_MODULE_0__);
// Value must be falsy for navigator indication to work properly
function transformV3ToV4(displayConditions) {
if (!Array.isArray(displayConditions) || !displayConditions?.length) {
return null;
}
const transformed = displayConditions.filter(conditionGroup => !!conditionGroup?.length).map(conditionGroup => ({
$$type: 'condition-group',
value: conditionGroup.map(condition => _elementor_editor_props__WEBPACK_IMPORTED_MODULE_0__.stringPropTypeUtil.create(JSON.stringify(condition)))
}));
return transformed.length ? transformed : null;
}
function transformV4ToV3(value) {
const conditionGroups = value;
const transformed = conditionGroups?.map(group => group.value.map(conditions => {
return JSON.parse(_elementor_editor_props__WEBPACK_IMPORTED_MODULE_0__.stringPropTypeUtil.extract(conditions) ?? '[]');
})) ?? null;
return getStructuredConditions(transformed);
}
function shouldConvertConditionsStructure(conditions) {
return !!conditions?.length && !Array.isArray(conditions?.[0]);
}
function getStructuredConditions(conditions) {
return shouldConvertConditionsStructure(conditions) ? [conditions] : conditions;
}
/***/ }),
/***/ "./node_modules/state-local/lib/es/state-local.js":
/*!********************************************************!*\
!*** ./node_modules/state-local/lib/es/state-local.js ***!
\********************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
function _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;
}
function 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;
}
function _objectSpread2(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;
}
function compose() {
for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {
fns[_key] = arguments[_key];
}
return function (x) {
return fns.reduceRight(function (y, f) {
return f(y);
}, x);
};
}
function curry(fn) {
return function curried() {
var _this = this;
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
return args.length >= fn.length ? fn.apply(this, args) : function () {
for (var _len3 = arguments.length, nextArgs = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
nextArgs[_key3] = arguments[_key3];
}
return curried.apply(_this, [].concat(args, nextArgs));
};
};
}
function isObject(value) {
return {}.toString.call(value).includes('Object');
}
function isEmpty(obj) {
return !Object.keys(obj).length;
}
function isFunction(value) {
return typeof value === 'function';
}
function hasOwnProperty(object, property) {
return Object.prototype.hasOwnProperty.call(object, property);
}
function validateChanges(initial, changes) {
if (!isObject(changes)) errorHandler('changeType');
if (Object.keys(changes).some(function (field) {
return !hasOwnProperty(initial, field);
})) errorHandler('changeField');
return changes;
}
function validateSelector(selector) {
if (!isFunction(selector)) errorHandler('selectorType');
}
function validateHandler(handler) {
if (!(isFunction(handler) || isObject(handler))) errorHandler('handlerType');
if (isObject(handler) && Object.values(handler).some(function (_handler) {
return !isFunction(_handler);
})) errorHandler('handlersType');
}
function validateInitial(initial) {
if (!initial) errorHandler('initialIsRequired');
if (!isObject(initial)) errorHandler('initialType');
if (isEmpty(initial)) errorHandler('initialContent');
}
function throwError(errorMessages, type) {
throw new Error(errorMessages[type] || errorMessages["default"]);
}
var errorMessages = {
initialIsRequired: 'initial state is required',
initialType: 'initial state should be an object',
initialContent: 'initial state shouldn\'t be an empty object',
handlerType: 'handler should be an object or a function',
handlersType: 'all handlers should be a functions',
selectorType: 'selector should be a function',
changeType: 'provided value of changes should be an object',
changeField: 'it seams you want to change a field in the state which is not specified in the "initial" state',
"default": 'an unknown error accured in `state-local` package'
};
var errorHandler = curry(throwError)(errorMessages);
var validators = {
changes: validateChanges,
selector: validateSelector,
handler: validateHandler,
initial: validateInitial
};
function create(initial) {
var handler = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
validators.initial(initial);
validators.handler(handler);
var state = {
current: initial
};
var didUpdate = curry(didStateUpdate)(state, handler);
var update = curry(updateState)(state);
var validate = curry(validators.changes)(initial);
var getChanges = curry(extractChanges)(state);
function getState() {
var selector = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (state) {
return state;
};
validators.selector(selector);
return selector(state.current);
}
function setState(causedChanges) {
compose(didUpdate, update, validate, getChanges)(causedChanges);
}
return [getState, setState];
}
function extractChanges(state, causedChanges) {
return isFunction(causedChanges) ? causedChanges(state.current) : causedChanges;
}
function updateState(state, changes) {
state.current = _objectSpread2(_objectSpread2({}, state.current), changes);
return changes;
}
function didStateUpdate(state, handler, changes) {
isFunction(handler) ? handler(state.current) : Object.keys(changes).forEach(function (field) {
var _handler$field;
return (_handler$field = handler[field]) === null || _handler$field === void 0 ? void 0 : _handler$field.call(handler, state.current[field]);
});
return changes;
}
var index = {
create: create
};
/* harmony default export */ __webpack_exports__["default"] = (index);
/***/ }),
/***/ "react":
/*!**************************!*\
!*** external ["React"] ***!
\**************************/
/***/ (function(module) {
module.exports = window["React"];
/***/ }),
/***/ "@elementor/editor-controls":
/*!*************************************************!*\
!*** external ["elementorV2","editorControls"] ***!
\*************************************************/
/***/ (function(module) {
module.exports = window["elementorV2"]["editorControls"];
/***/ }),
/***/ "@elementor/editor-props":
/*!**********************************************!*\
!*** external ["elementorV2","editorProps"] ***!
\**********************************************/
/***/ (function(module) {
module.exports = window["elementorV2"]["editorProps"];
/***/ }),
/***/ "@elementor/editor-ui":
/*!*******************************************!*\
!*** external ["elementorV2","editorUi"] ***!
\*******************************************/
/***/ (function(module) {
module.exports = window["elementorV2"]["editorUi"];
/***/ }),
/***/ "@elementor/icons":
/*!****************************************!*\
!*** external ["elementorV2","icons"] ***!
\****************************************/
/***/ (function(module) {
module.exports = window["elementorV2"]["icons"];
/***/ }),
/***/ "@elementor/license-api":
/*!*********************************************!*\
!*** external ["elementorV2","licenseApi"] ***!
\*********************************************/
/***/ (function(module) {
module.exports = window["elementorV2"]["licenseApi"];
/***/ }),
/***/ "@elementor/schema":
/*!*****************************************!*\
!*** external ["elementorV2","schema"] ***!
\*****************************************/
/***/ (function(module) {
module.exports = window["elementorV2"]["schema"];
/***/ }),
/***/ "@elementor/ui":
/*!*************************************!*\
!*** external ["elementorV2","ui"] ***!
\*************************************/
/***/ (function(module) {
module.exports = window["elementorV2"]["ui"];
/***/ }),
/***/ "@wordpress/i18n":
/*!******************************!*\
!*** external ["wp","i18n"] ***!
\******************************/
/***/ (function(module) {
module.exports = window["wp"]["i18n"];
/***/ }),
/***/ "./node_modules/@monaco-editor/react/dist/index.mjs":
/*!**********************************************************!*\
!*** ./node_modules/@monaco-editor/react/dist/index.mjs ***!
\**********************************************************/
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ DiffEditor: function() { return /* binding */ we; },
/* harmony export */ Editor: function() { return /* binding */ de; },
/* harmony export */ "default": function() { return /* binding */ Ft; },
/* harmony export */ loader: function() { return /* reexport safe */ _monaco_editor_loader__WEBPACK_IMPORTED_MODULE_0__["default"]; },
/* harmony export */ useMonaco: function() { return /* binding */ Le; }
/* harmony export */ });
/* harmony import */ var _monaco_editor_loader__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @monaco-editor/loader */ "./node_modules/@monaco-editor/loader/lib/es/index.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react");
var le={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},v=le;var ae={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},Y=ae;function Me({children:e}){return react__WEBPACK_IMPORTED_MODULE_1__.createElement("div",{style:Y.container},e)}var Z=Me;var $=Z;function Ee({width:e,height:r,isEditorReady:n,loading:t,_ref:a,className:m,wrapperProps:E}){return react__WEBPACK_IMPORTED_MODULE_1__.createElement("section",{style:{...v.wrapper,width:e,height:r},...E},!n&&react__WEBPACK_IMPORTED_MODULE_1__.createElement($,null,t),react__WEBPACK_IMPORTED_MODULE_1__.createElement("div",{ref:a,style:{...v.fullWidth,...!n&&v.hide},className:m}))}var ee=Ee;var H=(0,react__WEBPACK_IMPORTED_MODULE_1__.memo)(ee);function Ce(e){(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(e,[])}var k=Ce;function he(e,r,n=!0){let t=(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(!0);(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(t.current||!n?()=>{t.current=!1}:e,r)}var l=he;function D(){}function h(e,r,n,t){return De(e,t)||be(e,r,n,t)}function De(e,r){return e.editor.getModel(te(e,r))}function be(e,r,n,t){return e.editor.createModel(r,n,t?te(e,t):void 0)}function te(e,r){return e.Uri.parse(r)}function Oe({original:e,modified:r,language:n,originalLanguage:t,modifiedLanguage:a,originalModelPath:m,modifiedModelPath:E,keepCurrentOriginalModel:g=!1,keepCurrentModifiedModel:N=!1,theme:x="light",loading:P="Loading...",options:y={},height:V="100%",width:z="100%",className:F,wrapperProps:j={},beforeMount:A=D,onMount:q=D}){let[M,O]=(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1),[T,s]=(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!0),u=(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null),c=(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null),w=(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null),d=(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(q),o=(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(A),b=(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(!1);k(()=>{let i=_monaco_editor_loader__WEBPACK_IMPORTED_MODULE_0__["default"].init();return i.then(f=>(c.current=f)&&s(!1)).catch(f=>f?.type!=="cancelation"&&console.error("Monaco initialization: error:",f)),()=>u.current?I():i.cancel()}),l(()=>{if(u.current&&c.current){let i=u.current.getOriginalEditor(),f=h(c.current,e||"",t||n||"text",m||"");f!==i.getModel()&&i.setModel(f)}},[m],M),l(()=>{if(u.current&&c.current){let i=u.current.getModifiedEditor(),f=h(c.current,r||"",a||n||"text",E||"");f!==i.getModel()&&i.setModel(f)}},[E],M),l(()=>{let i=u.current.getModifiedEditor();i.getOption(c.current.editor.EditorOption.readOnly)?i.setValue(r||""):r!==i.getValue()&&(i.executeEdits("",[{range:i.getModel().getFullModelRange(),text:r||"",forceMoveMarkers:!0}]),i.pushUndoStop())},[r],M),l(()=>{u.current?.getModel()?.original.setValue(e||"")},[e],M),l(()=>{let{original:i,modified:f}=u.current.getModel();c.current.editor.setModelLanguage(i,t||n||"text"),c.current.editor.setModelLanguage(f,a||n||"text")},[n,t,a],M),l(()=>{c.current?.editor.setTheme(x)},[x],M),l(()=>{u.current?.updateOptions(y)},[y],M);let L=(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(()=>{if(!c.current)return;o.current(c.current);let i=h(c.current,e||"",t||n||"text",m||""),f=h(c.current,r||"",a||n||"text",E||"");u.current?.setModel({original:i,modified:f})},[n,r,a,e,t,m,E]),U=(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(()=>{!b.current&&w.current&&(u.current=c.current.editor.createDiffEditor(w.current,{automaticLayout:!0,...y}),L(),c.current?.editor.setTheme(x),O(!0),b.current=!0)},[y,x,L]);(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{M&&d.current(u.current,c.current)},[M]),(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{!T&&!M&&U()},[T,M,U]);function I(){let i=u.current?.getModel();g||i?.original?.dispose(),N||i?.modified?.dispose(),u.current?.dispose()}return react__WEBPACK_IMPORTED_MODULE_1__.createElement(H,{width:z,height:V,isEditorReady:M,loading:P,_ref:w,className:F,wrapperProps:j})}var ie=Oe;var we=(0,react__WEBPACK_IMPORTED_MODULE_1__.memo)(ie);function Pe(){let[e,r]=(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(_monaco_editor_loader__WEBPACK_IMPORTED_MODULE_0__["default"].__getMonacoInstance());return k(()=>{let n;return e||(n=_monaco_editor_loader__WEBPACK_IMPORTED_MODULE_0__["default"].init(),n.then(t=>{r(t)})),()=>n?.cancel()}),e}var Le=Pe;function He(e){let r=(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)();return (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{r.current=e},[e]),r.current}var se=He;var _=new Map;function Ve({defaultValue:e,defaultLanguage:r,defaultPath:n,value:t,language:a,path:m,theme:E="light",line:g,loading:N="Loading...",options:x={},overrideServices:P={},saveViewState:y=!0,keepCurrentModel:V=!1,width:z="100%",height:F="100%",className:j,wrapperProps:A={},beforeMount:q=D,onMount:M=D,onChange:O,onValidate:T=D}){let[s,u]=(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!1),[c,w]=(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(!0),d=(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null),o=(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null),b=(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null),L=(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(M),U=(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(q),I=(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(),i=(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(t),f=se(m),Q=(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(!1),B=(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(!1);k(()=>{let p=_monaco_editor_loader__WEBPACK_IMPORTED_MODULE_0__["default"].init();return p.then(R=>(d.current=R)&&w(!1)).catch(R=>R?.type!=="cancelation"&&console.error("Monaco initialization: error:",R)),()=>o.current?pe():p.cancel()}),l(()=>{let p=h(d.current,e||t||"",r||a||"",m||n||"");p!==o.current?.getModel()&&(y&&_.set(f,o.current?.saveViewState()),o.current?.setModel(p),y&&o.current?.restoreViewState(_.get(m)))},[m],s),l(()=>{o.current?.updateOptions(x)},[x],s),l(()=>{!o.current||t===void 0||(o.current.getOption(d.current.editor.EditorOption.readOnly)?o.current.setValue(t):t!==o.current.getValue()&&(B.current=!0,o.current.executeEdits("",[{range:o.current.getModel().getFullModelRange(),text:t,forceMoveMarkers:!0}]),o.current.pushUndoStop(),B.current=!1))},[t],s),l(()=>{let p=o.current?.getModel();p&&a&&d.current?.editor.setModelLanguage(p,a)},[a],s),l(()=>{g!==void 0&&o.current?.revealLine(g)},[g],s),l(()=>{d.current?.editor.setTheme(E)},[E],s);let X=(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(()=>{if(!(!b.current||!d.current)&&!Q.current){U.current(d.current);let p=m||n,R=h(d.current,t||e||"",r||a||"",p||"");o.current=d.current?.editor.create(b.current,{model:R,automaticLayout:!0,...x},P),y&&o.current.restoreViewState(_.get(p)),d.current.editor.setTheme(E),g!==void 0&&o.current.revealLine(g),u(!0),Q.current=!0}},[e,r,n,t,a,m,x,P,y,E,g]);(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{s&&L.current(o.current,d.current)},[s]),(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{!c&&!s&&X()},[c,s,X]),i.current=t,(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{s&&O&&(I.current?.dispose(),I.current=o.current?.onDidChangeModelContent(p=>{B.current||O(o.current.getValue(),p)}))},[s,O]),(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{if(s){let p=d.current.editor.onDidChangeMarkers(R=>{let G=o.current.getModel()?.uri;if(G&&R.find(J=>J.path===G.path)){let J=d.current.editor.getModelMarkers({resource:G});T?.(J)}});return()=>{p?.dispose()}}return()=>{}},[s,T]);function pe(){I.current?.dispose(),V?y&&_.set(m,o.current.saveViewState()):o.current.getModel()?.dispose(),o.current.dispose()}return react__WEBPACK_IMPORTED_MODULE_1__.createElement(H,{width:z,height:F,isEditorReady:s,loading:N,_ref:b,className:j,wrapperProps:A})}var fe=Ve;var de=(0,react__WEBPACK_IMPORTED_MODULE_1__.memo)(fe);var Ft=de;
//# sourceMappingURL=index.mjs.map
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ if (!(moduleId in __webpack_modules__)) {
/******/ delete __webpack_module_cache__[moduleId];
/******/ var e = new Error("Cannot find module '" + moduleId + "'");
/******/ e.code = 'MODULE_NOT_FOUND';
/******/ throw e;
/******/ }
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/compat get default export */
/******/ !function() {
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function() { return module['default']; } :
/******/ function() { return module; };
/******/ __webpack_require__.d(getter, { a: getter });
/******/ return getter;
/******/ };
/******/ }();
/******/
/******/ /* webpack/runtime/define property getters */
/******/ !function() {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = function(exports, definition) {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ }();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ !function() {
/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
/******/ }();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ !function() {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ }();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
!function() {
/*!*********************************************************************!*\
!*** ./packages/packages/pro/editor-controls-extended/src/index.ts ***!
\*********************************************************************/
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ AttributesControl: function() { return /* reexport safe */ _controls_attributes_control__WEBPACK_IMPORTED_MODULE_1__.AttributesControl; },
/* harmony export */ CssEditor: function() { return /* reexport safe */ _components_css_code_editor_css_editor__WEBPACK_IMPORTED_MODULE_6__.CssEditor; },
/* harmony export */ DisplayConditionsControl: function() { return /* reexport safe */ _controls_display_conditions_control__WEBPACK_IMPORTED_MODULE_3__.DisplayConditionsControl; },
/* harmony export */ OptionsControl: function() { return /* reexport safe */ _controls_options_control__WEBPACK_IMPORTED_MODULE_2__.OptionsControl; },
/* harmony export */ conditionGroupPropTypeUtil: function() { return /* reexport safe */ _prop_types_condition_group__WEBPACK_IMPORTED_MODULE_5__.conditionGroupPropTypeUtil; },
/* harmony export */ displayConditionsPropTypeUtil: function() { return /* reexport safe */ _prop_types_display_conditions__WEBPACK_IMPORTED_MODULE_4__.displayConditionsPropTypeUtil; }
/* harmony export */ });
/* harmony import */ var _init__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./init */ "./packages/packages/pro/editor-controls-extended/src/init.ts");
/* harmony import */ var _controls_attributes_control__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./controls/attributes-control */ "./packages/packages/pro/editor-controls-extended/src/controls/attributes-control.tsx");
/* harmony import */ var _controls_options_control__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./controls/options-control */ "./packages/packages/pro/editor-controls-extended/src/controls/options-control.tsx");
/* harmony import */ var _controls_display_conditions_control__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./controls/display-conditions-control */ "./packages/packages/pro/editor-controls-extended/src/controls/display-conditions-control.tsx");
/* harmony import */ var _prop_types_display_conditions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./prop-types/display-conditions */ "./packages/packages/pro/editor-controls-extended/src/prop-types/display-conditions.ts");
/* harmony import */ var _prop_types_condition_group__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./prop-types/condition-group */ "./packages/packages/pro/editor-controls-extended/src/prop-types/condition-group.ts");
/* harmony import */ var _components_css_code_editor_css_editor__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./components/css-code-editor/css-editor */ "./packages/packages/pro/editor-controls-extended/src/components/css-code-editor/css-editor.tsx");
(0,_init__WEBPACK_IMPORTED_MODULE_0__.init)();
}();
(window.elementorV2 = window.elementorV2 || {}).editorControlsExtended = __webpack_exports__;
/******/ })()
;
window.elementorV2.editorControlsExtended?.init?.();
The post Best Things to Do in Sentosa Island appeared first on Char's Footsteps.
]]>Sentosa is home to three man-made beaches, each offering a different experience for visitors. One of the things I love about Singapore is how quickly you can be in the city centre to lying on a beach! The easiest way to get to the beaches is to take the monorail to ‘Beach Station’ and get the free shuttle bus from there. Alternatively, you can walk from Beach Station to the beaches but it’s a fairly long walk in the heat, particularly to Tanjong Beach.
Siloso Beach: Known for its lively atmosphere, Siloso Beach is ideal for beach sports, bars, and restaurants. I love this beach for all the activities you can find, like beach volleyball, skydiving, water-jetpacking, kayaking etc. This sandy cove is also home to a few great eateries, like Siloso Beach Bar, and some sites, like Fort Siloso. I found this beach to be hit/miss in terms of how crowded it gets. Sometimes it’s been fairly empty and other times it’s been more packed.
Palawan Beach: Perfect for families, Palawan Beach is known for its shallow waters, playgrounds, and suspension bridge leading to a small offshore islet, which is considered the southernmost point of continental Asia. This is a great beach to enjoy the waters easily or to have picnics in the shaded areas. There’s also a 7/11 right on the beach if you need to get extra refreshments or beach gear!

Tanjong Beach: The most tranquil and quiet of the three, Tanjong Beach is great for a more relaxing day. It is the furthest beach to get to out of the three but great to set up for the day. Tanjong Beach is also home to the Tanjong Beach Club, which has great food, a swimming pool and different areas to rent (beach beds, pool beds etc). You won’t find activities here, like Siloso, so this is perfect for lying on the sandy beach with a book.

Tip: I recommend signing up for an Islander Membership if you visit Sentosa regularly. It’s free to sign up and unlocks loads of discounts, vouchers and deals. You can find out more information on this here.
If you’re looking for a little more adventure or something to do with kids, check out one of the many activities Sentosa has to offer. I recommend buying tickets online in-advance to avoid queues on the day. Sentosa gets pretty busy on weekends and holidays, so this will just save you time (and sometimes money!).
Universal Studios Singapore: One of the most popular attractions on the island, Universal Studios is a theme park offering a range of rides, shows, and attractions based on blockbuster films. It’s a must-visit for families and movie lovers.
Adventure Cove Waterpark: The Adventure Cove Waterpark is home to a number of water slides ,rides, a lazy river, and free-fall platform jumping. There’s also the opportunity to snorkel with tropical fish or enjoy one of their dolphin experiences! It’s a great place to cool off from the heat, without going to the beach. Find out more on their tickets and pricing here.
iFly Singapore: iFly offers the chance to experience skydiving in one of the world’s largest indoor wind tunnels. I haven’t yet braved this one but have heard great things about it! If you’re looking for a thrill-seeking experience, check out iFly.
Mega Adventure Park: Mega Adventure Park caters to a range of outdoor adventures. One of the key highlights is the 60km/h Zip-line that’ll take you 75m above ground and through Sentosa’s lush jungle canopy and coastline. Additionally, there’s a treetop adventure park, a 15m mega jump, a climbing wall and trampoline park. This is a great place to spend a few hours with kids! Check out their site for more information and to buy tickets online.
S.E.A. Aquarium: One of the largest aquariums in the world, the S.E.A Aquarium is home to over 100,000 marine animals from across 1,000 species. They currently have 12 species on sharks, including the endangered scalloped hammerhead shark, and a daily dive-feeding session! Check out their site for more information and to book tickets.
Madame Tussauds Singapore: A classic favourite, Madame Tussauds Singapore is home to the popular life-sized, wax figures of famous personalities from around the world.
If you’re looking for prefer quieter, nature-focused activities, there are a number of walking trails and scenic areas to choose from. Be sure to pack enough water and sun protection for these. Although they’re fairly short trails, it’s best to be too prepared when dealing with Singapore’s heat and humidity.
A walking trail that provides scenic views of the island while leading to Fort Siloso, a restored British-era fort offering a glimpse into Singapore’s military history.
The Sentosa Nature Discovery is another great trail that’ll take you through stunning nature and greenery. What I like about this trail is the interactive exhibits you’ll come across along the way, educating on Sentosa’s biodiversity! There’s also a great lookout point you can stop at for pictures.

The Imbiah Trail is a 2.3km hiking trail that takes you through lush forests. This peaceful and easy hike will take you around 35 minutes. Be sure to check out the waterfalls and Imbiah Bridge along the way. If you’re starting your trip from mainland Singapore, get the Sentosa Express straight to Imbiah Station. You’ll see maps and signs that will point you in the direction of the Imbiah Trail from there.

Sentosa is home to a wide range of food options, located across the island, to suit all budgets! Here are some places i’ve enjoyed going to in the past;
Sentosa has a few notable historical sites and cultural experiences you can enjoy.
Fort Siloso is a preserved coastal fort that played a significant role during World War II. The on-site museums has a wide range of WW2 memorabilia to explore, including old bunkers, tunnels, coastal guns, cannons and exhibits that tell the story of Singapore’s military past. I found it to be larger than I expected and ended up spending about 2.5 hours here! Whilst here, consider doing the Fort Siloso Skywalk (as mentioned above). Check out the Sentosa site for more information on Fort Siloso.
The Images of Singapore is an interactive museum that provides an engaging overview of Singapore’s history through actors and exhibits. Here you can get insight into the country’s colonial past and path to independence. It has 15 interactive areas that showcase 200 years of extraordinary history. You’ll find the Images of Singapore LIVE located alongside Madame Tussauds.
There are several ways to get to Sentosa from mainland Singapore.
You can catch the Sentosa Express monorail from VivoCity shopping mall to various stations on the island. For this option, take the train to HarbourFront station, the termini of the North East line and Circle line. Once at HarbourFront Station, follow signs for the Sentosa Express monorail line. This can be found on the 3rd floor of VivoCity and is a direct train to the island for a $4 roundtrip journey. Or, head to the first floor and walk along the Sentosa Boardwalk. This is probably the easiest ways to get to Sentosa!

This pedestrian walkway links VivoCity to Sentosa, providing an easy 15-minute walk onto the island. To access the boardwalk, head to the first floor of VivoCity shopping mall and follow signs to the boardwalk start. This area is covered so you’ll be protected from the sun or rain during the walk there.
For a scenic, and more adventurous route to Sentosa, take the cable car! Take the cable car from Faber Peak, Mount Faber to Sentosa and enjoy aerial views of the harbour and coastline. As someone who is scared of heights, I found the cable car terrifying, but it was a cool experience. Read the official site for more info. This could be a good option if you’re coming back from a hike at Faber Park or the Henderson Waves. You can take the cable car to Sentosa on a one-way trip or buy a return ticket.
You can drive onto Sentosa via the Gateway Toll Plaza, which charges an entry fee per car. Or get a taxi, which will conveniently drop off or pick up anywhere on the island. There is a small surcharge on top of the metered fare. Both personal cars and taxis will be charged $2-6 SG dollars depending on time of day. Read this article for up-to-date Sentosa entrance fees and parking costs.
You can visit the island all-year round, however, be mindful of the rainy season! Between November and January, you’ll likely experience bursts of rain. If you’re planning to do the beaches or trails then it might be worth planning your day around the weather. Or plan a few indoor activities for when it’s due to rain.
Entrance fees apply when taking the monorail, cable car, or driving into Sentosa. The boardwalk offers free entry for pedestrians.
To experience the main attractions, I’d recommend a full day, but you could easily spend two days. One for more of a beach day and another for the amusement parks.
Absolutely! This is probably one of the best places to go in Singapore with kids. You’ll be spoilt for choice with the number of attractions, beaches, theme parks, and educational trails.
Other great things to do in Singapore include visiting the Gardens by the Bay or one of the big hikes on the island.
The post Best Things to Do in Sentosa Island appeared first on Char's Footsteps.
]]>The post Best Places to Hike in Singapore appeared first on Char's Footsteps.
]]>The MacRitchie TreeTop Walk is one of Singapore’s most popular walks due to its 250m-long freestanding suspension bridge and forest canopy views. The trail is mostly flat, with a few gentle inclines, making it a great choice for beginners. Read more on the Treetop Walk Trails here.
Distance: 7km (round tip); approx 2-3 hours

Bukit Batok Nature Park offers a peaceful walk with well-maintained paths, gentle slopes, and scenic views of an old quarry. You’ll be treated to a variety of fruit trees, wildlife and clear, calm waters. It’s an excellent spot for a short, relaxing walk. Be sure to head to the centre of the park for the Bukit Batok Nature Park Lookout Point, where you’ll be treated to great views of the abandoned quarry! Check out the Bukit Batok Nature Park site for more information.
Distance: 1.7 km (loop), approx 1 hour

Pasir Ris Mangrove Boardwalk is an easy boardwalk trail that’ll take you through a 6-hectare mangrove forest!! This short walk is is perfect for an easy stroll and you’ll be treated to a variety of bird species and other wildlife. The boardwalk trail is located within Pasir Ris park, which is home to Singapore’s largest playground, a maze garden and a ‘kitchen’ (herb) garden. There’s plenty to see outside of the mangrove area and you can easily access park from Pasir Ris MRT station.

Distance: 1.5 km (loop), approx 45 mins – 1 hour
The Southern Ridges (probably one of my favourites hikes in Singapore) is a series of trails that connected several parks and gardens. The full area covers Kent Ridge Park, Labrador Nature Reserve, Telok Blangah Hill Park and Mount Faber Park. You’ll be treated to everything from elevated walkways, dense forest bits and panoramic views of the city! The majority of the walk is flat, but there are a few section with stairs. As the trail is fairly long, I’d recommend going early in the morning so you’re not out in peak heat and humidity.
Distance: 10 km (one-way), 3-4 hours

The Labrador Nature Reserve (or Labrador Park) is a great mix of historical sites and natural beauty. Home to a number of historical relics and artefacts, many dating back to WW2, make this park a must-do for any history buffs. The trails itself showcase thriving plant and animal life whilst providing panoramic views of the sea! You’ll find more than 70 kinds of bird species within the park too, so i’d recommend this one for bird watchers.
Distance: 2.1 km (loop), approx 1.5 – 2 hours
Coney Island (also known as Pulau Serangoon) offers a rustic, less manicured environment with sandy paths and dense vegetation. Although the trails are predominately flat, it can be a tiring walk due to the sandy terrain.
Distance: 2.4 km (one-way), approx. 2 hours
Bukit Timah Nature Reserve is home to Singapore’s highest natural point at at 163.63m. There are four main trails to choose from, that begin at the Visitor Centre, and range in terrain and difficulty. What makes this reserve so special is the rich biodiversity of the rainforest. According to Singapore’s National Library Board, one-hectare of land in the Bukit Timah Nature Reserve contains more tree species than the whole of North America! With over 1,000 species of flowering plants and over 500 species of wildlife, Bukit Timah Nature Reserve is really worth doing!

Distance: 4 km (loop), approx. 1.5 to 2 hours
This trail on Pulau Ubin offers a moderate hike with a short, steep climb to Puaka Hill, where you can enjoy views of the quarry below. The climb is only about 10-15 minutes and you’ll be treated to stunning views over the quarry. The more challenging aspect to this is actually getting to Pulau Ubin. You’ll need to catch a 10 minute boat ride from Changi Ferry Point Terminal. Therefore, if you decide to do this trail, I’d recommend doing a full day trip to Pulau Ubin to make the most of everything there.
Distance: 1.6 km (loop), 1 hour

This extended loop around the MacRitchie Reservoir is a more challenging option, with undulating terrain and longer distance. It’s ideal for those looking for a longer hike with scenic views. I love this loop for it’s diversity; containing everything from boardwalks to woodland trails, enclosed areas and sections that take you along the water. Definitely one of my favourite hikes in Singapore, so i’d urge anyone with the time to give this one a go.

The MacRitchie Reservoir Park is part of a much wider Central Catchment Nature Reserve with 20km of trails and boardwalks to choose from. This area is popular so you’ll likely bump into a few other walkers and runners along the way. Always be careful of the monkeys, particularly on the golf course you pass through!!
Distance: 12 km (loop), approx. 4 hours
This trail involves a steady climb up Mount Faber, followed by a walk along the Henderson Waves bridge. This is the highest pedestrian bridge in Singapore at 118ft in height and 900ft in length! The unique wave-like structure is worth visiting, and Mount Faber offers a scenic path directly to it! You can also tag this along with the Southern Ridges walk (featured above) to make it an even longer hike. This is a great hike to do if you’re looking to head to Sentosa too, as the cable car connects the island from Mount Faber!

Distance: 3.5 km (one-way), approx. 2 hours
Chestnut Nature Park offers trails with varying levels of difficulty, including rugged sections with steep climbs. There are two main loops, the Northern Loop (the more challenging one) and the Southern Loop. Chestnut Nature Park is also a favourite with mountain-bikers, with cycling trails taking you through scenic woodlands.
Distance: 5.6 km (combined), approx. 2-3 hours
Other great areas to enjoy nature in Singapore include the Botanic Gardens, Fort Canning Park, East Coast Park, Bishan-Ang Mo Kio Park and Gardens by the Bay!

The post Best Places to Hike in Singapore appeared first on Char's Footsteps.
]]>The post Travelling from Singapore to Kuala Lumpur by Bus appeared first on Char's Footsteps.
]]>After reading a number of horror stories online regarding the journey, and immigration, I was apprehensive. However, it ended up being completely fine and definitely the best choice for me. This blog will detail my positive experience getting the bus from Singapore to Kuala Lumpur.
I bought my ticket online from this site. I believe you can buy tickets at certain departure stations, however, I needed proof of onward journey to enter Singapore. Therefore, I had to buy mine ahead of time. I was a bit overwhelmed at the number of choices. There are 16 bus companies that travel throughout the 24-hour day, with a number of different pick-up and drop-off stops to choose from.

After much research, I went with the Cityline Bus, due to its good reviews and convenient pick-up/drop-off points for me. The ticket cost me SGD$35 – significantly cheaper than flying with all my bags. I chose the 11am bus from Jurong East, as it was close to my hotel in Tanjong Pagar, and on the same MRT line. I picked this time also as the drop-off in Kuala Lumpur was near to my accomodation there.
Despite reading a number of horror stories about the journey, I had a really easy time. I hope this helps provide an idea of what to expect.
The first part of the journey was very quick. With no traffic, it took 20 minutes to get from Jurong East to the Tuas Checkpoint. We were asked to leave the bus and take our passports into the immigration hall. At this point, we could leave all our belongings on the bus. Once in the hall, we walked up to the e-gates, where your passport and face are scanned. There was no queue, so this took less than 5 minutes. We walked out the other side and were reunited with our bus, once the driver had been checked. This entire process took less than 10 minutes from getting off the bus and getting back on again.
I’ve added a Google Map screengrab below to show which Tuas Checkpoint I crossed. The other border crossing, Woodlands Checkpoint, takes you from Singapore into Johor Bahru. My understanding the Singapore to Johor Bahru crossing is much busier, with longer queues times at immigration. If you’re going directly to Kuala Lumpur, I’d recommend choosing a bus route that goes through the Tuas Checkpoint.

Once back on the bus, we had a 10 drive from the Tuas Checkpoint to Malaysian border control – ‘Sultan Abu Bakar Immigration’. Bags had to be taken off the bus here and brought into the immigration hall. Again, we were blessed with minimal queues of less than 5 minutes.
This was where I had my only problem of the trip. As a UK citizen, I get 90 days visa-free in Malaysia. I researched if I needed anything else to enter the country and couldn’t find any information. However at immigration, I discovered I needed to fill out a Malaysian Digital Arrival Card ahead of time. This arrival card was introduced at the beginning of 2024. Luckily I had data on my phone to apply, and nothing complicated on my application, so it took a few minutes to fill out and for it to process in their system. I was warned that these forms can sometimes take a while to process, so I strongly urge you to sort this ahead of your journey.
The Malaysian Digital Arrival Card can be applied for here with more information on it here.
They didn’t ask for proof of onward journey here. Once through immigration, my bags went through a scanner and I was free to go back on the bus. This whole process took about 15-20 minutes, but that was largely due to the arrival card fiasco. There are toilets and a small snack stall near the buses. We had to wait 15-20 minutes here as other groups joined our bus.
I had read horror stories of people waiting 6 hours at immigration, so I was very relieved how quick this how process was!

Approximately 90 minutes from Malaysian immigration, we stopped at Yong Peng Bus Station. We were here for 30 minutes, which was a great opportunity to use the bathrooms and get food. There is a small food hall with options like fish ball soup. However these stalls accept cash only. There are two small shops that largely sell souvenirs and gifts, but I was able to buy water and a chicken pastry there. This was our only stop for food/bathrooms.

Once we all piled back on the bus, we made our way to Kuala Lumpur. The journey took another 2.5 hours and we faced some traffic getting into the city. There are several bus stops in the city, so choose one based on your accomodation location. I got out a Berjaya Times Square and caught a cab easily to my serviced apartment.
The actual bus itself was pretty good! The bus layout included a single row of seats and double row of seats either side of the aisle. You select your seat when buying your ticket online, so I chose one of the single seats by the window. The seats were comfortable, can recline back and there’s a foot rest provided too. There were also fairly wide too with strong aircon overhead. The only downside to the bus was the lack of toilet. Luckily the service station stop along the way sufficed, but be sure to choose a bus with toilets onboard if you think you’ll need more stops.

My bus was very empty, with 8 of us at the start and maybe 15 people by the time we reached Kuala Lumpur. The bus capacity was closer to 40, so we all had room to spread out.
Overall, I had a really great experience getting the bus from Singapore to Kuala Lumpur. At only $35, it was significantly cheaper than flying with added luggage. The entire process of flying (factoring in airport waiting times, security, flying, immigration, baggage reclaim), and the long airport drive, was on par with the driving time to KL. I’d definitely recommend the bus between Singapore and Malaysia if you’re looking to save money. However, I am aware that I might have been lucky with queue times as I’ve heard others say the journey took them 10+ hours with immigration wait times!!
Related Posts: A Guide to Gardens by the Bay in Singapore
The post Travelling from Singapore to Kuala Lumpur by Bus appeared first on Char's Footsteps.
]]>The post A Guide to Gardens by the Bay in Singapore appeared first on Char's Footsteps.
]]>Consisting of three waterfront gardens, Gardens by the Bay is home to over 1 million plants, from every continent – except Antartica. From the iconic Supertrees, plant conservatories, well-maintained gardens and numerous eateries, this is the perfect day out in Singapore.

The closest MRT station to the Gardens is Bayfront (circle line and downtown line). If you’re coming by foot, walk through the Shoppes at Marine Bay Sands, following signs for Gardens by the Bay. This will take you up a series of escalators, across a bridge through Marina Bay Sands itself and out the other side to the gardens.
If you’re coming by bus, you’ll be dropped at the back of Marina Bay Sands hotel. You’ll be able to use an elevator, from street level, that will take you up to the walk way. As with the Shoppes route, you’ll have to walk through Marina Bay Sands hotel and come out the other side.
Likely one of the most iconic sights in Singapore, the Supertree grove comprises of 18 steel-clad concrete structures, covered with 162,900 plants. Standing up to 16 storeys tall, these man-made structures are not only captivating to look at, but they play a crucial role in the Gardens. 11 of the Supertrees have capabilities to harvest solar energy, whilst others behave like a chimney stack or act as an air exhaust for the two conservatories. Very energy efficient.
The OCBC Skyway is one of the best ways to enjoy the Supertrees, and gardens in general. Connecting 6 supertrees, this 22m high walkway provides incredible panoramic views of the trees and the surrounding area.

Not for the faint hearted (i’m terrified of heights and just about survived), the walk is short but you can spend as much time as you like.
Entrance for the OCBC Skyway costs SG$8 for adults and SG$5 for children.
There’s also a bar worth checking out at the top of one o
During the evening, the supertrees come to life with a light and sound show – Garden Rhapsody. Twice every evening, 12 of the 18 supertrees come alive in a fun 15-minute light and sound show. There is no entry fee and it takes place daily at 7:45pm and 8:45pm. The music and lights change periodically throughout the year, so check out watch is currently on here.

Get here early for a prime location…it get busy quickly! It might sound odd, but I would recommend lying down if you can find a spot, as that’ll give you the best view of the light show.

The Cloud Forest Dome and Flower Dome, are two separate conservatories within Gardens by the Bay, that collectively home 217,000 plants from over 800 species!
The Cloud Forest Dome replicates the cool climate found in regions between 1000m and 3000m. With it’s iconic 42m cloud mountain and 35m waterfall, it’s certainly not something to miss whilst in Singapore.

Once in the Dome, you’ll take an elevator/lift to the top and slowly make your way down the mountain via a circular path. Crossing underneath the powerful waterfall, you’ll pass through stunning greenery and plants typically found in East Asia and Central & South America.

Note – bring a jumper/jacket for this as it’s a harsh contrast to the warmth outside. Very cold!!
The best time to visit the cloud dome is during there ‘misting’ periods. This takes place daily at 10.00 am, 12.00 pm, 2.00 pm, 4.00 pm, 6.00 pm, and 8.00 pm. To keep the dome at the best humidity levels, they have ‘misting’ sprays every 2 hours which makes the dome really atmospheric! Be sure to get there 15 minutes before the misting session starts so you’re fully in the dome when it’s happening.

The Flower Dome was given Guinness Book of World Record status in 2015, for being the largest greenhouse in the world at 1.2ha. Replicating a Mediterranean climate, this impressive dome is home to a large number of exotic flowers and plants.
Throughout the year, there are different themes within the Flower Dome. In October 2022, the Flower Dome hosted a ‘Spanish Serenade with Sunflowers’, with the most glorious sunflower display.
Tickets for the conservatories will cost SG$28/15 adult/child – allowing you into both domes.
You can either buy tickets online via the official Gardens by the Bay website, or in person! There’s a ticket counter in the central hub of the gardens where you can buy tickets. You’ll also find basic amenities here like toilets, refreshments and a souvenir shop.
I have been to GBTB many times and I always recommend going in the afternoon! This way you can enjoy everything the gardens has to offer in one go. Start by visiting the supertrees and walk around the gardens – this will let you enjoy them in the daylight. Following this, visit the various domes. Once you’ve finished at the domes head to one of the eateries on site for dinner. After eating go back to the supertrees, see them lit up at night and wait for the free light show!
There are several food options to choose from at the Gardens. My go-to whenever i’m here is the hawker centre Satay by the Bay. With a number of different food stalls, from Thai to Satay, there’s something for everyone here. It’s also reasonably priced. But expect to pay more than typically hawkers given the location.
Outside of this, there are a few other establishments on the site. From fast food chain giants, Shake Shack and McDonalds, to the Mediterranean inspired Hortus.
It’s very possible to visit Gardens by the Bay on a budget. For one, the gardens themselves are free for you to walk around and explore. Only the conservatories (flower and cloud domes) and the OCBC skywalk require tickets. The super trees, gardens and light show are all free.
For cheap food options, check out the Satay by the Bay hawker centre. The food is here is very reasonably priced, and some stalls offer lunch discounts. Alternatively, there are a number of benches dotted around the park, where you could sit with packed food.
You can also skip the OCBC skywalk and opt to take photos at the Marina Bay Overpass Viewing Point and at the Dragonfly Bridge.
There is also a Children’s Garden which consists of trampolines, treehouses, adventure trails, hanging bridges and more. It’s open between 10am-7pm from Tuesday-Friday and 9am-9pm on weekends. It’s closed on Mondays.
There are also two different themed horticultural themed gardens which focus on different cultural groups within Singapore. They’re primarily there as part of an educational programme to bring more understanding of plant knowledge to the public.
The outdoor gardens are open daily from 5:00 AM to 2:00 AM. However, the indoor conservatories and attractions, such as the Cloud Forest and Flower Dome, are typically open from 9:00 AM to 9:00 PM.
Admission to the outdoor gardens is free. However, the indoor conservatories and OCBC Skyway have an entrance fee. Ticket prices may vary based on promotions or resident status.
As the park is located outdoors in Singapore’s tropical climate, wear light and comfortable clothing. I would also suggest bringing sunscreen and water (although you can buy water on site). Be sure to bring a light jacket if you’re visiting the conservatories – particularly the cloud dome. Singapore’s aircon is often set to arctic temperatures!
Yes, you are allowed to bring your own food and have a picnic in the outdoor gardens. However, food and drinks are not permitted inside the conservatories.
Yes, the park is designed to be wheelchair-friendly. Most paths and attractions, including the conservatories, have wheelchair access, and wheelchair rentals are available on-site.
The post A Guide to Gardens by the Bay in Singapore appeared first on Char's Footsteps.
]]>