Version Description
Download this release
Release Info
Developer | themeisle |
Plugin | Cloud Templates & Patterns collection |
Version | 1.1.0 |
Comparing to | |
See all releases |
Code changes from version 1.0.11 to 1.1.0
- .babelrc.json +6 -0
- .browserslistrc +6 -0
- .eslintrc +38 -1
- CHANGELOG.md +5 -0
- README.md +8 -0
- assets/build/app.asset.php +2 -2
- assets/build/app.js +10 -2
- assets/build/style-app-rtl.css +1 -1
- assets/build/style-app.css +1 -1
- assets/src/Components/CloudLibrary/DemoSiteTemplatesImport.js +308 -0
- assets/src/Components/CloudLibrary/Filters.js +53 -0
- assets/src/Components/CloudLibrary/ImportTemplatesModal.js +364 -0
- assets/src/Components/CloudLibrary/Library.js +253 -0
- assets/src/Components/CloudLibrary/ListItem.js +278 -0
- assets/src/Components/CloudLibrary/PreviewFrame.js +39 -0
- assets/src/Components/CloudLibrary/common.js +186 -0
- assets/src/Components/Header.js +129 -0
- assets/src/Components/Icon.js +32 -0
- assets/src/Components/ImportModal.js +210 -133
- assets/src/Components/ImportModalNote.js +14 -18
- assets/src/Components/InstallModal.js +13 -3
- assets/src/Components/Main.js +42 -390
- assets/src/Components/Migration.js +2 -1
- assets/src/Components/OnboardingContent.js +256 -0
- assets/src/Components/PreviewFrame.js +6 -11
- assets/src/Components/Search.js +15 -5
- assets/src/Components/StarterSiteCard.js +45 -14
- assets/src/Components/StarterSites/Filters.js +159 -0
- assets/src/scss/_card.scss +1 -8
- assets/src/scss/_demo-site-templates.scss +113 -0
- assets/src/scss/_general.scss +104 -15
- assets/src/scss/_header.scss +24 -3
- assets/src/scss/_import-modal.scss +141 -59
- assets/src/scss/_library.scss +243 -0
- assets/src/scss/_media-queries.scss +7 -2
- assets/src/scss/_mock.scss +0 -1
- assets/src/scss/_preview.scss +53 -43
- assets/src/scss/_starter-site-card.scss +26 -44
- assets/src/scss/_sticky-nav.scss +4 -2
- assets/src/store/actions.js +30 -0
- assets/src/store/reducer.js +63 -27
- assets/src/store/selectors.js +5 -0
- assets/src/style.scss +4 -0
- assets/src/utils/common.js +55 -1
- assets/src/utils/site-import.js +4 -0
- editor/build/index-rtl.css +2 -0
- editor/build/index.asset.php +4 -0
- editor/build/index.css +2 -0
- editor/build/index.js +1 -0
- editor/src/components/content.js +42 -0
- editor/src/components/filters.js +27 -0
- editor/src/components/header.js +88 -0
- editor/src/components/list-item.js +299 -0
- editor/src/components/notices.js +38 -0
- editor/src/components/pagination.js +28 -0
- editor/src/components/preview.js +100 -0
- editor/src/components/templates-content.js +107 -0
- editor/src/data/block-editor/index.js +166 -0
- editor/src/data/index.js +4 -0
- editor/src/data/templates-cloud/index.js +284 -0
- editor/src/edit.js +154 -0
- editor/src/editor.scss +481 -0
- editor/src/extension.js +412 -0
- editor/src/icon.js +57 -0
- editor/src/index.js +32 -0
- editor/src/scss/_pagination.scss +21 -0
- includes/Admin.php +6 -1
- includes/Editor.php +151 -0
- includes/Main.php +20 -1
- includes/Rest_Server.php +75 -1
- languages/templates-patterns-collection.pot +220 -134
- readme.txt +8 -0
- templates-patterns-collection.php +18 -4
- vendor/autoload.php +1 -1
- vendor/composer/ClassLoader.php +2 -2
- vendor/composer/InstalledVersions.php +209 -0
- vendor/composer/autoload_classmap.php +2 -0
- vendor/composer/autoload_real.php +5 -5
- vendor/composer/autoload_static.php +6 -4
- vendor/composer/installed.json +5 -1
- vendor/composer/installed.php +24 -0
- yarn.lock +33 -1
.babelrc.json
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"presets": [ "@wordpress/babel-preset-default" ],
|
3 |
+
"plugins": [
|
4 |
+
"@babel/plugin-proposal-object-rest-spread"
|
5 |
+
]
|
6 |
+
}
|
.browserslistrc
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Browsers that we support
|
2 |
+
|
3 |
+
last 1 version
|
4 |
+
> 1%
|
5 |
+
maintained node versions
|
6 |
+
not dead
|
.eslintrc
CHANGED
@@ -1,4 +1,41 @@
|
|
1 |
{
|
2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
"ignorePatterns": ["**/vendor/**"]
|
4 |
}
|
1 |
{
|
2 |
+
"extends": [ "plugin:@wordpress/eslint-plugin/recommended" ],
|
3 |
+
"parserOptions": {
|
4 |
+
"allowImportExportEverywhere": true,
|
5 |
+
"ecmaFeatures": {
|
6 |
+
"jsx": true
|
7 |
+
},
|
8 |
+
"ecmaVersion": 2018,
|
9 |
+
"sourceType": "module"
|
10 |
+
},
|
11 |
+
"rules": {
|
12 |
+
"indent": [
|
13 |
+
"error",
|
14 |
+
"tab"
|
15 |
+
],
|
16 |
+
"linebreak-style": [
|
17 |
+
"error",
|
18 |
+
"unix"
|
19 |
+
],
|
20 |
+
"quotes": [
|
21 |
+
"error",
|
22 |
+
"single"
|
23 |
+
],
|
24 |
+
"semi": [
|
25 |
+
"error",
|
26 |
+
"always"
|
27 |
+
],
|
28 |
+
"no-unused-vars": [
|
29 |
+
"error", {
|
30 |
+
"vars": "all",
|
31 |
+
"args": "after-used",
|
32 |
+
"ignoreRestSiblings": false
|
33 |
+
}
|
34 |
+
],
|
35 |
+
"react/jsx-uses-react": "error",
|
36 |
+
"react/jsx-uses-vars": "error",
|
37 |
+
"no-alert": 0,
|
38 |
+
"no-nested-ternary": 0
|
39 |
+
},
|
40 |
"ignorePatterns": ["**/vendor/**"]
|
41 |
}
|
CHANGELOG.md
CHANGED
@@ -1,3 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
1 |
##### [Version 1.0.11](https://github.com/Codeinwp/templates-patterns-collection/compare/v1.0.10...v1.0.11) (2020-10-13)
|
2 |
|
3 |
- Moved onboarding to TPC
|
1 |
+
#### [Version 1.1.0](https://github.com/Codeinwp/templates-patterns-collection/compare/v1.0.11...v1.1.0) (2020-11-24)
|
2 |
+
|
3 |
+
Single page templates
|
4 |
+
Cloud storage for custom-built templates
|
5 |
+
|
6 |
##### [Version 1.0.11](https://github.com/Codeinwp/templates-patterns-collection/compare/v1.0.10...v1.0.11) (2020-10-13)
|
7 |
|
8 |
- Moved onboarding to TPC
|
README.md
CHANGED
@@ -27,6 +27,14 @@ No account is required to access the service template collection and the privacy
|
|
27 |
|
28 |
## Changelog ##
|
29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
##### [Version 1.0.11](https://github.com/Codeinwp/templates-patterns-collection/compare/v1.0.10...v1.0.11) (2020-10-13)
|
31 |
|
32 |
- Moved onboarding to TPC
|
27 |
|
28 |
## Changelog ##
|
29 |
|
30 |
+
#### [Version 1.1.0](https://github.com/Codeinwp/templates-patterns-collection/compare/v1.0.11...v1.1.0) (2020-11-24)
|
31 |
+
|
32 |
+
Single page templates
|
33 |
+
Cloud storage for custom-built templates
|
34 |
+
|
35 |
+
|
36 |
+
|
37 |
+
|
38 |
##### [Version 1.0.11](https://github.com/Codeinwp/templates-patterns-collection/compare/v1.0.10...v1.0.11) (2020-10-13)
|
39 |
|
40 |
- Moved onboarding to TPC
|
assets/build/app.asset.php
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
<?php return array(
|
2 |
-
'dependencies' => array( 'react', 'react-dom', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill' ),
|
3 |
-
'version' => '
|
4 |
);
|
1 |
<?php return array(
|
2 |
+
'dependencies' => array( 'react', 'react-dom', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives' ),
|
3 |
+
'version' => 'edaeef1d2a5566fc3aa7447a01bcc8c3',
|
4 |
);
|
assets/build/app.js
CHANGED
@@ -1,2 +1,10 @@
|
|
1 |
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[1],{15:function(e,t,n){}}]),function(e){function t(t){for(var r,c,a=t[0],s=t[1],l=t[2],m=0,d=[];m<a.length;m++)c=a[m],Object.prototype.hasOwnProperty.call(o,c)&&o[c]&&d.push(o[c][0]),o[c]=0;for(r in s)Object.prototype.hasOwnProperty.call(s,r)&&(e[r]=s[r]);for(u&&u(t);d.length;)d.shift()();return i.push.apply(i,l||[]),n()}function n(){for(var e,t=0;t<i.length;t++){for(var n=i[t],r=!0,a=1;a<n.length;a++){var s=n[a];0!==o[s]&&(r=!1)}r&&(i.splice(t--,1),e=c(c.s=n[0]))}return e}var r={},o={0:0},i=[];function c(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,c),n.l=!0,n.exports}c.m=e,c.c=r,c.d=function(e,t,n){c.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},c.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.t=function(e,t){if(1&t&&(e=c(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(c.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)c.d(n,r,function(t){return e[t]}.bind(null,r));return n},c.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(t,"a",t),t},c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},c.p="";var a=window.webpackJsonp=window.webpackJsonp||[],s=a.push.bind(a);a.push=t,a=a.slice();for(var l=0;l<a.length;l++)t(a[l]);var u=s;i.push([24,1]),n()}([function(e,t){!function(){e.exports=this.wp.element}()},function(e,t){!function(){e.exports=this.wp.i18n}()},function(e,t){!function(){e.exports=this.wp.components}()},function(e,t,n){var r=n(19),o=n(20),i=n(11),c=n(21);e.exports=function(e,t){return r(e)||o(e,t)||i(e,t)||c()}},function(e,t){!function(){e.exports=this.wp.data}()},function(e,t){!function(){e.exports=this.wp.compose}()},function(e,t,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var i=typeof r;if("string"===i||"number"===i)e.push(r);else if(Array.isArray(r)&&r.length){var c=o.apply(null,r);c&&e.push(c)}else if("object"===i)for(var a in r)n.call(r,a)&&r[a]&&e.push(a)}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t){!function(){e.exports=this.regeneratorRuntime}()},function(e,t,n){var r;r=function(e,t){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([function(e,t,n){e.exports=n(5)()},function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t){e.exports=function(e,t,n){var r=e.direction,o=e.value;switch(r){case"top":return n.top+o<t.top&&n.bottom>t.bottom&&n.left<t.left&&n.right>t.right;case"left":return n.left+o<t.left&&n.bottom>t.bottom&&n.top<t.top&&n.right>t.right;case"bottom":return n.bottom-o>t.bottom&&n.left<t.left&&n.right>t.right&&n.top<t.top;case"right":return n.right-o>t.right&&n.left<t.left&&n.top<t.top&&n.bottom>t.bottom}}},function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return g}));var r=n(1),o=n.n(r),i=n(2),c=n.n(i),a=n(0),s=n.n(a),l=n(3),u=n.n(l);function m(e){return(m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function d(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e,t){return(h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function b(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var g=function(e){function t(e){var n,r,o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),r=this,o=p(t).call(this,e),n=!o||"object"!==m(o)&&"function"!=typeof o?f(r):o,b(f(n),"getContainer",(function(){return n.props.containment||window})),b(f(n),"addEventListener",(function(e,t,r,o){var i;n.debounceCheck||(n.debounceCheck={});var c=function(){i=null,n.check()},a={target:e,fn:o>-1?function(){i||(i=setTimeout(c,o||0))}:function(){clearTimeout(i),i=setTimeout(c,r||0)},getLastTimeout:function(){return i}};e.addEventListener(t,a.fn),n.debounceCheck[t]=a})),b(f(n),"startWatching",(function(){n.debounceCheck||n.interval||(n.props.intervalCheck&&(n.interval=setInterval(n.check,n.props.intervalDelay)),n.props.scrollCheck&&n.addEventListener(n.getContainer(),"scroll",n.props.scrollDelay,n.props.scrollThrottle),n.props.resizeCheck&&n.addEventListener(window,"resize",n.props.resizeDelay,n.props.resizeThrottle),!n.props.delayedCall&&n.check())})),b(f(n),"stopWatching",(function(){if(n.debounceCheck)for(var e in n.debounceCheck)if(n.debounceCheck.hasOwnProperty(e)){var t=n.debounceCheck[e];clearTimeout(t.getLastTimeout()),t.target.removeEventListener(e,t.fn),n.debounceCheck[e]=null}n.debounceCheck=null,n.interval&&(n.interval=clearInterval(n.interval))})),b(f(n),"check",(function(){var e,t,r=n.node;if(!r)return n.state;if(e=function(e){return void 0===e.width&&(e.width=e.right-e.left),void 0===e.height&&(e.height=e.bottom-e.top),e}(n.roundRectDown(r.getBoundingClientRect())),n.props.containment){var o=n.props.containment.getBoundingClientRect();t={top:o.top,left:o.left,bottom:o.bottom,right:o.right}}else t={top:0,left:0,bottom:window.innerHeight||document.documentElement.clientHeight,right:window.innerWidth||document.documentElement.clientWidth};var i=n.props.offset||{};"object"===m(i)&&(t.top+=i.top||0,t.left+=i.left||0,t.bottom-=i.bottom||0,t.right-=i.right||0);var c={top:e.top>=t.top,left:e.left>=t.left,bottom:e.bottom<=t.bottom,right:e.right<=t.right},a=e.height>0&&e.width>0,s=a&&c.top&&c.left&&c.bottom&&c.right;if(a&&n.props.partialVisibility){var l=e.top<=t.bottom&&e.bottom>=t.top&&e.left<=t.right&&e.right>=t.left;"string"==typeof n.props.partialVisibility&&(l=c[n.props.partialVisibility]),s=n.props.minTopValue?l&&e.top<=t.bottom-n.props.minTopValue:l}"string"==typeof i.direction&&"number"==typeof i.value&&(console.warn("[notice] offset.direction and offset.value have been deprecated. They still work for now, but will be removed in next major version. Please upgrade to the new syntax: { %s: %d }",i.direction,i.value),s=u()(i,e,t));var d=n.state;return n.state.isVisible!==s&&(d={isVisible:s,visibilityRect:c},n.setState(d),n.props.onChange&&n.props.onChange(s)),d})),n.state={isVisible:null,visibilityRect:{}},n}var n,r,i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){this.node=c.a.findDOMNode(this),this.props.active&&this.startWatching()}},{key:"componentWillUnmount",value:function(){this.stopWatching()}},{key:"componentDidUpdate",value:function(e){this.node=c.a.findDOMNode(this),this.props.active&&!e.active?(this.setState({isVisible:null,visibilityRect:{}}),this.startWatching()):this.props.active||this.stopWatching()}},{key:"roundRectDown",value:function(e){return{top:Math.floor(e.top),left:Math.floor(e.left),bottom:Math.floor(e.bottom),right:Math.floor(e.right)}}},{key:"render",value:function(){return this.props.children instanceof Function?this.props.children({isVisible:this.state.isVisible,visibilityRect:this.state.visibilityRect}):o.a.Children.only(this.props.children)}}])&&d(n.prototype,r),i&&d(n,i),t}(o.a.Component);b(g,"defaultProps",{active:!0,partialVisibility:!1,minTopValue:0,scrollCheck:!1,scrollDelay:250,scrollThrottle:-1,resizeCheck:!1,resizeDelay:250,resizeThrottle:-1,intervalCheck:!0,intervalDelay:100,delayedCall:!1,offset:{},containment:null,children:o.a.createElement("span",null)}),b(g,"propTypes",{onChange:s.a.func,active:s.a.bool,partialVisibility:s.a.oneOfType([s.a.bool,s.a.oneOf(["top","right","bottom","left"])]),delayedCall:s.a.bool,offset:s.a.oneOfType([s.a.shape({top:s.a.number,left:s.a.number,bottom:s.a.number,right:s.a.number}),s.a.shape({direction:s.a.oneOf(["top","right","bottom","left"]),value:s.a.number})]),scrollCheck:s.a.bool,scrollDelay:s.a.number,scrollThrottle:s.a.number,resizeCheck:s.a.bool,resizeDelay:s.a.number,resizeThrottle:s.a.number,intervalCheck:s.a.bool,intervalDelay:s.a.number,containment:"undefined"!=typeof window?s.a.instanceOf(window.Element):s.a.any,children:s.a.oneOfType([s.a.element,s.a.func]),minTopValue:s.a.number})},function(e,t,n){"use strict";var r=n(6);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,c){if(c!==r){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}])},e.exports=r(n(22),n(23))},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}},function(e,t,n){var r=n(10);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}},function(e,t,n){var r=n(16),o=n(17),i=n(11),c=n(18);e.exports=function(e){return r(e)||o(e)||i(e)||c()}},function(e,t){function n(e,t,n,r,o,i,c){try{var a=e[i](c),s=a.value}catch(e){return void n(e)}a.done?t(s):Promise.resolve(s).then(r,o)}e.exports=function(e){return function(){var t=this,r=arguments;return new Promise((function(o,i){var c=e.apply(t,r);function a(e){n(c,o,i,a,s,"next",e)}function s(e){n(c,o,i,a,s,"throw",e)}a(void 0)}))}}},function(e,t,n){var r;r=function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function r(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&function(e,t){(Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}(e,t)}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function u(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=s(e);if(t){var o=s(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return l(this,n)}}function m(e){return function(e){if(Array.isArray(e))return d(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function p(e){return Array.isArray?Array.isArray(e):"[object Array]"===O(e)}function f(e){return"string"==typeof e}function h(e){return"number"==typeof e}function b(t){return"object"===e(t)}function g(e){return null!=e}function v(e){return!e.trim().length}function O(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}var y=function(e){return"Invalid value for key ".concat(e)},j=function(e){return"Pattern length exceeds max of ".concat(e,".")},E=Object.prototype.hasOwnProperty,_=function(){function e(n){var r=this;t(this,e),this._keys=[],this._keyMap={};var o=0;n.forEach((function(e){var t=w(e);o+=t.weight,r._keys.push(t),r._keyMap[t.id]=t,o+=t.weight})),this._keys.forEach((function(e){e.weight/=o}))}return r(e,[{key:"get",value:function(e){return this._keyMap[e]}},{key:"keys",value:function(){return this._keys}},{key:"toJSON",value:function(){return JSON.stringify(this._keys)}}]),e}();function w(e){var t=null,n=null,r=null,o=1;if(f(e)||p(e))r=e,t=S(e),n=k(e);else{if(!E.call(e,"name"))throw new Error("Missing ".concat("name"," property in key"));var i=e.name;if(r=i,E.call(e,"weight")&&(o=e.weight)<=0)throw new Error(function(e){return"Property 'weight' in key '".concat(e,"' must be a positive integer")}(i));t=S(i),n=k(i)}return{path:t,id:n,weight:o,src:r}}function S(e){return p(e)?e:e.split(".")}function k(e){return p(e)?e.join("."):e}var C=c({},{isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:function(e,t){return e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1}},{},{includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},{},{location:0,threshold:.6,distance:100},{},{useExtendedSearch:!1,getFn:function(e,t){var n=[],r=!1;return function e(t,o,i){if(o[i]){var c=t[o[i]];if(!g(c))return;if(i===o.length-1&&(f(c)||h(c)||function(e){return!0===e||!1===e||function(e){return b(e)&&null!==e}(e)&&"[object Boolean]"==O(e)}(c)))n.push(function(e){return null==e?"":function(e){if("string"==typeof e)return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(e)}(c));else if(p(c)){r=!0;for(var a=0,s=c.length;a<s;a+=1)e(c[a],o,i+1)}else o.length&&e(c,o,i+1)}else n.push(t)}(e,f(t)?t.split("."):t,0),r?n:n[0]},ignoreLocation:!1,ignoreFieldNorm:!1}),M=/[^ ]+/g;function N(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3,t=new Map;return{get:function(n){var r=n.match(M).length;if(t.has(r))return t.get(r);var o=parseFloat((1/Math.sqrt(r)).toFixed(e));return t.set(r,o),o},clear:function(){t.clear()}}}var x=function(){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.getFn,o=void 0===r?C.getFn:r;t(this,e),this.norm=N(3),this.getFn=o,this.isCreated=!1,this.setIndexRecords()}return r(e,[{key:"setSources",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.docs=e}},{key:"setIndexRecords",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.records=e}},{key:"setKeys",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.keys=t,this._keysMap={},t.forEach((function(t,n){e._keysMap[t.id]=n}))}},{key:"create",value:function(){var e=this;!this.isCreated&&this.docs.length&&(this.isCreated=!0,f(this.docs[0])?this.docs.forEach((function(t,n){e._addString(t,n)})):this.docs.forEach((function(t,n){e._addObject(t,n)})),this.norm.clear())}},{key:"add",value:function(e){var t=this.size();f(e)?this._addString(e,t):this._addObject(e,t)}},{key:"removeAt",value:function(e){this.records.splice(e,1);for(var t=e,n=this.size();t<n;t+=1)this.records[t].i-=1}},{key:"getValueForItemAtKeyId",value:function(e,t){return e[this._keysMap[t]]}},{key:"size",value:function(){return this.records.length}},{key:"_addString",value:function(e,t){if(g(e)&&!v(e)){var n={v:e,i:t,n:this.norm.get(e)};this.records.push(n)}}},{key:"_addObject",value:function(e,t){var n=this,r={i:t,$:{}};this.keys.forEach((function(t,o){var i=n.getFn(e,t.path);if(g(i))if(p(i))!function(){for(var e=[],t=[{nestedArrIndex:-1,value:i}];t.length;){var c=t.pop(),a=c.nestedArrIndex,s=c.value;if(g(s))if(f(s)&&!v(s)){var l={v:s,i:a,n:n.norm.get(s)};e.push(l)}else p(s)&&s.forEach((function(e,n){t.push({nestedArrIndex:n,value:e})}))}r.$[o]=e}();else if(!v(i)){var c={v:i,n:n.norm.get(i)};r.$[o]=c}})),this.records.push(r)}},{key:"toJSON",value:function(){return{keys:this.keys,records:this.records}}}]),e}();function D(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.getFn,o=void 0===r?C.getFn:r,i=new x({getFn:o});return i.setKeys(e.map(w)),i.setSources(t),i.create(),i}function P(e,t){var n=e.matches;t.matches=[],g(n)&&n.forEach((function(e){if(g(e.indices)&&e.indices.length){var n={indices:e.indices,value:e.value};e.key&&(n.key=e.key.src),e.idx>-1&&(n.refIndex=e.idx),t.matches.push(n)}}))}function T(e,t){t.score=e.score}function I(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.errors,r=void 0===n?0:n,o=t.currentLocation,i=void 0===o?0:o,c=t.expectedLocation,a=void 0===c?0:c,s=t.distance,l=void 0===s?C.distance:s,u=t.ignoreLocation,m=void 0===u?C.ignoreLocation:u,d=r/e.length;if(m)return d;var p=Math.abs(a-i);return l?d+p/l:p?1:d}function A(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:C.minMatchCharLength,n=[],r=-1,o=-1,i=0,c=e.length;i<c;i+=1){var a=e[i];a&&-1===r?r=i:a||-1===r||((o=i-1)-r+1>=t&&n.push([r,o]),r=-1)}return e[i-1]&&i-r>=t&&n.push([r,i-1]),n}function L(e){for(var t={},n=0,r=e.length;n<r;n+=1){var o=e.charAt(n);t[o]=(t[o]||0)|1<<r-n-1}return t}var R=function(){function e(n){var r=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=o.location,c=void 0===i?C.location:i,a=o.threshold,s=void 0===a?C.threshold:a,l=o.distance,u=void 0===l?C.distance:l,m=o.includeMatches,d=void 0===m?C.includeMatches:m,p=o.findAllMatches,f=void 0===p?C.findAllMatches:p,h=o.minMatchCharLength,b=void 0===h?C.minMatchCharLength:h,g=o.isCaseSensitive,v=void 0===g?C.isCaseSensitive:g,O=o.ignoreLocation,y=void 0===O?C.ignoreLocation:O;if(t(this,e),this.options={location:c,threshold:s,distance:u,includeMatches:d,findAllMatches:f,minMatchCharLength:b,isCaseSensitive:v,ignoreLocation:y},this.pattern=v?n:n.toLowerCase(),this.chunks=[],this.pattern.length){var j=function(e,t){r.chunks.push({pattern:e,alphabet:L(e),startIndex:t})},E=this.pattern.length;if(E>32){for(var _=0,w=E%32,S=E-w;_<S;)j(this.pattern.substr(_,32),_),_+=32;if(w){var k=E-32;j(this.pattern.substr(k),k)}}else j(this.pattern,0)}}return r(e,[{key:"searchIn",value:function(e){var t=this.options,n=t.isCaseSensitive,r=t.includeMatches;if(n||(e=e.toLowerCase()),this.pattern===e){var o={isMatch:!0,score:0};return r&&(o.indices=[[0,e.length-1]]),o}var i=this.options,c=i.location,a=i.distance,s=i.threshold,l=i.findAllMatches,u=i.minMatchCharLength,d=i.ignoreLocation,p=[],f=0,h=!1;this.chunks.forEach((function(t){var n=t.pattern,o=t.alphabet,i=t.startIndex,b=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=r.location,i=void 0===o?C.location:o,c=r.distance,a=void 0===c?C.distance:c,s=r.threshold,l=void 0===s?C.threshold:s,u=r.findAllMatches,m=void 0===u?C.findAllMatches:u,d=r.minMatchCharLength,p=void 0===d?C.minMatchCharLength:d,f=r.includeMatches,h=void 0===f?C.includeMatches:f,b=r.ignoreLocation,g=void 0===b?C.ignoreLocation:b;if(t.length>32)throw new Error(j(32));for(var v,O=t.length,y=e.length,E=Math.max(0,Math.min(i,y)),_=l,w=E,S=p>1||h,k=S?Array(y):[];(v=e.indexOf(t,w))>-1;){var M=I(t,{currentLocation:v,expectedLocation:E,distance:a,ignoreLocation:g});if(_=Math.min(M,_),w=v+O,S)for(var N=0;N<O;)k[v+N]=1,N+=1}w=-1;for(var x=[],D=1,P=O+y,T=1<<O-1,L=0;L<O;L+=1){for(var R=0,F=P;R<F;){var B=I(t,{errors:L,currentLocation:E+F,expectedLocation:E,distance:a,ignoreLocation:g});B<=_?R=F:P=F,F=Math.floor((P-R)/2+R)}P=F;var z=Math.max(1,E-F+1),U=m?y:Math.min(E+F,y)+O,$=Array(U+2);$[U+1]=(1<<L)-1;for(var W=U;W>=z;W-=1){var V=W-1,q=n[e.charAt(V)];if(S&&(k[V]=+!!q),$[W]=($[W+1]<<1|1)&q,L&&($[W]|=(x[W+1]|x[W])<<1|1|x[W+1]),$[W]&T&&(D=I(t,{errors:L,currentLocation:V,expectedLocation:E,distance:a,ignoreLocation:g}))<=_){if(_=D,(w=V)<=E)break;z=Math.max(1,2*E-w)}}var H=I(t,{errors:L+1,currentLocation:E,expectedLocation:E,distance:a,ignoreLocation:g});if(H>_)break;x=$}var J={isMatch:w>=0,score:Math.max(.001,D)};if(S){var G=A(k,p);G.length?h&&(J.indices=G):J.isMatch=!1}return J}(e,n,o,{location:c+i,distance:a,threshold:s,findAllMatches:l,minMatchCharLength:u,includeMatches:r,ignoreLocation:d}),g=b.isMatch,v=b.score,O=b.indices;g&&(h=!0),f+=v,g&&O&&(p=[].concat(m(p),m(O)))}));var b={isMatch:h,score:h?f/this.chunks.length:1};return h&&r&&(b.indices=p),b}}]),e}(),F=function(){function e(n){t(this,e),this.pattern=n}return r(e,[{key:"search",value:function(){}}],[{key:"isMultiMatch",value:function(e){return B(e,this.multiRegex)}},{key:"isSingleMatch",value:function(e){return B(e,this.singleRegex)}}]),e}();function B(e,t){var n=e.match(t);return n?n[1]:null}var z=function(e){a(o,e);var n=u(o);function o(e){return t(this,o),n.call(this,e)}return r(o,[{key:"search",value:function(e){var t=e===this.pattern;return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}}],[{key:"type",get:function(){return"exact"}},{key:"multiRegex",get:function(){return/^="(.*)"$/}},{key:"singleRegex",get:function(){return/^=(.*)$/}}]),o}(F),U=function(e){a(o,e);var n=u(o);function o(e){return t(this,o),n.call(this,e)}return r(o,[{key:"search",value:function(e){var t=-1===e.indexOf(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}],[{key:"type",get:function(){return"inverse-exact"}},{key:"multiRegex",get:function(){return/^!"(.*)"$/}},{key:"singleRegex",get:function(){return/^!(.*)$/}}]),o}(F),$=function(e){a(o,e);var n=u(o);function o(e){return t(this,o),n.call(this,e)}return r(o,[{key:"search",value:function(e){var t=e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}}],[{key:"type",get:function(){return"prefix-exact"}},{key:"multiRegex",get:function(){return/^\^"(.*)"$/}},{key:"singleRegex",get:function(){return/^\^(.*)$/}}]),o}(F),W=function(e){a(o,e);var n=u(o);function o(e){return t(this,o),n.call(this,e)}return r(o,[{key:"search",value:function(e){var t=!e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}],[{key:"type",get:function(){return"inverse-prefix-exact"}},{key:"multiRegex",get:function(){return/^!\^"(.*)"$/}},{key:"singleRegex",get:function(){return/^!\^(.*)$/}}]),o}(F),V=function(e){a(o,e);var n=u(o);function o(e){return t(this,o),n.call(this,e)}return r(o,[{key:"search",value:function(e){var t=e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}],[{key:"type",get:function(){return"suffix-exact"}},{key:"multiRegex",get:function(){return/^"(.*)"\$$/}},{key:"singleRegex",get:function(){return/^(.*)\$$/}}]),o}(F),q=function(e){a(o,e);var n=u(o);function o(e){return t(this,o),n.call(this,e)}return r(o,[{key:"search",value:function(e){var t=!e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}],[{key:"type",get:function(){return"inverse-suffix-exact"}},{key:"multiRegex",get:function(){return/^!"(.*)"\$$/}},{key:"singleRegex",get:function(){return/^!(.*)\$$/}}]),o}(F),H=function(e){a(o,e);var n=u(o);function o(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=i.location,a=void 0===c?C.location:c,s=i.threshold,l=void 0===s?C.threshold:s,u=i.distance,m=void 0===u?C.distance:u,d=i.includeMatches,p=void 0===d?C.includeMatches:d,f=i.findAllMatches,h=void 0===f?C.findAllMatches:f,b=i.minMatchCharLength,g=void 0===b?C.minMatchCharLength:b,v=i.isCaseSensitive,O=void 0===v?C.isCaseSensitive:v;return t(this,o),(r=n.call(this,e))._bitapSearch=new R(e,{location:a,threshold:l,distance:m,includeMatches:p,findAllMatches:h,minMatchCharLength:g,isCaseSensitive:O}),r}return r(o,[{key:"search",value:function(e){return this._bitapSearch.searchIn(e)}}],[{key:"type",get:function(){return"fuzzy"}},{key:"multiRegex",get:function(){return/^"(.*)"$/}},{key:"singleRegex",get:function(){return/^(.*)$/}}]),o}(F),J=function(e){a(o,e);var n=u(o);function o(e){return t(this,o),n.call(this,e)}return r(o,[{key:"search",value:function(e){for(var t,n=0,r=[],o=this.pattern.length;(t=e.indexOf(this.pattern,n))>-1;)n=t+o,r.push([t,n-1]);var i=!!r.length;return{isMatch:i,score:i?1:0,indices:r}}}],[{key:"type",get:function(){return"include"}},{key:"multiRegex",get:function(){return/^'"(.*)"$/}},{key:"singleRegex",get:function(){return/^'(.*)$/}}]),o}(F),G=[z,J,$,W,q,V,U,H],K=G.length,Y=/ +(?=([^\"]*\"[^\"]*\")*[^\"]*$)/;function Q(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.split("|").map((function(e){for(var n=e.trim().split(Y).filter((function(e){return e&&!!e.trim()})),r=[],o=0,i=n.length;o<i;o+=1){for(var c=n[o],a=!1,s=-1;!a&&++s<K;){var l=G[s],u=l.isMultiMatch(c);u&&(r.push(new l(u,t)),a=!0)}if(!a)for(s=-1;++s<K;){var m=G[s],d=m.isSingleMatch(c);if(d){r.push(new m(d,t));break}}}return r}))}var X=new Set([H.type,J.type]),Z=function(){function e(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r.isCaseSensitive,i=void 0===o?C.isCaseSensitive:o,c=r.includeMatches,a=void 0===c?C.includeMatches:c,s=r.minMatchCharLength,l=void 0===s?C.minMatchCharLength:s,u=r.findAllMatches,m=void 0===u?C.findAllMatches:u,d=r.location,p=void 0===d?C.location:d,f=r.threshold,h=void 0===f?C.threshold:f,b=r.distance,g=void 0===b?C.distance:b;t(this,e),this.query=null,this.options={isCaseSensitive:i,includeMatches:a,minMatchCharLength:l,findAllMatches:m,location:p,threshold:h,distance:g},this.pattern=i?n:n.toLowerCase(),this.query=Q(this.pattern,this.options)}return r(e,[{key:"searchIn",value:function(e){var t=this.query;if(!t)return{isMatch:!1,score:1};var n=this.options,r=n.includeMatches;e=n.isCaseSensitive?e:e.toLowerCase();for(var o=0,i=[],c=0,a=0,s=t.length;a<s;a+=1){var l=t[a];i.length=0,o=0;for(var u=0,d=l.length;u<d;u+=1){var p=l[u],f=p.search(e),h=f.isMatch,b=f.indices,g=f.score;if(!h){c=0,o=0,i.length=0;break}if(o+=1,c+=g,r){var v=p.constructor.type;X.has(v)?i=[].concat(m(i),m(b)):i.push(b)}}if(o){var O={isMatch:!0,score:c/o};return r&&(O.indices=i),O}}return{isMatch:!1,score:1}}}],[{key:"condition",value:function(e,t){return t.useExtendedSearch}}]),e}(),ee=[];function te(e,t){for(var n=0,r=ee.length;n<r;n+=1){var o=ee[n];if(o.condition(e,t))return new o(e,t)}return new R(e,t)}var ne="$and",re="$path",oe=function(e){return!(!e[ne]&&!e.$or)},ie=function(e){return!!e[re]},ce=function(e){return!p(e)&&b(e)&&!oe(e)},ae=function(e){return o({},ne,Object.keys(e).map((function(t){return o({},t,e[t])})))},se=function(){function e(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;t(this,e),this.options=c({},C,{},r),this.options.useExtendedSearch,this._keyStore=new _(this.options.keys),this.setCollection(n,o)}return r(e,[{key:"setCollection",value:function(e,t){if(this._docs=e,t&&!(t instanceof x))throw new Error("Incorrect 'index' type");this._myIndex=t||D(this.options.keys,this._docs,{getFn:this.options.getFn})}},{key:"add",value:function(e){g(e)&&(this._docs.push(e),this._myIndex.add(e))}},{key:"remove",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){return!1},t=[],n=0,r=this._docs.length;n<r;n+=1){var o=this._docs[n];e(o,n)&&(this.removeAt(n),n-=1,t.push(o))}return t}},{key:"removeAt",value:function(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}},{key:"getIndex",value:function(){return this._myIndex}},{key:"search",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.limit,r=void 0===n?-1:n,o=this.options,i=o.includeMatches,c=o.includeScore,a=o.shouldSort,s=o.sortFn,l=o.ignoreFieldNorm,u=f(e)?f(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return le(u,{ignoreFieldNorm:l}),a&&u.sort(s),h(r)&&r>-1&&(u=u.slice(0,r)),ue(u,this._docs,{includeMatches:i,includeScore:c})}},{key:"_searchStringList",value:function(e){var t=te(e,this.options),n=this._myIndex.records,r=[];return n.forEach((function(e){var n=e.v,o=e.i,i=e.n;if(g(n)){var c=t.searchIn(n),a=c.isMatch,s=c.score,l=c.indices;a&&r.push({item:n,idx:o,matches:[{score:s,value:n,norm:i,indices:l}]})}})),r}},{key:"_searchLogical",value:function(e){var t=this,n=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.auto,o=void 0===r||r,i=function e(n){var r=Object.keys(n),i=ie(n);if(!i&&r.length>1&&!oe(n))return e(ae(n));if(ce(n)){var c=i?n[re]:r[0],a=i?n.$val:n[c];if(!f(a))throw new Error(y(c));var s={keyId:k(c),pattern:a};return o&&(s.searcher=te(a,t)),s}var l={children:[],operator:r[0]};return r.forEach((function(t){var r=n[t];p(r)&&r.forEach((function(t){l.children.push(e(t))}))})),l};return oe(e)||(e=ae(e)),i(e)}(e,this.options),r=this._myIndex.records,o={},i=[];return r.forEach((function(e){var r=e.$,c=e.i;if(g(r)){var a=function e(n,r,o){if(!n.children){var i=n.keyId,c=n.searcher,a=t._findMatches({key:t._keyStore.get(i),value:t._myIndex.getValueForItemAtKeyId(r,i),searcher:c});return a&&a.length?[{idx:o,item:r,matches:a}]:[]}switch(n.operator){case ne:for(var s=[],l=0,u=n.children.length;l<u;l+=1){var d=e(n.children[l],r,o);if(!d.length)return[];s.push.apply(s,m(d))}return s;case"$or":for(var p=[],f=0,h=n.children.length;f<h;f+=1){var b=e(n.children[f],r,o);if(b.length){p.push.apply(p,m(b));break}}return p}}(n,r,c);a.length&&(o[c]||(o[c]={idx:c,item:r,matches:[]},i.push(o[c])),a.forEach((function(e){var t,n=e.matches;(t=o[c].matches).push.apply(t,m(n))})))}})),i}},{key:"_searchObjectList",value:function(e){var t=this,n=te(e,this.options),r=this._myIndex,o=r.keys,i=r.records,c=[];return i.forEach((function(e){var r=e.$,i=e.i;if(g(r)){var a=[];o.forEach((function(e,o){a.push.apply(a,m(t._findMatches({key:e,value:r[o],searcher:n})))})),a.length&&c.push({idx:i,item:r,matches:a})}})),c}},{key:"_findMatches",value:function(e){var t=e.key,n=e.value,r=e.searcher;if(!g(n))return[];var o=[];if(p(n))n.forEach((function(e){var n=e.v,i=e.i,c=e.n;if(g(n)){var a=r.searchIn(n),s=a.isMatch,l=a.score,u=a.indices;s&&o.push({score:l,key:t,value:n,idx:i,norm:c,indices:u})}}));else{var i=n.v,c=n.n,a=r.searchIn(i),s=a.isMatch,l=a.score,u=a.indices;s&&o.push({score:l,key:t,value:i,norm:c,indices:u})}return o}}]),e}();function le(e,t){var n=t.ignoreFieldNorm,r=void 0===n?C.ignoreFieldNorm:n;e.forEach((function(e){var t=1;e.matches.forEach((function(e){var n=e.key,o=e.norm,i=e.score,c=n?n.weight:null;t*=Math.pow(0===i&&c?Number.EPSILON:i,(c||1)*(r?1:o))})),e.score=t}))}function ue(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.includeMatches,o=void 0===r?C.includeMatches:r,i=n.includeScore,c=void 0===i?C.includeScore:i,a=[];return o&&a.push(P),c&&a.push(T),e.map((function(e){var n=e.idx,r={item:t[n],refIndex:n};return a.length&&a.forEach((function(t){t(e,r)})),r}))}return se.version="6.4.1",se.createIndex=D,se.parseIndex=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.getFn,r=void 0===n?C.getFn:n,o=e.keys,i=e.records,c=new x({getFn:r});return c.setKeys(o),c.setIndexRecords(i),c},se.config=C,function(){ee.push.apply(ee,arguments)}(Z),se},e.exports=r()},,function(e,t,n){var r=n(10);e.exports=function(e){if(Array.isArray(e))return r(e)}},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,o=!1,i=void 0;try{for(var c,a=e[Symbol.iterator]();!(r=(c=a.next()).done)&&(n.push(c.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==a.return||a.return()}finally{if(o)throw i}}return n}}},function(e,t){e.exports=function(){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(e,t){!function(){e.exports=this.React}()},function(e,t){!function(){e.exports=this.ReactDOM}()},function(e,t,n){"use strict";n.r(t);var r=n(0),o=(n(15),n(7)),i=n.n(o);function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var s=tiobDash,l=s.onboarding,u=s.themeAction,m=void 0!==l.sites&&void 0!==l.sites.sites?Object.keys(l.sites.sites)[0]:"gutenberg",d=localStorage.getItem("neve-onboarding-editor")||m,p={sites:l.sites||{},editor:d,category:"all",previewStatus:!1,importModalStatus:!1,installModalStatus:!1,currentSite:null,importing:!1,isOnboarding:l.onboarding||!1,migrationData:null,themeAction:u},f={refreshSites:function(e){return{type:"REFRESH_SITES",payload:{sites:e}}},setCurrentEditor:function(e){return{type:"SET_CURRENT_EDITOR",payload:{editor:e}}},setCurrentCategory:function(e){return{type:"SET_CURRENT_CATEGORY",payload:{category:e}}},setCurrentSite:function(e){return{type:"SET_FOCUSED_SITE",payload:{siteData:e}}},setPreviewStatus:function(e){return e?document.body.classList.add("ob-overflow-off"):document.body.classList.remove("ob-overflow-off"),{type:"SET_PREVIEW_STATUS",payload:{previewStatus:e}}},setImportModalStatus:function(e){return e?document.body.classList.add("ob-overflow-off"):document.body.classList.remove("ob-overflow-off"),{type:"SET_IMPORT_MODAL_STATUS",payload:{importModalStatus:e}}},setInstallModalStatus:function(e){return e?document.body.classList.add("ob-overflow-off"):document.body.classList.remove("ob-overflow-off"),{type:"SET_INSTALL_MODAL_STATUS",payload:{installModalStatus:e}}},setOnboardingState:function(e){return{type:"SET_ONBOARDING",payload:{state:e}}},setThemeAction:function(e){return{type:"SET_THEME_ACTIONS",payload:{themeActions:e}}}},h=n(4),b=n(6),g=n.n(b),v=n(12),O=n.n(v),y=n(3),j=n.n(y),E=n(1),_=n(2),w=n(5),S=Object(w.compose)(Object(h.withSelect)((function(e){return{category:(0,e("neve-onboarding").getCurrentCategory)()}})),Object(h.withDispatch)((function(e){var t=e("neve-onboarding").setCurrentCategory;return{setCurrentCategory:function(e){return t(e)}}})))((function(e){var t=e.count,n=e.categories,o=e.onSearch,i=e.category,c=e.setCurrentCategory,a=e.query,s=Object(r.useState)(!1),l=j()(s,2),u=l[0],m=l[1],d=function(){return m(!u)};return Object(r.createElement)("div",{className:"header-form"},Object(r.createElement)("div",{className:"search"},Object(r.createElement)("img",{src:tiobDash.assets+"/img/search.svg",alt:Object(E.__)("Search Icon")}),Object(r.createElement)("input",{onChange:function(e){o(e.target.value)},type:"search",value:a,placeholder:Object(E.__)("Search for a starter site","templates-patterns-collection")+"..."}),Object(r.createElement)("div",{className:"ob-dropdown categories-selector"},Object(r.createElement)(_.Button,{onClick:d,className:"select ob-dropdown"},n[i],Object(r.createElement)(_.Dashicon,{size:14,icon:u?"arrow-up-alt2":"arrow-down-alt2"}),u&&Object(r.createElement)(_.Popover,{position:"bottom center",onClose:d,noArrow:!0},u&&Object(r.createElement)("ul",{className:"options"},Object.keys(n).map((function(e,o){return e===i||"free"===e&&t.all===t[e]?null:Object(r.createElement)("li",{key:o},Object(r.createElement)("a",{href:"#",onClick:function(t){t.preventDefault(),c(e),m(!1)}},Object(r.createElement)("span",null,n[e]),Object(r.createElement)("span",{className:"count"},t[e])))}))))))))})),k=Object(w.compose)(Object(h.withSelect)((function(e){return{themeStatus:(0,e("neve-onboarding").getThemeAction)().action||!1}})),Object(h.withDispatch)((function(e){var t=e("neve-onboarding"),n=t.setCurrentSite,r=t.setPreviewStatus,o=t.setImportModalStatus,i=t.setInstallModalStatus;return{setSite:function(e){return n(e)},setPreview:function(e){return r(e)},setModal:function(e){return o(e)},setInstallModal:function(e){return i(e)}}})))((function(e){var t=e.data,n=e.setSite,o=e.setPreview,i=e.setModal,c=e.themeStatus,a=e.setInstallModal,s=t.upsell,l=Object(r.useState)(""),u=j()(l,2),m=u[0],d=u[1];return Object(r.createElement)("div",{onMouseEnter:function(){d("visible")},onMouseLeave:function(){d("")},className:"card starter-site-card"},Object(r.createElement)("div",{className:"top"},Object(r.createElement)("div",{className:"actions "+m},Object(r.createElement)(_.Button,{className:"preview",onClick:function(e){e.preventDefault(),n(t),o(!0)}},Object(E.__)("Preview","templates-patterns-collection")),!s&&Object(r.createElement)(_.Button,{className:"import",onClick:function(e){if(e.preventDefault(),n(t),c)return a(!0),!1;i(!0)}},Object(E.__)("Import","templates-patterns-collection"))),t.screenshot&&Object(r.createElement)("div",{className:"image",style:{backgroundImage:'url("'.concat(t.screenshot,'")')}})),Object(r.createElement)("div",{className:"bottom"},Object(r.createElement)("p",{className:"title"},t.title),s&&Object(r.createElement)("span",{className:"pro-badge"},Object(r.createElement)(_.Dashicon,{icon:"lock",size:15}),Object(r.createElement)("span",null,Object(E.__)("Premium","templates-patterns-collection")))))})),C=Object(w.compose)(Object(h.withSelect)((function(e){var t=e("neve-onboarding"),n=t.getCurrentSite,r=t.getThemeAction;return{siteData:n(),themeStatus:r().action||!1}})),Object(h.withDispatch)((function(e){var t=e("neve-onboarding"),n=t.setCurrentSite,r=t.setPreviewStatus,o=t.setImportModalStatus,i=t.setInstallModalStatus;return{setSite:function(e){return n(e)},setPreview:function(e){return r(e)},setModal:function(e){return o(e)},setInstallModal:function(e){return i(e)}}})))((function(e){var t=e.next,n=e.prev,o=e.siteData,i=e.setSite,c=e.setPreview,a=e.setModal,s=e.themeStatus,l=e.setInstallModal,u=tiobDash.isRTL;return Object(r.createElement)("div",{className:"ob-preview"},Object(r.createElement)("div",{className:"preview"},Object(r.createElement)("iframe",{src:o.url,frameBorder:"0"}),Object(r.createElement)("div",{className:"loading"},Object(r.createElement)(_.Dashicon,{icon:"update",size:50}))),Object(r.createElement)("div",{className:"bottom-bar"},Object(r.createElement)("div",{className:"navigator"},Object(r.createElement)(_.Button,{onClick:function(e){e.preventDefault(),c(!1),i(null)},className:"close",label:Object(E.__)("Close","templates-patterns-collection"),icon:"no"}),n&&Object(r.createElement)(_.Button,{onClick:function(e){e.preventDefault(),i(n)},className:"prev",label:Object(E.__)("Previous","templates-patterns-collection"),icon:u?"arrow-right-alt2":"arrow-left-alt2"}),t&&Object(r.createElement)(_.Button,{onClick:function(e){e.preventDefault(),i(t)},className:"next",label:Object(E.__)("Next","templates-patterns-collection"),icon:u?"arrow-left-alt2":"arrow-right-alt2"})),Object(r.createElement)("div",{className:"actions"},o.upsell?Object(r.createElement)(_.Button,{className:"upgrade",isPrimary:!0,href:o.utmOutboundLink||tiobDash.upgradeURL},Object(E.__)("Upgrade and Import","templates-patterns-collection")):Object(r.createElement)(_.Button,{className:"import",isPrimary:!0,onClick:function(e){if(e.preventDefault(),s)return l(!0),!1;a(!0)}},Object(E.__)("Import","templates-patterns-collection")))))})),M=n(8),N=n.n(M),x=n(13),D=n.n(x),P=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return I(e,n,t)},T=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return I(e,t,{},"GET",n)},I=function(){var e=D()(N.a.mark((function e(t){var n,r,o,i,c,a=arguments;return N.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>1&&void 0!==a[1]&&a[1],r=a.length>2&&void 0!==a[2]?a[2]:{},o=a.length>3&&void 0!==a[3]?a[3]:"POST",i=!(a.length>4&&void 0!==a[4])||a[4],c={method:o,headers:{Accept:"application/json","Content-Type":"application/json"}},i&&(c.headers["x-wp-nonce"]=tiobDash.nonce),"POST"===o&&(c.body=JSON.stringify(r)),e.next=9,fetch(t,c).then((function(e){return n?e:e.json()}));case 9:return e.abrupt("return",e.sent);case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),A=tiobDash.onboarding,L=function(e){return P(A.root+"/install_plugins",e)},R=function(e){var t=e.currentStep,n=e.progress,o=e.willDo,i={plugins:{label:Object(E.__)("Installing Plugins","templates-patterns-collection"),status:n.plugins,willDo:!0},content:{label:Object(E.__)("Importing Content","templates-patterns-collection"),status:n.content,willDo:o.content},customizer:{label:Object(E.__)("Importing Customizer Settings","templates-patterns-collection"),status:n.customizer,willDo:o.customizer},widgets:{label:Object(E.__)("Importing Widgets","templates-patterns-collection"),status:n.widgets,willDo:o.widgets}};return Object(r.createElement)("ul",{className:"stepper"},Object.keys(i).map((function(e,n){var o=i[e],c=o.label,a=o.status;if(!o.willDo)return null;var s=g()(["icon",{loading:t===e,warning:t===e,success:"done"===a,error:"error"===a,skip:"skip"===a}]),l="clock";return t===e&&(l="update"),"done"===a&&(l="yes"),"error"===a&&(l="no-alt"),Object(r.createElement)("li",{key:n},Object(r.createElement)("span",{className:s},Object(r.createElement)(_.Dashicon,{icon:l,className:t===e?"loading":""})),Object(r.createElement)("span",null,c))})))},F=function(e){var t=e.data,n=e.externalInstalled,o=t.external_plugins||null,i=g()(["well",{warning:o&&!n}]);return Object(r.createElement)("div",{className:i},Object(r.createElement)("h3",null,Object(r.createElement)(_.Dashicon,{icon:"info"}),Object(r.createElement)("span",null,o&&!n?Object(E.__)("To import this demo you have to install the following plugins","neve"):Object(E.__)("Note","templates-patterns-collection"),":")),Object(r.createElement)("ol",null,o&&!n?o.map((function(e,t){return Object(r.createElement)("li",{key:t},Object(r.createElement)(_.Button,{isLink:!0,href:e.author_url},e.name))})):Object(r.createElement)(r.Fragment,null,Object(r.createElement)("li",null,Object(E.__)("We recommend you backup your website content before attempting a full site import.","neve")),Object(r.createElement)("li",null,Object(E.__)("Some of the demo images will not be imported and will be replaced by placeholder images.","neve")))))},B=function(e){var t=e.message,n=e.code;return Object(r.createElement)("div",{className:"well error"},t&&Object(r.createElement)("h3",null,Object(r.createElement)(_.Dashicon,{icon:"warning"}),Object(r.createElement)("span",null,t)),Object(r.createElement)("ul",null,Object(r.createElement)("li",{dangerouslySetInnerHTML:{__html:tiobDash.onboarding.i18n.troubleshooting}}),Object(r.createElement)("li",{dangerouslySetInnerHTML:{__html:tiobDash.onboarding.i18n.support}}),n&&Object(r.createElement)("li",null,Object(E.__)("Error code","templates-patterns-collection"),":"," ",Object(r.createElement)("code",null,n)),Object(r.createElement)("li",null,Object(E.__)("Error log","templates-patterns-collection"),":"," ",Object(r.createElement)(_.Button,{isLink:!0,href:tiobDash.onboarding.logUrl},tiobDash.onboarding.logUrl,Object(r.createElement)(_.Dashicon,{icon:"external"})))))};function z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function U(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?z(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var $=Object(w.compose)(Object(h.withSelect)((function(e){var t=e("neve-onboarding"),n=t.getCurrentEditor,r=t.getCurrentSite;return{editor:n(),siteData:r()}})),Object(h.withDispatch)((function(e){var t=e("neve-onboarding").setImportModalStatus;return{setModal:function(e){return t(e)}}})))((function(e){var t=e.setModal,n=e.editor,o=e.siteData,c=Object(r.useState)({content:!0,customizer:!0,widgets:!0}),a=j()(c,2),s=a[0],l=a[1],u=Object(r.useState)(!1),m=j()(u,2),d=m[0],p=m[1],f=Object(r.useState)(!1),h=j()(f,2),b=h[0],v=h[1],O=Object(r.useState)(!1),y=j()(O,2),w=y[0],S=y[1],k=Object(r.useState)(!1),C=j()(k,2),M=C[0],N=C[1],x=Object(r.useState)(null),D=j()(x,2),I=D[0],z=D[1],$=Object(r.useState)(null),W=j()($,2),V=W[0],q=W[1],H=Object(r.useState)(!1),J=j()(H,2),G=J[0],K=J[1],Y=Object(r.useState)(null),Q=j()(Y,2),X=Q[0],Z=Q[1],ee=Object(r.useState)(null),te=j()(ee,2),ne=te[0],re=te[1],oe=Object(r.useState)(null),ie=j()(oe,2),ce=ie[0],ae=ie[1],se=Object(r.useState)(!0),le=j()(se,2),ue=le[0],me=le[1],de=tiobDash.license;Object(r.useEffect)((function(){var e=o.remote_url||o.url,t=new URL("".concat(function(e){return e.replace(/\/$/,"")}(e)+"/","wp-json/ti-demo-data/data"));t.searchParams.append("license",de?de.key:"free"),T(t,!0,!1).then((function(e){e.ok||(re({message:Object(E.__)("Something went wrong while loading the site data. Please refresh the page and try again.","templates-patterns-collection"),code:"ti__ob_failed_fetch_response"}),me(!1)),e.json().then((function(e){ae(U(U({},e),o));var t=U({},e.mandatory_plugins||{}),n=U({},e.recommended_plugins||{}),r=e.default_off_recommended_plugins||[];Object.keys(t).map((function(e){t[e]=!0})),Object.keys(n).map((function(e){n[e]=!r.includes(e)})),Z(U(U({},n),t)),me(!1)}))})).catch((function(e){re({message:Object(E.__)("Something went wrong while loading the site data. Please refresh the page and try again.","templates-patterns-collection"),code:"ti__ob_failed_fetch_catch"}),me(!1)}))}),[]);function pe(){if(!s.content)return console.log("[S] Content."),fe(),!1;var e;q("content"),console.log("[P] Content."),(e={contentFile:ce.content_file,source:"remote",frontPage:ce.front_page,shopPages:ce.shop_pages,demoSlug:ce.slug,editor:n},P(A.root+"/import_content",e)).then((function(e){if(!e.success)return ge(e,"content"),!1;console.log("[D] Content."),e.frontpage_id&&z(e.frontpage_id),v("done"),fe()})).catch((function(e){return ge(e,"content")}))}function fe(){if(!s.customizer)return console.log("[S] Customizer."),he(),!1;var e;q("customizer"),console.log("[P] Customizer."),(e={source_url:ce.url,theme_mods:ce.theme_mods,wp_options:ce.wp_options},P(A.root+"/import_theme_mods",e)).then((function(e){if(!e.success)return ge(e,"customizer"),!1;console.log("[D] Customizer."),S("done"),he()})).catch((function(e){return ge(e,"customizer")}))}function he(){var e;s.widgets||(console.log("[S] Widgets."),be()),q("widgets"),console.log("[P] Widgets."),(e=ce.widgets,P(A.root+"/import_widgets",e)).then((function(e){if(!e.success)return ge(e,"widgets"),!1;console.log("[D] Widgets."),N("done"),be()})).catch((function(e){return ge(e,"widgets")}))}function be(){q("done"),K(!1)}function ge(e,t){K(!1),q(null),"plugins"===t&&v("skip"),["content","plugins"].includes(t)&&S("skip"),["content","plugins","customizer"].includes(t)&&N("skip");var n={plugins:Object(E.__)("Something went wrong while installing the necessary plugins.","templates-patterns-collection"),content:Object(E.__)("Something went wrong while importing the website content.","templates-patterns-collection"),customizer:Object(E.__)("Something went wrong while updating the customizer settings.","templates-patterns-collection"),widgets:Object(E.__)("Something went wrong while importing the widgets.","templates-patterns-collection")};switch(t){case"plugins":p("error");break;case"content":v("error");break;case"customizer":S("error");break;case"widgets":N("error")}re(e.data?{message:n[t],code:e.data}:{message:n[t]})}var ve,Oe=function(){if(G)return!1;t(!1)},ye=!o.external_plugins||o.external_plugins.every((function(e){return!0===e.active})),je=Object.keys(s).every((function(e){return!1===s[e]})),Ee={elementor:"".concat(tiobDash.onboarding.homeUrl,"/wp-admin/post.php?post=").concat(I,"&action=elementor"),brizy:"".concat(tiobDash.onboarding.homeUrl,"/?brizy-edit"),"beaver builder":"".concat(tiobDash.onboarding.homeUrl,"/?fl_builder"),"thrive architect":"".concat(tiobDash.onboarding.homeUrl,"/wp-admin/post.php?post=").concat(I,"&action=architect&tve=true"),"divi builder":"".concat(tiobDash.onboarding.homeUrl,"/?et_fb=1&PageSpeed=off"),gutenberg:"".concat(tiobDash.onboarding.homeUrl,"/wp-admin/post.php?post=").concat(I,"&action=edit")}[n];return Object(r.createElement)(_.Modal,{className:g()(["ob-import-modal",{fetching:ue}]),title:ce&&!ue?ce.title:Object(r.createElement)("span",{className:"is-loading title"}),onRequestClose:Oe,shouldCloseOnClickOutside:!G&&!ue,isDismissible:!G&&!ue},ue?Object(r.createElement)(r.Fragment,null,Object(r.createElement)("div",{className:"modal-body"},Object(r.createElement)("div",{className:"well is-loading"},Object(r.createElement)("h3",null,Object(r.createElement)("div",{className:"mock-icon is-loading"}),Object(r.createElement)("span",{className:"is-loading"})),Object(r.createElement)("ol",null,[1,2,3].map((function(e){return Object(r.createElement)("li",{key:e})})))),Object(r.createElement)("hr",null),Object(r.createElement)("div",{className:"options general"},Object(r.createElement)("h3",{className:"is-loading"}),Object(r.createElement)("ul",null,[1,2,3].map((function(e){return Object(r.createElement)("li",{key:e},Object(r.createElement)("div",{className:"mock-icon is-loading"}),Object(r.createElement)("span",{className:"is-loading"}),Object(r.createElement)("div",{className:"toggle is-loading"}))})))),Object(r.createElement)("hr",null),Object(r.createElement)("div",{className:"options plugins"},Object(r.createElement)("h3",{className:"is-loading"}),Object(r.createElement)("ul",null,[1,2].map((function(e){return Object(r.createElement)("li",{key:e},Object(r.createElement)("div",{className:"mock-icon is-loading"}),Object(r.createElement)("span",{className:"is-loading"}),Object(r.createElement)("div",{className:"toggle is-loading"}))}))))),Object(r.createElement)("div",{className:"modal-footer"},Object(r.createElement)(_.Button,{isSecondary:!0,className:"is-loading"}),Object(r.createElement)(_.Button,{isPrimary:!0,className:"is-loading"}))):Object(r.createElement)(r.Fragment,null,Object(r.createElement)("div",{className:"modal-body"},G||"done"===V||ne?Object(r.createElement)(r.Fragment,null,ne&&Object(r.createElement)(r.Fragment,null,Object(r.createElement)(B,{message:ne.message||null,code:ne.code||null}),Object(r.createElement)("hr",null)),null!==V&&Object(r.createElement)(R,{progress:{plugins:d,content:b,customizer:w,widgets:M},currentStep:V,willDo:s}),"done"===V&&Object(r.createElement)(r.Fragment,null,Object(r.createElement)("hr",null),Object(r.createElement)("p",{className:"import-result"},Object(E.__)("Content was successfully imported. Enjoy your new site!","templates-patterns-collection")),Object(r.createElement)("hr",null))):Object(r.createElement)(r.Fragment,null,Object(r.createElement)(F,{data:ce,externalInstalled:ye}),Object(r.createElement)("hr",null),(ve={content:{title:Object(E.__)("Content","templates-patterns-collection"),icon:"admin-post"},customizer:{title:Object(E.__)("Customizer","templates-patterns-collection"),icon:"admin-customizer"},widgets:{title:Object(E.__)("Widgets","templates-patterns-collection"),icon:"admin-generic"}},Object(r.createElement)("div",{className:"options general"},Object(r.createElement)("h3",null,Object(E.__)("General","templates-patterns-collection"),":"),Object(r.createElement)("ul",null,Object.keys(ve).map((function(e,t){return Object(r.createElement)("li",{key:t},Object(r.createElement)(_.Dashicon,{className:g()({active:s[e]}),icon:ve[e].icon}),Object(r.createElement)("span",null,ve[e].title),Object(r.createElement)("div",{className:"toggle-wrapper"},Object(r.createElement)(_.ToggleControl,{checked:s[e],onChange:function(){l(U(U({},s),{},i()({},e,!s[e])))}})))}))))),Object(r.createElement)("hr",null),function(){if(ue)return null;var e=U(U({},ce.recommended_plugins||{}),ce.mandatory_plugins||{});return Object(r.createElement)("div",{className:"options plugins"},Object(r.createElement)("h3",null,Object(E.__)("Plugins","templates-patterns-collection"),":"),Object(r.createElement)("ul",null,Object.keys(e).map((function(t,n){return Object(r.createElement)("li",{key:n},Object(r.createElement)(_.Dashicon,{icon:"admin-plugins",className:g()({active:X[t]})}),Object(r.createElement)("span",{dangerouslySetInnerHTML:{__html:e[t]}}),t in ce.recommended_plugins&&Object(r.createElement)("div",{className:"toggle-wrapper"},Object(r.createElement)(_.ToggleControl,{checked:X[t],onChange:function(){Z(U(U({},X),{},i()({},t,!X[t])))}})))}))))}())),!G&&Object(r.createElement)("div",{className:"modal-footer"},"done"!==V?Object(r.createElement)(r.Fragment,null,Object(r.createElement)(_.Button,{isSecondary:!0,onClick:Oe},Object(E.__)("Close","templates-patterns-collection")),!ne&&Object(r.createElement)(_.Button,{isPrimary:!0,disabled:je||!ye,onClick:function(){K(!0),function(){if(console.clear(),!X)return console.log("[S] Plugins."),pe(),!1;q("plugins"),console.log("[P] Plugins."),L(X).then((function(e){if(!e.success)return ge(e,"plugins"),!1;console.log("[D] Plugins."),p("done"),pe()})).catch((function(e){return ge(e,"plugins")}))}()}},Object(E.__)("Import","templates-patterns-collection"))):Object(r.createElement)(r.Fragment,null,Object(r.createElement)(_.Button,{isLink:!0,className:"close",onClick:Oe},Object(E.__)("Back to Sites Library","templates-patterns-collection")),Object(r.createElement)(_.Button,{isSecondary:!0,href:tiobDash.onboarding.homeUrl},Object(E.__)("View Website","templates-patterns-collection")),Object(r.createElement)(_.Button,{isPrimary:!0,href:Ee},Object(E.__)("Add your own content","templates-patterns-collection"))))))}));function W(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function V(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?W(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):W(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var q=Object(w.compose)(Object(h.withSelect)((function(e){return{themeData:(0,e("neve-onboarding").getThemeAction)()||!1}})),Object(h.withDispatch)((function(e){var t=e("neve-onboarding"),n=t.setImportModalStatus,r=t.setInstallModalStatus,o=t.setThemeAction;return{setImportModal:function(e){return n(e)},setInstallModal:function(e){return r(e)},setThemeAction:function(e){return o(e)}}})))((function(e){var t=e.setImportModal,n=e.setInstallModal,o=e.themeData,i=e.setThemeAction,c=o.action,a=o.slug,s=o.nonce,l=tiobDash,u=l.themesURL,m=l.brandedTheme,d=Object(r.useState)(!1),p=j()(d,2),f=p[0],h=p[1],b=Object(r.useState)(null),g=j()(b,2),v=g[0],O=g[1],y=function(){n(!1)},w=function(e){h(!1),O(Object(E.sprintf)(// translators: %s: Error message.
|
2 |
-
Object(E.__)("An error has ocurred: %s","templates-patterns-collection"),e))},S=function(){h("activating");var e="".concat(u,"?action=activate&stylesheet=").concat(a,"&_wpnonce=").concat(s);T(e,!0).then((function(e){if(200!==e.status)return w(Object(E.__)("Could not activate theme.","templates-patterns-collection")),h(!1),!1;h(!1),n(!1),i(!1),t(!0)}))};return Object(r.createElement)(_.Modal,{className:"ob-import-modal install-modal",title:Object(E.__)("Install and Activate Neve","templates-patterns-collection"),onRequestClose:y,shouldCloseOnClickOutside:!f,isDismissible:!f},Object(r.createElement)("div",{className:"modal-body",style:{textAlign:"center"}},!m&&Object(r.createElement)("img",{style:{width:75},src:"".concat(tiobDash.assets,"/img/logo.svg"),alt:Object(E.__)("Logo","templates-patterns-collection")}),v&&Object(r.createElement)("div",{className:"well error",style:{margin:"20px 0"}},v),Object(r.createElement)("p",{style:{lineHeight:1.6,fontSize:"15px"}},Object(E.__)("In order to import the starter site, Neve theme has to be installed and activated. Click the button below to install and activate Neve","templates-patterns-collection"))),Object(r.createElement)("div",{className:"modal-footer",style:{justifyContent:"center"}},Object(r.createElement)("div",{className:"actions",style:{display:"flex"}},!v&&Object(r.createElement)(_.Button,{dismiss:v,isPrimary:!0,disabled:f,className:f&&"is-loading",icon:f&&"update",onClick:"install"===c?function(){h("installing"),wp.updates.installTheme({slug:"neve",success:function(){i(V(V({},o),{},{action:"activate"})),S()},error:function(e){i(V(V({},o),{},{action:"activate"})),w(e.errorMessage||Object(E.__)("Could not install theme.","templates-patterns-collection"))}})}:S},f&&("installing"===f?Object(E.__)("Installing"):Object(E.__)("Activating")),!f&&("install"===c?Object(E.__)("Install and Activate","templates-patterns-collection"):Object(E.__)("Activate","templates-patterns-collection"))),Object(r.createElement)(_.Button,{isSecondary:!0,disabled:f,onClick:y},Object(E.__)("Close","templates-patterns-collection")))))})),H=function(e){var t=e.data,n=function(e){return console.log(e)},o=Object(r.useState)(!1),i=j()(o,2),c=i[0],a=i[1],s=Object(r.useState)(!1),l=j()(s,2),u=l[0],m=l[1],d=Object(r.useState)(!1),p=j()(d,2),f=p[0],h=p[1],b=Object(r.useState)(null),g=j()(b,2),v=g[0],O=g[1],y=Object(r.useState)(null),w=j()(y,2),S=w[0],k=w[1];if(c)return null;var C=function(){"done"===f&&a(!0),m(!1),O(null),h(!1)};return Object(r.createElement)("div",{className:"ob-migration"},u&&Object(r.createElement)(_.Modal,{className:"ob-import-modal migration",title:Object(E.__)("Migrate","templates-patterns-collection")+" "+t.theme_name,onRequestClose:C,shouldCloseOnClickOutside:!f,isDismissible:!f},Object(r.createElement)(r.Fragment,null,Object(r.createElement)("div",{className:"modal-body"},v&&Object(r.createElement)(B,{message:v.message||null,code:v.code||null}),!1===f&&!v&&Object(r.createElement)(r.Fragment,null,Object(r.createElement)(F,{data:t}),t.mandatory_plugins&&Object(r.createElement)(r.Fragment,null,Object(r.createElement)("hr",null),Object(r.createElement)("h3",null,Object(E.__)("The following plugins will be installed","neve"),":"),Object(r.createElement)("ul",null,Object.keys(t.mandatory_plugins).map((function(e,n){return Object(r.createElement)("li",{key:n},"-"," ",t.mandatory_plugins[e])}))))),"done"===f&&Object(r.createElement)("p",{className:"import-result"},Object(E.__)("Content was successfully imported. Enjoy your new site!","neve")),!0===f&&Object(r.createElement)("div",{className:"loading"},Object(r.createElement)(_.Dashicon,{icon:"update",size:50}),Object(r.createElement)("h3",null,Object(E.__)("Migrating","templates-patterns-collection"),"..."))),(!f||"done"===f)&&Object(r.createElement)("div",{className:"modal-footer"},Object(r.createElement)(_.Button,{isSecondary:"done"!==f,isLink:"done"===f,className:"done"===f?"close":null,onClick:C},"done"===f?Object(E.__)("Close","templates-patterns-collection"):Object(E.__)("Cancel","templates-patterns-collection")),v||"done"===f?Object(r.createElement)(r.Fragment,null,Object(r.createElement)(_.Button,{isSecondary:!0,href:"".concat(tiobDash.onboarding.homeUrl,"/wp-admin/post.php?post=").concat(S,"&action=elementor")},Object(E.__)("Edit Content","templates-patterns-collection")),Object(r.createElement)(_.Button,{isPrimary:!0,href:tiobDash.onboarding.homeUrl},Object(E.__)("View Website","templates-patterns-collection"))):Object(r.createElement)(_.Button,{isPrimary:!0,onClick:function(){var e;e=Object.keys(t.mandatory_plugins).reduce((function(e,t){return e[t]=!0,e}),{}),L(e).then((function(e){if(h(!0),!e.success)return O({code:e.data||null,message:Object(E.__)("Something went wrong while installing the necessary plugins.","neve")}),h(!1),!1;var n=t.template,r=t.template_name;P(tiobDash.onboarding.root+"/migrate_frontpage",{template:n,template_name:r}).then((function(e){if(!e.success)return O({code:e.data||null,message:Object(E.__)("Something went wrong while importing the website content.","neve")}),h(!1),!1;k(e.data),h("done")}))}))}},Object(E.__)("Start Migration","templates-patterns-collection"))))),Object(r.createElement)("h2",null,t.heading),Object(r.createElement)("p",null,t.description),Object(r.createElement)("div",{className:"card starter-site-card"},Object(r.createElement)("div",{className:"top"},t.screenshot&&Object(r.createElement)("div",{className:"image"},Object(r.createElement)("img",{src:t.screenshot,alt:t.theme_name}))),Object(r.createElement)("div",{className:"bottom"},Object(r.createElement)("p",{className:"title"},t.theme_name))),Object(r.createElement)("div",{className:"actions"},Object(r.createElement)(_.Button,{isPrimary:!0,onClick:function(){return m(!0),!1}},Object(E.__)("Migrate","templates-patterns-collection")+" "+t.theme_name),Object(r.createElement)(_.Button,{isSecondary:!0,onClick:function(){P(tiobDash.onboarding.root+"/dismiss_migration",{theme_mod:t.theme_mod}).then((function(e){if(!e.success)return n(Object(E.__)("Something went wrong. Please reload the page and try again.","neve")),!1;n(Object(E.__)("Dismissed","templates-patterns-collection")),a(!0)}))}},Object(E.__)("Dismiss","templates-patterns-collection"))))},J=n(9),G=n.n(J),K=n(14),Y=n.n(K),Q=Object(w.compose)(Object(h.withSelect)((function(e){var t=e("neve-onboarding"),n=t.getCurrentEditor,r=t.getSites;return{editor:n(),sites:r().sites}})),Object(h.withDispatch)((function(e){var t=e("neve-onboarding").setCurrentEditor;return{setCurrentEditor:function(e){return t(e)}}})))((function(e){var t=e.EDITOR_MAP,n=e.count,o=e.onlyProSites,i=e.editor,c=e.setCurrentEditor,a=e.sites,s=Object.keys(a);return Object(r.createElement)("div",{className:"editor-tabs"},s.map((function(e,a){var s=g()(["tab",e,{active:e===i}]);return Object(r.createElement)("a",{key:a,href:"#",className:s,onClick:function(t){t.preventDefault(),c(e)}},Object(r.createElement)("span",{className:"icon-wrap"},Object(r.createElement)("img",{className:"editor-icon",src:tiobDash.assets+"img/"+t[e].icon,alt:Object(E.__)("Builder Logo","templates-patterns-collection")})),Object(r.createElement)("span",{className:"editor"},t[e].niceName),Object(r.createElement)("span",{className:"count"},n[e]),o.includes(e)&&Object(r.createElement)("span",{className:"pro-badge"},"PRO"))})))})),X=Object(w.compose)(Object(h.withSelect)((function(e){var t=e("neve-onboarding"),n=t.getCurrentEditor,r=t.getSites;return{editor:n(),sites:r().sites}})),Object(h.withDispatch)((function(e){var t=e("neve-onboarding").setCurrentEditor;return{setCurrentEditor:function(e){return t(e)}}})))((function(e){var t=e.EDITOR_MAP,n=e.count,o=e.editor,i=e.setCurrentEditor,c=e.sites,a=e.isSmall,s=Object(r.useState)(!1),l=j()(s,2),u=l[0],m=l[1],d=Object.keys(c),p=function(){return m(!u)},f=g()(["ob-dropdown","editor-selector",{small:a}]);return Object(r.createElement)("div",{className:f},Object(r.createElement)(_.Button,{onClick:p,className:"select ob-dropdown"},Object(r.createElement)("img",{className:"editor-icon",src:tiobDash.assets+"img/"+t[o].icon,alt:Object(E.__)("Builder Logo","templates-patterns-collection")}),!a&&Object(r.createElement)("span",null,t[o].niceName),Object(r.createElement)("span",{className:"count"},n[o]),Object(r.createElement)(_.Dashicon,{size:14,icon:u?"arrow-up-alt2":"arrow-down-alt2"}),u&&Object(r.createElement)(_.Popover,{position:"bottom center",onClose:p,noArrow:!0},u&&Object(r.createElement)("ul",{className:"options"},d.map((function(e,c){return e===o?null:Object(r.createElement)("li",{key:c},Object(r.createElement)("a",{href:"#",onClick:function(t){t.preventDefault(),i(e),m(!1)}},Object(r.createElement)("img",{className:"editor-icon",src:tiobDash.assets+"img/"+t[e].icon,alt:Object(E.__)("Builder Logo","templates-patterns-collection")}),Object(r.createElement)("span",null,t[e].niceName),Object(r.createElement)("span",{className:"count"},n[e])))}))))))})),Z=Object(w.compose)(Object(h.withDispatch)((function(e){var t=e("neve-onboarding"),n=t.setOnboardingState,r=t.setCurrentCategory;return{cancelOnboarding:function(){n(!1)},resetCategory:function(){r("all")}}})),Object(h.withSelect)((function(e){var t=e("neve-onboarding"),n=t.getCurrentEditor,r=t.getCurrentCategory,o=t.getPreviewStatus,i=t.getCurrentSite,c=t.getImportModalStatus,a=t.getOnboardingStatus,s=t.getSites,l=t.getInstallModalStatus;return{editor:n(),category:r(),previewOpen:o(),currentSiteData:i(),importModal:c(),installModal:l(),isOnboarding:a(),getSites:s()}})))((function(e){var t=e.editor,n=e.category,o=e.resetCategory,i=e.previewOpen,c=e.currentSiteData,a=e.importModal,s=e.isOnboarding,l=e.cancelOnboarding,u=e.getSites,m=e.installModal,d=Object(r.useState)(""),p=j()(d,2),f=p[0],h=p[1],b=Object(r.useState)(9),g=j()(b,2),v=g[0],y=g[1],w=u.sites,M=void 0===w?{}:w,N=u.migration,x=Object(r.useState)(!1),D=j()(x,2),P=D[0],T=D[1];if(1>M.length)return Object(r.createElement)(r.Fragment,null,Object(r.createElement)("p",null,Object(E.__)("Starter sites could not be loaded. Please refresh and try again.","neve"),s&&Object(r.createElement)(_.Button,{style:{display:"block",margin:"20px auto"},isPrimary:!0,onClick:l},Object(E.__)("Close","templates-patterns-collection"))));var I=[Object(E.__)("Business","templates-patterns-collection"),Object(E.__)("Ecommerce","templates-patterns-collection"),Object(E.__)("Fashion","templates-patterns-collection"),Object(E.__)("Blogging","templates-patterns-collection"),Object(E.__)("Photography","templates-patterns-collection")],A={all:Object(E.__)("All Categories"),free:Object(E.__)("Free"),business:Object(E.__)("Business"),portfolio:Object(E.__)("Portfolio"),woocommerce:Object(E.__)("WooCommerce"),blog:Object(E.__)("Blog"),personal:Object(E.__)("Personal"),other:Object(E.__)("Other")},L={gutenberg:{icon:"gutenberg.jpg",niceName:"Gutenberg"},elementor:{icon:"elementor.jpg",niceName:"Elementor"},"beaver builder":{icon:"beaver.jpg",niceName:Object(r.createElement)(r.Fragment,null,"Beaver ",Object(r.createElement)("span",{className:"long-name"},"Builder"))},brizy:{icon:"brizy.jpg",niceName:"Brizy"},"divi builder":{icon:"divi.jpg",niceName:"Divi"},"thrive architect":{icon:"thrive.jpg",niceName:Object(r.createElement)(r.Fragment,null,"Thrive ",Object(r.createElement)("span",{className:"long-name"},"Architect"))}},R=function(){var e={};return U().map((function(t){var n=M&&M[t]?M[t]:{};e[t]=O()(Object.values(n))})),e},F=function(e,t){return"free"===t?e.filter((function(e){return!e.upsell})):"all"!==t?e.filter((function(e){return e.keywords.includes(t)})):e},B=function(e){return f?new Y.a(e,{includeScore:!0,keys:["title","slug","keywords"]}).search(f).map((function(e){return e.item})):e},z=function(e){return R()[e]},U=function(){return Object.keys(M)},W=function(){var e=R()[t];return e=B(e),e=F(e,n)},V=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null===c)return null;var n=R()[t],r=n.indexOf(c);return-1===r||1===n.length?null:e&&0===r?n[n.length-1]:e||r!==n.length-1?n[e?r-1:r+1]:n[0]};var J,K=U().filter((function(e){return Object.keys(M[e]).filter((function(t){return!0===M[e][t].upsell})).length===Object.keys(M[e]).length})),Z=(J={builders:{},categories:{}},U().map((function(e){var t=z(e);t=F(t,n),t=B(t),J.builders[e]=t?t.length:0})),Object.keys(A).map((function(e){var n=z(t);n=F(n,e),n=B(n),J.categories[e]=n?n.length:0})),J);return Object(r.createElement)(r.Fragment,null,Object(r.createElement)("div",{className:"ob"},P&&!s&&Object(r.createElement)("div",{className:"sticky-nav"},Object(r.createElement)("div",{className:"container sticky-nav-content"},!tiobDash.brandedTheme&&Object(r.createElement)("img",{src:"".concat(tiobDash.assets,"img/logo.svg"),alt:"Logo"}),Object(r.createElement)(S,{count:Z.categories,categories:A,onSearch:function(e){h(e),y(9)},query:f}),Object(r.createElement)(X,{isSmall:!0,count:Z.builders,EDITOR_MAP:L}))),N?Object(r.createElement)(H,{data:N}):null,Object(r.createElement)("div",{className:"ob-head"},!s&&Object(r.createElement)(r.Fragment,null,Object(r.createElement)("h2",null,!tiobDash.brandedTheme&&Object(r.createElement)("img",{src:"".concat(tiobDash.assets,"img/logo.svg"),alt:"Logo"}),Object(r.createElement)("span",null,Object(E.__)("Ready to use pre-built websites with 1-click installation","neve"))),Object(r.createElement)("p",null,tiobDash.strings.starterSitesTabDescription)),s&&Object(r.createElement)(_.Button,{className:"close-onboarding",isLink:!0,icon:"no-alt",onClick:l})),Object(r.createElement)("div",{className:"ob-body"},Object(r.createElement)(G.a,{onChange:function(e){T(!e)}},Object(r.createElement)("div",null,Object(r.createElement)(X,{count:Z.builders,EDITOR_MAP:L}),Object(r.createElement)(S,{count:Z.categories,categories:A,onSearch:function(e){h(e),y(9)},query:f}),Object(r.createElement)(Q,{EDITOR_MAP:L,onlyProSites:K,count:Z.builders}))),0===W().length?Object(r.createElement)("div",{className:"no-results"},Object(r.createElement)("p",null,Object(E.__)("No results found","templates-patterns-collection"),"."," ",Object(E.__)("You can try a different search or use one of the categories below.","neve")),Object(r.createElement)("div",{className:"tags"},I.map((function(e,t){return Object(r.createElement)(_.Button,{key:t,isPrimary:!0,className:"tag",onClick:function(t){t.preventDefault(),h(e),o()}},e)})))):Object(r.createElement)("div",{className:"ob-sites"},W().slice(0,v).map((function(e,t){return Object(r.createElement)(k,{key:t,data:e})}))),Object(r.createElement)(G.a,{onChange:function(e){if(!e)return!1;y(v+9)}},Object(r.createElement)("span",{style:{height:10,width:10,display:"block"}})))),i&&c&&Object(r.createElement)(C,{next:V(),prev:V(!0)}),a&&c&&Object(r.createElement)($,null),m&&Object(r.createElement)(q,null))})),ee=Object(h.withSelect)((function(e){return{onboarding:(0,e("neve-onboarding").getOnboardingStatus)()}}))((function(e){var t=e.onboarding,n=g()(["content-wrap","starter-sites",{"is-onboarding":t}]);return Object(r.createElement)("div",{className:"tiob-wrap"},Object(r.createElement)("div",{className:n},Object(r.createElement)("div",{className:"container content"},Object(r.createElement)("div",{className:"main"},Object(r.createElement)("div",{className:"tab-content columns starter-sites"},Object(r.createElement)(Z,null))))))}));Object(h.registerStore)("neve-onboarding",{reducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"REFRESH_SITES":var n=t.payload.sites;return a(a({},e),{},{sites:n});case"SET_CURRENT_EDITOR":var r=t.payload.editor;return localStorage.setItem("neve-onboarding-editor",r),a(a({},e),{},{editor:r});case"SET_CURRENT_CATEGORY":var o=t.payload.category;return a(a({},e),{},{category:o});case"SET_FOCUSED_SITE":var i=t.payload.siteData;return a(a({},e),{},{currentSite:i});case"SET_PREVIEW_STATUS":var c=t.payload.previewStatus;return a(a({},e),{},{previewStatus:c});case"SET_IMPORT_MODAL_STATUS":var s=t.payload.importModalStatus;return a(a({},e),{},{importModalStatus:s});case"SET_INSTALL_MODAL_STATUS":var l=t.payload.installModalStatus;return a(a({},e),{},{installModalStatus:l});case"SET_ONBOARDING":var u=t.payload.status;return a(a({},e),{},{isOnboarding:u});case"SET_THEME_ACTIONS":var m=t.payload.themeActions;return a(a({},e),{},{themeAction:m})}return e},actions:f,selectors:{getSites:function(e){return e.sites},getMigrationData:function(e){return e.migrationData},getCurrentEditor:function(e){return e.editor},getCurrentCategory:function(e){return e.category},getCurrentSite:function(e){return e.currentSite},getPreviewStatus:function(e){return e.previewStatus},getImportModalStatus:function(e){return e.importModalStatus},getOnboardingStatus:function(e){return e.isOnboarding},getThemeAction:function(e){return e.themeAction},getInstallModalStatus:function(e){return e.installModalStatus}}}),Object(r.render)(Object(r.createElement)(ee,null),document.getElementById("tpc-app"))}]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(window.webpackJsonp=window.webpackJsonp||[]).push([[1],{20:function(e,t,n){}}]),function(e){function t(t){for(var r,o,i=t[0],s=t[1],l=t[2],m=0,p=[];m<i.length;m++)o=i[m],Object.prototype.hasOwnProperty.call(a,o)&&a[o]&&p.push(a[o][0]),a[o]=0;for(r in s)Object.prototype.hasOwnProperty.call(s,r)&&(e[r]=s[r]);for(u&&u(t);p.length;)p.shift()();return c.push.apply(c,l||[]),n()}function n(){for(var e,t=0;t<c.length;t++){for(var n=c[t],r=!0,i=1;i<n.length;i++){var s=n[i];0!==a[s]&&(r=!1)}r&&(c.splice(t--,1),e=o(o.s=n[0]))}return e}var r={},a={0:0},c=[];function o(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.m=e,o.c=r,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="";var i=window.webpackJsonp=window.webpackJsonp||[],s=i.push.bind(i);i.push=t,i=i.slice();for(var l=0;l<i.length;l++)t(i[l]);var u=s;c.push([32,1]),n()}([function(e,t){!function(){e.exports=this.wp.element}()},function(e,t){!function(){e.exports=this.wp.i18n}()},function(e,t){!function(){e.exports=this.wp.components}()},function(e,t,n){var r=n(21),a=n(22),c=n(15),o=n(23);e.exports=function(e,t){return r(e)||a(e,t)||c(e,t)||o()}},function(e,t){!function(){e.exports=this.wp.data}()},function(e,t){!function(){e.exports=this.wp.primitives}()},function(e,t,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function a(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var c=typeof r;if("string"===c||"number"===c)e.push(r);else if(Array.isArray(r)&&r.length){var o=a.apply(null,r);o&&e.push(o)}else if("object"===c)for(var i in r)n.call(r,i)&&r[i]&&e.push(i)}}return e.join(" ")}e.exports?(a.default=a,e.exports=a):void 0===(r=function(){return a}.apply(t,[]))||(e.exports=r)}()},function(e,t){!function(){e.exports=this.wp.compose}()},function(e,t){!function(){e.exports=this.regeneratorRuntime}()},function(e,t){function n(e,t,n,r,a,c,o){try{var i=e[c](o),s=i.value}catch(e){return void n(e)}i.done?t(s):Promise.resolve(s).then(r,a)}e.exports=function(e){return function(){var t=this,r=arguments;return new Promise((function(a,c){var o=e.apply(t,r);function i(e){n(o,a,c,i,s,"next",e)}function s(e){n(o,a,c,i,s,"throw",e)}i(void 0)}))}}},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t,n){"use strict";const r=n(24),a=n(25),c=n(26);function o(e){if("string"!=typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function i(e,t){return t.encode?t.strict?r(e):encodeURIComponent(e):e}function s(e,t){return t.decode?a(e):e}function l(e){const t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function u(e){const t=(e=l(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function m(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function p(e,t){o((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);const n=function(e){let t;switch(e.arrayFormat){case"index":return(e,n,r)=>{t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===r[e]&&(r[e]={}),r[e][t[1]]=n):r[e]=n};case"bracket":return(e,n,r)=>{t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],n):r[e]=[n]:r[e]=n};case"comma":case"separator":return(t,n,r)=>{const a="string"==typeof n&&n.includes(e.arrayFormatSeparator),c="string"==typeof n&&!a&&s(n,e).includes(e.arrayFormatSeparator);n=c?s(n,e):n;const o=a||c?n.split(e.arrayFormatSeparator).map(t=>s(t,e)):null===n?n:s(n,e);r[t]=o};default:return(e,t,n)=>{void 0!==n[e]?n[e]=[].concat(n[e],t):n[e]=t}}}(t),r=Object.create(null);if("string"!=typeof e)return r;if(!(e=e.trim().replace(/^[?#&]/,"")))return r;for(const a of e.split("&")){let[e,o]=c(t.decode?a.replace(/\+/g," "):a,"=");o=void 0===o?null:["comma","separator"].includes(t.arrayFormat)?o:s(o,t),n(s(e,t),o,r)}for(const e of Object.keys(r)){const n=r[e];if("object"==typeof n&&null!==n)for(const e of Object.keys(n))n[e]=m(n[e],t);else r[e]=m(n,t)}return!1===t.sort?r:(!0===t.sort?Object.keys(r).sort():Object.keys(r).sort(t.sort)).reduce((e,t)=>{const n=r[t];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?e[t]=function e(t){return Array.isArray(t)?t.sort():"object"==typeof t?e(Object.keys(t)).sort((e,t)=>Number(e)-Number(t)).map(e=>t[e]):t}(n):e[t]=n,e},Object.create(null))}t.extract=u,t.parse=p,t.stringify=(e,t)=>{if(!e)return"";o((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);const n=n=>t.skipNull&&null==e[n]||t.skipEmptyString&&""===e[n],r=function(e){switch(e.arrayFormat){case"index":return t=>(n,r)=>{const a=n.length;return void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[i(t,e),"[",a,"]"].join("")]:[...n,[i(t,e),"[",i(a,e),"]=",i(r,e)].join("")]};case"bracket":return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[i(t,e),"[]"].join("")]:[...n,[i(t,e),"[]=",i(r,e)].join("")];case"comma":case"separator":return t=>(n,r)=>null==r||0===r.length?n:0===n.length?[[i(t,e),"=",i(r,e)].join("")]:[[n,i(r,e)].join(e.arrayFormatSeparator)];default:return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,i(t,e)]:[...n,[i(t,e),"=",i(r,e)].join("")]}}(t),a={};for(const t of Object.keys(e))n(t)||(a[t]=e[t]);const c=Object.keys(a);return!1!==t.sort&&c.sort(t.sort),c.map(n=>{const a=e[n];return void 0===a?"":null===a?i(n,t):Array.isArray(a)?a.reduce(r(n),[]).join("&"):i(n,t)+"="+i(a,t)}).filter(e=>e.length>0).join("&")},t.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);const[n,r]=c(e,"#");return Object.assign({url:n.split("?")[0]||"",query:p(u(e),t)},t&&t.parseFragmentIdentifier&&r?{fragmentIdentifier:s(r,t)}:{})},t.stringifyUrl=(e,n)=>{n=Object.assign({encode:!0,strict:!0},n);const r=l(e.url).split("?")[0]||"",a=t.extract(e.url),c=t.parse(a,{sort:!1}),o=Object.assign(c,e.query);let s=t.stringify(o,n);s&&(s="?"+s);let u=function(e){let t="";const n=e.indexOf("#");return-1!==n&&(t=e.slice(n)),t}(e.url);return e.fragmentIdentifier&&(u="#"+i(e.fragmentIdentifier,n)),`${r}${s}${u}`}},function(e,t){!function(){e.exports=this.wp.apiFetch}()},,function(e,t,n){var r;r=function(e,t){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([function(e,t,n){e.exports=n(5)()},function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t){e.exports=function(e,t,n){var r=e.direction,a=e.value;switch(r){case"top":return n.top+a<t.top&&n.bottom>t.bottom&&n.left<t.left&&n.right>t.right;case"left":return n.left+a<t.left&&n.bottom>t.bottom&&n.top<t.top&&n.right>t.right;case"bottom":return n.bottom-a>t.bottom&&n.left<t.left&&n.right>t.right&&n.top<t.top;case"right":return n.right-a>t.right&&n.left<t.left&&n.top<t.top&&n.bottom>t.bottom}}},function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return g}));var r=n(1),a=n.n(r),c=n(2),o=n.n(c),i=n(0),s=n.n(i),l=n(3),u=n.n(l);function m(e){return(m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function b(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var g=function(e){function t(e){var n,r,a;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),r=this,a=d(t).call(this,e),n=!a||"object"!==m(a)&&"function"!=typeof a?b(r):a,h(b(n),"getContainer",(function(){return n.props.containment||window})),h(b(n),"addEventListener",(function(e,t,r,a){var c;n.debounceCheck||(n.debounceCheck={});var o=function(){c=null,n.check()},i={target:e,fn:a>-1?function(){c||(c=setTimeout(o,a||0))}:function(){clearTimeout(c),c=setTimeout(o,r||0)},getLastTimeout:function(){return c}};e.addEventListener(t,i.fn),n.debounceCheck[t]=i})),h(b(n),"startWatching",(function(){n.debounceCheck||n.interval||(n.props.intervalCheck&&(n.interval=setInterval(n.check,n.props.intervalDelay)),n.props.scrollCheck&&n.addEventListener(n.getContainer(),"scroll",n.props.scrollDelay,n.props.scrollThrottle),n.props.resizeCheck&&n.addEventListener(window,"resize",n.props.resizeDelay,n.props.resizeThrottle),!n.props.delayedCall&&n.check())})),h(b(n),"stopWatching",(function(){if(n.debounceCheck)for(var e in n.debounceCheck)if(n.debounceCheck.hasOwnProperty(e)){var t=n.debounceCheck[e];clearTimeout(t.getLastTimeout()),t.target.removeEventListener(e,t.fn),n.debounceCheck[e]=null}n.debounceCheck=null,n.interval&&(n.interval=clearInterval(n.interval))})),h(b(n),"check",(function(){var e,t,r=n.node;if(!r)return n.state;if(e=function(e){return void 0===e.width&&(e.width=e.right-e.left),void 0===e.height&&(e.height=e.bottom-e.top),e}(n.roundRectDown(r.getBoundingClientRect())),n.props.containment){var a=n.props.containment.getBoundingClientRect();t={top:a.top,left:a.left,bottom:a.bottom,right:a.right}}else t={top:0,left:0,bottom:window.innerHeight||document.documentElement.clientHeight,right:window.innerWidth||document.documentElement.clientWidth};var c=n.props.offset||{};"object"===m(c)&&(t.top+=c.top||0,t.left+=c.left||0,t.bottom-=c.bottom||0,t.right-=c.right||0);var o={top:e.top>=t.top,left:e.left>=t.left,bottom:e.bottom<=t.bottom,right:e.right<=t.right},i=e.height>0&&e.width>0,s=i&&o.top&&o.left&&o.bottom&&o.right;if(i&&n.props.partialVisibility){var l=e.top<=t.bottom&&e.bottom>=t.top&&e.left<=t.right&&e.right>=t.left;"string"==typeof n.props.partialVisibility&&(l=o[n.props.partialVisibility]),s=n.props.minTopValue?l&&e.top<=t.bottom-n.props.minTopValue:l}"string"==typeof c.direction&&"number"==typeof c.value&&(console.warn("[notice] offset.direction and offset.value have been deprecated. They still work for now, but will be removed in next major version. Please upgrade to the new syntax: { %s: %d }",c.direction,c.value),s=u()(c,e,t));var p=n.state;return n.state.isVisible!==s&&(p={isVisible:s,visibilityRect:o},n.setState(p),n.props.onChange&&n.props.onChange(s)),p})),n.state={isVisible:null,visibilityRect:{}},n}var n,r,c;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&f(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){this.node=o.a.findDOMNode(this),this.props.active&&this.startWatching()}},{key:"componentWillUnmount",value:function(){this.stopWatching()}},{key:"componentDidUpdate",value:function(e){this.node=o.a.findDOMNode(this),this.props.active&&!e.active?(this.setState({isVisible:null,visibilityRect:{}}),this.startWatching()):this.props.active||this.stopWatching()}},{key:"roundRectDown",value:function(e){return{top:Math.floor(e.top),left:Math.floor(e.left),bottom:Math.floor(e.bottom),right:Math.floor(e.right)}}},{key:"render",value:function(){return this.props.children instanceof Function?this.props.children({isVisible:this.state.isVisible,visibilityRect:this.state.visibilityRect}):a.a.Children.only(this.props.children)}}])&&p(n.prototype,r),c&&p(n,c),t}(a.a.Component);h(g,"defaultProps",{active:!0,partialVisibility:!1,minTopValue:0,scrollCheck:!1,scrollDelay:250,scrollThrottle:-1,resizeCheck:!1,resizeDelay:250,resizeThrottle:-1,intervalCheck:!0,intervalDelay:100,delayedCall:!1,offset:{},containment:null,children:a.a.createElement("span",null)}),h(g,"propTypes",{onChange:s.a.func,active:s.a.bool,partialVisibility:s.a.oneOfType([s.a.bool,s.a.oneOf(["top","right","bottom","left"])]),delayedCall:s.a.bool,offset:s.a.oneOfType([s.a.shape({top:s.a.number,left:s.a.number,bottom:s.a.number,right:s.a.number}),s.a.shape({direction:s.a.oneOf(["top","right","bottom","left"]),value:s.a.number})]),scrollCheck:s.a.bool,scrollDelay:s.a.number,scrollThrottle:s.a.number,resizeCheck:s.a.bool,resizeDelay:s.a.number,resizeThrottle:s.a.number,intervalCheck:s.a.bool,intervalDelay:s.a.number,containment:"undefined"!=typeof window?s.a.instanceOf(window.Element):s.a.any,children:s.a.oneOfType([s.a.element,s.a.func]),minTopValue:s.a.number})},function(e,t,n){"use strict";var r=n(6);function a(){}function c(){}c.resetWarningCache=a,e.exports=function(){function e(e,t,n,a,c,o){if(o!==r){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:c,resetWarningCache:a};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}])},e.exports=r(n(30),n(31))},function(e,t,n){var r=n(16);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}},function(e,t,n){var r=n(27),a=n(28),c=n(15),o=n(29);e.exports=function(e){return r(e)||a(e)||c(e)||o()}},function(e,t,n){var r;r=function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function r(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&function(e,t){(Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}(e,t)}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function u(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=s(e);if(t){var a=s(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return l(this,n)}}function m(e){return function(e){if(Array.isArray(e))return p(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function d(e){return Array.isArray?Array.isArray(e):"[object Array]"===v(e)}function b(e){return"string"==typeof e}function f(e){return"number"==typeof e}function h(t){return"object"===e(t)}function g(e){return null!=e}function O(e){return!e.trim().length}function v(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}var j=function(e){return"Invalid value for key ".concat(e)},y=function(e){return"Pattern length exceeds max of ".concat(e,".")},E=Object.prototype.hasOwnProperty,_=function(){function e(n){var r=this;t(this,e),this._keys=[],this._keyMap={};var a=0;n.forEach((function(e){var t=w(e);a+=t.weight,r._keys.push(t),r._keyMap[t.id]=t,a+=t.weight})),this._keys.forEach((function(e){e.weight/=a}))}return r(e,[{key:"get",value:function(e){return this._keyMap[e]}},{key:"keys",value:function(){return this._keys}},{key:"toJSON",value:function(){return JSON.stringify(this._keys)}}]),e}();function w(e){var t=null,n=null,r=null,a=1;if(b(e)||d(e))r=e,t=S(e),n=k(e);else{if(!E.call(e,"name"))throw new Error("Missing ".concat("name"," property in key"));var c=e.name;if(r=c,E.call(e,"weight")&&(a=e.weight)<=0)throw new Error(function(e){return"Property 'weight' in key '".concat(e,"' must be a positive integer")}(c));t=S(c),n=k(c)}return{path:t,id:n,weight:a,src:r}}function S(e){return d(e)?e:e.split(".")}function k(e){return d(e)?e.join("."):e}var C=o({},{isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:function(e,t){return e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1}},{},{includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},{},{location:0,threshold:.6,distance:100},{},{useExtendedSearch:!1,getFn:function(e,t){var n=[],r=!1;return function e(t,a,c){if(a[c]){var o=t[a[c]];if(!g(o))return;if(c===a.length-1&&(b(o)||f(o)||function(e){return!0===e||!1===e||function(e){return h(e)&&null!==e}(e)&&"[object Boolean]"==v(e)}(o)))n.push(function(e){return null==e?"":function(e){if("string"==typeof e)return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(e)}(o));else if(d(o)){r=!0;for(var i=0,s=o.length;i<s;i+=1)e(o[i],a,c+1)}else a.length&&e(o,a,c+1)}else n.push(t)}(e,b(t)?t.split("."):t,0),r?n:n[0]},ignoreLocation:!1,ignoreFieldNorm:!1}),N=/[^ ]+/g;function T(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3,t=new Map;return{get:function(n){var r=n.match(N).length;if(t.has(r))return t.get(r);var a=parseFloat((1/Math.sqrt(r)).toFixed(e));return t.set(r,a),a},clear:function(){t.clear()}}}var M=function(){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.getFn,a=void 0===r?C.getFn:r;t(this,e),this.norm=T(3),this.getFn=a,this.isCreated=!1,this.setIndexRecords()}return r(e,[{key:"setSources",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.docs=e}},{key:"setIndexRecords",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.records=e}},{key:"setKeys",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.keys=t,this._keysMap={},t.forEach((function(t,n){e._keysMap[t.id]=n}))}},{key:"create",value:function(){var e=this;!this.isCreated&&this.docs.length&&(this.isCreated=!0,b(this.docs[0])?this.docs.forEach((function(t,n){e._addString(t,n)})):this.docs.forEach((function(t,n){e._addObject(t,n)})),this.norm.clear())}},{key:"add",value:function(e){var t=this.size();b(e)?this._addString(e,t):this._addObject(e,t)}},{key:"removeAt",value:function(e){this.records.splice(e,1);for(var t=e,n=this.size();t<n;t+=1)this.records[t].i-=1}},{key:"getValueForItemAtKeyId",value:function(e,t){return e[this._keysMap[t]]}},{key:"size",value:function(){return this.records.length}},{key:"_addString",value:function(e,t){if(g(e)&&!O(e)){var n={v:e,i:t,n:this.norm.get(e)};this.records.push(n)}}},{key:"_addObject",value:function(e,t){var n=this,r={i:t,$:{}};this.keys.forEach((function(t,a){var c=n.getFn(e,t.path);if(g(c))if(d(c))!function(){for(var e=[],t=[{nestedArrIndex:-1,value:c}];t.length;){var o=t.pop(),i=o.nestedArrIndex,s=o.value;if(g(s))if(b(s)&&!O(s)){var l={v:s,i:i,n:n.norm.get(s)};e.push(l)}else d(s)&&s.forEach((function(e,n){t.push({nestedArrIndex:n,value:e})}))}r.$[a]=e}();else if(!O(c)){var o={v:c,n:n.norm.get(c)};r.$[a]=o}})),this.records.push(r)}},{key:"toJSON",value:function(){return{keys:this.keys,records:this.records}}}]),e}();function x(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.getFn,a=void 0===r?C.getFn:r,c=new M({getFn:a});return c.setKeys(e.map(w)),c.setSources(t),c.create(),c}function I(e,t){var n=e.matches;t.matches=[],g(n)&&n.forEach((function(e){if(g(e.indices)&&e.indices.length){var n={indices:e.indices,value:e.value};e.key&&(n.key=e.key.src),e.idx>-1&&(n.refIndex=e.idx),t.matches.push(n)}}))}function P(e,t){t.score=e.score}function D(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.errors,r=void 0===n?0:n,a=t.currentLocation,c=void 0===a?0:a,o=t.expectedLocation,i=void 0===o?0:o,s=t.distance,l=void 0===s?C.distance:s,u=t.ignoreLocation,m=void 0===u?C.ignoreLocation:u,p=r/e.length;if(m)return p;var d=Math.abs(i-c);return l?p+d/l:d?1:p}function L(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:C.minMatchCharLength,n=[],r=-1,a=-1,c=0,o=e.length;c<o;c+=1){var i=e[c];i&&-1===r?r=c:i||-1===r||((a=c-1)-r+1>=t&&n.push([r,a]),r=-1)}return e[c-1]&&c-r>=t&&n.push([r,c-1]),n}function A(e){for(var t={},n=0,r=e.length;n<r;n+=1){var a=e.charAt(n);t[a]=(t[a]||0)|1<<r-n-1}return t}var B=function(){function e(n){var r=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=a.location,o=void 0===c?C.location:c,i=a.threshold,s=void 0===i?C.threshold:i,l=a.distance,u=void 0===l?C.distance:l,m=a.includeMatches,p=void 0===m?C.includeMatches:m,d=a.findAllMatches,b=void 0===d?C.findAllMatches:d,f=a.minMatchCharLength,h=void 0===f?C.minMatchCharLength:f,g=a.isCaseSensitive,O=void 0===g?C.isCaseSensitive:g,v=a.ignoreLocation,j=void 0===v?C.ignoreLocation:v;if(t(this,e),this.options={location:o,threshold:s,distance:u,includeMatches:p,findAllMatches:b,minMatchCharLength:h,isCaseSensitive:O,ignoreLocation:j},this.pattern=O?n:n.toLowerCase(),this.chunks=[],this.pattern.length){var y=function(e,t){r.chunks.push({pattern:e,alphabet:A(e),startIndex:t})},E=this.pattern.length;if(E>32){for(var _=0,w=E%32,S=E-w;_<S;)y(this.pattern.substr(_,32),_),_+=32;if(w){var k=E-32;y(this.pattern.substr(k),k)}}else y(this.pattern,0)}}return r(e,[{key:"searchIn",value:function(e){var t=this.options,n=t.isCaseSensitive,r=t.includeMatches;if(n||(e=e.toLowerCase()),this.pattern===e){var a={isMatch:!0,score:0};return r&&(a.indices=[[0,e.length-1]]),a}var c=this.options,o=c.location,i=c.distance,s=c.threshold,l=c.findAllMatches,u=c.minMatchCharLength,p=c.ignoreLocation,d=[],b=0,f=!1;this.chunks.forEach((function(t){var n=t.pattern,a=t.alphabet,c=t.startIndex,h=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=r.location,c=void 0===a?C.location:a,o=r.distance,i=void 0===o?C.distance:o,s=r.threshold,l=void 0===s?C.threshold:s,u=r.findAllMatches,m=void 0===u?C.findAllMatches:u,p=r.minMatchCharLength,d=void 0===p?C.minMatchCharLength:p,b=r.includeMatches,f=void 0===b?C.includeMatches:b,h=r.ignoreLocation,g=void 0===h?C.ignoreLocation:h;if(t.length>32)throw new Error(y(32));for(var O,v=t.length,j=e.length,E=Math.max(0,Math.min(c,j)),_=l,w=E,S=d>1||f,k=S?Array(j):[];(O=e.indexOf(t,w))>-1;){var N=D(t,{currentLocation:O,expectedLocation:E,distance:i,ignoreLocation:g});if(_=Math.min(N,_),w=O+v,S)for(var T=0;T<v;)k[O+T]=1,T+=1}w=-1;for(var M=[],x=1,I=v+j,P=1<<v-1,A=0;A<v;A+=1){for(var B=0,R=I;B<R;){var F=D(t,{errors:A,currentLocation:E+R,expectedLocation:E,distance:i,ignoreLocation:g});F<=_?B=R:I=R,R=Math.floor((I-B)/2+B)}I=R;var z=Math.max(1,E-R+1),U=m?j:Math.min(E+R,j)+v,V=Array(U+2);V[U+1]=(1<<A)-1;for(var $=U;$>=z;$-=1){var H=$-1,G=n[e.charAt(H)];if(S&&(k[H]=+!!G),V[$]=(V[$+1]<<1|1)&G,A&&(V[$]|=(M[$+1]|M[$])<<1|1|M[$+1]),V[$]&P&&(x=D(t,{errors:A,currentLocation:H,expectedLocation:E,distance:i,ignoreLocation:g}))<=_){if(_=x,(w=H)<=E)break;z=Math.max(1,2*E-w)}}var W=D(t,{errors:A+1,currentLocation:E,expectedLocation:E,distance:i,ignoreLocation:g});if(W>_)break;M=V}var q={isMatch:w>=0,score:Math.max(.001,x)};if(S){var Q=L(k,d);Q.length?f&&(q.indices=Q):q.isMatch=!1}return q}(e,n,a,{location:o+c,distance:i,threshold:s,findAllMatches:l,minMatchCharLength:u,includeMatches:r,ignoreLocation:p}),g=h.isMatch,O=h.score,v=h.indices;g&&(f=!0),b+=O,g&&v&&(d=[].concat(m(d),m(v)))}));var h={isMatch:f,score:f?b/this.chunks.length:1};return f&&r&&(h.indices=d),h}}]),e}(),R=function(){function e(n){t(this,e),this.pattern=n}return r(e,[{key:"search",value:function(){}}],[{key:"isMultiMatch",value:function(e){return F(e,this.multiRegex)}},{key:"isSingleMatch",value:function(e){return F(e,this.singleRegex)}}]),e}();function F(e,t){var n=e.match(t);return n?n[1]:null}var z=function(e){i(a,e);var n=u(a);function a(e){return t(this,a),n.call(this,e)}return r(a,[{key:"search",value:function(e){var t=e===this.pattern;return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}}],[{key:"type",get:function(){return"exact"}},{key:"multiRegex",get:function(){return/^="(.*)"$/}},{key:"singleRegex",get:function(){return/^=(.*)$/}}]),a}(R),U=function(e){i(a,e);var n=u(a);function a(e){return t(this,a),n.call(this,e)}return r(a,[{key:"search",value:function(e){var t=-1===e.indexOf(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}],[{key:"type",get:function(){return"inverse-exact"}},{key:"multiRegex",get:function(){return/^!"(.*)"$/}},{key:"singleRegex",get:function(){return/^!(.*)$/}}]),a}(R),V=function(e){i(a,e);var n=u(a);function a(e){return t(this,a),n.call(this,e)}return r(a,[{key:"search",value:function(e){var t=e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}}],[{key:"type",get:function(){return"prefix-exact"}},{key:"multiRegex",get:function(){return/^\^"(.*)"$/}},{key:"singleRegex",get:function(){return/^\^(.*)$/}}]),a}(R),$=function(e){i(a,e);var n=u(a);function a(e){return t(this,a),n.call(this,e)}return r(a,[{key:"search",value:function(e){var t=!e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}],[{key:"type",get:function(){return"inverse-prefix-exact"}},{key:"multiRegex",get:function(){return/^!\^"(.*)"$/}},{key:"singleRegex",get:function(){return/^!\^(.*)$/}}]),a}(R),H=function(e){i(a,e);var n=u(a);function a(e){return t(this,a),n.call(this,e)}return r(a,[{key:"search",value:function(e){var t=e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}],[{key:"type",get:function(){return"suffix-exact"}},{key:"multiRegex",get:function(){return/^"(.*)"\$$/}},{key:"singleRegex",get:function(){return/^(.*)\$$/}}]),a}(R),G=function(e){i(a,e);var n=u(a);function a(e){return t(this,a),n.call(this,e)}return r(a,[{key:"search",value:function(e){var t=!e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}],[{key:"type",get:function(){return"inverse-suffix-exact"}},{key:"multiRegex",get:function(){return/^!"(.*)"\$$/}},{key:"singleRegex",get:function(){return/^!(.*)\$$/}}]),a}(R),W=function(e){i(a,e);var n=u(a);function a(e){var r,c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=c.location,i=void 0===o?C.location:o,s=c.threshold,l=void 0===s?C.threshold:s,u=c.distance,m=void 0===u?C.distance:u,p=c.includeMatches,d=void 0===p?C.includeMatches:p,b=c.findAllMatches,f=void 0===b?C.findAllMatches:b,h=c.minMatchCharLength,g=void 0===h?C.minMatchCharLength:h,O=c.isCaseSensitive,v=void 0===O?C.isCaseSensitive:O;return t(this,a),(r=n.call(this,e))._bitapSearch=new B(e,{location:i,threshold:l,distance:m,includeMatches:d,findAllMatches:f,minMatchCharLength:g,isCaseSensitive:v}),r}return r(a,[{key:"search",value:function(e){return this._bitapSearch.searchIn(e)}}],[{key:"type",get:function(){return"fuzzy"}},{key:"multiRegex",get:function(){return/^"(.*)"$/}},{key:"singleRegex",get:function(){return/^(.*)$/}}]),a}(R),q=function(e){i(a,e);var n=u(a);function a(e){return t(this,a),n.call(this,e)}return r(a,[{key:"search",value:function(e){for(var t,n=0,r=[],a=this.pattern.length;(t=e.indexOf(this.pattern,n))>-1;)n=t+a,r.push([t,n-1]);var c=!!r.length;return{isMatch:c,score:c?1:0,indices:r}}}],[{key:"type",get:function(){return"include"}},{key:"multiRegex",get:function(){return/^'"(.*)"$/}},{key:"singleRegex",get:function(){return/^'(.*)$/}}]),a}(R),Q=[z,q,V,$,G,H,U,W],J=Q.length,Y=/ +(?=([^\"]*\"[^\"]*\")*[^\"]*$)/;function K(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.split("|").map((function(e){for(var n=e.trim().split(Y).filter((function(e){return e&&!!e.trim()})),r=[],a=0,c=n.length;a<c;a+=1){for(var o=n[a],i=!1,s=-1;!i&&++s<J;){var l=Q[s],u=l.isMultiMatch(o);u&&(r.push(new l(u,t)),i=!0)}if(!i)for(s=-1;++s<J;){var m=Q[s],p=m.isSingleMatch(o);if(p){r.push(new m(p,t));break}}}return r}))}var Z=new Set([W.type,q.type]),X=function(){function e(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=r.isCaseSensitive,c=void 0===a?C.isCaseSensitive:a,o=r.includeMatches,i=void 0===o?C.includeMatches:o,s=r.minMatchCharLength,l=void 0===s?C.minMatchCharLength:s,u=r.findAllMatches,m=void 0===u?C.findAllMatches:u,p=r.location,d=void 0===p?C.location:p,b=r.threshold,f=void 0===b?C.threshold:b,h=r.distance,g=void 0===h?C.distance:h;t(this,e),this.query=null,this.options={isCaseSensitive:c,includeMatches:i,minMatchCharLength:l,findAllMatches:m,location:d,threshold:f,distance:g},this.pattern=c?n:n.toLowerCase(),this.query=K(this.pattern,this.options)}return r(e,[{key:"searchIn",value:function(e){var t=this.query;if(!t)return{isMatch:!1,score:1};var n=this.options,r=n.includeMatches;e=n.isCaseSensitive?e:e.toLowerCase();for(var a=0,c=[],o=0,i=0,s=t.length;i<s;i+=1){var l=t[i];c.length=0,a=0;for(var u=0,p=l.length;u<p;u+=1){var d=l[u],b=d.search(e),f=b.isMatch,h=b.indices,g=b.score;if(!f){o=0,a=0,c.length=0;break}if(a+=1,o+=g,r){var O=d.constructor.type;Z.has(O)?c=[].concat(m(c),m(h)):c.push(h)}}if(a){var v={isMatch:!0,score:o/a};return r&&(v.indices=c),v}}return{isMatch:!1,score:1}}}],[{key:"condition",value:function(e,t){return t.useExtendedSearch}}]),e}(),ee=[];function te(e,t){for(var n=0,r=ee.length;n<r;n+=1){var a=ee[n];if(a.condition(e,t))return new a(e,t)}return new B(e,t)}var ne="$and",re="$path",ae=function(e){return!(!e[ne]&&!e.$or)},ce=function(e){return!!e[re]},oe=function(e){return!d(e)&&h(e)&&!ae(e)},ie=function(e){return a({},ne,Object.keys(e).map((function(t){return a({},t,e[t])})))},se=function(){function e(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2?arguments[2]:void 0;t(this,e),this.options=o({},C,{},r),this.options.useExtendedSearch,this._keyStore=new _(this.options.keys),this.setCollection(n,a)}return r(e,[{key:"setCollection",value:function(e,t){if(this._docs=e,t&&!(t instanceof M))throw new Error("Incorrect 'index' type");this._myIndex=t||x(this.options.keys,this._docs,{getFn:this.options.getFn})}},{key:"add",value:function(e){g(e)&&(this._docs.push(e),this._myIndex.add(e))}},{key:"remove",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){return!1},t=[],n=0,r=this._docs.length;n<r;n+=1){var a=this._docs[n];e(a,n)&&(this.removeAt(n),n-=1,t.push(a))}return t}},{key:"removeAt",value:function(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}},{key:"getIndex",value:function(){return this._myIndex}},{key:"search",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.limit,r=void 0===n?-1:n,a=this.options,c=a.includeMatches,o=a.includeScore,i=a.shouldSort,s=a.sortFn,l=a.ignoreFieldNorm,u=b(e)?b(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return le(u,{ignoreFieldNorm:l}),i&&u.sort(s),f(r)&&r>-1&&(u=u.slice(0,r)),ue(u,this._docs,{includeMatches:c,includeScore:o})}},{key:"_searchStringList",value:function(e){var t=te(e,this.options),n=this._myIndex.records,r=[];return n.forEach((function(e){var n=e.v,a=e.i,c=e.n;if(g(n)){var o=t.searchIn(n),i=o.isMatch,s=o.score,l=o.indices;i&&r.push({item:n,idx:a,matches:[{score:s,value:n,norm:c,indices:l}]})}})),r}},{key:"_searchLogical",value:function(e){var t=this,n=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.auto,a=void 0===r||r,c=function e(n){var r=Object.keys(n),c=ce(n);if(!c&&r.length>1&&!ae(n))return e(ie(n));if(oe(n)){var o=c?n[re]:r[0],i=c?n.$val:n[o];if(!b(i))throw new Error(j(o));var s={keyId:k(o),pattern:i};return a&&(s.searcher=te(i,t)),s}var l={children:[],operator:r[0]};return r.forEach((function(t){var r=n[t];d(r)&&r.forEach((function(t){l.children.push(e(t))}))})),l};return ae(e)||(e=ie(e)),c(e)}(e,this.options),r=this._myIndex.records,a={},c=[];return r.forEach((function(e){var r=e.$,o=e.i;if(g(r)){var i=function e(n,r,a){if(!n.children){var c=n.keyId,o=n.searcher,i=t._findMatches({key:t._keyStore.get(c),value:t._myIndex.getValueForItemAtKeyId(r,c),searcher:o});return i&&i.length?[{idx:a,item:r,matches:i}]:[]}switch(n.operator){case ne:for(var s=[],l=0,u=n.children.length;l<u;l+=1){var p=e(n.children[l],r,a);if(!p.length)return[];s.push.apply(s,m(p))}return s;case"$or":for(var d=[],b=0,f=n.children.length;b<f;b+=1){var h=e(n.children[b],r,a);if(h.length){d.push.apply(d,m(h));break}}return d}}(n,r,o);i.length&&(a[o]||(a[o]={idx:o,item:r,matches:[]},c.push(a[o])),i.forEach((function(e){var t,n=e.matches;(t=a[o].matches).push.apply(t,m(n))})))}})),c}},{key:"_searchObjectList",value:function(e){var t=this,n=te(e,this.options),r=this._myIndex,a=r.keys,c=r.records,o=[];return c.forEach((function(e){var r=e.$,c=e.i;if(g(r)){var i=[];a.forEach((function(e,a){i.push.apply(i,m(t._findMatches({key:e,value:r[a],searcher:n})))})),i.length&&o.push({idx:c,item:r,matches:i})}})),o}},{key:"_findMatches",value:function(e){var t=e.key,n=e.value,r=e.searcher;if(!g(n))return[];var a=[];if(d(n))n.forEach((function(e){var n=e.v,c=e.i,o=e.n;if(g(n)){var i=r.searchIn(n),s=i.isMatch,l=i.score,u=i.indices;s&&a.push({score:l,key:t,value:n,idx:c,norm:o,indices:u})}}));else{var c=n.v,o=n.n,i=r.searchIn(c),s=i.isMatch,l=i.score,u=i.indices;s&&a.push({score:l,key:t,value:c,norm:o,indices:u})}return a}}]),e}();function le(e,t){var n=t.ignoreFieldNorm,r=void 0===n?C.ignoreFieldNorm:n;e.forEach((function(e){var t=1;e.matches.forEach((function(e){var n=e.key,a=e.norm,c=e.score,o=n?n.weight:null;t*=Math.pow(0===c&&o?Number.EPSILON:c,(o||1)*(r?1:a))})),e.score=t}))}function ue(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.includeMatches,a=void 0===r?C.includeMatches:r,c=n.includeScore,o=void 0===c?C.includeScore:c,i=[];return a&&i.push(I),o&&i.push(P),e.map((function(e){var n=e.idx,r={item:t[n],refIndex:n};return i.length&&i.forEach((function(t){t(e,r)})),r}))}return se.version="6.4.1",se.createIndex=x,se.parseIndex=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.getFn,r=void 0===n?C.getFn:n,a=e.keys,c=e.records,o=new M({getFn:r});return o.setKeys(a),o.setIndexRecords(c),o},se.config=C,function(){ee.push.apply(ee,arguments)}(X),se},e.exports=r()},,,function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,a=!1,c=void 0;try{for(var o,i=e[Symbol.iterator]();!(r=(o=i.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,c=e}finally{try{r||null==i.return||i.return()}finally{if(a)throw c}}return n}}},function(e,t){e.exports=function(){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(e,t,n){"use strict";e.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,e=>"%"+e.charCodeAt(0).toString(16).toUpperCase())},function(e,t,n){"use strict";var r=new RegExp("%[a-f0-9]{2}","gi"),a=new RegExp("(%[a-f0-9]{2})+","gi");function c(e,t){try{return decodeURIComponent(e.join(""))}catch(e){}if(1===e.length)return e;t=t||1;var n=e.slice(0,t),r=e.slice(t);return Array.prototype.concat.call([],c(n),c(r))}function o(e){try{return decodeURIComponent(e)}catch(a){for(var t=e.match(r),n=1;n<t.length;n++)t=(e=c(t,n).join("")).match(r);return e}}e.exports=function(e){if("string"!=typeof e)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch(t){return function(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},n=a.exec(e);n;){try{t[n[0]]=decodeURIComponent(n[0])}catch(e){var r=o(n[0]);r!==n[0]&&(t[n[0]]=r)}n=a.exec(e)}t["%C2"]="�";for(var c=Object.keys(t),i=0;i<c.length;i++){var s=c[i];e=e.replace(new RegExp(s,"g"),t[s])}return e}(e)}}},function(e,t,n){"use strict";e.exports=(e,t)=>{if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];const n=e.indexOf(t);return-1===n?[e]:[e.slice(0,n),e.slice(n+t.length)]}},function(e,t,n){var r=n(16);e.exports=function(e){if(Array.isArray(e))return r(e)}},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(e,t){!function(){e.exports=this.React}()},function(e,t){!function(){e.exports=this.ReactDOM}()},function(e,t,n){"use strict";n.r(t);var r=n(0),a=(n(20),n(10)),c=n.n(a);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var s=tiobDash,l=s.onboarding,u=s.themeAction,m=void 0!==l.sites&&void 0!==l.sites.sites?Object.keys(l.sites.sites)[0]:"gutenberg",p=localStorage.getItem("neve-onboarding-editor")||m,d={sites:l.sites||{},editor:p,category:"all",previewStatus:!1,importModalStatus:!1,installModalStatus:!1,currentSite:null,importing:!1,isOnboarding:l.onboarding||!1,migrationData:null,themeAction:u,currentTab:"starterSites",fetching:!1,singleTemplateImport:null,templateModal:null,searchQuery:""},b={refreshSites:function(e){return{type:"REFRESH_SITES",payload:{sites:e}}},setCurrentEditor:function(e){return{type:"SET_CURRENT_EDITOR",payload:{editor:e}}},setCurrentCategory:function(e){return{type:"SET_CURRENT_CATEGORY",payload:{category:e}}},setCurrentSite:function(e){return{type:"SET_FOCUSED_SITE",payload:{siteData:e}}},setPreviewStatus:function(e){return e?document.body.classList.add("ob-overflow-off"):document.body.classList.remove("ob-overflow-off"),{type:"SET_PREVIEW_STATUS",payload:{previewStatus:e}}},setImportModalStatus:function(e){return e?document.body.classList.add("ob-overflow-off"):document.body.classList.remove("ob-overflow-off"),{type:"SET_IMPORT_MODAL_STATUS",payload:{importModalStatus:e}}},setInstallModalStatus:function(e){return e?document.body.classList.add("ob-overflow-off"):document.body.classList.remove("ob-overflow-off"),{type:"SET_INSTALL_MODAL_STATUS",payload:{installModalStatus:e}}},setOnboardingState:function(e){return{type:"SET_ONBOARDING",payload:{state:e}}},setThemeAction:function(e){return{type:"SET_THEME_ACTIONS",payload:{themeActions:e}}},setCurrentTab:function(e){return{type:"SET_CURRENT_TAB",payload:{currentTab:e}}},setFetching:function(e){return{type:"SET_FETCHING",payload:{fetching:e}}},setSingleTemplateImport:function(e){return{type:"SET_SINGLE_TEMPLATE_IMPORT",payload:{slug:e}}},setTemplateModal:function(e){return{type:"SET_TEMPLATE_MODAL",payload:{data:e}}},setSearchQuery:function(e){return{type:"SET_SEARCH_QUERY",payload:{query:e}}}},f=n(4),h=n(6),g=n.n(h),O=n(7),v=n(3),j=n.n(v),y=n(2),E=n(1),_=n(8),w=n.n(_),S=n(9),k=n.n(S),C=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return T(e,n,t)},N=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return T(e,t,{},"GET",n)},T=function(){var e=k()(w.a.mark((function e(t){var n,r,a,c,o,i=arguments;return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.length>1&&void 0!==i[1]&&i[1],r=i.length>2&&void 0!==i[2]?i[2]:{},a=i.length>3&&void 0!==i[3]?i[3]:"POST",c=!(i.length>4&&void 0!==i[4])||i[4],o={method:a,headers:{Accept:"application/json","Content-Type":"application/json"}},c&&(o.headers["x-wp-nonce"]=tiobDash.nonce),"POST"===a&&(o.body=JSON.stringify(r)),e.next=9,fetch(t,o).then((function(e){return n?e:e.json()}));case 9:return e.abrupt("return",e.sent);case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function M(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function x(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?M(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var I=Object(O.compose)(Object(f.withSelect)((function(e){var t=e("neve-onboarding"),n=t.getSingleImport;return{themeData:(0,t.getThemeAction)()||!1,singleImport:n()}})),Object(f.withDispatch)((function(e){var t=e("neve-onboarding"),n=t.setImportModalStatus,r=t.setInstallModalStatus,a=t.setThemeAction,c=t.setTemplateModal;return{setImportModal:function(e){return n(e)},setInstallModal:function(e){return r(e)},setThemeAction:function(e){return a(e)},showTemplateModal:function(){return c(!0)}}})))((function(e){var t=e.setImportModal,n=e.setInstallModal,a=e.themeData,c=e.setThemeAction,o=e.singleImport,i=e.showTemplateModal,s=a.action,l=a.slug,u=a.nonce,m=tiobDash,p=m.themesURL,d=m.brandedTheme,b=Object(r.useState)(!1),f=j()(b,2),h=f[0],g=f[1],O=Object(r.useState)(null),v=j()(O,2),_=v[0],w=v[1],S=function(){n(!1)},k=function(e){g(!1),w(Object(E.sprintf)(// translators: %s: Error message.
|
2 |
+
Object(E.__)("An error has ocurred: %s","templates-patterns-collection"),e))},C=function(){g("activating");var e="".concat(p,"?action=activate&stylesheet=").concat(l,"&_wpnonce=").concat(u);N(e,!0).then((function(e){return 200!==e.status?(k(Object(E.__)("Could not activate theme.","templates-patterns-collection")),g(!1),!1):(g(!1),n(!1),c(!1),o?(i(),!1):void t(!0))}))};return Object(r.createElement)(y.Modal,{className:"ob-import-modal install-modal",title:Object(E.__)("Install and Activate Neve","templates-patterns-collection"),onRequestClose:S,shouldCloseOnClickOutside:!h,isDismissible:!h},Object(r.createElement)("div",{className:"modal-body",style:{textAlign:"center"}},!d&&Object(r.createElement)("img",{style:{width:75},src:"".concat(tiobDash.assets,"/img/logo.svg"),alt:Object(E.__)("Logo","templates-patterns-collection")}),_&&Object(r.createElement)("div",{className:"well error",style:{margin:"20px 0"}},_),Object(r.createElement)("p",{style:{lineHeight:1.6,fontSize:"15px"}},Object(E.__)("In order to import the starter site, Neve theme has to be installed and activated. Click the button below to install and activate Neve","templates-patterns-collection"))),Object(r.createElement)("div",{className:"modal-footer",style:{justifyContent:"center"}},Object(r.createElement)("div",{className:"actions",style:{display:"flex"}},!_&&Object(r.createElement)(y.Button,{dismiss:_,isPrimary:!0,disabled:h,className:h&&"is-loading",icon:h&&"update",onClick:"install"===s?function(){g("installing"),wp.updates.installTheme({slug:"neve",success:function(){c(x(x({},a),{},{action:"activate"})),C()},error:function(e){c(x(x({},a),{},{action:"activate"})),k(e.errorMessage||Object(E.__)("Could not install theme.","templates-patterns-collection"))}})}:C},h&&("installing"===h?Object(E.__)("Installing"):Object(E.__)("Activating")),!h&&("install"===s?Object(E.__)("Install and Activate","templates-patterns-collection"):Object(E.__)("Activate","templates-patterns-collection"))),Object(r.createElement)(y.Button,{style:{marginLeft:30},isSecondary:!0,disabled:h,onClick:S},Object(E.__)("Close","templates-patterns-collection")))))})),P=tiobDash.onboarding,D=function(e){return C(P.root+"/install_plugins",e)},L=function(e){var t=e.data,n=e.externalInstalled,a=t.external_plugins||null,c=g()(["well"]);return Object(r.createElement)("div",{className:c},a&&!n&&Object(r.createElement)("h3",{style:{marginTop:15}},Object(r.createElement)(y.Dashicon,{icon:"info"}),Object(r.createElement)("span",null,Object(E.__)("To import this demo you have to install the following plugins","neve"))),Object(r.createElement)("ul",null,a&&!n?a.map((function(e,t){return Object(r.createElement)("li",{key:t},Object(r.createElement)(y.Button,{isLink:!0,href:e.author_url},e.name))})):Object(r.createElement)(r.Fragment,null,Object(r.createElement)("li",null,Object(E.__)("We recommend you backup your website content before attempting a full site import.","neve")),Object(r.createElement)("li",null,Object(E.__)("Some of the demo images will not be imported and will be replaced by placeholder images.","neve")))))},A=function(e){var t=e.message,n=e.code;return Object(r.createElement)("div",{className:"well error"},t&&Object(r.createElement)("h3",null,Object(r.createElement)(y.Dashicon,{icon:"warning"}),Object(r.createElement)("span",null,t)),Object(r.createElement)("ul",null,Object(r.createElement)("li",{dangerouslySetInnerHTML:{__html:tiobDash.onboarding.i18n.troubleshooting}}),Object(r.createElement)("li",{dangerouslySetInnerHTML:{__html:tiobDash.onboarding.i18n.support}}),n&&Object(r.createElement)("li",null,Object(E.__)("Error code","templates-patterns-collection"),":"," ",Object(r.createElement)("code",null,n)),Object(r.createElement)("li",null,Object(E.__)("Error log","templates-patterns-collection"),":"," ",Object(r.createElement)(y.Button,{isLink:!0,href:tiobDash.onboarding.logUrl},tiobDash.onboarding.logUrl,Object(r.createElement)(y.Dashicon,{icon:"external"})))))},B=function(e){var t=e.data,n=function(e){return console.log(e)},a=Object(r.useState)(!1),c=j()(a,2),o=c[0],i=c[1],s=Object(r.useState)(!1),l=j()(s,2),u=l[0],m=l[1],p=Object(r.useState)(!1),d=j()(p,2),b=d[0],f=d[1],h=Object(r.useState)(null),g=j()(h,2),O=g[0],v=g[1],_=Object(r.useState)(null),w=j()(_,2),S=w[0],k=w[1];if(o)return null;var N=function(){"done"===b&&i(!0),m(!1),v(null),f(!1)};return Object(r.createElement)("div",{className:"ob-migration"},u&&Object(r.createElement)(y.Modal,{className:"ob-import-modal migration",title:Object(E.__)("Migrate","templates-patterns-collection")+" "+t.theme_name,onRequestClose:N,shouldCloseOnClickOutside:!b,isDismissible:!b},Object(r.createElement)(r.Fragment,null,Object(r.createElement)("div",{className:"modal-body"},O&&Object(r.createElement)(A,{message:O.message||null,code:O.code||null}),!1===b&&!O&&Object(r.createElement)(r.Fragment,null,Object(r.createElement)(L,{data:t}),t.mandatory_plugins&&Object(r.createElement)(r.Fragment,null,Object(r.createElement)("hr",null),Object(r.createElement)("h3",null,Object(E.__)("The following plugins will be installed","neve"),":"),Object(r.createElement)("ul",null,Object.keys(t.mandatory_plugins).map((function(e,n){return Object(r.createElement)("li",{key:n},"-"," ",t.mandatory_plugins[e])}))))),"done"===b&&Object(r.createElement)("p",{className:"import-result"},Object(E.__)("Content was successfully imported. Enjoy your new site!","neve")),!0===b&&Object(r.createElement)("div",{className:"loading"},Object(r.createElement)(y.Dashicon,{icon:"update",size:50}),Object(r.createElement)("h3",null,Object(E.__)("Migrating","templates-patterns-collection"),"..."))),(!b||"done"===b)&&Object(r.createElement)("div",{className:"modal-footer"},Object(r.createElement)(y.Button,{isSecondary:"done"!==b,isLink:"done"===b,className:"done"===b?"close":null,onClick:N},"done"===b?Object(E.__)("Close","templates-patterns-collection"):Object(E.__)("Cancel","templates-patterns-collection")),O||"done"===b?Object(r.createElement)(r.Fragment,null,Object(r.createElement)(y.Button,{style:{marginLeft:20},isSecondary:!0,href:"".concat(tiobDash.onboarding.homeUrl,"/wp-admin/post.php?post=").concat(S,"&action=elementor")},Object(E.__)("Edit Content","templates-patterns-collection")),Object(r.createElement)(y.Button,{isPrimary:!0,href:tiobDash.onboarding.homeUrl},Object(E.__)("View Website","templates-patterns-collection"))):Object(r.createElement)(y.Button,{isPrimary:!0,onClick:function(){var e;e=Object.keys(t.mandatory_plugins).reduce((function(e,t){return e[t]=!0,e}),{}),D(e).then((function(e){if(f(!0),!e.success)return v({code:e.data||null,message:Object(E.__)("Something went wrong while installing the necessary plugins.","neve")}),f(!1),!1;var n=t.template,r=t.template_name;C(tiobDash.onboarding.root+"/migrate_frontpage",{template:n,template_name:r}).then((function(e){if(!e.success)return v({code:e.data||null,message:Object(E.__)("Something went wrong while importing the website content.","neve")}),f(!1),!1;k(e.data),f("done")}))}))}},Object(E.__)("Start Migration","templates-patterns-collection"))))),Object(r.createElement)("h2",null,t.heading),Object(r.createElement)("p",null,t.description),Object(r.createElement)("div",{className:"card starter-site-card",style:{maxWidth:330}},Object(r.createElement)("div",{className:"top"},t.screenshot&&Object(r.createElement)("div",{className:"image"},Object(r.createElement)("img",{src:t.screenshot,alt:t.theme_name}))),Object(r.createElement)("div",{className:"bottom"},Object(r.createElement)("p",{className:"title"},t.theme_name))),Object(r.createElement)("div",{className:"actions"},Object(r.createElement)(y.Button,{isPrimary:!0,onClick:function(){return m(!0),!1}},Object(E.__)("Migrate","templates-patterns-collection")+" "+t.theme_name),Object(r.createElement)(y.Button,{isSecondary:!0,onClick:function(){C(tiobDash.onboarding.root+"/dismiss_migration",{theme_mod:t.theme_mod}).then((function(e){if(!e.success)return n(Object(E.__)("Something went wrong. Please reload the page and try again.","neve")),!1;n(Object(E.__)("Dismissed","templates-patterns-collection")),i(!0)}))}},Object(E.__)("Dismiss","templates-patterns-collection"))))},R=n(5),F=Object(r.createElement)(R.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(R.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"})),z=Object(r.createElement)(R.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(R.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})),U=Object(r.createElement)(R.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(R.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})),V=n(12),$=n.n(V),H=n(11),G="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),W=new Uint8Array(16);function q(){if(!G)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return G(W)}var Q=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var J=function(e){return"string"==typeof e&&Q.test(e)},Y=[],K=0;K<256;++K)Y.push((K+256).toString(16).substr(1));var Z=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(Y[e[t+0]]+Y[e[t+1]]+Y[e[t+2]]+Y[e[t+3]]+"-"+Y[e[t+4]]+Y[e[t+5]]+"-"+Y[e[t+6]]+Y[e[t+7]]+"-"+Y[e[t+8]]+Y[e[t+9]]+"-"+Y[e[t+10]]+Y[e[t+11]]+Y[e[t+12]]+Y[e[t+13]]+Y[e[t+14]]+Y[e[t+15]]).toLowerCase();if(!J(n))throw TypeError("Stringified UUID is invalid");return n};var X=function(e,t,n){var r=(e=e||{}).random||(e.rng||q)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var a=0;a<16;++a)t[n+a]=r[a];return t}return Z(r)};function ee(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function te(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ee(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ee(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ne=function(){var e=k()(w.a.mark((function e(){var t,n,r,a,c,o,i=arguments;return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=i.length>0&&void 0!==i[0]&&i[0],n=i.length>1&&void 0!==i[1]?i[1]:{},r=Object(H.stringifyUrl)({url:tiobDash.endpoint+(t?"page-templates":"templates"),query:te(te({cache:localStorage.getItem("tpcCacheBuster")},tiobDash.params),n)}),e.prev=3,e.next=6,$()({url:r,method:"GET",parse:!1});case 6:if(!(a=e.sent).ok){e.next=15;break}return e.next=10,a.json();case 10:if(!(c=e.sent).message){e.next=13;break}return e.abrupt("return",{success:!1,message:c.message});case 13:return o=a.headers.get("x-wp-totalpages"),e.abrupt("return",{success:!0,total:o,templates:c});case 15:e.next=21;break;case 17:if(e.prev=17,e.t0=e.catch(3),!e.t0.message){e.next=21;break}return e.abrupt("return",{success:!1,message:e.t0.message});case 21:case"end":return e.stop()}}),e,null,[[3,17]])})));return function(){return e.apply(this,arguments)}}(),re=function(){var e=k()(w.a.mark((function e(t,n){var r;return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Object(H.stringifyUrl)({url:tiobDash.endpoint+"templates/"+t,query:te({cache:localStorage.getItem("tpcCacheBuster")},tiobDash.params)}),e.prev=1,e.next=4,$()({url:r,method:"POST",data:{template_id:t,template_name:n}});case 4:return localStorage.setItem("tpcCacheBuster",X()),e.abrupt("return",{success:!0});case 8:if(e.prev=8,e.t0=e.catch(1),!e.t0.message){e.next=12;break}return e.abrupt("return",{success:!1,message:e.t0.message});case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t,n){return e.apply(this,arguments)}}(),ae=function(){var e=k()(w.a.mark((function e(t){var n;return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Object(H.stringifyUrl)({url:"".concat(tiobDash.endpoint,"templates/").concat(t),query:te({cache:localStorage.getItem("tpcCacheBuster"),_method:"DELETE"},tiobDash.params)}),e.prev=1,e.next=4,$()({url:n,method:"POST"});case 4:return localStorage.setItem("tpcCacheBuster",X()),e.abrupt("return",{success:!0});case 8:if(e.prev=8,e.t0=e.catch(1),!e.t0.message){e.next=12;break}return e.abrupt("return",{success:!1,message:e.t0.message});case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t){return e.apply(this,arguments)}}(),ce=function(){var e=k()(w.a.mark((function e(t){var n,r,a;return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Object(H.stringifyUrl)({url:"".concat(tiobDash.endpoint,"templates/bulk-import"),query:te({templates:t,cache:localStorage.getItem("tpcCacheBuster")},tiobDash.params)}),e.prev=1,e.next=4,$()({url:n,method:"GET",parse:!1});case 4:if(!(r=e.sent).ok){e.next=14;break}if(!r.message){e.next=8;break}return e.abrupt("return",{success:!1,message:r.message});case 8:return e.next=10,r.json();case 10:if(!(a=e.sent).message){e.next=13;break}return e.abrupt("return",{success:!1,message:a.message});case 13:return e.abrupt("return",{success:!0,templates:a});case 14:e.next=20;break;case 16:if(e.prev=16,e.t0=e.catch(1),!e.t0.message){e.next=20;break}return e.abrupt("return",{success:!1,message:e.t0.message});case 20:case"end":return e.stop()}}),e,null,[[1,16]])})));return function(t){return e.apply(this,arguments)}}(),oe=function(){var e=k()(w.a.mark((function e(t){var n,r,a;return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Object(H.stringifyUrl)({url:"".concat(tiobDash.endpoint,"templates/").concat(t,"/import"),query:te({cache:localStorage.getItem("tpcCacheBuster")},tiobDash.params)}),r={},e.prev=2,e.next=5,$()({url:n,method:"GET",parse:!1});case 5:if(!(a=e.sent).ok){e.next=12;break}return e.next=9,a.json();case 9:if(!(r=e.sent).message){e.next=12;break}return e.abrupt("return",{success:!1,message:r.message});case 12:e.next=18;break;case 14:if(e.prev=14,e.t0=e.catch(2),!e.t0.message){e.next=18;break}return e.abrupt("return",{success:!1,message:e.t0.message});case 18:return e.abrupt("return",{success:!0,templates:[r]});case 19:case"end":return e.stop()}}),e,null,[[2,14]])})));return function(t){return e.apply(this,arguments)}}(),ie=Object(r.createElement)(R.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(r.createElement)(R.Path,{d:"M10.2 3.28c3.53 0 6.43 2.61 6.92 6h2.08l-3.5 4-3.5-4h2.32c-.45-1.97-2.21-3.45-4.32-3.45-1.45 0-2.73.71-3.54 1.78L4.95 5.66C6.23 4.2 8.11 3.28 10.2 3.28zm-.4 13.44c-3.52 0-6.43-2.61-6.92-6H.8l3.5-4c1.17 1.33 2.33 2.67 3.5 4H5.48c.45 1.97 2.21 3.45 4.32 3.45 1.45 0 2.73-.71 3.54-1.78l1.71 1.95c-1.28 1.46-3.15 2.38-5.25 2.38z"})),se=Object(r.createElement)(R.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(R.Path,{d:"M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z"})),le=Object(r.createElement)(R.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(r.createElement)(R.Path,{d:"M12 4h3c.6 0 1 .4 1 1v1H3V5c0-.6.5-1 1-1h3c.2-1.1 1.3-2 2.5-2s2.3.9 2.5 2zM8 4h3c-.2-.6-.9-1-1.5-1S8.2 3.4 8 4zM4 7h11l-.9 10.1c0 .5-.5.9-1 .9H5.9c-.5 0-.9-.4-1-.9L4 7z"})),ue=Object(r.createElement)(R.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(R.Path,{d:"M18.3 5.6L9.9 16.9l-4.6-3.4-.9 1.2 5.8 4.3 9.3-12.6z"})),me=Object(r.createElement)(R.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(R.Path,{d:"M7 5.5h10a.5.5 0 01.5.5v12a.5.5 0 01-.5.5H7a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM17 4H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V6a2 2 0 00-2-2zm-1 3.75H8v1.5h8v-1.5zM8 11h8v1.5H8V11zm6 3.25H8v1.5h6v-1.5z"})),pe=function(e){var t=e.item,n=e.loadTemplates,a=e.userTemplate,c=e.grid,o=e.onPreview,i=e.onImport,s=e.upsell,l=void 0!==s&&s,u=Object(r.useState)(!1),m=j()(u,2),p=m[0],d=m[1],b=Object(r.useState)(!1),f=j()(b,2),h=f[0],O=f[1],v=Object(r.useState)(t.template_name),_=j()(v,2),S=_[0],C=_[1],N=function(){var e=k()(w.a.mark((function e(n){var r,a;return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n.preventDefault(),r=t.template_id,a=t.template_name,d("updating"),e.next=5,re(r,S||a).then((function(e){e.success&&(O(!h),d(!1))}));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),T=function(){var e=k()(w.a.mark((function e(){return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(d("deleteing"),window.confirm(Object(E.__)("Are you sure you want to delete this template?"))){e.next=3;break}return e.abrupt("return",!1);case 3:ae(t.template_id).then((function(e){e.success&&(n(),d(!1))}));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),M=function(){o(t.link)},x=g()("actions",{"no-controls":!a});if(c){var I={backgroundImage:"url(".concat(t.template_thumbnail,")")};return Object(r.createElement)("div",{key:t.template_id,className:"table-grid"},Object(r.createElement)("div",{style:I,className:g()("grid-preview",{"is-loading":h||!1!==p})},Object(r.createElement)("div",{className:"preview-actions"},!a&&t.link&&Object(r.createElement)(y.Button,{isSecondary:!0,disabled:!1!==p,onClick:M},Object(E.__)("Preview")),!l&&Object(r.createElement)(y.Button,{isPrimary:!0,isBusy:"importing"===p,disabled:!1!==p,onClick:i},Object(E.__)("Import")),a&&Object(r.createElement)("div",{className:"preview-controls"},Object(r.createElement)(y.Button,{label:Object(E.__)("Edit"),icon:"updating"===p?ie:se,disabled:h||!1!==p,className:g()({"is-loading":"updating"===p}),onClick:function(){return O(!h)}}),Object(r.createElement)(y.Button,{label:Object(E.__)("Delete"),icon:"deleteing"===p?ie:le,disabled:!1!==p,className:g()({"is-loading":"deleteing"===p}),onClick:T})))),Object(r.createElement)("div",{className:"card-footer"},h?Object(r.createElement)("form",{onSubmit:N},Object(r.createElement)(y.TextControl,{value:S,onChange:C}),Object(r.createElement)(y.Button,{type:"submit",label:Object(E.__)("Update"),icon:"updating"===p?ie:ue,disabled:!1!==p,className:g()({"is-loading":"updating"===p})})):Object(r.createElement)("p",null,S)))}return Object(r.createElement)("div",{key:t.template_id,className:"table-row"},Object(r.createElement)("div",{className:"title"},Object(r.createElement)(y.Icon,{icon:me}),h?Object(r.createElement)(y.TextControl,{label:Object(E.__)("Template Name"),hideLabelFromVision:!0,value:S,onChange:C}):S),a&&Object(r.createElement)("div",{className:"controls"},Object(r.createElement)(y.Button,{label:h?Object(E.__)("Update"):Object(E.__)("Edit"),icon:h?"updating"===p?ie:ue:se,disabled:!1!==p,className:g()({"is-loading":"updating"===p}),onClick:h?N:function(){return O(!h)}},h?Object(E.__)("Update"):Object(E.__)("Edit")),Object(r.createElement)(y.Button,{label:Object(E.__)("Delete"),icon:"deleteing"===p?ie:le,disabled:!1!==p,className:g()({"is-loading":"deleteing"===p}),onClick:T},"deleting"===p?Object(E.__)("Deleting")+"...":Object(E.__)("Delete"))),Object(r.createElement)("div",{className:x},!a&&t.link&&Object(r.createElement)(y.Button,{isSecondary:!0,disabled:!1!==p,onClick:M},Object(E.__)("Preview")),Object(r.createElement)(y.Button,{isPrimary:!0,isBusy:"importing"===p,onClick:i,disabled:!1!==p},Object(E.__)("Import"))))},de=Object(r.createElement)(R.SVG,{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(R.Path,{d:"M3 15h18v-2H3v2zm0 4h18v-2H3v2zm0-8h18V9H3v2zm0-6v2h18V5H3z"})),be=Object(r.createElement)(R.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(R.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7.8 16.5H5c-.3 0-.5-.2-.5-.5v-6.2h6.8v6.7zm0-8.3H4.5V5c0-.3.2-.5.5-.5h6.2v6.7zm8.3 7.8c0 .3-.2.5-.5.5h-6.2v-6.8h6.8V19zm0-7.8h-6.8V4.5H19c.3 0 .5.2.5.5v6.2z",fillRule:"evenodd",clipRule:"evenodd"})),fe=function(e){var t=e.isGrid,n=e.setGrid,a=e.searchQuery,c=e.setSearchQuery,o=e.onSearch;return Object(r.createElement)("div",{className:"filters"},Object(r.createElement)("div",{className:"header-form"},Object(r.createElement)("form",{className:"search",onSubmit:function(e){e.preventDefault(),o()}},Object(r.createElement)("img",{src:tiobDash.assets+"/img/search.svg",alt:Object(E.__)("Search Icon")}),Object(r.createElement)(y.TextControl,{type:"search",value:a,onChange:c,placeholder:Object(E.__)("Search for a template")+"…"})),Object(r.createElement)("div",{className:"display-filters"},Object(r.createElement)(y.Button,{label:Object(E.__)("List View"),icon:de,onClick:function(){return n(!1)},isPressed:!t}),Object(r.createElement)(y.Button,{label:Object(E.__)("Grid View"),icon:be,onClick:function(){return n(!0)},isPressed:t}))))},he=function(e){var t=e.title,n=e.leftButtons,a=e.rightButtons,c=e.heading,o=e.previewUrl,i=Object(H.stringifyUrl)({url:o,query:{tpcpreview:"yes"}}),s=t||Object(E.__)("Preview");return Object(r.createElement)("div",{className:"ob-preview single-templates"},Object(r.createElement)("div",{className:"preview"},Object(r.createElement)("iframe",{title:s,src:i,frameBorder:"0"}),Object(r.createElement)("div",{className:"loading"},Object(r.createElement)(y.Dashicon,{icon:"update",size:50}))),Object(r.createElement)("div",{className:"bottom-bar"},n&&Object(r.createElement)("div",{className:"navigator"},n),c&&Object(r.createElement)("h2",{className:"heading"},c),a&&Object(r.createElement)("div",{className:"actions"},a)))};function ge(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Oe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ge(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ge(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ve=Object(O.compose)(Object(f.withSelect)((function(e){var t=e("neve-onboarding"),n=t.getThemeAction,r=t.getCurrentSite,a=t.getCurrentEditor;return{themeStatus:n().action||!1,siteData:r(),editor:a()}})),Object(f.withDispatch)((function(e){var t=e("neve-onboarding"),n=t.setTemplateModal,r=t.setImportModalStatus,a=t.setInstallModalStatus;return{cancel:function(){n(null)},setModal:function(e){return r(e)},setInstallModal:function(e){return a(e)}}})))((function(e){var t=e.templatesData,n=e.cancel,a=e.siteData,c=e.themeStatus,o=e.setInstallModal,i=e.setModal,s=(e.editor,e.isUserTemplate),l=void 0!==s&&s,u=e.generalTemplates,m=void 0!==u&&u,p=Object(r.useState)(!0),d=j()(p,2),b=d[0],f=d[1],h=Object(r.useState)([]),O=j()(h,2),v=O[0],_=O[1],w=Object(r.useState)(!1),S=j()(w,2),k=S[0],N=S[1],T=Object(r.useState)([]),M=j()(T,2),x=M[0],I=M[1],D=Object(r.useState)(!1),L=j()(D,2),A=L[0],B=L[1],R=1===t.length;Object(r.useEffect)((function(){l&&R?oe(t[0].template_id).then((function(e){e.success||(e.message?B(e.message):B(!0),f(!1)),_(e.templates),f(!1)})):ce(t.map((function(e){return e.template_id}))).then((function(e){if(!e.success)return e.message?B(e.message):B(!0),f(!1),!1;_(e.templates),f(!1)}))}),[t]);var F=function(){return Object(r.createElement)(r.Fragment,null,Object(r.createElement)("div",{className:"modal-body"},Object(r.createElement)("div",{className:"header"},Object(r.createElement)("h1",{className:"is-loading",style:{height:30,marginBottom:30,width:"70%"}}),Object(r.createElement)("p",{className:"description is-loading"}),Object(r.createElement)("p",{className:"description is-loading"}),Object(r.createElement)("p",{className:"description is-loading",style:{width:"40%"}}))),Object(r.createElement)("div",{className:"modal-footer",style:{marginTop:50}},Object(r.createElement)("span",{className:"is-loading link"}),Object(r.createElement)("span",{className:"is-loading button",style:{width:"150px",marginLeft:"auto"}})))},z=function(e){if(e.preventDefault(),c)return o(!0),!1;i(!0)},U=function(){N(!0);var e=t.map((function(e,t){return Oe(Oe({},e),v[t])}));try{(function(e){return C(P.root+"/import_single_templates",e)})(e).then((function(e){if(!e.success)return console.log(e.message),!1;I(e.pages),N("done")}))}catch(e){console.log(A)}},V=function(){return Object(r.createElement)(r.Fragment,null,Object(r.createElement)("div",{className:"modal-body"},Object(r.createElement)("div",{className:"header"},Object(r.createElement)("h1",null,Object(E.__)("An error occurred!","templates-patterns-collection")),Object(r.createElement)("p",{className:"description"},!0===A?Object(E.__)("Please refresh the page and try again."):A))),Object(r.createElement)("div",{className:"modal-footer"},Object(r.createElement)(y.Button,{isPrimary:!0,className:"import",onClick:function(){B(!1),n()}},Object(E.__)("Close"))))};return Object(r.createElement)(y.Modal,{className:g()(["ob-import-modal",{fetching:b}]),onRequestClose:n,shouldCloseOnClickOutside:!k&&!b,isDismissible:!k&&!b},"done"===k?Object(r.createElement)((function(){return Object(r.createElement)(r.Fragment,null,Object(r.createElement)("div",{className:"modal-body"},Object(r.createElement)("div",{className:"header"},Object(r.createElement)("h1",null,Object(E.__)("Import done!","templates-patterns-collection")),Object(r.createElement)("p",{className:"description"},R?Object(E.__)("Template was successfully imported!","templates-patterns-collection"):Object(E.__)("Templates were successfully imported!","templates-patterns-collection"))),x&&Object(r.createElement)("ul",{className:"modal-toggles"},x.map((function(e,t){return Object(r.createElement)("li",{className:"option-row",key:t},Object(r.createElement)(y.Icon,{icon:me,className:"active"}),Object(r.createElement)("span",null,e.title),Object(r.createElement)("div",{className:"actions"},Object(r.createElement)(y.Button,{isTertiary:!0,href:e.url},Object(E.__)("Visit","templates-patterns-collection")),Object(r.createElement)(y.Button,{isTertiary:!0,href:e.edit},Object(E.__)("Edit","templates-patterns-collection"))))})))),Object(r.createElement)("div",{className:"modal-footer"},Object(r.createElement)(y.Button,{isPrimary:!0,className:"import",onClick:n},Object(E.__)("Close"))))}),null):Object(r.createElement)((function(){return b?Object(r.createElement)(F,null):A?Object(r.createElement)(V,null):Object(r.createElement)(r.Fragment,null,Object(r.createElement)("div",{className:"modal-body"},Object(r.createElement)("div",{className:"header"},Object(r.createElement)("h1",null,Object(E.sprintf)(R?
|
3 |
+
/* translators: name of starter site */
|
4 |
+
Object(E.__)("Import the %s template","templates-patterns-collection"):
|
5 |
+
/* translators: name of template */
|
6 |
+
Object(E.__)("Import all templates from %s","templates-patterns-collection"),R?t[0].template_name:a.title)),Object(r.createElement)("p",{className:"description"},(e={strong:Object(r.createElement)("strong",null,Object(E.__)("does not"))},n=R?Object(E.sprintf)(
|
7 |
+
/* translators: %s the name of the template */
|
8 |
+
Object(E.__)("The %s template will be imported as a page into your site. This import <strong/> include any plugins or theme settings.","templates-patterns-collection"),t[0].template_name):Object(E.__)("All the templates that are included in this starter site, will be imported as pages. This import <strong/> include any plugins or theme settings.","templates-patterns-collection"),Object(r.createInterpolateElement)(n,e))))),Object(r.createElement)("div",{className:"modal-footer"},!m&&Object(r.createElement)(y.Button,{className:"import-templates",isLink:!0,disabled:k,onClick:z},Object(E.__)("I want to import the entire site","templates-patterns-collection")),Object(r.createElement)(y.Button,{isPrimary:!0,className:"import",disabled:k,onClick:U},k?Object(E.__)("Importing")+"...":R?Object(E.__)("Import"):Object(E.__)("Import All Pages"))));var e,n}),null))})),je=function(e){var t=e.total,n=e.current,a=e.onChange;if(t<2)return null;for(var c=[],o=function(e){var t=e===n;c.push(Object(r.createElement)(y.Button,{key:"page-".concat(e),isPrimary:t,disabled:t,onClick:function(){return a(e)}},e+1))},i=0;i<t;i++)o(i);return Object(r.createElement)(y.ButtonGroup,{className:"pagination"},c)},ye=Object(O.compose)(Object(f.withDispatch)((function(e){var t=e("neve-onboarding"),n=t.setInstallModalStatus;return{setInstallModal:function(e){return n(e)},setTemplateModal:t.setTemplateModal}})),Object(f.withSelect)((function(e){var t=e("neve-onboarding"),n=t.getTemplateModal,r=t.getThemeAction,a=t.getCurrentEditor;return{templateModal:n(),themeStatus:r().action||!1,editor:a()}})))((function(e){var t=e.isGeneral,n=e.setInstallModal,a=e.setTemplateModal,c=e.templateModal,o=e.themeStatus,i=(e.editor,Object(r.useState)([])),s=j()(i,2),l=s[0],u=s[1],m=Object(r.useState)([]),p=j()(m,2),d=p[0],b=p[1],f=Object(r.useState)(t),h=j()(f,2),O=h[0],v=h[1],_=Object(r.useState)(""),S=j()(_,2),C=S[0],N=S[1],T=Object(r.useState)(0),M=j()(T,2),x=M[0],I=M[1],P=Object(r.useState)(0),D=j()(P,2),L=D[0],A=D[1],B=Object(r.useState)(!1),R=j()(B,2),V=R[0],$=R[1],H=Object(r.useState)(""),G=j()(H,2),W=G[0],q=G[1];Object(r.useEffect)((function(){$(!0),Q()}),[t]);var Q=function(){var e={page:x,per_page:12};t&&(e.template_site_slug="general",e.premade=!0),C&&(e.search=C),ne(t,e).then((function(e){u(e.templates),A(e.total),$(!1)}))},J=function(){var e=k()(w.a.mark((function e(n){var r;return w.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return $(!0),I(n),r={page:n,per_page:12},t&&(r.template_site_slug="general",r.premade=!0),C&&(r.search=C),e.next=7,ne(t,r).then((function(e){u(e.templates),A(e.total)}));case 7:$(!1);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Y=function(e){q(e)},K=function(e){if(o)return n(!0),!1;b([e]),a(!0)},Z=l&&l.findIndex((function(e){return e.link===W})),X=l&&l.find((function(e){return W===e.link})),ee=g()("cloud-items",{"is-grid":O});return Object(r.createElement)("div",{className:ee},Object(r.createElement)(r.Fragment,null,Object(r.createElement)(fe,{isGrid:O,setGrid:v,searchQuery:C,setSearchQuery:N,onSearch:function(){$(!0);var e={search:C};t&&(e.template_site_slug="general",e.premade=!0),ne(t,e).then((function(e){u(e.templates),A(e.total),$(!1)}))}}),V&&Object(r.createElement)(y.Spinner,null),!V&&(l&&l.length>0?Object(r.createElement)(r.Fragment,null,Object(r.createElement)("div",{className:"table"},l.map((function(e){return Object(r.createElement)(pe,{onPreview:Y,userTemplate:!t,key:e.template_id,item:e,loadTemplates:Q,onImport:function(){return K(e)},grid:O})}))),Object(r.createElement)(je,{total:L,current:x,onChange:J})):Object(r.createElement)(r.Fragment,null,Object(E.__)("No templates found."))),W&&Object(r.createElement)(he,{previewUrl:W,rightButtons:Object(r.createElement)(y.Button,{isPrimary:!0,onClick:function(){return K(X)}},Object(E.__)("Import Template")),heading:X.template_name,leftButtons:Object(r.createElement)(r.Fragment,null,Object(r.createElement)(y.Button,{icon:F,onClick:function(){return q("")}}),l.length>1&&Object(r.createElement)(r.Fragment,null,Object(r.createElement)(y.Button,{icon:Object(E.isRTL)()?z:U,onClick:function(){var e=Z-1;0===Z&&(e=l.length-1),q(l[e].link)}}),Object(r.createElement)(y.Button,{icon:Object(E.isRTL)()?U:z,onClick:function(){var e=Z+1;Z===l.length-1&&(e=0),q(l[e].link)}})))})),c&&d&&!V&&d.length>0&&Object(r.createElement)(ve,{generalTemplates:!0,isUserTemplate:!t,templatesData:d}))})),Ee=[Object(E.__)("Business","templates-patterns-collection"),Object(E.__)("Ecommerce","templates-patterns-collection"),Object(E.__)("Fashion","templates-patterns-collection"),Object(E.__)("Blogging","templates-patterns-collection"),Object(E.__)("Photography","templates-patterns-collection")],_e={all:Object(E.__)("All Categories"),free:Object(E.__)("Free"),business:Object(E.__)("Business"),portfolio:Object(E.__)("Portfolio"),woocommerce:Object(E.__)("WooCommerce"),blog:Object(E.__)("Blog"),personal:Object(E.__)("Personal"),other:Object(E.__)("Other")},we={gutenberg:{icon:"gutenberg.jpg",niceName:"Gutenberg"},elementor:{icon:"elementor.jpg",niceName:"Elementor"},"beaver builder":{icon:"beaver.jpg",niceName:Object(r.createElement)(r.Fragment,null,"Beaver ",Object(r.createElement)("span",{className:"long-name"},"Builder"))},brizy:{icon:"brizy.jpg",niceName:"Brizy"},"divi builder":{icon:"divi.jpg",niceName:"Divi"},"thrive architect":{icon:"thrive.jpg",niceName:Object(r.createElement)(r.Fragment,null,"Thrive ",Object(r.createElement)("span",{className:"long-name"},"Architect"))}},Se=function(e){var t=e.currentStep,n=e.progress,a=e.willDo,c={plugins:{label:Object(E.__)("Installing Plugins","templates-patterns-collection"),status:n.plugins,willDo:!0},content:{label:Object(E.__)("Importing Content","templates-patterns-collection"),status:n.content,willDo:a.content},customizer:{label:Object(E.__)("Importing Customizer Settings","templates-patterns-collection"),status:n.customizer,willDo:a.customizer},widgets:{label:Object(E.__)("Importing Widgets","templates-patterns-collection"),status:n.widgets,willDo:a.widgets}};return Object(r.createElement)("ul",{className:"stepper"},Object.keys(c).map((function(e,n){var a=c[e],o=a.label,i=a.status;if(!a.willDo)return null;var s=g()(["icon",{loading:t===e,warning:t===e,success:"done"===i,error:"error"===i,skip:"skip"===i}]),l="clock";return t===e&&(l="update"),"done"===i&&(l="yes"),"error"===i&&(l="no-alt"),Object(r.createElement)("li",{key:n},Object(r.createElement)("span",{className:s},Object(r.createElement)(y.Dashicon,{icon:l,className:t===e?"loading":""})),Object(r.createElement)("span",null,o))})))};function ke(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ce(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ke(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ke(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ne=Object(O.compose)(Object(f.withSelect)((function(e){var t=e("neve-onboarding"),n=t.getCurrentEditor,r=t.getCurrentSite;return{editor:n(),siteData:r()}})),Object(f.withDispatch)((function(e,t){var n=t.siteData,r=e("neve-onboarding"),a=r.setTemplateModal,c=r.setSingleTemplateImport,o=r.setImportModalStatus;return{setModal:function(e){return o(e)},runTemplateImport:function(){c(n.slug),a(!0),o(!1)}}})))((function(e){var t=e.setModal,n=e.editor,a=e.siteData,o=e.runTemplateImport,i=Object(r.useState)({content:!0,customizer:!0,widgets:!0}),s=j()(i,2),l=s[0],u=s[1],m=Object(r.useState)(!1),p=j()(m,2),d=p[0],b=p[1],f=Object(r.useState)(!1),h=j()(f,2),O=h[0],v=h[1],_=Object(r.useState)(!1),w=j()(_,2),S=w[0],k=w[1],T=Object(r.useState)(!1),M=j()(T,2),x=M[0],I=M[1],B=Object(r.useState)(null),R=j()(B,2),F=R[0],z=R[1],U=Object(r.useState)(null),V=j()(U,2),$=V[0],H=V[1],G=Object(r.useState)(!1),W=j()(G,2),q=W[0],Q=W[1],J=Object(r.useState)(null),Y=j()(J,2),K=Y[0],Z=Y[1],X=Object(r.useState)(null),ee=j()(X,2),te=ee[0],ne=ee[1],re=Object(r.useState)(null),ae=j()(re,2),ce=ae[0],oe=ae[1],ie=Object(r.useState)(!0),se=j()(ie,2),le=se[0],ue=se[1],me=Object(r.useState)(!0),pe=j()(me,2),de=pe[0],be=pe[1],fe=Object(r.useState)(!0),he=j()(fe,2),ge=he[0],Oe=he[1],ve=tiobDash.license;Object(r.useEffect)((function(){var e=a.remote_url||a.url,t=new URL("".concat(function(e){return e.replace(/\/$/,"")}(e)+"/","wp-json/ti-demo-data/data"));t.searchParams.append("license",ve?ve.key:"free"),N(t,!0,!1).then((function(e){e.ok||(ne({message:Object(E.__)("Something went wrong while loading the site data. Please refresh the page and try again.","templates-patterns-collection"),code:"ti__ob_failed_fetch_response"}),ue(!1)),e.json().then((function(e){oe(Ce(Ce({},e),a));var t=Ce({},e.mandatory_plugins||{}),n=Ce({},e.recommended_plugins||{}),r=e.default_off_recommended_plugins||[];Object.keys(t).map((function(e){t[e]=!0})),Object.keys(n).map((function(e){n[e]=!r.includes(e)})),Z(Ce(Ce({},n),t)),ue(!1)}))})).catch((function(e){ne({message:Object(E.__)("Something went wrong while loading the site data. Please refresh the page and try again.","templates-patterns-collection"),code:"ti__ob_failed_fetch_catch"}),ue(!1)}))}),[]);function je(){if(!l.content)return console.log("[S] Content."),ye(),!1;var e;H("content"),console.log("[P] Content."),(e={contentFile:ce.content_file,source:"remote",frontPage:ce.front_page,shopPages:ce.shop_pages,demoSlug:ce.slug,editor:n},C(P.root+"/import_content",e)).then((function(e){if(!e.success)return we(e,"content"),!1;console.log("[D] Content."),e.frontpage_id&&z(e.frontpage_id),v("done"),ye()})).catch((function(e){return we(e,"content")}))}function ye(){if(!l.customizer)return console.log("[S] Customizer."),Ee(),!1;var e;H("customizer"),console.log("[P] Customizer."),(e={source_url:ce.url,theme_mods:ce.theme_mods,wp_options:ce.wp_options},C(P.root+"/import_theme_mods",e)).then((function(e){if(!e.success)return we(e,"customizer"),!1;console.log("[D] Customizer."),k("done"),Ee()})).catch((function(e){return we(e,"customizer")}))}function Ee(){var e;l.widgets||(console.log("[S] Widgets."),_e()),H("widgets"),console.log("[P] Widgets."),(e=ce.widgets,C(P.root+"/import_widgets",e)).then((function(e){if(!e.success)return we(e,"widgets"),!1;console.log("[D] Widgets."),I("done"),_e()})).catch((function(e){return we(e,"widgets")}))}function _e(){H("done"),Q(!1)}function we(e,t){Q(!1),H(null),"plugins"===t&&v("skip"),["content","plugins"].includes(t)&&k("skip"),["content","plugins","customizer"].includes(t)&&I("skip");var n={plugins:Object(E.__)("Something went wrong while installing the necessary plugins.","templates-patterns-collection"),content:Object(E.__)("Something went wrong while importing the website content.","templates-patterns-collection"),customizer:Object(E.__)("Something went wrong while updating the customizer settings.","templates-patterns-collection"),widgets:Object(E.__)("Something went wrong while importing the widgets.","templates-patterns-collection")};switch(t){case"plugins":b("error");break;case"content":v("error");break;case"customizer":k("error");break;case"widgets":I("error")}ne(e.data?{message:n[t],code:e.data}:{message:n[t]})}var ke=function(){if(q)return!1;t(!1)},Ne=!a.external_plugins||a.external_plugins.every((function(e){return!0===e.active})),Te=Object.keys(l).every((function(e){return!1===l[e]})),Me={elementor:"".concat(tiobDash.onboarding.homeUrl,"/wp-admin/post.php?post=").concat(F,"&action=elementor"),brizy:"".concat(tiobDash.onboarding.homeUrl,"/?brizy-edit"),"beaver builder":"".concat(tiobDash.onboarding.homeUrl,"/?fl_builder"),"thrive architect":"".concat(tiobDash.onboarding.homeUrl,"/wp-admin/post.php?post=").concat(F,"&action=architect&tve=true"),"divi builder":"".concat(tiobDash.onboarding.homeUrl,"/?et_fb=1&PageSpeed=off"),gutenberg:"".concat(tiobDash.onboarding.homeUrl,"/wp-admin/post.php?post=").concat(F,"&action=edit")}[n];return Object(r.createElement)(y.Modal,{className:g()(["ob-import-modal",{fetching:le}]),onRequestClose:ke,shouldCloseOnClickOutside:!q&&!le,isDismissible:!q&&!le},le?Object(r.createElement)(r.Fragment,null,Object(r.createElement)("div",{className:"modal-body"},Object(r.createElement)("div",{className:"header"},Object(r.createElement)("span",{className:"title is-loading",style:{height:35,marginBottom:20}}),Object(r.createElement)("p",{className:"description is-loading"}),Object(r.createElement)("p",{className:"description is-loading"})),Object(r.createElement)("div",{className:"well is-loading"},Object(r.createElement)("span",{className:"title is-loading",style:{height:20}}),Object(r.createElement)("ol",null,Object(r.createElement)("li",null),Object(r.createElement)("li",null))),Object(r.createElement)("div",{className:"modal-toggles components-panel"},[1,2].map((function(e){return Object(r.createElement)("div",{key:e,className:"components-panel__body options general is-opened"},Object(r.createElement)("span",{className:"title is-loading"}),Object(r.createElement)("ul",null,[1,2,3].map((function(e){return Object(r.createElement)("li",{className:"option-row",key:e},Object(r.createElement)("div",{className:"mock-icon is-loading"}),Object(r.createElement)("span",{className:"is-loading"}),Object(r.createElement)("div",{className:"toggle is-loading"}))}))))})))),Object(r.createElement)("div",{className:"modal-footer"},Object(r.createElement)("span",{className:"link is-loading"}),Object(r.createElement)(y.Button,{isPrimary:!0,className:"import is-loading"}))):Object(r.createElement)(r.Fragment,null,Object(r.createElement)("div",{className:"modal-body"},q||"done"===$||te?Object(r.createElement)(r.Fragment,null,te&&Object(r.createElement)(r.Fragment,null,Object(r.createElement)(A,{message:te.message||null,code:te.code||null}),Object(r.createElement)("hr",null)),null!==$&&Object(r.createElement)(Se,{progress:{plugins:d,content:O,customizer:S,widgets:x},currentStep:$,willDo:l}),"done"===$&&Object(r.createElement)(r.Fragment,null,Object(r.createElement)("hr",null),Object(r.createElement)("p",{className:"import-result"},Object(E.__)("Content was successfully imported. Enjoy your new site!","templates-patterns-collection")),Object(r.createElement)("hr",null))):Object(r.createElement)(r.Fragment,null,Object(r.createElement)((function(){return le?Object(r.createElement)(r.Fragment,null,Object(r.createElement)("h1",{className:"is-loading title"}),Object(r.createElement)("p",{className:"is-loading description"})):Object(r.createElement)("div",{className:"header"},Object(r.createElement)("h1",null,Object(E.sprintf)(
|
9 |
+
/* translators: name of starter site */
|
10 |
+
Object(E.__)("Import %s as a complete site","templates-patterns-collection"),ce.title)),Object(r.createElement)("p",{className:"description"},Object(E.__)("Import the entire site including customizer options, pages, content and plugins.","templates-patterns-collection")))}),null),Object(r.createElement)((function(){return Object(r.createElement)(L,{data:ce,externalInstalled:Ne})}),null),Object(r.createElement)(y.Panel,{className:"modal-toggles"},Object(r.createElement)((function(){var e={content:{title:Object(E.__)("Content","templates-patterns-collection"),icon:"admin-post"},customizer:{title:Object(E.__)("Customizer","templates-patterns-collection"),icon:"admin-customizer"},widgets:{title:Object(E.__)("Widgets","templates-patterns-collection"),icon:"admin-generic"}};return Object(r.createElement)(y.PanelBody,{onToggle:function(){Oe(!ge)},opened:ge,className:"options general",title:Object(E.__)("Import settings","templates-patterns-collection")},Object.keys(e).map((function(t,n){return Object(r.createElement)(y.PanelRow,{className:"option-row",key:n},Object(r.createElement)(y.Icon,{className:g()({active:l[t]}),icon:e[t].icon}),Object(r.createElement)("span",null,e[t].title),Object(r.createElement)("div",{className:"toggle-wrapper"},Object(r.createElement)(y.ToggleControl,{checked:l[t],onChange:function(){u(Ce(Ce({},l),{},c()({},t,!l[t])))}})))})))}),null),Object(r.createElement)((function(){if(le)return null;var e=Ce(Ce({},ce.recommended_plugins||{}),ce.mandatory_plugins||{});return Object(r.createElement)(y.PanelBody,{onToggle:function(){be(!de)},opened:de,className:"options plugins",title:Object(E.__)("Plugins","templates-patterns-collection")},Object.keys(e).map((function(t,n){return Object(r.createElement)(y.PanelRow,{className:"option-row",key:n},Object(r.createElement)(y.Icon,{icon:"admin-plugins",className:g()({active:K[t]})}),Object(r.createElement)("span",{dangerouslySetInnerHTML:{__html:e[t]}}),t in ce.recommended_plugins&&Object(r.createElement)("div",{className:"toggle-wrapper"},Object(r.createElement)(y.ToggleControl,{checked:K[t],onChange:function(){Z(Ce(Ce({},K),{},c()({},t,!K[t])))}})))})))}),null)))),!q&&Object(r.createElement)("div",{className:"modal-footer"},"done"!==$?Object(r.createElement)(r.Fragment,null,Object(r.createElement)(y.Button,{className:"import-templates",isLink:!0,onClick:o},Object(E.__)("I want to import just the templates","templates-patterns-collection")),!te&&Object(r.createElement)(y.Button,{className:"import",isPrimary:!0,disabled:Te||!Ne,onClick:function(){Q(!0),function(){if(console.clear(),!K)return console.log("[S] Plugins."),je(),!1;H("plugins"),console.log("[P] Plugins."),D(K).then((function(e){if(!e.success)return we(e,"plugins"),!1;console.log("[D] Plugins."),b("done"),je()})).catch((function(e){return we(e,"plugins")}))}()}},Object(E.__)("Import entire site","templates-patterns-collection"))):Object(r.createElement)("div",{className:"import-done-actions"},Object(r.createElement)(y.Button,{isLink:!0,className:"close",onClick:ke},Object(E.__)("Back to Sites Library","templates-patterns-collection")),Object(r.createElement)(y.Button,{isSecondary:!0,href:tiobDash.onboarding.homeUrl},Object(E.__)("View Website","templates-patterns-collection")),Object(r.createElement)(y.Button,{isPrimary:!0,className:"import",href:Me},Object(E.__)("Add your own content","templates-patterns-collection"))))))})),Te=Object(O.compose)(Object(f.withDispatch)((function(e){var t=e("neve-onboarding"),n=t.setSingleTemplateImport,r=t.setImportModalStatus,a=t.setInstallModalStatus;return{cancel:function(){n(null)},setModal:function(e){return r(e)},setInstallModal:function(e){return a(e)},setTemplateModal:t.setTemplateModal}})),Object(f.withSelect)((function(e){var t=e("neve-onboarding"),n=t.getTemplateModal,r=t.getThemeAction,a=t.getCurrentSite,c=t.getCurrentEditor;return{templateModal:n(),themeStatus:r().action||!1,site:a(),editor:c()}})))((function(e){var t=e.slug,n=e.cancel,a=e.setModal,c=e.setInstallModal,o=e.themeStatus,i=e.site,s=e.editor,l=e.setTemplateModal,u=e.templateModal,m=Object(r.useState)([]),p=j()(m,2),d=p[0],b=p[1],f=Object(r.useState)(!0),h=j()(f,2),g=h[0],O=h[1],v=Object(r.useState)(""),_=j()(v,2),w=_[0],S=_[1],k=Object(r.useState)([]),C=j()(k,2),N=C[0],T=C[1],M=i.title,x=i.upsell,I=i.utmOutboundLink;Object(r.useEffect)((function(){P()}),[]);var P=function(){ne(!0,{per_page:100,template_site_slug:t,premade:!0,type:s}).then((function(e){b(e.templates||[]),O(!1)}))},D=function(e){S(e)},L=function(e){if(o)return c(!0),!1;T([e]),l(!0)},A=function(e){if(e.preventDefault(),o)return c(!0),!1;a(!0)},B=d.findIndex((function(e){return e.link===w})),R=d.find((function(e){return e.link===w}));return Object(r.createElement)("div",{className:"single-templates-wrapper"},Object(r.createElement)("div",{className:"top"},Object(r.createElement)("div",{className:"breadcrumb"},Object(r.createElement)(y.Button,{isTertiary:!0,onClick:n},Object(E.__)("Back to starter sites"))),Object(r.createElement)("div",{className:"header"},Object(r.createElement)("div",{className:"text"},Object(r.createElement)("h1",null,M||"",x&&Object(r.createElement)("span",{className:"pro-badge"},Object(r.createElement)(y.Icon,{icon:"lock"}),Object(r.createElement)("span",null,Object(E.__)("Premium","templates-patterns-collection")))),Object(r.createElement)("p",{className:"description"},Object(E.__)("You can import individual pages or bulk-import all of them."))),Object(r.createElement)("div",{className:"actions"},!x&&Object(r.createElement)(r.Fragment,null,Object(r.createElement)(y.Button,{isSecondary:!0,onClick:A},Object(E.__)("Import Starter Site")),Object(r.createElement)(y.Button,{isPrimary:!0,disabled:d.length<1,onClick:function(e){if(e.preventDefault(),o)return c(!0),!1;T(d),l(!0)}},Object(E.__)("Import All Pages"))),x&&Object(r.createElement)(y.Button,{href:I||tiobDash.upgradeURL,isSecondary:!0},Object(E.__)("Upgrade"))))),Object(r.createElement)((function(){return g?Object(r.createElement)(y.Spinner,null):d.length<1?Object(E.__)("No templates for this starter site."):Object(r.createElement)("div",{className:"cloud-items is-grid"},Object(r.createElement)("div",{className:"table"},d.map((function(e){return Object(r.createElement)(pe,{upsell:x,onPreview:D,userTemplate:!1,key:e.template_id,item:e,loadTemplates:P,onImport:function(){return L(e)},grid:!0})}))))}),null),w&&Object(r.createElement)(he,{heading:R.template_name||null,previewUrl:w,leftButtons:Object(r.createElement)(r.Fragment,null,Object(r.createElement)(y.Button,{icon:F,onClick:function(){return S("")},label:Object(E.__)("Close","templates-patterns-collection")}),d.length>1&&Object(r.createElement)(r.Fragment,null,Object(r.createElement)(y.Button,{icon:Object(E.isRTL)()?z:U,onClick:function(){var e=B-1;0===B&&(e=d.length-1),S(d[e].link)}}),Object(r.createElement)(y.Button,{icon:Object(E.isRTL)()?U:z,onClick:function(){var e=B+1;B===d.length-1&&(e=0),S(d[e].link)}}))),rightButtons:Object(r.createElement)(r.Fragment,null,!x&&Object(r.createElement)(r.Fragment,null,Object(r.createElement)(y.Button,{isSecondary:!0,onClick:A},Object(E.__)("Import Starter Site")),Object(r.createElement)(y.Button,{isPrimary:!0,disabled:d.length<1,onClick:function(){return L(R)}},Object(E.__)("Import Page"))),x&&Object(r.createElement)(y.Button,{href:I||tiobDash.upgradeURL,isSecondary:!0},Object(E.__)("Upgrade")))}),u&&N&&!g&&N.length>0&&Object(r.createElement)(ve,{templatesData:N}))})),Me=function(){return Object(r.createElement)(R.SVG,{width:"100",height:"100",viewBox:"0 0 100 100",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"ob-logo"},Object(r.createElement)(R.Path,{d:"M95.0264 100H4.97356C2.22797 100 0 97.772 0 95.0264V4.97356C0 2.22797 2.22797 0 4.97356 0H95.0264C97.772 0 100 2.22797 100 4.97356V95.0264C100 97.772 97.772 100 95.0264 100Z",fill:"#0366D6"}),Object(r.createElement)(R.Path,{d:"M82.6941 86.7448V30.8205V18.4653H70.3502H14.4146L26.7584 30.8205H70.3502V74.401L82.6941 86.7448Z",fill:"white"}),Object(r.createElement)(R.Path,{d:"M42.2416 58.9291L42.2528 71.183L53.2352 82.1653L53.1902 47.9806L18.9941 47.9355L29.9765 58.9066L42.2416 58.9291Z",fill:"white"}))},xe=function(e){var t=e.setCurrentTab,n=e.currentTab,a=e.isFetching,c=Object(r.useState)(!1),o=j()(c,2),i=o[0],s=o[1],l={starterSites:Object(E.__)("Starter Sites","neve"),pageTemplates:Object(E.__)("Page Templates","neve")};return tiobDash.license&&tiobDash.license.tier&&3===tiobDash.license.tier&&(l.library=Object(E.__)("My Library","neve")),Object(r.createElement)("div",{className:"header-nav"},Object.keys(l).map((function(e){return Object(r.createElement)(y.Button,{key:e,isTertiary:!0,isPressed:e===n,onClick:function(){return t(e)}},l[e])})),"starterSites"!==n&&Object(r.createElement)(y.Button,{icon:ie,onClick:function(){s(!0),localStorage.setItem("tpcCacheBuster",X());var e=n;t(null),setTimeout((function(){t(e),s(!1)}),100)},label:Object(E.__)("Re-sync Library"),className:g()("is-sync",{"is-loading":i}),disabled:a||i,"data-content":Object(E.__)("Sync")}))},Ie=Object(O.compose)(Object(f.withDispatch)((function(e){var t=e("neve-onboarding"),n=t.setOnboardingState;return{cancelOnboarding:function(){n(!1)},setCurrentTab:t.setCurrentTab,setFetching:t.setFetching}})),Object(f.withSelect)((function(e){var t=e("neve-onboarding"),n=t.getOnboardingStatus,r=t.getCurrentTab,a=t.getFetching;return{isOnboarding:n(),currentTab:r(),isFetching:a()}})))((function(e){var t=e.isOnboarding,n=e.cancelOnboarding,a=e.setCurrentTab,c=e.currentTab;return Object(r.createElement)("div",{className:"ob-head"},!t&&Object(r.createElement)(r.Fragment,null,Object(r.createElement)("div",{className:"header-container"},Object(r.createElement)("h2",null,!tiobDash.brandedTheme&&Object(r.createElement)(y.Icon,{icon:Me}),Object(r.createElement)("span",null,Object(E.__)("Templates Cloud","neve"))),Object(r.createElement)(xe,{setCurrentTab:a,currentTab:c}))),t&&Object(r.createElement)(y.Button,{className:"close-onboarding",isLink:!0,icon:"no-alt",onClick:n}))})),Pe=n(17),De=n.n(Pe),Le=n(14),Ae=n.n(Le),Be=n(18),Re=n.n(Be),Fe=Object(O.compose)(Object(f.withSelect)((function(e){return{themeStatus:(0,e("neve-onboarding").getThemeAction)().action||!1}})),Object(f.withDispatch)((function(e,t){var n=t.data,r=n.slug,a=e("neve-onboarding"),c=a.setCurrentSite,o=a.setPreviewStatus,i=a.setImportModalStatus,s=a.setInstallModalStatus,l=a.setSingleTemplateImport;return{setSite:function(){return c(n)},setPreview:function(e){return o(e)},setModal:function(e){return i(e)},setInstallModal:function(e){return s(e)},setImportingPages:function(){return l(r)}}})))((function(e){var t=e.data,n=e.setSite,a=e.setPreview,c=e.setModal,o=e.themeStatus,i=e.setInstallModal,s=e.setImportingPages,l=t.upsell,u=(t.slug,t.screenshot),m=t.title,p=t.has_templates,d=Object(r.useState)(""),b=j()(d,2),f=b[0],h=b[1],O=g()("card starter-site-card",{"has-templates":p});return Object(r.createElement)("div",{onMouseEnter:function(){h("visible")},onMouseLeave:function(){h("")},className:O},Object(r.createElement)("div",{className:"top"},Object(r.createElement)("div",{className:"actions "+f},Object(r.createElement)(y.Button,{isSecondary:!0,onClick:function(e){e.preventDefault(),n(),a(!0)}},Object(E.__)("Preview","templates-patterns-collection")),!l&&Object(r.createElement)(y.Button,{isPrimary:!0,className:"import",onClick:function(e){if(e.preventDefault(),n(),o)return i(!0),!1;c(!0)}},Object(E.__)("Import","templates-patterns-collection")),p&&Object(r.createElement)(y.Button,{isLink:!0,className:"templates",onClick:function(e){e.preventDefault(),n(),s()}},Object(E.__)("View Pages","templates-patterns-collection"))),u&&Object(r.createElement)("div",{className:"image",style:{backgroundImage:'url("'.concat(u,'")')}})),Object(r.createElement)("div",{className:"bottom"},Object(r.createElement)("p",{className:"title"},m),l&&Object(r.createElement)("span",{className:"pro-badge"},Object(r.createElement)(y.Dashicon,{icon:"lock",size:15}),Object(r.createElement)("span",null,Object(E.__)("Premium","templates-patterns-collection")))))})),ze=Object(O.compose)(Object(f.withSelect)((function(e){var t=e("neve-onboarding"),n=t.getCurrentSite,r=t.getThemeAction;return{siteData:n(),themeStatus:r().action||!1}})),Object(f.withDispatch)((function(e){var t=e("neve-onboarding"),n=t.setCurrentSite,r=t.setPreviewStatus,a=t.setImportModalStatus,c=t.setInstallModalStatus;return{setSite:function(e){return n(e)},setPreview:function(e){return r(e)},setModal:function(e){return a(e)},setInstallModal:function(e){return c(e)}}})))((function(e){var t=e.next,n=e.prev,a=e.siteData,c=e.setSite,o=e.setPreview,i=e.setModal,s=e.themeStatus,l=e.setInstallModal;return Object(r.createElement)("div",{className:"ob-preview"},Object(r.createElement)("div",{className:"preview"},Object(r.createElement)("iframe",{src:a.url,frameBorder:"0"}),Object(r.createElement)("div",{className:"loading"},Object(r.createElement)(y.Dashicon,{icon:"update",size:50}))),Object(r.createElement)("div",{className:"bottom-bar"},Object(r.createElement)("div",{className:"navigator"},Object(r.createElement)(y.Button,{onClick:function(e){e.preventDefault(),o(!1),c(null)},className:"close",label:Object(E.__)("Close","templates-patterns-collection"),icon:F}),n&&Object(r.createElement)(y.Button,{onClick:function(e){e.preventDefault(),c(n)},className:"prev",label:Object(E.__)("Previous","templates-patterns-collection"),icon:Object(E.isRTL)()?z:U}),t&&Object(r.createElement)(y.Button,{onClick:function(e){e.preventDefault(),c(t)},className:"next",label:Object(E.__)("Next","templates-patterns-collection"),icon:Object(E.isRTL)()?U:z})),Object(r.createElement)("div",{className:"actions"},a.upsell?Object(r.createElement)(y.Button,{className:"upgrade",isPrimary:!0,href:a.utmOutboundLink||tiobDash.upgradeURL},Object(E.__)("Upgrade and Import","templates-patterns-collection")):Object(r.createElement)(y.Button,{className:"import",isPrimary:!0,onClick:function(e){if(e.preventDefault(),s)return l(!0),!1;i(!0)}},Object(E.__)("Import","templates-patterns-collection")))))})),Ue=Object(O.compose)(Object(f.withSelect)((function(e){var t=e("neve-onboarding"),n=t.getCurrentCategory,r=t.getSearchQuery;return{category:n(),query:r()}})),Object(f.withDispatch)((function(e){var t=e("neve-onboarding"),n=t.setCurrentCategory,r=t.setSearchQuery;return{setCurrentCategory:function(e){return n(e)},onSearch:function(e){return r(e)}}})))((function(e){var t=e.count,n=e.categories,a=e.onSearch,c=e.category,o=e.setCurrentCategory,i=e.query,s=e.className,l=Object(r.useState)(!1),u=j()(l,2),m=u[0],p=u[1],d=function(){return p(!m)},b=g()(s,"header-form");return Object(r.createElement)("div",{className:b},Object(r.createElement)("div",{className:"search"},Object(r.createElement)("img",{src:tiobDash.assets+"/img/search.svg",alt:Object(E.__)("Search Icon")}),Object(r.createElement)("input",{onChange:function(e){a(e.target.value)},type:"search",value:i,placeholder:Object(E.__)("Search for a starter site","templates-patterns-collection")+"..."}),Object(r.createElement)((function(){return Object(r.createElement)("div",{className:"ob-dropdown categories-selector"},Object(r.createElement)(y.Button,{onClick:d,className:"select ob-dropdown"},n[c],Object(r.createElement)(y.Dashicon,{size:14,icon:m?"arrow-up-alt2":"arrow-down-alt2"}),m&&Object(r.createElement)(y.Popover,{position:"bottom center",onClose:d,noArrow:!0},m&&Object(r.createElement)("ul",{className:"options"},Object.keys(n).map((function(e,a){return e===c||"free"===e&&t.all===t[e]?null:Object(r.createElement)("li",{key:a},Object(r.createElement)("a",{href:"#",onClick:function(t){t.preventDefault(),o(e),p(!1)}},Object(r.createElement)("span",null,n[e]),Object(r.createElement)("span",{className:"count"},t[e])))}))))))}),null)))})),Ve=Object(O.compose)(Object(f.withSelect)((function(e){var t=e("neve-onboarding"),n=t.getCurrentEditor,r=t.getSites;return{editor:n(),sites:r().sites}})),Object(f.withDispatch)((function(e){var t=e("neve-onboarding").setCurrentEditor;return{setCurrentEditor:function(e){return t(e)}}})))((function(e){var t=e.EDITOR_MAP,n=e.count,a=e.editor,c=e.setCurrentEditor,o=e.sites,i=e.isSmall,s=Object(r.useState)(!1),l=j()(s,2),u=l[0],m=l[1],p=Object.keys(o),d=function(){return m(!u)},b=g()(["ob-dropdown","editor-selector",{small:i}]);return Object(r.createElement)("div",{className:b},Object(r.createElement)(y.Button,{onClick:d,className:"select ob-dropdown"},Object(r.createElement)("img",{className:"editor-icon",src:tiobDash.assets+"img/"+t[a].icon,alt:Object(E.__)("Builder Logo","templates-patterns-collection")}),!i&&Object(r.createElement)("span",null,t[a].niceName),Object(r.createElement)("span",{className:"count"},n[a]),Object(r.createElement)(y.Dashicon,{size:14,icon:u?"arrow-up-alt2":"arrow-down-alt2"}),u&&Object(r.createElement)(y.Popover,{position:"bottom center",onClose:d,noArrow:!0},u&&Object(r.createElement)("ul",{className:"options"},p.map((function(e,o){return e===a?null:Object(r.createElement)("li",{key:o},Object(r.createElement)("a",{href:"#",onClick:function(t){t.preventDefault(),c(e),m(!1)}},Object(r.createElement)("img",{className:"editor-icon",src:tiobDash.assets+"img/"+t[e].icon,alt:Object(E.__)("Builder Logo","templates-patterns-collection")}),Object(r.createElement)("span",null,t[e].niceName),Object(r.createElement)("span",{className:"count"},n[e])))}))))))})),$e=Object(O.compose)(Object(f.withSelect)((function(e){var t=e("neve-onboarding"),n=t.getCurrentEditor,r=t.getSites;return{editor:n(),sites:r().sites}})),Object(f.withDispatch)((function(e){var t=e("neve-onboarding").setCurrentEditor;return{setCurrentEditor:function(e){return t(e)}}})))((function(e){var t=e.EDITOR_MAP,n=e.count,a=e.onlyProSites,c=e.editor,o=e.setCurrentEditor,i=e.sites,s=Object.keys(i);return Object(r.createElement)("div",{className:"editor-tabs"},s.map((function(e,i){var s=g()(["tab",e,{active:e===c}]);return Object(r.createElement)("a",{key:i,href:"#",className:s,onClick:function(t){t.preventDefault(),o(e)}},Object(r.createElement)("span",{className:"icon-wrap"},Object(r.createElement)("img",{className:"editor-icon",src:tiobDash.assets+"img/"+t[e].icon,alt:Object(E.__)("Builder Logo","templates-patterns-collection")})),Object(r.createElement)("span",{className:"editor"},t[e].niceName),Object(r.createElement)("span",{className:"count"},n[e]),a.includes(e)&&Object(r.createElement)("span",{className:"pro-badge"},"PRO"))})))})),He=Object(O.compose)(Object(f.withDispatch)((function(e){var t=e("neve-onboarding"),n=t.setOnboardingState,r=t.setCurrentCategory;return{cancelOnboarding:function(){n(!1)},resetCategory:function(){r("all")},setCurrentTab:t.setCurrentTab}})),Object(f.withSelect)((function(e){var t=e("neve-onboarding"),n=t.getCurrentEditor,r=t.getCurrentCategory,a=t.getOnboardingStatus,c=t.getSites;return{editor:n(),category:r(),isOnboarding:a(),getSites:c()}})))((function(e){var t,n=e.filterByCategory,a=e.filterBySearch,c=e.getSitesForBuilder,o=e.isOnboarding,i=e.getSites,s=e.category,l=e.editor,u=Object(r.useState)(!1),m=j()(u,2),p=m[0],d=m[1],b=i.sites,f=void 0===b?{}:b,h=i.migration,g={top:p?0:"-100%"},O=Object.keys(f),v=O.filter((function(e){return Object.keys(f[e]).filter((function(t){return!0===f[e][t].upsell})).length===Object.keys(f[e]).length})),E=(t={builders:{},categories:{}},O.forEach((function(e){var r=c(e);r=n(r,s),r=a(r),t.builders[e]=r?r.length:0})),Object.keys(_e).forEach((function(e){var r=c(l);r=n(r,e),r=a(r),t.categories[e]=r?r.length:0})),t);return Object(r.createElement)(r.Fragment,null,!o&&!h&&Object(r.createElement)("div",{className:"sticky-nav",style:g},Object(r.createElement)("div",{className:"container sticky-nav-content"},!tiobDash.brandedTheme&&Object(r.createElement)(y.Icon,{icon:Me,size:32}),Object(r.createElement)(Ue,{className:"in-sticky",count:E.categories,categories:_e}),Object(r.createElement)(Ve,{isSmall:!0,count:E.builders,EDITOR_MAP:we}))),Object(r.createElement)(Ae.a,{onChange:function(e){d(!e)}},Object(r.createElement)("div",null,!o&&Object(r.createElement)("p",{className:"instructions"},tiobDash.strings.starterSitesTabDescription),Object(r.createElement)(Ve,{count:E.builders,EDITOR_MAP:we}),Object(r.createElement)(Ue,{count:E.categories,categories:_e}),Object(r.createElement)($e,{EDITOR_MAP:we,onlyProSites:v,count:E.builders}))))})),Ge=Object(O.compose)(Object(f.withDispatch)((function(e){var t=e("neve-onboarding"),n=t.setOnboardingState,r=t.setCurrentCategory;return{cancelOnboarding:function(){n(!1)},resetCategory:function(){r("all")},setCurrentTab:t.setCurrentTab,setSearchQuery:t.setSearchQuery}})),Object(f.withSelect)((function(e){var t=e("neve-onboarding"),n=t.getCurrentEditor,r=t.getCurrentCategory,a=t.getPreviewStatus,c=t.getCurrentSite,o=t.getImportModalStatus,i=t.getOnboardingStatus,s=t.getSites,l=t.getInstallModalStatus,u=t.getCurrentTab,m=t.getSearchQuery;return{editor:n(),category:r(),previewOpen:a(),currentSiteData:c(),importModal:o(),installModal:l(),isOnboarding:i(),getSites:s(),currentTab:u(),searchQuery:m()}})))((function(e){var t=e.getSites,n=e.category,a=e.resetCategory,c=e.editor,o=e.previewOpen,i=e.currentSiteData,s=e.isOnboarding,l=e.cancelOnboarding,u=e.setSearchQuery,m=e.searchQuery,p=t.sites,d=void 0===p?{}:p,b=function(){var e={};return g().forEach((function(t){var n=d&&d[t]?d[t]:{};e[t]=De()(Object.values(n))})),e},f=function(e,t){return"free"===t?e.filter((function(e){return!e.upsell})):"all"!==t?e.filter((function(e){return e.keywords.includes(t)})):e},h=function(e){return m?new Re.a(e,{includeScore:!0,keys:["title","slug","keywords"]}).search(m).map((function(e){return e.item})):e},g=function(){return Object.keys(d)},O=function(){var e=b()[c];return e=h(e),e=f(e,n)},v=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null===i)return null;var t=b()[c],n=t.indexOf(i);return-1===n||1===t.length?null:e&&0===n?t[t.length-1]:e||n!==t.length-1?t[e?n-1:n+1]:t[0]};return 1>d.length?Object(r.createElement)(r.Fragment,null,Object(r.createElement)("p",null,Object(E.__)("Starter sites could not be loaded. Please refresh and try again.","neve"),s&&Object(r.createElement)(y.Button,{style:{display:"block",margin:"20px auto"},isPrimary:!0,onClick:l},Object(E.__)("Close","templates-patterns-collection")))):Object(r.createElement)(r.Fragment,null,Object(r.createElement)(He,{getSitesForBuilder:function(e){return b()[e]},filterBySearch:h,filterByCategory:f}),0===O().length&&Object(r.createElement)("div",{className:"no-results"},Object(r.createElement)("p",null,Object(E.__)("No results found","templates-patterns-collection"),Object(E.__)("You can try a different search or use one of the categories below.","neve")),Object(r.createElement)("div",{className:"tags"},Ee.map((function(e,t){return Object(r.createElement)(y.Button,{key:t,isPrimary:!0,className:"tag",onClick:function(t){t.preventDefault(),u(e),a()}},e)})))),Object(r.createElement)((function(){var e=Object(r.useState)(9),t=j()(e,2),n=t[0],a=t[1],c=O();return Object(r.createElement)("div",{className:"ob-sites is-grid"},c.slice(0,n).map((function(e,t){return Object(r.createElement)(Fe,{key:t,data:e})})),Object(r.createElement)(Ae.a,{onChange:function(e){if(!e)return!1;a(n+9)}},Object(r.createElement)("span",{style:{height:10,width:10,display:"block"}})))}),null),o&&i&&Object(r.createElement)(ze,{next:v(),prev:v(!0)}))})),We=Object(O.compose)(Object(f.withDispatch)((function(e){var t=e("neve-onboarding"),n=t.setOnboardingState,r=t.setCurrentCategory;return{cancelOnboarding:function(){n(!1)},resetCategory:function(){r("all")},setCurrentTab:t.setCurrentTab}})),Object(f.withSelect)((function(e){var t=e("neve-onboarding"),n=t.getCurrentEditor,r=t.getCurrentCategory,a=t.getPreviewStatus,c=t.getCurrentSite,o=t.getImportModalStatus,i=t.getOnboardingStatus,s=t.getSites,l=t.getInstallModalStatus,u=t.getCurrentTab,m=t.getSingleImport;return{editor:n(),category:r(),previewOpen:a(),currentSiteData:c(),importModal:o(),installModal:l(),isOnboarding:i(),getSites:s(),currentTab:u(),singleImport:m()}})))((function(e){var t=e.getSites,n=e.installModal,a=e.currentTab,c=e.singleImport,o=e.importModal,i=e.currentSiteData,s=(e.isOnboarding,t.migration);return Object(r.createElement)(r.Fragment,null,Object(r.createElement)("div",{className:"ob"},Object(r.createElement)(Ie,null),Object(r.createElement)("div",{className:"ob-body"},Object(r.createElement)("div",{className:"content-container"},s&&Object(r.createElement)(B,{data:s}),"starterSites"===a&&(c?Object(r.createElement)(Te,{slug:c}):Object(r.createElement)(Ge,null)),"library"===a&&Object(r.createElement)(ye,null),"pageTemplates"===a&&Object(r.createElement)(ye,{isGeneral:!0})))),n&&Object(r.createElement)(I,null),o&&i&&Object(r.createElement)(Ne,null))})),qe=Object(f.withSelect)((function(e){return{onboarding:(0,e("neve-onboarding").getOnboardingStatus)()}}))((function(e){var t=e.onboarding,n=g()(["content-wrap","starter-sites",{"is-onboarding":t}]);return Object(r.createElement)("div",{className:"tiob-wrap"},Object(r.createElement)("div",{className:n},Object(r.createElement)("div",{className:"container content"},Object(r.createElement)("div",{className:"main"},Object(r.createElement)("div",{className:"tab-content columns starter-sites"},Object(r.createElement)(We,null))))))}));Object(f.registerStore)("neve-onboarding",{reducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:d,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"REFRESH_SITES":var n=t.payload.sites;return i(i({},e),{},{sites:n});case"SET_CURRENT_EDITOR":var r=t.payload.editor;return localStorage.setItem("neve-onboarding-editor",r),i(i({},e),{},{editor:r});case"SET_CURRENT_CATEGORY":var a=t.payload.category;return i(i({},e),{},{category:a});case"SET_FOCUSED_SITE":var c=t.payload.siteData;return i(i({},e),{},{currentSite:c});case"SET_PREVIEW_STATUS":var o=t.payload.previewStatus;return i(i({},e),{},{previewStatus:o});case"SET_IMPORT_MODAL_STATUS":var s=t.payload.importModalStatus;return i(i({},e),{},{importModalStatus:s});case"SET_INSTALL_MODAL_STATUS":var l=t.payload.installModalStatus;return i(i({},e),{},{installModalStatus:l});case"SET_ONBOARDING":var u=t.payload.status;return i(i({},e),{},{isOnboarding:u});case"SET_THEME_ACTIONS":var m=t.payload.themeActions;return i(i({},e),{},{themeAction:m});case"SET_CURRENT_TAB":var p=t.payload.currentTab;return i(i({},e),{},{singleTemplateImport:null,currentTab:p});case"SET_FETCHING":var b=t.payload.fetching;return i(i({},e),{},{fetching:b});case"SET_SINGLE_TEMPLATE_IMPORT":var f=t.payload.slug;return i(i({},e),{},{singleTemplateImport:f});case"SET_TEMPLATE_MODAL":var h=t.payload.data;return i(i({},e),{},{templateModal:h});case"SET_SEARCH_QUERY":var g=t.payload.query;return i(i({},e),{},{searchQuery:g})}return e},actions:b,selectors:{getSites:function(e){return e.sites},getMigrationData:function(e){return e.migrationData},getCurrentEditor:function(e){return e.editor},getCurrentCategory:function(e){return e.category},getCurrentSite:function(e){return e.currentSite},getPreviewStatus:function(e){return e.previewStatus},getImportModalStatus:function(e){return e.importModalStatus},getOnboardingStatus:function(e){return e.isOnboarding},getThemeAction:function(e){return e.themeAction},getInstallModalStatus:function(e){return e.installModalStatus},getCurrentTab:function(e){return e.currentTab},getFetching:function(e){return e.fetching},getSingleImport:function(e){return e.singleTemplateImport},getTemplateModal:function(e){return e.templateModal},getSearchQuery:function(e){return e.searchQuery}}}),Object(r.render)(Object(r.createElement)(qe,null),document.getElementById("tpc-app"))}]);
|
assets/build/style-app-rtl.css
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
-
#wpcontent{padding-right:0 !important}#wpbody-content>.error,#wpbody-content>.info,#wpbody-content>.notice{display:none !important}.ob-overflow-off{overflow:hidden !important}@media screen and (min-width: 660px){.ob-import-modal{width:630px !important}}.container{padding:0 15px}.container.content{padding-top:20px;position:relative}svg.is-loading,button.is-loading svg{-webkit-animation-name:spin;animation-name:spin;-webkit-animation-duration:2000ms;animation-duration:2000ms;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-timing-function:linear;animation-timing-function:linear;margin-left:0}.col{width:100%}@-webkit-keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(-360deg)}}@keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(-360deg)}}.columns.starter-sites{position:relative;display:flex;flex-grow:1}.ss-background{opacity:.25;z-index:-1;position:absolute;top:0;bottom:0;width:100%;display:block;background-size:cover;background-position:center center;right:0;left:0;height:calc(100vh - 300px);flex-grow:1}.unavailable-starter-sites{background-color:#fff;border:1px solid #ccc;padding:50px 30px;text-align:center;align-items:center;justify-content:center}.unavailable-starter-sites h1{line-height:1.6}.content-wrap.is-onboarding{position:fixed;top:0;bottom:0;right:0;left:0;background-color:#f1f1f1;z-index:100000;overflow:auto}.content-wrap.is-onboarding h2{display:block}.content-wrap.is-onboarding h2 img{display:none}.content-wrap.is-onboarding .content{background-color:#fefefe;padding-top:30px}.content-wrap.is-onboarding .ob{display:flex;min-height:100vh;flex-direction:column}.content-wrap.is-onboarding .ob-migration{text-align:center}.content-wrap.is-onboarding .ob-migration h2{line-height:1}.content-wrap.is-onboarding .ob-head button{margin:0 !important}.content-wrap.is-onboarding .ob-head{margin:0 0 20px;display:flex;justify-content:flex-end;align-items:flex-end}.content-wrap.is-onboarding .ob-head button.close-onboarding{color:#676767}.content-wrap.is-onboarding .ob-head button.close-onboarding svg{width:30px;height:30px}.ob{width:100%}.ob-sites{display:flex;flex-direction:row;flex-wrap:wrap}.no-results{display:flex;flex-direction:column;align-items:center;justify-content:center;margin:30px 0}.no-results p{font-size:16px}.no-results p span{color:#0073AA;font-weight:600}.no-results .tags{margin-top:10px;justify-content:center;display:flex;flex-wrap:wrap}.no-results .tags .tag{margin:10px 20px;line-height:normal;height:auto;font-weight:600;padding:10px 15px;color:#fff;transition:all .3s ease}.no-results .tags .tag:hover{background-color:#0071a7}.pro-badge{background-color:#6EB77A;height:auto;color:#fff;font-weight:600;text-transform:uppercase;padding:5px 10px;margin-right:auto;border-radius:999px;line-height:normal;display:flex;align-items:center}.pro-badge svg{margin-left:3px}.ob-migration{margin-bottom:20px}.ob-migration .card.starter-site-card{margin-left:auto !important;margin-right:auto !important}.ob-migration .card.starter-site-card .image{height:auto}.ob-migration .actions{margin:30px auto 0;display:flex;justify-content:center}.ob-migration button:last-child{margin-right:10px}.ob-head>h2,.ob-migration>h2{font-size:21px;color:#282828;margin:0;line-height:1.6;display:flex;align-items:center}.ob-head>h2>img,.ob-migration>h2>img{margin-left:20px}.ob-head>p,.ob-migration>p{margin:20px 0;font-size:15px;color:#282828}.ob-head>button,.ob-migration>button{margin-bottom:20px}.header-form{margin-top:20px;display:flex;align-items:center;flex-direction:column}.header-form input{margin:0;display:block;flex-grow:1;border:1px solid #e1e1e1;height:52px;padding:5px 50px 5px 30px;font-size:17px;font-weight:300}.search{position:relative;display:flex;width:100%;flex-wrap:wrap}.search input{width:auto;flex-shrink:1}.search img{opacity:.4;position:absolute;top:10px;right:10px}.search .ob-dropdown{width:100%;height:52px;margin:20px 0 0}.search .ob-dropdown button{position:relative;right:-1px;height:100%;display:flex;align-items:center;font-weight:600;padding:5px 10px 5px 20px;background:#fff;border:1px solid #e1e1e1;font-size:14px;margin:0}.search .ob-dropdown button>svg,.search .ob-dropdown button .dashicon{margin-right:auto;display:flex;align-items:center}.search .ob-dropdown .options{margin:0}.search .ob-dropdown .options li{margin:0}.search .ob-dropdown .options a{height:35px;font-size:14px;display:flex;align-items:center;font-weight:600;color:#282828;cursor:pointer;padding:5px 10px;text-decoration:none}.search .ob-dropdown .options a .count{color:#a3a3a3}.search .ob-dropdown .options a:hover{color:#fff;background-color:#0073AA}.search .ob-dropdown .options a:hover .count{color:#fff}.search .ob-dropdown .options a .count{margin-right:auto}.editor-tabs{display:none;margin:30px 0;position:relative}.editor-tabs:after{content:"";position:absolute;display:block;width:100%;right:0;border-bottom:1px solid #e0e0e0;height:1px;z-index:-1;left:0;bottom:0}.editor-tabs .long-name{display:none}.editor-tabs a{padding:15px 0px 12px 10px;display:flex;align-items:center;font-weight:700;text-decoration:none;font-size:15px;border-bottom:3px solid transparent;position:relative;width:auto}.editor-tabs a:last-child{padding-left:0}.editor-tabs a:not(:first-child){margin-right:auto}.editor-tabs a.active{border-bottom:3px solid #0073AA}.editor-tabs a .pro-badge{margin-right:auto;font-size:11px}.editor-tabs .editor{color:#616161}.editor-tabs .count{color:rgba(97,97,97,0.5);margin:0 10px}.editor-tabs .icon-wrap{display:none;margin-left:10px;width:34px;height:34px;border-radius:100%;overflow:hidden}.editor-tabs .icon-wrap img{max-width:100%;display:block}@media (min-width: 1600px){.editor-tabs .long-name{display:inline}}.ob-dropdown.editor-selector{overflow:visible;display:inline-block;position:relative;width:100%}.ob-dropdown.editor-selector button{display:flex;align-items:center;font-weight:600;padding:5px 10px 5px 20px;background:#fff;border:1px solid #e1e1e1;font-size:14px;height:52px;width:100%}.ob-dropdown.editor-selector button .count{color:#a3a3a3;margin:0 auto 0 20px}.ob-dropdown.editor-selector img{border-radius:100%;margin-left:5px;max-width:30px;max-height:30px}.ob-dropdown.editor-selector .options{margin:0}.ob-dropdown.editor-selector .options li{border-bottom:1px solid #e1e1e1;padding:0;margin:0}.ob-dropdown.editor-selector .options a{height:35px;font-size:14px;display:flex;align-items:center;font-weight:600;color:#282828;cursor:pointer;padding:5px 10px;text-decoration:none}.ob-dropdown.editor-selector .options a:hover{background-color:#0073AA;color:#fff}.card{width:100%;display:flex;max-width:unset;min-width:unset;border:1px solid #e1e1e1;flex-direction:column;padding:30px 40px;align-self:flex-start;flex-grow:0}.card .card-header{flex-direction:row;display:flex;align-items:center}.card .card-header .title{font-size:18px;line-height:1.5}.card .card-header .icon{margin-left:10px}.card .card-header .icon.dashicon{width:33px;height:33px;fill:#0073AA}.card .card-content{display:flex;flex-direction:column;flex-grow:1}.card .card-content a,.card .card-content button{align-self:flex-start;margin-top:auto}.card p{font-size:15px;color:#616161}.card .card-description{margin:15px 0 25px}.card.starter-site-card{padding:0;max-width:100%}.card.starter-site-card:hover .actions,.card.starter-site-card:hover .fav,.card.starter-site-card:focus-within .actions,.card.starter-site-card:focus-within .fav{opacity:1}.card.starter-site-card .actions.visible{opacity:1}.card.starter-site-card .top{position:relative;overflow:hidden}.card.starter-site-card .fav{position:absolute;z-index:2000;right:-15px;top:-30px;opacity:0;transition:.3s ease}.card.starter-site-card .fav button{padding:30px 30px 30px 5px;height:auto;transform:rotate(-45deg);background-color:#4268CF}.card.starter-site-card .fav svg{transform:rotate(45deg);fill:#fff;max-width:15px}.card.starter-site-card .actions{background-color:rgba(0,0,0,0.75);right:0;left:0;bottom:0;top:0;display:flex;align-items:center;justify-content:center;position:absolute;opacity:0;transition:.3s ease}.card.starter-site-card .actions button{background-color:#0073AA;color:#fff;font-weight:600;line-height:normal;height:auto;padding:8px 15px;transition:all .3s ease}.card.starter-site-card .actions button:hover{box-shadow:none;background-color:#005177}.card.starter-site-card .actions button.preview{background-color:#6BC2DD}.card.starter-site-card .actions button.preview:hover{background-color:#42b1d3}.card.starter-site-card .actions button:last-child{margin-right:10px}.card.starter-site-card .image{height:335px;background-size:cover;background-position:top center;background-color:rgba(100,109,130,0.25)}.card.starter-site-card img{width:100%;display:block}.card.starter-site-card .bottom{display:flex;align-items:center;padding:15px 30px 15px 10px;border-top:1px solid #e1e1e1}.card.starter-site-card .bottom p{font-size:16px;font-weight:700;color:#282828;margin:0}.ob-preview{background-color:#fff;position:fixed;top:0;bottom:0;right:0;left:0;z-index:100000;height:100vh;margin:0;display:flex;flex-direction:column}.ob-preview .loading{bottom:0;top:0;right:0;left:0;position:absolute;display:flex;align-items:center;justify-content:center;z-index:100000;color:#646D82}.ob-preview .loading svg{-webkit-animation-name:spin;animation-name:spin;-webkit-animation-duration:2000ms;animation-duration:2000ms;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-timing-function:linear;animation-timing-function:linear}.ob-preview .preview{display:flex;flex-direction:column;position:relative;flex-grow:1}.ob-preview .preview iframe{flex-grow:1;position:relative;z-index:100001;height:100%;width:100%}.ob-preview .bottom-bar{border-top:1px solid #e1e1e1;display:flex;padding:15px 30px;align-items:center}.ob-preview .bottom-bar .actions{margin-right:auto}.ob-import-modal .stepper li{display:flex;align-items:center;margin-bottom:25px;font-size:15px}.ob-import-modal .stepper li .icon{margin-left:20px;background-color:#0073AA;color:#fff;padding:5px;border-radius:100%}.ob-import-modal .stepper li .icon.success{background-color:#6EB77A}.ob-import-modal .stepper li .icon.success svg{left:1px;position:relative}.ob-import-modal .stepper li .icon.warning{background-color:#ffb900}.ob-import-modal .stepper li .icon.error{background-color:#EC7C7C}.ob-import-modal .stepper li .icon.skip{background-color:#e1e1e1}.ob-import-modal .stepper li .icon.loading .dashicon,.ob-import-modal .stepper li .icon.loading svg{-webkit-animation-name:spin;animation-name:spin;-webkit-animation-duration:2000ms;animation-duration:2000ms;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-timing-function:linear;animation-timing-function:linear}.ob-import-modal .stepper li svg{width:20px;height:20px;display:block}@-webkit-keyframes loading-placeholder{0%{opacity:.1}50%{opacity:.2}100%{opacity:.1}}@keyframes loading-placeholder{0%{opacity:.1}50%{opacity:.2}100%{opacity:.1}}@-webkit-keyframes loading-placeholder-high-opacity{0%{opacity:.7}50%{opacity:.9}100%{opacity:.7}}@keyframes loading-placeholder-high-opacity{0%{opacity:.7}50%{opacity:.9}100%{opacity:.7}}.ob-import-modal .stepper li{display:flex;align-items:center;margin-bottom:25px;font-size:15px}.ob-import-modal .stepper li .icon{margin-left:20px;background-color:#0073AA;color:#fff;padding:5px;border-radius:100%}.ob-import-modal .stepper li .icon.success{background-color:#6EB77A}.ob-import-modal .stepper li .icon.success svg{left:1px;position:relative}.ob-import-modal .stepper li .icon.warning{background-color:#ffb900}.ob-import-modal .stepper li .icon.error{background-color:#EC7C7C}.ob-import-modal .stepper li .icon.skip{background-color:#e1e1e1}.ob-import-modal .stepper li .icon.loading .dashicon,.ob-import-modal .stepper li .icon.loading svg{-webkit-animation-name:spin;animation-name:spin;-webkit-animation-duration:2000ms;animation-duration:2000ms;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-timing-function:linear;animation-timing-function:linear}.ob-import-modal .stepper li svg{width:20px;height:20px;display:block}.migration .modal-body .loading{display:flex;flex-direction:column;align-items:center;justify-content:center;margin:30px auto;width:auto;color:#fff}.migration .modal-body .loading h3{margin:20px 0 0}.migration .modal-body .loading svg{padding:10px;background-color:#ffb900;border-radius:100%;-webkit-animation-name:spin;animation-name:spin;-webkit-animation-duration:2000ms;animation-duration:2000ms;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-timing-function:linear;animation-timing-function:linear}.ob-import-modal{background-color:#fff;box-shadow:0 0 10px rgba(0,0,0,0.5)}.ob-import-modal .components-tooltip{display:none}.ob-import-modal .modal-body h3{margin:0;display:flex;align-items:center}.ob-import-modal .modal-body h3 svg{margin-left:5px}.ob-import-modal .well{margin:0;padding:10px;border:1px solid;border-radius:3px;color:#282828;border-color:#6BC2DD;background-color:#dbf0f7}.ob-import-modal .well ol{padding:0;margin:20px 20px 0 0}.ob-import-modal .well ol li{margin-bottom:10px}.ob-import-modal .well ol li:last-child{margin-bottom:0}.ob-import-modal .well ul{margin:20px 0 0;padding:0}.ob-import-modal .well ul li{margin-bottom:10px}.ob-import-modal .well.error{border-color:#EC7C7C;background-color:#fdf4f4}.ob-import-modal .well.warning{border-color:#ffb900;background-color:#ffdf8a}.ob-import-modal hr{margin:25px 0;border:none;border-top:1px solid #e1e1e1;height:0}.ob-import-modal .options ul{margin:10px 0 0 0}.ob-import-modal .options li{padding:15px 0 0;display:flex;align-items:center;margin-bottom:0;font-size:15px;color:#282828}.ob-import-modal .options li:not(:last-child){padding-bottom:15px;border-bottom:1px solid rgba(225,225,225,0.5)}.ob-import-modal .options li svg{margin-left:15px;opacity:.5}.ob-import-modal .options li svg.active{opacity:1;color:#0073AA}.ob-import-modal .options .toggle-wrapper{margin-right:auto}.ob-import-modal .options .toggle-wrapper span{margin-left:0}.ob-import-modal .options .toggle-wrapper div{margin-bottom:0}.ob-import-modal .import-result{font-size:15px}.ob-import-modal .modal-footer{margin-top:25px;display:flex;align-items:center}.ob-import-modal .modal-footer .close{padding:0}.ob-import-modal .modal-footer button:not(.close),.ob-import-modal .modal-footer a{margin-right:auto;padding:5px 25px}.ob-import-modal .modal-footer button:not(.close):last-child,.ob-import-modal .modal-footer a:last-child{margin-right:25px}.ob-import-modal .modal-footer button:not(.close):last-child:only-child,.ob-import-modal .modal-footer a:last-child:only-child{margin-right:auto}.ob-import-modal.fetching{pointer-events:none}.ob-import-modal.fetching .title{width:200px;display:block}.ob-import-modal.fetching .is-loading{border-radius:3px;-webkit-animation:1.5s loading-placeholder ease-in-out infinite;animation:1.5s loading-placeholder ease-in-out infinite;background-color:#282828;height:20px}.ob-import-modal.fetching .well{-webkit-animation:1.5s loading-placeholder-high-opacity ease-in-out infinite;animation:1.5s loading-placeholder-high-opacity ease-in-out infinite;opacity:1;height:inherit !important;background-color:inherit !important}.ob-import-modal.fetching .well h3 span{width:100px}.ob-import-modal.fetching .well ol{list-style:square}.ob-import-modal.fetching .well li{border-radius:3px;width:75%;height:18px;margin-top:0;background-color:#282828;-webkit-animation:1.5s loading-placeholder ease-in-out infinite;animation:1.5s loading-placeholder ease-in-out infinite}.ob-import-modal.fetching .well li:nth-child(2){width:85%}.ob-import-modal.fetching .well li:nth-child(3){width:95%}.ob-import-modal.fetching .mock-icon{width:20px;height:20px;margin-left:5px}.ob-import-modal.fetching .options h3{max-width:100px}.ob-import-modal.fetching .options li .mock-icon{background-color:#0073AA;margin-left:15px}.ob-import-modal.fetching .options li span{width:100px}.ob-import-modal.fetching .options li .toggle{width:40px;background-color:#0073AA;border-radius:50px;margin-right:auto}.ob-import-modal.fetching .modal-footer button{width:90px;height:35px;background-color:#646D82;border:none !important}.ob-import-modal.fetching .modal-footer button.is-primary{background-color:#0073AA}.sticky-nav{position:fixed;z-index:1000;right:0;left:0;top:0;background:#f1f1f1;padding:15px 0;box-shadow:0px 4px 20px rgba(0,0,0,0.15)}@media (min-width: 601px){.sticky-nav{margin-top:46px}}@media (min-width: 783px){.sticky-nav{margin-top:32px;right:160px}.auto-fold .sticky-nav{right:32px}}@media (min-width: 961px){.sticky-nav{right:160px !important}.folded .sticky-nav{right:32px !important}}.sticky-nav-content{display:flex}.sticky-nav-content>img{display:none;margin-left:20px}@media (min-width: 992px){.sticky-nav-content>img{display:block}}.sticky-nav-content .header-form{margin:0;flex-grow:1;max-width:60%}@media (min-width: 660px){.sticky-nav-content .header-form{max-width:100%}}.sticky-nav-content .ob-dropdown.editor-selector.small{width:auto;margin-right:15px;display:flex;align-items:center}.sticky-nav-content .ob-dropdown.editor-selector.small>button>.count{margin-right:12px}.sticky-nav-content button,.sticky-nav-content input{border-radius:6px}.sticky-nav-content input{max-width:100%;font-weight:500}.sticky-nav-content input::-moz-placeholder{color:#b7b7b7}.sticky-nav-content input:-ms-input-placeholder{color:#b7b7b7}.sticky-nav-content input::placeholder{color:#b7b7b7}@media (min-width: 660px){.card.starter-site-card{max-width:49%}.card.starter-site-card:not(:nth-child(2n)){margin-left:2%}.ob-head>h2,.ob-migration>h2{font-size:30px}.ob-head>p,.ob-migration>p{font-size:22px}.header-form{flex-direction:row}}@media (min-width: 992px){.container{padding:0 20px}.content{display:flex}.main{flex-grow:1}.col{display:flex;flex-direction:column}.card.starter-site-card{max-width:32%;margin:0 0 30px}.card.starter-site-card:not(:nth-child(2n)){margin-left:0}.card.starter-site-card:not(:nth-child(3n)){margin-left:2%}.content-wrap.is-onboarding .content{box-shadow:0 0 10px -5px rgba(0,0,0,0.5);padding:35px 40px 35px;border:1px solid #e1e1e1;margin:40px auto 30px}.content-wrap.is-onboarding .header-form{margin-top:0}.ob-sites{margin-top:30px}.ob-head{margin-top:50px}.editor-tabs{display:flex}.ob-body .ob-dropdown.editor-selector{display:none}.header-form{margin-top:50px}.search{display:flex}.search input{border-bottom-left-radius:0;border-top-left-radius:0}.search img{top:50%;transform:translateY(-50%)}.search .ob-dropdown{display:inline-block;width:200px;margin:0}.search .ob-dropdown button{margin:0;border-top-right-radius:0;border-bottom-right-radius:0}}@media (min-width: 1200px){.container{margin:0 auto}.col{width:50%}.col:not(:last-child){margin-left:20px}.main{flex-grow:1}.content{display:flex;padding-top:30px}.columns{display:flex;flex-direction:row}.editor-tabs .icon-wrap{display:block}}@media (min-width: 1400px){.container{padding:0 50px;max-width:1300px}.col:not(:last-child){margin-left:30px}.card{padding:30px 40px;margin:0 0 30px}.editor-tabs a{width:auto;padding:15px 5px 12px 20px}}
|
2 |
|
1 |
+
#wpcontent{padding-right:0 !important}.content-container{padding:0 20px;flex-basis:100%;max-width:1300px;margin:0 auto}#wpbody-content>.error,#wpbody-content>.info,#wpbody-content>.notice{display:none !important}.ob-overflow-off{overflow:hidden !important}@media screen and (min-width: 660px){.ob-import-modal{width:630px !important}}@media screen and (min-width: 992px){.ob-import-modal{width:700px !important}}.container{padding:0 15px}.container.content{padding:0}svg.is-loading,button.is-loading svg{-webkit-animation-name:spin;animation-name:spin;-webkit-animation-duration:2000ms;animation-duration:2000ms;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-timing-function:linear;animation-timing-function:linear;margin-left:0}.col{width:100%}@-webkit-keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(-360deg)}}@keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(-360deg)}}.columns.starter-sites{position:relative;display:flex;flex-grow:1}.ss-background{opacity:.25;z-index:-1;position:absolute;top:0;bottom:0;width:100%;display:block;background-size:cover;background-position:center center;right:0;left:0;height:calc(100vh - 300px);flex-grow:1}.unavailable-starter-sites{background-color:#fff;border:1px solid #ccc;padding:50px 30px;text-align:center;align-items:center;justify-content:center}.unavailable-starter-sites h1{line-height:1.6}.content-wrap.is-onboarding{position:fixed;top:0;bottom:0;right:0;left:0;background-color:#f1f1f1;z-index:100000;overflow:auto}.content-wrap.is-onboarding h2{display:block}.content-wrap.is-onboarding h2 img{display:none}.content-wrap.is-onboarding .content{background-color:#fefefe;padding-top:30px}.content-wrap.is-onboarding .ob{display:flex;min-height:100vh;flex-direction:column}.content-wrap.is-onboarding .ob-migration{padding-top:0;text-align:center}.content-wrap.is-onboarding .ob-migration h2{line-height:1}.content-wrap.is-onboarding .ob-head button{margin:0 !important}.content-wrap.is-onboarding .ob-head{padding:20px 0 0;margin:0 0 20px;display:flex;justify-content:flex-end;align-items:flex-end}.content-wrap.is-onboarding .ob-head button.close-onboarding{color:#676767}.content-wrap.is-onboarding .ob-head button.close-onboarding svg{width:30px;height:30px}.content-wrap.is-onboarding .content-container{padding:0}.ob{width:100%;display:flex;flex-direction:column;align-items:center}.ob .ob-head{box-sizing:border-box;padding:20px;background:#ffffff;width:100%;display:flex;justify-content:center}.ob .ob-head .header-container{display:flex;flex-basis:100%;max-width:1300px}.ob .ob-head .header-container h2{flex-basis:40%}.ob .ob-head .header-container .header-nav{flex-basis:60%;display:flex;justify-content:flex-end;align-items:center}.ob .ob-head .header-container .header-nav .components-button{font-size:18px;font-weight:600;color:#282828;margin-right:25px}.ob .ob-head .header-container .header-nav .components-button:hover{box-shadow:none}.ob .ob-head .header-container .header-nav .components-button:first-child{margin-right:0}.ob .ob-head .header-container .header-nav .components-button.is-pressed{color:#0073AA;background:transparent}.ob .ob-body{width:100%;box-sizing:border-box}.ob .ob-body .instructions{font-size:22px;margin:20px 0;color:#282828}.ob-logo{width:50px;margin-left:20px}.ob-sites{margin-top:30px}.ob-sites.is-grid{display:-ms-grid;display:grid;-ms-grid-columns:1fr;grid-template-columns:1fr;grid-column-gap:20px;grid-row-gap:20px}.no-results{display:flex;flex-direction:column;align-items:center;justify-content:center;margin:30px 0}.no-results p{font-size:16px}.no-results p span{color:#0073AA;font-weight:600}.no-results .tags{margin-top:10px;justify-content:center;display:flex;flex-wrap:wrap}.no-results .tags .tag{margin:10px 20px;line-height:normal;height:auto;font-weight:600;padding:10px 15px;color:#fff;transition:all .3s ease}.no-results .tags .tag:hover{background-color:#0071a7}.pro-badge{background-color:#6EB77A;height:auto;color:#fff;font-weight:600;text-transform:uppercase;padding:5px 10px;margin-right:auto;border-radius:999px;line-height:normal;display:flex;align-items:center}.pro-badge svg{margin-left:3px}.ob-migration{padding-top:20px;margin-bottom:20px}.ob-migration .card.starter-site-card{margin-left:auto !important;margin-right:auto !important}.ob-migration .card.starter-site-card .image{height:auto}.ob-migration .actions{margin:30px auto 0;display:flex;justify-content:center}.ob-migration button:last-child{margin-right:10px}.ob-head>.header-container>h2,.ob-migration>h2{font-size:21px;color:#282828;margin:0;line-height:1.6;display:flex;align-items:center}.ob-head>.header-container>h2>img,.ob-migration>h2>img{margin-left:20px}.ob-head>.header-container>p,.ob-migration>p{margin:20px 0;font-size:15px;color:#282828}.ob-head>.header-container>button,.ob-migration>button{margin-bottom:20px}.header-form{margin-top:20px;display:flex;align-items:center;flex-direction:column}.header-form input{margin:0;display:block;flex-grow:1;border:1px solid #e1e1e1;height:52px;padding:5px 50px 5px 30px;font-size:17px;font-weight:300}.is-sync{background-color:#f1f1f1;color:#0073aa !important;border-radius:6px}.is-sync:before{padding:10px 15px 10px 5px;content:attr(data-content);margin-left:5px;font-size:15px;display:none}.is-sync:hover:before{display:block}.search{position:relative;display:flex;width:100%;flex-wrap:wrap}.search input{width:auto;flex-shrink:1}.search img{opacity:.4;position:absolute;top:10px;right:10px}.search .ob-dropdown{width:100%;height:52px;margin:20px 0 0}.search .ob-dropdown button{position:relative;right:-1px;height:100%;display:flex;align-items:center;font-weight:600;padding:5px 10px 5px 20px;background:#fff;border:1px solid #e1e1e1;font-size:14px;margin:0}.search .ob-dropdown button>svg,.search .ob-dropdown button .dashicon{margin-right:auto;display:flex;align-items:center}.search .ob-dropdown .options{margin:0}.search .ob-dropdown .options li{margin:0}.search .ob-dropdown .options a{height:35px;font-size:14px;display:flex;align-items:center;font-weight:600;color:#282828;cursor:pointer;padding:5px 10px;text-decoration:none}.search .ob-dropdown .options a .count{color:#a3a3a3}.search .ob-dropdown .options a:hover{color:#fff;background-color:#0073AA}.search .ob-dropdown .options a:hover .count{color:#fff}.search .ob-dropdown .options a .count{margin-right:auto}.editor-tabs{display:none;margin:30px 0;position:relative}.editor-tabs:after{content:"";position:absolute;display:block;width:100%;right:0;border-bottom:1px solid #e0e0e0;height:1px;z-index:-1;left:0;bottom:0}.editor-tabs .long-name{display:none}.editor-tabs a{padding:15px 0px 12px 10px;display:flex;align-items:center;font-weight:700;text-decoration:none;font-size:15px;border-bottom:3px solid transparent;position:relative;width:auto}.editor-tabs a:last-child{padding-left:0}.editor-tabs a:not(:first-child){margin-right:auto}.editor-tabs a.active{border-bottom:3px solid #0073AA}.editor-tabs a .pro-badge{margin-right:auto;font-size:11px}.editor-tabs .editor{color:#616161}.editor-tabs .count{color:rgba(97,97,97,0.5);margin:0 10px}.editor-tabs .icon-wrap{display:none;margin-left:10px;width:34px;height:34px;border-radius:100%;overflow:hidden}.editor-tabs .icon-wrap img{max-width:100%;display:block}@media (min-width: 1600px){.editor-tabs .long-name{display:inline}}.ob-dropdown.editor-selector{overflow:visible;display:inline-block;position:relative;width:100%}.ob-dropdown.editor-selector button{display:flex;align-items:center;font-weight:600;padding:5px 10px 5px 20px;background:#fff;border:1px solid #e1e1e1;font-size:14px;height:52px;width:100%}.ob-dropdown.editor-selector button .count{color:#a3a3a3;margin:0 auto 0 20px}.ob-dropdown.editor-selector img{border-radius:100%;margin-left:5px;max-width:30px;max-height:30px}.ob-dropdown.editor-selector .options{margin:0}.ob-dropdown.editor-selector .options li{border-bottom:1px solid #e1e1e1;padding:0;margin:0}.ob-dropdown.editor-selector .options a{height:35px;font-size:14px;display:flex;align-items:center;font-weight:600;color:#282828;cursor:pointer;padding:5px 10px;text-decoration:none}.ob-dropdown.editor-selector .options a:hover{background-color:#0073AA;color:#fff}.card{width:100%;display:flex;max-width:unset;min-width:unset;border:1px solid #e1e1e1;flex-direction:column;padding:30px 40px;margin:0;align-self:flex-start;flex-grow:0}.card .card-header{flex-direction:row;display:flex;align-items:center}.card .card-header .title{font-size:18px;line-height:1.5}.card .card-header .icon{margin-left:10px}.card .card-header .icon.dashicon{width:33px;height:33px;fill:#0073AA}.card .card-content{display:flex;flex-direction:column;flex-grow:1}.card .card-content a,.card .card-content button{align-self:flex-start;margin-top:auto}.card p{font-size:15px;color:#616161}.card .card-description{margin:15px 0 25px}.card.starter-site-card{padding:0;max-width:100%}.card.starter-site-card:hover .actions,.card.starter-site-card:hover .fav,.card.starter-site-card:focus-within .actions,.card.starter-site-card:focus-within .fav{opacity:1}.card.starter-site-card .actions.visible{opacity:1}.card.starter-site-card .top{position:relative;overflow:hidden}.card.starter-site-card .fav{position:absolute;z-index:2000;right:-15px;top:-30px;opacity:0;transition:.3s ease}.card.starter-site-card .fav button{padding:30px 30px 30px 5px;height:auto;transform:rotate(-45deg);background-color:#4268CF}.card.starter-site-card .fav svg{transform:rotate(45deg);fill:#fff;max-width:15px}.card.starter-site-card .actions{background-color:rgba(0,0,0,0.75);right:0;left:0;bottom:0;top:0;display:flex;align-items:center;justify-content:center;flex-direction:column;position:absolute;opacity:0;transition:.3s ease}.card.starter-site-card .actions .templates{color:#fff}.card.starter-site-card .actions .components-button{margin:5px 0;width:100px;height:40px;font-weight:600;justify-content:center}.card.starter-site-card .actions .components-button.is-secondary{color:#fff;border:2px solid #fff}.card.starter-site-card .image{height:335px;background-size:cover;background-repeat:no-repeat;background-position:top center;background-color:rgba(100,109,130,0.25)}.card.starter-site-card img{width:100%;display:block}.card.starter-site-card .bottom{display:flex;align-items:center;padding:15px 30px 15px 10px;border-top:1px solid #e1e1e1}.card.starter-site-card .bottom p{font-size:16px;font-weight:700;color:#282828;margin:0}.card.starter-site-card.has-templates:after{position:absolute;width:93%;background-color:#FFFFFF;display:block;height:10px;content:'';margin:0 auto;bottom:-7px;right:50%;transform:translateX(50%);z-index:-1;border:1px solid #D9D9D9}.ob-preview{background-color:#fff;position:fixed;top:0;bottom:0;right:0;left:0;z-index:100000;height:100vh;margin:0;display:flex;flex-direction:column}.ob-preview .loading{bottom:0;top:0;right:0;left:0;position:absolute;display:flex;align-items:center;justify-content:center;z-index:100000;color:#646D82}.ob-preview .loading svg{-webkit-animation-name:spin;animation-name:spin;-webkit-animation-duration:2000ms;animation-duration:2000ms;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-timing-function:linear;animation-timing-function:linear}.ob-preview .preview{display:flex;flex-direction:column;position:relative;flex-grow:1}.ob-preview .preview iframe{flex-grow:1;position:relative;z-index:100001;height:100%;width:100%}.ob-preview .bottom-bar{border-top:1px solid #e1e1e1;display:flex;padding:15px 30px;align-items:center}.ob-preview .bottom-bar .actions{margin-right:auto}.ob-preview .bottom-bar .heading{margin:0 20px 0 0}.ob-import-modal .stepper li{display:flex;align-items:center;margin-bottom:25px;font-size:15px}.ob-import-modal .stepper li .icon{margin-left:20px;background-color:#0073AA;color:#fff;padding:5px;border-radius:100%}.ob-import-modal .stepper li .icon.success{background-color:#6EB77A}.ob-import-modal .stepper li .icon.success svg{left:1px;position:relative}.ob-import-modal .stepper li .icon.warning{background-color:#ffb900}.ob-import-modal .stepper li .icon.error{background-color:#EC7C7C}.ob-import-modal .stepper li .icon.skip{background-color:#e1e1e1}.ob-import-modal .stepper li .icon.loading .dashicon,.ob-import-modal .stepper li .icon.loading svg{-webkit-animation-name:spin;animation-name:spin;-webkit-animation-duration:2000ms;animation-duration:2000ms;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-timing-function:linear;animation-timing-function:linear}.ob-import-modal .stepper li svg{width:20px;height:20px;display:block}@-webkit-keyframes loading-placeholder{0%{opacity:.1}50%{opacity:.2}100%{opacity:.1}}@keyframes loading-placeholder{0%{opacity:.1}50%{opacity:.2}100%{opacity:.1}}@-webkit-keyframes loading-placeholder-high-opacity{0%{opacity:.7}50%{opacity:.9}100%{opacity:.7}}@keyframes loading-placeholder-high-opacity{0%{opacity:.7}50%{opacity:.9}100%{opacity:.7}}.ob-import-modal .stepper li{display:flex;align-items:center;margin-bottom:25px;font-size:15px}.ob-import-modal .stepper li .icon{margin-left:20px;background-color:#0073AA;color:#fff;padding:5px;border-radius:100%}.ob-import-modal .stepper li .icon.success{background-color:#6EB77A}.ob-import-modal .stepper li .icon.success svg{left:1px;position:relative}.ob-import-modal .stepper li .icon.warning{background-color:#ffb900}.ob-import-modal .stepper li .icon.error{background-color:#EC7C7C}.ob-import-modal .stepper li .icon.skip{background-color:#e1e1e1}.ob-import-modal .stepper li .icon.loading .dashicon,.ob-import-modal .stepper li .icon.loading svg{-webkit-animation-name:spin;animation-name:spin;-webkit-animation-duration:2000ms;animation-duration:2000ms;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-timing-function:linear;animation-timing-function:linear}.ob-import-modal .stepper li svg{width:20px;height:20px;display:block}.migration .modal-body .loading{display:flex;flex-direction:column;align-items:center;justify-content:center;margin:30px auto;width:auto;color:#fff}.migration .modal-body .loading h3{margin:20px 0 0}.migration .modal-body .loading svg{padding:10px;background-color:#ffb900;border-radius:100%;-webkit-animation-name:spin;animation-name:spin;-webkit-animation-duration:2000ms;animation-duration:2000ms;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-timing-function:linear;animation-timing-function:linear}.ob-import-modal{background-color:#fff;box-shadow:0 0 10px rgba(0,0,0,0.5)}.ob-import-modal .components-modal__content{padding:0 30px 40px}.ob-import-modal .components-modal__header{border:none;margin-bottom:10px !important}.ob-import-modal .header{margin-bottom:15px}.ob-import-modal .header h1{margin-top:0;font-size:25px;font-weight:700;color:#000;line-height:normal;margin-bottom:10px}.ob-import-modal .header p.description{font-size:20px;line-height:34px;color:#000}.ob-import-modal .components-tooltip{display:none}.ob-import-modal .modal-body h3{margin:0;display:flex;align-items:center}.ob-import-modal .modal-body h3 svg{margin-left:5px}.ob-import-modal .well{margin:0;padding:20px 10px;border-radius:6px;color:#616161;background-color:rgba(249,215,128,0.24)}.ob-import-modal .well ol{padding:0;margin:20px 20px 0 0}.ob-import-modal .well ol li{margin-bottom:10px;font-size:15px}.ob-import-modal .well ol li:last-child{margin-bottom:0}.ob-import-modal .well ul{margin:0 20px 0 0;padding:0;list-style:disc}.ob-import-modal .well ul li{font-size:15px;margin-bottom:10px;font-weight:400}.ob-import-modal .well ul li:last-child{margin-bottom:0}.ob-import-modal .well.error{background-color:#fdf4f4}.ob-import-modal .well.warning{background-color:#ffdf8a}.ob-import-modal hr{margin:25px 0;border:none;border-top:1px solid #e1e1e1;height:0}.ob-import-modal .import-result{font-size:15px}.ob-import-modal .modal-footer{margin-top:25px;display:flex;align-items:center}.ob-import-modal .modal-footer .import{padding:10px 30px;margin-right:auto;font-weight:600;font-size:14px;height:auto;border-radius:4px}.ob-import-modal .modal-footer button:last-child,.ob-import-modal .modal-footer a:last-child{margin-right:auto}.ob-import-modal .modal-footer button:last-child:only-child,.ob-import-modal .modal-footer a:last-child:only-child{margin-right:auto}.ob-import-modal.fetching .title{width:200px;display:block}.ob-import-modal.fetching .is-loading{border-radius:3px;-webkit-animation:1.5s loading-placeholder ease-in-out infinite;animation:1.5s loading-placeholder ease-in-out infinite;background-color:#282828;height:20px}.ob-import-modal.fetching .is-loading.button{background-color:#007cba;height:39px}.ob-import-modal.fetching .is-loading.link{width:100px;background-color:#007cba}.ob-import-modal.fetching .well{-webkit-animation:1.5s loading-placeholder-high-opacity ease-in-out infinite;animation:1.5s loading-placeholder-high-opacity ease-in-out infinite;height:inherit !important;background-color:inherit !important}.ob-import-modal.fetching .well h3 span{width:100px}.ob-import-modal.fetching .well ol{list-style:square}.ob-import-modal.fetching .well li{border-radius:3px;width:75%;height:18px;margin-top:0;background-color:#282828;-webkit-animation:1.5s loading-placeholder ease-in-out infinite;animation:1.5s loading-placeholder ease-in-out infinite}.ob-import-modal.fetching .well li:nth-child(2){width:85%}.ob-import-modal.fetching .well li:nth-child(3){width:95%}.ob-import-modal.fetching .mock-icon{width:20px;height:20px;margin-left:5px}.ob-import-modal.fetching .options h3{max-width:100px}.ob-import-modal.fetching .options li .mock-icon{background-color:#0073AA;margin-left:15px}.ob-import-modal.fetching .options li span{width:100px}.ob-import-modal.fetching .options li .toggle{width:40px;background-color:#0073AA;border-radius:50px;margin-right:auto}.ob-import-modal.fetching .modal-footer button{width:90px;height:35px;background-color:#646D82;border:none !important}.ob-import-modal.fetching .modal-footer button.is-primary{background-color:#0073AA}.modal-toggles{margin-top:10px;border:none}.modal-toggles .options{border:none;padding:10px}.modal-toggles .options .components-panel__body-title{margin:-10px -10px 0 -10px !important}.modal-toggles .options button{font-size:19px;font-weight:700;line-height:30px}.modal-toggles .options button svg{width:30px;height:30px}.modal-toggles .option-row{justify-content:flex-start;border-bottom:1px solid rgba(40,40,40,0.1);margin:0;padding:10px 0;display:flex;align-items:center}.modal-toggles .option-row span{font-size:15px;margin-right:20px;color:#282828}.modal-toggles .option-row .actions{margin-right:auto}.modal-toggles .option-row .dashicon{margin-right:10px;fill:#d9d9d9}.modal-toggles .option-row .dashicon.active{fill:#0073AA}.modal-toggles .option-row .toggle-wrapper{margin-right:auto}.modal-toggles .option-row .toggle-wrapper .components-form-toggle{margin:0}.import-done-actions{display:flex;align-items:center;width:100%}.import-done-actions .components-button.is-secondary{margin-right:auto;border:2px solid;padding:8px 20px;font-weight:600;font-size:14px;height:auto;border-radius:4px}.import-done-actions .import{margin-right:20px !important}.sticky-nav{transition:top .3s ease;position:fixed;z-index:1000;right:0;left:0;top:0;background:#f1f1f1;padding:15px 0;box-shadow:0px 4px 20px rgba(0,0,0,0.15)}@media (min-width: 601px){.sticky-nav{margin-top:46px}}@media (min-width: 783px){.sticky-nav{margin-top:32px;right:160px}.auto-fold .sticky-nav{right:32px}}@media (min-width: 961px){.sticky-nav{right:160px !important}.folded .sticky-nav{right:32px !important}}.sticky-nav-content{display:flex;max-width:1300px}.sticky-nav-content>img,.sticky-nav-content>.ob-logo{display:none;margin-left:20px}@media (min-width: 992px){.sticky-nav-content>img,.sticky-nav-content>.ob-logo{display:block}}.sticky-nav-content .header-form{margin:0;flex-grow:1}@media (min-width: 660px){.sticky-nav-content .header-form{max-width:100%}}.sticky-nav-content .ob-dropdown.editor-selector.small{width:auto;margin-right:15px;display:flex;align-items:center}.sticky-nav-content .ob-dropdown.editor-selector.small>button>.count{margin-right:12px}.sticky-nav-content button,.sticky-nav-content input{border-radius:6px}.sticky-nav-content input{max-width:100%;font-weight:500}.sticky-nav-content input::-moz-placeholder{color:#b7b7b7}.sticky-nav-content input:-ms-input-placeholder{color:#b7b7b7}.sticky-nav-content input::placeholder{color:#b7b7b7}.table .table-row{display:flex;height:60px;align-items:center;padding:0 25px;background:#fff;border:1px solid rgba(0,0,0,0.11);border-top:none}.table .table-row:first-child{border-top:1px solid rgba(0,0,0,0.11)}.table .table-row svg{height:24px;margin-left:10px;fill:#b9b9b9}.table .table-row .title{display:flex;align-items:center}.table .table-row .title .components-base-control__field{margin:0}.table .table-row .controls{margin-right:auto;display:flex;align-items:center}.table .table-row .controls button{padding:6px 30px;font-weight:600;color:#b9b9b9}.table .table-row .actions{display:flex;margin-right:50px;justify-content:flex-end}.table .table-row .actions.no-controls{margin-right:auto}.table .table-row .actions .components-button{padding:6px 30px}.table .table-row .actions .components-button.is-primary{margin-right:10px}.filters{display:flex;align-items:center;margin-bottom:40px}.filters .components-base-control,.filters input{width:100%}.filters .components-base-control .components-base-control__field,.filters input .components-base-control__field{margin-bottom:0}.filters .components-base-control input,.filters input input{border-radius:6px}.filters .display-filters{display:flex;margin-right:20px}.filters .display-filters button.is-pressed,.filters .display-filters button:active,.filters .display-filters button:focus,.filters .display-filters button:hover{background-color:transparent !important;color:#0073AA}.filters .header-form{width:100%}.cloud-items .components-spinner{margin:0 auto !important;display:block;margin-top:50% !important}.cloud-items.is-grid .table{display:-ms-grid;display:grid;-ms-grid-columns:1fr;grid-template-columns:1fr;grid-column-gap:20px;grid-row-gap:20px}.table-grid{border:1px solid #ccc;min-height:350px;display:flex;flex-direction:column}.table-grid .grid-preview{display:flex;width:100%;height:300px;background-color:#b7c0cc;background-position:top center;background-size:cover}.table-grid .grid-preview:hover{background-color:#404040}.table-grid .grid-preview.is-loading{background:#404040}.table-grid .grid-preview.is-loading .preview-actions{display:flex}.table-grid .grid-preview .preview-actions{opacity:0;transition:.3s ease opacity;width:100%;height:auto;flex-direction:column;justify-content:center;align-items:center;background-color:rgba(0,0,0,0.9);display:flex}.table-grid .grid-preview .preview-actions>.components-button{width:120px;justify-content:center;margin-bottom:10px}.table-grid .grid-preview .preview-actions>.components-button.is-secondary{color:#ffffff;box-shadow:inset 0 0 0 2px #ffffff}.table-grid .grid-preview .preview-actions>.components-button.is-secondary:disabled{background:transparent;opacity:0.5}.table-grid .grid-preview .preview-actions .preview-controls .components-button{width:20px}.table-grid .grid-preview .preview-actions .preview-controls .components-button svg{fill:#ffffff}.table-grid .grid-preview:hover .preview-actions{opacity:1}.table-grid .card-footer{background:#ffffff;border-top:1px solid #ccc;padding:15px;flex-grow:1}.table-grid .card-footer form{display:flex;align-items:center}.table-grid .card-footer .components-base-control{flex-grow:1}.table-grid .card-footer .components-base-control__field{margin-bottom:0}.table-grid .card-footer button{height:auto;margin-right:auto}.table-grid .card-footer p{font-weight:600;margin:0}.pagination{padding-top:20px}.pagination .components-button{margin-left:10px;border-radius:2px;box-shadow:none}.pagination .components-button:focus{box-shadow:inset 0 0 0 1px #fff, 0 0 0 1.5px #007cba}.pagination .components-button:not(.is-primary){background:#ffffff}.pagination .components-button:not(.is-primary):focus{box-shadow:0 0 0 1.5px #007cba}.single-templates-wrapper .components-spinner{display:block;margin:0 auto}.single-templates-wrapper .top{padding:25px 0 30px}.single-templates-wrapper .header{display:flex;flex-direction:column}.single-templates-wrapper .header h1{display:flex;align-items:center;font-size:26px;font-weight:700}.single-templates-wrapper .header .actions{margin-top:15px}.single-templates-wrapper .header .actions .components-button{font-weight:600;font-size:14px;height:auto;border-radius:4px}.single-templates-wrapper .header .actions .components-button:not(:first-child){margin-right:20px}.single-templates-wrapper .header .actions .components-button.is-primary{padding:10px 30px}.single-templates-wrapper .header .actions .components-button.is-secondary{border:2px solid;padding:8px 20px}.single-templates-wrapper .header .description{font-size:16px;color:#282828}.single-templates-wrapper .header .pro-badge{font-size:11px;margin-right:20px}.ob-preview.single-templates .actions .components-button{font-weight:600;font-size:14px;height:auto;border-radius:4px}.ob-preview.single-templates .actions .components-button:not(:first-child){margin-right:20px}.ob-preview.single-templates .actions .components-button.is-primary{padding:10px 30px}.ob-preview.single-templates .actions .components-button.is-secondary{border:2px solid;padding:8px 20px}@media (min-width: 660px){.ob-sites.is-grid{-ms-grid-columns:1fr 1fr;grid-template-columns:1fr 1fr}.ob-head>.header-container>h2,.ob-migration>h2{font-size:30px}.ob-head>.header-container>p,.ob-migration>p{font-size:22px}.header-form{flex-direction:row}.ob-head>.header-container>h2,.ob-migration>h2{font-size:30px}.ob-head>.header-container>p,.ob-migration>p{font-size:22px}.header-form{flex-direction:row}.cloud-items.is-grid .table{-ms-grid-columns:1fr 1fr;grid-template-columns:1fr 1fr}}@media (min-width: 992px){.container{padding:0 20px}.content{display:flex}.main{flex-grow:1}.col{display:flex;flex-direction:column}.content-wrap.is-onboarding .content{max-width:1300px;padding:15px 40px 35px;box-shadow:0 0 10px -5px rgba(0,0,0,0.5);border:1px solid #e1e1e1;margin:40px auto 30px}.content-wrap.is-onboarding .header-form{margin-top:0}.ob-sites.is-grid{-ms-grid-columns:1fr 1fr 1fr;grid-template-columns:1fr 1fr 1fr}.editor-tabs{display:flex}.ob-body .ob-dropdown.editor-selector{display:none}.header-form{margin-top:25px}.search{display:flex}.search input{border-bottom-left-radius:0;border-top-left-radius:0}.search img{top:50%;transform:translateY(-50%)}.search .ob-dropdown{display:inline-block;width:200px;margin:0}.search .ob-dropdown button{margin:0;border-top-right-radius:0;border-bottom-right-radius:0}.cloud-items.is-grid .table{-ms-grid-columns:1fr 1fr 1fr;grid-template-columns:1fr 1fr 1fr}.single-templates-wrapper .header{flex-direction:row;align-items:flex-start}.single-templates-wrapper .header h1{font-size:30px}.single-templates-wrapper .description{font-size:20px}.single-templates-wrapper .actions{margin-right:auto}}@media (min-width: 1200px){.container{margin:0 auto}.col{width:50%}.col:not(:last-child){margin-left:20px}.main{flex-grow:1}.content{display:flex;padding-top:30px}.columns{display:flex;flex-direction:row}.editor-tabs .icon-wrap{display:block}.cloud-items.is-grid .table{-ms-grid-columns:1fr 1fr 1fr 1fr;grid-template-columns:1fr 1fr 1fr 1fr}.single-templates-wrapper .actions{margin-right:auto}}@media (min-width: 1400px){.col:not(:last-child){margin-left:30px}.card{padding:30px 40px}.editor-tabs a{width:auto;padding:15px 5px 12px 20px}}
|
2 |
|
assets/build/style-app.css
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
-
#wpcontent{padding-left:0 !important}#wpbody-content>.error,#wpbody-content>.info,#wpbody-content>.notice{display:none !important}.ob-overflow-off{overflow:hidden !important}@media screen and (min-width: 660px){.ob-import-modal{width:630px !important}}.container{padding:0 15px}.container.content{padding-top:20px;position:relative}svg.is-loading,button.is-loading svg{-webkit-animation-name:spin;animation-name:spin;-webkit-animation-duration:2000ms;animation-duration:2000ms;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-timing-function:linear;animation-timing-function:linear;margin-right:0}.col{width:100%}@-webkit-keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}@keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}.columns.starter-sites{position:relative;display:flex;flex-grow:1}.ss-background{opacity:.25;z-index:-1;position:absolute;top:0;bottom:0;width:100%;display:block;background-size:cover;background-position:center center;left:0;right:0;height:calc(100vh - 300px);flex-grow:1}.unavailable-starter-sites{background-color:#fff;border:1px solid #ccc;padding:50px 30px;text-align:center;align-items:center;justify-content:center}.unavailable-starter-sites h1{line-height:1.6}.content-wrap.is-onboarding{position:fixed;top:0;bottom:0;left:0;right:0;background-color:#f1f1f1;z-index:100000;overflow:auto}.content-wrap.is-onboarding h2{display:block}.content-wrap.is-onboarding h2 img{display:none}.content-wrap.is-onboarding .content{background-color:#fefefe;padding-top:30px}.content-wrap.is-onboarding .ob{display:flex;min-height:100vh;flex-direction:column}.content-wrap.is-onboarding .ob-migration{text-align:center}.content-wrap.is-onboarding .ob-migration h2{line-height:1}.content-wrap.is-onboarding .ob-head button{margin:0 !important}.content-wrap.is-onboarding .ob-head{margin:0 0 20px;display:flex;justify-content:flex-end;align-items:flex-end}.content-wrap.is-onboarding .ob-head button.close-onboarding{color:#676767}.content-wrap.is-onboarding .ob-head button.close-onboarding svg{width:30px;height:30px}.ob{width:100%}.ob-sites{display:flex;flex-direction:row;flex-wrap:wrap}.no-results{display:flex;flex-direction:column;align-items:center;justify-content:center;margin:30px 0}.no-results p{font-size:16px}.no-results p span{color:#0073AA;font-weight:600}.no-results .tags{margin-top:10px;justify-content:center;display:flex;flex-wrap:wrap}.no-results .tags .tag{margin:10px 20px;line-height:normal;height:auto;font-weight:600;padding:10px 15px;color:#fff;transition:all .3s ease}.no-results .tags .tag:hover{background-color:#0071a7}.pro-badge{background-color:#6EB77A;height:auto;color:#fff;font-weight:600;text-transform:uppercase;padding:5px 10px;margin-left:auto;border-radius:999px;line-height:normal;display:flex;align-items:center}.pro-badge svg{margin-right:3px}.ob-migration{margin-bottom:20px}.ob-migration .card.starter-site-card{margin-right:auto !important;margin-left:auto !important}.ob-migration .card.starter-site-card .image{height:auto}.ob-migration .actions{margin:30px auto 0;display:flex;justify-content:center}.ob-migration button:last-child{margin-left:10px}.ob-head>h2,.ob-migration>h2{font-size:21px;color:#282828;margin:0;line-height:1.6;display:flex;align-items:center}.ob-head>h2>img,.ob-migration>h2>img{margin-right:20px}.ob-head>p,.ob-migration>p{margin:20px 0;font-size:15px;color:#282828}.ob-head>button,.ob-migration>button{margin-bottom:20px}.header-form{margin-top:20px;display:flex;align-items:center;flex-direction:column}.header-form input{margin:0;display:block;flex-grow:1;border:1px solid #e1e1e1;height:52px;padding:5px 30px 5px 50px;font-size:17px;font-weight:300}.search{position:relative;display:flex;width:100%;flex-wrap:wrap}.search input{width:auto;flex-shrink:1}.search img{opacity:.4;position:absolute;top:10px;left:10px}.search .ob-dropdown{width:100%;height:52px;margin:20px 0 0}.search .ob-dropdown button{position:relative;left:-1px;height:100%;display:flex;align-items:center;font-weight:600;padding:5px 20px 5px 10px;background:#fff;border:1px solid #e1e1e1;font-size:14px;margin:0}.search .ob-dropdown button>svg,.search .ob-dropdown button .dashicon{margin-left:auto;display:flex;align-items:center}.search .ob-dropdown .options{margin:0}.search .ob-dropdown .options li{margin:0}.search .ob-dropdown .options a{height:35px;font-size:14px;display:flex;align-items:center;font-weight:600;color:#282828;cursor:pointer;padding:5px 10px;text-decoration:none}.search .ob-dropdown .options a .count{color:#a3a3a3}.search .ob-dropdown .options a:hover{color:#fff;background-color:#0073AA}.search .ob-dropdown .options a:hover .count{color:#fff}.search .ob-dropdown .options a .count{margin-left:auto}.editor-tabs{display:none;margin:30px 0;position:relative}.editor-tabs:after{content:"";position:absolute;display:block;width:100%;left:0;border-bottom:1px solid #e0e0e0;height:1px;z-index:-1;right:0;bottom:0}.editor-tabs .long-name{display:none}.editor-tabs a{padding:15px 10px 12px 0px;display:flex;align-items:center;font-weight:700;text-decoration:none;font-size:15px;border-bottom:3px solid transparent;position:relative;width:auto}.editor-tabs a:last-child{padding-right:0}.editor-tabs a:not(:first-child){margin-left:auto}.editor-tabs a.active{border-bottom:3px solid #0073AA}.editor-tabs a .pro-badge{margin-left:auto;font-size:11px}.editor-tabs .editor{color:#616161}.editor-tabs .count{color:rgba(97,97,97,0.5);margin:0 10px}.editor-tabs .icon-wrap{display:none;margin-right:10px;width:34px;height:34px;border-radius:100%;overflow:hidden}.editor-tabs .icon-wrap img{max-width:100%;display:block}@media (min-width: 1600px){.editor-tabs .long-name{display:inline}}.ob-dropdown.editor-selector{overflow:visible;display:inline-block;position:relative;width:100%}.ob-dropdown.editor-selector button{display:flex;align-items:center;font-weight:600;padding:5px 20px 5px 10px;background:#fff;border:1px solid #e1e1e1;font-size:14px;height:52px;width:100%}.ob-dropdown.editor-selector button .count{color:#a3a3a3;margin:0 20px 0 auto}.ob-dropdown.editor-selector img{border-radius:100%;margin-right:5px;max-width:30px;max-height:30px}.ob-dropdown.editor-selector .options{margin:0}.ob-dropdown.editor-selector .options li{border-bottom:1px solid #e1e1e1;padding:0;margin:0}.ob-dropdown.editor-selector .options a{height:35px;font-size:14px;display:flex;align-items:center;font-weight:600;color:#282828;cursor:pointer;padding:5px 10px;text-decoration:none}.ob-dropdown.editor-selector .options a:hover{background-color:#0073AA;color:#fff}.card{width:100%;display:flex;max-width:unset;min-width:unset;border:1px solid #e1e1e1;flex-direction:column;padding:30px 40px;align-self:flex-start;flex-grow:0}.card .card-header{flex-direction:row;display:flex;align-items:center}.card .card-header .title{font-size:18px;line-height:1.5}.card .card-header .icon{margin-right:10px}.card .card-header .icon.dashicon{width:33px;height:33px;fill:#0073AA}.card .card-content{display:flex;flex-direction:column;flex-grow:1}.card .card-content a,.card .card-content button{align-self:flex-start;margin-top:auto}.card p{font-size:15px;color:#616161}.card .card-description{margin:15px 0 25px}.card.starter-site-card{padding:0;max-width:100%}.card.starter-site-card:hover .actions,.card.starter-site-card:hover .fav,.card.starter-site-card:focus-within .actions,.card.starter-site-card:focus-within .fav{opacity:1}.card.starter-site-card .actions.visible{opacity:1}.card.starter-site-card .top{position:relative;overflow:hidden}.card.starter-site-card .fav{position:absolute;z-index:2000;left:-15px;top:-30px;opacity:0;transition:.3s ease}.card.starter-site-card .fav button{padding:30px 5px 30px 30px;height:auto;transform:rotate(45deg);background-color:#4268CF}.card.starter-site-card .fav svg{transform:rotate(-45deg);fill:#fff;max-width:15px}.card.starter-site-card .actions{background-color:rgba(0,0,0,0.75);left:0;right:0;bottom:0;top:0;display:flex;align-items:center;justify-content:center;position:absolute;opacity:0;transition:.3s ease}.card.starter-site-card .actions button{background-color:#0073AA;color:#fff;font-weight:600;line-height:normal;height:auto;padding:8px 15px;transition:all .3s ease}.card.starter-site-card .actions button:hover{box-shadow:none;background-color:#005177}.card.starter-site-card .actions button.preview{background-color:#6BC2DD}.card.starter-site-card .actions button.preview:hover{background-color:#42b1d3}.card.starter-site-card .actions button:last-child{margin-left:10px}.card.starter-site-card .image{height:335px;background-size:cover;background-position:top center;background-color:rgba(100,109,130,0.25)}.card.starter-site-card img{width:100%;display:block}.card.starter-site-card .bottom{display:flex;align-items:center;padding:15px 10px 15px 30px;border-top:1px solid #e1e1e1}.card.starter-site-card .bottom p{font-size:16px;font-weight:700;color:#282828;margin:0}.ob-preview{background-color:#fff;position:fixed;top:0;bottom:0;left:0;right:0;z-index:100000;height:100vh;margin:0;display:flex;flex-direction:column}.ob-preview .loading{bottom:0;top:0;left:0;right:0;position:absolute;display:flex;align-items:center;justify-content:center;z-index:100000;color:#646D82}.ob-preview .loading svg{-webkit-animation-name:spin;animation-name:spin;-webkit-animation-duration:2000ms;animation-duration:2000ms;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-timing-function:linear;animation-timing-function:linear}.ob-preview .preview{display:flex;flex-direction:column;position:relative;flex-grow:1}.ob-preview .preview iframe{flex-grow:1;position:relative;z-index:100001;height:100%;width:100%}.ob-preview .bottom-bar{border-top:1px solid #e1e1e1;display:flex;padding:15px 30px;align-items:center}.ob-preview .bottom-bar .actions{margin-left:auto}.ob-import-modal .stepper li{display:flex;align-items:center;margin-bottom:25px;font-size:15px}.ob-import-modal .stepper li .icon{margin-right:20px;background-color:#0073AA;color:#fff;padding:5px;border-radius:100%}.ob-import-modal .stepper li .icon.success{background-color:#6EB77A}.ob-import-modal .stepper li .icon.success svg{right:1px;position:relative}.ob-import-modal .stepper li .icon.warning{background-color:#ffb900}.ob-import-modal .stepper li .icon.error{background-color:#EC7C7C}.ob-import-modal .stepper li .icon.skip{background-color:#e1e1e1}.ob-import-modal .stepper li .icon.loading .dashicon,.ob-import-modal .stepper li .icon.loading svg{-webkit-animation-name:spin;animation-name:spin;-webkit-animation-duration:2000ms;animation-duration:2000ms;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-timing-function:linear;animation-timing-function:linear}.ob-import-modal .stepper li svg{width:20px;height:20px;display:block}@-webkit-keyframes loading-placeholder{0%{opacity:.1}50%{opacity:.2}100%{opacity:.1}}@keyframes loading-placeholder{0%{opacity:.1}50%{opacity:.2}100%{opacity:.1}}@-webkit-keyframes loading-placeholder-high-opacity{0%{opacity:.7}50%{opacity:.9}100%{opacity:.7}}@keyframes loading-placeholder-high-opacity{0%{opacity:.7}50%{opacity:.9}100%{opacity:.7}}.ob-import-modal .stepper li{display:flex;align-items:center;margin-bottom:25px;font-size:15px}.ob-import-modal .stepper li .icon{margin-right:20px;background-color:#0073AA;color:#fff;padding:5px;border-radius:100%}.ob-import-modal .stepper li .icon.success{background-color:#6EB77A}.ob-import-modal .stepper li .icon.success svg{right:1px;position:relative}.ob-import-modal .stepper li .icon.warning{background-color:#ffb900}.ob-import-modal .stepper li .icon.error{background-color:#EC7C7C}.ob-import-modal .stepper li .icon.skip{background-color:#e1e1e1}.ob-import-modal .stepper li .icon.loading .dashicon,.ob-import-modal .stepper li .icon.loading svg{-webkit-animation-name:spin;animation-name:spin;-webkit-animation-duration:2000ms;animation-duration:2000ms;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-timing-function:linear;animation-timing-function:linear}.ob-import-modal .stepper li svg{width:20px;height:20px;display:block}.migration .modal-body .loading{display:flex;flex-direction:column;align-items:center;justify-content:center;margin:30px auto;width:auto;color:#fff}.migration .modal-body .loading h3{margin:20px 0 0}.migration .modal-body .loading svg{padding:10px;background-color:#ffb900;border-radius:100%;-webkit-animation-name:spin;animation-name:spin;-webkit-animation-duration:2000ms;animation-duration:2000ms;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-timing-function:linear;animation-timing-function:linear}.ob-import-modal{background-color:#fff;box-shadow:0 0 10px rgba(0,0,0,0.5)}.ob-import-modal .components-tooltip{display:none}.ob-import-modal .modal-body h3{margin:0;display:flex;align-items:center}.ob-import-modal .modal-body h3 svg{margin-right:5px}.ob-import-modal .well{margin:0;padding:10px;border:1px solid;border-radius:3px;color:#282828;border-color:#6BC2DD;background-color:#dbf0f7}.ob-import-modal .well ol{padding:0;margin:20px 0 0 20px}.ob-import-modal .well ol li{margin-bottom:10px}.ob-import-modal .well ol li:last-child{margin-bottom:0}.ob-import-modal .well ul{margin:20px 0 0;padding:0}.ob-import-modal .well ul li{margin-bottom:10px}.ob-import-modal .well.error{border-color:#EC7C7C;background-color:#fdf4f4}.ob-import-modal .well.warning{border-color:#ffb900;background-color:#ffdf8a}.ob-import-modal hr{margin:25px 0;border:none;border-top:1px solid #e1e1e1;height:0}.ob-import-modal .options ul{margin:10px 0 0 0}.ob-import-modal .options li{padding:15px 0 0;display:flex;align-items:center;margin-bottom:0;font-size:15px;color:#282828}.ob-import-modal .options li:not(:last-child){padding-bottom:15px;border-bottom:1px solid rgba(225,225,225,0.5)}.ob-import-modal .options li svg{margin-right:15px;opacity:.5}.ob-import-modal .options li svg.active{opacity:1;color:#0073AA}.ob-import-modal .options .toggle-wrapper{margin-left:auto}.ob-import-modal .options .toggle-wrapper span{margin-right:0}.ob-import-modal .options .toggle-wrapper div{margin-bottom:0}.ob-import-modal .import-result{font-size:15px}.ob-import-modal .modal-footer{margin-top:25px;display:flex;align-items:center}.ob-import-modal .modal-footer .close{padding:0}.ob-import-modal .modal-footer button:not(.close),.ob-import-modal .modal-footer a{margin-left:auto;padding:5px 25px}.ob-import-modal .modal-footer button:not(.close):last-child,.ob-import-modal .modal-footer a:last-child{margin-left:25px}.ob-import-modal .modal-footer button:not(.close):last-child:only-child,.ob-import-modal .modal-footer a:last-child:only-child{margin-left:auto}.ob-import-modal.fetching{pointer-events:none}.ob-import-modal.fetching .title{width:200px;display:block}.ob-import-modal.fetching .is-loading{border-radius:3px;-webkit-animation:1.5s loading-placeholder ease-in-out infinite;animation:1.5s loading-placeholder ease-in-out infinite;background-color:#282828;height:20px}.ob-import-modal.fetching .well{-webkit-animation:1.5s loading-placeholder-high-opacity ease-in-out infinite;animation:1.5s loading-placeholder-high-opacity ease-in-out infinite;opacity:1;height:inherit !important;background-color:inherit !important}.ob-import-modal.fetching .well h3 span{width:100px}.ob-import-modal.fetching .well ol{list-style:square}.ob-import-modal.fetching .well li{border-radius:3px;width:75%;height:18px;margin-top:0;background-color:#282828;-webkit-animation:1.5s loading-placeholder ease-in-out infinite;animation:1.5s loading-placeholder ease-in-out infinite}.ob-import-modal.fetching .well li:nth-child(2){width:85%}.ob-import-modal.fetching .well li:nth-child(3){width:95%}.ob-import-modal.fetching .mock-icon{width:20px;height:20px;margin-right:5px}.ob-import-modal.fetching .options h3{max-width:100px}.ob-import-modal.fetching .options li .mock-icon{background-color:#0073AA;margin-right:15px}.ob-import-modal.fetching .options li span{width:100px}.ob-import-modal.fetching .options li .toggle{width:40px;background-color:#0073AA;border-radius:50px;margin-left:auto}.ob-import-modal.fetching .modal-footer button{width:90px;height:35px;background-color:#646D82;border:none !important}.ob-import-modal.fetching .modal-footer button.is-primary{background-color:#0073AA}.sticky-nav{position:fixed;z-index:1000;left:0;right:0;top:0;background:#f1f1f1;padding:15px 0;box-shadow:0px 4px 20px rgba(0,0,0,0.15)}@media (min-width: 601px){.sticky-nav{margin-top:46px}}@media (min-width: 783px){.sticky-nav{margin-top:32px;left:160px}.auto-fold .sticky-nav{left:32px}}@media (min-width: 961px){.sticky-nav{left:160px !important}.folded .sticky-nav{left:32px !important}}.sticky-nav-content{display:flex}.sticky-nav-content>img{display:none;margin-right:20px}@media (min-width: 992px){.sticky-nav-content>img{display:block}}.sticky-nav-content .header-form{margin:0;flex-grow:1;max-width:60%}@media (min-width: 660px){.sticky-nav-content .header-form{max-width:100%}}.sticky-nav-content .ob-dropdown.editor-selector.small{width:auto;margin-left:15px;display:flex;align-items:center}.sticky-nav-content .ob-dropdown.editor-selector.small>button>.count{margin-left:12px}.sticky-nav-content button,.sticky-nav-content input{border-radius:6px}.sticky-nav-content input{max-width:100%;font-weight:500}.sticky-nav-content input::-moz-placeholder{color:#b7b7b7}.sticky-nav-content input:-ms-input-placeholder{color:#b7b7b7}.sticky-nav-content input::placeholder{color:#b7b7b7}@media (min-width: 660px){.card.starter-site-card{max-width:49%}.card.starter-site-card:not(:nth-child(2n)){margin-right:2%}.ob-head>h2,.ob-migration>h2{font-size:30px}.ob-head>p,.ob-migration>p{font-size:22px}.header-form{flex-direction:row}}@media (min-width: 992px){.container{padding:0 20px}.content{display:flex}.main{flex-grow:1}.col{display:flex;flex-direction:column}.card.starter-site-card{max-width:32%;margin:0 0 30px}.card.starter-site-card:not(:nth-child(2n)){margin-right:0}.card.starter-site-card:not(:nth-child(3n)){margin-right:2%}.content-wrap.is-onboarding .content{box-shadow:0 0 10px -5px rgba(0,0,0,0.5);padding:35px 40px 35px;border:1px solid #e1e1e1;margin:40px auto 30px}.content-wrap.is-onboarding .header-form{margin-top:0}.ob-sites{margin-top:30px}.ob-head{margin-top:50px}.editor-tabs{display:flex}.ob-body .ob-dropdown.editor-selector{display:none}.header-form{margin-top:50px}.search{display:flex}.search input{border-bottom-right-radius:0;border-top-right-radius:0}.search img{top:50%;transform:translateY(-50%)}.search .ob-dropdown{display:inline-block;width:200px;margin:0}.search .ob-dropdown button{margin:0;border-top-left-radius:0;border-bottom-left-radius:0}}@media (min-width: 1200px){.container{margin:0 auto}.col{width:50%}.col:not(:last-child){margin-right:20px}.main{flex-grow:1}.content{display:flex;padding-top:30px}.columns{display:flex;flex-direction:row}.editor-tabs .icon-wrap{display:block}}@media (min-width: 1400px){.container{padding:0 50px;max-width:1300px}.col:not(:last-child){margin-right:30px}.card{padding:30px 40px;margin:0 0 30px}.editor-tabs a{width:auto;padding:15px 20px 12px 5px}}
|
2 |
|
1 |
+
#wpcontent{padding-left:0 !important}.content-container{padding:0 20px;flex-basis:100%;max-width:1300px;margin:0 auto}#wpbody-content>.error,#wpbody-content>.info,#wpbody-content>.notice{display:none !important}.ob-overflow-off{overflow:hidden !important}@media screen and (min-width: 660px){.ob-import-modal{width:630px !important}}@media screen and (min-width: 992px){.ob-import-modal{width:700px !important}}.container{padding:0 15px}.container.content{padding:0}svg.is-loading,button.is-loading svg{-webkit-animation-name:spin;animation-name:spin;-webkit-animation-duration:2000ms;animation-duration:2000ms;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-timing-function:linear;animation-timing-function:linear;margin-right:0}.col{width:100%}@-webkit-keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}@keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}.columns.starter-sites{position:relative;display:flex;flex-grow:1}.ss-background{opacity:.25;z-index:-1;position:absolute;top:0;bottom:0;width:100%;display:block;background-size:cover;background-position:center center;left:0;right:0;height:calc(100vh - 300px);flex-grow:1}.unavailable-starter-sites{background-color:#fff;border:1px solid #ccc;padding:50px 30px;text-align:center;align-items:center;justify-content:center}.unavailable-starter-sites h1{line-height:1.6}.content-wrap.is-onboarding{position:fixed;top:0;bottom:0;left:0;right:0;background-color:#f1f1f1;z-index:100000;overflow:auto}.content-wrap.is-onboarding h2{display:block}.content-wrap.is-onboarding h2 img{display:none}.content-wrap.is-onboarding .content{background-color:#fefefe;padding-top:30px}.content-wrap.is-onboarding .ob{display:flex;min-height:100vh;flex-direction:column}.content-wrap.is-onboarding .ob-migration{padding-top:0;text-align:center}.content-wrap.is-onboarding .ob-migration h2{line-height:1}.content-wrap.is-onboarding .ob-head button{margin:0 !important}.content-wrap.is-onboarding .ob-head{padding:20px 0 0;margin:0 0 20px;display:flex;justify-content:flex-end;align-items:flex-end}.content-wrap.is-onboarding .ob-head button.close-onboarding{color:#676767}.content-wrap.is-onboarding .ob-head button.close-onboarding svg{width:30px;height:30px}.content-wrap.is-onboarding .content-container{padding:0}.ob{width:100%;display:flex;flex-direction:column;align-items:center}.ob .ob-head{box-sizing:border-box;padding:20px;background:#ffffff;width:100%;display:flex;justify-content:center}.ob .ob-head .header-container{display:flex;flex-basis:100%;max-width:1300px}.ob .ob-head .header-container h2{flex-basis:40%}.ob .ob-head .header-container .header-nav{flex-basis:60%;display:flex;justify-content:flex-end;align-items:center}.ob .ob-head .header-container .header-nav .components-button{font-size:18px;font-weight:600;color:#282828;margin-left:25px}.ob .ob-head .header-container .header-nav .components-button:hover{box-shadow:none}.ob .ob-head .header-container .header-nav .components-button:first-child{margin-left:0}.ob .ob-head .header-container .header-nav .components-button.is-pressed{color:#0073AA;background:transparent}.ob .ob-body{width:100%;box-sizing:border-box}.ob .ob-body .instructions{font-size:22px;margin:20px 0;color:#282828}.ob-logo{width:50px;margin-right:20px}.ob-sites{margin-top:30px}.ob-sites.is-grid{display:-ms-grid;display:grid;-ms-grid-columns:1fr;grid-template-columns:1fr;grid-column-gap:20px;grid-row-gap:20px}.no-results{display:flex;flex-direction:column;align-items:center;justify-content:center;margin:30px 0}.no-results p{font-size:16px}.no-results p span{color:#0073AA;font-weight:600}.no-results .tags{margin-top:10px;justify-content:center;display:flex;flex-wrap:wrap}.no-results .tags .tag{margin:10px 20px;line-height:normal;height:auto;font-weight:600;padding:10px 15px;color:#fff;transition:all .3s ease}.no-results .tags .tag:hover{background-color:#0071a7}.pro-badge{background-color:#6EB77A;height:auto;color:#fff;font-weight:600;text-transform:uppercase;padding:5px 10px;margin-left:auto;border-radius:999px;line-height:normal;display:flex;align-items:center}.pro-badge svg{margin-right:3px}.ob-migration{padding-top:20px;margin-bottom:20px}.ob-migration .card.starter-site-card{margin-right:auto !important;margin-left:auto !important}.ob-migration .card.starter-site-card .image{height:auto}.ob-migration .actions{margin:30px auto 0;display:flex;justify-content:center}.ob-migration button:last-child{margin-left:10px}.ob-head>.header-container>h2,.ob-migration>h2{font-size:21px;color:#282828;margin:0;line-height:1.6;display:flex;align-items:center}.ob-head>.header-container>h2>img,.ob-migration>h2>img{margin-right:20px}.ob-head>.header-container>p,.ob-migration>p{margin:20px 0;font-size:15px;color:#282828}.ob-head>.header-container>button,.ob-migration>button{margin-bottom:20px}.header-form{margin-top:20px;display:flex;align-items:center;flex-direction:column}.header-form input{margin:0;display:block;flex-grow:1;border:1px solid #e1e1e1;height:52px;padding:5px 30px 5px 50px;font-size:17px;font-weight:300}.is-sync{background-color:#f1f1f1;color:#0073aa !important;border-radius:6px}.is-sync:before{padding:10px 5px 10px 15px;content:attr(data-content);margin-right:5px;font-size:15px;display:none}.is-sync:hover:before{display:block}.search{position:relative;display:flex;width:100%;flex-wrap:wrap}.search input{width:auto;flex-shrink:1}.search img{opacity:.4;position:absolute;top:10px;left:10px}.search .ob-dropdown{width:100%;height:52px;margin:20px 0 0}.search .ob-dropdown button{position:relative;left:-1px;height:100%;display:flex;align-items:center;font-weight:600;padding:5px 20px 5px 10px;background:#fff;border:1px solid #e1e1e1;font-size:14px;margin:0}.search .ob-dropdown button>svg,.search .ob-dropdown button .dashicon{margin-left:auto;display:flex;align-items:center}.search .ob-dropdown .options{margin:0}.search .ob-dropdown .options li{margin:0}.search .ob-dropdown .options a{height:35px;font-size:14px;display:flex;align-items:center;font-weight:600;color:#282828;cursor:pointer;padding:5px 10px;text-decoration:none}.search .ob-dropdown .options a .count{color:#a3a3a3}.search .ob-dropdown .options a:hover{color:#fff;background-color:#0073AA}.search .ob-dropdown .options a:hover .count{color:#fff}.search .ob-dropdown .options a .count{margin-left:auto}.editor-tabs{display:none;margin:30px 0;position:relative}.editor-tabs:after{content:"";position:absolute;display:block;width:100%;left:0;border-bottom:1px solid #e0e0e0;height:1px;z-index:-1;right:0;bottom:0}.editor-tabs .long-name{display:none}.editor-tabs a{padding:15px 10px 12px 0px;display:flex;align-items:center;font-weight:700;text-decoration:none;font-size:15px;border-bottom:3px solid transparent;position:relative;width:auto}.editor-tabs a:last-child{padding-right:0}.editor-tabs a:not(:first-child){margin-left:auto}.editor-tabs a.active{border-bottom:3px solid #0073AA}.editor-tabs a .pro-badge{margin-left:auto;font-size:11px}.editor-tabs .editor{color:#616161}.editor-tabs .count{color:rgba(97,97,97,0.5);margin:0 10px}.editor-tabs .icon-wrap{display:none;margin-right:10px;width:34px;height:34px;border-radius:100%;overflow:hidden}.editor-tabs .icon-wrap img{max-width:100%;display:block}@media (min-width: 1600px){.editor-tabs .long-name{display:inline}}.ob-dropdown.editor-selector{overflow:visible;display:inline-block;position:relative;width:100%}.ob-dropdown.editor-selector button{display:flex;align-items:center;font-weight:600;padding:5px 20px 5px 10px;background:#fff;border:1px solid #e1e1e1;font-size:14px;height:52px;width:100%}.ob-dropdown.editor-selector button .count{color:#a3a3a3;margin:0 20px 0 auto}.ob-dropdown.editor-selector img{border-radius:100%;margin-right:5px;max-width:30px;max-height:30px}.ob-dropdown.editor-selector .options{margin:0}.ob-dropdown.editor-selector .options li{border-bottom:1px solid #e1e1e1;padding:0;margin:0}.ob-dropdown.editor-selector .options a{height:35px;font-size:14px;display:flex;align-items:center;font-weight:600;color:#282828;cursor:pointer;padding:5px 10px;text-decoration:none}.ob-dropdown.editor-selector .options a:hover{background-color:#0073AA;color:#fff}.card{width:100%;display:flex;max-width:unset;min-width:unset;border:1px solid #e1e1e1;flex-direction:column;padding:30px 40px;margin:0;align-self:flex-start;flex-grow:0}.card .card-header{flex-direction:row;display:flex;align-items:center}.card .card-header .title{font-size:18px;line-height:1.5}.card .card-header .icon{margin-right:10px}.card .card-header .icon.dashicon{width:33px;height:33px;fill:#0073AA}.card .card-content{display:flex;flex-direction:column;flex-grow:1}.card .card-content a,.card .card-content button{align-self:flex-start;margin-top:auto}.card p{font-size:15px;color:#616161}.card .card-description{margin:15px 0 25px}.card.starter-site-card{padding:0;max-width:100%}.card.starter-site-card:hover .actions,.card.starter-site-card:hover .fav,.card.starter-site-card:focus-within .actions,.card.starter-site-card:focus-within .fav{opacity:1}.card.starter-site-card .actions.visible{opacity:1}.card.starter-site-card .top{position:relative;overflow:hidden}.card.starter-site-card .fav{position:absolute;z-index:2000;left:-15px;top:-30px;opacity:0;transition:.3s ease}.card.starter-site-card .fav button{padding:30px 5px 30px 30px;height:auto;transform:rotate(45deg);background-color:#4268CF}.card.starter-site-card .fav svg{transform:rotate(-45deg);fill:#fff;max-width:15px}.card.starter-site-card .actions{background-color:rgba(0,0,0,0.75);left:0;right:0;bottom:0;top:0;display:flex;align-items:center;justify-content:center;flex-direction:column;position:absolute;opacity:0;transition:.3s ease}.card.starter-site-card .actions .templates{color:#fff}.card.starter-site-card .actions .components-button{margin:5px 0;width:100px;height:40px;font-weight:600;justify-content:center}.card.starter-site-card .actions .components-button.is-secondary{color:#fff;border:2px solid #fff}.card.starter-site-card .image{height:335px;background-size:cover;background-repeat:no-repeat;background-position:top center;background-color:rgba(100,109,130,0.25)}.card.starter-site-card img{width:100%;display:block}.card.starter-site-card .bottom{display:flex;align-items:center;padding:15px 10px 15px 30px;border-top:1px solid #e1e1e1}.card.starter-site-card .bottom p{font-size:16px;font-weight:700;color:#282828;margin:0}.card.starter-site-card.has-templates:after{position:absolute;width:93%;background-color:#FFFFFF;display:block;height:10px;content:'';margin:0 auto;bottom:-7px;left:50%;transform:translateX(-50%);z-index:-1;border:1px solid #D9D9D9}.ob-preview{background-color:#fff;position:fixed;top:0;bottom:0;left:0;right:0;z-index:100000;height:100vh;margin:0;display:flex;flex-direction:column}.ob-preview .loading{bottom:0;top:0;left:0;right:0;position:absolute;display:flex;align-items:center;justify-content:center;z-index:100000;color:#646D82}.ob-preview .loading svg{-webkit-animation-name:spin;animation-name:spin;-webkit-animation-duration:2000ms;animation-duration:2000ms;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-timing-function:linear;animation-timing-function:linear}.ob-preview .preview{display:flex;flex-direction:column;position:relative;flex-grow:1}.ob-preview .preview iframe{flex-grow:1;position:relative;z-index:100001;height:100%;width:100%}.ob-preview .bottom-bar{border-top:1px solid #e1e1e1;display:flex;padding:15px 30px;align-items:center}.ob-preview .bottom-bar .actions{margin-left:auto}.ob-preview .bottom-bar .heading{margin:0 0 0 20px}.ob-import-modal .stepper li{display:flex;align-items:center;margin-bottom:25px;font-size:15px}.ob-import-modal .stepper li .icon{margin-right:20px;background-color:#0073AA;color:#fff;padding:5px;border-radius:100%}.ob-import-modal .stepper li .icon.success{background-color:#6EB77A}.ob-import-modal .stepper li .icon.success svg{right:1px;position:relative}.ob-import-modal .stepper li .icon.warning{background-color:#ffb900}.ob-import-modal .stepper li .icon.error{background-color:#EC7C7C}.ob-import-modal .stepper li .icon.skip{background-color:#e1e1e1}.ob-import-modal .stepper li .icon.loading .dashicon,.ob-import-modal .stepper li .icon.loading svg{-webkit-animation-name:spin;animation-name:spin;-webkit-animation-duration:2000ms;animation-duration:2000ms;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-timing-function:linear;animation-timing-function:linear}.ob-import-modal .stepper li svg{width:20px;height:20px;display:block}@-webkit-keyframes loading-placeholder{0%{opacity:.1}50%{opacity:.2}100%{opacity:.1}}@keyframes loading-placeholder{0%{opacity:.1}50%{opacity:.2}100%{opacity:.1}}@-webkit-keyframes loading-placeholder-high-opacity{0%{opacity:.7}50%{opacity:.9}100%{opacity:.7}}@keyframes loading-placeholder-high-opacity{0%{opacity:.7}50%{opacity:.9}100%{opacity:.7}}.ob-import-modal .stepper li{display:flex;align-items:center;margin-bottom:25px;font-size:15px}.ob-import-modal .stepper li .icon{margin-right:20px;background-color:#0073AA;color:#fff;padding:5px;border-radius:100%}.ob-import-modal .stepper li .icon.success{background-color:#6EB77A}.ob-import-modal .stepper li .icon.success svg{right:1px;position:relative}.ob-import-modal .stepper li .icon.warning{background-color:#ffb900}.ob-import-modal .stepper li .icon.error{background-color:#EC7C7C}.ob-import-modal .stepper li .icon.skip{background-color:#e1e1e1}.ob-import-modal .stepper li .icon.loading .dashicon,.ob-import-modal .stepper li .icon.loading svg{-webkit-animation-name:spin;animation-name:spin;-webkit-animation-duration:2000ms;animation-duration:2000ms;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-timing-function:linear;animation-timing-function:linear}.ob-import-modal .stepper li svg{width:20px;height:20px;display:block}.migration .modal-body .loading{display:flex;flex-direction:column;align-items:center;justify-content:center;margin:30px auto;width:auto;color:#fff}.migration .modal-body .loading h3{margin:20px 0 0}.migration .modal-body .loading svg{padding:10px;background-color:#ffb900;border-radius:100%;-webkit-animation-name:spin;animation-name:spin;-webkit-animation-duration:2000ms;animation-duration:2000ms;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-timing-function:linear;animation-timing-function:linear}.ob-import-modal{background-color:#fff;box-shadow:0 0 10px rgba(0,0,0,0.5)}.ob-import-modal .components-modal__content{padding:0 30px 40px}.ob-import-modal .components-modal__header{border:none;margin-bottom:10px !important}.ob-import-modal .header{margin-bottom:15px}.ob-import-modal .header h1{margin-top:0;font-size:25px;font-weight:700;color:#000;line-height:normal;margin-bottom:10px}.ob-import-modal .header p.description{font-size:20px;line-height:34px;color:#000}.ob-import-modal .components-tooltip{display:none}.ob-import-modal .modal-body h3{margin:0;display:flex;align-items:center}.ob-import-modal .modal-body h3 svg{margin-right:5px}.ob-import-modal .well{margin:0;padding:20px 10px;border-radius:6px;color:#616161;background-color:rgba(249,215,128,0.24)}.ob-import-modal .well ol{padding:0;margin:20px 0 0 20px}.ob-import-modal .well ol li{margin-bottom:10px;font-size:15px}.ob-import-modal .well ol li:last-child{margin-bottom:0}.ob-import-modal .well ul{margin:0 0 0 20px;padding:0;list-style:disc}.ob-import-modal .well ul li{font-size:15px;margin-bottom:10px;font-weight:400}.ob-import-modal .well ul li:last-child{margin-bottom:0}.ob-import-modal .well.error{background-color:#fdf4f4}.ob-import-modal .well.warning{background-color:#ffdf8a}.ob-import-modal hr{margin:25px 0;border:none;border-top:1px solid #e1e1e1;height:0}.ob-import-modal .import-result{font-size:15px}.ob-import-modal .modal-footer{margin-top:25px;display:flex;align-items:center}.ob-import-modal .modal-footer .import{padding:10px 30px;margin-left:auto;font-weight:600;font-size:14px;height:auto;border-radius:4px}.ob-import-modal .modal-footer button:last-child,.ob-import-modal .modal-footer a:last-child{margin-left:auto}.ob-import-modal .modal-footer button:last-child:only-child,.ob-import-modal .modal-footer a:last-child:only-child{margin-left:auto}.ob-import-modal.fetching .title{width:200px;display:block}.ob-import-modal.fetching .is-loading{border-radius:3px;-webkit-animation:1.5s loading-placeholder ease-in-out infinite;animation:1.5s loading-placeholder ease-in-out infinite;background-color:#282828;height:20px}.ob-import-modal.fetching .is-loading.button{background-color:#007cba;height:39px}.ob-import-modal.fetching .is-loading.link{width:100px;background-color:#007cba}.ob-import-modal.fetching .well{-webkit-animation:1.5s loading-placeholder-high-opacity ease-in-out infinite;animation:1.5s loading-placeholder-high-opacity ease-in-out infinite;height:inherit !important;background-color:inherit !important}.ob-import-modal.fetching .well h3 span{width:100px}.ob-import-modal.fetching .well ol{list-style:square}.ob-import-modal.fetching .well li{border-radius:3px;width:75%;height:18px;margin-top:0;background-color:#282828;-webkit-animation:1.5s loading-placeholder ease-in-out infinite;animation:1.5s loading-placeholder ease-in-out infinite}.ob-import-modal.fetching .well li:nth-child(2){width:85%}.ob-import-modal.fetching .well li:nth-child(3){width:95%}.ob-import-modal.fetching .mock-icon{width:20px;height:20px;margin-right:5px}.ob-import-modal.fetching .options h3{max-width:100px}.ob-import-modal.fetching .options li .mock-icon{background-color:#0073AA;margin-right:15px}.ob-import-modal.fetching .options li span{width:100px}.ob-import-modal.fetching .options li .toggle{width:40px;background-color:#0073AA;border-radius:50px;margin-left:auto}.ob-import-modal.fetching .modal-footer button{width:90px;height:35px;background-color:#646D82;border:none !important}.ob-import-modal.fetching .modal-footer button.is-primary{background-color:#0073AA}.modal-toggles{margin-top:10px;border:none}.modal-toggles .options{border:none;padding:10px}.modal-toggles .options .components-panel__body-title{margin:-10px -10px 0 -10px !important}.modal-toggles .options button{font-size:19px;font-weight:700;line-height:30px}.modal-toggles .options button svg{width:30px;height:30px}.modal-toggles .option-row{justify-content:flex-start;border-bottom:1px solid rgba(40,40,40,0.1);margin:0;padding:10px 0;display:flex;align-items:center}.modal-toggles .option-row span{font-size:15px;margin-left:20px;color:#282828}.modal-toggles .option-row .actions{margin-left:auto}.modal-toggles .option-row .dashicon{margin-left:10px;fill:#d9d9d9}.modal-toggles .option-row .dashicon.active{fill:#0073AA}.modal-toggles .option-row .toggle-wrapper{margin-left:auto}.modal-toggles .option-row .toggle-wrapper .components-form-toggle{margin:0}.import-done-actions{display:flex;align-items:center;width:100%}.import-done-actions .components-button.is-secondary{margin-left:auto;border:2px solid;padding:8px 20px;font-weight:600;font-size:14px;height:auto;border-radius:4px}.import-done-actions .import{margin-left:20px !important}.sticky-nav{transition:top .3s ease;position:fixed;z-index:1000;left:0;right:0;top:0;background:#f1f1f1;padding:15px 0;box-shadow:0px 4px 20px rgba(0,0,0,0.15)}@media (min-width: 601px){.sticky-nav{margin-top:46px}}@media (min-width: 783px){.sticky-nav{margin-top:32px;left:160px}.auto-fold .sticky-nav{left:32px}}@media (min-width: 961px){.sticky-nav{left:160px !important}.folded .sticky-nav{left:32px !important}}.sticky-nav-content{display:flex;max-width:1300px}.sticky-nav-content>img,.sticky-nav-content>.ob-logo{display:none;margin-right:20px}@media (min-width: 992px){.sticky-nav-content>img,.sticky-nav-content>.ob-logo{display:block}}.sticky-nav-content .header-form{margin:0;flex-grow:1}@media (min-width: 660px){.sticky-nav-content .header-form{max-width:100%}}.sticky-nav-content .ob-dropdown.editor-selector.small{width:auto;margin-left:15px;display:flex;align-items:center}.sticky-nav-content .ob-dropdown.editor-selector.small>button>.count{margin-left:12px}.sticky-nav-content button,.sticky-nav-content input{border-radius:6px}.sticky-nav-content input{max-width:100%;font-weight:500}.sticky-nav-content input::-moz-placeholder{color:#b7b7b7}.sticky-nav-content input:-ms-input-placeholder{color:#b7b7b7}.sticky-nav-content input::placeholder{color:#b7b7b7}.table .table-row{display:flex;height:60px;align-items:center;padding:0 25px;background:#fff;border:1px solid rgba(0,0,0,0.11);border-top:none}.table .table-row:first-child{border-top:1px solid rgba(0,0,0,0.11)}.table .table-row svg{height:24px;margin-right:10px;fill:#b9b9b9}.table .table-row .title{display:flex;align-items:center}.table .table-row .title .components-base-control__field{margin:0}.table .table-row .controls{margin-left:auto;display:flex;align-items:center}.table .table-row .controls button{padding:6px 30px;font-weight:600;color:#b9b9b9}.table .table-row .actions{display:flex;margin-left:50px;justify-content:flex-end}.table .table-row .actions.no-controls{margin-left:auto}.table .table-row .actions .components-button{padding:6px 30px}.table .table-row .actions .components-button.is-primary{margin-left:10px}.filters{display:flex;align-items:center;margin-bottom:40px}.filters .components-base-control,.filters input{width:100%}.filters .components-base-control .components-base-control__field,.filters input .components-base-control__field{margin-bottom:0}.filters .components-base-control input,.filters input input{border-radius:6px}.filters .display-filters{display:flex;margin-left:20px}.filters .display-filters button.is-pressed,.filters .display-filters button:active,.filters .display-filters button:focus,.filters .display-filters button:hover{background-color:transparent !important;color:#0073AA}.filters .header-form{width:100%}.cloud-items .components-spinner{margin:0 auto !important;display:block;margin-top:50% !important}.cloud-items.is-grid .table{display:-ms-grid;display:grid;-ms-grid-columns:1fr;grid-template-columns:1fr;grid-column-gap:20px;grid-row-gap:20px}.table-grid{border:1px solid #ccc;min-height:350px;display:flex;flex-direction:column}.table-grid .grid-preview{display:flex;width:100%;height:300px;background-color:#b7c0cc;background-position:top center;background-size:cover}.table-grid .grid-preview:hover{background-color:#404040}.table-grid .grid-preview.is-loading{background:#404040}.table-grid .grid-preview.is-loading .preview-actions{display:flex}.table-grid .grid-preview .preview-actions{opacity:0;transition:.3s ease opacity;width:100%;height:auto;flex-direction:column;justify-content:center;align-items:center;background-color:rgba(0,0,0,0.9);display:flex}.table-grid .grid-preview .preview-actions>.components-button{width:120px;justify-content:center;margin-bottom:10px}.table-grid .grid-preview .preview-actions>.components-button.is-secondary{color:#ffffff;box-shadow:inset 0 0 0 2px #ffffff}.table-grid .grid-preview .preview-actions>.components-button.is-secondary:disabled{background:transparent;opacity:0.5}.table-grid .grid-preview .preview-actions .preview-controls .components-button{width:20px}.table-grid .grid-preview .preview-actions .preview-controls .components-button svg{fill:#ffffff}.table-grid .grid-preview:hover .preview-actions{opacity:1}.table-grid .card-footer{background:#ffffff;border-top:1px solid #ccc;padding:15px;flex-grow:1}.table-grid .card-footer form{display:flex;align-items:center}.table-grid .card-footer .components-base-control{flex-grow:1}.table-grid .card-footer .components-base-control__field{margin-bottom:0}.table-grid .card-footer button{height:auto;margin-left:auto}.table-grid .card-footer p{font-weight:600;margin:0}.pagination{padding-top:20px}.pagination .components-button{margin-right:10px;border-radius:2px;box-shadow:none}.pagination .components-button:focus{box-shadow:inset 0 0 0 1px #fff, 0 0 0 1.5px #007cba}.pagination .components-button:not(.is-primary){background:#ffffff}.pagination .components-button:not(.is-primary):focus{box-shadow:0 0 0 1.5px #007cba}.single-templates-wrapper .components-spinner{display:block;margin:0 auto}.single-templates-wrapper .top{padding:25px 0 30px}.single-templates-wrapper .header{display:flex;flex-direction:column}.single-templates-wrapper .header h1{display:flex;align-items:center;font-size:26px;font-weight:700}.single-templates-wrapper .header .actions{margin-top:15px}.single-templates-wrapper .header .actions .components-button{font-weight:600;font-size:14px;height:auto;border-radius:4px}.single-templates-wrapper .header .actions .components-button:not(:first-child){margin-left:20px}.single-templates-wrapper .header .actions .components-button.is-primary{padding:10px 30px}.single-templates-wrapper .header .actions .components-button.is-secondary{border:2px solid;padding:8px 20px}.single-templates-wrapper .header .description{font-size:16px;color:#282828}.single-templates-wrapper .header .pro-badge{font-size:11px;margin-left:20px}.ob-preview.single-templates .actions .components-button{font-weight:600;font-size:14px;height:auto;border-radius:4px}.ob-preview.single-templates .actions .components-button:not(:first-child){margin-left:20px}.ob-preview.single-templates .actions .components-button.is-primary{padding:10px 30px}.ob-preview.single-templates .actions .components-button.is-secondary{border:2px solid;padding:8px 20px}@media (min-width: 660px){.ob-sites.is-grid{-ms-grid-columns:1fr 1fr;grid-template-columns:1fr 1fr}.ob-head>.header-container>h2,.ob-migration>h2{font-size:30px}.ob-head>.header-container>p,.ob-migration>p{font-size:22px}.header-form{flex-direction:row}.ob-head>.header-container>h2,.ob-migration>h2{font-size:30px}.ob-head>.header-container>p,.ob-migration>p{font-size:22px}.header-form{flex-direction:row}.cloud-items.is-grid .table{-ms-grid-columns:1fr 1fr;grid-template-columns:1fr 1fr}}@media (min-width: 992px){.container{padding:0 20px}.content{display:flex}.main{flex-grow:1}.col{display:flex;flex-direction:column}.content-wrap.is-onboarding .content{max-width:1300px;padding:15px 40px 35px;box-shadow:0 0 10px -5px rgba(0,0,0,0.5);border:1px solid #e1e1e1;margin:40px auto 30px}.content-wrap.is-onboarding .header-form{margin-top:0}.ob-sites.is-grid{-ms-grid-columns:1fr 1fr 1fr;grid-template-columns:1fr 1fr 1fr}.editor-tabs{display:flex}.ob-body .ob-dropdown.editor-selector{display:none}.header-form{margin-top:25px}.search{display:flex}.search input{border-bottom-right-radius:0;border-top-right-radius:0}.search img{top:50%;transform:translateY(-50%)}.search .ob-dropdown{display:inline-block;width:200px;margin:0}.search .ob-dropdown button{margin:0;border-top-left-radius:0;border-bottom-left-radius:0}.cloud-items.is-grid .table{-ms-grid-columns:1fr 1fr 1fr;grid-template-columns:1fr 1fr 1fr}.single-templates-wrapper .header{flex-direction:row;align-items:flex-start}.single-templates-wrapper .header h1{font-size:30px}.single-templates-wrapper .description{font-size:20px}.single-templates-wrapper .actions{margin-left:auto}}@media (min-width: 1200px){.container{margin:0 auto}.col{width:50%}.col:not(:last-child){margin-right:20px}.main{flex-grow:1}.content{display:flex;padding-top:30px}.columns{display:flex;flex-direction:row}.editor-tabs .icon-wrap{display:block}.cloud-items.is-grid .table{-ms-grid-columns:1fr 1fr 1fr 1fr;grid-template-columns:1fr 1fr 1fr 1fr}.single-templates-wrapper .actions{margin-left:auto}}@media (min-width: 1400px){.col:not(:last-child){margin-right:30px}.card{padding:30px 40px}.editor-tabs a{width:auto;padding:15px 20px 12px 5px}}
|
2 |
|
assets/src/Components/CloudLibrary/DemoSiteTemplatesImport.js
ADDED
@@ -0,0 +1,308 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* global tiobDash */
|
2 |
+
import { close, chevronLeft, chevronRight } from '@wordpress/icons';
|
3 |
+
import { Spinner, Button, Icon } from '@wordpress/components';
|
4 |
+
import { withDispatch, withSelect } from '@wordpress/data';
|
5 |
+
import { useEffect, useState } from '@wordpress/element';
|
6 |
+
import { __, isRTL } from '@wordpress/i18n';
|
7 |
+
import { compose } from '@wordpress/compose';
|
8 |
+
|
9 |
+
import { fetchLibrary } from './common';
|
10 |
+
import ListItem from './ListItem';
|
11 |
+
import PreviewFrame from './PreviewFrame';
|
12 |
+
import ImportTemplatesModal from './ImportTemplatesModal';
|
13 |
+
|
14 |
+
const DemoSiteTemplatesImport = ( {
|
15 |
+
slug,
|
16 |
+
cancel,
|
17 |
+
setModal,
|
18 |
+
setInstallModal,
|
19 |
+
themeStatus,
|
20 |
+
site,
|
21 |
+
editor,
|
22 |
+
setTemplateModal,
|
23 |
+
templateModal,
|
24 |
+
} ) => {
|
25 |
+
const [ templates, setTemplates ] = useState( [] );
|
26 |
+
const [ loading, setLoading ] = useState( true );
|
27 |
+
const [ previewUrl, setPreviewUrl ] = useState( '' );
|
28 |
+
const [ toImport, setToImport ] = useState( [] );
|
29 |
+
|
30 |
+
const { title, upsell, utmOutboundLink } = site;
|
31 |
+
|
32 |
+
useEffect( () => {
|
33 |
+
loadTemplates();
|
34 |
+
}, [] );
|
35 |
+
|
36 |
+
const loadTemplates = () => {
|
37 |
+
const params = {
|
38 |
+
per_page: 100,
|
39 |
+
template_site_slug: slug,
|
40 |
+
premade: true,
|
41 |
+
type: editor,
|
42 |
+
};
|
43 |
+
fetchLibrary( true, params ).then( ( r ) => {
|
44 |
+
setTemplates( r.templates || [] );
|
45 |
+
setLoading( false );
|
46 |
+
} );
|
47 |
+
};
|
48 |
+
|
49 |
+
const handlePreview = ( url ) => {
|
50 |
+
setPreviewUrl( url );
|
51 |
+
};
|
52 |
+
|
53 |
+
const handleBulk = ( e ) => {
|
54 |
+
e.preventDefault();
|
55 |
+
|
56 |
+
if ( themeStatus ) {
|
57 |
+
setInstallModal( true );
|
58 |
+
|
59 |
+
return false;
|
60 |
+
}
|
61 |
+
setToImport( templates );
|
62 |
+
setTemplateModal( true );
|
63 |
+
};
|
64 |
+
|
65 |
+
const handleSingleImport = ( item ) => {
|
66 |
+
if ( themeStatus ) {
|
67 |
+
setInstallModal( true );
|
68 |
+
|
69 |
+
return false;
|
70 |
+
}
|
71 |
+
setToImport( [ item ] );
|
72 |
+
|
73 |
+
setTemplateModal( true );
|
74 |
+
};
|
75 |
+
|
76 |
+
const launchImport = ( e ) => {
|
77 |
+
e.preventDefault();
|
78 |
+
|
79 |
+
if ( themeStatus ) {
|
80 |
+
setInstallModal( true );
|
81 |
+
|
82 |
+
return false;
|
83 |
+
}
|
84 |
+
setModal( true );
|
85 |
+
};
|
86 |
+
|
87 |
+
const currentPreviewIndex = templates.findIndex(
|
88 |
+
( item ) => item.link === previewUrl
|
89 |
+
);
|
90 |
+
|
91 |
+
const currentPreviewTemplate = templates.find(
|
92 |
+
( item ) => item.link === previewUrl
|
93 |
+
);
|
94 |
+
|
95 |
+
const handlePrevious = () => {
|
96 |
+
let newIndex = currentPreviewIndex - 1;
|
97 |
+
if ( currentPreviewIndex === 0 ) {
|
98 |
+
newIndex = templates.length - 1;
|
99 |
+
}
|
100 |
+
setPreviewUrl( templates[ newIndex ].link );
|
101 |
+
};
|
102 |
+
|
103 |
+
const handleNext = () => {
|
104 |
+
let newIndex = currentPreviewIndex + 1;
|
105 |
+
if ( currentPreviewIndex === templates.length - 1 ) {
|
106 |
+
newIndex = 0;
|
107 |
+
}
|
108 |
+
setPreviewUrl( templates[ newIndex ].link );
|
109 |
+
};
|
110 |
+
|
111 |
+
const Templates = () => {
|
112 |
+
if ( loading ) {
|
113 |
+
return <Spinner />;
|
114 |
+
}
|
115 |
+
if ( templates.length < 1 ) {
|
116 |
+
return __( 'No templates for this starter site.' );
|
117 |
+
}
|
118 |
+
|
119 |
+
return (
|
120 |
+
<div className="cloud-items is-grid">
|
121 |
+
<div className="table">
|
122 |
+
{ templates.map( ( item ) => (
|
123 |
+
<ListItem
|
124 |
+
upsell={ upsell }
|
125 |
+
onPreview={ handlePreview }
|
126 |
+
userTemplate={ false }
|
127 |
+
key={ item.template_id }
|
128 |
+
item={ item }
|
129 |
+
loadTemplates={ loadTemplates }
|
130 |
+
onImport={ () => handleSingleImport( item ) }
|
131 |
+
grid={ true }
|
132 |
+
/>
|
133 |
+
) ) }
|
134 |
+
</div>
|
135 |
+
</div>
|
136 |
+
);
|
137 |
+
};
|
138 |
+
|
139 |
+
return (
|
140 |
+
<div className="single-templates-wrapper">
|
141 |
+
<div className="top">
|
142 |
+
<div className="breadcrumb">
|
143 |
+
<Button isTertiary onClick={ cancel }>
|
144 |
+
{ __( 'Back to starter sites' ) }
|
145 |
+
</Button>
|
146 |
+
</div>
|
147 |
+
<div className="header">
|
148 |
+
<div className="text">
|
149 |
+
<h1>
|
150 |
+
{ title || '' }
|
151 |
+
{ upsell && (
|
152 |
+
<span className="pro-badge">
|
153 |
+
<Icon icon="lock" />
|
154 |
+
<span>
|
155 |
+
{ __(
|
156 |
+
'Premium',
|
157 |
+
'templates-patterns-collection'
|
158 |
+
) }
|
159 |
+
</span>
|
160 |
+
</span>
|
161 |
+
) }
|
162 |
+
</h1>
|
163 |
+
<p className="description">
|
164 |
+
{ __(
|
165 |
+
'You can import individual pages or bulk-import all of them.'
|
166 |
+
) }
|
167 |
+
</p>
|
168 |
+
</div>
|
169 |
+
|
170 |
+
<div className="actions">
|
171 |
+
{ ! upsell && (
|
172 |
+
<>
|
173 |
+
<Button isSecondary onClick={ launchImport }>
|
174 |
+
{ __( 'Import Starter Site' ) }
|
175 |
+
</Button>
|
176 |
+
<Button
|
177 |
+
isPrimary
|
178 |
+
disabled={ templates.length < 1 }
|
179 |
+
onClick={ handleBulk }
|
180 |
+
>
|
181 |
+
{ __( 'Import All Pages' ) }
|
182 |
+
</Button>
|
183 |
+
</>
|
184 |
+
) }
|
185 |
+
{ upsell && (
|
186 |
+
<Button
|
187 |
+
href={ utmOutboundLink || tiobDash.upgradeURL }
|
188 |
+
isSecondary
|
189 |
+
>
|
190 |
+
{ __( 'Upgrade' ) }
|
191 |
+
</Button>
|
192 |
+
) }
|
193 |
+
</div>
|
194 |
+
</div>
|
195 |
+
</div>
|
196 |
+
<Templates />
|
197 |
+
{ previewUrl && (
|
198 |
+
<PreviewFrame
|
199 |
+
heading={ currentPreviewTemplate.template_name || null }
|
200 |
+
previewUrl={ previewUrl }
|
201 |
+
leftButtons={
|
202 |
+
<>
|
203 |
+
<Button
|
204 |
+
icon={ close }
|
205 |
+
onClick={ () => setPreviewUrl( '' ) }
|
206 |
+
label={ __(
|
207 |
+
'Close',
|
208 |
+
'templates-patterns-collection'
|
209 |
+
) }
|
210 |
+
/>
|
211 |
+
{ templates.length > 1 && (
|
212 |
+
<>
|
213 |
+
<Button
|
214 |
+
icon={
|
215 |
+
isRTL() ? chevronRight : chevronLeft
|
216 |
+
}
|
217 |
+
onClick={ handlePrevious }
|
218 |
+
/>
|
219 |
+
<Button
|
220 |
+
icon={
|
221 |
+
isRTL() ? chevronLeft : chevronRight
|
222 |
+
}
|
223 |
+
onClick={ handleNext }
|
224 |
+
/>
|
225 |
+
</>
|
226 |
+
) }
|
227 |
+
</>
|
228 |
+
}
|
229 |
+
rightButtons={
|
230 |
+
<>
|
231 |
+
{ ! upsell && (
|
232 |
+
<>
|
233 |
+
<Button
|
234 |
+
isSecondary
|
235 |
+
onClick={ launchImport }
|
236 |
+
>
|
237 |
+
{ __( 'Import Starter Site' ) }
|
238 |
+
</Button>
|
239 |
+
<Button
|
240 |
+
isPrimary
|
241 |
+
disabled={ templates.length < 1 }
|
242 |
+
onClick={ () =>
|
243 |
+
handleSingleImport(
|
244 |
+
currentPreviewTemplate
|
245 |
+
)
|
246 |
+
}
|
247 |
+
>
|
248 |
+
{ __( 'Import Page' ) }
|
249 |
+
</Button>
|
250 |
+
</>
|
251 |
+
) }
|
252 |
+
{ upsell && (
|
253 |
+
<Button
|
254 |
+
href={
|
255 |
+
utmOutboundLink || tiobDash.upgradeURL
|
256 |
+
}
|
257 |
+
isSecondary
|
258 |
+
>
|
259 |
+
{ __( 'Upgrade' ) }
|
260 |
+
</Button>
|
261 |
+
) }
|
262 |
+
</>
|
263 |
+
}
|
264 |
+
/>
|
265 |
+
) }
|
266 |
+
{ templateModal && toImport && ! loading && toImport.length > 0 && (
|
267 |
+
<ImportTemplatesModal templatesData={ toImport } />
|
268 |
+
) }
|
269 |
+
</div>
|
270 |
+
);
|
271 |
+
};
|
272 |
+
|
273 |
+
export default compose(
|
274 |
+
withDispatch( ( dispatch ) => {
|
275 |
+
const {
|
276 |
+
setSingleTemplateImport,
|
277 |
+
setImportModalStatus,
|
278 |
+
setInstallModalStatus,
|
279 |
+
setTemplateModal,
|
280 |
+
} = dispatch( 'neve-onboarding' );
|
281 |
+
|
282 |
+
const cancel = () => {
|
283 |
+
setSingleTemplateImport( null );
|
284 |
+
};
|
285 |
+
|
286 |
+
return {
|
287 |
+
cancel,
|
288 |
+
setModal: ( status ) => setImportModalStatus( status ),
|
289 |
+
setInstallModal: ( status ) => setInstallModalStatus( status ),
|
290 |
+
setTemplateModal,
|
291 |
+
};
|
292 |
+
} ),
|
293 |
+
withSelect( ( select ) => {
|
294 |
+
const {
|
295 |
+
getTemplateModal,
|
296 |
+
getThemeAction,
|
297 |
+
getCurrentSite,
|
298 |
+
getCurrentEditor,
|
299 |
+
} = select( 'neve-onboarding' );
|
300 |
+
|
301 |
+
return {
|
302 |
+
templateModal: getTemplateModal(),
|
303 |
+
themeStatus: getThemeAction().action || false,
|
304 |
+
site: getCurrentSite(),
|
305 |
+
editor: getCurrentEditor(),
|
306 |
+
};
|
307 |
+
} )
|
308 |
+
)( DemoSiteTemplatesImport );
|
assets/src/Components/CloudLibrary/Filters.js
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* global tiobDash */
|
2 |
+
import { alignJustify, grid } from '@wordpress/icons';
|
3 |
+
import { __ } from '@wordpress/i18n';
|
4 |
+
import { Button, TextControl } from '@wordpress/components';
|
5 |
+
|
6 |
+
const Filters = ( {
|
7 |
+
isGrid,
|
8 |
+
setGrid,
|
9 |
+
searchQuery,
|
10 |
+
setSearchQuery,
|
11 |
+
onSearch,
|
12 |
+
} ) => {
|
13 |
+
const onSubmit = ( e ) => {
|
14 |
+
e.preventDefault();
|
15 |
+
onSearch();
|
16 |
+
};
|
17 |
+
|
18 |
+
return (
|
19 |
+
<div className="filters">
|
20 |
+
<div className="header-form">
|
21 |
+
<form className="search" onSubmit={ onSubmit }>
|
22 |
+
<img
|
23 |
+
src={ tiobDash.assets + '/img/search.svg' }
|
24 |
+
alt={ __( 'Search Icon' ) }
|
25 |
+
/>
|
26 |
+
<TextControl
|
27 |
+
type="search"
|
28 |
+
value={ searchQuery }
|
29 |
+
onChange={ setSearchQuery }
|
30 |
+
placeholder={ __( 'Search for a template' ) + '…' }
|
31 |
+
/>
|
32 |
+
</form>
|
33 |
+
<div className="display-filters">
|
34 |
+
<Button
|
35 |
+
label={ __( 'List View' ) }
|
36 |
+
icon={ alignJustify }
|
37 |
+
onClick={ () => setGrid( false ) }
|
38 |
+
isPressed={ ! isGrid }
|
39 |
+
/>
|
40 |
+
|
41 |
+
<Button
|
42 |
+
label={ __( 'Grid View' ) }
|
43 |
+
icon={ grid }
|
44 |
+
onClick={ () => setGrid( true ) }
|
45 |
+
isPressed={ isGrid }
|
46 |
+
/>
|
47 |
+
</div>
|
48 |
+
</div>
|
49 |
+
</div>
|
50 |
+
);
|
51 |
+
};
|
52 |
+
|
53 |
+
export default Filters;
|
assets/src/Components/CloudLibrary/ImportTemplatesModal.js
ADDED
@@ -0,0 +1,364 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { withSelect, withDispatch } from '@wordpress/data';
|
2 |
+
import { Modal, Button, Icon } from '@wordpress/components';
|
3 |
+
import { __, sprintf } from '@wordpress/i18n';
|
4 |
+
import { compose } from '@wordpress/compose';
|
5 |
+
import { page as pageIcon } from '@wordpress/icons';
|
6 |
+
import {
|
7 |
+
useEffect,
|
8 |
+
useState,
|
9 |
+
createInterpolateElement,
|
10 |
+
} from '@wordpress/element';
|
11 |
+
|
12 |
+
import { importTemplates } from '../../utils/site-import';
|
13 |
+
import { fetchBulkData, getUserTemplateData } from './common';
|
14 |
+
import classnames from 'classnames';
|
15 |
+
|
16 |
+
const ImportTemplatesModal = ( {
|
17 |
+
templatesData,
|
18 |
+
cancel,
|
19 |
+
siteData,
|
20 |
+
themeStatus,
|
21 |
+
setInstallModal,
|
22 |
+
setModal,
|
23 |
+
editor,
|
24 |
+
isUserTemplate = false,
|
25 |
+
generalTemplates = false,
|
26 |
+
} ) => {
|
27 |
+
const [ fetching, setFetching ] = useState( true );
|
28 |
+
const [ templates, setTemplates ] = useState( [] );
|
29 |
+
const [ importing, setImporting ] = useState( false );
|
30 |
+
const [ imported, setImported ] = useState( [] );
|
31 |
+
const [ error, setError ] = useState( false );
|
32 |
+
|
33 |
+
const isSingle = templatesData.length === 1;
|
34 |
+
|
35 |
+
useEffect( () => {
|
36 |
+
if ( isUserTemplate && isSingle ) {
|
37 |
+
getUserTemplateData( templatesData[ 0 ].template_id ).then(
|
38 |
+
( r ) => {
|
39 |
+
if ( ! r.success ) {
|
40 |
+
if ( r.message ) {
|
41 |
+
setError( r.message );
|
42 |
+
} else {
|
43 |
+
setError( true );
|
44 |
+
}
|
45 |
+
setFetching( false );
|
46 |
+
}
|
47 |
+
setTemplates( r.templates );
|
48 |
+
setFetching( false );
|
49 |
+
}
|
50 |
+
);
|
51 |
+
} else {
|
52 |
+
fetchBulkData( templatesData.map( ( i ) => i.template_id ) ).then(
|
53 |
+
( r ) => {
|
54 |
+
if ( ! r.success ) {
|
55 |
+
if ( r.message ) {
|
56 |
+
setError( r.message );
|
57 |
+
} else {
|
58 |
+
setError( true );
|
59 |
+
}
|
60 |
+
setFetching( false );
|
61 |
+
return false;
|
62 |
+
}
|
63 |
+
setTemplates( r.templates );
|
64 |
+
setFetching( false );
|
65 |
+
}
|
66 |
+
);
|
67 |
+
}
|
68 |
+
}, [ templatesData ] );
|
69 |
+
|
70 |
+
const Mock = () => {
|
71 |
+
return (
|
72 |
+
<>
|
73 |
+
<div className="modal-body">
|
74 |
+
<div className="header">
|
75 |
+
<h1
|
76 |
+
className="is-loading"
|
77 |
+
style={ {
|
78 |
+
height: 30,
|
79 |
+
marginBottom: 30,
|
80 |
+
width: '70%',
|
81 |
+
} }
|
82 |
+
/>
|
83 |
+
<p className="description is-loading" />
|
84 |
+
<p className="description is-loading" />
|
85 |
+
<p
|
86 |
+
className="description is-loading"
|
87 |
+
style={ { width: '40%' } }
|
88 |
+
/>
|
89 |
+
</div>
|
90 |
+
</div>
|
91 |
+
<div className="modal-footer" style={ { marginTop: 50 } }>
|
92 |
+
<span className="is-loading link" />
|
93 |
+
<span
|
94 |
+
className="is-loading button"
|
95 |
+
style={ {
|
96 |
+
width: '150px',
|
97 |
+
marginLeft: 'auto',
|
98 |
+
} }
|
99 |
+
/>
|
100 |
+
</div>
|
101 |
+
</>
|
102 |
+
);
|
103 |
+
};
|
104 |
+
|
105 |
+
const launchImport = ( e ) => {
|
106 |
+
e.preventDefault();
|
107 |
+
|
108 |
+
if ( themeStatus ) {
|
109 |
+
setInstallModal( true );
|
110 |
+
|
111 |
+
return false;
|
112 |
+
}
|
113 |
+
|
114 |
+
setModal( true );
|
115 |
+
};
|
116 |
+
|
117 |
+
const runTemplatesImport = () => {
|
118 |
+
setImporting( true );
|
119 |
+
const data = templatesData.map( ( item, index ) => {
|
120 |
+
return { ...item, ...templates[ index ] };
|
121 |
+
} );
|
122 |
+
try {
|
123 |
+
importTemplates( data ).then( ( r ) => {
|
124 |
+
if ( ! r.success ) {
|
125 |
+
console.log( r.message );
|
126 |
+
return false;
|
127 |
+
}
|
128 |
+
|
129 |
+
setImported( r.pages );
|
130 |
+
setImporting( 'done' );
|
131 |
+
} );
|
132 |
+
} catch ( e ) {
|
133 |
+
console.log( error );
|
134 |
+
}
|
135 |
+
};
|
136 |
+
|
137 |
+
const ImportDone = () => {
|
138 |
+
return (
|
139 |
+
<>
|
140 |
+
<div className="modal-body">
|
141 |
+
<div className="header">
|
142 |
+
<h1>
|
143 |
+
{ __(
|
144 |
+
'Import done!',
|
145 |
+
'templates-patterns-collection'
|
146 |
+
) }
|
147 |
+
</h1>
|
148 |
+
<p className="description">
|
149 |
+
{ isSingle
|
150 |
+
? __(
|
151 |
+
'Template was successfully imported!',
|
152 |
+
'templates-patterns-collection'
|
153 |
+
)
|
154 |
+
: __(
|
155 |
+
'Templates were successfully imported!',
|
156 |
+
'templates-patterns-collection'
|
157 |
+
) }
|
158 |
+
</p>
|
159 |
+
</div>
|
160 |
+
{ imported && (
|
161 |
+
<ul className="modal-toggles">
|
162 |
+
{ imported.map( ( page, index ) => {
|
163 |
+
return (
|
164 |
+
<li className="option-row" key={ index }>
|
165 |
+
<Icon
|
166 |
+
icon={ pageIcon }
|
167 |
+
className="active"
|
168 |
+
/>
|
169 |
+
<span>{ page.title }</span>
|
170 |
+
<div className="actions">
|
171 |
+
<Button
|
172 |
+
isTertiary
|
173 |
+
href={ page.url }
|
174 |
+
>
|
175 |
+
{ __(
|
176 |
+
'Visit',
|
177 |
+
'templates-patterns-collection'
|
178 |
+
) }
|
179 |
+
</Button>
|
180 |
+
<Button
|
181 |
+
isTertiary
|
182 |
+
href={ page.edit }
|
183 |
+
>
|
184 |
+
{ __(
|
185 |
+
'Edit',
|
186 |
+
'templates-patterns-collection'
|
187 |
+
) }
|
188 |
+
</Button>
|
189 |
+
</div>
|
190 |
+
</li>
|
191 |
+
);
|
192 |
+
} ) }
|
193 |
+
</ul>
|
194 |
+
) }
|
195 |
+
</div>
|
196 |
+
<div className="modal-footer">
|
197 |
+
<Button isPrimary className="import" onClick={ cancel }>
|
198 |
+
{ __( 'Close' ) }
|
199 |
+
</Button>
|
200 |
+
</div>
|
201 |
+
</>
|
202 |
+
);
|
203 |
+
};
|
204 |
+
|
205 |
+
const Error = () => {
|
206 |
+
return (
|
207 |
+
<>
|
208 |
+
<div className="modal-body">
|
209 |
+
<div className="header">
|
210 |
+
<h1>
|
211 |
+
{ __(
|
212 |
+
'An error occurred!',
|
213 |
+
'templates-patterns-collection'
|
214 |
+
) }
|
215 |
+
</h1>
|
216 |
+
<p className="description">
|
217 |
+
{ error === true
|
218 |
+
? __( 'Please refresh the page and try again.' )
|
219 |
+
: error }
|
220 |
+
</p>
|
221 |
+
</div>
|
222 |
+
</div>
|
223 |
+
<div className="modal-footer">
|
224 |
+
<Button
|
225 |
+
isPrimary
|
226 |
+
className="import"
|
227 |
+
onClick={ () => {
|
228 |
+
setError( false );
|
229 |
+
cancel();
|
230 |
+
} }
|
231 |
+
>
|
232 |
+
{ __( 'Close' ) }
|
233 |
+
</Button>
|
234 |
+
</div>
|
235 |
+
</>
|
236 |
+
);
|
237 |
+
};
|
238 |
+
|
239 |
+
const description = () => {
|
240 |
+
const map = {
|
241 |
+
strong: <strong>{ __( 'does not' ) }</strong>,
|
242 |
+
};
|
243 |
+
|
244 |
+
const text = isSingle
|
245 |
+
? sprintf(
|
246 |
+
/* translators: %s the name of the template */
|
247 |
+
__(
|
248 |
+
'The %s template will be imported as a page into your site. This import <strong/> include any plugins or theme settings.',
|
249 |
+
'templates-patterns-collection'
|
250 |
+
),
|
251 |
+
templatesData[ 0 ].template_name
|
252 |
+
)
|
253 |
+
: __(
|
254 |
+
'All the templates that are included in this starter site, will be imported as pages. This import <strong/> include any plugins or theme settings.',
|
255 |
+
'templates-patterns-collection'
|
256 |
+
);
|
257 |
+
|
258 |
+
return createInterpolateElement( text, map );
|
259 |
+
};
|
260 |
+
|
261 |
+
const ModalContent = () => {
|
262 |
+
if ( fetching ) {
|
263 |
+
return <Mock />;
|
264 |
+
}
|
265 |
+
|
266 |
+
if ( error ) {
|
267 |
+
return <Error />;
|
268 |
+
}
|
269 |
+
|
270 |
+
return (
|
271 |
+
<>
|
272 |
+
<div className="modal-body">
|
273 |
+
<div className="header">
|
274 |
+
<h1>
|
275 |
+
{ sprintf(
|
276 |
+
isSingle
|
277 |
+
? /* translators: name of starter site */
|
278 |
+
__(
|
279 |
+
'Import the %s template',
|
280 |
+
'templates-patterns-collection'
|
281 |
+
)
|
282 |
+
: /* translators: name of template */
|
283 |
+
__(
|
284 |
+
'Import all templates from %s',
|
285 |
+
'templates-patterns-collection'
|
286 |
+
),
|
287 |
+
isSingle
|
288 |
+
? templatesData[ 0 ].template_name
|
289 |
+
: siteData.title
|
290 |
+
) }
|
291 |
+
</h1>
|
292 |
+
<p className="description">{ description() }</p>
|
293 |
+
</div>
|
294 |
+
</div>
|
295 |
+
<div className="modal-footer">
|
296 |
+
{ ! generalTemplates && (
|
297 |
+
<Button
|
298 |
+
className="import-templates"
|
299 |
+
isLink
|
300 |
+
disabled={ importing }
|
301 |
+
onClick={ launchImport }
|
302 |
+
>
|
303 |
+
{ __(
|
304 |
+
'I want to import the entire site',
|
305 |
+
'templates-patterns-collection'
|
306 |
+
) }
|
307 |
+
</Button>
|
308 |
+
) }
|
309 |
+
<Button
|
310 |
+
isPrimary
|
311 |
+
className="import"
|
312 |
+
disabled={ importing }
|
313 |
+
onClick={ runTemplatesImport }
|
314 |
+
>
|
315 |
+
{ importing
|
316 |
+
? __( 'Importing' ) + '...'
|
317 |
+
: isSingle
|
318 |
+
? __( 'Import' )
|
319 |
+
: __( 'Import All Pages' ) }
|
320 |
+
</Button>
|
321 |
+
</div>
|
322 |
+
</>
|
323 |
+
);
|
324 |
+
};
|
325 |
+
|
326 |
+
return (
|
327 |
+
<Modal
|
328 |
+
className={ classnames( [ 'ob-import-modal', { fetching } ] ) }
|
329 |
+
onRequestClose={ cancel }
|
330 |
+
shouldCloseOnClickOutside={ ! importing && ! fetching }
|
331 |
+
isDismissible={ ! importing && ! fetching }
|
332 |
+
>
|
333 |
+
{ importing === 'done' ? <ImportDone /> : <ModalContent /> }
|
334 |
+
</Modal>
|
335 |
+
);
|
336 |
+
};
|
337 |
+
|
338 |
+
export default compose(
|
339 |
+
withSelect( ( select ) => {
|
340 |
+
const { getThemeAction, getCurrentSite, getCurrentEditor } = select(
|
341 |
+
'neve-onboarding'
|
342 |
+
);
|
343 |
+
return {
|
344 |
+
themeStatus: getThemeAction().action || false,
|
345 |
+
siteData: getCurrentSite(),
|
346 |
+
editor: getCurrentEditor(),
|
347 |
+
};
|
348 |
+
} ),
|
349 |
+
withDispatch( ( dispatch ) => {
|
350 |
+
const {
|
351 |
+
setTemplateModal,
|
352 |
+
setImportModalStatus,
|
353 |
+
setInstallModalStatus,
|
354 |
+
} = dispatch( 'neve-onboarding' );
|
355 |
+
|
356 |
+
return {
|
357 |
+
cancel: () => {
|
358 |
+
setTemplateModal( null );
|
359 |
+
},
|
360 |
+
setModal: ( status ) => setImportModalStatus( status ),
|
361 |
+
setInstallModal: ( status ) => setInstallModalStatus( status ),
|
362 |
+
};
|
363 |
+
} )
|
364 |
+
)( ImportTemplatesModal );
|
assets/src/Components/CloudLibrary/Library.js
ADDED
@@ -0,0 +1,253 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import classnames from 'classnames';
|
2 |
+
|
3 |
+
import { chevronLeft, chevronRight, close } from '@wordpress/icons';
|
4 |
+
import { useEffect, useState, Fragment } from '@wordpress/element';
|
5 |
+
import { withDispatch, withSelect } from '@wordpress/data';
|
6 |
+
import { Spinner, Button } from '@wordpress/components';
|
7 |
+
import { compose } from '@wordpress/compose';
|
8 |
+
import { __, isRTL } from '@wordpress/i18n';
|
9 |
+
|
10 |
+
import { fetchLibrary } from './common';
|
11 |
+
import ListItem from './ListItem';
|
12 |
+
import Filters from './Filters';
|
13 |
+
import PreviewFrame from './PreviewFrame';
|
14 |
+
import ImportTemplatesModal from './ImportTemplatesModal';
|
15 |
+
import Pagination from '../../../../editor/src/components/pagination';
|
16 |
+
|
17 |
+
const Library = ( {
|
18 |
+
isGeneral,
|
19 |
+
setInstallModal,
|
20 |
+
setTemplateModal,
|
21 |
+
templateModal,
|
22 |
+
themeStatus,
|
23 |
+
editor,
|
24 |
+
} ) => {
|
25 |
+
const [ library, setLibrary ] = useState( [] );
|
26 |
+
const [ toImport, setToImport ] = useState( [] );
|
27 |
+
const [ isGrid, setIsGrid ] = useState( isGeneral );
|
28 |
+
const [ searchQuery, setSearchQuery ] = useState( '' );
|
29 |
+
const [ currentPage, setCurrentPage ] = useState( 0 );
|
30 |
+
const [ totalPages, setTotalPages ] = useState( 0 );
|
31 |
+
const [ isLoading, setLoading ] = useState( false );
|
32 |
+
const [ previewUrl, setPreviewUrl ] = useState( '' );
|
33 |
+
|
34 |
+
useEffect( () => {
|
35 |
+
setLoading( true );
|
36 |
+
loadTemplates();
|
37 |
+
}, [ isGeneral ] );
|
38 |
+
|
39 |
+
const loadTemplates = () => {
|
40 |
+
const params = {
|
41 |
+
page: currentPage,
|
42 |
+
per_page: 12,
|
43 |
+
};
|
44 |
+
|
45 |
+
if ( isGeneral ) {
|
46 |
+
params.template_site_slug = 'general';
|
47 |
+
params.premade = true;
|
48 |
+
}
|
49 |
+
|
50 |
+
if ( searchQuery ) {
|
51 |
+
params.search = searchQuery;
|
52 |
+
}
|
53 |
+
|
54 |
+
fetchLibrary( isGeneral, params ).then( ( r ) => {
|
55 |
+
setLibrary( r.templates );
|
56 |
+
setTotalPages( r.total );
|
57 |
+
setLoading( false );
|
58 |
+
} );
|
59 |
+
};
|
60 |
+
|
61 |
+
const handlePageChange = async ( index ) => {
|
62 |
+
setLoading( true );
|
63 |
+
setCurrentPage( index );
|
64 |
+
|
65 |
+
const params = {
|
66 |
+
page: index,
|
67 |
+
per_page: 12,
|
68 |
+
};
|
69 |
+
|
70 |
+
if ( isGeneral ) {
|
71 |
+
params.template_site_slug = 'general';
|
72 |
+
params.premade = true;
|
73 |
+
}
|
74 |
+
|
75 |
+
if ( searchQuery ) {
|
76 |
+
params.search = searchQuery;
|
77 |
+
}
|
78 |
+
|
79 |
+
await fetchLibrary( isGeneral, params ).then( ( r ) => {
|
80 |
+
setLibrary( r.templates );
|
81 |
+
setTotalPages( r.total );
|
82 |
+
} );
|
83 |
+
|
84 |
+
setLoading( false );
|
85 |
+
};
|
86 |
+
|
87 |
+
const handleSearch = () => {
|
88 |
+
setLoading( true );
|
89 |
+
const params = { search: searchQuery };
|
90 |
+
if ( isGeneral ) {
|
91 |
+
params.template_site_slug = 'general';
|
92 |
+
params.premade = true;
|
93 |
+
}
|
94 |
+
|
95 |
+
fetchLibrary( isGeneral, params ).then( ( r ) => {
|
96 |
+
setLibrary( r.templates );
|
97 |
+
setTotalPages( r.total );
|
98 |
+
setLoading( false );
|
99 |
+
} );
|
100 |
+
};
|
101 |
+
|
102 |
+
const handlePreview = ( url ) => {
|
103 |
+
setPreviewUrl( url );
|
104 |
+
};
|
105 |
+
|
106 |
+
const handleImport = ( id ) => {
|
107 |
+
if ( themeStatus ) {
|
108 |
+
setInstallModal( true );
|
109 |
+
|
110 |
+
return false;
|
111 |
+
}
|
112 |
+
setToImport( [ id ] );
|
113 |
+
setTemplateModal( true );
|
114 |
+
};
|
115 |
+
|
116 |
+
const currentPreviewIndex =
|
117 |
+
library && library.findIndex( ( item ) => item.link === previewUrl );
|
118 |
+
const previewedItem =
|
119 |
+
library && library.find( ( item ) => previewUrl === item.link );
|
120 |
+
const wrapClasses = classnames( 'cloud-items', { 'is-grid': isGrid } );
|
121 |
+
|
122 |
+
const handlePrevious = () => {
|
123 |
+
let newIndex = currentPreviewIndex - 1;
|
124 |
+
if ( currentPreviewIndex === 0 ) {
|
125 |
+
newIndex = library.length - 1;
|
126 |
+
}
|
127 |
+
setPreviewUrl( library[ newIndex ].link );
|
128 |
+
};
|
129 |
+
|
130 |
+
const handleNext = () => {
|
131 |
+
let newIndex = currentPreviewIndex + 1;
|
132 |
+
if ( currentPreviewIndex === library.length - 1 ) {
|
133 |
+
newIndex = 0;
|
134 |
+
}
|
135 |
+
setPreviewUrl( library[ newIndex ].link );
|
136 |
+
};
|
137 |
+
|
138 |
+
return (
|
139 |
+
<div className={ wrapClasses }>
|
140 |
+
<>
|
141 |
+
<Filters
|
142 |
+
isGrid={ isGrid }
|
143 |
+
setGrid={ setIsGrid }
|
144 |
+
searchQuery={ searchQuery }
|
145 |
+
setSearchQuery={ setSearchQuery }
|
146 |
+
onSearch={ handleSearch }
|
147 |
+
/>
|
148 |
+
{ isLoading && <Spinner /> }
|
149 |
+
{ ! isLoading &&
|
150 |
+
( library && library.length > 0 ? (
|
151 |
+
<>
|
152 |
+
<div className="table">
|
153 |
+
{ library.map( ( item ) => (
|
154 |
+
<ListItem
|
155 |
+
onPreview={ handlePreview }
|
156 |
+
userTemplate={ ! isGeneral }
|
157 |
+
key={ item.template_id }
|
158 |
+
item={ item }
|
159 |
+
loadTemplates={ loadTemplates }
|
160 |
+
onImport={ () => handleImport( item ) }
|
161 |
+
grid={ isGrid }
|
162 |
+
/>
|
163 |
+
) ) }
|
164 |
+
</div>
|
165 |
+
<Pagination
|
166 |
+
total={ totalPages }
|
167 |
+
current={ currentPage }
|
168 |
+
onChange={ handlePageChange }
|
169 |
+
/>
|
170 |
+
</>
|
171 |
+
) : (
|
172 |
+
<Fragment>{ __( 'No templates found.' ) }</Fragment>
|
173 |
+
) ) }
|
174 |
+
{ previewUrl && (
|
175 |
+
<PreviewFrame
|
176 |
+
previewUrl={ previewUrl }
|
177 |
+
rightButtons={
|
178 |
+
<Button
|
179 |
+
isPrimary
|
180 |
+
onClick={ () => handleImport( previewedItem ) }
|
181 |
+
>
|
182 |
+
{ __( 'Import Template' ) }
|
183 |
+
</Button>
|
184 |
+
}
|
185 |
+
heading={ previewedItem.template_name }
|
186 |
+
leftButtons={
|
187 |
+
<>
|
188 |
+
<Button
|
189 |
+
icon={ close }
|
190 |
+
onClick={ () => setPreviewUrl( '' ) }
|
191 |
+
/>
|
192 |
+
{ library.length > 1 && (
|
193 |
+
<>
|
194 |
+
<Button
|
195 |
+
icon={
|
196 |
+
isRTL()
|
197 |
+
? chevronRight
|
198 |
+
: chevronLeft
|
199 |
+
}
|
200 |
+
onClick={ handlePrevious }
|
201 |
+
/>
|
202 |
+
<Button
|
203 |
+
icon={
|
204 |
+
isRTL()
|
205 |
+
? chevronLeft
|
206 |
+
: chevronRight
|
207 |
+
}
|
208 |
+
onClick={ handleNext }
|
209 |
+
/>
|
210 |
+
</>
|
211 |
+
) }
|
212 |
+
</>
|
213 |
+
}
|
214 |
+
/>
|
215 |
+
) }
|
216 |
+
</>
|
217 |
+
{ templateModal &&
|
218 |
+
toImport &&
|
219 |
+
! isLoading &&
|
220 |
+
toImport.length > 0 && (
|
221 |
+
<ImportTemplatesModal
|
222 |
+
generalTemplates={ true }
|
223 |
+
isUserTemplate={ ! isGeneral }
|
224 |
+
templatesData={ toImport }
|
225 |
+
/>
|
226 |
+
) }
|
227 |
+
</div>
|
228 |
+
);
|
229 |
+
};
|
230 |
+
|
231 |
+
export default compose(
|
232 |
+
withDispatch( ( dispatch ) => {
|
233 |
+
const { setInstallModalStatus, setTemplateModal } = dispatch(
|
234 |
+
'neve-onboarding'
|
235 |
+
);
|
236 |
+
|
237 |
+
return {
|
238 |
+
setInstallModal: ( status ) => setInstallModalStatus( status ),
|
239 |
+
setTemplateModal,
|
240 |
+
};
|
241 |
+
} ),
|
242 |
+
withSelect( ( select ) => {
|
243 |
+
const { getTemplateModal, getThemeAction, getCurrentEditor } = select(
|
244 |
+
'neve-onboarding'
|
245 |
+
);
|
246 |
+
|
247 |
+
return {
|
248 |
+
templateModal: getTemplateModal(),
|
249 |
+
themeStatus: getThemeAction().action || false,
|
250 |
+
editor: getCurrentEditor(),
|
251 |
+
};
|
252 |
+
} )
|
253 |
+
)( Library );
|
assets/src/Components/CloudLibrary/ListItem.js
ADDED
@@ -0,0 +1,278 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* eslint-disable camelcase */
|
2 |
+
|
3 |
+
import { check, edit, group, page, trash, update } from '@wordpress/icons';
|
4 |
+
import { __ } from '@wordpress/i18n';
|
5 |
+
import { Button, Icon, TextControl } from '@wordpress/components';
|
6 |
+
|
7 |
+
import { useState } from '@wordpress/element';
|
8 |
+
import classnames from 'classnames';
|
9 |
+
|
10 |
+
import {
|
11 |
+
updateTemplate,
|
12 |
+
// duplicateTemplate,
|
13 |
+
deleteTemplate,
|
14 |
+
} from './common';
|
15 |
+
|
16 |
+
const ListItem = ( {
|
17 |
+
item,
|
18 |
+
loadTemplates,
|
19 |
+
userTemplate,
|
20 |
+
grid,
|
21 |
+
onPreview,
|
22 |
+
onImport,
|
23 |
+
upsell = false,
|
24 |
+
} ) => {
|
25 |
+
const [ isLoading, setLoading ] = useState( false );
|
26 |
+
const [ isEditing, setEditing ] = useState( false );
|
27 |
+
const [ itemName, setItemName ] = useState( item.template_name );
|
28 |
+
|
29 |
+
const updateItem = async ( e ) => {
|
30 |
+
e.preventDefault();
|
31 |
+
const { template_id, template_name } = item;
|
32 |
+
setLoading( 'updating' );
|
33 |
+
await updateTemplate( template_id, itemName || template_name ).then(
|
34 |
+
( r ) => {
|
35 |
+
if ( r.success ) {
|
36 |
+
setEditing( ! isEditing );
|
37 |
+
setLoading( false );
|
38 |
+
}
|
39 |
+
}
|
40 |
+
);
|
41 |
+
};
|
42 |
+
|
43 |
+
/*const duplicateItem = async () => {
|
44 |
+
setLoading( 'duplicating' );
|
45 |
+
await duplicateTemplate( item.template_id ).then( ( r ) => {
|
46 |
+
if ( r.success ) {
|
47 |
+
loadTemplates();
|
48 |
+
}
|
49 |
+
} );
|
50 |
+
setLoading( false );
|
51 |
+
};*/
|
52 |
+
|
53 |
+
const deleteItem = async () => {
|
54 |
+
setLoading( 'deleteing' );
|
55 |
+
|
56 |
+
if (
|
57 |
+
! window.confirm(
|
58 |
+
__( 'Are you sure you want to delete this template?' )
|
59 |
+
)
|
60 |
+
) {
|
61 |
+
return false;
|
62 |
+
}
|
63 |
+
|
64 |
+
deleteTemplate( item.template_id ).then( ( r ) => {
|
65 |
+
if ( r.success ) {
|
66 |
+
loadTemplates();
|
67 |
+
setLoading( false );
|
68 |
+
}
|
69 |
+
} );
|
70 |
+
};
|
71 |
+
|
72 |
+
const handlePreview = () => {
|
73 |
+
onPreview( item.link );
|
74 |
+
};
|
75 |
+
|
76 |
+
const actionClasses = classnames( 'actions', {
|
77 |
+
'no-controls': ! userTemplate,
|
78 |
+
} );
|
79 |
+
|
80 |
+
if ( grid ) {
|
81 |
+
const style = { backgroundImage: `url(${ item.template_thumbnail })` };
|
82 |
+
|
83 |
+
return (
|
84 |
+
<div key={ item.template_id } className="table-grid">
|
85 |
+
<div
|
86 |
+
style={ style }
|
87 |
+
className={ classnames( 'grid-preview', {
|
88 |
+
'is-loading': isEditing || false !== isLoading,
|
89 |
+
} ) }
|
90 |
+
>
|
91 |
+
<div className="preview-actions">
|
92 |
+
{ ! userTemplate && item.link && (
|
93 |
+
<Button
|
94 |
+
isSecondary
|
95 |
+
disabled={ false !== isLoading }
|
96 |
+
onClick={ handlePreview }
|
97 |
+
>
|
98 |
+
{ __( 'Preview' ) }
|
99 |
+
</Button>
|
100 |
+
) }
|
101 |
+
{ ! upsell && (
|
102 |
+
<Button
|
103 |
+
isPrimary
|
104 |
+
isBusy={ 'importing' === isLoading }
|
105 |
+
disabled={ false !== isLoading }
|
106 |
+
onClick={ onImport }
|
107 |
+
>
|
108 |
+
{ __( 'Import' ) }
|
109 |
+
</Button>
|
110 |
+
) }
|
111 |
+
|
112 |
+
{ userTemplate && (
|
113 |
+
<div className="preview-controls">
|
114 |
+
<Button
|
115 |
+
label={ __( 'Edit' ) }
|
116 |
+
icon={
|
117 |
+
'updating' === isLoading ? update : edit
|
118 |
+
}
|
119 |
+
disabled={
|
120 |
+
isEditing || false !== isLoading
|
121 |
+
}
|
122 |
+
className={ classnames( {
|
123 |
+
'is-loading': 'updating' === isLoading,
|
124 |
+
} ) }
|
125 |
+
onClick={ () => setEditing( ! isEditing ) }
|
126 |
+
/>
|
127 |
+
|
128 |
+
{ /*<Button
|
129 |
+
label={ __( 'Duplicate' ) }
|
130 |
+
icon={
|
131 |
+
'duplicating' === isLoading
|
132 |
+
? update
|
133 |
+
: group
|
134 |
+
}
|
135 |
+
disabled={ false !== isLoading }
|
136 |
+
className={ classnames( {
|
137 |
+
'is-loading':
|
138 |
+
'duplicating' === isLoading,
|
139 |
+
} ) }
|
140 |
+
onClick={ duplicateItem }
|
141 |
+
/>*/ }
|
142 |
+
|
143 |
+
<Button
|
144 |
+
label={ __( 'Delete' ) }
|
145 |
+
icon={
|
146 |
+
'deleteing' === isLoading
|
147 |
+
? update
|
148 |
+
: trash
|
149 |
+
}
|
150 |
+
disabled={ false !== isLoading }
|
151 |
+
className={ classnames( {
|
152 |
+
'is-loading': 'deleteing' === isLoading,
|
153 |
+
} ) }
|
154 |
+
onClick={ deleteItem }
|
155 |
+
/>
|
156 |
+
</div>
|
157 |
+
) }
|
158 |
+
</div>
|
159 |
+
</div>
|
160 |
+
|
161 |
+
<div className="card-footer">
|
162 |
+
{ isEditing ? (
|
163 |
+
<form onSubmit={ updateItem }>
|
164 |
+
<TextControl
|
165 |
+
value={ itemName }
|
166 |
+
onChange={ setItemName }
|
167 |
+
/>
|
168 |
+
<Button
|
169 |
+
type="submit"
|
170 |
+
label={ __( 'Update' ) }
|
171 |
+
icon={
|
172 |
+
'updating' === isLoading ? update : check
|
173 |
+
}
|
174 |
+
disabled={ false !== isLoading }
|
175 |
+
className={ classnames( {
|
176 |
+
'is-loading': 'updating' === isLoading,
|
177 |
+
} ) }
|
178 |
+
/>
|
179 |
+
</form>
|
180 |
+
) : (
|
181 |
+
<p>{ itemName }</p>
|
182 |
+
) }
|
183 |
+
</div>
|
184 |
+
</div>
|
185 |
+
);
|
186 |
+
}
|
187 |
+
|
188 |
+
return (
|
189 |
+
<div key={ item.template_id } className="table-row">
|
190 |
+
<div className="title">
|
191 |
+
<Icon icon={ page } />
|
192 |
+
{ isEditing ? (
|
193 |
+
<TextControl
|
194 |
+
label={ __( 'Template Name' ) }
|
195 |
+
hideLabelFromVision
|
196 |
+
value={ itemName }
|
197 |
+
onChange={ setItemName }
|
198 |
+
/>
|
199 |
+
) : (
|
200 |
+
itemName
|
201 |
+
) }
|
202 |
+
</div>
|
203 |
+
|
204 |
+
{ userTemplate && (
|
205 |
+
<div className="controls">
|
206 |
+
<Button
|
207 |
+
label={ isEditing ? __( 'Update' ) : __( 'Edit' ) }
|
208 |
+
icon={
|
209 |
+
isEditing
|
210 |
+
? 'updating' === isLoading
|
211 |
+
? update
|
212 |
+
: check
|
213 |
+
: edit
|
214 |
+
}
|
215 |
+
disabled={ false !== isLoading }
|
216 |
+
className={ classnames( {
|
217 |
+
'is-loading': 'updating' === isLoading,
|
218 |
+
} ) }
|
219 |
+
onClick={
|
220 |
+
isEditing
|
221 |
+
? updateItem
|
222 |
+
: () => setEditing( ! isEditing )
|
223 |
+
}
|
224 |
+
>
|
225 |
+
{ isEditing ? __( 'Update' ) : __( 'Edit' ) }
|
226 |
+
</Button>
|
227 |
+
|
228 |
+
{ /* <Button
|
229 |
+
label={ __( 'Duplicate' ) }
|
230 |
+
icon={ 'duplicating' === isLoading ? update : group }
|
231 |
+
disabled={ false !== isLoading }
|
232 |
+
className={ classnames( {
|
233 |
+
'is-loading': 'duplicating' === isLoading,
|
234 |
+
} ) }
|
235 |
+
onClick={ duplicateItem }
|
236 |
+
/>
|
237 |
+
*/ }
|
238 |
+
<Button
|
239 |
+
label={ __( 'Delete' ) }
|
240 |
+
icon={ 'deleteing' === isLoading ? update : trash }
|
241 |
+
disabled={ false !== isLoading }
|
242 |
+
className={ classnames( {
|
243 |
+
'is-loading': 'deleteing' === isLoading,
|
244 |
+
} ) }
|
245 |
+
onClick={ deleteItem }
|
246 |
+
>
|
247 |
+
{ 'deleting' === isLoading
|
248 |
+
? __( 'Deleting' ) + '...'
|
249 |
+
: __( 'Delete' ) }
|
250 |
+
</Button>
|
251 |
+
</div>
|
252 |
+
) }
|
253 |
+
|
254 |
+
<div className={ actionClasses }>
|
255 |
+
{ ! userTemplate && item.link && (
|
256 |
+
<Button
|
257 |
+
isSecondary
|
258 |
+
disabled={ false !== isLoading }
|
259 |
+
onClick={ handlePreview }
|
260 |
+
>
|
261 |
+
{ __( 'Preview' ) }
|
262 |
+
</Button>
|
263 |
+
) }
|
264 |
+
|
265 |
+
<Button
|
266 |
+
isPrimary
|
267 |
+
isBusy={ 'importing' === isLoading }
|
268 |
+
onClick={ onImport }
|
269 |
+
disabled={ false !== isLoading }
|
270 |
+
>
|
271 |
+
{ __( 'Import' ) }
|
272 |
+
</Button>
|
273 |
+
</div>
|
274 |
+
</div>
|
275 |
+
);
|
276 |
+
};
|
277 |
+
|
278 |
+
export default ListItem;
|
assets/src/Components/CloudLibrary/PreviewFrame.js
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { Dashicon } from '@wordpress/components';
|
2 |
+
import { __ } from '@wordpress/i18n';
|
3 |
+
import { stringifyUrl } from 'query-string';
|
4 |
+
|
5 |
+
const PreviewFrame = ( {
|
6 |
+
title,
|
7 |
+
leftButtons,
|
8 |
+
rightButtons,
|
9 |
+
heading,
|
10 |
+
previewUrl,
|
11 |
+
} ) => {
|
12 |
+
const url = stringifyUrl( {
|
13 |
+
url: previewUrl,
|
14 |
+
query: { tpcpreview: 'yes' },
|
15 |
+
} );
|
16 |
+
|
17 |
+
const iframeTitle = title || __( 'Preview' );
|
18 |
+
return (
|
19 |
+
<div className="ob-preview single-templates">
|
20 |
+
<div className="preview">
|
21 |
+
<iframe title={ iframeTitle } src={ url } frameBorder="0" />
|
22 |
+
<div className="loading">
|
23 |
+
<Dashicon icon="update" size={ 50 } />
|
24 |
+
</div>
|
25 |
+
</div>
|
26 |
+
<div className="bottom-bar">
|
27 |
+
{ leftButtons && (
|
28 |
+
<div className="navigator">{ leftButtons }</div>
|
29 |
+
) }
|
30 |
+
{ heading && <h2 className="heading">{ heading }</h2> }
|
31 |
+
{ rightButtons && (
|
32 |
+
<div className="actions">{ rightButtons }</div>
|
33 |
+
) }
|
34 |
+
</div>
|
35 |
+
</div>
|
36 |
+
);
|
37 |
+
};
|
38 |
+
|
39 |
+
export default PreviewFrame;
|
assets/src/Components/CloudLibrary/common.js
ADDED
@@ -0,0 +1,186 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* global tiobDash, localStorage */
|
2 |
+
import apiFetch from '@wordpress/api-fetch';
|
3 |
+
|
4 |
+
import { stringifyUrl } from 'query-string';
|
5 |
+
import { v4 as uuidv4 } from 'uuid';
|
6 |
+
|
7 |
+
export const fetchLibrary = async (
|
8 |
+
premade = false,
|
9 |
+
additionalParams = {}
|
10 |
+
) => {
|
11 |
+
const url = stringifyUrl( {
|
12 |
+
url: tiobDash.endpoint + ( premade ? 'page-templates' : 'templates' ),
|
13 |
+
query: {
|
14 |
+
cache: localStorage.getItem( 'tpcCacheBuster' ),
|
15 |
+
...tiobDash.params,
|
16 |
+
...additionalParams,
|
17 |
+
},
|
18 |
+
} );
|
19 |
+
|
20 |
+
try {
|
21 |
+
const response = await apiFetch( {
|
22 |
+
url,
|
23 |
+
method: 'GET',
|
24 |
+
parse: false,
|
25 |
+
} );
|
26 |
+
|
27 |
+
if ( response.ok ) {
|
28 |
+
const templates = await response.json();
|
29 |
+
|
30 |
+
if ( templates.message ) {
|
31 |
+
return { success: false, message: templates.message };
|
32 |
+
}
|
33 |
+
|
34 |
+
const total = response.headers.get( 'x-wp-totalpages' );
|
35 |
+
return {
|
36 |
+
success: true,
|
37 |
+
total,
|
38 |
+
templates,
|
39 |
+
};
|
40 |
+
}
|
41 |
+
} catch ( error ) {
|
42 |
+
if ( error.message ) {
|
43 |
+
return { success: false, message: error.message };
|
44 |
+
}
|
45 |
+
}
|
46 |
+
};
|
47 |
+
|
48 |
+
export const updateTemplate = async ( id, name ) => {
|
49 |
+
const url = stringifyUrl( {
|
50 |
+
url: tiobDash.endpoint + 'templates/' + id,
|
51 |
+
query: {
|
52 |
+
cache: localStorage.getItem( 'tpcCacheBuster' ),
|
53 |
+
...tiobDash.params,
|
54 |
+
},
|
55 |
+
} );
|
56 |
+
|
57 |
+
try {
|
58 |
+
await apiFetch( {
|
59 |
+
url,
|
60 |
+
method: 'POST',
|
61 |
+
data: {
|
62 |
+
template_id: id,
|
63 |
+
template_name: name,
|
64 |
+
},
|
65 |
+
} );
|
66 |
+
localStorage.setItem( 'tpcCacheBuster', uuidv4() );
|
67 |
+
|
68 |
+
return { success: true };
|
69 |
+
} catch ( error ) {
|
70 |
+
if ( error.message ) {
|
71 |
+
return { success: false, message: error.message };
|
72 |
+
}
|
73 |
+
}
|
74 |
+
};
|
75 |
+
|
76 |
+
export const duplicateTemplate = async ( id ) => {
|
77 |
+
const url = stringifyUrl( {
|
78 |
+
url: `${ tiobDash.endpoint }templates/${ id }/clone`,
|
79 |
+
query: {
|
80 |
+
cache: localStorage.getItem( 'tpcCacheBuster' ),
|
81 |
+
...tiobDash.params,
|
82 |
+
},
|
83 |
+
} );
|
84 |
+
|
85 |
+
try {
|
86 |
+
await apiFetch( {
|
87 |
+
url,
|
88 |
+
method: 'POST',
|
89 |
+
} );
|
90 |
+
localStorage.setItem( 'tpcCacheBuster', uuidv4() );
|
91 |
+
|
92 |
+
return { success: true };
|
93 |
+
} catch ( error ) {
|
94 |
+
if ( error.message ) {
|
95 |
+
return { successs: false, message: error.message };
|
96 |
+
}
|
97 |
+
}
|
98 |
+
};
|
99 |
+
|
100 |
+
export const deleteTemplate = async ( id ) => {
|
101 |
+
const url = stringifyUrl( {
|
102 |
+
url: `${ tiobDash.endpoint }templates/${ id }`,
|
103 |
+
query: {
|
104 |
+
cache: localStorage.getItem( 'tpcCacheBuster' ),
|
105 |
+
_method: 'DELETE',
|
106 |
+
...tiobDash.params,
|
107 |
+
},
|
108 |
+
} );
|
109 |
+
|
110 |
+
try {
|
111 |
+
await apiFetch( { url, method: 'POST' } );
|
112 |
+
localStorage.setItem( 'tpcCacheBuster', uuidv4() );
|
113 |
+
|
114 |
+
return { success: true };
|
115 |
+
} catch ( error ) {
|
116 |
+
if ( error.message ) {
|
117 |
+
return { success: false, message: error.message };
|
118 |
+
}
|
119 |
+
}
|
120 |
+
};
|
121 |
+
|
122 |
+
export const fetchBulkData = async ( templates ) => {
|
123 |
+
const url = stringifyUrl( {
|
124 |
+
url: `${ tiobDash.endpoint }templates/bulk-import`,
|
125 |
+
query: {
|
126 |
+
templates,
|
127 |
+
cache: localStorage.getItem( 'tpcCacheBuster' ),
|
128 |
+
...tiobDash.params,
|
129 |
+
},
|
130 |
+
} );
|
131 |
+
|
132 |
+
try {
|
133 |
+
const response = await apiFetch( { url, method: 'GET', parse: false } );
|
134 |
+
|
135 |
+
if ( response.ok ) {
|
136 |
+
if ( response.message ) {
|
137 |
+
return { success: false, message: response.message };
|
138 |
+
}
|
139 |
+
const data = await response.json();
|
140 |
+
|
141 |
+
if ( data.message ) {
|
142 |
+
return { success: false, message: data.message };
|
143 |
+
}
|
144 |
+
|
145 |
+
return { success: true, templates: data };
|
146 |
+
}
|
147 |
+
} catch ( error ) {
|
148 |
+
if ( error.message ) {
|
149 |
+
return { success: false, message: error.message };
|
150 |
+
}
|
151 |
+
}
|
152 |
+
};
|
153 |
+
|
154 |
+
export const getUserTemplateData = async ( template ) => {
|
155 |
+
const url = stringifyUrl( {
|
156 |
+
url: `${ tiobDash.endpoint }templates/${ template }/import`,
|
157 |
+
query: {
|
158 |
+
cache: localStorage.getItem( 'tpcCacheBuster' ),
|
159 |
+
...tiobDash.params,
|
160 |
+
},
|
161 |
+
} );
|
162 |
+
|
163 |
+
let content = {};
|
164 |
+
|
165 |
+
try {
|
166 |
+
const response = await apiFetch( {
|
167 |
+
url,
|
168 |
+
method: 'GET',
|
169 |
+
parse: false,
|
170 |
+
} );
|
171 |
+
|
172 |
+
if ( response.ok ) {
|
173 |
+
content = await response.json();
|
174 |
+
|
175 |
+
if ( content.message ) {
|
176 |
+
return { success: false, message: content.message };
|
177 |
+
}
|
178 |
+
}
|
179 |
+
} catch ( error ) {
|
180 |
+
if ( error.message ) {
|
181 |
+
return { success: false, message: error.message };
|
182 |
+
}
|
183 |
+
}
|
184 |
+
|
185 |
+
return { success: true, templates: [ content ] };
|
186 |
+
};
|
assets/src/Components/Header.js
ADDED
@@ -0,0 +1,129 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* global tiobDash, localStorage */
|
2 |
+
import { withSelect, withDispatch } from '@wordpress/data';
|
3 |
+
import { Button, Icon } from '@wordpress/components';
|
4 |
+
import { useState } from '@wordpress/element';
|
5 |
+
import { compose } from '@wordpress/compose';
|
6 |
+
import { update } from '@wordpress/icons';
|
7 |
+
import { __ } from '@wordpress/i18n';
|
8 |
+
|
9 |
+
import Logo from './Icon';
|
10 |
+
import classnames from 'classnames';
|
11 |
+
import { v4 as uuidv4 } from 'uuid';
|
12 |
+
|
13 |
+
const TabNavigation = ( { setCurrentTab, currentTab, isFetching } ) => {
|
14 |
+
const [ isSyncing, setSyncing ] = useState( false );
|
15 |
+
|
16 |
+
const buttons = {
|
17 |
+
starterSites: __( 'Starter Sites', 'neve' ),
|
18 |
+
pageTemplates: __( 'Page Templates', 'neve' ),
|
19 |
+
};
|
20 |
+
|
21 |
+
const sync = () => {
|
22 |
+
setSyncing( true );
|
23 |
+
localStorage.setItem( 'tpcCacheBuster', uuidv4() );
|
24 |
+
const nextTab = currentTab;
|
25 |
+
setCurrentTab( null );
|
26 |
+
setTimeout( () => {
|
27 |
+
setCurrentTab( nextTab );
|
28 |
+
setSyncing( false );
|
29 |
+
}, 100 );
|
30 |
+
};
|
31 |
+
|
32 |
+
if (
|
33 |
+
tiobDash.license &&
|
34 |
+
tiobDash.license.tier &&
|
35 |
+
tiobDash.license.tier === 3
|
36 |
+
) {
|
37 |
+
buttons.library = __( 'My Library', 'neve' );
|
38 |
+
}
|
39 |
+
|
40 |
+
return (
|
41 |
+
<div className="header-nav">
|
42 |
+
{ Object.keys( buttons ).map( ( slug ) => {
|
43 |
+
return (
|
44 |
+
<Button
|
45 |
+
key={ slug }
|
46 |
+
isTertiary
|
47 |
+
isPressed={ slug === currentTab }
|
48 |
+
onClick={ () => setCurrentTab( slug ) }
|
49 |
+
>
|
50 |
+
{ buttons[ slug ] }
|
51 |
+
</Button>
|
52 |
+
);
|
53 |
+
} ) }
|
54 |
+
{ currentTab !== 'starterSites' && (
|
55 |
+
<Button
|
56 |
+
icon={ update }
|
57 |
+
onClick={ sync }
|
58 |
+
label={ __( 'Re-sync Library' ) }
|
59 |
+
className={ classnames( 'is-sync', {
|
60 |
+
'is-loading': isSyncing,
|
61 |
+
} ) }
|
62 |
+
disabled={ isFetching || isSyncing }
|
63 |
+
data-content={ __( 'Sync' ) }
|
64 |
+
/>
|
65 |
+
) }
|
66 |
+
</div>
|
67 |
+
);
|
68 |
+
};
|
69 |
+
|
70 |
+
const Header = ( {
|
71 |
+
isOnboarding,
|
72 |
+
cancelOnboarding,
|
73 |
+
setCurrentTab,
|
74 |
+
currentTab,
|
75 |
+
} ) => {
|
76 |
+
return (
|
77 |
+
<div className="ob-head">
|
78 |
+
{ ! isOnboarding && (
|
79 |
+
<>
|
80 |
+
<div className="header-container">
|
81 |
+
<h2>
|
82 |
+
{ ! tiobDash.brandedTheme && (
|
83 |
+
<Icon icon={ Logo } />
|
84 |
+
) }
|
85 |
+
<span>{ __( 'Templates Cloud', 'neve' ) }</span>
|
86 |
+
</h2>
|
87 |
+
<TabNavigation
|
88 |
+
setCurrentTab={ setCurrentTab }
|
89 |
+
currentTab={ currentTab }
|
90 |
+
/>
|
91 |
+
</div>
|
92 |
+
</>
|
93 |
+
) }
|
94 |
+
{ isOnboarding && (
|
95 |
+
<Button
|
96 |
+
className="close-onboarding"
|
97 |
+
isLink
|
98 |
+
icon="no-alt"
|
99 |
+
onClick={ cancelOnboarding }
|
100 |
+
/>
|
101 |
+
) }
|
102 |
+
</div>
|
103 |
+
);
|
104 |
+
};
|
105 |
+
|
106 |
+
export default compose(
|
107 |
+
withDispatch( ( dispatch ) => {
|
108 |
+
const { setOnboardingState, setCurrentTab, setFetching } = dispatch(
|
109 |
+
'neve-onboarding'
|
110 |
+
);
|
111 |
+
return {
|
112 |
+
cancelOnboarding: () => {
|
113 |
+
setOnboardingState( false );
|
114 |
+
},
|
115 |
+
setCurrentTab,
|
116 |
+
setFetching,
|
117 |
+
};
|
118 |
+
} ),
|
119 |
+
withSelect( ( select ) => {
|
120 |
+
const { getOnboardingStatus, getCurrentTab, getFetching } = select(
|
121 |
+
'neve-onboarding'
|
122 |
+
);
|
123 |
+
return {
|
124 |
+
isOnboarding: getOnboardingStatus(),
|
125 |
+
currentTab: getCurrentTab(),
|
126 |
+
isFetching: getFetching(),
|
127 |
+
};
|
128 |
+
} )
|
129 |
+
)( Header );
|
assets/src/Components/Icon.js
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* WordPress dependencies
|
3 |
+
*/
|
4 |
+
import { Path, SVG } from '@wordpress/primitives';
|
5 |
+
|
6 |
+
const icon = () => {
|
7 |
+
return (
|
8 |
+
<SVG
|
9 |
+
width="100"
|
10 |
+
height="100"
|
11 |
+
viewBox="0 0 100 100"
|
12 |
+
fill="none"
|
13 |
+
xmlns="http://www.w3.org/2000/svg"
|
14 |
+
className="ob-logo"
|
15 |
+
>
|
16 |
+
<Path
|
17 |
+
d="M95.0264 100H4.97356C2.22797 100 0 97.772 0 95.0264V4.97356C0 2.22797 2.22797 0 4.97356 0H95.0264C97.772 0 100 2.22797 100 4.97356V95.0264C100 97.772 97.772 100 95.0264 100Z"
|
18 |
+
fill="#0366D6"
|
19 |
+
/>
|
20 |
+
<Path
|
21 |
+
d="M82.6941 86.7448V30.8205V18.4653H70.3502H14.4146L26.7584 30.8205H70.3502V74.401L82.6941 86.7448Z"
|
22 |
+
fill="white"
|
23 |
+
/>
|
24 |
+
<Path
|
25 |
+
d="M42.2416 58.9291L42.2528 71.183L53.2352 82.1653L53.1902 47.9806L18.9941 47.9355L29.9765 58.9066L42.2416 58.9291Z"
|
26 |
+
fill="white"
|
27 |
+
/>
|
28 |
+
</SVG>
|
29 |
+
);
|
30 |
+
};
|
31 |
+
|
32 |
+
export default icon;
|
assets/src/Components/ImportModal.js
CHANGED
@@ -12,13 +12,21 @@ import ImportModalNote from './ImportModalNote';
|
|
12 |
import classnames from 'classnames';
|
13 |
import ImportModalError from './ImportModalError';
|
14 |
|
|
|
15 |
import { withSelect, withDispatch } from '@wordpress/data';
|
|
|
16 |
import { compose } from '@wordpress/compose';
|
17 |
-
import {
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
|
21 |
-
const ImportModal = ( { setModal, editor, siteData } ) => {
|
22 |
const [ general, setGeneral ] = useState( {
|
23 |
content: true,
|
24 |
customizer: true,
|
@@ -35,8 +43,12 @@ const ImportModal = ( { setModal, editor, siteData } ) => {
|
|
35 |
const [ error, setError ] = useState( null );
|
36 |
const [ importData, setImportData ] = useState( null );
|
37 |
const [ fetching, setFetching ] = useState( true );
|
|
|
|
|
|
|
38 |
const { license } = tiobDash;
|
39 |
-
|
|
|
40 |
const fetchAddress = siteData.remote_url || siteData.url;
|
41 |
const url = new URL(
|
42 |
`${ trailingSlashIt( fetchAddress ) }wp-json/ti-demo-data/data`
|
@@ -96,52 +108,53 @@ const ImportModal = ( { setModal, editor, siteData } ) => {
|
|
96 |
return (
|
97 |
<Fragment>
|
98 |
<div className="modal-body">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
<div className="well is-loading">
|
100 |
-
<
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
<ol>
|
105 |
-
|
106 |
-
|
107 |
-
) ) }
|
108 |
</ol>
|
109 |
</div>
|
110 |
-
|
111 |
-
<div className="
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
<div className="mock-icon is-loading" />
|
130 |
-
<span className="is-loading" />
|
131 |
-
<div className="toggle is-loading" />
|
132 |
-
</li>
|
133 |
-
) ) }
|
134 |
-
</ul>
|
135 |
</div>
|
136 |
</div>
|
137 |
<div className="modal-footer">
|
138 |
-
<
|
139 |
-
<Button isPrimary className="is-loading" />
|
140 |
</div>
|
141 |
</Fragment>
|
142 |
);
|
143 |
};
|
144 |
-
const
|
145 |
return (
|
146 |
<ImportModalNote
|
147 |
data={ importData }
|
@@ -150,7 +163,38 @@ const ImportModal = ( { setModal, editor, siteData } ) => {
|
|
150 |
);
|
151 |
};
|
152 |
|
153 |
-
const
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
154 |
const map = {
|
155 |
content: {
|
156 |
title: __( 'Content', 'templates-patterns-collection' ),
|
@@ -165,39 +209,49 @@ const ImportModal = ( { setModal, editor, siteData } ) => {
|
|
165 |
icon: 'admin-generic',
|
166 |
},
|
167 |
};
|
|
|
|
|
|
|
|
|
|
|
168 |
return (
|
169 |
-
<
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
180 |
/>
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
setGeneral( {
|
187 |
-
...general,
|
188 |
-
[ id ]: ! general[ id ],
|
189 |
-
} );
|
190 |
-
} }
|
191 |
-
/>
|
192 |
-
</div>
|
193 |
-
</li>
|
194 |
-
);
|
195 |
-
} ) }
|
196 |
-
</ul>
|
197 |
-
</div>
|
198 |
);
|
199 |
};
|
200 |
-
const
|
201 |
if ( fetching ) {
|
202 |
return null;
|
203 |
}
|
@@ -206,44 +260,50 @@ const ImportModal = ( { setModal, editor, siteData } ) => {
|
|
206 |
...( importData.mandatory_plugins || {} ),
|
207 |
};
|
208 |
|
|
|
|
|
|
|
|
|
209 |
return (
|
210 |
-
<
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
|
|
|
|
247 |
);
|
248 |
};
|
249 |
|
@@ -413,6 +473,8 @@ const ImportModal = ( { setModal, editor, siteData } ) => {
|
|
413 |
setModal( false );
|
414 |
};
|
415 |
|
|
|
|
|
416 |
const externalPluginsInstalled = siteData.external_plugins
|
417 |
? siteData.external_plugins.every( ( value ) => true === value.active )
|
418 |
: true;
|
@@ -432,13 +494,6 @@ const ImportModal = ( { setModal, editor, siteData } ) => {
|
|
432 |
return (
|
433 |
<Modal
|
434 |
className={ classnames( [ 'ob-import-modal', { fetching } ] ) }
|
435 |
-
title={
|
436 |
-
importData && ! fetching ? (
|
437 |
-
importData.title
|
438 |
-
) : (
|
439 |
-
<span className="is-loading title" />
|
440 |
-
)
|
441 |
-
}
|
442 |
onRequestClose={ closeModal }
|
443 |
shouldCloseOnClickOutside={ ! importing && ! fetching }
|
444 |
isDismissible={ ! importing && ! fetching }
|
@@ -449,23 +504,24 @@ const ImportModal = ( { setModal, editor, siteData } ) => {
|
|
449 |
<Fragment>
|
450 |
<div className="modal-body">
|
451 |
{ ! importing && 'done' !== currentStep && ! error ? (
|
452 |
-
|
453 |
-
|
454 |
-
<
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
|
|
459 |
) : (
|
460 |
-
|
461 |
{ error && (
|
462 |
-
|
463 |
<ImportModalError
|
464 |
message={ error.message || null }
|
465 |
code={ error.code || null }
|
466 |
/>
|
467 |
<hr />
|
468 |
-
|
469 |
) }
|
470 |
{ null !== currentStep && (
|
471 |
<ImportStepper
|
@@ -491,21 +547,26 @@ const ImportModal = ( { setModal, editor, siteData } ) => {
|
|
491 |
<hr />
|
492 |
</Fragment>
|
493 |
) }
|
494 |
-
|
495 |
) }
|
496 |
</div>
|
497 |
{ ! importing && (
|
498 |
<div className="modal-footer">
|
499 |
{ 'done' !== currentStep ? (
|
500 |
<Fragment>
|
501 |
-
<Button
|
|
|
|
|
|
|
|
|
502 |
{ __(
|
503 |
-
'
|
504 |
'templates-patterns-collection'
|
505 |
) }
|
506 |
</Button>
|
507 |
{ ! error && (
|
508 |
<Button
|
|
|
509 |
isPrimary
|
510 |
disabled={
|
511 |
allOptionsOff ||
|
@@ -517,14 +578,14 @@ const ImportModal = ( { setModal, editor, siteData } ) => {
|
|
517 |
} }
|
518 |
>
|
519 |
{ __(
|
520 |
-
'Import',
|
521 |
'templates-patterns-collection'
|
522 |
) }
|
523 |
</Button>
|
524 |
) }
|
525 |
</Fragment>
|
526 |
) : (
|
527 |
-
<
|
528 |
<Button
|
529 |
isLink
|
530 |
className="close"
|
@@ -544,13 +605,17 @@ const ImportModal = ( { setModal, editor, siteData } ) => {
|
|
544 |
'templates-patterns-collection'
|
545 |
) }
|
546 |
</Button>
|
547 |
-
<Button
|
|
|
|
|
|
|
|
|
548 |
{ __(
|
549 |
'Add your own content',
|
550 |
'templates-patterns-collection'
|
551 |
) }
|
552 |
</Button>
|
553 |
-
</
|
554 |
) }
|
555 |
</div>
|
556 |
) }
|
@@ -570,10 +635,22 @@ export default compose(
|
|
570 |
siteData: getCurrentSite(),
|
571 |
};
|
572 |
} ),
|
573 |
-
withDispatch( ( dispatch ) => {
|
574 |
-
const {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
575 |
return {
|
576 |
setModal: ( status ) => setImportModalStatus( status ),
|
|
|
577 |
};
|
578 |
} )
|
579 |
)( ImportModal );
|
12 |
import classnames from 'classnames';
|
13 |
import ImportModalError from './ImportModalError';
|
14 |
|
15 |
+
import { useState, useEffect, Fragment } from '@wordpress/element';
|
16 |
import { withSelect, withDispatch } from '@wordpress/data';
|
17 |
+
import { __, sprintf } from '@wordpress/i18n';
|
18 |
import { compose } from '@wordpress/compose';
|
19 |
+
import {
|
20 |
+
Button,
|
21 |
+
Icon,
|
22 |
+
ToggleControl,
|
23 |
+
Modal,
|
24 |
+
Panel,
|
25 |
+
PanelBody,
|
26 |
+
PanelRow,
|
27 |
+
} from '@wordpress/components';
|
28 |
|
29 |
+
const ImportModal = ( { setModal, editor, siteData, runTemplateImport } ) => {
|
30 |
const [ general, setGeneral ] = useState( {
|
31 |
content: true,
|
32 |
customizer: true,
|
43 |
const [ error, setError ] = useState( null );
|
44 |
const [ importData, setImportData ] = useState( null );
|
45 |
const [ fetching, setFetching ] = useState( true );
|
46 |
+
const [ pluginsOpened, setPluginsOpened ] = useState( true );
|
47 |
+
const [ optionsOpened, setOptionsOpened ] = useState( true );
|
48 |
+
|
49 |
const { license } = tiobDash;
|
50 |
+
|
51 |
+
useEffect( () => {
|
52 |
const fetchAddress = siteData.remote_url || siteData.url;
|
53 |
const url = new URL(
|
54 |
`${ trailingSlashIt( fetchAddress ) }wp-json/ti-demo-data/data`
|
108 |
return (
|
109 |
<Fragment>
|
110 |
<div className="modal-body">
|
111 |
+
<div className="header">
|
112 |
+
<span
|
113 |
+
className="title is-loading"
|
114 |
+
style={ { height: 35, marginBottom: 20 } }
|
115 |
+
/>
|
116 |
+
<p className="description is-loading" />
|
117 |
+
<p className="description is-loading" />
|
118 |
+
</div>
|
119 |
<div className="well is-loading">
|
120 |
+
<span
|
121 |
+
className="title is-loading"
|
122 |
+
style={ { height: 20 } }
|
123 |
+
/>
|
124 |
<ol>
|
125 |
+
<li />
|
126 |
+
<li />
|
|
|
127 |
</ol>
|
128 |
</div>
|
129 |
+
|
130 |
+
<div className="modal-toggles components-panel">
|
131 |
+
{ [ 1, 2 ].map( ( i ) => (
|
132 |
+
<div
|
133 |
+
key={ i }
|
134 |
+
className="components-panel__body options general is-opened"
|
135 |
+
>
|
136 |
+
<span className="title is-loading" />
|
137 |
+
<ul>
|
138 |
+
{ [ 1, 2, 3 ].map( ( i ) => (
|
139 |
+
<li className="option-row" key={ i }>
|
140 |
+
<div className="mock-icon is-loading" />
|
141 |
+
<span className="is-loading" />
|
142 |
+
<div className="toggle is-loading" />
|
143 |
+
</li>
|
144 |
+
) ) }
|
145 |
+
</ul>
|
146 |
+
</div>
|
147 |
+
) ) }
|
|
|
|
|
|
|
|
|
|
|
|
|
148 |
</div>
|
149 |
</div>
|
150 |
<div className="modal-footer">
|
151 |
+
<span className="link is-loading" />
|
152 |
+
<Button isPrimary className="import is-loading" />
|
153 |
</div>
|
154 |
</Fragment>
|
155 |
);
|
156 |
};
|
157 |
+
const Note = () => {
|
158 |
return (
|
159 |
<ImportModalNote
|
160 |
data={ importData }
|
163 |
);
|
164 |
};
|
165 |
|
166 |
+
const ModalHead = () => {
|
167 |
+
if ( fetching ) {
|
168 |
+
return (
|
169 |
+
<>
|
170 |
+
<h1 className="is-loading title" />
|
171 |
+
<p className="is-loading description" />
|
172 |
+
</>
|
173 |
+
);
|
174 |
+
}
|
175 |
+
return (
|
176 |
+
<div className="header">
|
177 |
+
<h1>
|
178 |
+
{ sprintf(
|
179 |
+
/* translators: name of starter site */
|
180 |
+
__(
|
181 |
+
'Import %s as a complete site',
|
182 |
+
'templates-patterns-collection'
|
183 |
+
),
|
184 |
+
importData.title
|
185 |
+
) }
|
186 |
+
</h1>
|
187 |
+
<p className="description">
|
188 |
+
{ __(
|
189 |
+
'Import the entire site including customizer options, pages, content and plugins.',
|
190 |
+
'templates-patterns-collection'
|
191 |
+
) }
|
192 |
+
</p>
|
193 |
+
</div>
|
194 |
+
);
|
195 |
+
};
|
196 |
+
|
197 |
+
const Options = () => {
|
198 |
const map = {
|
199 |
content: {
|
200 |
title: __( 'Content', 'templates-patterns-collection' ),
|
209 |
icon: 'admin-generic',
|
210 |
},
|
211 |
};
|
212 |
+
|
213 |
+
const toggleOpen = () => {
|
214 |
+
setOptionsOpened( ! optionsOpened );
|
215 |
+
};
|
216 |
+
|
217 |
return (
|
218 |
+
<PanelBody
|
219 |
+
onToggle={ toggleOpen }
|
220 |
+
opened={ optionsOpened }
|
221 |
+
className="options general"
|
222 |
+
title={ __(
|
223 |
+
'Import settings',
|
224 |
+
'templates-patterns-collection'
|
225 |
+
) }
|
226 |
+
>
|
227 |
+
{ Object.keys( map ).map( ( id, index ) => {
|
228 |
+
return (
|
229 |
+
<PanelRow className="option-row" key={ index }>
|
230 |
+
<Icon
|
231 |
+
className={ classnames( {
|
232 |
+
active: general[ id ],
|
233 |
+
} ) }
|
234 |
+
icon={ map[ id ].icon }
|
235 |
+
/>
|
236 |
+
<span>{ map[ id ].title }</span>
|
237 |
+
<div className="toggle-wrapper">
|
238 |
+
<ToggleControl
|
239 |
+
checked={ general[ id ] }
|
240 |
+
onChange={ () => {
|
241 |
+
setGeneral( {
|
242 |
+
...general,
|
243 |
+
[ id ]: ! general[ id ],
|
244 |
+
} );
|
245 |
+
} }
|
246 |
/>
|
247 |
+
</div>
|
248 |
+
</PanelRow>
|
249 |
+
);
|
250 |
+
} ) }
|
251 |
+
</PanelBody>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
252 |
);
|
253 |
};
|
254 |
+
const Plugins = () => {
|
255 |
if ( fetching ) {
|
256 |
return null;
|
257 |
}
|
260 |
...( importData.mandatory_plugins || {} ),
|
261 |
};
|
262 |
|
263 |
+
const toggleOpen = () => {
|
264 |
+
setPluginsOpened( ! pluginsOpened );
|
265 |
+
};
|
266 |
+
|
267 |
return (
|
268 |
+
<PanelBody
|
269 |
+
onToggle={ toggleOpen }
|
270 |
+
opened={ pluginsOpened }
|
271 |
+
className="options plugins"
|
272 |
+
title={ __( 'Plugins', 'templates-patterns-collection' ) }
|
273 |
+
>
|
274 |
+
{ Object.keys( allPlugins ).map( ( slug, index ) => {
|
275 |
+
return (
|
276 |
+
<PanelRow className="option-row" key={ index }>
|
277 |
+
<Icon
|
278 |
+
icon="admin-plugins"
|
279 |
+
className={ classnames( {
|
280 |
+
active: pluginOptions[ slug ],
|
281 |
+
} ) }
|
282 |
+
/>
|
283 |
+
<span
|
284 |
+
dangerouslySetInnerHTML={ {
|
285 |
+
__html: allPlugins[ slug ],
|
286 |
+
} }
|
287 |
+
/>
|
288 |
+
{ slug in importData.recommended_plugins && (
|
289 |
+
<div className="toggle-wrapper">
|
290 |
+
<ToggleControl
|
291 |
+
checked={ pluginOptions[ slug ] }
|
292 |
+
onChange={ () => {
|
293 |
+
setPluginOptions( {
|
294 |
+
...pluginOptions,
|
295 |
+
[ slug ]: ! pluginOptions[
|
296 |
+
slug
|
297 |
+
],
|
298 |
+
} );
|
299 |
+
} }
|
300 |
+
/>
|
301 |
+
</div>
|
302 |
+
) }
|
303 |
+
</PanelRow>
|
304 |
+
);
|
305 |
+
} ) }
|
306 |
+
</PanelBody>
|
307 |
);
|
308 |
};
|
309 |
|
473 |
setModal( false );
|
474 |
};
|
475 |
|
476 |
+
const runTemplatesImport = () => {};
|
477 |
+
|
478 |
const externalPluginsInstalled = siteData.external_plugins
|
479 |
? siteData.external_plugins.every( ( value ) => true === value.active )
|
480 |
: true;
|
494 |
return (
|
495 |
<Modal
|
496 |
className={ classnames( [ 'ob-import-modal', { fetching } ] ) }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
497 |
onRequestClose={ closeModal }
|
498 |
shouldCloseOnClickOutside={ ! importing && ! fetching }
|
499 |
isDismissible={ ! importing && ! fetching }
|
504 |
<Fragment>
|
505 |
<div className="modal-body">
|
506 |
{ ! importing && 'done' !== currentStep && ! error ? (
|
507 |
+
<>
|
508 |
+
<ModalHead />
|
509 |
+
<Note />
|
510 |
+
<Panel className="modal-toggles">
|
511 |
+
<Options />
|
512 |
+
<Plugins />
|
513 |
+
</Panel>
|
514 |
+
</>
|
515 |
) : (
|
516 |
+
<>
|
517 |
{ error && (
|
518 |
+
<>
|
519 |
<ImportModalError
|
520 |
message={ error.message || null }
|
521 |
code={ error.code || null }
|
522 |
/>
|
523 |
<hr />
|
524 |
+
</>
|
525 |
) }
|
526 |
{ null !== currentStep && (
|
527 |
<ImportStepper
|
547 |
<hr />
|
548 |
</Fragment>
|
549 |
) }
|
550 |
+
</>
|
551 |
) }
|
552 |
</div>
|
553 |
{ ! importing && (
|
554 |
<div className="modal-footer">
|
555 |
{ 'done' !== currentStep ? (
|
556 |
<Fragment>
|
557 |
+
<Button
|
558 |
+
className="import-templates"
|
559 |
+
isLink
|
560 |
+
onClick={ runTemplateImport }
|
561 |
+
>
|
562 |
{ __(
|
563 |
+
'I want to import just the templates',
|
564 |
'templates-patterns-collection'
|
565 |
) }
|
566 |
</Button>
|
567 |
{ ! error && (
|
568 |
<Button
|
569 |
+
className="import"
|
570 |
isPrimary
|
571 |
disabled={
|
572 |
allOptionsOff ||
|
578 |
} }
|
579 |
>
|
580 |
{ __(
|
581 |
+
'Import entire site',
|
582 |
'templates-patterns-collection'
|
583 |
) }
|
584 |
</Button>
|
585 |
) }
|
586 |
</Fragment>
|
587 |
) : (
|
588 |
+
<div className="import-done-actions">
|
589 |
<Button
|
590 |
isLink
|
591 |
className="close"
|
605 |
'templates-patterns-collection'
|
606 |
) }
|
607 |
</Button>
|
608 |
+
<Button
|
609 |
+
isPrimary
|
610 |
+
className="import"
|
611 |
+
href={ editLink }
|
612 |
+
>
|
613 |
{ __(
|
614 |
'Add your own content',
|
615 |
'templates-patterns-collection'
|
616 |
) }
|
617 |
</Button>
|
618 |
+
</div>
|
619 |
) }
|
620 |
</div>
|
621 |
) }
|
635 |
siteData: getCurrentSite(),
|
636 |
};
|
637 |
} ),
|
638 |
+
withDispatch( ( dispatch, { siteData } ) => {
|
639 |
+
const {
|
640 |
+
setTemplateModal,
|
641 |
+
setSingleTemplateImport,
|
642 |
+
setImportModalStatus,
|
643 |
+
} = dispatch( 'neve-onboarding' );
|
644 |
+
|
645 |
+
const runTemplateImport = () => {
|
646 |
+
setSingleTemplateImport( siteData.slug );
|
647 |
+
setTemplateModal( true );
|
648 |
+
setImportModalStatus( false );
|
649 |
+
};
|
650 |
+
|
651 |
return {
|
652 |
setModal: ( status ) => setImportModalStatus( status ),
|
653 |
+
runTemplateImport,
|
654 |
};
|
655 |
} )
|
656 |
)( ImportModal );
|
assets/src/Components/ImportModalNote.js
CHANGED
@@ -6,25 +6,21 @@ import { __ } from '@wordpress/i18n';
|
|
6 |
|
7 |
const ImportModalNote = ( { data, externalInstalled } ) => {
|
8 |
const external = data.external_plugins || null;
|
9 |
-
const classes = classnames( [
|
10 |
-
'well',
|
11 |
-
{ warning: external && ! externalInstalled },
|
12 |
-
] );
|
13 |
return (
|
14 |
<div className={ classes }>
|
15 |
-
|
16 |
-
<
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
<ol>
|
28 |
{ external && ! externalInstalled ? (
|
29 |
external.map( ( plugin, index ) => (
|
30 |
<li key={ index }>
|
@@ -49,7 +45,7 @@ const ImportModalNote = ( { data, externalInstalled } ) => {
|
|
49 |
</li>
|
50 |
</Fragment>
|
51 |
) }
|
52 |
-
</
|
53 |
</div>
|
54 |
);
|
55 |
};
|
6 |
|
7 |
const ImportModalNote = ( { data, externalInstalled } ) => {
|
8 |
const external = data.external_plugins || null;
|
9 |
+
const classes = classnames( [ 'well' ] );
|
|
|
|
|
|
|
10 |
return (
|
11 |
<div className={ classes }>
|
12 |
+
{ external && ! externalInstalled && (
|
13 |
+
<h3 style={ { marginTop: 15 } }>
|
14 |
+
<Dashicon icon="info" />
|
15 |
+
<span>
|
16 |
+
{ __(
|
17 |
+
'To import this demo you have to install the following plugins',
|
18 |
+
'neve'
|
19 |
+
) }
|
20 |
+
</span>
|
21 |
+
</h3>
|
22 |
+
) }
|
23 |
+
<ul>
|
|
|
24 |
{ external && ! externalInstalled ? (
|
25 |
external.map( ( plugin, index ) => (
|
26 |
<li key={ index }>
|
45 |
</li>
|
46 |
</Fragment>
|
47 |
) }
|
48 |
+
</ul>
|
49 |
</div>
|
50 |
);
|
51 |
};
|
assets/src/Components/InstallModal.js
CHANGED
@@ -12,6 +12,8 @@ const InstallModal = ( {
|
|
12 |
setInstallModal,
|
13 |
themeData,
|
14 |
setThemeAction,
|
|
|
|
|
15 |
} ) => {
|
16 |
const { action, slug, nonce } = themeData;
|
17 |
const { themesURL, brandedTheme } = tiobDash;
|
@@ -73,6 +75,10 @@ const InstallModal = ( {
|
|
73 |
setInstalling( false );
|
74 |
setInstallModal( false );
|
75 |
setThemeAction( false );
|
|
|
|
|
|
|
|
|
76 |
setImportModal( true );
|
77 |
} );
|
78 |
};
|
@@ -139,8 +145,8 @@ const InstallModal = ( {
|
|
139 |
{ ! installing &&
|
140 |
( action === 'install'
|
141 |
? __(
|
142 |
-
|
143 |
-
|
144 |
)
|
145 |
: __(
|
146 |
'Activate',
|
@@ -149,6 +155,7 @@ const InstallModal = ( {
|
|
149 |
</Button>
|
150 |
) }
|
151 |
<Button
|
|
|
152 |
isSecondary
|
153 |
disabled={ installing }
|
154 |
onClick={ handleDismiss }
|
@@ -163,10 +170,11 @@ const InstallModal = ( {
|
|
163 |
|
164 |
export default compose(
|
165 |
withSelect( ( select ) => {
|
166 |
-
const { getThemeAction } = select( 'neve-onboarding' );
|
167 |
|
168 |
return {
|
169 |
themeData: getThemeAction() || false,
|
|
|
170 |
};
|
171 |
} ),
|
172 |
withDispatch( ( dispatch ) => {
|
@@ -174,11 +182,13 @@ export default compose(
|
|
174 |
setImportModalStatus,
|
175 |
setInstallModalStatus,
|
176 |
setThemeAction,
|
|
|
177 |
} = dispatch( 'neve-onboarding' );
|
178 |
return {
|
179 |
setImportModal: ( status ) => setImportModalStatus( status ),
|
180 |
setInstallModal: ( status ) => setInstallModalStatus( status ),
|
181 |
setThemeAction: ( status ) => setThemeAction( status ),
|
|
|
182 |
};
|
183 |
} )
|
184 |
)( InstallModal );
|
12 |
setInstallModal,
|
13 |
themeData,
|
14 |
setThemeAction,
|
15 |
+
singleImport,
|
16 |
+
showTemplateModal,
|
17 |
} ) => {
|
18 |
const { action, slug, nonce } = themeData;
|
19 |
const { themesURL, brandedTheme } = tiobDash;
|
75 |
setInstalling( false );
|
76 |
setInstallModal( false );
|
77 |
setThemeAction( false );
|
78 |
+
if ( singleImport ) {
|
79 |
+
showTemplateModal();
|
80 |
+
return false;
|
81 |
+
}
|
82 |
setImportModal( true );
|
83 |
} );
|
84 |
};
|
145 |
{ ! installing &&
|
146 |
( action === 'install'
|
147 |
? __(
|
148 |
+
'Install and Activate',
|
149 |
+
'templates-patterns-collection'
|
150 |
)
|
151 |
: __(
|
152 |
'Activate',
|
155 |
</Button>
|
156 |
) }
|
157 |
<Button
|
158 |
+
style={ { marginLeft: 30 } }
|
159 |
isSecondary
|
160 |
disabled={ installing }
|
161 |
onClick={ handleDismiss }
|
170 |
|
171 |
export default compose(
|
172 |
withSelect( ( select ) => {
|
173 |
+
const { getSingleImport, getThemeAction } = select( 'neve-onboarding' );
|
174 |
|
175 |
return {
|
176 |
themeData: getThemeAction() || false,
|
177 |
+
singleImport: getSingleImport(),
|
178 |
};
|
179 |
} ),
|
180 |
withDispatch( ( dispatch ) => {
|
182 |
setImportModalStatus,
|
183 |
setInstallModalStatus,
|
184 |
setThemeAction,
|
185 |
+
setTemplateModal,
|
186 |
} = dispatch( 'neve-onboarding' );
|
187 |
return {
|
188 |
setImportModal: ( status ) => setImportModalStatus( status ),
|
189 |
setInstallModal: ( status ) => setInstallModalStatus( status ),
|
190 |
setThemeAction: ( status ) => setThemeAction( status ),
|
191 |
+
showTemplateModal: () => setTemplateModal( true ),
|
192 |
};
|
193 |
} )
|
194 |
)( InstallModal );
|
assets/src/Components/Main.js
CHANGED
@@ -1,415 +1,62 @@
|
|
1 |
-
import
|
2 |
-
import StarterSiteCard from './StarterSiteCard';
|
3 |
-
import PreviewFrame from './PreviewFrame';
|
4 |
-
import ImportModal from './ImportModal';
|
5 |
-
import InstallModal from './InstallModal';
|
6 |
-
import Migration from './Migration';
|
7 |
-
import VizSensor from 'react-visibility-sensor';
|
8 |
-
import Fuse from 'fuse.js/dist/fuse.min';
|
9 |
-
import EditorTabs from './EditorTabs';
|
10 |
-
import EditorSelector from './EditorSelector';
|
11 |
-
|
12 |
-
import { useState, Fragment } from '@wordpress/element';
|
13 |
-
import { Button } from '@wordpress/components';
|
14 |
-
import { __ } from '@wordpress/i18n';
|
15 |
import { withSelect, withDispatch } from '@wordpress/data';
|
16 |
import { compose } from '@wordpress/compose';
|
17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
const Onboarding = ( {
|
19 |
-
editor,
|
20 |
-
category,
|
21 |
-
resetCategory,
|
22 |
-
previewOpen,
|
23 |
-
currentSiteData,
|
24 |
-
importModal,
|
25 |
-
isOnboarding,
|
26 |
-
cancelOnboarding,
|
27 |
getSites,
|
28 |
installModal,
|
|
|
|
|
|
|
|
|
|
|
29 |
} ) => {
|
30 |
-
const
|
31 |
-
const [ maxShown, setMaxShown ] = useState( 9 );
|
32 |
-
const { sites = {}, migration } = getSites;
|
33 |
-
const [ sticky, setSticky ] = useState( false );
|
34 |
-
|
35 |
-
if ( 1 > sites.length ) {
|
36 |
-
return (
|
37 |
-
<>
|
38 |
-
<p>
|
39 |
-
{ __(
|
40 |
-
'Starter sites could not be loaded. Please refresh and try again.',
|
41 |
-
'neve'
|
42 |
-
) }
|
43 |
-
{ isOnboarding && (
|
44 |
-
<Button
|
45 |
-
style={ {
|
46 |
-
display: 'block',
|
47 |
-
margin: '20px auto',
|
48 |
-
} }
|
49 |
-
isPrimary
|
50 |
-
onClick={ cancelOnboarding }
|
51 |
-
>
|
52 |
-
{ __( 'Close', 'templates-patterns-collection' ) }
|
53 |
-
</Button>
|
54 |
-
) }
|
55 |
-
</p>
|
56 |
-
</>
|
57 |
-
);
|
58 |
-
}
|
59 |
-
|
60 |
-
const tags = [
|
61 |
-
__( 'Business', 'templates-patterns-collection' ),
|
62 |
-
__( 'Ecommerce', 'templates-patterns-collection' ),
|
63 |
-
__( 'Fashion', 'templates-patterns-collection' ),
|
64 |
-
__( 'Blogging', 'templates-patterns-collection' ),
|
65 |
-
__( 'Photography', 'templates-patterns-collection' ),
|
66 |
-
];
|
67 |
-
|
68 |
-
const CATEGORIES = {
|
69 |
-
all: __( 'All Categories' ),
|
70 |
-
free: __( 'Free' ),
|
71 |
-
business: __( 'Business' ),
|
72 |
-
portfolio: __( 'Portfolio' ),
|
73 |
-
woocommerce: __( 'WooCommerce' ),
|
74 |
-
blog: __( 'Blog' ),
|
75 |
-
personal: __( 'Personal' ),
|
76 |
-
other: __( 'Other' ),
|
77 |
-
};
|
78 |
-
|
79 |
-
const EDITOR_MAP = {
|
80 |
-
gutenberg: {
|
81 |
-
icon: 'gutenberg.jpg',
|
82 |
-
niceName: 'Gutenberg',
|
83 |
-
},
|
84 |
-
elementor: {
|
85 |
-
icon: 'elementor.jpg',
|
86 |
-
niceName: 'Elementor',
|
87 |
-
},
|
88 |
-
'beaver builder': {
|
89 |
-
icon: 'beaver.jpg',
|
90 |
-
niceName: (
|
91 |
-
<>
|
92 |
-
Beaver <span className="long-name">Builder</span>
|
93 |
-
</>
|
94 |
-
),
|
95 |
-
},
|
96 |
-
brizy: {
|
97 |
-
icon: 'brizy.jpg',
|
98 |
-
niceName: 'Brizy',
|
99 |
-
},
|
100 |
-
'divi builder': {
|
101 |
-
icon: 'divi.jpg',
|
102 |
-
niceName: 'Divi',
|
103 |
-
},
|
104 |
-
'thrive architect': {
|
105 |
-
icon: 'thrive.jpg',
|
106 |
-
niceName: (
|
107 |
-
<>
|
108 |
-
Thrive <span className="long-name">Architect</span>
|
109 |
-
</>
|
110 |
-
),
|
111 |
-
},
|
112 |
-
};
|
113 |
-
|
114 |
-
const getAllSites = () => {
|
115 |
-
const finalData = {};
|
116 |
-
const builders = getBuilders();
|
117 |
-
|
118 |
-
builders.map( ( builder ) => {
|
119 |
-
const sitesData = sites && sites[ builder ] ? sites[ builder ] : {};
|
120 |
-
finalData[ builder ] = [ ...Object.values( sitesData ) ];
|
121 |
-
} );
|
122 |
-
|
123 |
-
return finalData;
|
124 |
-
};
|
125 |
-
|
126 |
-
const filterByCategory = ( sites, category ) => {
|
127 |
-
if ( 'free' === category ) {
|
128 |
-
return sites.filter( ( item ) => ! item.upsell );
|
129 |
-
}
|
130 |
-
|
131 |
-
if ( 'all' !== category ) {
|
132 |
-
return sites.filter( ( item ) =>
|
133 |
-
item.keywords.includes( category )
|
134 |
-
);
|
135 |
-
}
|
136 |
-
|
137 |
-
return sites;
|
138 |
-
};
|
139 |
-
|
140 |
-
const filterBySearch = ( sites ) => {
|
141 |
-
if ( ! searchQuery ) {
|
142 |
-
return sites;
|
143 |
-
}
|
144 |
-
|
145 |
-
const fuse = new Fuse( sites, {
|
146 |
-
includeScore: true,
|
147 |
-
keys: [ 'title', 'slug', 'keywords' ],
|
148 |
-
} );
|
149 |
-
return fuse.search( searchQuery ).map( ( item ) => item.item );
|
150 |
-
};
|
151 |
-
|
152 |
-
const getSitesForBuilder = ( builder ) => {
|
153 |
-
const allSites = getAllSites();
|
154 |
-
return allSites[ builder ];
|
155 |
-
};
|
156 |
-
|
157 |
-
const getBuilders = () => Object.keys( sites );
|
158 |
-
|
159 |
-
const getCounts = () => {
|
160 |
-
const counts = {
|
161 |
-
builders: {},
|
162 |
-
categories: {},
|
163 |
-
};
|
164 |
-
const builders = getBuilders();
|
165 |
-
|
166 |
-
builders.map( ( builder ) => {
|
167 |
-
let buildersFiltered = getSitesForBuilder( builder );
|
168 |
-
buildersFiltered = filterByCategory( buildersFiltered, category );
|
169 |
-
buildersFiltered = filterBySearch( buildersFiltered );
|
170 |
-
counts.builders[ builder ] = buildersFiltered
|
171 |
-
? buildersFiltered.length
|
172 |
-
: 0;
|
173 |
-
} );
|
174 |
-
|
175 |
-
Object.keys( CATEGORIES ).map( ( category ) => {
|
176 |
-
let categoriesFiltered = getSitesForBuilder( editor );
|
177 |
-
categoriesFiltered = filterByCategory(
|
178 |
-
categoriesFiltered,
|
179 |
-
category
|
180 |
-
);
|
181 |
-
categoriesFiltered = filterBySearch( categoriesFiltered );
|
182 |
-
counts.categories[ category ] = categoriesFiltered
|
183 |
-
? categoriesFiltered.length
|
184 |
-
: 0;
|
185 |
-
} );
|
186 |
-
|
187 |
-
return counts;
|
188 |
-
};
|
189 |
-
|
190 |
-
const getFilteredSites = () => {
|
191 |
-
const allSites = getAllSites();
|
192 |
-
let builderSites = allSites[ editor ];
|
193 |
-
builderSites = filterBySearch( builderSites );
|
194 |
-
builderSites = filterByCategory( builderSites, category );
|
195 |
-
|
196 |
-
return builderSites;
|
197 |
-
};
|
198 |
-
|
199 |
-
const renderSites = () => {
|
200 |
-
const allData = getFilteredSites();
|
201 |
-
return allData.slice( 0, maxShown ).map( ( site, index ) => {
|
202 |
-
return <StarterSiteCard key={ index } data={ site } />;
|
203 |
-
} );
|
204 |
-
};
|
205 |
-
|
206 |
-
const getSiteNav = ( prev = false ) => {
|
207 |
-
if ( null === currentSiteData ) {
|
208 |
-
return null;
|
209 |
-
}
|
210 |
-
const allSites = getAllSites()[ editor ];
|
211 |
-
const position = allSites.indexOf( currentSiteData );
|
212 |
-
|
213 |
-
if ( -1 === position ) {
|
214 |
-
return null;
|
215 |
-
}
|
216 |
-
|
217 |
-
if ( 1 === allSites.length ) {
|
218 |
-
return null;
|
219 |
-
}
|
220 |
-
|
221 |
-
if ( prev && 0 === position ) {
|
222 |
-
return allSites[ allSites.length - 1 ];
|
223 |
-
}
|
224 |
-
|
225 |
-
if ( ! prev && position === allSites.length - 1 ) {
|
226 |
-
return allSites[ 0 ];
|
227 |
-
}
|
228 |
-
|
229 |
-
return allSites[ prev ? position - 1 : position + 1 ];
|
230 |
-
};
|
231 |
-
|
232 |
-
function renderMigration() {
|
233 |
-
if ( ! migration ) {
|
234 |
-
return null;
|
235 |
-
}
|
236 |
-
return <Migration data={ migration } />;
|
237 |
-
}
|
238 |
-
|
239 |
-
const onlyProBuilders = getBuilders().filter( ( builder ) => {
|
240 |
-
const upsellSitesCount = Object.keys( sites[ builder ] ).filter(
|
241 |
-
( site ) => true === sites[ builder ][ site ].upsell
|
242 |
-
).length;
|
243 |
-
const sitesCount = Object.keys( sites[ builder ] ).length;
|
244 |
-
|
245 |
-
return upsellSitesCount === sitesCount;
|
246 |
-
} );
|
247 |
-
|
248 |
-
const counted = getCounts();
|
249 |
|
250 |
return (
|
251 |
<Fragment>
|
252 |
<div className="ob">
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
|
|
|
|
260 |
/>
|
261 |
-
)
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
} }
|
269 |
-
query={ searchQuery }
|
270 |
-
/>
|
271 |
-
<EditorSelector
|
272 |
-
isSmall
|
273 |
-
count={ counted.builders }
|
274 |
-
EDITOR_MAP={ EDITOR_MAP }
|
275 |
-
/>
|
276 |
-
</div>
|
277 |
</div>
|
278 |
-
) }
|
279 |
-
{ renderMigration() }
|
280 |
-
<div className="ob-head">
|
281 |
-
{ ! isOnboarding && (
|
282 |
-
<>
|
283 |
-
<h2>
|
284 |
-
{ ! tiobDash.brandedTheme && (
|
285 |
-
<img
|
286 |
-
src={ `${ tiobDash.assets }img/logo.svg` }
|
287 |
-
alt="Logo"
|
288 |
-
/>
|
289 |
-
) }
|
290 |
-
<span>
|
291 |
-
{ __(
|
292 |
-
'Ready to use pre-built websites with 1-click installation',
|
293 |
-
'neve'
|
294 |
-
) }
|
295 |
-
</span>
|
296 |
-
</h2>
|
297 |
-
<p>
|
298 |
-
{ tiobDash.strings.starterSitesTabDescription }
|
299 |
-
</p>
|
300 |
-
</>
|
301 |
-
) }
|
302 |
-
{ isOnboarding && (
|
303 |
-
<Button
|
304 |
-
className="close-onboarding"
|
305 |
-
isLink
|
306 |
-
icon="no-alt"
|
307 |
-
onClick={ cancelOnboarding }
|
308 |
-
/>
|
309 |
-
) }
|
310 |
-
</div>
|
311 |
-
|
312 |
-
<div className="ob-body">
|
313 |
-
<VizSensor
|
314 |
-
onChange={ ( isVisible ) => {
|
315 |
-
if ( ! isVisible ) {
|
316 |
-
setSticky( true );
|
317 |
-
} else {
|
318 |
-
setSticky( false );
|
319 |
-
}
|
320 |
-
} }
|
321 |
-
>
|
322 |
-
<div>
|
323 |
-
<EditorSelector
|
324 |
-
count={ counted.builders }
|
325 |
-
EDITOR_MAP={ EDITOR_MAP }
|
326 |
-
/>
|
327 |
-
<Search
|
328 |
-
count={ counted.categories }
|
329 |
-
categories={ CATEGORIES }
|
330 |
-
onSearch={ ( query ) => {
|
331 |
-
setSearchQuery( query );
|
332 |
-
setMaxShown( 9 );
|
333 |
-
} }
|
334 |
-
query={ searchQuery }
|
335 |
-
/>
|
336 |
-
<EditorTabs
|
337 |
-
EDITOR_MAP={ EDITOR_MAP }
|
338 |
-
onlyProSites={ onlyProBuilders }
|
339 |
-
count={ counted.builders }
|
340 |
-
/>
|
341 |
-
</div>
|
342 |
-
</VizSensor>
|
343 |
-
{ 0 === getFilteredSites().length ? (
|
344 |
-
<div className="no-results">
|
345 |
-
<p>
|
346 |
-
{ __(
|
347 |
-
'No results found',
|
348 |
-
'templates-patterns-collection'
|
349 |
-
) }
|
350 |
-
.{ ' ' }
|
351 |
-
{ __(
|
352 |
-
'You can try a different search or use one of the categories below.',
|
353 |
-
'neve'
|
354 |
-
) }
|
355 |
-
</p>
|
356 |
-
<div className="tags">
|
357 |
-
{ tags.map( ( tag, index ) => {
|
358 |
-
return (
|
359 |
-
<Button
|
360 |
-
key={ index }
|
361 |
-
isPrimary
|
362 |
-
className="tag"
|
363 |
-
onClick={ ( e ) => {
|
364 |
-
e.preventDefault();
|
365 |
-
setSearchQuery( tag );
|
366 |
-
resetCategory();
|
367 |
-
} }
|
368 |
-
>
|
369 |
-
{ tag }
|
370 |
-
</Button>
|
371 |
-
);
|
372 |
-
} ) }
|
373 |
-
</div>
|
374 |
-
</div>
|
375 |
-
) : (
|
376 |
-
<div className="ob-sites">{ renderSites() }</div>
|
377 |
-
) }
|
378 |
-
<VizSensor
|
379 |
-
onChange={ ( isVisible ) => {
|
380 |
-
if ( ! isVisible ) {
|
381 |
-
return false;
|
382 |
-
}
|
383 |
-
setMaxShown( maxShown + 9 );
|
384 |
-
} }
|
385 |
-
>
|
386 |
-
<span
|
387 |
-
style={ {
|
388 |
-
height: 10,
|
389 |
-
width: 10,
|
390 |
-
display: 'block',
|
391 |
-
} }
|
392 |
-
/>
|
393 |
-
</VizSensor>
|
394 |
</div>
|
395 |
</div>
|
396 |
-
{ previewOpen && currentSiteData && (
|
397 |
-
<PreviewFrame
|
398 |
-
next={ getSiteNav() }
|
399 |
-
prev={ getSiteNav( true ) }
|
400 |
-
/>
|
401 |
-
) }
|
402 |
-
{ importModal && currentSiteData && <ImportModal /> }
|
403 |
{ installModal && <InstallModal /> }
|
|
|
404 |
</Fragment>
|
405 |
);
|
406 |
};
|
407 |
|
408 |
export default compose(
|
409 |
withDispatch( ( dispatch ) => {
|
410 |
-
const {
|
411 |
-
|
412 |
-
|
|
|
|
|
413 |
return {
|
414 |
cancelOnboarding: () => {
|
415 |
setOnboardingState( false );
|
@@ -417,6 +64,7 @@ export default compose(
|
|
417 |
resetCategory: () => {
|
418 |
setCurrentCategory( 'all' );
|
419 |
},
|
|
|
420 |
};
|
421 |
} ),
|
422 |
withSelect( ( select ) => {
|
@@ -429,6 +77,8 @@ export default compose(
|
|
429 |
getOnboardingStatus,
|
430 |
getSites,
|
431 |
getInstallModalStatus,
|
|
|
|
|
432 |
} = select( 'neve-onboarding' );
|
433 |
return {
|
434 |
editor: getCurrentEditor(),
|
@@ -439,6 +89,8 @@ export default compose(
|
|
439 |
installModal: getInstallModalStatus(),
|
440 |
isOnboarding: getOnboardingStatus(),
|
441 |
getSites: getSites(),
|
|
|
|
|
442 |
};
|
443 |
} )
|
444 |
)( Onboarding );
|
1 |
+
import { Fragment } from '@wordpress/element';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
import { withSelect, withDispatch } from '@wordpress/data';
|
3 |
import { compose } from '@wordpress/compose';
|
4 |
|
5 |
+
import InstallModal from './InstallModal';
|
6 |
+
import Migration from './Migration';
|
7 |
+
import Library from './CloudLibrary/Library';
|
8 |
+
import ImportModal from './ImportModal';
|
9 |
+
import DemoSiteTemplatesImport from './CloudLibrary/DemoSiteTemplatesImport';
|
10 |
+
import Header from './Header';
|
11 |
+
import OnboardingContent from './OnboardingContent';
|
12 |
+
|
13 |
const Onboarding = ( {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
getSites,
|
15 |
installModal,
|
16 |
+
currentTab,
|
17 |
+
singleImport,
|
18 |
+
importModal,
|
19 |
+
currentSiteData,
|
20 |
+
isOnboarding,
|
21 |
} ) => {
|
22 |
+
const { migration } = getSites;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
|
24 |
return (
|
25 |
<Fragment>
|
26 |
<div className="ob">
|
27 |
+
<Header />
|
28 |
+
<div className="ob-body">
|
29 |
+
<div className="content-container">
|
30 |
+
{ migration && <Migration data={ migration } /> }
|
31 |
+
|
32 |
+
{ 'starterSites' === currentTab &&
|
33 |
+
( singleImport ? (
|
34 |
+
<DemoSiteTemplatesImport
|
35 |
+
slug={ singleImport }
|
36 |
/>
|
37 |
+
) : (
|
38 |
+
<OnboardingContent />
|
39 |
+
) ) }
|
40 |
+
{ 'library' === currentTab && <Library /> }
|
41 |
+
{ 'pageTemplates' === currentTab && (
|
42 |
+
<Library isGeneral={ true } />
|
43 |
+
) }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
</div>
|
46 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
{ installModal && <InstallModal /> }
|
48 |
+
{ importModal && currentSiteData && <ImportModal /> }
|
49 |
</Fragment>
|
50 |
);
|
51 |
};
|
52 |
|
53 |
export default compose(
|
54 |
withDispatch( ( dispatch ) => {
|
55 |
+
const {
|
56 |
+
setOnboardingState,
|
57 |
+
setCurrentCategory,
|
58 |
+
setCurrentTab,
|
59 |
+
} = dispatch( 'neve-onboarding' );
|
60 |
return {
|
61 |
cancelOnboarding: () => {
|
62 |
setOnboardingState( false );
|
64 |
resetCategory: () => {
|
65 |
setCurrentCategory( 'all' );
|
66 |
},
|
67 |
+
setCurrentTab,
|
68 |
};
|
69 |
} ),
|
70 |
withSelect( ( select ) => {
|
77 |
getOnboardingStatus,
|
78 |
getSites,
|
79 |
getInstallModalStatus,
|
80 |
+
getCurrentTab,
|
81 |
+
getSingleImport,
|
82 |
} = select( 'neve-onboarding' );
|
83 |
return {
|
84 |
editor: getCurrentEditor(),
|
89 |
installModal: getInstallModalStatus(),
|
90 |
isOnboarding: getOnboardingStatus(),
|
91 |
getSites: getSites(),
|
92 |
+
currentTab: getCurrentTab(),
|
93 |
+
singleImport: getSingleImport(),
|
94 |
};
|
95 |
} )
|
96 |
)( Onboarding );
|
assets/src/Components/Migration.js
CHANGED
@@ -182,6 +182,7 @@ const Migration = ( { data } ) => {
|
|
182 |
) : (
|
183 |
<Fragment>
|
184 |
<Button
|
|
|
185 |
isSecondary
|
186 |
href={ `${ tiobDash.onboarding.homeUrl }/wp-admin/post.php?post=${ frontPageID }&action=elementor` }
|
187 |
>
|
@@ -213,7 +214,7 @@ const Migration = ( { data } ) => {
|
|
213 |
{ modalOpen && renderModal() }
|
214 |
<h2>{ data.heading }</h2>
|
215 |
<p>{ data.description }</p>
|
216 |
-
<div className="card starter-site-card">
|
217 |
<div className="top">
|
218 |
{ data.screenshot && (
|
219 |
<div className="image">
|
182 |
) : (
|
183 |
<Fragment>
|
184 |
<Button
|
185 |
+
style={ { marginLeft: 20 } }
|
186 |
isSecondary
|
187 |
href={ `${ tiobDash.onboarding.homeUrl }/wp-admin/post.php?post=${ frontPageID }&action=elementor` }
|
188 |
>
|
214 |
{ modalOpen && renderModal() }
|
215 |
<h2>{ data.heading }</h2>
|
216 |
<p>{ data.description }</p>
|
217 |
+
<div className="card starter-site-card" style={ { maxWidth: 330 } }>
|
218 |
<div className="top">
|
219 |
{ data.screenshot && (
|
220 |
<div className="image">
|
assets/src/Components/OnboardingContent.js
ADDED
@@ -0,0 +1,256 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { withSelect, withDispatch } from '@wordpress/data';
|
2 |
+
import { compose } from '@wordpress/compose';
|
3 |
+
import { useState } from '@wordpress/element';
|
4 |
+
import { __ } from '@wordpress/i18n';
|
5 |
+
import { Button } from '@wordpress/components';
|
6 |
+
|
7 |
+
import VizSensor from 'react-visibility-sensor';
|
8 |
+
import Fuse from 'fuse.js/dist/fuse.min';
|
9 |
+
|
10 |
+
import StarterSiteCard from './StarterSiteCard';
|
11 |
+
import PreviewFrame from './PreviewFrame';
|
12 |
+
import { TAGS } from '../utils/common';
|
13 |
+
import Filters from './StarterSites/Filters';
|
14 |
+
|
15 |
+
const OnboardingContent = ( {
|
16 |
+
getSites,
|
17 |
+
category,
|
18 |
+
resetCategory,
|
19 |
+
editor,
|
20 |
+
previewOpen,
|
21 |
+
currentSiteData,
|
22 |
+
isOnboarding,
|
23 |
+
cancelOnboarding,
|
24 |
+
setSearchQuery,
|
25 |
+
searchQuery,
|
26 |
+
} ) => {
|
27 |
+
const { sites = {} } = getSites;
|
28 |
+
|
29 |
+
const getAllSites = () => {
|
30 |
+
const finalData = {};
|
31 |
+
const builders = getBuilders();
|
32 |
+
|
33 |
+
builders.forEach( ( builder ) => {
|
34 |
+
const sitesData = sites && sites[ builder ] ? sites[ builder ] : {};
|
35 |
+
finalData[ builder ] = [ ...Object.values( sitesData ) ];
|
36 |
+
} );
|
37 |
+
|
38 |
+
return finalData;
|
39 |
+
};
|
40 |
+
|
41 |
+
const filterByCategory = ( items, cat ) => {
|
42 |
+
if ( 'free' === cat ) {
|
43 |
+
return items.filter( ( item ) => ! item.upsell );
|
44 |
+
}
|
45 |
+
|
46 |
+
if ( 'all' !== cat ) {
|
47 |
+
return items.filter( ( item ) => item.keywords.includes( cat ) );
|
48 |
+
}
|
49 |
+
|
50 |
+
return items;
|
51 |
+
};
|
52 |
+
|
53 |
+
const filterBySearch = ( items ) => {
|
54 |
+
if ( ! searchQuery ) {
|
55 |
+
return items;
|
56 |
+
}
|
57 |
+
|
58 |
+
const fuse = new Fuse( items, {
|
59 |
+
includeScore: true,
|
60 |
+
keys: [ 'title', 'slug', 'keywords' ],
|
61 |
+
} );
|
62 |
+
return fuse.search( searchQuery ).map( ( item ) => item.item );
|
63 |
+
};
|
64 |
+
|
65 |
+
const getSitesForBuilder = ( builder ) => {
|
66 |
+
const allSites = getAllSites();
|
67 |
+
return allSites[ builder ];
|
68 |
+
};
|
69 |
+
|
70 |
+
const getBuilders = () => Object.keys( sites );
|
71 |
+
|
72 |
+
const getFilteredSites = () => {
|
73 |
+
const allSites = getAllSites();
|
74 |
+
let builderSites = allSites[ editor ];
|
75 |
+
builderSites = filterBySearch( builderSites );
|
76 |
+
builderSites = filterByCategory( builderSites, category );
|
77 |
+
|
78 |
+
return builderSites;
|
79 |
+
};
|
80 |
+
|
81 |
+
const Sites = () => {
|
82 |
+
const [ maxShown, setMaxShown ] = useState( 9 );
|
83 |
+
const allData = getFilteredSites();
|
84 |
+
return (
|
85 |
+
<div className="ob-sites is-grid">
|
86 |
+
{ allData.slice( 0, maxShown ).map( ( site, index ) => {
|
87 |
+
return <StarterSiteCard key={ index } data={ site } />;
|
88 |
+
} ) }
|
89 |
+
|
90 |
+
<VizSensor
|
91 |
+
onChange={ ( isVisible ) => {
|
92 |
+
if ( ! isVisible ) {
|
93 |
+
return false;
|
94 |
+
}
|
95 |
+
setMaxShown( maxShown + 9 );
|
96 |
+
} }
|
97 |
+
>
|
98 |
+
<span
|
99 |
+
style={ {
|
100 |
+
height: 10,
|
101 |
+
width: 10,
|
102 |
+
display: 'block',
|
103 |
+
} }
|
104 |
+
/>
|
105 |
+
</VizSensor>
|
106 |
+
</div>
|
107 |
+
);
|
108 |
+
};
|
109 |
+
|
110 |
+
const getSiteNav = ( prev = false ) => {
|
111 |
+
if ( null === currentSiteData ) {
|
112 |
+
return null;
|
113 |
+
}
|
114 |
+
const allSites = getAllSites()[ editor ];
|
115 |
+
const position = allSites.indexOf( currentSiteData );
|
116 |
+
|
117 |
+
if ( -1 === position ) {
|
118 |
+
return null;
|
119 |
+
}
|
120 |
+
|
121 |
+
if ( 1 === allSites.length ) {
|
122 |
+
return null;
|
123 |
+
}
|
124 |
+
|
125 |
+
if ( prev && 0 === position ) {
|
126 |
+
return allSites[ allSites.length - 1 ];
|
127 |
+
}
|
128 |
+
|
129 |
+
if ( ! prev && position === allSites.length - 1 ) {
|
130 |
+
return allSites[ 0 ];
|
131 |
+
}
|
132 |
+
|
133 |
+
return allSites[ prev ? position - 1 : position + 1 ];
|
134 |
+
};
|
135 |
+
|
136 |
+
if ( 1 > sites.length ) {
|
137 |
+
return (
|
138 |
+
<>
|
139 |
+
<p>
|
140 |
+
{ __(
|
141 |
+
'Starter sites could not be loaded. Please refresh and try again.',
|
142 |
+
'neve'
|
143 |
+
) }
|
144 |
+
{ isOnboarding && (
|
145 |
+
<Button
|
146 |
+
style={ {
|
147 |
+
display: 'block',
|
148 |
+
margin: '20px auto',
|
149 |
+
} }
|
150 |
+
isPrimary
|
151 |
+
onClick={ cancelOnboarding }
|
152 |
+
>
|
153 |
+
{ __( 'Close', 'templates-patterns-collection' ) }
|
154 |
+
</Button>
|
155 |
+
) }
|
156 |
+
</p>
|
157 |
+
</>
|
158 |
+
);
|
159 |
+
}
|
160 |
+
|
161 |
+
return (
|
162 |
+
<>
|
163 |
+
<Filters
|
164 |
+
getSitesForBuilder={ getSitesForBuilder }
|
165 |
+
filterBySearch={ filterBySearch }
|
166 |
+
filterByCategory={ filterByCategory }
|
167 |
+
/>
|
168 |
+
{ 0 === getFilteredSites().length && (
|
169 |
+
<div className="no-results">
|
170 |
+
<p>
|
171 |
+
{ __(
|
172 |
+
'No results found',
|
173 |
+
'templates-patterns-collection'
|
174 |
+
) }
|
175 |
+
{ __(
|
176 |
+
'You can try a different search or use one of the categories below.',
|
177 |
+
'neve'
|
178 |
+
) }
|
179 |
+
</p>
|
180 |
+
<div className="tags">
|
181 |
+
{ TAGS.map( ( tag, index ) => {
|
182 |
+
return (
|
183 |
+
<Button
|
184 |
+
key={ index }
|
185 |
+
isPrimary
|
186 |
+
className="tag"
|
187 |
+
onClick={ ( e ) => {
|
188 |
+
e.preventDefault();
|
189 |
+
setSearchQuery( tag );
|
190 |
+
resetCategory();
|
191 |
+
} }
|
192 |
+
>
|
193 |
+
{ tag }
|
194 |
+
</Button>
|
195 |
+
);
|
196 |
+
} ) }
|
197 |
+
</div>
|
198 |
+
</div>
|
199 |
+
) }
|
200 |
+
<Sites />
|
201 |
+
{ previewOpen && currentSiteData && (
|
202 |
+
<PreviewFrame
|
203 |
+
next={ getSiteNav() }
|
204 |
+
prev={ getSiteNav( true ) }
|
205 |
+
/>
|
206 |
+
) }
|
207 |
+
</>
|
208 |
+
);
|
209 |
+
};
|
210 |
+
|
211 |
+
export default compose(
|
212 |
+
withDispatch( ( dispatch ) => {
|
213 |
+
const {
|
214 |
+
setOnboardingState,
|
215 |
+
setCurrentCategory,
|
216 |
+
setCurrentTab,
|
217 |
+
setSearchQuery,
|
218 |
+
} = dispatch( 'neve-onboarding' );
|
219 |
+
return {
|
220 |
+
cancelOnboarding: () => {
|
221 |
+
setOnboardingState( false );
|
222 |
+
},
|
223 |
+
resetCategory: () => {
|
224 |
+
setCurrentCategory( 'all' );
|
225 |
+
},
|
226 |
+
setCurrentTab,
|
227 |
+
setSearchQuery,
|
228 |
+
};
|
229 |
+
} ),
|
230 |
+
withSelect( ( select ) => {
|
231 |
+
const {
|
232 |
+
getCurrentEditor,
|
233 |
+
getCurrentCategory,
|
234 |
+
getPreviewStatus,
|
235 |
+
getCurrentSite,
|
236 |
+
getImportModalStatus,
|
237 |
+
getOnboardingStatus,
|
238 |
+
getSites,
|
239 |
+
getInstallModalStatus,
|
240 |
+
getCurrentTab,
|
241 |
+
getSearchQuery,
|
242 |
+
} = select( 'neve-onboarding' );
|
243 |
+
return {
|
244 |
+
editor: getCurrentEditor(),
|
245 |
+
category: getCurrentCategory(),
|
246 |
+
previewOpen: getPreviewStatus(),
|
247 |
+
currentSiteData: getCurrentSite(),
|
248 |
+
importModal: getImportModalStatus(),
|
249 |
+
installModal: getInstallModalStatus(),
|
250 |
+
isOnboarding: getOnboardingStatus(),
|
251 |
+
getSites: getSites(),
|
252 |
+
currentTab: getCurrentTab(),
|
253 |
+
searchQuery: getSearchQuery(),
|
254 |
+
};
|
255 |
+
} )
|
256 |
+
)( OnboardingContent );
|
assets/src/Components/PreviewFrame.js
CHANGED
@@ -1,8 +1,9 @@
|
|
1 |
/* global tiobDash */
|
2 |
import { withSelect, withDispatch } from '@wordpress/data';
|
3 |
-
import { compose } from '@wordpress/compose';
|
4 |
import { Button, Dashicon } from '@wordpress/components';
|
5 |
-
import {
|
|
|
|
|
6 |
|
7 |
const PreviewFrame = ( {
|
8 |
next,
|
@@ -14,8 +15,6 @@ const PreviewFrame = ( {
|
|
14 |
themeStatus,
|
15 |
setInstallModal,
|
16 |
} ) => {
|
17 |
-
const { isRTL } = tiobDash;
|
18 |
-
|
19 |
const handleImport = ( e ) => {
|
20 |
e.preventDefault();
|
21 |
if ( themeStatus ) {
|
@@ -53,7 +52,7 @@ const PreviewFrame = ( {
|
|
53 |
onClick={ handleClose }
|
54 |
className="close"
|
55 |
label={ __( 'Close', 'templates-patterns-collection' ) }
|
56 |
-
icon=
|
57 |
/>
|
58 |
|
59 |
{ prev && (
|
@@ -64,9 +63,7 @@ const PreviewFrame = ( {
|
|
64 |
'Previous',
|
65 |
'templates-patterns-collection'
|
66 |
) }
|
67 |
-
icon={
|
68 |
-
isRTL ? 'arrow-right-alt2' : 'arrow-left-alt2'
|
69 |
-
}
|
70 |
/>
|
71 |
) }
|
72 |
|
@@ -78,9 +75,7 @@ const PreviewFrame = ( {
|
|
78 |
'Next',
|
79 |
'templates-patterns-collection'
|
80 |
) }
|
81 |
-
icon={
|
82 |
-
isRTL ? 'arrow-left-alt2' : 'arrow-right-alt2'
|
83 |
-
}
|
84 |
/>
|
85 |
) }
|
86 |
</div>
|
1 |
/* global tiobDash */
|
2 |
import { withSelect, withDispatch } from '@wordpress/data';
|
|
|
3 |
import { Button, Dashicon } from '@wordpress/components';
|
4 |
+
import { compose } from '@wordpress/compose';
|
5 |
+
import { __, isRTL } from '@wordpress/i18n';
|
6 |
+
import { close, chevronRight, chevronLeft } from '@wordpress/icons';
|
7 |
|
8 |
const PreviewFrame = ( {
|
9 |
next,
|
15 |
themeStatus,
|
16 |
setInstallModal,
|
17 |
} ) => {
|
|
|
|
|
18 |
const handleImport = ( e ) => {
|
19 |
e.preventDefault();
|
20 |
if ( themeStatus ) {
|
52 |
onClick={ handleClose }
|
53 |
className="close"
|
54 |
label={ __( 'Close', 'templates-patterns-collection' ) }
|
55 |
+
icon={ close }
|
56 |
/>
|
57 |
|
58 |
{ prev && (
|
63 |
'Previous',
|
64 |
'templates-patterns-collection'
|
65 |
) }
|
66 |
+
icon={ isRTL() ? chevronRight : chevronLeft }
|
|
|
|
|
67 |
/>
|
68 |
) }
|
69 |
|
75 |
'Next',
|
76 |
'templates-patterns-collection'
|
77 |
) }
|
78 |
+
icon={ isRTL() ? chevronLeft : chevronRight }
|
|
|
|
|
79 |
/>
|
80 |
) }
|
81 |
</div>
|
assets/src/Components/Search.js
CHANGED
@@ -3,6 +3,7 @@ import { useState } from '@wordpress/element';
|
|
3 |
import { Button, Dashicon, Popover } from '@wordpress/components';
|
4 |
import { withDispatch, withSelect } from '@wordpress/data';
|
5 |
import { compose } from '@wordpress/compose';
|
|
|
6 |
|
7 |
const Search = ( {
|
8 |
count,
|
@@ -11,10 +12,11 @@ const Search = ( {
|
|
11 |
category,
|
12 |
setCurrentCategory,
|
13 |
query,
|
|
|
14 |
} ) => {
|
15 |
const [ open, setOpen ] = useState( false );
|
16 |
const toggleDropdown = () => setOpen( ! open );
|
17 |
-
const
|
18 |
return (
|
19 |
<div className="ob-dropdown categories-selector">
|
20 |
<Button
|
@@ -81,8 +83,10 @@ const Search = ( {
|
|
81 |
);
|
82 |
};
|
83 |
|
|
|
|
|
84 |
return (
|
85 |
-
<div className=
|
86 |
<div className="search">
|
87 |
<img
|
88 |
src={ tiobDash.assets + '/img/search.svg' }
|
@@ -101,7 +105,7 @@ const Search = ( {
|
|
101 |
) + '...'
|
102 |
}
|
103 |
/>
|
104 |
-
|
105 |
</div>
|
106 |
</div>
|
107 |
);
|
@@ -109,15 +113,21 @@ const Search = ( {
|
|
109 |
|
110 |
export default compose(
|
111 |
withSelect( ( select ) => {
|
112 |
-
const { getCurrentCategory } = select(
|
|
|
|
|
113 |
return {
|
114 |
category: getCurrentCategory(),
|
|
|
115 |
};
|
116 |
} ),
|
117 |
withDispatch( ( dispatch ) => {
|
118 |
-
const { setCurrentCategory } = dispatch(
|
|
|
|
|
119 |
return {
|
120 |
setCurrentCategory: ( category ) => setCurrentCategory( category ),
|
|
|
121 |
};
|
122 |
} )
|
123 |
)( Search );
|
3 |
import { Button, Dashicon, Popover } from '@wordpress/components';
|
4 |
import { withDispatch, withSelect } from '@wordpress/data';
|
5 |
import { compose } from '@wordpress/compose';
|
6 |
+
import classnames from 'classnames';
|
7 |
|
8 |
const Search = ( {
|
9 |
count,
|
12 |
category,
|
13 |
setCurrentCategory,
|
14 |
query,
|
15 |
+
className,
|
16 |
} ) => {
|
17 |
const [ open, setOpen ] = useState( false );
|
18 |
const toggleDropdown = () => setOpen( ! open );
|
19 |
+
const CategoriesDropdown = () => {
|
20 |
return (
|
21 |
<div className="ob-dropdown categories-selector">
|
22 |
<Button
|
83 |
);
|
84 |
};
|
85 |
|
86 |
+
const wrapClasses = classnames( className, 'header-form' );
|
87 |
+
|
88 |
return (
|
89 |
+
<div className={ wrapClasses }>
|
90 |
<div className="search">
|
91 |
<img
|
92 |
src={ tiobDash.assets + '/img/search.svg' }
|
105 |
) + '...'
|
106 |
}
|
107 |
/>
|
108 |
+
<CategoriesDropdown />
|
109 |
</div>
|
110 |
</div>
|
111 |
);
|
113 |
|
114 |
export default compose(
|
115 |
withSelect( ( select ) => {
|
116 |
+
const { getCurrentCategory, getSearchQuery } = select(
|
117 |
+
'neve-onboarding'
|
118 |
+
);
|
119 |
return {
|
120 |
category: getCurrentCategory(),
|
121 |
+
query: getSearchQuery(),
|
122 |
};
|
123 |
} ),
|
124 |
withDispatch( ( dispatch ) => {
|
125 |
+
const { setCurrentCategory, setSearchQuery } = dispatch(
|
126 |
+
'neve-onboarding'
|
127 |
+
);
|
128 |
return {
|
129 |
setCurrentCategory: ( category ) => setCurrentCategory( category ),
|
130 |
+
onSearch: ( query ) => setSearchQuery( query ),
|
131 |
};
|
132 |
} )
|
133 |
)( Search );
|
assets/src/Components/StarterSiteCard.js
CHANGED
@@ -1,8 +1,11 @@
|
|
1 |
-
|
2 |
-
import { __ } from '@wordpress/i18n';
|
3 |
import { withDispatch, withSelect } from '@wordpress/data';
|
4 |
-
import {
|
5 |
import { useState } from '@wordpress/element';
|
|
|
|
|
|
|
|
|
6 |
|
7 |
const StarterSiteCard = ( {
|
8 |
data,
|
@@ -11,8 +14,9 @@ const StarterSiteCard = ( {
|
|
11 |
setModal,
|
12 |
themeStatus,
|
13 |
setInstallModal,
|
|
|
14 |
} ) => {
|
15 |
-
const { upsell } = data;
|
16 |
const [ actionsClass, setActionClass ] = useState( '' );
|
17 |
|
18 |
const showActions = () => {
|
@@ -24,7 +28,7 @@ const StarterSiteCard = ( {
|
|
24 |
|
25 |
const launchImport = ( e ) => {
|
26 |
e.preventDefault();
|
27 |
-
setSite(
|
28 |
|
29 |
if ( themeStatus ) {
|
30 |
setInstallModal( true );
|
@@ -36,38 +40,62 @@ const StarterSiteCard = ( {
|
|
36 |
|
37 |
const launchPreview = ( e ) => {
|
38 |
e.preventDefault();
|
39 |
-
setSite(
|
40 |
setPreview( true );
|
41 |
};
|
42 |
|
|
|
|
|
|
|
|
|
43 |
return (
|
44 |
<div
|
45 |
onMouseEnter={ showActions }
|
46 |
onMouseLeave={ hideActions }
|
47 |
-
className=
|
48 |
>
|
49 |
<div className="top">
|
50 |
<div className={ 'actions ' + actionsClass }>
|
51 |
-
<Button
|
52 |
{ __( 'Preview', 'templates-patterns-collection' ) }
|
53 |
</Button>
|
54 |
{ ! upsell && (
|
55 |
-
<Button
|
|
|
|
|
|
|
|
|
56 |
{ __( 'Import', 'templates-patterns-collection' ) }
|
57 |
</Button>
|
58 |
) }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
</div>
|
60 |
-
{
|
61 |
<div
|
62 |
className="image"
|
63 |
style={ {
|
64 |
-
backgroundImage: `url("${
|
65 |
} }
|
66 |
/>
|
67 |
) }
|
68 |
</div>
|
69 |
<div className="bottom">
|
70 |
-
<p className="title">{
|
71 |
{ upsell && (
|
72 |
<span className="pro-badge">
|
73 |
<Dashicon icon="lock" size={ 15 } />
|
@@ -89,18 +117,21 @@ export default compose(
|
|
89 |
themeStatus: getThemeAction().action || false,
|
90 |
};
|
91 |
} ),
|
92 |
-
withDispatch( ( dispatch ) => {
|
|
|
93 |
const {
|
94 |
setCurrentSite,
|
95 |
setPreviewStatus,
|
96 |
setImportModalStatus,
|
97 |
setInstallModalStatus,
|
|
|
98 |
} = dispatch( 'neve-onboarding' );
|
99 |
return {
|
100 |
-
setSite: (
|
101 |
setPreview: ( status ) => setPreviewStatus( status ),
|
102 |
setModal: ( status ) => setImportModalStatus( status ),
|
103 |
setInstallModal: ( status ) => setInstallModalStatus( status ),
|
|
|
104 |
};
|
105 |
} )
|
106 |
)( StarterSiteCard );
|
1 |
+
/* eslint-disable camelcase */
|
|
|
2 |
import { withDispatch, withSelect } from '@wordpress/data';
|
3 |
+
import { Button, Dashicon } from '@wordpress/components';
|
4 |
import { useState } from '@wordpress/element';
|
5 |
+
import { compose } from '@wordpress/compose';
|
6 |
+
import { __ } from '@wordpress/i18n';
|
7 |
+
|
8 |
+
import classnames from 'classnames';
|
9 |
|
10 |
const StarterSiteCard = ( {
|
11 |
data,
|
14 |
setModal,
|
15 |
themeStatus,
|
16 |
setInstallModal,
|
17 |
+
setImportingPages,
|
18 |
} ) => {
|
19 |
+
const { upsell, slug, screenshot, title, has_templates } = data;
|
20 |
const [ actionsClass, setActionClass ] = useState( '' );
|
21 |
|
22 |
const showActions = () => {
|
28 |
|
29 |
const launchImport = ( e ) => {
|
30 |
e.preventDefault();
|
31 |
+
setSite();
|
32 |
|
33 |
if ( themeStatus ) {
|
34 |
setInstallModal( true );
|
40 |
|
41 |
const launchPreview = ( e ) => {
|
42 |
e.preventDefault();
|
43 |
+
setSite();
|
44 |
setPreview( true );
|
45 |
};
|
46 |
|
47 |
+
const cardClassNames = classnames( 'card starter-site-card', {
|
48 |
+
'has-templates': has_templates,
|
49 |
+
} );
|
50 |
+
|
51 |
return (
|
52 |
<div
|
53 |
onMouseEnter={ showActions }
|
54 |
onMouseLeave={ hideActions }
|
55 |
+
className={ cardClassNames }
|
56 |
>
|
57 |
<div className="top">
|
58 |
<div className={ 'actions ' + actionsClass }>
|
59 |
+
<Button isSecondary onClick={ launchPreview }>
|
60 |
{ __( 'Preview', 'templates-patterns-collection' ) }
|
61 |
</Button>
|
62 |
{ ! upsell && (
|
63 |
+
<Button
|
64 |
+
isPrimary
|
65 |
+
className="import"
|
66 |
+
onClick={ launchImport }
|
67 |
+
>
|
68 |
{ __( 'Import', 'templates-patterns-collection' ) }
|
69 |
</Button>
|
70 |
) }
|
71 |
+
{ has_templates && (
|
72 |
+
<Button
|
73 |
+
isLink
|
74 |
+
className="templates"
|
75 |
+
onClick={ ( e ) => {
|
76 |
+
e.preventDefault();
|
77 |
+
setSite();
|
78 |
+
setImportingPages();
|
79 |
+
} }
|
80 |
+
>
|
81 |
+
{ __(
|
82 |
+
'View Pages',
|
83 |
+
'templates-patterns-collection'
|
84 |
+
) }
|
85 |
+
</Button>
|
86 |
+
) }
|
87 |
</div>
|
88 |
+
{ screenshot && (
|
89 |
<div
|
90 |
className="image"
|
91 |
style={ {
|
92 |
+
backgroundImage: `url("${ screenshot }")`,
|
93 |
} }
|
94 |
/>
|
95 |
) }
|
96 |
</div>
|
97 |
<div className="bottom">
|
98 |
+
<p className="title">{ title }</p>
|
99 |
{ upsell && (
|
100 |
<span className="pro-badge">
|
101 |
<Dashicon icon="lock" size={ 15 } />
|
117 |
themeStatus: getThemeAction().action || false,
|
118 |
};
|
119 |
} ),
|
120 |
+
withDispatch( ( dispatch, { data } ) => {
|
121 |
+
const { slug } = data;
|
122 |
const {
|
123 |
setCurrentSite,
|
124 |
setPreviewStatus,
|
125 |
setImportModalStatus,
|
126 |
setInstallModalStatus,
|
127 |
+
setSingleTemplateImport,
|
128 |
} = dispatch( 'neve-onboarding' );
|
129 |
return {
|
130 |
+
setSite: () => setCurrentSite( data ),
|
131 |
setPreview: ( status ) => setPreviewStatus( status ),
|
132 |
setModal: ( status ) => setImportModalStatus( status ),
|
133 |
setInstallModal: ( status ) => setInstallModalStatus( status ),
|
134 |
+
setImportingPages: () => setSingleTemplateImport( slug ),
|
135 |
};
|
136 |
} )
|
137 |
)( StarterSiteCard );
|
assets/src/Components/StarterSites/Filters.js
ADDED
@@ -0,0 +1,159 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* global tiobDash */
|
2 |
+
|
3 |
+
import { withSelect, withDispatch } from '@wordpress/data';
|
4 |
+
import { compose } from '@wordpress/compose';
|
5 |
+
import { useState } from '@wordpress/element';
|
6 |
+
import { Icon } from '@wordpress/components';
|
7 |
+
|
8 |
+
import Logo from '../Icon';
|
9 |
+
import Search from '../Search';
|
10 |
+
import { CATEGORIES, EDITOR_MAP } from '../../utils/common';
|
11 |
+
import EditorSelector from '../EditorSelector';
|
12 |
+
import VizSensor from 'react-visibility-sensor';
|
13 |
+
import EditorTabs from '../EditorTabs';
|
14 |
+
|
15 |
+
const Filters = ( {
|
16 |
+
filterByCategory,
|
17 |
+
filterBySearch,
|
18 |
+
getSitesForBuilder,
|
19 |
+
isOnboarding,
|
20 |
+
getSites,
|
21 |
+
category,
|
22 |
+
editor,
|
23 |
+
} ) => {
|
24 |
+
const [ sticky, setSticky ] = useState( false );
|
25 |
+
const { sites = {}, migration } = getSites;
|
26 |
+
const stickyNavStyle = { top: sticky ? 0 : '-100%' };
|
27 |
+
|
28 |
+
const builders = Object.keys( sites );
|
29 |
+
|
30 |
+
const onlyProBuilders = builders.filter( ( builder ) => {
|
31 |
+
const upsellSitesCount = Object.keys( sites[ builder ] ).filter(
|
32 |
+
( site ) => true === sites[ builder ][ site ].upsell
|
33 |
+
).length;
|
34 |
+
const sitesCount = Object.keys( sites[ builder ] ).length;
|
35 |
+
|
36 |
+
return upsellSitesCount === sitesCount;
|
37 |
+
} );
|
38 |
+
|
39 |
+
const getCounts = () => {
|
40 |
+
const counts = {
|
41 |
+
builders: {},
|
42 |
+
categories: {},
|
43 |
+
};
|
44 |
+
|
45 |
+
builders.forEach( ( builder ) => {
|
46 |
+
let buildersFiltered = getSitesForBuilder( builder );
|
47 |
+
buildersFiltered = filterByCategory( buildersFiltered, category );
|
48 |
+
buildersFiltered = filterBySearch( buildersFiltered );
|
49 |
+
counts.builders[ builder ] = buildersFiltered
|
50 |
+
? buildersFiltered.length
|
51 |
+
: 0;
|
52 |
+
} );
|
53 |
+
|
54 |
+
Object.keys( CATEGORIES ).forEach( ( singleCat ) => {
|
55 |
+
let categoriesFiltered = getSitesForBuilder( editor );
|
56 |
+
categoriesFiltered = filterByCategory(
|
57 |
+
categoriesFiltered,
|
58 |
+
singleCat
|
59 |
+
);
|
60 |
+
categoriesFiltered = filterBySearch( categoriesFiltered );
|
61 |
+
counts.categories[ singleCat ] = categoriesFiltered
|
62 |
+
? categoriesFiltered.length
|
63 |
+
: 0;
|
64 |
+
} );
|
65 |
+
|
66 |
+
return counts;
|
67 |
+
};
|
68 |
+
|
69 |
+
const counted = getCounts();
|
70 |
+
|
71 |
+
return (
|
72 |
+
<>
|
73 |
+
{ ! isOnboarding && ! migration && (
|
74 |
+
<div className="sticky-nav" style={ stickyNavStyle }>
|
75 |
+
<div className="container sticky-nav-content">
|
76 |
+
{ ! tiobDash.brandedTheme && (
|
77 |
+
<Icon icon={ Logo } size={ 32 } />
|
78 |
+
) }
|
79 |
+
<Search
|
80 |
+
className="in-sticky"
|
81 |
+
count={ counted.categories }
|
82 |
+
categories={ CATEGORIES }
|
83 |
+
/>
|
84 |
+
<EditorSelector
|
85 |
+
isSmall
|
86 |
+
count={ counted.builders }
|
87 |
+
EDITOR_MAP={ EDITOR_MAP }
|
88 |
+
/>
|
89 |
+
</div>
|
90 |
+
</div>
|
91 |
+
) }
|
92 |
+
<VizSensor
|
93 |
+
onChange={ ( isVisible ) => {
|
94 |
+
if ( ! isVisible ) {
|
95 |
+
setSticky( true );
|
96 |
+
} else {
|
97 |
+
setSticky( false );
|
98 |
+
}
|
99 |
+
} }
|
100 |
+
>
|
101 |
+
<div>
|
102 |
+
{ ! isOnboarding && (
|
103 |
+
<p className="instructions">
|
104 |
+
{ tiobDash.strings.starterSitesTabDescription }
|
105 |
+
</p>
|
106 |
+
) }
|
107 |
+
<EditorSelector
|
108 |
+
count={ counted.builders }
|
109 |
+
EDITOR_MAP={ EDITOR_MAP }
|
110 |
+
/>
|
111 |
+
|
112 |
+
<Search
|
113 |
+
count={ counted.categories }
|
114 |
+
categories={ CATEGORIES }
|
115 |
+
/>
|
116 |
+
|
117 |
+
<EditorTabs
|
118 |
+
EDITOR_MAP={ EDITOR_MAP }
|
119 |
+
onlyProSites={ onlyProBuilders }
|
120 |
+
count={ counted.builders }
|
121 |
+
/>
|
122 |
+
</div>
|
123 |
+
</VizSensor>
|
124 |
+
</>
|
125 |
+
);
|
126 |
+
};
|
127 |
+
|
128 |
+
export default compose(
|
129 |
+
withDispatch( ( dispatch ) => {
|
130 |
+
const {
|
131 |
+
setOnboardingState,
|
132 |
+
setCurrentCategory,
|
133 |
+
setCurrentTab,
|
134 |
+
} = dispatch( 'neve-onboarding' );
|
135 |
+
return {
|
136 |
+
cancelOnboarding: () => {
|
137 |
+
setOnboardingState( false );
|
138 |
+
},
|
139 |
+
resetCategory: () => {
|
140 |
+
setCurrentCategory( 'all' );
|
141 |
+
},
|
142 |
+
setCurrentTab,
|
143 |
+
};
|
144 |
+
} ),
|
145 |
+
withSelect( ( select ) => {
|
146 |
+
const {
|
147 |
+
getCurrentEditor,
|
148 |
+
getCurrentCategory,
|
149 |
+
getOnboardingStatus,
|
150 |
+
getSites,
|
151 |
+
} = select( 'neve-onboarding' );
|
152 |
+
return {
|
153 |
+
editor: getCurrentEditor(),
|
154 |
+
category: getCurrentCategory(),
|
155 |
+
isOnboarding: getOnboardingStatus(),
|
156 |
+
getSites: getSites(),
|
157 |
+
};
|
158 |
+
} )
|
159 |
+
)( Filters );
|
assets/src/scss/_card.scss
CHANGED
@@ -6,6 +6,7 @@
|
|
6 |
border: 1px solid $grey;
|
7 |
flex-direction: column;
|
8 |
padding: 30px 40px;
|
|
|
9 |
align-self: flex-start;
|
10 |
flex-grow: 0;
|
11 |
|
@@ -45,21 +46,13 @@
|
|
45 |
margin: 15px 0 25px;
|
46 |
}
|
47 |
}
|
48 |
-
|
49 |
-
@mixin card--laptop() {
|
50 |
-
.card {
|
51 |
-
margin: 0 0 20px;
|
52 |
-
}
|
53 |
-
}
|
54 |
@mixin card--desktop() {
|
55 |
.card {
|
56 |
padding: 20px 30px;
|
57 |
-
margin: 0 0 20px;
|
58 |
}
|
59 |
}
|
60 |
@mixin card--desktop-large() {
|
61 |
.card {
|
62 |
padding: 30px 40px;
|
63 |
-
margin: 0 0 30px;
|
64 |
}
|
65 |
}
|
6 |
border: 1px solid $grey;
|
7 |
flex-direction: column;
|
8 |
padding: 30px 40px;
|
9 |
+
margin: 0;
|
10 |
align-self: flex-start;
|
11 |
flex-grow: 0;
|
12 |
|
46 |
margin: 15px 0 25px;
|
47 |
}
|
48 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
@mixin card--desktop() {
|
50 |
.card {
|
51 |
padding: 20px 30px;
|
|
|
52 |
}
|
53 |
}
|
54 |
@mixin card--desktop-large() {
|
55 |
.card {
|
56 |
padding: 30px 40px;
|
|
|
57 |
}
|
58 |
}
|
assets/src/scss/_demo-site-templates.scss
ADDED
@@ -0,0 +1,113 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.single-templates-wrapper {
|
2 |
+
|
3 |
+
.components-spinner {
|
4 |
+
display: block;
|
5 |
+
margin: 0 auto;
|
6 |
+
}
|
7 |
+
|
8 |
+
.top {
|
9 |
+
padding: 25px 0 30px;
|
10 |
+
}
|
11 |
+
|
12 |
+
.header {
|
13 |
+
display: flex;
|
14 |
+
flex-direction: column;
|
15 |
+
|
16 |
+
h1 {
|
17 |
+
display: flex;
|
18 |
+
align-items: center;
|
19 |
+
font-size: 26px;
|
20 |
+
font-weight: 700;
|
21 |
+
}
|
22 |
+
|
23 |
+
.actions {
|
24 |
+
margin-top: 15px;
|
25 |
+
|
26 |
+
.components-button {
|
27 |
+
font-weight: 600;
|
28 |
+
font-size: 14px;
|
29 |
+
height: auto;
|
30 |
+
border-radius: 4px;
|
31 |
+
|
32 |
+
&:not(:first-child) {
|
33 |
+
margin-left: 20px;
|
34 |
+
}
|
35 |
+
|
36 |
+
&.is-primary {
|
37 |
+
padding: 10px 30px;
|
38 |
+
}
|
39 |
+
|
40 |
+
&.is-secondary {
|
41 |
+
border: 2px solid;
|
42 |
+
padding: 8px 20px;
|
43 |
+
}
|
44 |
+
}
|
45 |
+
}
|
46 |
+
|
47 |
+
.description {
|
48 |
+
font-size: 16px;
|
49 |
+
color: $black;
|
50 |
+
}
|
51 |
+
|
52 |
+
.pro-badge {
|
53 |
+
font-size: 11px;
|
54 |
+
margin-left: 20px;
|
55 |
+
}
|
56 |
+
}
|
57 |
+
|
58 |
+
}
|
59 |
+
|
60 |
+
@mixin demo-site-templates--laptop() {
|
61 |
+
.single-templates-wrapper {
|
62 |
+
.header {
|
63 |
+
flex-direction: row;
|
64 |
+
align-items: flex-start;
|
65 |
+
|
66 |
+
h1 {
|
67 |
+
font-size: 30px;
|
68 |
+
}
|
69 |
+
}
|
70 |
+
|
71 |
+
.description {
|
72 |
+
font-size: 20px;
|
73 |
+
}
|
74 |
+
|
75 |
+
.actions {
|
76 |
+
margin-left: auto;
|
77 |
+
}
|
78 |
+
}
|
79 |
+
}
|
80 |
+
|
81 |
+
@mixin demo-site-templates--desktop() {
|
82 |
+
.single-templates-wrapper {
|
83 |
+
.actions {
|
84 |
+
margin-left: auto;
|
85 |
+
}
|
86 |
+
}
|
87 |
+
}
|
88 |
+
|
89 |
+
// PREVIEW FRAME
|
90 |
+
.ob-preview.single-templates {
|
91 |
+
.actions {
|
92 |
+
.components-button {
|
93 |
+
font-weight: 600;
|
94 |
+
font-size: 14px;
|
95 |
+
height: auto;
|
96 |
+
border-radius: 4px;
|
97 |
+
|
98 |
+
&:not(:first-child) {
|
99 |
+
margin-left: 20px;
|
100 |
+
}
|
101 |
+
|
102 |
+
&.is-primary {
|
103 |
+
padding: 10px 30px;
|
104 |
+
}
|
105 |
+
|
106 |
+
&.is-secondary {
|
107 |
+
border: 2px solid;
|
108 |
+
padding: 8px 20px;
|
109 |
+
}
|
110 |
+
}
|
111 |
+
}
|
112 |
+
}
|
113 |
+
|
assets/src/scss/_general.scss
CHANGED
@@ -2,6 +2,13 @@
|
|
2 |
padding-left: 0 !important;
|
3 |
}
|
4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
#wpbody-content > {
|
6 |
.error, .info, .notice {
|
7 |
display: none !important;
|
@@ -18,12 +25,17 @@
|
|
18 |
}
|
19 |
}
|
20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
.container {
|
22 |
padding: 0 15px;
|
23 |
|
24 |
&.content {
|
25 |
-
padding
|
26 |
-
position: relative;
|
27 |
}
|
28 |
}
|
29 |
|
@@ -101,10 +113,6 @@ svg.is-loading, button.is-loading svg {
|
|
101 |
}
|
102 |
|
103 |
@mixin general--desktop-large() {
|
104 |
-
.container {
|
105 |
-
padding: 0 50px;
|
106 |
-
max-width: 1300px;
|
107 |
-
}
|
108 |
.col {
|
109 |
&:not(:last-child) {
|
110 |
margin-right: 30px;
|
@@ -178,6 +186,7 @@ svg.is-loading, button.is-loading svg {
|
|
178 |
}
|
179 |
|
180 |
.ob-migration {
|
|
|
181 |
text-align: center;
|
182 |
|
183 |
h2 {
|
@@ -190,6 +199,7 @@ svg.is-loading, button.is-loading svg {
|
|
190 |
}
|
191 |
|
192 |
.ob-head {
|
|
|
193 |
margin: 0 0 20px;
|
194 |
display: flex;
|
195 |
justify-content: flex-end;
|
@@ -204,23 +214,98 @@ svg.is-loading, button.is-loading svg {
|
|
204 |
}
|
205 |
}
|
206 |
}
|
|
|
|
|
|
|
|
|
207 |
}
|
208 |
|
209 |
.ob {
|
210 |
width: 100%;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
211 |
}
|
212 |
|
213 |
.ob-sites {
|
214 |
-
|
215 |
-
|
216 |
-
|
|
|
|
|
|
|
|
|
|
|
217 |
}
|
218 |
|
219 |
@mixin ob-general--laptop() {
|
220 |
.content-wrap.is-onboarding {
|
221 |
.content {
|
|
|
|
|
222 |
box-shadow: 0 0 10px -5px rgba(0, 0, 0, 0.5);
|
223 |
-
padding: 35px 40px 35px;
|
224 |
border: 1px solid $grey;
|
225 |
margin: 40px auto 30px;
|
226 |
}
|
@@ -228,17 +313,21 @@ svg.is-loading, button.is-loading svg {
|
|
228 |
margin-top: 0;
|
229 |
}
|
230 |
}
|
231 |
-
|
232 |
.ob-sites {
|
233 |
-
|
|
|
|
|
234 |
}
|
|
|
235 |
|
236 |
-
|
237 |
-
|
|
|
|
|
|
|
238 |
}
|
239 |
}
|
240 |
|
241 |
-
|
242 |
.no-results {
|
243 |
display: flex;
|
244 |
flex-direction: column;
|
2 |
padding-left: 0 !important;
|
3 |
}
|
4 |
|
5 |
+
.content-container {
|
6 |
+
padding: 0 20px;
|
7 |
+
flex-basis: 100%;
|
8 |
+
max-width: 1300px;
|
9 |
+
margin: 0 auto;
|
10 |
+
}
|
11 |
+
|
12 |
#wpbody-content > {
|
13 |
.error, .info, .notice {
|
14 |
display: none !important;
|
25 |
}
|
26 |
}
|
27 |
|
28 |
+
@media screen and (min-width: #{$laptop}) {
|
29 |
+
.ob-import-modal {
|
30 |
+
width: 700px !important;
|
31 |
+
}
|
32 |
+
}
|
33 |
+
|
34 |
.container {
|
35 |
padding: 0 15px;
|
36 |
|
37 |
&.content {
|
38 |
+
padding: 0;
|
|
|
39 |
}
|
40 |
}
|
41 |
|
113 |
}
|
114 |
|
115 |
@mixin general--desktop-large() {
|
|
|
|
|
|
|
|
|
116 |
.col {
|
117 |
&:not(:last-child) {
|
118 |
margin-right: 30px;
|
186 |
}
|
187 |
|
188 |
.ob-migration {
|
189 |
+
padding-top: 0;
|
190 |
text-align: center;
|
191 |
|
192 |
h2 {
|
199 |
}
|
200 |
|
201 |
.ob-head {
|
202 |
+
padding: 20px 0 0;
|
203 |
margin: 0 0 20px;
|
204 |
display: flex;
|
205 |
justify-content: flex-end;
|
214 |
}
|
215 |
}
|
216 |
}
|
217 |
+
|
218 |
+
.content-container {
|
219 |
+
padding: 0;
|
220 |
+
}
|
221 |
}
|
222 |
|
223 |
.ob {
|
224 |
width: 100%;
|
225 |
+
display: flex;
|
226 |
+
flex-direction: column;
|
227 |
+
align-items: center;
|
228 |
+
|
229 |
+
.ob-head {
|
230 |
+
box-sizing: border-box;
|
231 |
+
padding: 20px;
|
232 |
+
background: #ffffff;
|
233 |
+
width: 100%;
|
234 |
+
display: flex;
|
235 |
+
justify-content: center;
|
236 |
+
|
237 |
+
.header-container {
|
238 |
+
display: flex;
|
239 |
+
flex-basis: 100%;
|
240 |
+
max-width: 1300px;
|
241 |
+
|
242 |
+
h2 {
|
243 |
+
flex-basis: 40%;
|
244 |
+
}
|
245 |
+
|
246 |
+
.header-nav {
|
247 |
+
flex-basis: 60%;
|
248 |
+
display: flex;
|
249 |
+
justify-content: flex-end;
|
250 |
+
align-items: center;
|
251 |
+
|
252 |
+
.components-button {
|
253 |
+
font-size: 18px;
|
254 |
+
font-weight: 600;
|
255 |
+
color: $black;
|
256 |
+
margin-left: 25px;
|
257 |
+
|
258 |
+
&:hover {
|
259 |
+
box-shadow: none;
|
260 |
+
}
|
261 |
+
|
262 |
+
&:first-child {
|
263 |
+
margin-left: 0;
|
264 |
+
}
|
265 |
+
|
266 |
+
&.is-pressed {
|
267 |
+
color: #0073AA;
|
268 |
+
background: transparent;
|
269 |
+
}
|
270 |
+
}
|
271 |
+
}
|
272 |
+
}
|
273 |
+
}
|
274 |
+
|
275 |
+
.ob-body {
|
276 |
+
width: 100%;
|
277 |
+
box-sizing: border-box;
|
278 |
+
|
279 |
+
.instructions {
|
280 |
+
font-size: 22px;
|
281 |
+
margin: 20px 0;
|
282 |
+
color: $black;
|
283 |
+
}
|
284 |
+
}
|
285 |
+
}
|
286 |
+
|
287 |
+
.ob-logo {
|
288 |
+
width: 50px;
|
289 |
+
margin-right: 20px;
|
290 |
}
|
291 |
|
292 |
.ob-sites {
|
293 |
+
margin-top: 30px;
|
294 |
+
|
295 |
+
&.is-grid {
|
296 |
+
display: grid;
|
297 |
+
grid-template-columns: 1fr;
|
298 |
+
grid-column-gap: 20px;
|
299 |
+
grid-row-gap: 20px;
|
300 |
+
}
|
301 |
}
|
302 |
|
303 |
@mixin ob-general--laptop() {
|
304 |
.content-wrap.is-onboarding {
|
305 |
.content {
|
306 |
+
max-width: 1300px;
|
307 |
+
padding: 15px 40px 35px;
|
308 |
box-shadow: 0 0 10px -5px rgba(0, 0, 0, 0.5);
|
|
|
309 |
border: 1px solid $grey;
|
310 |
margin: 40px auto 30px;
|
311 |
}
|
313 |
margin-top: 0;
|
314 |
}
|
315 |
}
|
|
|
316 |
.ob-sites {
|
317 |
+
&.is-grid {
|
318 |
+
grid-template-columns: 1fr 1fr 1fr;
|
319 |
+
}
|
320 |
}
|
321 |
+
}
|
322 |
|
323 |
+
@mixin ob-general--tablet() {
|
324 |
+
.ob-sites {
|
325 |
+
&.is-grid {
|
326 |
+
grid-template-columns: 1fr 1fr;
|
327 |
+
}
|
328 |
}
|
329 |
}
|
330 |
|
|
|
331 |
.no-results {
|
332 |
display: flex;
|
333 |
flex-direction: column;
|
assets/src/scss/_header.scss
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
.ob-migration {
|
|
|
2 |
margin-bottom: 20px;
|
3 |
|
4 |
.card.starter-site-card {
|
@@ -21,7 +22,7 @@
|
|
21 |
}
|
22 |
}
|
23 |
|
24 |
-
.ob-head >, .ob-migration > {
|
25 |
h2 {
|
26 |
font-size: 21px;
|
27 |
color: $black;
|
@@ -29,6 +30,7 @@
|
|
29 |
line-height: 1.6;
|
30 |
display: flex;
|
31 |
align-items: center;
|
|
|
32 |
> img {
|
33 |
margin-right: 20px;
|
34 |
}
|
@@ -64,7 +66,7 @@
|
|
64 |
}
|
65 |
|
66 |
@mixin ob-header--tablet {
|
67 |
-
.ob-head >, .ob-migration > {
|
68 |
h2 {
|
69 |
font-size: 30px;
|
70 |
}
|
@@ -80,6 +82,25 @@
|
|
80 |
|
81 |
@mixin ob-header--laptop {
|
82 |
.header-form {
|
83 |
-
margin-top:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
}
|
85 |
}
|
1 |
.ob-migration {
|
2 |
+
padding-top: 20px;
|
3 |
margin-bottom: 20px;
|
4 |
|
5 |
.card.starter-site-card {
|
22 |
}
|
23 |
}
|
24 |
|
25 |
+
.ob-head > .header-container >, .ob-migration > {
|
26 |
h2 {
|
27 |
font-size: 21px;
|
28 |
color: $black;
|
30 |
line-height: 1.6;
|
31 |
display: flex;
|
32 |
align-items: center;
|
33 |
+
|
34 |
> img {
|
35 |
margin-right: 20px;
|
36 |
}
|
66 |
}
|
67 |
|
68 |
@mixin ob-header--tablet {
|
69 |
+
.ob-head > .header-container >, .ob-migration > {
|
70 |
h2 {
|
71 |
font-size: 30px;
|
72 |
}
|
82 |
|
83 |
@mixin ob-header--laptop {
|
84 |
.header-form {
|
85 |
+
margin-top: 25px;
|
86 |
+
}
|
87 |
+
}
|
88 |
+
|
89 |
+
|
90 |
+
.is-sync {
|
91 |
+
background-color: #f1f1f1;
|
92 |
+
color: #0073aa !important;
|
93 |
+
border-radius: 6px;
|
94 |
+
|
95 |
+
&:before {
|
96 |
+
padding: 10px 5px 10px 15px;
|
97 |
+
content: attr(data-content);
|
98 |
+
margin-right: 5px;
|
99 |
+
font-size: 15px;
|
100 |
+
display: none;
|
101 |
+
}
|
102 |
+
|
103 |
+
&:hover:before {
|
104 |
+
display: block;
|
105 |
}
|
106 |
}
|
assets/src/scss/_import-modal.scss
CHANGED
@@ -29,6 +29,32 @@ $base-index: 100000;
|
|
29 |
.ob-import-modal {
|
30 |
background-color: #fff;
|
31 |
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
|
33 |
.components-tooltip {
|
34 |
display: none;
|
@@ -48,12 +74,10 @@ $base-index: 100000;
|
|
48 |
|
49 |
.well {
|
50 |
margin: 0;
|
51 |
-
padding: 10px;
|
52 |
-
border:
|
53 |
-
|
54 |
-
color:
|
55 |
-
border-color: $info;
|
56 |
-
background-color: lighten($info, 27);
|
57 |
|
58 |
ol {
|
59 |
padding: 0;
|
@@ -61,6 +85,7 @@ $base-index: 100000;
|
|
61 |
|
62 |
li {
|
63 |
margin-bottom: 10px;
|
|
|
64 |
|
65 |
&:last-child {
|
66 |
margin-bottom: 0;
|
@@ -69,21 +94,27 @@ $base-index: 100000;
|
|
69 |
}
|
70 |
|
71 |
ul {
|
72 |
-
margin:
|
73 |
padding: 0;
|
|
|
74 |
|
75 |
li {
|
|
|
76 |
margin-bottom: 10px;
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
}
|
78 |
}
|
79 |
|
80 |
&.error {
|
81 |
-
border-color: $error;
|
82 |
background-color: lighten($error, 27);
|
83 |
}
|
84 |
|
85 |
&.warning {
|
86 |
-
border-color: $warning;
|
87 |
background-color: lighten($warning, 27);
|
88 |
}
|
89 |
}
|
@@ -95,48 +126,6 @@ $base-index: 100000;
|
|
95 |
height: 0;
|
96 |
}
|
97 |
|
98 |
-
.options {
|
99 |
-
ul {
|
100 |
-
margin: 10px 0 0 0;
|
101 |
-
}
|
102 |
-
|
103 |
-
li {
|
104 |
-
padding: 15px 0 0;
|
105 |
-
display: flex;
|
106 |
-
align-items: center;
|
107 |
-
margin-bottom: 0;
|
108 |
-
font-size: 15px;
|
109 |
-
color: $black;
|
110 |
-
|
111 |
-
&:not(:last-child) {
|
112 |
-
padding-bottom: 15px;
|
113 |
-
border-bottom: 1px solid transparentize($grey, .5);
|
114 |
-
}
|
115 |
-
|
116 |
-
svg {
|
117 |
-
margin-right: 15px;
|
118 |
-
opacity: .5;
|
119 |
-
|
120 |
-
&.active {
|
121 |
-
opacity: 1;
|
122 |
-
color: $blue;
|
123 |
-
}
|
124 |
-
}
|
125 |
-
}
|
126 |
-
|
127 |
-
.toggle-wrapper {
|
128 |
-
margin-left: auto;
|
129 |
-
|
130 |
-
span {
|
131 |
-
margin-right: 0;
|
132 |
-
}
|
133 |
-
|
134 |
-
div {
|
135 |
-
margin-bottom: 0;
|
136 |
-
}
|
137 |
-
}
|
138 |
-
}
|
139 |
-
|
140 |
.import-result {
|
141 |
font-size: 15px;
|
142 |
}
|
@@ -146,16 +135,19 @@ $base-index: 100000;
|
|
146 |
display: flex;
|
147 |
align-items: center;
|
148 |
|
149 |
-
.
|
150 |
-
padding:
|
|
|
|
|
|
|
|
|
|
|
151 |
}
|
152 |
|
153 |
-
button:not(.close), a {
|
154 |
-
margin-left: auto;
|
155 |
-
padding: 5px 25px;
|
156 |
|
|
|
157 |
&:last-child {
|
158 |
-
margin-left:
|
159 |
|
160 |
&:only-child {
|
161 |
margin-left: auto;
|
@@ -166,7 +158,7 @@ $base-index: 100000;
|
|
166 |
}
|
167 |
|
168 |
.ob-import-modal.fetching {
|
169 |
-
pointer-events: none;
|
170 |
|
171 |
.title {
|
172 |
width: 200px;
|
@@ -178,11 +170,20 @@ $base-index: 100000;
|
|
178 |
animation: 1.5s loading-placeholder ease-in-out infinite;
|
179 |
background-color: $black;
|
180 |
height: 20px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
181 |
}
|
182 |
|
183 |
.well {
|
184 |
animation: 1.5s loading-placeholder-high-opacity ease-in-out infinite;
|
185 |
-
opacity: 1;
|
186 |
height: inherit !important;
|
187 |
background-color: inherit !important;
|
188 |
|
@@ -255,3 +256,84 @@ $base-index: 100000;
|
|
255 |
}
|
256 |
}
|
257 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
.ob-import-modal {
|
30 |
background-color: #fff;
|
31 |
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
|
32 |
+
.components-modal__content {
|
33 |
+
padding: 0 30px 40px;
|
34 |
+
}
|
35 |
+
.components-modal__header {
|
36 |
+
border: none;
|
37 |
+
margin-bottom: 10px !important;
|
38 |
+
}
|
39 |
+
|
40 |
+
.header {
|
41 |
+
margin-bottom: 15px;
|
42 |
+
|
43 |
+
h1 {
|
44 |
+
margin-top: 0;
|
45 |
+
font-size: 25px;
|
46 |
+
font-weight: 700;
|
47 |
+
color: #000;
|
48 |
+
line-height: normal;
|
49 |
+
margin-bottom: 10px;
|
50 |
+
}
|
51 |
+
|
52 |
+
p.description {
|
53 |
+
font-size: 20px;
|
54 |
+
line-height: 34px;
|
55 |
+
color: #000;
|
56 |
+
}
|
57 |
+
}
|
58 |
|
59 |
.components-tooltip {
|
60 |
display: none;
|
74 |
|
75 |
.well {
|
76 |
margin: 0;
|
77 |
+
padding: 20px 10px;
|
78 |
+
border-radius: 6px;
|
79 |
+
color: #616161;
|
80 |
+
background-color: rgba(249, 215, 128, 0.24);
|
|
|
|
|
81 |
|
82 |
ol {
|
83 |
padding: 0;
|
85 |
|
86 |
li {
|
87 |
margin-bottom: 10px;
|
88 |
+
font-size: 15px;
|
89 |
|
90 |
&:last-child {
|
91 |
margin-bottom: 0;
|
94 |
}
|
95 |
|
96 |
ul {
|
97 |
+
margin: 0 0 0 20px;
|
98 |
padding: 0;
|
99 |
+
list-style: disc;
|
100 |
|
101 |
li {
|
102 |
+
font-size: 15px;
|
103 |
margin-bottom: 10px;
|
104 |
+
font-weight: 400;
|
105 |
+
|
106 |
+
|
107 |
+
&:last-child {
|
108 |
+
margin-bottom: 0;
|
109 |
+
}
|
110 |
}
|
111 |
}
|
112 |
|
113 |
&.error {
|
|
|
114 |
background-color: lighten($error, 27);
|
115 |
}
|
116 |
|
117 |
&.warning {
|
|
|
118 |
background-color: lighten($warning, 27);
|
119 |
}
|
120 |
}
|
126 |
height: 0;
|
127 |
}
|
128 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
129 |
.import-result {
|
130 |
font-size: 15px;
|
131 |
}
|
135 |
display: flex;
|
136 |
align-items: center;
|
137 |
|
138 |
+
.import {
|
139 |
+
padding: 10px 30px;
|
140 |
+
margin-left: auto;
|
141 |
+
font-weight: 600;
|
142 |
+
font-size: 14px;
|
143 |
+
height: auto;
|
144 |
+
border-radius: 4px;
|
145 |
}
|
146 |
|
|
|
|
|
|
|
147 |
|
148 |
+
button, a {
|
149 |
&:last-child {
|
150 |
+
margin-left: auto;
|
151 |
|
152 |
&:only-child {
|
153 |
margin-left: auto;
|
158 |
}
|
159 |
|
160 |
.ob-import-modal.fetching {
|
161 |
+
//pointer-events: none;
|
162 |
|
163 |
.title {
|
164 |
width: 200px;
|
170 |
animation: 1.5s loading-placeholder ease-in-out infinite;
|
171 |
background-color: $black;
|
172 |
height: 20px;
|
173 |
+
|
174 |
+
&.button {
|
175 |
+
background-color: #007cba;
|
176 |
+
height: 39px;
|
177 |
+
}
|
178 |
+
|
179 |
+
&.link {
|
180 |
+
width: 100px;
|
181 |
+
background-color: #007cba;
|
182 |
+
}
|
183 |
}
|
184 |
|
185 |
.well {
|
186 |
animation: 1.5s loading-placeholder-high-opacity ease-in-out infinite;
|
|
|
187 |
height: inherit !important;
|
188 |
background-color: inherit !important;
|
189 |
|
256 |
}
|
257 |
}
|
258 |
}
|
259 |
+
|
260 |
+
.modal-toggles {
|
261 |
+
margin-top: 10px;
|
262 |
+
border: none;
|
263 |
+
|
264 |
+
.options {
|
265 |
+
border: none;
|
266 |
+
padding: 10px;
|
267 |
+
|
268 |
+
.components-panel__body-title {
|
269 |
+
margin: -10px -10px 0 -10px !important;
|
270 |
+
}
|
271 |
+
|
272 |
+
button {
|
273 |
+
font-size: 19px;
|
274 |
+
font-weight: 700;
|
275 |
+
line-height: 30px;
|
276 |
+
|
277 |
+
svg {
|
278 |
+
width: 30px;
|
279 |
+
height: 30px;
|
280 |
+
}
|
281 |
+
}
|
282 |
+
}
|
283 |
+
|
284 |
+
.option-row {
|
285 |
+
justify-content: flex-start;
|
286 |
+
border-bottom: 1px solid transparentize($black, .9);
|
287 |
+
margin: 0;
|
288 |
+
padding: 10px 0;
|
289 |
+
display: flex;
|
290 |
+
align-items: center;
|
291 |
+
|
292 |
+
span {
|
293 |
+
font-size: 15px;
|
294 |
+
margin-left: 20px;
|
295 |
+
color: $black;
|
296 |
+
}
|
297 |
+
|
298 |
+
.actions {
|
299 |
+
margin-left: auto;
|
300 |
+
}
|
301 |
+
|
302 |
+
.dashicon {
|
303 |
+
margin-left: 10px;
|
304 |
+
fill: #d9d9d9;
|
305 |
+
|
306 |
+
&.active {
|
307 |
+
fill: $blue;
|
308 |
+
}
|
309 |
+
}
|
310 |
+
|
311 |
+
.toggle-wrapper {
|
312 |
+
margin-left: auto;
|
313 |
+
|
314 |
+
.components-form-toggle {
|
315 |
+
margin: 0;
|
316 |
+
}
|
317 |
+
}
|
318 |
+
}
|
319 |
+
}
|
320 |
+
|
321 |
+
.import-done-actions {
|
322 |
+
display: flex;
|
323 |
+
align-items: center;
|
324 |
+
width: 100%;
|
325 |
+
|
326 |
+
.components-button.is-secondary {
|
327 |
+
margin-left: auto;
|
328 |
+
border: 2px solid;
|
329 |
+
padding: 8px 20px;
|
330 |
+
font-weight: 600;
|
331 |
+
font-size: 14px;
|
332 |
+
height: auto;
|
333 |
+
border-radius: 4px;
|
334 |
+
}
|
335 |
+
|
336 |
+
.import {
|
337 |
+
margin-left: 20px !important;
|
338 |
+
}
|
339 |
+
}
|
assets/src/scss/_library.scss
ADDED
@@ -0,0 +1,243 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.table {
|
2 |
+
.table-row {
|
3 |
+
display: flex;
|
4 |
+
height: 60px;
|
5 |
+
align-items: center;
|
6 |
+
padding: 0 25px;
|
7 |
+
background: #fff;
|
8 |
+
border: 1px solid rgba(0, 0, 0, 0.11);
|
9 |
+
border-top: none;
|
10 |
+
|
11 |
+
&:first-child {
|
12 |
+
border-top: 1px solid rgba(0, 0, 0, 0.11);
|
13 |
+
}
|
14 |
+
|
15 |
+
svg {
|
16 |
+
height: 24px;
|
17 |
+
margin-right: 10px;
|
18 |
+
fill: #b9b9b9;
|
19 |
+
}
|
20 |
+
|
21 |
+
.title {
|
22 |
+
display: flex;
|
23 |
+
align-items: center;
|
24 |
+
|
25 |
+
.components-base-control__field {
|
26 |
+
margin: 0;
|
27 |
+
}
|
28 |
+
}
|
29 |
+
|
30 |
+
.controls {
|
31 |
+
margin-left: auto;
|
32 |
+
display: flex;
|
33 |
+
align-items: center;
|
34 |
+
|
35 |
+
button {
|
36 |
+
padding: 6px 30px;
|
37 |
+
font-weight: 600;
|
38 |
+
color: #b9b9b9;
|
39 |
+
}
|
40 |
+
}
|
41 |
+
|
42 |
+
.actions {
|
43 |
+
display: flex;
|
44 |
+
margin-left: 50px;
|
45 |
+
justify-content: flex-end;
|
46 |
+
|
47 |
+
&.no-controls {
|
48 |
+
margin-left: auto;
|
49 |
+
}
|
50 |
+
|
51 |
+
.components-button {
|
52 |
+
padding: 6px 30px;
|
53 |
+
|
54 |
+
&.is-primary {
|
55 |
+
margin-left: 10px;
|
56 |
+
}
|
57 |
+
}
|
58 |
+
}
|
59 |
+
}
|
60 |
+
}
|
61 |
+
|
62 |
+
.filters {
|
63 |
+
display: flex;
|
64 |
+
align-items: center;
|
65 |
+
margin-bottom: 40px;
|
66 |
+
|
67 |
+
.components-base-control, input {
|
68 |
+
width: 100%;
|
69 |
+
|
70 |
+
.components-base-control__field {
|
71 |
+
margin-bottom: 0;
|
72 |
+
}
|
73 |
+
|
74 |
+
input {
|
75 |
+
border-radius: 6px;
|
76 |
+
}
|
77 |
+
}
|
78 |
+
|
79 |
+
|
80 |
+
.display-filters {
|
81 |
+
display: flex;
|
82 |
+
margin-left: 20px;
|
83 |
+
|
84 |
+
button {
|
85 |
+
&.is-pressed, &:active, &:focus, &:hover {
|
86 |
+
background-color: transparent !important;
|
87 |
+
color: $blue;
|
88 |
+
}
|
89 |
+
}
|
90 |
+
}
|
91 |
+
|
92 |
+
.header-form {
|
93 |
+
width: 100%;
|
94 |
+
}
|
95 |
+
}
|
96 |
+
|
97 |
+
.cloud-items {
|
98 |
+
|
99 |
+
.components-spinner {
|
100 |
+
margin: 0 auto !important;
|
101 |
+
display: block;
|
102 |
+
margin-top: 50% !important;
|
103 |
+
}
|
104 |
+
|
105 |
+
&.is-grid .table {
|
106 |
+
display: grid;
|
107 |
+
grid-template-columns: 1fr;
|
108 |
+
grid-column-gap: 20px;
|
109 |
+
grid-row-gap: 20px;
|
110 |
+
}
|
111 |
+
}
|
112 |
+
|
113 |
+
.table-grid {
|
114 |
+
border: 1px solid #ccc;
|
115 |
+
min-height: 350px;
|
116 |
+
display: flex;
|
117 |
+
flex-direction: column;
|
118 |
+
|
119 |
+
.grid-preview {
|
120 |
+
display: flex;
|
121 |
+
width: 100%;
|
122 |
+
height: 300px;
|
123 |
+
background-color: #b7c0cc;
|
124 |
+
background-position: top center;
|
125 |
+
background-size: cover;
|
126 |
+
|
127 |
+
&:hover {
|
128 |
+
background-color: #404040;
|
129 |
+
}
|
130 |
+
|
131 |
+
&.is-loading {
|
132 |
+
background: #404040;
|
133 |
+
|
134 |
+
.preview-actions {
|
135 |
+
display: flex;
|
136 |
+
}
|
137 |
+
}
|
138 |
+
|
139 |
+
.preview-actions {
|
140 |
+
opacity: 0;
|
141 |
+
transition: .3s ease opacity;
|
142 |
+
width: 100%;
|
143 |
+
height: auto;
|
144 |
+
flex-direction: column;
|
145 |
+
justify-content: center;
|
146 |
+
align-items: center;
|
147 |
+
background-color: rgba(0, 0, 0, 0.9);
|
148 |
+
display: flex;
|
149 |
+
|
150 |
+
> .components-button {
|
151 |
+
width: 120px;
|
152 |
+
justify-content: center;
|
153 |
+
margin-bottom: 10px;
|
154 |
+
|
155 |
+
&.is-secondary {
|
156 |
+
color: #ffffff;
|
157 |
+
box-shadow: inset 0 0 0 2px #ffffff;
|
158 |
+
|
159 |
+
&:disabled {
|
160 |
+
background: transparent;
|
161 |
+
opacity: 0.5;
|
162 |
+
}
|
163 |
+
}
|
164 |
+
}
|
165 |
+
|
166 |
+
.preview-controls {
|
167 |
+
.components-button {
|
168 |
+
width: 20px;
|
169 |
+
|
170 |
+
svg {
|
171 |
+
fill: #ffffff;
|
172 |
+
}
|
173 |
+
}
|
174 |
+
}
|
175 |
+
}
|
176 |
+
|
177 |
+
&:hover {
|
178 |
+
.preview-actions {
|
179 |
+
opacity: 1;
|
180 |
+
}
|
181 |
+
}
|
182 |
+
}
|
183 |
+
|
184 |
+
.card-footer {
|
185 |
+
background: #ffffff;
|
186 |
+
border-top: 1px solid #ccc;
|
187 |
+
padding: 15px;
|
188 |
+
flex-grow: 1;
|
189 |
+
|
190 |
+
form {
|
191 |
+
display: flex;
|
192 |
+
align-items: center;
|
193 |
+
}
|
194 |
+
|
195 |
+
.components-base-control {
|
196 |
+
flex-grow: 1;
|
197 |
+
}
|
198 |
+
|
199 |
+
.components-base-control__field {
|
200 |
+
margin-bottom: 0;
|
201 |
+
}
|
202 |
+
|
203 |
+
button {
|
204 |
+
height: auto;
|
205 |
+
margin-left: auto;
|
206 |
+
}
|
207 |
+
|
208 |
+
p {
|
209 |
+
font-weight: 600;
|
210 |
+
margin: 0;
|
211 |
+
}
|
212 |
+
}
|
213 |
+
}
|
214 |
+
|
215 |
+
@mixin library--tablet {
|
216 |
+
.cloud-items {
|
217 |
+
&.is-grid .table {
|
218 |
+
grid-template-columns: 1fr 1fr;
|
219 |
+
|
220 |
+
}
|
221 |
+
}
|
222 |
+
}
|
223 |
+
|
224 |
+
@mixin library--laptop {
|
225 |
+
.cloud-items {
|
226 |
+
&.is-grid .table {
|
227 |
+
grid-template-columns: 1fr 1fr 1fr;
|
228 |
+
|
229 |
+
}
|
230 |
+
}
|
231 |
+
}
|
232 |
+
|
233 |
+
@mixin library--desktop {
|
234 |
+
.cloud-items {
|
235 |
+
&.is-grid .table {
|
236 |
+
grid-template-columns: 1fr 1fr 1fr 1fr;
|
237 |
+
|
238 |
+
}
|
239 |
+
}
|
240 |
+
}
|
241 |
+
|
242 |
+
@import "../../../editor/src/scss/pagination";
|
243 |
+
|
assets/src/scss/_media-queries.scss
CHANGED
@@ -1,23 +1,28 @@
|
|
1 |
@media (min-width: #{$tablet}) {
|
2 |
-
@include ob-
|
3 |
@include ob-editor-tabs--tablet();
|
4 |
@include ob-header--tablet();
|
|
|
|
|
5 |
}
|
6 |
|
7 |
@media (min-width: #{$laptop}) {
|
8 |
@include general--laptop();
|
9 |
-
@include ob-starter-site-card--laptop();
|
10 |
@include ob-general--laptop();
|
11 |
@include ob-editor-tabs--laptop();
|
12 |
@include ob-editor-selector--laptop();
|
13 |
@include ob-header--laptop();
|
14 |
@include ob-search--laptop();
|
|
|
|
|
15 |
}
|
16 |
|
17 |
|
18 |
@media (min-width: #{$desktop}) {
|
19 |
@include general--desktop();
|
20 |
@include ob-editor-tabs--desktop();
|
|
|
|
|
21 |
}
|
22 |
|
23 |
|
1 |
@media (min-width: #{$tablet}) {
|
2 |
+
@include ob-general--tablet();
|
3 |
@include ob-editor-tabs--tablet();
|
4 |
@include ob-header--tablet();
|
5 |
+
@include ob-header--tablet();
|
6 |
+
@include library--tablet();
|
7 |
}
|
8 |
|
9 |
@media (min-width: #{$laptop}) {
|
10 |
@include general--laptop();
|
|
|
11 |
@include ob-general--laptop();
|
12 |
@include ob-editor-tabs--laptop();
|
13 |
@include ob-editor-selector--laptop();
|
14 |
@include ob-header--laptop();
|
15 |
@include ob-search--laptop();
|
16 |
+
@include library--laptop();
|
17 |
+
@include demo-site-templates--laptop();
|
18 |
}
|
19 |
|
20 |
|
21 |
@media (min-width: #{$desktop}) {
|
22 |
@include general--desktop();
|
23 |
@include ob-editor-tabs--desktop();
|
24 |
+
@include library--desktop();
|
25 |
+
@include demo-site-templates--desktop();
|
26 |
}
|
27 |
|
28 |
|
assets/src/scss/_mock.scss
CHANGED
@@ -1,4 +1,3 @@
|
|
1 |
-
|
2 |
@keyframes loading-placeholder {
|
3 |
0% {
|
4 |
opacity: .1;
|
|
|
1 |
@keyframes loading-placeholder {
|
2 |
0% {
|
3 |
opacity: .1;
|
assets/src/scss/_preview.scss
CHANGED
@@ -1,55 +1,65 @@
|
|
1 |
$base-index: 100000;
|
2 |
|
3 |
.ob-preview {
|
4 |
-
|
5 |
-
|
6 |
-
top: 0;
|
7 |
-
bottom: 0;
|
8 |
-
left: 0;
|
9 |
-
right: 0;
|
10 |
-
z-index: $base-index;
|
11 |
-
height: 100vh;
|
12 |
-
margin: 0;
|
13 |
-
display: flex;
|
14 |
-
flex-direction: column;
|
15 |
-
.loading {
|
16 |
-
bottom: 0;
|
17 |
top: 0;
|
|
|
18 |
left: 0;
|
19 |
right: 0;
|
20 |
-
position: absolute;
|
21 |
-
display: flex;
|
22 |
-
align-items: center;
|
23 |
-
justify-content: center;
|
24 |
z-index: $base-index;
|
25 |
-
|
26 |
-
|
27 |
-
animation-name: spin;
|
28 |
-
animation-duration: 2000ms;
|
29 |
-
animation-iteration-count: infinite;
|
30 |
-
animation-timing-function: linear;
|
31 |
-
}
|
32 |
-
}
|
33 |
-
.preview {
|
34 |
display: flex;
|
35 |
flex-direction: column;
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
}
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
}
|
54 |
-
}
|
55 |
}
|
1 |
$base-index: 100000;
|
2 |
|
3 |
.ob-preview {
|
4 |
+
background-color: #fff;
|
5 |
+
position: fixed;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
top: 0;
|
7 |
+
bottom: 0;
|
8 |
left: 0;
|
9 |
right: 0;
|
|
|
|
|
|
|
|
|
10 |
z-index: $base-index;
|
11 |
+
height: 100vh;
|
12 |
+
margin: 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
display: flex;
|
14 |
flex-direction: column;
|
15 |
+
|
16 |
+
.loading {
|
17 |
+
bottom: 0;
|
18 |
+
top: 0;
|
19 |
+
left: 0;
|
20 |
+
right: 0;
|
21 |
+
position: absolute;
|
22 |
+
display: flex;
|
23 |
+
align-items: center;
|
24 |
+
justify-content: center;
|
25 |
+
z-index: $base-index;
|
26 |
+
color: $dark-grey;
|
27 |
+
|
28 |
+
svg {
|
29 |
+
animation-name: spin;
|
30 |
+
animation-duration: 2000ms;
|
31 |
+
animation-iteration-count: infinite;
|
32 |
+
animation-timing-function: linear;
|
33 |
+
}
|
34 |
}
|
35 |
+
|
36 |
+
.preview {
|
37 |
+
display: flex;
|
38 |
+
flex-direction: column;
|
39 |
+
position: relative;
|
40 |
+
flex-grow: 1;
|
41 |
+
|
42 |
+
iframe {
|
43 |
+
flex-grow: 1;
|
44 |
+
position: relative;
|
45 |
+
z-index: $base-index+1;
|
46 |
+
height: 100%;
|
47 |
+
width: 100%;
|
48 |
+
}
|
49 |
+
}
|
50 |
+
|
51 |
+
.bottom-bar {
|
52 |
+
border-top: 1px solid $grey;
|
53 |
+
display: flex;
|
54 |
+
padding: 15px 30px;
|
55 |
+
align-items: center;
|
56 |
+
|
57 |
+
.actions {
|
58 |
+
margin-left: auto;
|
59 |
+
}
|
60 |
+
|
61 |
+
.heading {
|
62 |
+
margin: 0 0 0 20px;
|
63 |
+
}
|
64 |
}
|
|
|
65 |
}
|
assets/src/scss/_starter-site-card.scss
CHANGED
@@ -48,34 +48,25 @@
|
|
48 |
display: flex;
|
49 |
align-items: center;
|
50 |
justify-content: center;
|
|
|
51 |
position: absolute;
|
52 |
opacity: 0;
|
53 |
transition: .3s ease;
|
54 |
|
55 |
-
|
56 |
-
background-color: $blue;
|
57 |
color: #fff;
|
58 |
-
|
59 |
-
line-height: normal;
|
60 |
-
height: auto;
|
61 |
-
padding: 8px 15px;
|
62 |
-
transition: all .3s ease;
|
63 |
-
|
64 |
-
&:hover {
|
65 |
-
box-shadow: none;
|
66 |
-
background-color: darken($blue, 10);
|
67 |
-
}
|
68 |
-
|
69 |
-
&.preview {
|
70 |
-
background-color: $light-blue;
|
71 |
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
|
|
|
|
76 |
|
77 |
-
|
78 |
-
|
|
|
79 |
}
|
80 |
}
|
81 |
}
|
@@ -83,6 +74,7 @@
|
|
83 |
.image {
|
84 |
height: 335px;
|
85 |
background-size: cover;
|
|
|
86 |
background-position: top center;
|
87 |
background-color: transparentize($dark-grey, .75);
|
88 |
}
|
@@ -105,29 +97,19 @@
|
|
105 |
margin: 0;
|
106 |
}
|
107 |
}
|
108 |
-
}
|
109 |
-
|
110 |
-
@mixin ob-starter-site-card--tablet {
|
111 |
-
.card.starter-site-card {
|
112 |
-
max-width: 49%;
|
113 |
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
}
|
128 |
-
|
129 |
-
&:not(:nth-child(3n)) {
|
130 |
-
margin-right: 2%;
|
131 |
-
}
|
132 |
}
|
133 |
}
|
48 |
display: flex;
|
49 |
align-items: center;
|
50 |
justify-content: center;
|
51 |
+
flex-direction: column;
|
52 |
position: absolute;
|
53 |
opacity: 0;
|
54 |
transition: .3s ease;
|
55 |
|
56 |
+
.templates {
|
|
|
57 |
color: #fff;
|
58 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
|
60 |
+
.components-button {
|
61 |
+
margin: 5px 0;
|
62 |
+
width: 100px;
|
63 |
+
height: 40px;
|
64 |
+
font-weight: 600;
|
65 |
+
justify-content: center;
|
66 |
|
67 |
+
&.is-secondary {
|
68 |
+
color: #fff;
|
69 |
+
border: 2px solid #fff;
|
70 |
}
|
71 |
}
|
72 |
}
|
74 |
.image {
|
75 |
height: 335px;
|
76 |
background-size: cover;
|
77 |
+
background-repeat: no-repeat;
|
78 |
background-position: top center;
|
79 |
background-color: transparentize($dark-grey, .75);
|
80 |
}
|
97 |
margin: 0;
|
98 |
}
|
99 |
}
|
|
|
|
|
|
|
|
|
|
|
100 |
|
101 |
+
&.has-templates:after {
|
102 |
+
position: absolute;
|
103 |
+
width: 93%;
|
104 |
+
background-color: #FFFFFF;
|
105 |
+
display: block;
|
106 |
+
height: 10px;
|
107 |
+
content: '';
|
108 |
+
margin: 0 auto;
|
109 |
+
bottom: -7px;
|
110 |
+
left: 50%;
|
111 |
+
transform: translateX(-50%);
|
112 |
+
z-index: -1;
|
113 |
+
border: 1px solid #D9D9D9;
|
|
|
|
|
|
|
|
|
|
|
114 |
}
|
115 |
}
|
assets/src/scss/_sticky-nav.scss
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
.sticky-nav {
|
|
|
2 |
position: fixed;
|
3 |
z-index: 1000;
|
4 |
left: 0;
|
@@ -30,8 +31,10 @@
|
|
30 |
|
31 |
.sticky-nav-content {
|
32 |
display: flex;
|
|
|
33 |
|
34 |
-
> img
|
|
|
35 |
display: none;
|
36 |
margin-right: 20px;
|
37 |
|
@@ -43,7 +46,6 @@
|
|
43 |
.header-form {
|
44 |
margin: 0;
|
45 |
flex-grow: 1;
|
46 |
-
max-width: 60%;
|
47 |
|
48 |
@media (min-width: #{$tablet}) {
|
49 |
max-width: 100%;
|
1 |
.sticky-nav {
|
2 |
+
transition: top .3s ease;
|
3 |
position: fixed;
|
4 |
z-index: 1000;
|
5 |
left: 0;
|
31 |
|
32 |
.sticky-nav-content {
|
33 |
display: flex;
|
34 |
+
max-width: 1300px;
|
35 |
|
36 |
+
> img,
|
37 |
+
> .ob-logo {
|
38 |
display: none;
|
39 |
margin-right: 20px;
|
40 |
|
46 |
.header-form {
|
47 |
margin: 0;
|
48 |
flex-grow: 1;
|
|
|
49 |
|
50 |
@media (min-width: #{$tablet}) {
|
51 |
max-width: 100%;
|
assets/src/store/actions.js
CHANGED
@@ -68,4 +68,34 @@ export default {
|
|
68 |
payload: { themeActions },
|
69 |
};
|
70 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
};
|
68 |
payload: { themeActions },
|
69 |
};
|
70 |
},
|
71 |
+
setCurrentTab( currentTab ) {
|
72 |
+
return {
|
73 |
+
type: 'SET_CURRENT_TAB',
|
74 |
+
payload: { currentTab },
|
75 |
+
};
|
76 |
+
},
|
77 |
+
setFetching( fetching ) {
|
78 |
+
return {
|
79 |
+
type: 'SET_FETCHING',
|
80 |
+
payload: { fetching },
|
81 |
+
};
|
82 |
+
},
|
83 |
+
setSingleTemplateImport( slug ) {
|
84 |
+
return {
|
85 |
+
type: 'SET_SINGLE_TEMPLATE_IMPORT',
|
86 |
+
payload: { slug },
|
87 |
+
};
|
88 |
+
},
|
89 |
+
setTemplateModal( data ) {
|
90 |
+
return {
|
91 |
+
type: 'SET_TEMPLATE_MODAL',
|
92 |
+
payload: { data },
|
93 |
+
};
|
94 |
+
},
|
95 |
+
setSearchQuery( query ) {
|
96 |
+
return {
|
97 |
+
type: 'SET_SEARCH_QUERY',
|
98 |
+
payload: { query },
|
99 |
+
};
|
100 |
+
},
|
101 |
};
|
assets/src/store/reducer.js
CHANGED
@@ -21,64 +21,100 @@ const initialState = {
|
|
21 |
isOnboarding: onboarding.onboarding || false,
|
22 |
migrationData: null,
|
23 |
themeAction,
|
|
|
|
|
|
|
|
|
|
|
24 |
};
|
25 |
export default ( state = initialState, action ) => {
|
26 |
switch ( action.type ) {
|
27 |
-
|
28 |
const { sites } = action.payload;
|
29 |
-
|
30 |
-
|
31 |
sites,
|
32 |
};
|
33 |
-
|
34 |
const { editor } = action.payload;
|
35 |
localStorage.setItem( 'neve-onboarding-editor', editor );
|
36 |
-
|
37 |
-
|
38 |
editor,
|
39 |
};
|
40 |
-
|
41 |
const { category } = action.payload;
|
42 |
-
|
43 |
-
|
44 |
category,
|
45 |
};
|
46 |
-
|
47 |
const { siteData } = action.payload;
|
48 |
-
|
49 |
-
|
50 |
currentSite: siteData,
|
51 |
};
|
52 |
-
|
53 |
const { previewStatus } = action.payload;
|
54 |
-
|
55 |
-
|
56 |
previewStatus,
|
57 |
};
|
58 |
-
|
59 |
const { importModalStatus } = action.payload;
|
60 |
-
|
61 |
-
|
62 |
importModalStatus,
|
63 |
};
|
64 |
-
|
65 |
const { installModalStatus } = action.payload;
|
66 |
-
|
67 |
-
|
68 |
installModalStatus,
|
69 |
};
|
70 |
-
|
71 |
const { status } = action.payload;
|
72 |
-
|
73 |
-
|
74 |
isOnboarding: status,
|
75 |
};
|
76 |
-
|
77 |
const { themeActions } = action.payload;
|
78 |
-
|
79 |
-
|
80 |
themeAction: themeActions,
|
81 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
}
|
83 |
return state;
|
84 |
};
|
21 |
isOnboarding: onboarding.onboarding || false,
|
22 |
migrationData: null,
|
23 |
themeAction,
|
24 |
+
currentTab: 'starterSites',
|
25 |
+
fetching: false,
|
26 |
+
singleTemplateImport: null,
|
27 |
+
templateModal: null,
|
28 |
+
searchQuery: '',
|
29 |
};
|
30 |
export default ( state = initialState, action ) => {
|
31 |
switch ( action.type ) {
|
32 |
+
case 'REFRESH_SITES':
|
33 |
const { sites } = action.payload;
|
34 |
+
return {
|
35 |
+
...state,
|
36 |
sites,
|
37 |
};
|
38 |
+
case 'SET_CURRENT_EDITOR':
|
39 |
const { editor } = action.payload;
|
40 |
localStorage.setItem( 'neve-onboarding-editor', editor );
|
41 |
+
return {
|
42 |
+
...state,
|
43 |
editor,
|
44 |
};
|
45 |
+
case 'SET_CURRENT_CATEGORY':
|
46 |
const { category } = action.payload;
|
47 |
+
return {
|
48 |
+
...state,
|
49 |
category,
|
50 |
};
|
51 |
+
case 'SET_FOCUSED_SITE':
|
52 |
const { siteData } = action.payload;
|
53 |
+
return {
|
54 |
+
...state,
|
55 |
currentSite: siteData,
|
56 |
};
|
57 |
+
case 'SET_PREVIEW_STATUS':
|
58 |
const { previewStatus } = action.payload;
|
59 |
+
return {
|
60 |
+
...state,
|
61 |
previewStatus,
|
62 |
};
|
63 |
+
case 'SET_IMPORT_MODAL_STATUS':
|
64 |
const { importModalStatus } = action.payload;
|
65 |
+
return {
|
66 |
+
...state,
|
67 |
importModalStatus,
|
68 |
};
|
69 |
+
case 'SET_INSTALL_MODAL_STATUS':
|
70 |
const { installModalStatus } = action.payload;
|
71 |
+
return {
|
72 |
+
...state,
|
73 |
installModalStatus,
|
74 |
};
|
75 |
+
case 'SET_ONBOARDING':
|
76 |
const { status } = action.payload;
|
77 |
+
return {
|
78 |
+
...state,
|
79 |
isOnboarding: status,
|
80 |
};
|
81 |
+
case 'SET_THEME_ACTIONS':
|
82 |
const { themeActions } = action.payload;
|
83 |
+
return {
|
84 |
+
...state,
|
85 |
themeAction: themeActions,
|
86 |
};
|
87 |
+
case 'SET_CURRENT_TAB':
|
88 |
+
const { currentTab } = action.payload;
|
89 |
+
return {
|
90 |
+
...state,
|
91 |
+
singleTemplateImport: null,
|
92 |
+
currentTab,
|
93 |
+
};
|
94 |
+
case 'SET_FETCHING':
|
95 |
+
const { fetching } = action.payload;
|
96 |
+
return {
|
97 |
+
...state,
|
98 |
+
fetching,
|
99 |
+
};
|
100 |
+
case 'SET_SINGLE_TEMPLATE_IMPORT':
|
101 |
+
const { slug } = action.payload;
|
102 |
+
return {
|
103 |
+
...state,
|
104 |
+
singleTemplateImport: slug,
|
105 |
+
};
|
106 |
+
case 'SET_TEMPLATE_MODAL':
|
107 |
+
const { data } = action.payload;
|
108 |
+
return {
|
109 |
+
...state,
|
110 |
+
templateModal: data,
|
111 |
+
};
|
112 |
+
case 'SET_SEARCH_QUERY':
|
113 |
+
const { query } = action.payload;
|
114 |
+
return {
|
115 |
+
...state,
|
116 |
+
searchQuery: query,
|
117 |
+
};
|
118 |
}
|
119 |
return state;
|
120 |
};
|
assets/src/store/selectors.js
CHANGED
@@ -9,4 +9,9 @@ export default {
|
|
9 |
getOnboardingStatus: ( state ) => state.isOnboarding,
|
10 |
getThemeAction: ( state ) => state.themeAction,
|
11 |
getInstallModalStatus: ( state ) => state.installModalStatus,
|
|
|
|
|
|
|
|
|
|
|
12 |
};
|
9 |
getOnboardingStatus: ( state ) => state.isOnboarding,
|
10 |
getThemeAction: ( state ) => state.themeAction,
|
11 |
getInstallModalStatus: ( state ) => state.installModalStatus,
|
12 |
+
getCurrentTab: ( state ) => state.currentTab,
|
13 |
+
getFetching: ( state ) => state.fetching,
|
14 |
+
getSingleImport: ( state ) => state.singleTemplateImport,
|
15 |
+
getTemplateModal: ( state ) => state.templateModal,
|
16 |
+
getSearchQuery: ( state ) => state.searchQuery,
|
17 |
};
|
assets/src/style.scss
CHANGED
@@ -11,4 +11,8 @@
|
|
11 |
@import "scss/mock";
|
12 |
@import "scss/import-modal";
|
13 |
@import "scss/sticky-nav";
|
|
|
|
|
|
|
14 |
@import "scss/media-queries";
|
|
11 |
@import "scss/mock";
|
12 |
@import "scss/import-modal";
|
13 |
@import "scss/sticky-nav";
|
14 |
+
@import "scss/library";
|
15 |
+
@import "scss/demo-site-templates";
|
16 |
+
|
17 |
@import "scss/media-queries";
|
18 |
+
|
assets/src/utils/common.js
CHANGED
@@ -1,4 +1,58 @@
|
|
|
|
|
|
1 |
const untrailingSlashIt = ( str ) => str.replace( /\/$/, '' );
|
2 |
const trailingSlashIt = ( str ) => untrailingSlashIt( str ) + '/';
|
3 |
|
4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { __ } from '@wordpress/i18n';
|
2 |
+
|
3 |
const untrailingSlashIt = ( str ) => str.replace( /\/$/, '' );
|
4 |
const trailingSlashIt = ( str ) => untrailingSlashIt( str ) + '/';
|
5 |
|
6 |
+
const TAGS = [
|
7 |
+
__( 'Business', 'templates-patterns-collection' ),
|
8 |
+
__( 'Ecommerce', 'templates-patterns-collection' ),
|
9 |
+
__( 'Fashion', 'templates-patterns-collection' ),
|
10 |
+
__( 'Blogging', 'templates-patterns-collection' ),
|
11 |
+
__( 'Photography', 'templates-patterns-collection' ),
|
12 |
+
];
|
13 |
+
const CATEGORIES = {
|
14 |
+
all: __( 'All Categories' ),
|
15 |
+
free: __( 'Free' ),
|
16 |
+
business: __( 'Business' ),
|
17 |
+
portfolio: __( 'Portfolio' ),
|
18 |
+
woocommerce: __( 'WooCommerce' ),
|
19 |
+
blog: __( 'Blog' ),
|
20 |
+
personal: __( 'Personal' ),
|
21 |
+
other: __( 'Other' ),
|
22 |
+
};
|
23 |
+
const EDITOR_MAP = {
|
24 |
+
gutenberg: {
|
25 |
+
icon: 'gutenberg.jpg',
|
26 |
+
niceName: 'Gutenberg',
|
27 |
+
},
|
28 |
+
elementor: {
|
29 |
+
icon: 'elementor.jpg',
|
30 |
+
niceName: 'Elementor',
|
31 |
+
},
|
32 |
+
'beaver builder': {
|
33 |
+
icon: 'beaver.jpg',
|
34 |
+
niceName: (
|
35 |
+
<>
|
36 |
+
Beaver <span className="long-name">Builder</span>
|
37 |
+
</>
|
38 |
+
),
|
39 |
+
},
|
40 |
+
brizy: {
|
41 |
+
icon: 'brizy.jpg',
|
42 |
+
niceName: 'Brizy',
|
43 |
+
},
|
44 |
+
'divi builder': {
|
45 |
+
icon: 'divi.jpg',
|
46 |
+
niceName: 'Divi',
|
47 |
+
},
|
48 |
+
'thrive architect': {
|
49 |
+
icon: 'thrive.jpg',
|
50 |
+
niceName: (
|
51 |
+
<>
|
52 |
+
Thrive <span className="long-name">Architect</span>
|
53 |
+
</>
|
54 |
+
),
|
55 |
+
},
|
56 |
+
};
|
57 |
+
|
58 |
+
export { trailingSlashIt, untrailingSlashIt, CATEGORIES, EDITOR_MAP, TAGS };
|
assets/src/utils/site-import.js
CHANGED
@@ -17,3 +17,7 @@ export const installPlugins = ( pluginArray ) => {
|
|
17 |
export const importContent = ( data ) => {
|
18 |
return send( onboarding.root + '/import_content', data );
|
19 |
};
|
|
|
|
|
|
|
|
17 |
export const importContent = ( data ) => {
|
18 |
return send( onboarding.root + '/import_content', data );
|
19 |
};
|
20 |
+
|
21 |
+
export const importTemplates = ( data ) => {
|
22 |
+
return send( onboarding.root + '/import_single_templates', data );
|
23 |
+
};
|
editor/build/index-rtl.css
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
.tpc-template-cloud-icon{max-width:100%;max-height:100%}.tpc-template-cloud-modal .components-modal__frame{width:100%}.tpc-template-cloud-modal .components-modal__frame .components-modal__content{padding:0}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .components-modal__header{display:none}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .modal-header{display:flex;border-bottom:1px solid #e0e0e0}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .modal-header .left{display:flex;flex-basis:20%;justify-content:flex-start}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .modal-header .left .tpc-template-cloud-icon{width:60px;height:60px;padding:10px}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .modal-header .center{display:flex;flex-basis:60%;justify-content:center}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .modal-header .center .tabs{height:60px;font-size:14px;color:#616161;font-weight:500;border-radius:0;padding-right:25px;padding-left:25px}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .modal-header .center .tabs.is-active{box-shadow:inset 0 0 0 1.5px transparent, inset 0 -4px 0 0 #0073aa}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .modal-header .right{display:flex;flex-basis:20%;justify-content:flex-end}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .modal-header .right .components-button{width:60px;height:60px;border-right:1px solid #e6e9ec}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .modal-header .right .components-button:hover{background:#f1f1f1}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .modal-header .right .components-button svg{width:32px;height:32px;fill:#616161}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .modal-header .right .components-button-group{display:flex;justify-content:center;align-items:center;height:60px}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .modal-header .right .components-button-group .components-button{border-right:0;box-shadow:none;background:#f1f1f1;width:38px;height:38px;margin:5px 10px;padding:5px;border:1px solid #d9d9d9;border-radius:6px}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .modal-header .right .components-button-group .components-button:hover{color:#f1f1f1;background:#0073aa;width:auto;border:1px solid #0073aa}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .modal-header .right .components-button-group .components-button:hover:before{content:'Sync';padding:0 10px;font-weight:500}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .modal-header .right .components-button-group .components-button:hover svg{fill:#f1f1f1}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .modal-header .right .components-button-group .components-button svg{width:26px;height:26px;padding:0;fill:#0073aa}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content{background:#f1f1f1;padding:20px 40px}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .notices .components-notice{margin:0 0 20px 0;padding:10px}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .filters{display:flex;justify-content:flex-end;padding-bottom:20px}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .filters .components-button.is-pressed{background:transparent}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .filters .components-button.is-pressed svg{fill:#0073aa}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .filters .components-button svg{fill:#d9d9d9}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content.is-grid{display:-ms-grid;display:grid;-ms-grid-columns:25% 25% 25% 25%;grid-template-columns:25% 25% 25% 25%}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content .table-row{display:flex;height:60px;width:100%;align-items:center;padding:0 25px;background:#fff;border:1px solid rgba(0,0,0,0.11);border-top:none}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content .table-row:first-child{border-top:1px solid rgba(0,0,0,0.11)}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content .table-row svg{height:24px;margin-left:10px;fill:#b9b9b9}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content .table-row .row-title{display:flex;align-items:center}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content .table-row .row-title .components-base-control__field{margin:0}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content .table-row .row-controls{display:flex;align-items:center;margin-right:auto}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content .table-row .row-controls button{padding:6px 30px;font-weight:600;color:#b9b9b9}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content .table-row .actions{display:flex;margin-right:50px;justify-content:flex-end}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content .table-row .actions.no-controls{margin-right:auto}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content .table-row .actions .components-button{padding:6px 30px}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content .table-row .actions .components-button.is-primary{margin-right:10px}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content .table-grid{border:1px solid #ccc;margin:10px;min-height:350px}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content .table-grid .grid-preview{display:flex;width:100%;height:300px;background-color:#b7c0cc;background-position:top center;background-size:cover}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content .table-grid .grid-preview:hover{background-color:#404040}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content .table-grid .grid-preview.is-loading{background:#404040}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content .table-grid .grid-preview.is-loading .preview-actions{display:flex}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content .table-grid .grid-preview .preview-actions{opacity:0;transition:.3s ease opacity;width:100%;height:auto;flex-direction:column;justify-content:center;align-items:center;background-color:rgba(0,0,0,0.9);display:flex}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content .table-grid .grid-preview .preview-actions>.components-button{width:120px;justify-content:center;margin-bottom:10px}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content .table-grid .grid-preview .preview-actions>.components-button.is-secondary{color:#ffffff;box-shadow:inset 0 0 0 2px #ffffff}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content .table-grid .grid-preview .preview-actions>.components-button.is-secondary:disabled{background:transparent;opacity:0.5}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content .table-grid .grid-preview .preview-actions .preview-controls .components-button{width:20px}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content .table-grid .grid-preview .preview-actions .preview-controls .components-button svg{fill:#ffffff}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content .table-grid .grid-preview:hover .preview-actions{opacity:1}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content .table-grid .card-footer{background:#ffffff;border-top:1px solid #ccc;padding:15px}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content .table-grid .card-footer p{font-weight:600;margin:0}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .pagination{padding-top:20px}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .pagination .components-button{margin-left:10px;border-radius:2px;box-shadow:none}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .pagination .components-button:focus{box-shadow:inset 0 0 0 1px #fff, 0 0 0 1.5px #007cba}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .pagination .components-button:not(.is-primary){background:#ffffff}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .pagination .components-button:not(.is-primary):focus{box-shadow:0 0 0 1.5px #007cba}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .preview-header{display:flex;align-items:center;justify-content:space-between}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .preview-header .right .components-button:last-child{margin-right:10px}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .preview-content{margin:20px 0}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .preview-content .block-editor-block-preview__container{max-height:60vh;overflow:scroll}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .preview-content .block-editor-block-preview__container .block-editor-block-list__block:first-child{margin-top:0;margin-bottom:0}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .components-placeholder{box-shadow:none;margin:20px 0}.tpc-template-cloud-modal .components-modal__frame .components-spinner{margin:0 auto}.ti-tpc-components-panel .components-button{margin:20px 0}.controls-popover .components-popover__content{padding:10px}.controls-popover .components-popover__content .popover-content{display:flex;justify-content:center;align-items:flex-end}.controls-popover .components-popover__content .popover-content .components-base-control__field{margin:0}.controls-popover .components-popover__content .popover-content .components-base-control__field .components-text-control__input{max-height:30px}.controls-popover .components-popover__content .popover-content .components-button{max-width:30px;max-height:30px}.components-button.is-loading svg{-webkit-animation:icon-spin 2s linear infinite;animation:icon-spin 2s linear infinite}@media (max-width: 1439px){.tpc-template-cloud-modal .components-modal__frame{max-width:990px}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content.is-grid{-ms-grid-columns:33% 33% 33%;grid-template-columns:33% 33% 33%}}@media (min-width: 1440px){.tpc-template-cloud-modal .components-modal__frame{max-width:1200px}}@-webkit-keyframes icon-spin{0%{transform:rotate(0deg)}to{transform:rotate(-1turn)}}@keyframes icon-spin{0%{transform:rotate(0deg)}to{transform:rotate(-1turn)}}.tpc-preview-wrap-modal{top:0 !important;bottom:0 !important;right:0 !important;left:0 !important;width:100vw !important;height:100vh !important;transform:none !important;margin:0 !important;padding:0 !important;max-width:100%;max-height:100%;overflow:hidden}.tpc-preview-wrap-modal .components-modal__header{display:none}.tpc-preview-wrap-modal .ob-preview{background-color:#fff;position:fixed;top:0;bottom:0;right:0;left:0;z-index:100000;height:100vh;margin:0;display:flex;flex-direction:column}.tpc-preview-wrap-modal .ob-preview .loading{bottom:0;top:0;right:0;left:0;position:absolute;display:flex;align-items:center;justify-content:center;z-index:100000;color:#646D82}.tpc-preview-wrap-modal .ob-preview .loading svg{-webkit-animation-name:spin;animation-name:spin;-webkit-animation-duration:2000ms;animation-duration:2000ms;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-timing-function:linear;animation-timing-function:linear}.tpc-preview-wrap-modal .ob-preview .preview{display:flex;flex-direction:column;position:relative;flex-grow:1}.tpc-preview-wrap-modal .ob-preview .preview iframe{flex-grow:1;position:relative;z-index:100001;height:100%;width:100%}.tpc-preview-wrap-modal .ob-preview .bottom-bar{border-top:1px solid #e1e1e1;display:flex;padding:15px 30px;align-items:center}.tpc-preview-wrap-modal .ob-preview .bottom-bar .actions{margin-right:auto}.tpc-preview-wrap-modal .ob-preview .bottom-bar .heading{margin:0 20px 0 0}.tpc-preview-wrap-modal .ob-preview{width:100vw;height:100vh;position:absolute;top:0;right:0}@-webkit-keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(-360deg)}}@keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(-360deg)}}
|
2 |
+
|
editor/build/index.asset.php
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?php return array(
|
2 |
+
'dependencies' => array( 'wp-api-fetch', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-plugins', 'wp-polyfill', 'wp-primitives' ),
|
3 |
+
'version' => '377f8928b6cbc561fa91c8de5ba6a51f',
|
4 |
+
);
|
editor/build/index.css
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
.tpc-template-cloud-icon{max-width:100%;max-height:100%}.tpc-template-cloud-modal .components-modal__frame{width:100%}.tpc-template-cloud-modal .components-modal__frame .components-modal__content{padding:0}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .components-modal__header{display:none}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .modal-header{display:flex;border-bottom:1px solid #e0e0e0}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .modal-header .left{display:flex;flex-basis:20%;justify-content:flex-start}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .modal-header .left .tpc-template-cloud-icon{width:60px;height:60px;padding:10px}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .modal-header .center{display:flex;flex-basis:60%;justify-content:center}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .modal-header .center .tabs{height:60px;font-size:14px;color:#616161;font-weight:500;border-radius:0;padding-left:25px;padding-right:25px}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .modal-header .center .tabs.is-active{box-shadow:inset 0 0 0 1.5px transparent, inset 0 -4px 0 0 #0073aa}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .modal-header .right{display:flex;flex-basis:20%;justify-content:flex-end}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .modal-header .right .components-button{width:60px;height:60px;border-left:1px solid #e6e9ec}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .modal-header .right .components-button:hover{background:#f1f1f1}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .modal-header .right .components-button svg{width:32px;height:32px;fill:#616161}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .modal-header .right .components-button-group{display:flex;justify-content:center;align-items:center;height:60px}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .modal-header .right .components-button-group .components-button{border-left:0;box-shadow:none;background:#f1f1f1;width:38px;height:38px;margin:5px 10px;padding:5px;border:1px solid #d9d9d9;border-radius:6px}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .modal-header .right .components-button-group .components-button:hover{color:#f1f1f1;background:#0073aa;width:auto;border:1px solid #0073aa}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .modal-header .right .components-button-group .components-button:hover:before{content:'Sync';padding:0 10px;font-weight:500}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .modal-header .right .components-button-group .components-button:hover svg{fill:#f1f1f1}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .modal-header .right .components-button-group .components-button svg{width:26px;height:26px;padding:0;fill:#0073aa}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content{background:#f1f1f1;padding:20px 40px}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .notices .components-notice{margin:0 0 20px 0;padding:10px}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .filters{display:flex;justify-content:flex-end;padding-bottom:20px}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .filters .components-button.is-pressed{background:transparent}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .filters .components-button.is-pressed svg{fill:#0073aa}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .filters .components-button svg{fill:#d9d9d9}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content.is-grid{display:-ms-grid;display:grid;-ms-grid-columns:25% 25% 25% 25%;grid-template-columns:25% 25% 25% 25%}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content .table-row{display:flex;height:60px;width:100%;align-items:center;padding:0 25px;background:#fff;border:1px solid rgba(0,0,0,0.11);border-top:none}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content .table-row:first-child{border-top:1px solid rgba(0,0,0,0.11)}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content .table-row svg{height:24px;margin-right:10px;fill:#b9b9b9}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content .table-row .row-title{display:flex;align-items:center}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content .table-row .row-title .components-base-control__field{margin:0}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content .table-row .row-controls{display:flex;align-items:center;margin-left:auto}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content .table-row .row-controls button{padding:6px 30px;font-weight:600;color:#b9b9b9}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content .table-row .actions{display:flex;margin-left:50px;justify-content:flex-end}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content .table-row .actions.no-controls{margin-left:auto}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content .table-row .actions .components-button{padding:6px 30px}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content .table-row .actions .components-button.is-primary{margin-left:10px}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content .table-grid{border:1px solid #ccc;margin:10px;min-height:350px}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content .table-grid .grid-preview{display:flex;width:100%;height:300px;background-color:#b7c0cc;background-position:top center;background-size:cover}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content .table-grid .grid-preview:hover{background-color:#404040}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content .table-grid .grid-preview.is-loading{background:#404040}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content .table-grid .grid-preview.is-loading .preview-actions{display:flex}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content .table-grid .grid-preview .preview-actions{opacity:0;transition:.3s ease opacity;width:100%;height:auto;flex-direction:column;justify-content:center;align-items:center;background-color:rgba(0,0,0,0.9);display:flex}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content .table-grid .grid-preview .preview-actions>.components-button{width:120px;justify-content:center;margin-bottom:10px}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content .table-grid .grid-preview .preview-actions>.components-button.is-secondary{color:#ffffff;box-shadow:inset 0 0 0 2px #ffffff}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content .table-grid .grid-preview .preview-actions>.components-button.is-secondary:disabled{background:transparent;opacity:0.5}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content .table-grid .grid-preview .preview-actions .preview-controls .components-button{width:20px}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content .table-grid .grid-preview .preview-actions .preview-controls .components-button svg{fill:#ffffff}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content .table-grid .grid-preview:hover .preview-actions{opacity:1}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content .table-grid .card-footer{background:#ffffff;border-top:1px solid #ccc;padding:15px}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content .table-grid .card-footer p{font-weight:600;margin:0}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .pagination{padding-top:20px}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .pagination .components-button{margin-right:10px;border-radius:2px;box-shadow:none}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .pagination .components-button:focus{box-shadow:inset 0 0 0 1px #fff, 0 0 0 1.5px #007cba}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .pagination .components-button:not(.is-primary){background:#ffffff}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .pagination .components-button:not(.is-primary):focus{box-shadow:0 0 0 1.5px #007cba}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .preview-header{display:flex;align-items:center;justify-content:space-between}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .preview-header .right .components-button:last-child{margin-left:10px}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .preview-content{margin:20px 0}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .preview-content .block-editor-block-preview__container{max-height:60vh;overflow:scroll}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .preview-content .block-editor-block-preview__container .block-editor-block-list__block:first-child{margin-top:0;margin-bottom:0}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .components-placeholder{box-shadow:none;margin:20px 0}.tpc-template-cloud-modal .components-modal__frame .components-spinner{margin:0 auto}.ti-tpc-components-panel .components-button{margin:20px 0}.controls-popover .components-popover__content{padding:10px}.controls-popover .components-popover__content .popover-content{display:flex;justify-content:center;align-items:flex-end}.controls-popover .components-popover__content .popover-content .components-base-control__field{margin:0}.controls-popover .components-popover__content .popover-content .components-base-control__field .components-text-control__input{max-height:30px}.controls-popover .components-popover__content .popover-content .components-button{max-width:30px;max-height:30px}.components-button.is-loading svg{-webkit-animation:icon-spin 2s linear infinite;animation:icon-spin 2s linear infinite}@media (max-width: 1439px){.tpc-template-cloud-modal .components-modal__frame{max-width:990px}.tpc-template-cloud-modal .components-modal__frame .components-modal__content .tpc-modal-content .table-content.is-grid{-ms-grid-columns:33% 33% 33%;grid-template-columns:33% 33% 33%}}@media (min-width: 1440px){.tpc-template-cloud-modal .components-modal__frame{max-width:1200px}}@-webkit-keyframes icon-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes icon-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.tpc-preview-wrap-modal{top:0 !important;bottom:0 !important;left:0 !important;right:0 !important;width:100vw !important;height:100vh !important;transform:none !important;margin:0 !important;padding:0 !important;max-width:100%;max-height:100%;overflow:hidden}.tpc-preview-wrap-modal .components-modal__header{display:none}.tpc-preview-wrap-modal .ob-preview{background-color:#fff;position:fixed;top:0;bottom:0;left:0;right:0;z-index:100000;height:100vh;margin:0;display:flex;flex-direction:column}.tpc-preview-wrap-modal .ob-preview .loading{bottom:0;top:0;left:0;right:0;position:absolute;display:flex;align-items:center;justify-content:center;z-index:100000;color:#646D82}.tpc-preview-wrap-modal .ob-preview .loading svg{-webkit-animation-name:spin;animation-name:spin;-webkit-animation-duration:2000ms;animation-duration:2000ms;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-timing-function:linear;animation-timing-function:linear}.tpc-preview-wrap-modal .ob-preview .preview{display:flex;flex-direction:column;position:relative;flex-grow:1}.tpc-preview-wrap-modal .ob-preview .preview iframe{flex-grow:1;position:relative;z-index:100001;height:100%;width:100%}.tpc-preview-wrap-modal .ob-preview .bottom-bar{border-top:1px solid #e1e1e1;display:flex;padding:15px 30px;align-items:center}.tpc-preview-wrap-modal .ob-preview .bottom-bar .actions{margin-left:auto}.tpc-preview-wrap-modal .ob-preview .bottom-bar .heading{margin:0 0 0 20px}.tpc-preview-wrap-modal .ob-preview{width:100vw;height:100vh;position:absolute;top:0;left:0}@-webkit-keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}@keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}
|
2 |
+
|
editor/build/index.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var c=t[n]={i:n,l:!1,exports:{}};return e[n].call(c.exports,c,c.exports,r),c.l=!0,c.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var c in e)r.d(n,c,function(t){return e[t]}.bind(null,c));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=27)}([function(e,t){!function(){e.exports=this.wp.element}()},function(e,t){!function(){e.exports=this.wp.i18n}()},function(e,t){!function(){e.exports=this.wp.components}()},function(e,t){!function(){e.exports=this.regeneratorRuntime}()},function(e,t){!function(){e.exports=this.wp.data}()},function(e,t){!function(){e.exports=this.wp.primitives}()},function(e,t){function r(e,t,r,n,c,a,i){try{var o=e[a](i),s=o.value}catch(e){return void r(e)}o.done?t(s):Promise.resolve(s).then(n,c)}e.exports=function(e){return function(){var t=this,n=arguments;return new Promise((function(c,a){var i=e.apply(t,n);function o(e){r(i,c,a,o,s,"next",e)}function s(e){r(i,c,a,o,s,"throw",e)}o(void 0)}))}}},function(e,t,r){var n=r(19),c=r(20),a=r(21),i=r(23);e.exports=function(e,t){return n(e)||c(e,t)||a(e,t)||i()}},function(e,t,r){var n;!function(){"use strict";var r={}.hasOwnProperty;function c(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var a=typeof n;if("string"===a||"number"===a)e.push(n);else if(Array.isArray(n)&&n.length){var i=c.apply(null,n);i&&e.push(i)}else if("object"===a)for(var o in n)r.call(n,o)&&n[o]&&e.push(o)}}return e.join(" ")}e.exports?(c.default=c,e.exports=c):void 0===(n=function(){return c}.apply(t,[]))||(e.exports=n)}()},function(e,t,r){"use strict";const n=r(24),c=r(25),a=r(26);function i(e){if("string"!=typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function o(e,t){return t.encode?t.strict?n(e):encodeURIComponent(e):e}function s(e,t){return t.decode?c(e):e}function l(e){const t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function u(e){const t=(e=l(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function p(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function m(e,t){i((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);const r=function(e){let t;switch(e.arrayFormat){case"index":return(e,r,n)=>{t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===n[e]&&(n[e]={}),n[e][t[1]]=r):n[e]=r};case"bracket":return(e,r,n)=>{t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==n[e]?n[e]=[].concat(n[e],r):n[e]=[r]:n[e]=r};case"comma":case"separator":return(t,r,n)=>{const c="string"==typeof r&&r.includes(e.arrayFormatSeparator),a="string"==typeof r&&!c&&s(r,e).includes(e.arrayFormatSeparator);r=a?s(r,e):r;const i=c||a?r.split(e.arrayFormatSeparator).map(t=>s(t,e)):null===r?r:s(r,e);n[t]=i};default:return(e,t,r)=>{void 0!==r[e]?r[e]=[].concat(r[e],t):r[e]=t}}}(t),n=Object.create(null);if("string"!=typeof e)return n;if(!(e=e.trim().replace(/^[?#&]/,"")))return n;for(const c of e.split("&")){let[e,i]=a(t.decode?c.replace(/\+/g," "):c,"=");i=void 0===i?null:["comma","separator"].includes(t.arrayFormat)?i:s(i,t),r(s(e,t),i,n)}for(const e of Object.keys(n)){const r=n[e];if("object"==typeof r&&null!==r)for(const e of Object.keys(r))r[e]=p(r[e],t);else n[e]=p(r,t)}return!1===t.sort?n:(!0===t.sort?Object.keys(n).sort():Object.keys(n).sort(t.sort)).reduce((e,t)=>{const r=n[t];return Boolean(r)&&"object"==typeof r&&!Array.isArray(r)?e[t]=function e(t){return Array.isArray(t)?t.sort():"object"==typeof t?e(Object.keys(t)).sort((e,t)=>Number(e)-Number(t)).map(e=>t[e]):t}(r):e[t]=r,e},Object.create(null))}t.extract=u,t.parse=m,t.stringify=(e,t)=>{if(!e)return"";i((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);const r=r=>t.skipNull&&null==e[r]||t.skipEmptyString&&""===e[r],n=function(e){switch(e.arrayFormat){case"index":return t=>(r,n)=>{const c=r.length;return void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[o(t,e),"[",c,"]"].join("")]:[...r,[o(t,e),"[",o(c,e),"]=",o(n,e)].join("")]};case"bracket":return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[o(t,e),"[]"].join("")]:[...r,[o(t,e),"[]=",o(n,e)].join("")];case"comma":case"separator":return t=>(r,n)=>null==n||0===n.length?r:0===r.length?[[o(t,e),"=",o(n,e)].join("")]:[[r,o(n,e)].join(e.arrayFormatSeparator)];default:return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,o(t,e)]:[...r,[o(t,e),"=",o(n,e)].join("")]}}(t),c={};for(const t of Object.keys(e))r(t)||(c[t]=e[t]);const a=Object.keys(c);return!1!==t.sort&&a.sort(t.sort),a.map(r=>{const c=e[r];return void 0===c?"":null===c?o(r,t):Array.isArray(c)?c.reduce(n(r),[]).join("&"):o(r,t)+"="+o(c,t)}).filter(e=>e.length>0).join("&")},t.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);const[r,n]=a(e,"#");return Object.assign({url:r.split("?")[0]||"",query:m(u(e),t)},t&&t.parseFragmentIdentifier&&n?{fragmentIdentifier:s(n,t)}:{})},t.stringifyUrl=(e,r)=>{r=Object.assign({encode:!0,strict:!0},r);const n=l(e.url).split("?")[0]||"",c=t.extract(e.url),a=t.parse(c,{sort:!1}),i=Object.assign(a,e.query);let s=t.stringify(i,r);s&&(s="?"+s);let u=function(e){let t="";const r=e.indexOf("#");return-1!==r&&(t=e.slice(r)),t}(e.url);return e.fragmentIdentifier&&(u="#"+o(e.fragmentIdentifier,r)),`${n}${s}${u}`}},function(e,t){!function(){e.exports=this.wp.apiFetch}()},function(e,t){!function(){e.exports=this.wp.blocks}()},function(e,t){!function(){e.exports=this.wp.compose}()},function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},function(e,t){!function(){e.exports=this.wp.editPost}()},,,function(e,t){!function(){e.exports=this.wp.plugins}()},function(e,t,r){},function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},function(e,t){e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,c=!1,a=void 0;try{for(var i,o=e[Symbol.iterator]();!(n=(i=o.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){c=!0,a=e}finally{try{n||null==o.return||o.return()}finally{if(c)throw a}}return r}}},function(e,t,r){var n=r(22);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}},function(e,t){e.exports=function(){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(e,t,r){"use strict";e.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,e=>"%"+e.charCodeAt(0).toString(16).toUpperCase())},function(e,t,r){"use strict";var n=new RegExp("%[a-f0-9]{2}","gi"),c=new RegExp("(%[a-f0-9]{2})+","gi");function a(e,t){try{return decodeURIComponent(e.join(""))}catch(e){}if(1===e.length)return e;t=t||1;var r=e.slice(0,t),n=e.slice(t);return Array.prototype.concat.call([],a(r),a(n))}function i(e){try{return decodeURIComponent(e)}catch(c){for(var t=e.match(n),r=1;r<t.length;r++)t=(e=a(t,r).join("")).match(n);return e}}e.exports=function(e){if("string"!=typeof e)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch(t){return function(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},r=c.exec(e);r;){try{t[r[0]]=decodeURIComponent(r[0])}catch(e){var n=i(r[0]);n!==r[0]&&(t[r[0]]=n)}r=c.exec(e)}t["%C2"]="�";for(var a=Object.keys(t),o=0;o<a.length;o++){var s=a[o];e=e.replace(new RegExp(s,"g"),t[s])}return e}(e)}}},function(e,t,r){"use strict";e.exports=(e,t)=>{if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];const r=e.indexOf(t);return-1===r?[e]:[e.slice(0,r),e.slice(r+t.length)]}},function(e,t,r){"use strict";r.r(t);var n=r(1),c=r(17),a=r(11),i=(r(18),r(13)),o=r.n(i),s=r(4);function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var p={isFetching:!0,isPreview:!1,tab:3===parseInt(tiTpc.tier)?"library":"templates",templates:[],patterns:[],library:{items:[],currentPage:0,totalPages:0},preview:{type:"templates",item:{}}};Object(s.registerStore)("tpc/block-editor",{reducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p,t=arguments.length>1?arguments[1]:void 0;return"SET_FETCHING"===t.type?u(u({},e),{},{isFetching:t.isFetching}):"TOGGLE_PREVIEW"===t.type?u(u({},e),{},{isPreview:!e.isPreview}):"UPDATE_CURRENT_TAB"===t.type?u(u({},e),{},{tab:t.tab,isPreview:!1}):"UPDATE_TEMPLATES"===t.type?u(u({},e),{},{templates:{items:t.items,currentPage:Number(t.currentPage),totalPages:Number(t.totalPages)}}):"UPDATE_PATTERNS"===t.type?u(u({},e),{},{patterns:t.items}):"UPDATE_LIBRARY"===t.type?u(u({},e),{},{library:{items:t.items,currentPage:Number(t.currentPage),totalPages:Number(t.totalPages)}}):"SET_PREVIEW_DATA"===t.type?u(u({},e),{},{preview:t.preview}):e},selectors:{isFetching:function(e){return e.isFetching},isPreview:function(e){return e.isPreview},getCurrentTab:function(e){return e.tab},getTemplates:function(e){return e.templates},getPatterns:function(e){return e.patterns},getLibrary:function(e){return e.library},getPreview:function(e){return e.preview}},actions:{setFetching:function(e){return{type:"SET_FETCHING",isFetching:e}},togglePreview:function(e){return{type:"TOGGLE_PREVIEW",isPreview:e}},updateCurrentTab:function(e){return{type:"UPDATE_CURRENT_TAB",tab:e}},updateTemplates:function(e,t,r){return{type:"UPDATE_TEMPLATES",items:e,currentPage:t,totalPages:r}},updatePatterns:function(e){return{type:"UPDATE_PATTERNS",items:e}},updateLibrary:function(e,t,r){return{type:"UPDATE_LIBRARY",items:e,currentPage:t,totalPages:r}},setPreviewData:function(e){return{type:"SET_PREVIEW_DATA",preview:e}}}});var m=r(0),b=wp.primitives,f=b.Path,d=b.SVG,g=function(){return Object(m.createElement)(d,{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(m.createElement)(f,{d:"M22.8063 24H1.19365C0.534714 24 0 23.4653 0 22.8063V1.19365C0 0.534714 0.534714 0 1.19365 0H22.8063C23.4653 0 24 0.534714 24 1.19365V22.8063C24 23.4653 23.4653 24 22.8063 24Z",fill:"#14171C"}),Object(m.createElement)(f,{d:"M19.8466 20.8187V7.39687V4.43164H16.884H3.45947L6.422 7.39687H16.884V17.8562L19.8466 20.8187Z",fill:"white"}),Object(m.createElement)(f,{d:"M10.138 14.1429L10.1407 17.0838L12.7764 19.7195L12.7656 11.5152L4.55859 11.5044L7.19435 14.1375L10.138 14.1429Z",fill:"white"}))},O=function(){return Object(m.createElement)(d,{width:"100",height:"100",viewBox:"0 0 100 100",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"tpc-template-cloud-icon"},Object(m.createElement)(f,{d:"M95.0264 100H4.97356C2.22797 100 0 97.772 0 95.0264V4.97356C0 2.22797 2.22797 0 4.97356 0H95.0264C97.772 0 100 2.22797 100 4.97356V95.0264C100 97.772 97.772 100 95.0264 100Z",fill:"#0366D6"}),Object(m.createElement)(f,{d:"M82.6941 86.7448V30.8205V18.4653H70.3502H14.4146L26.7584 30.8205H70.3502V74.401L82.6941 86.7448Z",fill:"white"}),Object(m.createElement)(f,{d:"M42.2416 58.9291L42.2528 71.183L53.2352 82.1653L53.1902 47.9806L18.9941 47.9355L29.9765 58.9066L42.2416 58.9291Z",fill:"white"}))},v=r(3),j=r.n(v),h=r(6),y=r.n(h),w=r(7),_=r.n(w),E=r(10),k=r.n(E),x=r(2),P=r(14),S=r(9),T="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),C=new Uint8Array(16);function B(){if(!T)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return T(C)}var N=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var I=function(e){return"string"==typeof e&&N.test(e)},A=[],D=0;D<256;++D)A.push((D+256).toString(16).substr(1));var F=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(A[e[t+0]]+A[e[t+1]]+A[e[t+2]]+A[e[t+3]]+"-"+A[e[t+4]]+A[e[t+5]]+"-"+A[e[t+6]]+A[e[t+7]]+"-"+A[e[t+8]]+A[e[t+9]]+"-"+A[e[t+10]]+A[e[t+11]]+A[e[t+12]]+A[e[t+13]]+A[e[t+14]]+A[e[t+15]]).toLowerCase();if(!I(r))throw TypeError("Stringified UUID is invalid");return r};var V=function(e,t,r){var n=(e=e||{}).random||(e.rng||B)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var c=0;c<16;++c)t[r+c]=n[c];return t}return F(n)},L=r(8),U=r.n(L);function M(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function R(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?M(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):M(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var H=Object(s.dispatch)("tpc/block-editor"),z=H.updateLibrary,G=H.updateTemplates,q=Object(s.dispatch)("core/notices").createNotice,$=function(e){q("warning",e,{context:"themeisle-blocks/notices/templates-cloud",isDismissible:!0})},W=function(){var e=y()(j.a.mark((function e(){var t,r,n,c,a,i,o,s=arguments;return j.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=s.length>0&&void 0!==s[0]?s[0]:{},r=R(R({cache:localStorage.getItem("tpcCacheBuster")},tiTpc.params),{},{per_page:12,page:0,premade:!0,template_site_slug:"general"},t),n=Object(S.stringifyUrl)({url:tiTpc.endpoint+"page-templates",query:r}),e.prev=3,e.next=6,k()({url:n,method:"GET",parse:!1});case 6:if(!(c=e.sent).ok){e.next=16;break}return e.next=10,c.json();case 10:if(!(a=e.sent).message){e.next=13;break}return e.abrupt("return",$(a.message));case 13:i=c.headers.get("x-wp-totalpages"),o=r.page,G(a,o,i);case 16:e.next=21;break;case 18:e.prev=18,e.t0=e.catch(3),e.t0.message&&$(e.t0.message);case 21:case"end":return e.stop()}}),e,null,[[3,18]])})));return function(){return e.apply(this,arguments)}}(),Z=function(){var e=y()(j.a.mark((function e(){var t,r,n,c,a,i,o,s=arguments;return j.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=s.length>0&&void 0!==s[0]?s[0]:{},r=R({per_page:12,page:0},t),n=Object(S.stringifyUrl)({url:tiTpc.endpoint+"templates",query:R(R({cache:localStorage.getItem("tpcCacheBuster")},tiTpc.params),r)}),e.prev=3,e.next=6,k()({url:n,method:"GET",parse:!1});case 6:if(!(c=e.sent).ok){e.next=16;break}return e.next=10,c.json();case 10:if(!(a=e.sent).message){e.next=13;break}return e.abrupt("return",$(a.message));case 13:i=c.headers.get("x-wp-totalpages"),o=r.page,z(a,o,i);case 16:e.next=21;break;case 18:e.prev=18,e.t0=e.catch(3),e.t0.message&&$(e.t0.message);case 21:case"end":return e.stop()}}),e,null,[[3,18]])})));return function(){return e.apply(this,arguments)}}(),Y=function(){var e=y()(j.a.mark((function e(t){var r,n,c;return j.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Object(S.stringifyUrl)({url:"".concat(tiTpc.endpoint,"templates/").concat(t.template_id),query:R(R({cache:localStorage.getItem("tpcCacheBuster")},tiTpc.params),t)}),e.prev=1,e.next=4,k()({url:r,method:"POST",data:t,parse:!1});case 4:if(!(n=e.sent).ok){e.next=11;break}return e.next=8,n.json();case 8:if(!(c=e.sent).message){e.next=11;break}return e.abrupt("return",$(c.message));case 11:return localStorage.setItem("tpcCacheBuster",V()),e.next=14,W();case 14:e.next=19;break;case 16:e.prev=16,e.t0=e.catch(1),e.t0.message&&$(e.t0.message);case 19:case"end":return e.stop()}}),e,null,[[1,16]])})));return function(t){return e.apply(this,arguments)}}(),J=function(){var e=y()(j.a.mark((function e(t){var r,n,c;return j.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Object(S.stringifyUrl)({url:"".concat(tiTpc.endpoint,"templates/").concat(t,"/import"),query:R({cache:localStorage.getItem("tpcCacheBuster")},tiTpc.params)}),n={},e.prev=2,e.next=5,k()({url:r,method:"GET",parse:!1});case 5:if(!(c=e.sent).ok){e.next=12;break}return e.next=9,c.json();case 9:if(!(n=e.sent).message){e.next=12;break}return e.abrupt("return",$(n.message));case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(2),e.t0.message&&$(e.t0.message);case 17:return e.abrupt("return",n);case 18:case"end":return e.stop()}}),e,null,[[2,14]])})));return function(t){return e.apply(this,arguments)}}(),K=function(){var e=y()(j.a.mark((function e(t){var r,n,c;return j.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Object(S.stringifyUrl)({url:"".concat(tiTpc.endpoint,"templates/").concat(t),query:R({cache:localStorage.getItem("tpcCacheBuster"),_method:"DELETE"},tiTpc.params)}),e.prev=1,e.next=4,k()({url:r,method:"POST"});case 4:if(!(n=e.sent).ok){e.next=11;break}return e.next=8,n.json();case 8:if(!(c=e.sent).message){e.next=11;break}return e.abrupt("return",$(c.message));case 11:return localStorage.setItem("tpcCacheBuster",V()),e.next=14,Z();case 14:e.next=19;break;case 16:e.prev=16,e.t0=e.catch(1),e.t0.message&&$(e.t0.message);case 19:case"end":return e.stop()}}),e,null,[[1,16]])})));return function(t){return e.apply(this,arguments)}}(),Q=function(){var e=y()(j.a.mark((function e(t,r,n,c,a){var i,o,s;return j.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=Object(S.stringifyUrl)({url:"".concat(tiTpc.endpoint,"templates/").concat(t,"/publish"),query:R({cache:localStorage.getItem("tpcCacheBuster"),method:"POST",template_site_slug:r,template_thumbnail:n,premade:c?"yes":"no",link:a},tiTpc.params)}),e.prev=1,e.next=4,k()({url:i,method:"POST",headers:{Authorization:"Bearer ".concat(tiTpc.bearer||""," ")}});case 4:if(!(o=e.sent).ok){e.next=14;break}return e.next=8,o.json();case 8:if(!(s=e.sent).message){e.next=12;break}return $(s.message),e.abrupt("return",{success:!1});case 12:e.next=17;break;case 14:if(!o.message){e.next=17;break}return $(o.message),e.abrupt("return",{success:!1});case 17:return localStorage.setItem("tpcCacheBuster",V()),e.abrupt("return",{success:!0});case 21:if(e.prev=21,e.t0=e.catch(1),!e.t0.message){e.next=26;break}return $(e.t0.message),e.abrupt("return",{success:!1});case 26:case"end":return e.stop()}}),e,null,[[1,21]])})));return function(t,r,n,c,a){return e.apply(this,arguments)}}(),X=function(){var e=Object(s.useSelect)((function(e){return e("core/notices").getNotices("themeisle-blocks/notices/templates-cloud")})),t=Object(s.useDispatch)("core/notices").removeNotice;return Object(m.createElement)("div",{className:"notices"},e.map((function(e){return Object(m.createElement)(x.Notice,{key:e.id,status:e.status,isDismissible:e.isDismissible,onRemove:function(){return t(e.id,"themeisle-blocks/notices/templates-cloud")},actions:e.actions},e.content)})))};function ee(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function te(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ee(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ee(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var re=function(){var e=Object(m.useState)(!1),t=_()(e,2),r=t[0],c=t[1],i=Object(m.useState)(!1),o=_()(i,2),l=o[0],u=o[1],p=Object(m.useState)(""),b=_()(p,2),f=b[0],d=b[1],O=window.tiTpc.canPredefine,v=Object(s.useDispatch)("core/notices"),h=v.createErrorNotice,w=v.createSuccessNotice,E=Object(s.useDispatch)("core/editor"),T=E.editPost,C=(E.savePost,Object(s.useSelect)((function(e){var t=e("core/block-editor"),r=t.getSelectedBlockCount,n=t.getSelectedBlock,c=t.getMultiSelectedBlocks,i=1===r()?n():c();return Object(a.serialize)(i)}),[])),B=Object(s.useSelect)((function(e){var t=(0,e("core/block-editor").getBlocks)();return Object(a.serialize)(t)}),[]),N=Object(s.useSelect)((function(e){return{meta:e("core/editor").getEditedPostAttribute("meta")||{},postId:e("core/editor").getEditedPostAttribute("id"),type:e("core/editor").getEditedPostAttribute("type"),link:e("core/editor").getEditedPostAttribute("link"),postTitle:e("core/editor").getEditedPostAttribute("title")||Object(n.__)("Template")}})),I=N.meta,A=N.postTitle,D=N.postId,F=N.type,L=N.link,M=N.meta,R=M._ti_tpc_template_sync,H=M._ti_tpc_template_id,z=M._ti_tpc_screenshot_url,G=M._ti_tpc_site_slug,q=M._ti_tpc_published,$=Object(s.useSelect)((function(e,t){var r=t.forceIsSaving,n=e("core/editor"),c=n.isSavingPost,a=n.isPublishingPost,i=n.isAutosavingPost,o=r||c(),s=i();return(a()||o)&&!s})),W=Object(m.useState)(R),Z=_()(W,2),Y=Z[0],J=Z[1],K=Object(m.useState)(H),ee=_()(K,2),re=ee[0],ne=ee[1],ce=Object(m.useState)(G),ae=_()(ce,2),ie=ae[0],oe=ae[1],se=Object(m.useState)(q),le=_()(se,2),ue=le[0],pe=le[1],me=Object(m.useState)(z),be=_()(me,2),fe=be[0],de=be[1];Object(m.useEffect)((function(){T({meta:te(te({},I),{},{_ti_tpc_template_sync:Y,_ti_tpc_template_id:re,_ti_tpc_screenshot_url:fe,_ti_tpc_site_slug:ie,_ti_tpc_published:ue})})}),[Y,re,fe,ie,ue]),Object(m.useEffect)((function(){$&&Y&&Oe()}),[$,Y]);var ge=function(){var e=y()(j.a.mark((function e(){var t,r,a,i;return j.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u(!0),t={__file:"wp_export",version:2,content:C},r=Object(S.stringifyUrl)({url:window.tiTpc.endpoint+"templates",query:te(te({},window.tiTpc.params),{},{template_name:f,template_type:"gutenberg"})}),e.prev=3,e.next=6,k()({url:r,method:"POST",data:t,parse:!1});case 6:if(!(a=e.sent).ok){e.next=12;break}return e.next=10,a.json();case 10:(i=e.sent).message?h(i.message,{type:"snackbar"}):(window.localStorage.setItem("tpcCacheBuster",V()),w(Object(n.__)("Template saved."),{type:"snackbar"}));case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(3),e.t0.message&&h(e.t0.message,{type:"snackbar"});case 17:u(!1),c(!1),d("");case 20:case"end":return e.stop()}}),e,null,[[3,14]])})));return function(){return e.apply(this,arguments)}}(),Oe=function(){var e=y()(j.a.mark((function e(){var t,r,c,a;return j.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u(!0),t={__file:"wp_export",version:2,content:B},r=re?Object(S.stringifyUrl)({url:window.tiTpc.endpoint+"templates/"+re,query:te(te({},window.tiTpc.params),{},{template_name:A})}):Object(S.stringifyUrl)({url:window.tiTpc.endpoint+"templates",query:te(te({},window.tiTpc.params),{},{template_name:A,template_type:"gutenberg",template_site_slug:G||"",template_thumbnail:z||""})}),e.prev=3,e.next=6,k()({url:r,method:"POST",data:t,parse:!1});case 6:if(!(c=e.sent).ok){e.next=12;break}return e.next=10,c.json();case 10:(a=e.sent).message?h(a.message,{type:"snackbar"}):(a.template_id&&ne(a.template_id),window.localStorage.setItem("tpcCacheBuster",V()),w(Object(n.__)("Template saved."),{type:"snackbar"}),ve());case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(3),e.t0.message&&h(e.t0.message,{type:"snackbar"});case 17:u(!1);case 18:case"end":return e.stop()}}),e,null,[[3,14]])})));return function(){return e.apply(this,arguments)}}(),ve=function(){var e=null;return"post"===F?e=new wp.api.models.Post({id:D}):"page"===F&&(e=new wp.api.models.Page({id:D})),e.set("meta",{_ti_tpc_template_id:re,_ti_tpc_template_sync:Y,_ti_tpc_screenshot_url:fe,_ti_tpc_site_slug:ie,_ti_tpc_published:!ue}),e.save()};return["post","page"].includes(F)?Object(m.createElement)(m.Fragment,null,Object(m.createElement)(P.PluginBlockSettingsMenuItem,{label:Object(n.__)("Save as Template"),icon:"none",onClick:function(){return c(!0)}}),Object(m.createElement)(P.PluginSidebarMoreMenuItem,{icon:Object(m.createElement)(x.Icon,{icon:g}),target:"ti-tpc"},Object(n.__)("Templates Cloud")),Object(m.createElement)(P.PluginSidebar,{name:"ti-tpc",title:Object(n.__)("Templates Cloud"),className:"ti-tpc-components-panel"},Object(m.createElement)(x.PanelBody,null,Object(n.__)("Save this page as a template in your Templates Cloud library."),Object(m.createElement)(x.Button,{isPrimary:!0,isBusy:l,disabled:l,onClick:Oe},Object(n.__)("Save Page as Template")),Object(m.createElement)(x.ToggleControl,{label:Object(n.__)("Automatically sync to the cloud"),checked:Y,onChange:function(){return J(!Y)}})),O&&Object(m.createElement)(x.PanelBody,null,Object(m.createElement)("h4",null,Object(n.__)("Publish Settings")),Object(m.createElement)(x.TextControl,{label:Object(n.__)("Screenshot URL"),value:fe,type:"url",onChange:de}),Object(m.createElement)(x.TextControl,{label:Object(n.__)("Site Slug"),value:ie,help:Object(n.__)("Use `general` to publish this as a global template. Otherwise use the starter site slug to make it available as a single page for the starter site."),type:"url",onChange:oe}),Object(m.createElement)((function(){if(!O)return null;var e=function(){var e=y()(j.a.mark((function e(){return j.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u("publishing"),e.next=3,Q(H,G,z,!q,L).then((function(e){e.success&&(pe(!ue),ve(),w(ue?Object(n.__)("Template Unpublished."):Object(n.__)("Template Published."),{type:"snackbar"}))}));case 3:u(!1);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object(m.createElement)(x.Button,{isSecondary:!0,onClick:e,disabled:!1!==l,className:U()({"is-loading":"publishing"===l})},ue&&("publishing"===l?Object(n.__)("Unpublishing"):Object(n.__)("Unpublish")),!ue&&("publishing"===l?Object(n.__)("Publishing"):Object(n.__)("Publish")))}),null),Object(m.createElement)(X,null))),r&&Object(m.createElement)(x.Modal,{title:Object(n.__)("Save Template"),onRequestClose:function(){return c(!1)}},Object(m.createElement)(x.TextControl,{label:Object(n.__)("Template Name"),value:f,onChange:d}),Object(m.createElement)(x.Button,{isPrimary:!0,isBusy:l,disabled:l,onClick:ge},Object(n.__)("Save")))):null},ne=r(12),ce=r(5),ae=Object(m.createElement)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(m.createElement)(ce.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"})),ie=Object(m.createElement)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(m.createElement)(ce.Path,{d:"M10.2 3.28c3.53 0 6.43 2.61 6.92 6h2.08l-3.5 4-3.5-4h2.32c-.45-1.97-2.21-3.45-4.32-3.45-1.45 0-2.73.71-3.54 1.78L4.95 5.66C6.23 4.2 8.11 3.28 10.2 3.28zm-.4 13.44c-3.52 0-6.43-2.61-6.92-6H.8l3.5-4c1.17 1.33 2.33 2.67 3.5 4H5.48c.45 1.97 2.21 3.45 4.32 3.45 1.45 0 2.73-.71 3.54-1.78l1.71 1.95c-1.28 1.46-3.15 2.38-5.25 2.38z"})),oe=Object(m.createElement)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(m.createElement)(ce.Path,{d:"M13 11.9l3.3-3.4-1.1-1-3.2 3.3-3.2-3.3-1.1 1 3.3 3.4-3.5 3.6 1 1L12 13l3.5 3.5 1-1z"})),se=function(e){var t=e.closeModal,r=Object(s.useDispatch)("tpc/block-editor"),c=r.setFetching,a=r.updateCurrentTab,i={templates:Object(n.__)("Page Templates")};3===parseInt(tiTpc.tier)&&(i.library=Object(n.__)("My Library"));var o=Object(s.useSelect)((function(e){return e("tpc/block-editor").isFetching()})),l=Object(s.useSelect)((function(e){return e("tpc/block-editor").isPreview()})),u=Object(s.useSelect)((function(e){return e("tpc/block-editor").getCurrentTab()})),p=function(){var e=y()(j.a.mark((function e(){return j.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return window.localStorage.setItem("tpcCacheBuster",V()),c(!0),e.next=4,W();case 4:return e.next=6,Z();case 6:c(!1);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object(m.createElement)("div",{className:"modal-header"},Object(m.createElement)("div",{className:"left"},Object(m.createElement)(x.Icon,{icon:O})),Object(m.createElement)("div",{className:"center"},Object.keys(i).map((function(e){return Object(m.createElement)(x.Button,{key:e,onClick:function(){return a(e)},className:U()("tabs",{"is-active":e===u})},i[e])}))),Object(m.createElement)("div",{className:"right"},"library"===u&&!l&&Object(m.createElement)(x.ButtonGroup,null,Object(m.createElement)(x.Button,{label:Object(n.__)("Re-sync Library"),icon:ie,disabled:o,className:U()("is-sync",{"is-loading":o}),onClick:p})),Object(m.createElement)(x.Button,{label:Object(n.__)("Close Modal"),icon:oe,onClick:t})))},le=wp.blockEditor.BlockPreview,ue=function(e){var t=e.isFetching,r=e.importBlocks,c=Object(ne.useViewportMatch)("large",">="),i=Object(ne.useViewportMatch)("large","<="),o=Object(ne.useViewportMatch)("small",">="),l=Object(ne.useViewportMatch)("small","<="),u=1400;!c&&!i&&o&&!l?u=960:!(c||i||o||l)&&(u=600);var p=Object(s.useDispatch)("tpc/block-editor"),b=p.setFetching,f=p.togglePreview,d=Object(s.useSelect)((function(e){return e("tpc/block-editor").getPreview()})).item;Object(m.useEffect)((function(){w()}),[]);var g=Object(m.useState)(""),O=_()(g,2),v=O[0],h=O[1],w=function(){var e=y()(j.a.mark((function e(){return j.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return b(!0),e.next=3,E();case 3:b(!1);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),E=function(){var e=y()(j.a.mark((function e(){var t;return j.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return b(!0),e.next=3,J(d.template_id);case 3:(t=e.sent).__file&&t.content&&"wp_export"===t.__file&&h(t.content),b(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object(m.createElement)("div",{className:"tpc-modal-content"},Object(m.createElement)("div",{className:"preview-header"},Object(m.createElement)("div",{className:"left"},d.template_name||Object(n.__)("Template")),Object(m.createElement)("div",{className:"right"},Object(m.createElement)(x.Button,{isSecondary:!0,onClick:f},Object(n.__)("Close Preview")),Object(m.createElement)(x.Button,{isPrimary:!0,isBusy:t,disabled:t,onClick:function(){f(),r(v)}},Object(n.__)("Import")))),t?Object(m.createElement)(x.Placeholder,null,Object(m.createElement)(x.Spinner,null)):Object(m.createElement)("div",{className:"preview-content"},Object(m.createElement)(le,{blocks:Object(a.parse)(v),viewportWidth:u})))},pe=Object(m.createElement)(ce.SVG,{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(m.createElement)(ce.Path,{d:"M3 15h18v-2H3v2zm0 4h18v-2H3v2zm0-8h18V9H3v2zm0-6v2h18V5H3z"})),me=Object(m.createElement)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(m.createElement)(ce.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7.8 16.5H5c-.3 0-.5-.2-.5-.5v-6.2h6.8v6.7zm0-8.3H4.5V5c0-.3.2-.5.5-.5h6.2v6.7zm8.3 7.8c0 .3-.2.5-.5.5h-6.2v-6.8h6.8V19zm0-7.8h-6.8V4.5H19c.3 0 .5.2.5.5v6.2z",fillRule:"evenodd",clipRule:"evenodd"})),be=function(e){var t=e.layout,r=e.setLayout;return Object(m.createElement)("div",{className:"filters"},Object(m.createElement)("div",{className:"display-filters"},Object(m.createElement)(x.Button,{label:Object(n.__)("List View"),icon:pe,onClick:function(){return r("list")},isPressed:"list"===t}),Object(m.createElement)(x.Button,{label:Object(n.__)("Grid View"),icon:me,onClick:function(){return r("grid")},isPressed:"grid"===t})))},fe=Object(m.createElement)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(m.createElement)(ce.Path,{d:"M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z"})),de=Object(m.createElement)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(m.createElement)(ce.Path,{d:"M18.3 5.6L9.9 16.9l-4.6-3.4-.9 1.2 5.8 4.3 9.3-12.6z"})),ge=Object(m.createElement)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(m.createElement)(ce.Path,{d:"M12 4h3c.6 0 1 .4 1 1v1H3V5c0-.6.5-1 1-1h3c.2-1.1 1.3-2 2.5-2s2.3.9 2.5 2zM8 4h3c-.2-.6-.9-1-1.5-1S8.2 3.4 8 4zM4 7h11l-.9 10.1c0 .5-.5.9-1 .9H5.9c-.5 0-.9-.4-1-.9L4 7z"})),Oe=Object(m.createElement)(ce.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(m.createElement)(ce.Path,{d:"M7 5.5h10a.5.5 0 01.5.5v12a.5.5 0 01-.5.5H7a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM17 4H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V6a2 2 0 00-2-2zm-1 3.75H8v1.5h8v-1.5zM8 11h8v1.5H8V11zm6 3.25H8v1.5h6v-1.5z"})),ve=function(e){var t=e.layout,r=e.item,c=e.importBlocks,a=e.deletable,i=Object(s.useDispatch)("tpc/block-editor"),o=i.togglePreview,l=i.setPreviewData,u=Object(m.useState)(!1),p=_()(u,2),b=p[0],f=p[1],d=Object(m.useState)(!1),g=_()(d,2),O=g[0],v=g[1],h=Object(m.useState)(r.template_name),w=_()(h,2),E=w[0],k=w[1],P=function(){var e=y()(j.a.mark((function e(){var t;return j.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return f("importing"),e.next=3,J(r.template_id);case 3:(t=e.sent).__file&&t.content&&"wp_export"===t.__file&&c(t.content),f(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),S=function(){var e=y()(j.a.mark((function e(){return j.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return f("updating"),e.next=3,Y({template_id:r.template_id,template_name:E||r.template_name});case 3:return e.next=5,Z();case 5:f(!1),v(!O);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),T=function(){var e=y()(j.a.mark((function e(){return j.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(window.confirm(Object(n.__)("Are you sure you want to delete this template?"))){e.next=2;break}return e.abrupt("return",!1);case 2:return f("deleting"),e.next=5,K(r.template_id);case 5:f(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),C=function(){var e=y()(j.a.mark((function e(){return j.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o(),l({type:"library",item:r});case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();if("grid"===t){var B={backgroundImage:"url(".concat(r.template_thumbnail,")")};return Object(m.createElement)("div",{key:r.template_id,className:"table-grid"},Object(m.createElement)("div",{style:B,className:U()("grid-preview",{"is-loading":O||!1!==b})},Object(m.createElement)("div",{className:"preview-actions"},Object(m.createElement)(x.Button,{isSecondary:!0,disabled:!1!==b,onClick:C},Object(n.__)("Preview")),Object(m.createElement)(x.Button,{isPrimary:!0,isBusy:"importing"===b,disabled:!1!==b,onClick:P},Object(n.__)("Import")),a&&Object(m.createElement)("div",{className:"preview-controls"},Object(m.createElement)(x.Button,{label:Object(n.__)("Edit"),icon:"updating"===b?ie:fe,disabled:O||!1!==b,className:U()({"is-loading":"updating"===b}),onClick:function(){return v(!O)}},O&&Object(m.createElement)(x.Popover,{onFocusOutside:function(){return v(!O)},className:"controls-popover"},Object(m.createElement)("div",{className:"popover-content"},Object(m.createElement)(x.TextControl,{label:Object(n.__)("Template Name"),value:E,onChange:k}),Object(m.createElement)(x.Button,{label:Object(n.__)("Update"),icon:"updating"===b?ie:de,disabled:!1!==b,className:U()({"is-loading":"updating"===b}),onClick:S})))),Object(m.createElement)(x.Button,{label:Object(n.__)("Delete"),icon:"deleting"===b?ie:ge,disabled:!1!==b,className:U()({"is-loading":"deleting"===b}),onClick:T})))),Object(m.createElement)("div",{className:"card-footer"},Object(m.createElement)("p",null,r.template_name)))}var N=U()("actions",{"no-controls":!a});return Object(m.createElement)("div",{key:r.template_id,className:"table-row"},Object(m.createElement)("div",{className:"row-title"},Object(m.createElement)(x.Icon,{icon:Oe}),O?Object(m.createElement)(x.TextControl,{label:Object(n.__)("Template Name"),hideLabelFromVision:!0,value:E,onChange:k}):r.template_name),a&&Object(m.createElement)("div",{className:"row-controls"},Object(m.createElement)(x.Button,{label:O?Object(n.__)("Update"):Object(n.__)("Edit"),icon:O?"updating"===b?ie:de:fe,disabled:!1!==b,className:U()({"is-loading":"updating"===b}),onClick:O?S:function(){return v(!O)}},O?Object(n.__)("Update"):Object(n.__)("Edit")),Object(m.createElement)(x.Button,{label:Object(n.__)("Delete"),icon:"deleting"===b?ie:ge,disabled:!1!==b,className:U()({"is-loading":"deleting"===b}),onClick:T},"deleting"===b?Object(n.__)("Deleting")+"...":Object(n.__)("Delete"))),Object(m.createElement)("div",{className:N},Object(m.createElement)(x.Button,{isSecondary:!0,disabled:!1!==b,onClick:C},Object(n.__)("Preview")),Object(m.createElement)(x.Button,{isPrimary:!0,isBusy:"importing"===b,disabled:!1!==b,onClick:P},Object(n.__)("Import"))))},je=function(e){var t=e.total,r=e.current,n=e.onChange;if(t<2)return null;for(var c=[],a=function(e){var t=e===r;c.push(Object(m.createElement)(x.Button,{key:"page-".concat(e),isPrimary:t,disabled:t,onClick:function(){return n(e)}},e+1))},i=0;i<t;i++)a(i);return Object(m.createElement)(x.ButtonGroup,{className:"pagination"},c)},he=Object(s.withSelect)((function(e,t){var r=t.isGeneral?e("tpc/block-editor").getTemplates():e("tpc/block-editor").getLibrary(),n=r.items;return{items:void 0===n?[]:n,currentPage:r.currentPage,totalPages:r.totalPages}}))((function(e){var t=e.importBlocks,r=e.isGeneral,c=void 0!==r&&r,a=e.isFetching,i=e.items,o=e.currentPage,l=e.totalPages,u=Object(s.useDispatch)("tpc/block-editor").setFetching,p=Object(m.useState)("grid"),b=_()(p,2),f=b[0],d=b[1],g=function(){var e=y()(j.a.mark((function e(){return j.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u(!0),!c){e.next=6;break}return e.next=4,W();case 4:e.next=8;break;case 6:return e.next=8,Z();case 8:u(!1);case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();Object(m.useEffect)((function(){i&&i.length>0||g()}),[c]);var O=function(){var e=y()(j.a.mark((function e(t){return j.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u(!0),!c){e.next=6;break}return e.next=4,W({page:t});case 4:e.next=8;break;case 6:return e.next=8,Z({page:t});case 8:u(!1);case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();if(a)return Object(m.createElement)(x.Placeholder,null,Object(m.createElement)(x.Spinner,null));if(!Boolean(i.length))return Object(m.createElement)("div",{className:"table-content"},Object(n.__)("No templates available. Add a new one?"));var v=U()("table-content",{"is-grid":"grid"===f});return Object(m.createElement)(m.Fragment,null,Object(m.createElement)(be,{layout:f,setLayout:d}),Object(m.createElement)("div",{className:v},i.map((function(e){return Object(m.createElement)(ve,{deletable:!c,key:e.template_id,layout:f,item:e,importBlocks:t})}))),Object(m.createElement)(je,{onChange:O,current:o,total:l}))})),ye=Object(s.withSelect)((function(e){var t=e("tpc/block-editor"),r=t.isPreview,n=t.isFetching,c=t.getCurrentTab;return{isPreview:r(),isFetching:n(),currentTab:c()}}))((function(e){var t=e.importBlocks,r=e.isPreview,c=e.currentTab,a=e.isFetching;return r&&"library"===c?Object(m.createElement)(ue,{isFetching:a,importBlocks:t}):Object(m.createElement)("div",{className:"tpc-modal-content"},Object(m.createElement)(X,null),["templates","library"].includes(c)&&Object(m.createElement)(he,{isFetching:a,isGeneral:"templates"===c,importBlocks:t}),"patterns"===c&&Object(n.__)("We are still working on this. Please check back later. Thank you!"))})),we=function(e){var t=e.title,r=e.leftButtons,c=e.rightButtons,a=e.heading,i=e.previewUrl,o=Object(S.stringifyUrl)({url:i,query:{tpcpreview:"yes"}}),s=t||Object(n.__)("Preview");return Object(m.createElement)("div",{className:"ob-preview single-templates"},Object(m.createElement)("div",{className:"preview"},Object(m.createElement)("iframe",{title:s,src:o,frameBorder:"0"}),Object(m.createElement)("div",{className:"loading"},Object(m.createElement)(x.Dashicon,{icon:"update",size:50}))),Object(m.createElement)("div",{className:"bottom-bar"},r&&Object(m.createElement)("div",{className:"navigator"},r),a&&Object(m.createElement)("h2",{className:"heading"},a),c&&Object(m.createElement)("div",{className:"actions"},c)))},_e=Object(ne.compose)(Object(s.withSelect)((function(e){var t=e("tpc/block-editor"),r=t.isPreview,n=t.getPreview,c=t.getCurrentTab;return{isPreview:r(),currentTab:c(),previewData:n().item}})),Object(s.withDispatch)((function(e){var t=e("core/block-editor"),r=t.removeBlock,n=t.replaceBlocks,c=e("tpc/block-editor").togglePreview;return{removeBlock:r,replaceBlocks:n,closePreview:function(){return c(!1)}}})))((function(e){var t=e.clientId,r=e.isPreview,c=e.previewData,i=e.currentTab,o=e.removeBlock,l=e.replaceBlocks,u=e.closePreview,p=Object(s.useDispatch)("core/notices").createErrorNotice,b=Object(m.useState)(!1),f=_()(b,2),d=f[0],g=f[1],O=Object(m.useState)(!1),v=_()(O,2),h=v[0],w=v[1],E=function(e){l(t,Object(a.parse)(e))},k=function(){var e=y()(j.a.mark((function e(){return j.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return w(!0),e.next=3,J(c.template_id).then((function(e){if(e.__file&&e.content&&"wp_export"===e.__file)return u(),w(!1),E(e.content),!1;p(Object(n.__)("Something went wrong while importing. Please try again."),{type:"snackbar"}),w(!1),o(t)}));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),P=function(){g(!1),w(!1),o(t)};if(Object(m.useEffect)((function(){setTimeout((function(){g(!0)}),100)}),[]),!d)return null;return Object(m.createElement)(m.Fragment,null,Object(m.createElement)(x.Modal,{onRequestClose:P,shouldCloseOnEsc:!1,shouldCloseOnClickOutside:!r||"templates"!==i,isDismissible:!1,overlayClassName:"tpc-template-cloud-modal"},Object(m.createElement)(se,{closeModal:P}),Object(m.createElement)(ye,{importBlocks:E}),Object(m.createElement)((function(){if(!r||"templates"!==i)return null;var e=c.link,t=c.template_name;return Object(m.createElement)(x.Modal,{isDismissible:!1,shouldCloseOnClickOutside:!1,shouldCloseOnEsc:!1,className:"tpc-preview-wrap-modal"},Object(m.createElement)(we,{previewUrl:e,heading:t,leftButtons:Object(m.createElement)(m.Fragment,null,Object(m.createElement)(x.Button,{disabled:h,icon:ae,onClick:u})),rightButtons:Object(m.createElement)(x.Button,{disabled:h,isPrimary:!0,onClick:k},h?Object(n.__)("Importing")+"...":Object(n.__)("Import"))}),";")}),null)))}));Object(a.registerBlockType)("ti-tpc/templates-cloud",{title:Object(n.__)("Templates Cloud"),description:Object(n.__)("A cloud based templates library which enables you to create ready-made website in no time."),icon:g,category:"design",keywords:["templates cloud","patterns","template library"],supports:{html:!1},edit:_e,save:function(){return null}}),3===parseInt(tiTpc.tier)&&Object(c.registerPlugin)("ti-tpc",{render:re,icon:g})}]);
|
editor/src/components/content.js
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { __ } from '@wordpress/i18n';
|
2 |
+
import { withSelect } from '@wordpress/data';
|
3 |
+
|
4 |
+
import Preview from './preview';
|
5 |
+
import TemplatesContent from './templates-content';
|
6 |
+
import Notices from './notices';
|
7 |
+
|
8 |
+
const Content = ( { importBlocks, isPreview, currentTab, isFetching } ) => {
|
9 |
+
if ( isPreview && currentTab === 'library' ) {
|
10 |
+
return (
|
11 |
+
<Preview isFetching={ isFetching } importBlocks={ importBlocks } />
|
12 |
+
);
|
13 |
+
}
|
14 |
+
|
15 |
+
return (
|
16 |
+
<div className="tpc-modal-content">
|
17 |
+
<Notices />
|
18 |
+
{ [ 'templates', 'library' ].includes( currentTab ) && (
|
19 |
+
<TemplatesContent
|
20 |
+
isFetching={ isFetching }
|
21 |
+
isGeneral={ currentTab === 'templates' }
|
22 |
+
importBlocks={ importBlocks }
|
23 |
+
/>
|
24 |
+
) }
|
25 |
+
{ currentTab === 'patterns' &&
|
26 |
+
__(
|
27 |
+
'We are still working on this. Please check back later. Thank you!'
|
28 |
+
) }
|
29 |
+
</div>
|
30 |
+
);
|
31 |
+
};
|
32 |
+
|
33 |
+
export default withSelect( ( select ) => {
|
34 |
+
const { isPreview, isFetching, getCurrentTab } = select(
|
35 |
+
'tpc/block-editor'
|
36 |
+
);
|
37 |
+
return {
|
38 |
+
isPreview: isPreview(),
|
39 |
+
isFetching: isFetching(),
|
40 |
+
currentTab: getCurrentTab(),
|
41 |
+
};
|
42 |
+
} )( Content );
|
editor/src/components/filters.js
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { alignJustify, grid } from '@wordpress/icons';
|
2 |
+
import { __ } from '@wordpress/i18n';
|
3 |
+
import { Button } from '@wordpress/components';
|
4 |
+
|
5 |
+
const Filters = ( { layout, setLayout } ) => {
|
6 |
+
return (
|
7 |
+
<div className="filters">
|
8 |
+
<div className="display-filters">
|
9 |
+
<Button
|
10 |
+
label={ __( 'List View' ) }
|
11 |
+
icon={ alignJustify }
|
12 |
+
onClick={ () => setLayout( 'list' ) }
|
13 |
+
isPressed={ 'list' === layout }
|
14 |
+
/>
|
15 |
+
|
16 |
+
<Button
|
17 |
+
label={ __( 'Grid View' ) }
|
18 |
+
icon={ grid }
|
19 |
+
onClick={ () => setLayout( 'grid' ) }
|
20 |
+
isPressed={ 'grid' === layout }
|
21 |
+
/>
|
22 |
+
</div>
|
23 |
+
</div>
|
24 |
+
);
|
25 |
+
};
|
26 |
+
|
27 |
+
export default Filters;
|
editor/src/components/header.js
ADDED
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* global tiTpc */
|
2 |
+
import classnames from 'classnames';
|
3 |
+
import { v4 as uuidv4 } from 'uuid';
|
4 |
+
|
5 |
+
import { closeSmall, update } from '@wordpress/icons';
|
6 |
+
import { __ } from '@wordpress/i18n';
|
7 |
+
import { Button, ButtonGroup, Icon } from '@wordpress/components';
|
8 |
+
import { useDispatch, useSelect } from '@wordpress/data';
|
9 |
+
|
10 |
+
import icon from './../icon';
|
11 |
+
import { fetchTemplates, fetchLibrary } from './../data/templates-cloud/index';
|
12 |
+
|
13 |
+
const Header = ( { closeModal } ) => {
|
14 |
+
const { setFetching, updateCurrentTab } = useDispatch( 'tpc/block-editor' );
|
15 |
+
|
16 |
+
const TABS = {
|
17 |
+
templates: __( 'Page Templates' ),
|
18 |
+
// patterns: __( 'Patterns' ),
|
19 |
+
};
|
20 |
+
|
21 |
+
if ( parseInt( tiTpc.tier ) === 3 ) {
|
22 |
+
TABS.library = __( 'My Library' );
|
23 |
+
}
|
24 |
+
|
25 |
+
const isFetching = useSelect( ( select ) =>
|
26 |
+
select( 'tpc/block-editor' ).isFetching()
|
27 |
+
);
|
28 |
+
const isPreview = useSelect( ( select ) =>
|
29 |
+
select( 'tpc/block-editor' ).isPreview()
|
30 |
+
);
|
31 |
+
const currentTab = useSelect( ( select ) =>
|
32 |
+
select( 'tpc/block-editor' ).getCurrentTab()
|
33 |
+
);
|
34 |
+
|
35 |
+
const syncLibrary = async () => {
|
36 |
+
window.localStorage.setItem( 'tpcCacheBuster', uuidv4() );
|
37 |
+
setFetching( true );
|
38 |
+
await fetchTemplates();
|
39 |
+
await fetchLibrary();
|
40 |
+
setFetching( false );
|
41 |
+
};
|
42 |
+
|
43 |
+
return (
|
44 |
+
<div className="modal-header">
|
45 |
+
<div className="left">
|
46 |
+
<Icon icon={ icon } />
|
47 |
+
</div>
|
48 |
+
|
49 |
+
<div className="center">
|
50 |
+
{ Object.keys( TABS ).map( ( i ) => (
|
51 |
+
<Button
|
52 |
+
key={ i }
|
53 |
+
onClick={ () => updateCurrentTab( i ) }
|
54 |
+
className={ classnames( 'tabs', {
|
55 |
+
'is-active': i === currentTab,
|
56 |
+
} ) }
|
57 |
+
>
|
58 |
+
{ TABS[ i ] }
|
59 |
+
</Button>
|
60 |
+
) ) }
|
61 |
+
</div>
|
62 |
+
|
63 |
+
<div className="right">
|
64 |
+
{ 'library' === currentTab && ! isPreview && (
|
65 |
+
<ButtonGroup>
|
66 |
+
<Button
|
67 |
+
label={ __( 'Re-sync Library' ) }
|
68 |
+
icon={ update }
|
69 |
+
disabled={ isFetching }
|
70 |
+
className={ classnames( 'is-sync', {
|
71 |
+
'is-loading': isFetching,
|
72 |
+
} ) }
|
73 |
+
onClick={ syncLibrary }
|
74 |
+
/>
|
75 |
+
</ButtonGroup>
|
76 |
+
) }
|
77 |
+
|
78 |
+
<Button
|
79 |
+
label={ __( 'Close Modal' ) }
|
80 |
+
icon={ closeSmall }
|
81 |
+
onClick={ closeModal }
|
82 |
+
/>
|
83 |
+
</div>
|
84 |
+
</div>
|
85 |
+
);
|
86 |
+
};
|
87 |
+
|
88 |
+
export default Header;
|
editor/src/components/list-item.js
ADDED
@@ -0,0 +1,299 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* eslint-disable camelcase */
|
2 |
+
import classnames from 'classnames';
|
3 |
+
|
4 |
+
import {
|
5 |
+
// cloudUpload,
|
6 |
+
check,
|
7 |
+
edit,
|
8 |
+
group,
|
9 |
+
page,
|
10 |
+
trash,
|
11 |
+
update,
|
12 |
+
} from '@wordpress/icons';
|
13 |
+
import { __ } from '@wordpress/i18n';
|
14 |
+
import { Button, Icon, Popover, TextControl } from '@wordpress/components';
|
15 |
+
import { useDispatch } from '@wordpress/data';
|
16 |
+
import { useState } from '@wordpress/element';
|
17 |
+
|
18 |
+
import {
|
19 |
+
updateTemplate,
|
20 |
+
deleteTemplate,
|
21 |
+
// duplicateTemplate,
|
22 |
+
importTemplate,
|
23 |
+
fetchLibrary,
|
24 |
+
} from './../data/templates-cloud/index';
|
25 |
+
|
26 |
+
const ListItem = ( { layout, item, importBlocks, deletable } ) => {
|
27 |
+
const { togglePreview, setPreviewData } = useDispatch( 'tpc/block-editor' );
|
28 |
+
const [ isLoading, setLoading ] = useState( false );
|
29 |
+
const [ isEditing, setEditing ] = useState( false );
|
30 |
+
const [ itemName, setItemName ] = useState( item.template_name );
|
31 |
+
|
32 |
+
const importItem = async () => {
|
33 |
+
setLoading( 'importing' );
|
34 |
+
const data = await importTemplate( item.template_id );
|
35 |
+
|
36 |
+
if ( data.__file && data.content && 'wp_export' === data.__file ) {
|
37 |
+
importBlocks( data.content );
|
38 |
+
}
|
39 |
+
setLoading( false );
|
40 |
+
};
|
41 |
+
|
42 |
+
const updateItem = async () => {
|
43 |
+
setLoading( 'updating' );
|
44 |
+
await updateTemplate( {
|
45 |
+
template_id: item.template_id,
|
46 |
+
template_name: itemName || item.template_name,
|
47 |
+
} );
|
48 |
+
await fetchLibrary();
|
49 |
+
setLoading( false );
|
50 |
+
setEditing( ! isEditing );
|
51 |
+
};
|
52 |
+
|
53 |
+
/* const duplicateItem = async () => {
|
54 |
+
setLoading( 'duplicating' );
|
55 |
+
await duplicateTemplate( item.template_id );
|
56 |
+
setLoading( false );
|
57 |
+
};*/
|
58 |
+
|
59 |
+
const deleteItem = async () => {
|
60 |
+
if (
|
61 |
+
! window.confirm(
|
62 |
+
__( 'Are you sure you want to delete this template?' )
|
63 |
+
)
|
64 |
+
) {
|
65 |
+
return false;
|
66 |
+
}
|
67 |
+
|
68 |
+
setLoading( 'deleting' );
|
69 |
+
await deleteTemplate( item.template_id );
|
70 |
+
setLoading( false );
|
71 |
+
};
|
72 |
+
|
73 |
+
const importPreview = async () => {
|
74 |
+
togglePreview();
|
75 |
+
setPreviewData( {
|
76 |
+
type: 'library',
|
77 |
+
item,
|
78 |
+
} );
|
79 |
+
};
|
80 |
+
|
81 |
+
if ( 'grid' === layout ) {
|
82 |
+
const style = { backgroundImage: `url(${ item.template_thumbnail })` };
|
83 |
+
|
84 |
+
return (
|
85 |
+
<div key={ item.template_id } className="table-grid">
|
86 |
+
<div
|
87 |
+
style={ style }
|
88 |
+
className={ classnames( 'grid-preview', {
|
89 |
+
'is-loading': isEditing || false !== isLoading,
|
90 |
+
} ) }
|
91 |
+
>
|
92 |
+
<div className="preview-actions">
|
93 |
+
<Button
|
94 |
+
isSecondary
|
95 |
+
disabled={ false !== isLoading }
|
96 |
+
onClick={ importPreview }
|
97 |
+
>
|
98 |
+
{ __( 'Preview' ) }
|
99 |
+
</Button>
|
100 |
+
|
101 |
+
<Button
|
102 |
+
isPrimary
|
103 |
+
isBusy={ 'importing' === isLoading }
|
104 |
+
disabled={ false !== isLoading }
|
105 |
+
onClick={ importItem }
|
106 |
+
>
|
107 |
+
{ __( 'Import' ) }
|
108 |
+
</Button>
|
109 |
+
|
110 |
+
{ deletable && (
|
111 |
+
<div className="preview-controls">
|
112 |
+
<Button
|
113 |
+
label={ __( 'Edit' ) }
|
114 |
+
icon={
|
115 |
+
'updating' === isLoading ? update : edit
|
116 |
+
}
|
117 |
+
disabled={
|
118 |
+
isEditing || false !== isLoading
|
119 |
+
}
|
120 |
+
className={ classnames( {
|
121 |
+
'is-loading': 'updating' === isLoading,
|
122 |
+
} ) }
|
123 |
+
onClick={ () => setEditing( ! isEditing ) }
|
124 |
+
>
|
125 |
+
{ isEditing && (
|
126 |
+
<Popover
|
127 |
+
onFocusOutside={ () =>
|
128 |
+
setEditing( ! isEditing )
|
129 |
+
}
|
130 |
+
className="controls-popover"
|
131 |
+
>
|
132 |
+
<div className="popover-content">
|
133 |
+
<TextControl
|
134 |
+
label={ __(
|
135 |
+
'Template Name'
|
136 |
+
) }
|
137 |
+
value={ itemName }
|
138 |
+
onChange={ setItemName }
|
139 |
+
/>
|
140 |
+
|
141 |
+
<Button
|
142 |
+
label={ __( 'Update' ) }
|
143 |
+
icon={
|
144 |
+
'updating' === isLoading
|
145 |
+
? update
|
146 |
+
: check
|
147 |
+
}
|
148 |
+
disabled={
|
149 |
+
false !== isLoading
|
150 |
+
}
|
151 |
+
className={ classnames( {
|
152 |
+
'is-loading':
|
153 |
+
'updating' ===
|
154 |
+
isLoading,
|
155 |
+
} ) }
|
156 |
+
onClick={ updateItem }
|
157 |
+
/>
|
158 |
+
</div>
|
159 |
+
</Popover>
|
160 |
+
) }
|
161 |
+
</Button>
|
162 |
+
|
163 |
+
{ /*<Button
|
164 |
+
label={ __( 'Duplicate' ) }
|
165 |
+
icon={
|
166 |
+
'duplicating' === isLoading
|
167 |
+
? update
|
168 |
+
: group
|
169 |
+
}
|
170 |
+
disabled={ false !== isLoading }
|
171 |
+
className={ classnames( {
|
172 |
+
'is-loading':
|
173 |
+
'duplicating' === isLoading,
|
174 |
+
} ) }
|
175 |
+
onClick={ duplicateItem }
|
176 |
+
/>*/ }
|
177 |
+
|
178 |
+
<Button
|
179 |
+
label={ __( 'Delete' ) }
|
180 |
+
icon={
|
181 |
+
'deleting' === isLoading
|
182 |
+
? update
|
183 |
+
: trash
|
184 |
+
}
|
185 |
+
disabled={ false !== isLoading }
|
186 |
+
className={ classnames( {
|
187 |
+
'is-loading': 'deleting' === isLoading,
|
188 |
+
} ) }
|
189 |
+
onClick={ deleteItem }
|
190 |
+
/>
|
191 |
+
</div>
|
192 |
+
) }
|
193 |
+
</div>
|
194 |
+
</div>
|
195 |
+
|
196 |
+
<div className="card-footer">
|
197 |
+
<p>{ item.template_name }</p>
|
198 |
+
</div>
|
199 |
+
</div>
|
200 |
+
);
|
201 |
+
}
|
202 |
+
|
203 |
+
const actionClasses = classnames( 'actions', {
|
204 |
+
'no-controls': ! deletable,
|
205 |
+
} );
|
206 |
+
|
207 |
+
return (
|
208 |
+
<div key={ item.template_id } className="table-row">
|
209 |
+
<div className="row-title">
|
210 |
+
<Icon icon={ page } />
|
211 |
+
{ isEditing ? (
|
212 |
+
<TextControl
|
213 |
+
label={ __( 'Template Name' ) }
|
214 |
+
hideLabelFromVision
|
215 |
+
value={ itemName }
|
216 |
+
onChange={ setItemName }
|
217 |
+
/>
|
218 |
+
) : (
|
219 |
+
item.template_name
|
220 |
+
) }
|
221 |
+
</div>
|
222 |
+
|
223 |
+
{ deletable && (
|
224 |
+
<div className="row-controls">
|
225 |
+
<Button
|
226 |
+
label={ isEditing ? __( 'Update' ) : __( 'Edit' ) }
|
227 |
+
icon={
|
228 |
+
isEditing
|
229 |
+
? 'updating' === isLoading
|
230 |
+
? update
|
231 |
+
: check
|
232 |
+
: edit
|
233 |
+
}
|
234 |
+
disabled={ false !== isLoading }
|
235 |
+
className={ classnames( {
|
236 |
+
'is-loading': 'updating' === isLoading,
|
237 |
+
} ) }
|
238 |
+
onClick={
|
239 |
+
isEditing
|
240 |
+
? updateItem
|
241 |
+
: () => setEditing( ! isEditing )
|
242 |
+
}
|
243 |
+
>
|
244 |
+
{ isEditing ? __( 'Update' ) : __( 'Edit' ) }
|
245 |
+
</Button>
|
246 |
+
|
247 |
+
{ /*<Button
|
248 |
+
label={ __( 'Duplicate' ) }
|
249 |
+
icon={ 'duplicating' === isLoading ? update : group }
|
250 |
+
disabled={ false !== isLoading }
|
251 |
+
className={ classnames( {
|
252 |
+
'is-loading': 'duplicating' === isLoading,
|
253 |
+
} ) }
|
254 |
+
onClick={ duplicateItem }
|
255 |
+
/>*/ }
|
256 |
+
|
257 |
+
<Button
|
258 |
+
label={ __( 'Delete' ) }
|
259 |
+
icon={ 'deleting' === isLoading ? update : trash }
|
260 |
+
disabled={ false !== isLoading }
|
261 |
+
className={ classnames( {
|
262 |
+
'is-loading': 'deleting' === isLoading,
|
263 |
+
} ) }
|
264 |
+
onClick={ deleteItem }
|
265 |
+
>
|
266 |
+
{ 'deleting' === isLoading
|
267 |
+
? __( 'Deleting' ) + '...'
|
268 |
+
: __( 'Delete' ) }
|
269 |
+
</Button>
|
270 |
+
{ /* <Button
|
271 |
+
label={ __( 'Sync' ) }
|
272 |
+
icon={ cloudUpload }
|
273 |
+
onClick={ () => console.log( 'Upload to cloud.' ) }
|
274 |
+
/> */ }
|
275 |
+
</div>
|
276 |
+
) }
|
277 |
+
<div className={ actionClasses }>
|
278 |
+
<Button
|
279 |
+
isSecondary
|
280 |
+
disabled={ false !== isLoading }
|
281 |
+
onClick={ importPreview }
|
282 |
+
>
|
283 |
+
{ __( 'Preview' ) }
|
284 |
+
</Button>
|
285 |
+
|
286 |
+
<Button
|
287 |
+
isPrimary
|
288 |
+
isBusy={ 'importing' === isLoading }
|
289 |
+
disabled={ false !== isLoading }
|
290 |
+
onClick={ importItem }
|
291 |
+
>
|
292 |
+
{ __( 'Import' ) }
|
293 |
+
</Button>
|
294 |
+
</div>
|
295 |
+
</div>
|
296 |
+
);
|
297 |
+
};
|
298 |
+
|
299 |
+
export default ListItem;
|
editor/src/components/notices.js
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* WordPress dependencies
|
3 |
+
*/
|
4 |
+
import { Notice } from '@wordpress/components';
|
5 |
+
import { useDispatch, useSelect } from '@wordpress/data';
|
6 |
+
|
7 |
+
const Notices = () => {
|
8 |
+
const notices = useSelect( ( select ) =>
|
9 |
+
select( 'core/notices' ).getNotices(
|
10 |
+
'themeisle-blocks/notices/templates-cloud'
|
11 |
+
)
|
12 |
+
);
|
13 |
+
|
14 |
+
const { removeNotice } = useDispatch( 'core/notices' );
|
15 |
+
|
16 |
+
return (
|
17 |
+
<div className="notices">
|
18 |
+
{ notices.map( ( notice ) => (
|
19 |
+
<Notice
|
20 |
+
key={ notice.id }
|
21 |
+
status={ notice.status }
|
22 |
+
isDismissible={ notice.isDismissible }
|
23 |
+
onRemove={ () =>
|
24 |
+
removeNotice(
|
25 |
+
notice.id,
|
26 |
+
'themeisle-blocks/notices/templates-cloud'
|
27 |
+
)
|
28 |
+
}
|
29 |
+
actions={ notice.actions }
|
30 |
+
>
|
31 |
+
{ notice.content }
|
32 |
+
</Notice>
|
33 |
+
) ) }
|
34 |
+
</div>
|
35 |
+
);
|
36 |
+
};
|
37 |
+
|
38 |
+
export default Notices;
|
editor/src/components/pagination.js
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { Button, ButtonGroup } from '@wordpress/components';
|
2 |
+
|
3 |
+
const Pagination = ( { total, current, onChange } ) => {
|
4 |
+
if ( total < 2 ) {
|
5 |
+
return null;
|
6 |
+
}
|
7 |
+
|
8 |
+
const pages = [];
|
9 |
+
|
10 |
+
for ( let i = 0; i < total; i++ ) {
|
11 |
+
const isCurrent = i === current;
|
12 |
+
|
13 |
+
pages.push(
|
14 |
+
<Button
|
15 |
+
key={ `page-${ i }` }
|
16 |
+
isPrimary={ isCurrent }
|
17 |
+
disabled={ isCurrent }
|
18 |
+
onClick={ () => onChange( i ) }
|
19 |
+
>
|
20 |
+
{ i + 1 }
|
21 |
+
</Button>
|
22 |
+
);
|
23 |
+
}
|
24 |
+
|
25 |
+
return <ButtonGroup className="pagination">{ pages }</ButtonGroup>;
|
26 |
+
};
|
27 |
+
|
28 |
+
export default Pagination;
|
editor/src/components/preview.js
ADDED
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { __ } from '@wordpress/i18n';
|
2 |
+
import { parse } from '@wordpress/blocks';
|
3 |
+
import { Button, Placeholder, Spinner } from '@wordpress/components';
|
4 |
+
import { useViewportMatch } from '@wordpress/compose';
|
5 |
+
import { useDispatch, useSelect } from '@wordpress/data';
|
6 |
+
import { useEffect, useState } from '@wordpress/element';
|
7 |
+
const { BlockPreview } = wp.blockEditor;
|
8 |
+
|
9 |
+
import { importTemplate } from './../data/templates-cloud/index';
|
10 |
+
|
11 |
+
const Preview = ( { isFetching, importBlocks } ) => {
|
12 |
+
const isLarger = useViewportMatch( 'large', '>=' );
|
13 |
+
const isLarge = useViewportMatch( 'large', '<=' );
|
14 |
+
const isSmall = useViewportMatch( 'small', '>=' );
|
15 |
+
const isSmaller = useViewportMatch( 'small', '<=' );
|
16 |
+
|
17 |
+
let viewportWidth = 1400;
|
18 |
+
|
19 |
+
const isTablet = ! isLarger && ! isLarge && isSmall && ! isSmaller;
|
20 |
+
const isMobile = ! isLarger && ! isLarge && ! isSmall && ! isSmaller;
|
21 |
+
|
22 |
+
if ( isTablet ) {
|
23 |
+
viewportWidth = 960;
|
24 |
+
} else if ( isMobile ) {
|
25 |
+
viewportWidth = 600;
|
26 |
+
}
|
27 |
+
|
28 |
+
const { setFetching, togglePreview } = useDispatch( 'tpc/block-editor' );
|
29 |
+
|
30 |
+
const { item } = useSelect( ( select ) =>
|
31 |
+
select( 'tpc/block-editor' ).getPreview()
|
32 |
+
);
|
33 |
+
|
34 |
+
useEffect( () => {
|
35 |
+
init();
|
36 |
+
}, [] );
|
37 |
+
|
38 |
+
const [ content, setContent ] = useState( '' );
|
39 |
+
|
40 |
+
const init = async () => {
|
41 |
+
setFetching( true );
|
42 |
+
await importContent();
|
43 |
+
setFetching( false );
|
44 |
+
};
|
45 |
+
|
46 |
+
const importContent = async () => {
|
47 |
+
setFetching( true );
|
48 |
+
const data = await importTemplate( item.template_id );
|
49 |
+
|
50 |
+
if ( data.__file && data.content && 'wp_export' === data.__file ) {
|
51 |
+
setContent( data.content );
|
52 |
+
}
|
53 |
+
setFetching( false );
|
54 |
+
};
|
55 |
+
|
56 |
+
const importItem = () => {
|
57 |
+
togglePreview();
|
58 |
+
importBlocks( content );
|
59 |
+
};
|
60 |
+
|
61 |
+
return (
|
62 |
+
<div className="tpc-modal-content">
|
63 |
+
<div className="preview-header">
|
64 |
+
<div className="left">
|
65 |
+
{ item.template_name || __( 'Template' ) }
|
66 |
+
</div>
|
67 |
+
|
68 |
+
<div className="right">
|
69 |
+
<Button isSecondary onClick={ togglePreview }>
|
70 |
+
{ __( 'Close Preview' ) }
|
71 |
+
</Button>
|
72 |
+
|
73 |
+
<Button
|
74 |
+
isPrimary
|
75 |
+
isBusy={ isFetching }
|
76 |
+
disabled={ isFetching }
|
77 |
+
onClick={ importItem }
|
78 |
+
>
|
79 |
+
{ __( 'Import' ) }
|
80 |
+
</Button>
|
81 |
+
</div>
|
82 |
+
</div>
|
83 |
+
|
84 |
+
{ isFetching ? (
|
85 |
+
<Placeholder>
|
86 |
+
<Spinner />
|
87 |
+
</Placeholder>
|
88 |
+
) : (
|
89 |
+
<div className="preview-content">
|
90 |
+
<BlockPreview
|
91 |
+
blocks={ parse( content ) }
|
92 |
+
viewportWidth={ viewportWidth }
|
93 |
+
/>
|
94 |
+
</div>
|
95 |
+
) }
|
96 |
+
</div>
|
97 |
+
);
|
98 |
+
};
|
99 |
+
|
100 |
+
export default Preview;
|
editor/src/components/templates-content.js
ADDED
@@ -0,0 +1,107 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { __ } from '@wordpress/i18n';
|
2 |
+
import { Placeholder, Spinner } from '@wordpress/components';
|
3 |
+
import { withSelect, useDispatch } from '@wordpress/data';
|
4 |
+
import { Fragment, useEffect, useState } from '@wordpress/element';
|
5 |
+
|
6 |
+
import classnames from 'classnames';
|
7 |
+
|
8 |
+
import Filters from './filters';
|
9 |
+
import ListItem from './list-item';
|
10 |
+
import Pagination from './pagination';
|
11 |
+
import { fetchLibrary, fetchTemplates } from './../data/templates-cloud/index';
|
12 |
+
|
13 |
+
const TemplatesContent = ( {
|
14 |
+
importBlocks,
|
15 |
+
isGeneral = false,
|
16 |
+
isFetching,
|
17 |
+
items,
|
18 |
+
currentPage,
|
19 |
+
totalPages,
|
20 |
+
} ) => {
|
21 |
+
const { setFetching } = useDispatch( 'tpc/block-editor' );
|
22 |
+
const [ layout, setLayout ] = useState( 'grid' );
|
23 |
+
|
24 |
+
const init = async () => {
|
25 |
+
setFetching( true );
|
26 |
+
if ( isGeneral ) {
|
27 |
+
await fetchTemplates();
|
28 |
+
} else {
|
29 |
+
await fetchLibrary();
|
30 |
+
}
|
31 |
+
setFetching( false );
|
32 |
+
};
|
33 |
+
|
34 |
+
useEffect( () => {
|
35 |
+
if ( items && items.length > 0 ) {
|
36 |
+
return;
|
37 |
+
}
|
38 |
+
init();
|
39 |
+
}, [ isGeneral ] );
|
40 |
+
|
41 |
+
const changePage = async ( index ) => {
|
42 |
+
setFetching( true );
|
43 |
+
if ( isGeneral ) {
|
44 |
+
await fetchTemplates( {
|
45 |
+
page: index,
|
46 |
+
} );
|
47 |
+
} else {
|
48 |
+
await fetchLibrary( {
|
49 |
+
page: index,
|
50 |
+
} );
|
51 |
+
}
|
52 |
+
|
53 |
+
setFetching( false );
|
54 |
+
};
|
55 |
+
|
56 |
+
if ( isFetching ) {
|
57 |
+
return (
|
58 |
+
<Placeholder>
|
59 |
+
<Spinner />
|
60 |
+
</Placeholder>
|
61 |
+
);
|
62 |
+
}
|
63 |
+
|
64 |
+
if ( ! Boolean( items.length ) ) {
|
65 |
+
return (
|
66 |
+
<div className="table-content">
|
67 |
+
{ __( 'No templates available. Add a new one?' ) }
|
68 |
+
</div>
|
69 |
+
);
|
70 |
+
}
|
71 |
+
|
72 |
+
const contentClasses = classnames( 'table-content', {
|
73 |
+
'is-grid': 'grid' === layout,
|
74 |
+
} );
|
75 |
+
|
76 |
+
return (
|
77 |
+
<Fragment>
|
78 |
+
<Filters layout={ layout } setLayout={ setLayout } />
|
79 |
+
|
80 |
+
<div className={ contentClasses }>
|
81 |
+
{ items.map( ( item ) => (
|
82 |
+
<ListItem
|
83 |
+
deletable={ ! isGeneral }
|
84 |
+
key={ item.template_id }
|
85 |
+
layout={ layout }
|
86 |
+
item={ item }
|
87 |
+
importBlocks={ importBlocks }
|
88 |
+
/>
|
89 |
+
) ) }
|
90 |
+
</div>
|
91 |
+
|
92 |
+
<Pagination
|
93 |
+
onChange={ changePage }
|
94 |
+
current={ currentPage }
|
95 |
+
total={ totalPages }
|
96 |
+
/>
|
97 |
+
</Fragment>
|
98 |
+
);
|
99 |
+
};
|
100 |
+
|
101 |
+
export default withSelect( ( select, { isGeneral } ) => {
|
102 |
+
const library = isGeneral
|
103 |
+
? select( 'tpc/block-editor' ).getTemplates()
|
104 |
+
: select( 'tpc/block-editor' ).getLibrary();
|
105 |
+
const { items = [], currentPage, totalPages } = library;
|
106 |
+
return { items, currentPage, totalPages };
|
107 |
+
} )( TemplatesContent );
|
editor/src/data/block-editor/index.js
ADDED
@@ -0,0 +1,166 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { registerStore } from '@wordpress/data';
|
2 |
+
|
3 |
+
const DEFAULT_STATE = {
|
4 |
+
isFetching: true,
|
5 |
+
isPreview: false,
|
6 |
+
tab: parseInt( tiTpc.tier ) === 3 ? 'library' : 'templates',
|
7 |
+
templates: [],
|
8 |
+
patterns: [],
|
9 |
+
library: {
|
10 |
+
items: [],
|
11 |
+
currentPage: 0,
|
12 |
+
totalPages: 0,
|
13 |
+
},
|
14 |
+
preview: {
|
15 |
+
type: 'templates',
|
16 |
+
item: {},
|
17 |
+
},
|
18 |
+
};
|
19 |
+
|
20 |
+
registerStore( 'tpc/block-editor', {
|
21 |
+
reducer( state = DEFAULT_STATE, action ) {
|
22 |
+
if ( 'SET_FETCHING' === action.type ) {
|
23 |
+
return {
|
24 |
+
...state,
|
25 |
+
isFetching: action.isFetching,
|
26 |
+
};
|
27 |
+
}
|
28 |
+
|
29 |
+
if ( 'TOGGLE_PREVIEW' === action.type ) {
|
30 |
+
return {
|
31 |
+
...state,
|
32 |
+
isPreview: ! state.isPreview,
|
33 |
+
};
|
34 |
+
}
|
35 |
+
|
36 |
+
if ( 'UPDATE_CURRENT_TAB' === action.type ) {
|
37 |
+
return {
|
38 |
+
...state,
|
39 |
+
tab: action.tab,
|
40 |
+
isPreview: false,
|
41 |
+
};
|
42 |
+
}
|
43 |
+
|
44 |
+
if ( 'UPDATE_TEMPLATES' === action.type ) {
|
45 |
+
return {
|
46 |
+
...state,
|
47 |
+
templates: {
|
48 |
+
items: action.items,
|
49 |
+
currentPage: Number( action.currentPage ),
|
50 |
+
totalPages: Number( action.totalPages ),
|
51 |
+
},
|
52 |
+
};
|
53 |
+
}
|
54 |
+
|
55 |
+
if ( 'UPDATE_PATTERNS' === action.type ) {
|
56 |
+
return {
|
57 |
+
...state,
|
58 |
+
patterns: action.items,
|
59 |
+
};
|
60 |
+
}
|
61 |
+
|
62 |
+
if ( 'UPDATE_LIBRARY' === action.type ) {
|
63 |
+
return {
|
64 |
+
...state,
|
65 |
+
library: {
|
66 |
+
items: action.items,
|
67 |
+
currentPage: Number( action.currentPage ),
|
68 |
+
totalPages: Number( action.totalPages ),
|
69 |
+
},
|
70 |
+
};
|
71 |
+
}
|
72 |
+
|
73 |
+
if ( 'SET_PREVIEW_DATA' === action.type ) {
|
74 |
+
return {
|
75 |
+
...state,
|
76 |
+
preview: action.preview,
|
77 |
+
};
|
78 |
+
}
|
79 |
+
|
80 |
+
return state;
|
81 |
+
},
|
82 |
+
|
83 |
+
selectors: {
|
84 |
+
isFetching( state ) {
|
85 |
+
return state.isFetching;
|
86 |
+
},
|
87 |
+
|
88 |
+
isPreview( state ) {
|
89 |
+
return state.isPreview;
|
90 |
+
},
|
91 |
+
|
92 |
+
getCurrentTab( state ) {
|
93 |
+
return state.tab;
|
94 |
+
},
|
95 |
+
|
96 |
+
getTemplates( state ) {
|
97 |
+
return state.templates;
|
98 |
+
},
|
99 |
+
|
100 |
+
getPatterns( state ) {
|
101 |
+
return state.patterns;
|
102 |
+
},
|
103 |
+
|
104 |
+
getLibrary( state ) {
|
105 |
+
return state.library;
|
106 |
+
},
|
107 |
+
|
108 |
+
getPreview( state ) {
|
109 |
+
return state.preview;
|
110 |
+
},
|
111 |
+
},
|
112 |
+
|
113 |
+
actions: {
|
114 |
+
setFetching( isFetching ) {
|
115 |
+
return {
|
116 |
+
type: 'SET_FETCHING',
|
117 |
+
isFetching,
|
118 |
+
};
|
119 |
+
},
|
120 |
+
|
121 |
+
togglePreview( isPreview ) {
|
122 |
+
return {
|
123 |
+
type: 'TOGGLE_PREVIEW',
|
124 |
+
isPreview,
|
125 |
+
};
|
126 |
+
},
|
127 |
+
|
128 |
+
updateCurrentTab( tab ) {
|
129 |
+
return {
|
130 |
+
type: 'UPDATE_CURRENT_TAB',
|
131 |
+
tab,
|
132 |
+
};
|
133 |
+
},
|
134 |
+
|
135 |
+
updateTemplates( items, currentPage, totalPages ) {
|
136 |
+
return {
|
137 |
+
type: 'UPDATE_TEMPLATES',
|
138 |
+
items,
|
139 |
+
currentPage,
|
140 |
+
totalPages,
|
141 |
+
};
|
142 |
+
},
|
143 |
+
|
144 |
+
updatePatterns( items ) {
|
145 |
+
return {
|
146 |
+
type: 'UPDATE_PATTERNS',
|
147 |
+
items,
|
148 |
+
};
|
149 |
+
},
|
150 |
+
|
151 |
+
updateLibrary( items, currentPage, totalPages ) {
|
152 |
+
return {
|
153 |
+
type: 'UPDATE_LIBRARY',
|
154 |
+
items,
|
155 |
+
currentPage,
|
156 |
+
totalPages,
|
157 |
+
};
|
158 |
+
},
|
159 |
+
setPreviewData( preview ) {
|
160 |
+
return {
|
161 |
+
type: 'SET_PREVIEW_DATA',
|
162 |
+
preview,
|
163 |
+
};
|
164 |
+
},
|
165 |
+
},
|
166 |
+
} );
|
editor/src/data/index.js
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* Internal dependencies
|
3 |
+
*/
|
4 |
+
import './block-editor/index.js';
|
editor/src/data/templates-cloud/index.js
ADDED
@@ -0,0 +1,284 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* global localStorage, tiTpc */
|
2 |
+
import { stringifyUrl } from 'query-string';
|
3 |
+
import { v4 as uuidv4 } from 'uuid';
|
4 |
+
|
5 |
+
import apiFetch from '@wordpress/api-fetch';
|
6 |
+
import { dispatch } from '@wordpress/data';
|
7 |
+
|
8 |
+
const { updateLibrary, updateTemplates } = dispatch( 'tpc/block-editor' );
|
9 |
+
const { createNotice } = dispatch( 'core/notices' );
|
10 |
+
|
11 |
+
const createErrorNotice = ( message ) => {
|
12 |
+
createNotice( 'warning', message, {
|
13 |
+
context: 'themeisle-blocks/notices/templates-cloud',
|
14 |
+
isDismissible: true,
|
15 |
+
} );
|
16 |
+
};
|
17 |
+
|
18 |
+
export const fetchTemplates = async ( additionalParams = {} ) => {
|
19 |
+
const params = {
|
20 |
+
cache: localStorage.getItem( 'tpcCacheBuster' ),
|
21 |
+
...tiTpc.params,
|
22 |
+
per_page: 12,
|
23 |
+
page: 0,
|
24 |
+
premade: true,
|
25 |
+
template_site_slug: 'general',
|
26 |
+
...additionalParams,
|
27 |
+
};
|
28 |
+
|
29 |
+
const url = stringifyUrl( {
|
30 |
+
url: tiTpc.endpoint + 'page-templates',
|
31 |
+
query: params,
|
32 |
+
} );
|
33 |
+
|
34 |
+
try {
|
35 |
+
const response = await apiFetch( {
|
36 |
+
url,
|
37 |
+
method: 'GET',
|
38 |
+
parse: false,
|
39 |
+
} );
|
40 |
+
|
41 |
+
if ( response.ok ) {
|
42 |
+
const templates = await response.json();
|
43 |
+
|
44 |
+
if ( templates.message ) {
|
45 |
+
return createErrorNotice( templates.message );
|
46 |
+
}
|
47 |
+
const totalPages = response.headers.get( 'x-wp-totalpages' );
|
48 |
+
const currentPage = params.page;
|
49 |
+
updateTemplates( templates, currentPage, totalPages );
|
50 |
+
}
|
51 |
+
} catch ( error ) {
|
52 |
+
if ( error.message ) {
|
53 |
+
createErrorNotice( error.message );
|
54 |
+
}
|
55 |
+
}
|
56 |
+
};
|
57 |
+
|
58 |
+
export const fetchLibrary = async ( additionalParams = {} ) => {
|
59 |
+
const params = {
|
60 |
+
per_page: 12,
|
61 |
+
page: 0,
|
62 |
+
...additionalParams,
|
63 |
+
};
|
64 |
+
|
65 |
+
const url = stringifyUrl( {
|
66 |
+
url: tiTpc.endpoint + 'templates',
|
67 |
+
query: {
|
68 |
+
cache: localStorage.getItem( 'tpcCacheBuster' ),
|
69 |
+
...tiTpc.params,
|
70 |
+
...params,
|
71 |
+
},
|
72 |
+
} );
|
73 |
+
|
74 |
+
try {
|
75 |
+
const response = await apiFetch( {
|
76 |
+
url,
|
77 |
+
method: 'GET',
|
78 |
+
parse: false,
|
79 |
+
} );
|
80 |
+
|
81 |
+
if ( response.ok ) {
|
82 |
+
const templates = await response.json();
|
83 |
+
|
84 |
+
if ( templates.message ) {
|
85 |
+
return createErrorNotice( templates.message );
|
86 |
+
}
|
87 |
+
|
88 |
+
const totalPages = response.headers.get( 'x-wp-totalpages' );
|
89 |
+
const currentPage = params.page;
|
90 |
+
|
91 |
+
updateLibrary( templates, currentPage, totalPages );
|
92 |
+
}
|
93 |
+
} catch ( error ) {
|
94 |
+
if ( error.message ) {
|
95 |
+
createErrorNotice( error.message );
|
96 |
+
}
|
97 |
+
}
|
98 |
+
};
|
99 |
+
|
100 |
+
export const updateTemplate = async ( params ) => {
|
101 |
+
const url = stringifyUrl( {
|
102 |
+
url: `${ tiTpc.endpoint }templates/${ params.template_id }`,
|
103 |
+
query: {
|
104 |
+
cache: localStorage.getItem( 'tpcCacheBuster' ),
|
105 |
+
...tiTpc.params,
|
106 |
+
...params,
|
107 |
+
},
|
108 |
+
} );
|
109 |
+
|
110 |
+
try {
|
111 |
+
const response = await apiFetch( {
|
112 |
+
url,
|
113 |
+
method: 'POST',
|
114 |
+
data: params,
|
115 |
+
parse: false,
|
116 |
+
} );
|
117 |
+
|
118 |
+
if ( response.ok ) {
|
119 |
+
const content = await response.json();
|
120 |
+
|
121 |
+
if ( content.message ) {
|
122 |
+
return createErrorNotice( content.message );
|
123 |
+
}
|
124 |
+
}
|
125 |
+
|
126 |
+
localStorage.setItem( 'tpcCacheBuster', uuidv4() );
|
127 |
+
|
128 |
+
await fetchTemplates();
|
129 |
+
} catch ( error ) {
|
130 |
+
if ( error.message ) {
|
131 |
+
createErrorNotice( error.message );
|
132 |
+
}
|
133 |
+
}
|
134 |
+
};
|
135 |
+
|
136 |
+
export const importTemplate = async ( template ) => {
|
137 |
+
const url = stringifyUrl( {
|
138 |
+
url: `${ tiTpc.endpoint }templates/${ template }/import`,
|
139 |
+
query: {
|
140 |
+
cache: localStorage.getItem( 'tpcCacheBuster' ),
|
141 |
+
...tiTpc.params,
|
142 |
+
},
|
143 |
+
} );
|
144 |
+
|
145 |
+
let content = {};
|
146 |
+
|
147 |
+
try {
|
148 |
+
const response = await apiFetch( {
|
149 |
+
url,
|
150 |
+
method: 'GET',
|
151 |
+
parse: false,
|
152 |
+
} );
|
153 |
+
|
154 |
+
if ( response.ok ) {
|
155 |
+
content = await response.json();
|
156 |
+
|
157 |
+
if ( content.message ) {
|
158 |
+
return createErrorNotice( content.message );
|
159 |
+
}
|
160 |
+
}
|
161 |
+
} catch ( error ) {
|
162 |
+
if ( error.message ) {
|
163 |
+
createErrorNotice( error.message );
|
164 |
+
}
|
165 |
+
}
|
166 |
+
|
167 |
+
return content;
|
168 |
+
};
|
169 |
+
|
170 |
+
export const duplicateTemplate = async ( template ) => {
|
171 |
+
const url = stringifyUrl( {
|
172 |
+
url: `${ tiTpc.endpoint }templates/${ template }/clone`,
|
173 |
+
query: {
|
174 |
+
cache: localStorage.getItem( 'tpcCacheBuster' ),
|
175 |
+
...tiTpc.params,
|
176 |
+
},
|
177 |
+
} );
|
178 |
+
|
179 |
+
try {
|
180 |
+
const response = await apiFetch( {
|
181 |
+
url,
|
182 |
+
method: 'POST',
|
183 |
+
parse: false,
|
184 |
+
} );
|
185 |
+
|
186 |
+
if ( response.ok ) {
|
187 |
+
const content = await response.json();
|
188 |
+
|
189 |
+
if ( content.message ) {
|
190 |
+
return createErrorNotice( content.message );
|
191 |
+
}
|
192 |
+
}
|
193 |
+
|
194 |
+
localStorage.setItem( 'tpcCacheBuster', uuidv4() );
|
195 |
+
|
196 |
+
await fetchTemplates();
|
197 |
+
await fetchLibrary();
|
198 |
+
} catch ( error ) {
|
199 |
+
if ( error.message ) {
|
200 |
+
createErrorNotice( error.message );
|
201 |
+
}
|
202 |
+
}
|
203 |
+
};
|
204 |
+
|
205 |
+
export const deleteTemplate = async ( template ) => {
|
206 |
+
const url = stringifyUrl( {
|
207 |
+
url: `${ tiTpc.endpoint }templates/${ template }`,
|
208 |
+
query: {
|
209 |
+
cache: localStorage.getItem( 'tpcCacheBuster' ),
|
210 |
+
_method: 'DELETE',
|
211 |
+
...tiTpc.params,
|
212 |
+
},
|
213 |
+
} );
|
214 |
+
|
215 |
+
try {
|
216 |
+
const response = await apiFetch( { url, method: 'POST' } );
|
217 |
+
|
218 |
+
if ( response.ok ) {
|
219 |
+
const content = await response.json();
|
220 |
+
|
221 |
+
if ( content.message ) {
|
222 |
+
return createErrorNotice( content.message );
|
223 |
+
}
|
224 |
+
}
|
225 |
+
|
226 |
+
localStorage.setItem( 'tpcCacheBuster', uuidv4() );
|
227 |
+
|
228 |
+
await fetchLibrary();
|
229 |
+
} catch ( error ) {
|
230 |
+
if ( error.message ) {
|
231 |
+
createErrorNotice( error.message );
|
232 |
+
}
|
233 |
+
}
|
234 |
+
};
|
235 |
+
|
236 |
+
export const publishTemplate = async (
|
237 |
+
template,
|
238 |
+
siteSlug,
|
239 |
+
featuredImageURL,
|
240 |
+
publishStatus,
|
241 |
+
link
|
242 |
+
) => {
|
243 |
+
const url = stringifyUrl( {
|
244 |
+
url: `${ tiTpc.endpoint }templates/${ template }/publish`,
|
245 |
+
query: {
|
246 |
+
cache: localStorage.getItem( 'tpcCacheBuster' ),
|
247 |
+
method: 'POST',
|
248 |
+
template_site_slug: siteSlug,
|
249 |
+
template_thumbnail: featuredImageURL,
|
250 |
+
premade: publishStatus ? 'yes' : 'no',
|
251 |
+
link,
|
252 |
+
...tiTpc.params,
|
253 |
+
},
|
254 |
+
} );
|
255 |
+
|
256 |
+
try {
|
257 |
+
const response = await apiFetch( {
|
258 |
+
url,
|
259 |
+
method: 'POST',
|
260 |
+
headers: {
|
261 |
+
Authorization: `Bearer ${ tiTpc.bearer || '' } `,
|
262 |
+
},
|
263 |
+
} );
|
264 |
+
if ( response.ok ) {
|
265 |
+
const content = await response.json();
|
266 |
+
if ( content.message ) {
|
267 |
+
createErrorNotice( content.message );
|
268 |
+
return { success: false };
|
269 |
+
}
|
270 |
+
} else if ( response.message ) {
|
271 |
+
createErrorNotice( response.message );
|
272 |
+
return { success: false };
|
273 |
+
}
|
274 |
+
|
275 |
+
localStorage.setItem( 'tpcCacheBuster', uuidv4() );
|
276 |
+
|
277 |
+
return { success: true };
|
278 |
+
} catch ( error ) {
|
279 |
+
if ( error.message ) {
|
280 |
+
createErrorNotice( error.message );
|
281 |
+
return { success: false };
|
282 |
+
}
|
283 |
+
}
|
284 |
+
};
|
editor/src/edit.js
ADDED
@@ -0,0 +1,154 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { withDispatch, withSelect, useDispatch } from '@wordpress/data';
|
2 |
+
import { useState, useEffect } from '@wordpress/element';
|
3 |
+
import { Modal, Button } from '@wordpress/components';
|
4 |
+
import { compose } from '@wordpress/compose';
|
5 |
+
import { parse } from '@wordpress/blocks';
|
6 |
+
import { close } from '@wordpress/icons';
|
7 |
+
import { __ } from '@wordpress/i18n';
|
8 |
+
|
9 |
+
import Header from './components/header';
|
10 |
+
import Content from './components/content';
|
11 |
+
import PreviewFrame from '../../assets/src/Components/CloudLibrary/PreviewFrame';
|
12 |
+
import { importTemplate } from './data/templates-cloud';
|
13 |
+
|
14 |
+
const Edit = ( {
|
15 |
+
clientId,
|
16 |
+
isPreview,
|
17 |
+
previewData,
|
18 |
+
currentTab,
|
19 |
+
removeBlock,
|
20 |
+
replaceBlocks,
|
21 |
+
closePreview,
|
22 |
+
} ) => {
|
23 |
+
const { createErrorNotice } = useDispatch( 'core/notices' );
|
24 |
+
|
25 |
+
const [ modalOpen, setModalOpen ] = useState( false );
|
26 |
+
const [ importing, setImporting ] = useState( false );
|
27 |
+
|
28 |
+
const importBlocks = ( content ) => {
|
29 |
+
replaceBlocks( clientId, parse( content ) );
|
30 |
+
};
|
31 |
+
|
32 |
+
const importFromPreview = async () => {
|
33 |
+
setImporting( true );
|
34 |
+
await importTemplate( previewData.template_id ).then( ( r ) => {
|
35 |
+
if ( r.__file && r.content && 'wp_export' === r.__file ) {
|
36 |
+
closePreview();
|
37 |
+
setImporting( false );
|
38 |
+
importBlocks( r.content );
|
39 |
+
return false;
|
40 |
+
}
|
41 |
+
|
42 |
+
createErrorNotice(
|
43 |
+
__( 'Something went wrong while importing. Please try again.' ),
|
44 |
+
{
|
45 |
+
type: 'snackbar',
|
46 |
+
}
|
47 |
+
);
|
48 |
+
setImporting( false );
|
49 |
+
removeBlock( clientId );
|
50 |
+
} );
|
51 |
+
};
|
52 |
+
|
53 |
+
const closeModal = () => {
|
54 |
+
setModalOpen( false );
|
55 |
+
setImporting( false );
|
56 |
+
removeBlock( clientId );
|
57 |
+
};
|
58 |
+
|
59 |
+
useEffect( () => {
|
60 |
+
setTimeout( () => {
|
61 |
+
setModalOpen( true );
|
62 |
+
}, 100 );
|
63 |
+
}, [] );
|
64 |
+
|
65 |
+
if ( ! modalOpen ) {
|
66 |
+
return null;
|
67 |
+
}
|
68 |
+
|
69 |
+
const PreviewWrap = () => {
|
70 |
+
if ( ! isPreview || currentTab !== 'templates' ) {
|
71 |
+
return null;
|
72 |
+
}
|
73 |
+
const { link, template_name } = previewData;
|
74 |
+
|
75 |
+
return (
|
76 |
+
<Modal
|
77 |
+
isDismissible={ false }
|
78 |
+
shouldCloseOnClickOutside={ false }
|
79 |
+
shouldCloseOnEsc={ false }
|
80 |
+
className="tpc-preview-wrap-modal"
|
81 |
+
>
|
82 |
+
<PreviewFrame
|
83 |
+
previewUrl={ link }
|
84 |
+
heading={ template_name }
|
85 |
+
leftButtons={
|
86 |
+
<>
|
87 |
+
<Button
|
88 |
+
disabled={ importing }
|
89 |
+
icon={ close }
|
90 |
+
onClick={ closePreview }
|
91 |
+
/>
|
92 |
+
</>
|
93 |
+
}
|
94 |
+
rightButtons={
|
95 |
+
<Button
|
96 |
+
disabled={ importing }
|
97 |
+
isPrimary
|
98 |
+
onClick={ importFromPreview }
|
99 |
+
>
|
100 |
+
{ importing
|
101 |
+
? __( 'Importing' ) + '...'
|
102 |
+
: __( 'Import' ) }
|
103 |
+
</Button>
|
104 |
+
}
|
105 |
+
/>
|
106 |
+
;
|
107 |
+
</Modal>
|
108 |
+
);
|
109 |
+
};
|
110 |
+
|
111 |
+
return (
|
112 |
+
<>
|
113 |
+
<Modal
|
114 |
+
onRequestClose={ closeModal }
|
115 |
+
shouldCloseOnEsc={ false }
|
116 |
+
shouldCloseOnClickOutside={
|
117 |
+
! isPreview || currentTab !== 'templates'
|
118 |
+
}
|
119 |
+
isDismissible={ false }
|
120 |
+
overlayClassName="tpc-template-cloud-modal"
|
121 |
+
>
|
122 |
+
<Header closeModal={ closeModal } />
|
123 |
+
<Content importBlocks={ importBlocks } />
|
124 |
+
|
125 |
+
<PreviewWrap />
|
126 |
+
</Modal>
|
127 |
+
</>
|
128 |
+
);
|
129 |
+
};
|
130 |
+
|
131 |
+
export default compose(
|
132 |
+
withSelect( ( select ) => {
|
133 |
+
const { isPreview, getPreview, getCurrentTab } = select(
|
134 |
+
'tpc/block-editor'
|
135 |
+
);
|
136 |
+
return {
|
137 |
+
isPreview: isPreview(),
|
138 |
+
currentTab: getCurrentTab(),
|
139 |
+
previewData: getPreview().item,
|
140 |
+
};
|
141 |
+
} ),
|
142 |
+
withDispatch( ( dispatch ) => {
|
143 |
+
const { removeBlock, replaceBlocks } = dispatch( 'core/block-editor' );
|
144 |
+
const { togglePreview } = dispatch( 'tpc/block-editor' );
|
145 |
+
|
146 |
+
const closePreview = () => togglePreview( false );
|
147 |
+
|
148 |
+
return {
|
149 |
+
removeBlock,
|
150 |
+
replaceBlocks,
|
151 |
+
closePreview,
|
152 |
+
};
|
153 |
+
} )
|
154 |
+
)( Edit );
|
editor/src/editor.scss
ADDED
@@ -0,0 +1,481 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.tpc-template-cloud-icon {
|
2 |
+
max-width: 100%;
|
3 |
+
max-height: 100%;
|
4 |
+
}
|
5 |
+
|
6 |
+
.tpc-template-cloud-modal {
|
7 |
+
.components-modal__frame {
|
8 |
+
width: 100%;
|
9 |
+
|
10 |
+
.components-modal__content {
|
11 |
+
padding: 0;
|
12 |
+
|
13 |
+
.components-modal__header {
|
14 |
+
display: none;
|
15 |
+
}
|
16 |
+
|
17 |
+
.modal-header {
|
18 |
+
display: flex;
|
19 |
+
border-bottom: 1px solid #e0e0e0;
|
20 |
+
|
21 |
+
.left {
|
22 |
+
display: flex;
|
23 |
+
flex-basis: 20%;
|
24 |
+
justify-content: flex-start;
|
25 |
+
|
26 |
+
.tpc-template-cloud-icon {
|
27 |
+
width: 60px;
|
28 |
+
height: 60px;
|
29 |
+
padding: 10px;
|
30 |
+
}
|
31 |
+
}
|
32 |
+
|
33 |
+
.center {
|
34 |
+
display: flex;
|
35 |
+
flex-basis: 60%;
|
36 |
+
justify-content: center;
|
37 |
+
|
38 |
+
.tabs {
|
39 |
+
height: 60px;
|
40 |
+
font-size: 14px;
|
41 |
+
color: #616161;
|
42 |
+
font-weight: 500;
|
43 |
+
border-radius: 0;
|
44 |
+
padding-left: 25px;
|
45 |
+
padding-right: 25px;
|
46 |
+
|
47 |
+
&.is-active {
|
48 |
+
box-shadow: inset 0 0 0 1.5px transparent, inset 0 -4px 0 0 #0073aa;
|
49 |
+
}
|
50 |
+
}
|
51 |
+
}
|
52 |
+
|
53 |
+
.right {
|
54 |
+
display: flex;
|
55 |
+
flex-basis: 20%;
|
56 |
+
justify-content: flex-end;
|
57 |
+
|
58 |
+
.components-button {
|
59 |
+
width: 60px;
|
60 |
+
height: 60px;
|
61 |
+
border-left: 1px solid #e6e9ec;
|
62 |
+
|
63 |
+
&:hover {
|
64 |
+
background: #f1f1f1;
|
65 |
+
}
|
66 |
+
|
67 |
+
svg {
|
68 |
+
width: 32px;
|
69 |
+
height: 32px;
|
70 |
+
fill: #616161;
|
71 |
+
}
|
72 |
+
}
|
73 |
+
|
74 |
+
.components-button-group {
|
75 |
+
display: flex;
|
76 |
+
justify-content: center;
|
77 |
+
align-items: center;
|
78 |
+
height: 60px;
|
79 |
+
|
80 |
+
.components-button {
|
81 |
+
border-left: 0;
|
82 |
+
box-shadow: none;
|
83 |
+
background: #f1f1f1;
|
84 |
+
width: 38px;
|
85 |
+
height: 38px;
|
86 |
+
margin: 5px 10px;
|
87 |
+
padding: 5px;
|
88 |
+
border: 1px solid #d9d9d9;
|
89 |
+
border-radius: 6px;
|
90 |
+
|
91 |
+
&:hover {
|
92 |
+
color: #f1f1f1;
|
93 |
+
background: #0073aa;
|
94 |
+
width: auto;
|
95 |
+
border: 1px solid #0073aa;
|
96 |
+
|
97 |
+
&:before {
|
98 |
+
content: 'Sync';
|
99 |
+
padding: 0 10px;
|
100 |
+
font-weight: 500;
|
101 |
+
}
|
102 |
+
|
103 |
+
svg {
|
104 |
+
fill: #f1f1f1;
|
105 |
+
}
|
106 |
+
}
|
107 |
+
|
108 |
+
svg {
|
109 |
+
width: 26px;
|
110 |
+
height: 26px;
|
111 |
+
padding: 0;
|
112 |
+
fill: #0073aa;
|
113 |
+
}
|
114 |
+
}
|
115 |
+
}
|
116 |
+
}
|
117 |
+
}
|
118 |
+
|
119 |
+
.tpc-modal-content {
|
120 |
+
background: #f1f1f1;
|
121 |
+
padding: 20px 40px;
|
122 |
+
|
123 |
+
.notices {
|
124 |
+
.components-notice {
|
125 |
+
margin: 0 0 20px 0;
|
126 |
+
padding: 10px;
|
127 |
+
}
|
128 |
+
}
|
129 |
+
|
130 |
+
.filters {
|
131 |
+
display: flex;
|
132 |
+
justify-content: flex-end;
|
133 |
+
padding-bottom: 20px;
|
134 |
+
|
135 |
+
.components-button {
|
136 |
+
&.is-pressed {
|
137 |
+
background: transparent;
|
138 |
+
|
139 |
+
svg {
|
140 |
+
fill: #0073aa;
|
141 |
+
}
|
142 |
+
}
|
143 |
+
|
144 |
+
svg {
|
145 |
+
fill: #d9d9d9;
|
146 |
+
}
|
147 |
+
}
|
148 |
+
}
|
149 |
+
|
150 |
+
.table-content {
|
151 |
+
&.is-grid {
|
152 |
+
display: grid;
|
153 |
+
grid-template-columns: 25% 25% 25% 25%;
|
154 |
+
}
|
155 |
+
|
156 |
+
.table-row {
|
157 |
+
display: flex;
|
158 |
+
height: 60px;
|
159 |
+
width: 100%;
|
160 |
+
align-items: center;
|
161 |
+
padding: 0 25px;
|
162 |
+
background: #fff;
|
163 |
+
border: 1px solid rgba(0, 0, 0, 0.11);
|
164 |
+
border-top: none;
|
165 |
+
|
166 |
+
&:first-child {
|
167 |
+
border-top: 1px solid rgba(0, 0, 0, 0.11);
|
168 |
+
}
|
169 |
+
|
170 |
+
svg {
|
171 |
+
height: 24px;
|
172 |
+
margin-right: 10px;
|
173 |
+
fill: #b9b9b9;
|
174 |
+
}
|
175 |
+
|
176 |
+
.row-title {
|
177 |
+
display: flex;
|
178 |
+
align-items: center;
|
179 |
+
|
180 |
+
.components-base-control__field {
|
181 |
+
margin: 0;
|
182 |
+
}
|
183 |
+
}
|
184 |
+
|
185 |
+
.row-controls {
|
186 |
+
display: flex;
|
187 |
+
align-items: center;
|
188 |
+
margin-left: auto;
|
189 |
+
|
190 |
+
button {
|
191 |
+
padding: 6px 30px;
|
192 |
+
font-weight: 600;
|
193 |
+
color: #b9b9b9;
|
194 |
+
}
|
195 |
+
}
|
196 |
+
|
197 |
+
.actions {
|
198 |
+
display: flex;
|
199 |
+
margin-left: 50px;
|
200 |
+
justify-content: flex-end;
|
201 |
+
|
202 |
+
&.no-controls {
|
203 |
+
margin-left: auto;
|
204 |
+
}
|
205 |
+
|
206 |
+
.components-button {
|
207 |
+
padding: 6px 30px;
|
208 |
+
|
209 |
+
&.is-primary {
|
210 |
+
margin-left: 10px;
|
211 |
+
}
|
212 |
+
}
|
213 |
+
}
|
214 |
+
}
|
215 |
+
|
216 |
+
.table-grid {
|
217 |
+
border: 1px solid #ccc;
|
218 |
+
margin: 10px;
|
219 |
+
min-height: 350px;
|
220 |
+
|
221 |
+
.grid-preview {
|
222 |
+
display: flex;
|
223 |
+
width: 100%;
|
224 |
+
height: 300px;
|
225 |
+
background-color: #b7c0cc;
|
226 |
+
background-position: top center;
|
227 |
+
background-size: cover;
|
228 |
+
|
229 |
+
&:hover {
|
230 |
+
background-color: #404040;
|
231 |
+
}
|
232 |
+
|
233 |
+
&.is-loading {
|
234 |
+
background: #404040;
|
235 |
+
|
236 |
+
.preview-actions {
|
237 |
+
display: flex;
|
238 |
+
}
|
239 |
+
}
|
240 |
+
|
241 |
+
.preview-actions {
|
242 |
+
opacity: 0;
|
243 |
+
transition: .3s ease opacity;
|
244 |
+
width: 100%;
|
245 |
+
height: auto;
|
246 |
+
flex-direction: column;
|
247 |
+
justify-content: center;
|
248 |
+
align-items: center;
|
249 |
+
background-color: rgba(0, 0, 0, 0.9);
|
250 |
+
display: flex;
|
251 |
+
|
252 |
+
> .components-button {
|
253 |
+
width: 120px;
|
254 |
+
justify-content: center;
|
255 |
+
margin-bottom: 10px;
|
256 |
+
|
257 |
+
&.is-secondary {
|
258 |
+
color: #ffffff;
|
259 |
+
box-shadow: inset 0 0 0 2px #ffffff;
|
260 |
+
|
261 |
+
&:disabled {
|
262 |
+
background: transparent;
|
263 |
+
opacity: 0.5;
|
264 |
+
}
|
265 |
+
}
|
266 |
+
}
|
267 |
+
|
268 |
+
.preview-controls {
|
269 |
+
.components-button {
|
270 |
+
width: 20px;
|
271 |
+
|
272 |
+
svg {
|
273 |
+
fill: #ffffff;
|
274 |
+
}
|
275 |
+
}
|
276 |
+
}
|
277 |
+
}
|
278 |
+
|
279 |
+
&:hover {
|
280 |
+
.preview-actions {
|
281 |
+
opacity: 1;
|
282 |
+
}
|
283 |
+
}
|
284 |
+
}
|
285 |
+
|
286 |
+
.card-footer {
|
287 |
+
background: #ffffff;
|
288 |
+
border-top: 1px solid #ccc;
|
289 |
+
padding: 15px;
|
290 |
+
|
291 |
+
p {
|
292 |
+
font-weight: 600;
|
293 |
+
margin: 0;
|
294 |
+
}
|
295 |
+
}
|
296 |
+
}
|
297 |
+
}
|
298 |
+
|
299 |
+
@import './scss/pagination';
|
300 |
+
|
301 |
+
.preview-header {
|
302 |
+
display: flex;
|
303 |
+
align-items: center;
|
304 |
+
justify-content: space-between;
|
305 |
+
|
306 |
+
.right {
|
307 |
+
.components-button {
|
308 |
+
&:last-child {
|
309 |
+
margin-left: 10px;
|
310 |
+
}
|
311 |
+
}
|
312 |
+
}
|
313 |
+
}
|
314 |
+
|
315 |
+
.preview-content {
|
316 |
+
margin: 20px 0;
|
317 |
+
|
318 |
+
.block-editor-block-preview__container {
|
319 |
+
max-height: 60vh;
|
320 |
+
overflow: scroll;
|
321 |
+
|
322 |
+
.block-editor-block-list__block {
|
323 |
+
&:first-child {
|
324 |
+
margin-top: 0;
|
325 |
+
margin-bottom: 0;
|
326 |
+
}
|
327 |
+
}
|
328 |
+
}
|
329 |
+
}
|
330 |
+
|
331 |
+
.components-placeholder {
|
332 |
+
box-shadow: none;
|
333 |
+
margin: 20px 0;
|
334 |
+
}
|
335 |
+
}
|
336 |
+
}
|
337 |
+
|
338 |
+
.components-spinner {
|
339 |
+
margin: 0 auto;
|
340 |
+
}
|
341 |
+
}
|
342 |
+
}
|
343 |
+
|
344 |
+
.ti-tpc-components-panel {
|
345 |
+
.components-button {
|
346 |
+
margin: 20px 0;
|
347 |
+
}
|
348 |
+
}
|
349 |
+
|
350 |
+
.controls-popover {
|
351 |
+
.components-popover__content {
|
352 |
+
padding: 10px;
|
353 |
+
|
354 |
+
.popover-content {
|
355 |
+
display: flex;
|
356 |
+
justify-content: center;
|
357 |
+
align-items: flex-end;
|
358 |
+
|
359 |
+
.components-base-control__field {
|
360 |
+
margin: 0;
|
361 |
+
|
362 |
+
.components-text-control__input {
|
363 |
+
max-height: 30px;
|
364 |
+
}
|
365 |
+
}
|
366 |
+
|
367 |
+
.components-button {
|
368 |
+
max-width: 30px;
|
369 |
+
max-height: 30px;
|
370 |
+
}
|
371 |
+
}
|
372 |
+
}
|
373 |
+
}
|
374 |
+
|
375 |
+
.components-button {
|
376 |
+
&.is-loading {
|
377 |
+
svg {
|
378 |
+
-webkit-animation: icon-spin 2s linear infinite;
|
379 |
+
animation: icon-spin 2s linear infinite;
|
380 |
+
}
|
381 |
+
}
|
382 |
+
}
|
383 |
+
|
384 |
+
@media (max-width: 1439px) {
|
385 |
+
.tpc-template-cloud-modal {
|
386 |
+
.components-modal__frame {
|
387 |
+
max-width: 990px;
|
388 |
+
|
389 |
+
.components-modal__content {
|
390 |
+
.tpc-modal-content {
|
391 |
+
.table-content {
|
392 |
+
&.is-grid {
|
393 |
+
grid-template-columns: 33% 33% 33%;
|
394 |
+
}
|
395 |
+
}
|
396 |
+
}
|
397 |
+
}
|
398 |
+
}
|
399 |
+
}
|
400 |
+
}
|
401 |
+
|
402 |
+
@media (min-width: 1440px) {
|
403 |
+
.tpc-template-cloud-modal {
|
404 |
+
.components-modal__frame {
|
405 |
+
max-width: 1200px;
|
406 |
+
}
|
407 |
+
}
|
408 |
+
}
|
409 |
+
|
410 |
+
@-webkit-keyframes icon-spin {
|
411 |
+
0% {
|
412 |
+
-webkit-transform: rotate(0deg);
|
413 |
+
transform: rotate(0deg)
|
414 |
+
}
|
415 |
+
|
416 |
+
to {
|
417 |
+
-webkit-transform: rotate(1turn);
|
418 |
+
transform: rotate(1turn)
|
419 |
+
}
|
420 |
+
}
|
421 |
+
|
422 |
+
@keyframes icon-spin {
|
423 |
+
0% {
|
424 |
+
-webkit-transform: rotate(0deg);
|
425 |
+
transform: rotate(0deg)
|
426 |
+
}
|
427 |
+
|
428 |
+
to {
|
429 |
+
-webkit-transform: rotate(1turn);
|
430 |
+
transform: rotate(1turn)
|
431 |
+
}
|
432 |
+
}
|
433 |
+
|
434 |
+
.tpc-preview-wrap-modal {
|
435 |
+
top: 0 !important;
|
436 |
+
bottom: 0 !important;
|
437 |
+
left: 0 !important;
|
438 |
+
right: 0 !important;
|
439 |
+
width: 100vw !important;
|
440 |
+
height: 100vh !important;
|
441 |
+
transform: none !important;
|
442 |
+
margin: 0 !important;
|
443 |
+
padding: 0 !important;
|
444 |
+
max-width: 100%;
|
445 |
+
max-height: 100%;
|
446 |
+
overflow: hidden;
|
447 |
+
|
448 |
+
.components-modal__header {
|
449 |
+
display: none;
|
450 |
+
}
|
451 |
+
|
452 |
+
@import "../../assets/src/scss/vars";
|
453 |
+
@import "../../assets/src/scss/preview";
|
454 |
+
|
455 |
+
.ob-preview {
|
456 |
+
width: 100vw;
|
457 |
+
height: 100vh;
|
458 |
+
position: absolute;
|
459 |
+
top: 0;
|
460 |
+
left: 0;
|
461 |
+
}
|
462 |
+
|
463 |
+
}
|
464 |
+
|
465 |
+
@-webkit-keyframes spin {
|
466 |
+
from {
|
467 |
+
transform: rotate(0deg);
|
468 |
+
}
|
469 |
+
to {
|
470 |
+
transform: rotate(360deg);
|
471 |
+
}
|
472 |
+
}
|
473 |
+
|
474 |
+
@keyframes spin {
|
475 |
+
from {
|
476 |
+
transform: rotate(0deg);
|
477 |
+
}
|
478 |
+
to {
|
479 |
+
transform: rotate(360deg);
|
480 |
+
}
|
481 |
+
}
|
editor/src/extension.js
ADDED
@@ -0,0 +1,412 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* eslint-disable camelcase */
|
2 |
+
import { __ } from '@wordpress/i18n';
|
3 |
+
import apiFetch from '@wordpress/api-fetch';
|
4 |
+
import { serialize } from '@wordpress/blocks';
|
5 |
+
import {
|
6 |
+
Button,
|
7 |
+
Icon,
|
8 |
+
Modal,
|
9 |
+
PanelBody,
|
10 |
+
TextControl,
|
11 |
+
ToggleControl,
|
12 |
+
} from '@wordpress/components';
|
13 |
+
import { useDispatch, useSelect } from '@wordpress/data';
|
14 |
+
import {
|
15 |
+
PluginBlockSettingsMenuItem,
|
16 |
+
PluginSidebar,
|
17 |
+
PluginSidebarMoreMenuItem,
|
18 |
+
} from '@wordpress/edit-post';
|
19 |
+
import { Fragment, useState, useEffect } from '@wordpress/element';
|
20 |
+
|
21 |
+
import { stringifyUrl } from 'query-string';
|
22 |
+
import { v4 as uuidv4 } from 'uuid';
|
23 |
+
import classnames from 'classnames';
|
24 |
+
|
25 |
+
import { iconBlack } from './icon';
|
26 |
+
import { publishTemplate } from './data/templates-cloud';
|
27 |
+
import Notices from './components/notices';
|
28 |
+
|
29 |
+
const Exporter = () => {
|
30 |
+
const [ isOpen, setOpen ] = useState( false );
|
31 |
+
const [ isLoading, setLoading ] = useState( false );
|
32 |
+
const [ title, setTitle ] = useState( '' );
|
33 |
+
const { canPredefine } = window.tiTpc;
|
34 |
+
|
35 |
+
const { createErrorNotice, createSuccessNotice } = useDispatch(
|
36 |
+
'core/notices'
|
37 |
+
);
|
38 |
+
|
39 |
+
const { editPost, savePost } = useDispatch( 'core/editor' );
|
40 |
+
|
41 |
+
const content = useSelect( ( select ) => {
|
42 |
+
const {
|
43 |
+
getSelectedBlockCount,
|
44 |
+
getSelectedBlock,
|
45 |
+
getMultiSelectedBlocks,
|
46 |
+
} = select( 'core/block-editor' );
|
47 |
+
const blocks =
|
48 |
+
1 === getSelectedBlockCount()
|
49 |
+
? getSelectedBlock()
|
50 |
+
: getMultiSelectedBlocks();
|
51 |
+
|
52 |
+
return serialize( blocks );
|
53 |
+
}, [] );
|
54 |
+
|
55 |
+
const editorContent = useSelect( ( select ) => {
|
56 |
+
const { getBlocks } = select( 'core/block-editor' );
|
57 |
+
const blocks = getBlocks();
|
58 |
+
|
59 |
+
return serialize( blocks );
|
60 |
+
}, [] );
|
61 |
+
|
62 |
+
const {
|
63 |
+
meta,
|
64 |
+
postTitle,
|
65 |
+
postId,
|
66 |
+
type,
|
67 |
+
link,
|
68 |
+
meta: {
|
69 |
+
_ti_tpc_template_sync,
|
70 |
+
_ti_tpc_template_id,
|
71 |
+
_ti_tpc_screenshot_url,
|
72 |
+
_ti_tpc_site_slug,
|
73 |
+
_ti_tpc_published,
|
74 |
+
},
|
75 |
+
} = useSelect( ( select ) => ( {
|
76 |
+
meta: select( 'core/editor' ).getEditedPostAttribute( 'meta' ) || {},
|
77 |
+
postId: select( 'core/editor' ).getEditedPostAttribute( 'id' ),
|
78 |
+
type: select( 'core/editor' ).getEditedPostAttribute( 'type' ),
|
79 |
+
link: select( 'core/editor' ).getEditedPostAttribute( 'link' ),
|
80 |
+
postTitle:
|
81 |
+
select( 'core/editor' ).getEditedPostAttribute( 'title' ) ||
|
82 |
+
__( 'Template' ),
|
83 |
+
} ) );
|
84 |
+
|
85 |
+
const isPostSaving = useSelect( ( select, { forceIsSaving } ) => {
|
86 |
+
const { isSavingPost, isPublishingPost, isAutosavingPost } = select(
|
87 |
+
'core/editor'
|
88 |
+
);
|
89 |
+
|
90 |
+
const isSaving = forceIsSaving || isSavingPost();
|
91 |
+
const isAutoSaving = isAutosavingPost();
|
92 |
+
const isPublishing = isPublishingPost();
|
93 |
+
|
94 |
+
return ( isPublishing || isSaving ) && ! isAutoSaving;
|
95 |
+
} );
|
96 |
+
|
97 |
+
const [ templateSync, setTemplateSync ] = useState( _ti_tpc_template_sync );
|
98 |
+
const [ templateID, setTemplateID ] = useState( _ti_tpc_template_id );
|
99 |
+
const [ siteSlug, setSiteSlug ] = useState( _ti_tpc_site_slug );
|
100 |
+
const [ published, setPublished ] = useState( _ti_tpc_published );
|
101 |
+
const [ screenshotURL, setScreenshotURL ] = useState(
|
102 |
+
_ti_tpc_screenshot_url
|
103 |
+
);
|
104 |
+
|
105 |
+
useEffect( () => {
|
106 |
+
editPost( {
|
107 |
+
meta: {
|
108 |
+
...meta,
|
109 |
+
_ti_tpc_template_sync: templateSync,
|
110 |
+
_ti_tpc_template_id: templateID,
|
111 |
+
_ti_tpc_screenshot_url: screenshotURL,
|
112 |
+
_ti_tpc_site_slug: siteSlug,
|
113 |
+
_ti_tpc_published: published,
|
114 |
+
},
|
115 |
+
} );
|
116 |
+
}, [ templateSync, templateID, screenshotURL, siteSlug, published ] );
|
117 |
+
|
118 |
+
useEffect( () => {
|
119 |
+
if ( isPostSaving && templateSync ) {
|
120 |
+
onSavePage();
|
121 |
+
}
|
122 |
+
}, [ isPostSaving, templateSync ] );
|
123 |
+
|
124 |
+
const onSave = async () => {
|
125 |
+
setLoading( true );
|
126 |
+
|
127 |
+
const data = {
|
128 |
+
__file: 'wp_export',
|
129 |
+
version: 2,
|
130 |
+
content,
|
131 |
+
};
|
132 |
+
|
133 |
+
const url = stringifyUrl( {
|
134 |
+
url: window.tiTpc.endpoint + 'templates',
|
135 |
+
query: {
|
136 |
+
...window.tiTpc.params,
|
137 |
+
template_name: title,
|
138 |
+
template_type: 'gutenberg',
|
139 |
+
},
|
140 |
+
} );
|
141 |
+
|
142 |
+
try {
|
143 |
+
const response = await apiFetch( {
|
144 |
+
url,
|
145 |
+
method: 'POST',
|
146 |
+
data,
|
147 |
+
parse: false,
|
148 |
+
} );
|
149 |
+
|
150 |
+
if ( response.ok ) {
|
151 |
+
const res = await response.json();
|
152 |
+
|
153 |
+
if ( res.message ) {
|
154 |
+
createErrorNotice( res.message, {
|
155 |
+
type: 'snackbar',
|
156 |
+
} );
|
157 |
+
} else {
|
158 |
+
window.localStorage.setItem( 'tpcCacheBuster', uuidv4() );
|
159 |
+
|
160 |
+
createSuccessNotice( __( 'Template saved.' ), {
|
161 |
+
type: 'snackbar',
|
162 |
+
} );
|
163 |
+
}
|
164 |
+
}
|
165 |
+
} catch ( error ) {
|
166 |
+
if ( error.message ) {
|
167 |
+
createErrorNotice( error.message, {
|
168 |
+
type: 'snackbar',
|
169 |
+
} );
|
170 |
+
}
|
171 |
+
}
|
172 |
+
|
173 |
+
setLoading( false );
|
174 |
+
setOpen( false );
|
175 |
+
setTitle( '' );
|
176 |
+
};
|
177 |
+
|
178 |
+
const onSavePage = async () => {
|
179 |
+
setLoading( true );
|
180 |
+
const data = {
|
181 |
+
__file: 'wp_export',
|
182 |
+
version: 2,
|
183 |
+
content: editorContent,
|
184 |
+
};
|
185 |
+
|
186 |
+
let url;
|
187 |
+
|
188 |
+
if ( templateID ) {
|
189 |
+
url = stringifyUrl( {
|
190 |
+
url: window.tiTpc.endpoint + 'templates/' + templateID,
|
191 |
+
query: {
|
192 |
+
...window.tiTpc.params,
|
193 |
+
template_name: postTitle,
|
194 |
+
},
|
195 |
+
} );
|
196 |
+
} else {
|
197 |
+
url = stringifyUrl( {
|
198 |
+
url: window.tiTpc.endpoint + 'templates',
|
199 |
+
query: {
|
200 |
+
...window.tiTpc.params,
|
201 |
+
template_name: postTitle,
|
202 |
+
template_type: 'gutenberg',
|
203 |
+
template_site_slug: _ti_tpc_site_slug || '',
|
204 |
+
template_thumbnail: _ti_tpc_screenshot_url || '',
|
205 |
+
},
|
206 |
+
} );
|
207 |
+
}
|
208 |
+
|
209 |
+
try {
|
210 |
+
const response = await apiFetch( {
|
211 |
+
url,
|
212 |
+
method: 'POST',
|
213 |
+
data,
|
214 |
+
parse: false,
|
215 |
+
} );
|
216 |
+
|
217 |
+
if ( response.ok ) {
|
218 |
+
const res = await response.json();
|
219 |
+
|
220 |
+
if ( res.message ) {
|
221 |
+
createErrorNotice( res.message, {
|
222 |
+
type: 'snackbar',
|
223 |
+
} );
|
224 |
+
} else {
|
225 |
+
if ( res.template_id ) {
|
226 |
+
setTemplateID( res.template_id );
|
227 |
+
}
|
228 |
+
|
229 |
+
window.localStorage.setItem( 'tpcCacheBuster', uuidv4() );
|
230 |
+
|
231 |
+
createSuccessNotice( __( 'Template saved.' ), {
|
232 |
+
type: 'snackbar',
|
233 |
+
} );
|
234 |
+
|
235 |
+
saveMeta();
|
236 |
+
}
|
237 |
+
}
|
238 |
+
} catch ( error ) {
|
239 |
+
if ( error.message ) {
|
240 |
+
createErrorNotice( error.message, {
|
241 |
+
type: 'snackbar',
|
242 |
+
} );
|
243 |
+
}
|
244 |
+
}
|
245 |
+
|
246 |
+
setLoading( false );
|
247 |
+
};
|
248 |
+
|
249 |
+
const PublishButton = () => {
|
250 |
+
if ( ! canPredefine ) {
|
251 |
+
return null;
|
252 |
+
}
|
253 |
+
|
254 |
+
const onPublish = async () => {
|
255 |
+
setLoading( 'publishing' );
|
256 |
+
await publishTemplate(
|
257 |
+
_ti_tpc_template_id,
|
258 |
+
_ti_tpc_site_slug,
|
259 |
+
_ti_tpc_screenshot_url,
|
260 |
+
! _ti_tpc_published,
|
261 |
+
link
|
262 |
+
).then( ( r ) => {
|
263 |
+
if ( r.success ) {
|
264 |
+
setPublished( ! published );
|
265 |
+
saveMeta();
|
266 |
+
createSuccessNotice(
|
267 |
+
published
|
268 |
+
? __( 'Template Unpublished.' )
|
269 |
+
: __( 'Template Published.' ),
|
270 |
+
{
|
271 |
+
type: 'snackbar',
|
272 |
+
}
|
273 |
+
);
|
274 |
+
}
|
275 |
+
} );
|
276 |
+
setLoading( false );
|
277 |
+
};
|
278 |
+
|
279 |
+
return (
|
280 |
+
<Button
|
281 |
+
isSecondary
|
282 |
+
onClick={ onPublish }
|
283 |
+
disabled={ false !== isLoading }
|
284 |
+
className={ classnames( {
|
285 |
+
'is-loading': 'publishing' === isLoading,
|
286 |
+
} ) }
|
287 |
+
>
|
288 |
+
{ published &&
|
289 |
+
( 'publishing' === isLoading
|
290 |
+
? __( 'Unpublishing' )
|
291 |
+
: __( 'Unpublish' ) ) }
|
292 |
+
{ ! published &&
|
293 |
+
( 'publishing' === isLoading
|
294 |
+
? __( 'Publishing' )
|
295 |
+
: __( 'Publish' ) ) }
|
296 |
+
</Button>
|
297 |
+
);
|
298 |
+
};
|
299 |
+
|
300 |
+
const saveMeta = () => {
|
301 |
+
let post = null;
|
302 |
+
|
303 |
+
if ( type === 'post' ) {
|
304 |
+
post = new wp.api.models.Post( { id: postId } );
|
305 |
+
} else if ( type === 'page' ) {
|
306 |
+
post = new wp.api.models.Page( { id: postId } );
|
307 |
+
}
|
308 |
+
|
309 |
+
post.set( 'meta', {
|
310 |
+
_ti_tpc_template_id: templateID,
|
311 |
+
_ti_tpc_template_sync: templateSync,
|
312 |
+
_ti_tpc_screenshot_url: screenshotURL,
|
313 |
+
_ti_tpc_site_slug: siteSlug,
|
314 |
+
_ti_tpc_published: ! published,
|
315 |
+
} );
|
316 |
+
return post.save();
|
317 |
+
};
|
318 |
+
|
319 |
+
if ( ! [ 'post', 'page' ].includes( type ) ) {
|
320 |
+
return null;
|
321 |
+
}
|
322 |
+
|
323 |
+
return (
|
324 |
+
<Fragment>
|
325 |
+
<PluginBlockSettingsMenuItem
|
326 |
+
label={ __( 'Save as Template' ) }
|
327 |
+
icon={ 'none' } // We don't want an icon, as new UI of Gutenberg does't have icons for Menu Items, but the component doesn't allow that so we pass an icon which doesn't exist.
|
328 |
+
onClick={ () => setOpen( true ) }
|
329 |
+
/>
|
330 |
+
|
331 |
+
<PluginSidebarMoreMenuItem
|
332 |
+
icon={ <Icon icon={ iconBlack } /> }
|
333 |
+
target="ti-tpc"
|
334 |
+
>
|
335 |
+
{ __( 'Templates Cloud' ) }
|
336 |
+
</PluginSidebarMoreMenuItem>
|
337 |
+
|
338 |
+
<PluginSidebar
|
339 |
+
name="ti-tpc"
|
340 |
+
title={ __( 'Templates Cloud' ) }
|
341 |
+
className="ti-tpc-components-panel"
|
342 |
+
>
|
343 |
+
<PanelBody>
|
344 |
+
{ __(
|
345 |
+
'Save this page as a template in your Templates Cloud library.'
|
346 |
+
) }
|
347 |
+
|
348 |
+
<Button
|
349 |
+
isPrimary
|
350 |
+
isBusy={ isLoading }
|
351 |
+
disabled={ isLoading }
|
352 |
+
onClick={ onSavePage }
|
353 |
+
>
|
354 |
+
{ __( 'Save Page as Template' ) }
|
355 |
+
</Button>
|
356 |
+
|
357 |
+
<ToggleControl
|
358 |
+
label={ __( 'Automatically sync to the cloud' ) }
|
359 |
+
checked={ templateSync }
|
360 |
+
onChange={ () => setTemplateSync( ! templateSync ) }
|
361 |
+
/>
|
362 |
+
</PanelBody>
|
363 |
+
{ canPredefine && (
|
364 |
+
<PanelBody>
|
365 |
+
<h4>{ __( 'Publish Settings' ) }</h4>
|
366 |
+
<TextControl
|
367 |
+
label={ __( 'Screenshot URL' ) }
|
368 |
+
value={ screenshotURL }
|
369 |
+
type="url"
|
370 |
+
onChange={ setScreenshotURL }
|
371 |
+
/>
|
372 |
+
<TextControl
|
373 |
+
label={ __( 'Site Slug' ) }
|
374 |
+
value={ siteSlug }
|
375 |
+
help={ __(
|
376 |
+
'Use `general` to publish this as a global template. Otherwise use the starter site slug to make it available as a single page for the starter site.'
|
377 |
+
) }
|
378 |
+
type="url"
|
379 |
+
onChange={ setSiteSlug }
|
380 |
+
/>
|
381 |
+
<PublishButton />
|
382 |
+
<Notices />
|
383 |
+
</PanelBody>
|
384 |
+
) }
|
385 |
+
</PluginSidebar>
|
386 |
+
|
387 |
+
{ isOpen && (
|
388 |
+
<Modal
|
389 |
+
title={ __( 'Save Template' ) }
|
390 |
+
onRequestClose={ () => setOpen( false ) }
|
391 |
+
>
|
392 |
+
<TextControl
|
393 |
+
label={ __( 'Template Name' ) }
|
394 |
+
value={ title }
|
395 |
+
onChange={ setTitle }
|
396 |
+
/>
|
397 |
+
|
398 |
+
<Button
|
399 |
+
isPrimary
|
400 |
+
isBusy={ isLoading }
|
401 |
+
disabled={ isLoading }
|
402 |
+
onClick={ onSave }
|
403 |
+
>
|
404 |
+
{ __( 'Save' ) }
|
405 |
+
</Button>
|
406 |
+
</Modal>
|
407 |
+
) }
|
408 |
+
</Fragment>
|
409 |
+
);
|
410 |
+
};
|
411 |
+
|
412 |
+
export default Exporter;
|
editor/src/icon.js
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* WordPress dependencies
|
3 |
+
*/
|
4 |
+
const { Path, SVG } = wp.primitives;
|
5 |
+
|
6 |
+
const icon = () => {
|
7 |
+
return (
|
8 |
+
<SVG
|
9 |
+
width="100"
|
10 |
+
height="100"
|
11 |
+
viewBox="0 0 100 100"
|
12 |
+
fill="none"
|
13 |
+
xmlns="http://www.w3.org/2000/svg"
|
14 |
+
className="tpc-template-cloud-icon"
|
15 |
+
>
|
16 |
+
<Path
|
17 |
+
d="M95.0264 100H4.97356C2.22797 100 0 97.772 0 95.0264V4.97356C0 2.22797 2.22797 0 4.97356 0H95.0264C97.772 0 100 2.22797 100 4.97356V95.0264C100 97.772 97.772 100 95.0264 100Z"
|
18 |
+
fill="#0366D6"
|
19 |
+
/>
|
20 |
+
<Path
|
21 |
+
d="M82.6941 86.7448V30.8205V18.4653H70.3502H14.4146L26.7584 30.8205H70.3502V74.401L82.6941 86.7448Z"
|
22 |
+
fill="white"
|
23 |
+
/>
|
24 |
+
<Path
|
25 |
+
d="M42.2416 58.9291L42.2528 71.183L53.2352 82.1653L53.1902 47.9806L18.9941 47.9355L29.9765 58.9066L42.2416 58.9291Z"
|
26 |
+
fill="white"
|
27 |
+
/>
|
28 |
+
</SVG>
|
29 |
+
);
|
30 |
+
};
|
31 |
+
|
32 |
+
export const iconBlack = () => {
|
33 |
+
return (
|
34 |
+
<SVG
|
35 |
+
width="24"
|
36 |
+
height="24"
|
37 |
+
viewBox="0 0 24 24"
|
38 |
+
fill="none"
|
39 |
+
xmlns="http://www.w3.org/2000/svg"
|
40 |
+
>
|
41 |
+
<Path
|
42 |
+
d="M22.8063 24H1.19365C0.534714 24 0 23.4653 0 22.8063V1.19365C0 0.534714 0.534714 0 1.19365 0H22.8063C23.4653 0 24 0.534714 24 1.19365V22.8063C24 23.4653 23.4653 24 22.8063 24Z"
|
43 |
+
fill="#14171C"
|
44 |
+
/>
|
45 |
+
<Path
|
46 |
+
d="M19.8466 20.8187V7.39687V4.43164H16.884H3.45947L6.422 7.39687H16.884V17.8562L19.8466 20.8187Z"
|
47 |
+
fill="white"
|
48 |
+
/>
|
49 |
+
<Path
|
50 |
+
d="M10.138 14.1429L10.1407 17.0838L12.7764 19.7195L12.7656 11.5152L4.55859 11.5044L7.19435 14.1375L10.138 14.1429Z"
|
51 |
+
fill="white"
|
52 |
+
/>
|
53 |
+
</SVG>
|
54 |
+
);
|
55 |
+
};
|
56 |
+
|
57 |
+
export default icon;
|
editor/src/index.js
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* global tiTpc */
|
2 |
+
import { __ } from '@wordpress/i18n';
|
3 |
+
import { registerPlugin } from '@wordpress/plugins';
|
4 |
+
import { registerBlockType } from '@wordpress/blocks';
|
5 |
+
|
6 |
+
import './editor.scss';
|
7 |
+
import './data/index.js';
|
8 |
+
import { iconBlack as icon } from './icon';
|
9 |
+
import Exporter from './extension';
|
10 |
+
import edit from './edit';
|
11 |
+
|
12 |
+
registerBlockType( 'ti-tpc/templates-cloud', {
|
13 |
+
title: __( 'Templates Cloud' ),
|
14 |
+
description: __(
|
15 |
+
'A cloud based templates library which enables you to create ready-made website in no time.'
|
16 |
+
),
|
17 |
+
icon,
|
18 |
+
category: 'design',
|
19 |
+
keywords: [ 'templates cloud', 'patterns', 'template library' ],
|
20 |
+
supports: {
|
21 |
+
html: false,
|
22 |
+
},
|
23 |
+
edit,
|
24 |
+
save: () => null,
|
25 |
+
} );
|
26 |
+
|
27 |
+
if ( parseInt( tiTpc.tier ) === 3 ) {
|
28 |
+
registerPlugin( 'ti-tpc', {
|
29 |
+
render: Exporter,
|
30 |
+
icon,
|
31 |
+
} );
|
32 |
+
}
|
editor/src/scss/_pagination.scss
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.pagination {
|
2 |
+
padding-top: 20px;
|
3 |
+
|
4 |
+
.components-button {
|
5 |
+
margin-right: 10px;
|
6 |
+
border-radius: 2px;
|
7 |
+
box-shadow: none;
|
8 |
+
|
9 |
+
&:focus {
|
10 |
+
box-shadow: inset 0 0 0 1px #fff, 0 0 0 1.5px #007cba;
|
11 |
+
}
|
12 |
+
|
13 |
+
&:not( .is-primary ) {
|
14 |
+
background: #ffffff;
|
15 |
+
|
16 |
+
&:focus {
|
17 |
+
box-shadow: 0 0 0 1.5px #007cba;
|
18 |
+
}
|
19 |
+
}
|
20 |
+
}
|
21 |
+
}
|
includes/Admin.php
CHANGED
@@ -334,13 +334,18 @@ class Admin {
|
|
334 |
'upgradeURL' => esc_url( apply_filters( 'neve_upgrade_link_from_child_theme_filter', 'https://themeisle.com/themes/neve/upgrade/?utm_medium=aboutneve&utm_source=freevspro&utm_campaign=neve' ) ),
|
335 |
'strings' => array(
|
336 |
/* translators: %s - Theme name */
|
337 |
-
'starterSitesTabDescription' =>
|
338 |
),
|
339 |
'onboarding' => array(),
|
340 |
'hasFileSystem' => WP_Filesystem(),
|
341 |
'themesURL' => admin_url( 'themes.php' ),
|
342 |
'themeAction' => $this->get_theme_action(),
|
343 |
'brandedTheme' => isset( $this->wl_config['theme_name'] ) ? $this->wl_config['theme_name'] : false,
|
|
|
|
|
|
|
|
|
|
|
344 |
);
|
345 |
}
|
346 |
|
334 |
'upgradeURL' => esc_url( apply_filters( 'neve_upgrade_link_from_child_theme_filter', 'https://themeisle.com/themes/neve/upgrade/?utm_medium=aboutneve&utm_source=freevspro&utm_campaign=neve' ) ),
|
335 |
'strings' => array(
|
336 |
/* translators: %s - Theme name */
|
337 |
+
'starterSitesTabDescription' => __( 'Choose from multiple unique demos, specially designed for you, that can be installed with a single click. You just need to choose your favorite, and we will take care of everything else.', 'templates-patterns-collection' ),
|
338 |
),
|
339 |
'onboarding' => array(),
|
340 |
'hasFileSystem' => WP_Filesystem(),
|
341 |
'themesURL' => admin_url( 'themes.php' ),
|
342 |
'themeAction' => $this->get_theme_action(),
|
343 |
'brandedTheme' => isset( $this->wl_config['theme_name'] ) ? $this->wl_config['theme_name'] : false,
|
344 |
+
'endpoint' => TPC_TEMPLATES_CLOUD_ENDPOINT,
|
345 |
+
'params' => array(
|
346 |
+
'site_url' => get_site_url(),
|
347 |
+
'license_id' => apply_filters( 'product_neve_license_key', 'free' ),
|
348 |
+
),
|
349 |
);
|
350 |
}
|
351 |
|
includes/Editor.php
ADDED
@@ -0,0 +1,151 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Handles code for Block Editor.
|
4 |
+
*
|
5 |
+
* @package templates-patterns-collection
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace TIOB;
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Class Editor
|
12 |
+
*
|
13 |
+
* @package templates-patterns-collection
|
14 |
+
*/
|
15 |
+
class Editor {
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Assets Handle.
|
19 |
+
*
|
20 |
+
* @var string
|
21 |
+
*/
|
22 |
+
private $handle = 'ti-tpc-block';
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Initialize the Admin.
|
26 |
+
*/
|
27 |
+
public function init() {
|
28 |
+
define( 'TPC_TEMPLATES_CLOUD_ENDPOINT', 'https://api.themeisle.com/templates-cloud/' );
|
29 |
+
|
30 |
+
add_action( 'init', array( $this, 'register_block' ), 11 );
|
31 |
+
add_action( 'init', array( $this, 'register_post_meta' ), 11 );
|
32 |
+
}
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Register editor blocks.
|
36 |
+
*/
|
37 |
+
public function register_block() {
|
38 |
+
$deps = require( TIOB_PATH . 'editor/build/index.asset.php' );
|
39 |
+
|
40 |
+
wp_register_script(
|
41 |
+
$this->handle,
|
42 |
+
TIOB_URL . 'editor/build/index.js',
|
43 |
+
array_merge( $deps['dependencies'], array( 'wp-api' ) ),
|
44 |
+
$deps['version']
|
45 |
+
);
|
46 |
+
|
47 |
+
wp_localize_script(
|
48 |
+
$this->handle,
|
49 |
+
'tiTpc',
|
50 |
+
apply_filters(
|
51 |
+
'ti_tpc_editor_data',
|
52 |
+
array(
|
53 |
+
'endpoint' => TPC_TEMPLATES_CLOUD_ENDPOINT,
|
54 |
+
'params' => array(
|
55 |
+
'site_url' => get_site_url(),
|
56 |
+
'license_id' => apply_filters( 'product_neve_license_key', 'free' ),
|
57 |
+
),
|
58 |
+
'canPredefine' => apply_filters( 'ti_tpc_can_predefine', false ),
|
59 |
+
)
|
60 |
+
)
|
61 |
+
);
|
62 |
+
|
63 |
+
wp_register_style(
|
64 |
+
$this->handle,
|
65 |
+
TIOB_URL . 'editor/build/index.css',
|
66 |
+
array(),
|
67 |
+
$deps['version']
|
68 |
+
);
|
69 |
+
|
70 |
+
wp_style_add_data( $this->handle, 'rtl', 'replace' );
|
71 |
+
|
72 |
+
register_block_type(
|
73 |
+
'ti-tpc/templates-cloud',
|
74 |
+
array(
|
75 |
+
'editor_script' => $this->handle,
|
76 |
+
'editor_style' => $this->handle,
|
77 |
+
)
|
78 |
+
);
|
79 |
+
}
|
80 |
+
|
81 |
+
/**
|
82 |
+
* Register post meta.
|
83 |
+
*/
|
84 |
+
public function register_post_meta() {
|
85 |
+
register_post_meta(
|
86 |
+
'',
|
87 |
+
'_ti_tpc_template_sync',
|
88 |
+
array(
|
89 |
+
'show_in_rest' => true,
|
90 |
+
'single' => true,
|
91 |
+
'type' => 'boolean',
|
92 |
+
'auth_callback' => function() {
|
93 |
+
return current_user_can( 'edit_posts' );
|
94 |
+
},
|
95 |
+
)
|
96 |
+
);
|
97 |
+
|
98 |
+
register_post_meta(
|
99 |
+
'',
|
100 |
+
'_ti_tpc_template_id',
|
101 |
+
array(
|
102 |
+
'show_in_rest' => true,
|
103 |
+
'single' => true,
|
104 |
+
'type' => 'string',
|
105 |
+
'auth_callback' => function () {
|
106 |
+
return current_user_can( 'edit_posts' );
|
107 |
+
},
|
108 |
+
)
|
109 |
+
);
|
110 |
+
if ( apply_filters( 'ti_tpc_can_predefine', false ) === false ) {
|
111 |
+
return;
|
112 |
+
}
|
113 |
+
|
114 |
+
register_post_meta(
|
115 |
+
'',
|
116 |
+
'_ti_tpc_screenshot_url',
|
117 |
+
array(
|
118 |
+
'show_in_rest' => true,
|
119 |
+
'single' => true,
|
120 |
+
'type' => 'string',
|
121 |
+
'auth_callback' => function () {
|
122 |
+
return current_user_can( 'edit_posts' );
|
123 |
+
},
|
124 |
+
)
|
125 |
+
);
|
126 |
+
register_post_meta(
|
127 |
+
'',
|
128 |
+
'_ti_tpc_site_slug',
|
129 |
+
array(
|
130 |
+
'show_in_rest' => true,
|
131 |
+
'single' => true,
|
132 |
+
'type' => 'string',
|
133 |
+
'auth_callback' => function () {
|
134 |
+
return current_user_can( 'edit_posts' );
|
135 |
+
},
|
136 |
+
)
|
137 |
+
);
|
138 |
+
register_post_meta(
|
139 |
+
'',
|
140 |
+
'_ti_tpc_published',
|
141 |
+
array(
|
142 |
+
'show_in_rest' => true,
|
143 |
+
'single' => true,
|
144 |
+
'type' => 'boolean',
|
145 |
+
'auth_callback' => function () {
|
146 |
+
return current_user_can( 'edit_posts' );
|
147 |
+
},
|
148 |
+
)
|
149 |
+
);
|
150 |
+
}
|
151 |
+
}
|
includes/Main.php
CHANGED
@@ -16,7 +16,7 @@ class Main {
|
|
16 |
*
|
17 |
* @var string Version string.
|
18 |
*/
|
19 |
-
const VERSION = '1.0
|
20 |
/**
|
21 |
* Sites Library API URL.
|
22 |
*
|
@@ -42,6 +42,13 @@ class Main {
|
|
42 |
*/
|
43 |
public $admin = null;
|
44 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
/**
|
46 |
* Sites listing
|
47 |
*
|
@@ -72,6 +79,7 @@ class Main {
|
|
72 |
* @var null
|
73 |
*/
|
74 |
private function init() {
|
|
|
75 |
$this->setup_sites_listing();
|
76 |
|
77 |
if ( ! $this->should_load() ) {
|
@@ -114,6 +122,17 @@ class Main {
|
|
114 |
$this->admin->init();
|
115 |
}
|
116 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
117 |
/**
|
118 |
* Setup the restful functionality.
|
119 |
*
|
16 |
*
|
17 |
* @var string Version string.
|
18 |
*/
|
19 |
+
const VERSION = '1.1.0';
|
20 |
/**
|
21 |
* Sites Library API URL.
|
22 |
*
|
42 |
*/
|
43 |
public $admin = null;
|
44 |
|
45 |
+
/**
|
46 |
+
* Editor
|
47 |
+
*
|
48 |
+
* @var Editor
|
49 |
+
*/
|
50 |
+
public $editor = null;
|
51 |
+
|
52 |
/**
|
53 |
* Sites listing
|
54 |
*
|
79 |
* @var null
|
80 |
*/
|
81 |
private function init() {
|
82 |
+
$this->setup_editor();
|
83 |
$this->setup_sites_listing();
|
84 |
|
85 |
if ( ! $this->should_load() ) {
|
122 |
$this->admin->init();
|
123 |
}
|
124 |
|
125 |
+
|
126 |
+
/**
|
127 |
+
* Setup editor functionality.
|
128 |
+
*
|
129 |
+
* @return void
|
130 |
+
*/
|
131 |
+
private function setup_editor() {
|
132 |
+
$this->editor = new Editor();
|
133 |
+
$this->editor->init();
|
134 |
+
}
|
135 |
+
|
136 |
/**
|
137 |
* Setup the restful functionality.
|
138 |
*
|
includes/Rest_Server.php
CHANGED
@@ -110,6 +110,17 @@ class Rest_Server {
|
|
110 |
},
|
111 |
)
|
112 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
}
|
114 |
|
115 |
/**
|
@@ -145,7 +156,10 @@ class Rest_Server {
|
|
145 |
*/
|
146 |
public function run_xml_importer( WP_REST_Request $request ) {
|
147 |
$content_importer = new Content_Importer();
|
148 |
-
|
|
|
|
|
|
|
149 |
}
|
150 |
|
151 |
/**
|
@@ -237,4 +251,64 @@ class Rest_Server {
|
|
237 |
|
238 |
return new WP_REST_Response( array( 'success' => true ) );
|
239 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
240 |
}
|
110 |
},
|
111 |
)
|
112 |
);
|
113 |
+
register_rest_route(
|
114 |
+
Main::API_ROOT,
|
115 |
+
'/import_single_templates',
|
116 |
+
array(
|
117 |
+
'methods' => WP_REST_Server::EDITABLE,
|
118 |
+
'callback' => array( $this, 'import_templates' ),
|
119 |
+
'permission_callback' => function () {
|
120 |
+
return current_user_can( 'manage_options' );
|
121 |
+
},
|
122 |
+
)
|
123 |
+
);
|
124 |
}
|
125 |
|
126 |
/**
|
156 |
*/
|
157 |
public function run_xml_importer( WP_REST_Request $request ) {
|
158 |
$content_importer = new Content_Importer();
|
159 |
+
$import = $content_importer->import_remote_xml( $request );
|
160 |
+
set_transient( 'ti_tpc_should_flush_permalinks', 'yes', 12 * HOUR_IN_SECONDS );
|
161 |
+
|
162 |
+
return $import;
|
163 |
}
|
164 |
|
165 |
/**
|
251 |
|
252 |
return new WP_REST_Response( array( 'success' => true ) );
|
253 |
}
|
254 |
+
|
255 |
+
/**
|
256 |
+
* Import Templates.
|
257 |
+
*
|
258 |
+
* @param WP_REST_Request $request
|
259 |
+
* @return WP_REST_Response
|
260 |
+
*/
|
261 |
+
public function import_templates( WP_REST_Request $request ) {
|
262 |
+
$params = $request->get_json_params();
|
263 |
+
$imported = array();
|
264 |
+
foreach ( $params as $template ) {
|
265 |
+
$id = $this->insert_single_template( $template );
|
266 |
+
|
267 |
+
if ( $id instanceof \WP_Error ) {
|
268 |
+
return new WP_REST_Response(
|
269 |
+
array(
|
270 |
+
'success' => false,
|
271 |
+
'message' => $id->get_error_message(),
|
272 |
+
)
|
273 |
+
);
|
274 |
+
}
|
275 |
+
|
276 |
+
$imported[] = array(
|
277 |
+
'title' => get_the_title( $id ),
|
278 |
+
'url' => get_post_permalink( $id ),
|
279 |
+
'edit' => add_query_arg(
|
280 |
+
array(
|
281 |
+
'post' => $id,
|
282 |
+
'action' => 'edit',
|
283 |
+
),
|
284 |
+
admin_url( 'post.php' )
|
285 |
+
),
|
286 |
+
);
|
287 |
+
}
|
288 |
+
|
289 |
+
return new WP_REST_Response(
|
290 |
+
array(
|
291 |
+
'success' => true,
|
292 |
+
'pages' => $imported,
|
293 |
+
)
|
294 |
+
);
|
295 |
+
}
|
296 |
+
|
297 |
+
/**
|
298 |
+
* Insert Single Template
|
299 |
+
*
|
300 |
+
* @param $template
|
301 |
+
* @return int|\WP_Error
|
302 |
+
*/
|
303 |
+
private function insert_single_template( $template ) {
|
304 |
+
return wp_insert_post(
|
305 |
+
array(
|
306 |
+
'post_title' => wp_strip_all_tags( $template['template_name'] ),
|
307 |
+
'post_content' => wp_kses_post( $template['content'] ),
|
308 |
+
'post_status' => 'publish',
|
309 |
+
'post_type' => 'page',
|
310 |
+
'page_template' => 'page-templates/template-pagebuilder-full-width.php',
|
311 |
+
)
|
312 |
+
);
|
313 |
+
}
|
314 |
}
|
languages/templates-patterns-collection.pot
CHANGED
@@ -2,14 +2,14 @@
|
|
2 |
# This file is distributed under the same license as the Templates Patterns Collection plugin.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Templates Patterns Collection 1.0.
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/templates-patterns-collection\n"
|
7 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
8 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
-
"POT-Creation-Date: 2020-
|
13 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
14 |
"X-Generator: WP-CLI 2.4.0\n"
|
15 |
"X-Domain: templates-patterns-collection\n"
|
@@ -39,18 +39,16 @@ msgid "Hi! We've noticed you were using a child theme of Zelle before. To make y
|
|
39 |
msgstr ""
|
40 |
|
41 |
#: includes/Admin.php:270
|
42 |
-
#: assets/build/app.js:
|
43 |
-
#: assets/src/Components/StarterSiteCard.js:
|
44 |
msgid "Preview"
|
45 |
msgstr ""
|
46 |
|
47 |
#: includes/Admin.php:271
|
48 |
-
#: assets/build/app.js:
|
49 |
-
#: assets/build/app.js:
|
50 |
-
#: assets/
|
51 |
-
#: assets/src/Components/
|
52 |
-
#: assets/src/Components/PreviewFrame.js:107
|
53 |
-
#: assets/src/Components/StarterSiteCard.js:56
|
54 |
msgid "Import"
|
55 |
msgstr ""
|
56 |
|
@@ -63,7 +61,7 @@ msgid "Importing"
|
|
63 |
msgstr ""
|
64 |
|
65 |
#: includes/Admin.php:274
|
66 |
-
#: assets/build/app.js:
|
67 |
#: assets/src/Components/Migration.js:165
|
68 |
msgid "Cancel"
|
69 |
msgstr ""
|
@@ -73,28 +71,26 @@ msgid "Loading"
|
|
73 |
msgstr ""
|
74 |
|
75 |
#: includes/Admin.php:276
|
76 |
-
#: assets/build/app.js:
|
77 |
-
#: assets/build/app.js:
|
78 |
-
#: assets/src/Components/ImportModal.js:
|
79 |
-
#: assets/src/Components/Migration.js:
|
80 |
msgid "View Website"
|
81 |
msgstr ""
|
82 |
|
83 |
#: includes/Admin.php:277
|
84 |
-
#: assets/build/app.js:
|
85 |
-
#: assets/src/Components/ImportModal.js:
|
86 |
msgid "Add your own content"
|
87 |
msgstr ""
|
88 |
|
89 |
#: includes/Admin.php:278
|
90 |
-
#: assets/build/app.js:
|
91 |
-
#: assets/src/Components/ImportModal.js:
|
92 |
msgid "Back to Sites Library"
|
93 |
msgstr ""
|
94 |
|
95 |
#: includes/Admin.php:279
|
96 |
-
#: assets/build/app.js:1057
|
97 |
-
#: assets/src/Components/ImportModalNote.js:23
|
98 |
msgid "Note"
|
99 |
msgstr ""
|
100 |
|
@@ -103,14 +99,12 @@ msgid "Advanced Options"
|
|
103 |
msgstr ""
|
104 |
|
105 |
#: includes/Admin.php:281
|
106 |
-
#: assets/build/app.js:
|
107 |
-
#: assets/src/Components/ImportModal.js:
|
108 |
msgid "Plugins"
|
109 |
msgstr ""
|
110 |
|
111 |
#: includes/Admin.php:282
|
112 |
-
#: assets/build/app.js:667
|
113 |
-
#: assets/src/Components/ImportModal.js:170
|
114 |
msgid "General"
|
115 |
msgstr ""
|
116 |
|
@@ -123,20 +117,20 @@ msgid "Search"
|
|
123 |
msgstr ""
|
124 |
|
125 |
#: includes/Admin.php:285
|
126 |
-
#: assets/build/app.js:
|
127 |
-
#: assets/src/Components/ImportModal.js:
|
128 |
msgid "Content"
|
129 |
msgstr ""
|
130 |
|
131 |
#: includes/Admin.php:286
|
132 |
-
#: assets/build/app.js:
|
133 |
-
#: assets/src/Components/ImportModal.js:
|
134 |
msgid "Customizer"
|
135 |
msgstr ""
|
136 |
|
137 |
#: includes/Admin.php:287
|
138 |
-
#: assets/build/app.js:
|
139 |
-
#: assets/src/Components/ImportModal.js:
|
140 |
msgid "Widgets"
|
141 |
msgstr ""
|
142 |
|
@@ -157,8 +151,8 @@ msgid "Here is our own collection of related images you can use for your site."
|
|
157 |
msgstr ""
|
158 |
|
159 |
#: includes/Admin.php:292
|
160 |
-
#: assets/build/app.js:
|
161 |
-
#: assets/src/Components/ImportModal.js:
|
162 |
msgid "Content was successfully imported. Enjoy your new site!"
|
163 |
msgstr ""
|
164 |
|
@@ -213,7 +207,7 @@ msgstr ""
|
|
213 |
|
214 |
#. translators: %s - Theme name
|
215 |
#: includes/Admin.php:337
|
216 |
-
msgid "
|
217 |
msgstr ""
|
218 |
|
219 |
#: includes/Sites_Listing.php:46
|
@@ -234,209 +228,301 @@ msgstr ""
|
|
234 |
msgid "With Neve, you can choose from multiple unique demos, specially designed for you, that can be installed with a single click. You just need to choose your favorite, and we will take care of everything else."
|
235 |
msgstr ""
|
236 |
|
237 |
-
#: assets/build/app.js:
|
238 |
-
#: assets/build/app.js:
|
239 |
-
#: assets/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
240 |
#: assets/src/Components/EditorSelector.js:30
|
241 |
#: assets/src/Components/EditorSelector.js:70
|
242 |
#: assets/src/Components/EditorTabs.js:42
|
243 |
msgid "Builder Logo"
|
244 |
msgstr ""
|
245 |
|
246 |
-
#: assets/build/app.js:
|
247 |
-
#: assets/build/app.js:
|
248 |
-
#: assets/src/Components/ImportModal.js:
|
249 |
-
#: assets/src/Components/ImportModal.js:
|
250 |
msgid "Something went wrong while loading the site data. Please refresh the page and try again."
|
251 |
msgstr ""
|
252 |
|
253 |
-
|
254 |
-
#: assets/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
255 |
msgid "Something went wrong while installing the necessary plugins."
|
256 |
msgstr ""
|
257 |
|
258 |
-
#: assets/build/app.js:
|
259 |
-
#: assets/src/Components/ImportModal.js:
|
260 |
msgid "Something went wrong while importing the website content."
|
261 |
msgstr ""
|
262 |
|
263 |
-
#: assets/build/app.js:
|
264 |
-
#: assets/src/Components/ImportModal.js:
|
265 |
msgid "Something went wrong while updating the customizer settings."
|
266 |
msgstr ""
|
267 |
|
268 |
-
#: assets/build/app.js:
|
269 |
-
#: assets/src/Components/ImportModal.js:
|
270 |
msgid "Something went wrong while importing the widgets."
|
271 |
msgstr ""
|
272 |
|
273 |
-
#: assets/build/app.js:
|
274 |
-
#: assets/
|
275 |
-
|
276 |
-
#: assets/build/app.js:1907
|
277 |
-
#: assets/build/app.js:2051
|
278 |
-
#: assets/src/Components/ImportModal.js:502
|
279 |
-
#: assets/src/Components/InstallModal.js:156
|
280 |
-
#: assets/src/Components/Main.js:52
|
281 |
-
#: assets/src/Components/Migration.js:161
|
282 |
-
#: assets/src/Components/PreviewFrame.js:55
|
283 |
-
msgid "Close"
|
284 |
msgstr ""
|
285 |
|
286 |
-
#: assets/build/app.js:
|
|
|
|
|
|
|
|
|
|
|
287 |
#: assets/src/Components/ImportModalError.js:26
|
288 |
msgid "Error code"
|
289 |
msgstr ""
|
290 |
|
291 |
-
#: assets/build/app.js:
|
292 |
#: assets/src/Components/ImportModalError.js:31
|
293 |
msgid "Error log"
|
294 |
msgstr ""
|
295 |
|
296 |
-
#: assets/build/app.js:
|
297 |
#: assets/src/Components/ImportStepper.js:8
|
298 |
msgid "Installing Plugins"
|
299 |
msgstr ""
|
300 |
|
301 |
-
#: assets/build/app.js:
|
302 |
#: assets/src/Components/ImportStepper.js:13
|
303 |
msgid "Importing Content"
|
304 |
msgstr ""
|
305 |
|
306 |
-
#: assets/build/app.js:
|
307 |
#: assets/src/Components/ImportStepper.js:18
|
308 |
msgid "Importing Customizer Settings"
|
309 |
msgstr ""
|
310 |
|
311 |
-
#: assets/build/app.js:
|
312 |
#: assets/src/Components/ImportStepper.js:26
|
313 |
msgid "Importing Widgets"
|
314 |
msgstr ""
|
315 |
|
316 |
#. translators: %s: Error message.
|
317 |
-
#: assets/build/app.js:
|
318 |
-
#: assets/src/Components/InstallModal.js:
|
319 |
msgid "An error has ocurred: %s"
|
320 |
msgstr ""
|
321 |
|
322 |
-
#: assets/build/app.js:
|
323 |
-
#: assets/src/Components/InstallModal.js:
|
324 |
msgid "Could not install theme."
|
325 |
msgstr ""
|
326 |
|
327 |
-
#: assets/build/app.js:
|
328 |
-
#: assets/src/Components/InstallModal.js:
|
329 |
msgid "Could not activate theme."
|
330 |
msgstr ""
|
331 |
|
332 |
-
#: assets/build/app.js:
|
333 |
-
#: assets/src/Components/InstallModal.js:
|
334 |
msgid "Install and Activate Neve"
|
335 |
msgstr ""
|
336 |
|
337 |
-
#: assets/build/app.js:
|
338 |
-
#: assets/src/Components/InstallModal.js:
|
339 |
msgid "Logo"
|
340 |
msgstr ""
|
341 |
|
342 |
-
#: assets/build/app.js:
|
343 |
-
#: assets/src/Components/InstallModal.js:
|
344 |
msgid "In order to import the starter site, Neve theme has to be installed and activated. Click the button below to install and activate Neve"
|
345 |
msgstr ""
|
346 |
|
347 |
-
#: assets/build/app.js:
|
348 |
-
#: assets/src/Components/InstallModal.js:
|
349 |
msgid "Install and Activate"
|
350 |
msgstr ""
|
351 |
|
352 |
-
#: assets/build/app.js:
|
353 |
-
#: assets/src/Components/InstallModal.js:
|
354 |
msgid "Activate"
|
355 |
msgstr ""
|
356 |
|
357 |
-
#: assets/build/app.js:
|
358 |
-
#: assets/
|
359 |
-
msgid "Business"
|
360 |
-
msgstr ""
|
361 |
-
|
362 |
-
#: assets/build/app.js:1450
|
363 |
-
#: assets/src/Components/Main.js:62
|
364 |
-
msgid "Ecommerce"
|
365 |
-
msgstr ""
|
366 |
-
|
367 |
-
#: assets/build/app.js:1450
|
368 |
-
#: assets/src/Components/Main.js:63
|
369 |
-
msgid "Fashion"
|
370 |
-
msgstr ""
|
371 |
-
|
372 |
-
#: assets/build/app.js:1450
|
373 |
-
#: assets/src/Components/Main.js:64
|
374 |
-
msgid "Blogging"
|
375 |
-
msgstr ""
|
376 |
-
|
377 |
-
#: assets/build/app.js:1450
|
378 |
-
#: assets/src/Components/Main.js:65
|
379 |
-
msgid "Photography"
|
380 |
-
msgstr ""
|
381 |
-
|
382 |
-
#: assets/build/app.js:1685
|
383 |
-
#: assets/src/Components/Main.js:346
|
384 |
-
msgid "No results found"
|
385 |
-
msgstr ""
|
386 |
-
|
387 |
-
#: assets/build/app.js:1878
|
388 |
-
#: assets/build/app.js:1944
|
389 |
#: assets/src/Components/Migration.js:82
|
390 |
-
#: assets/src/Components/Migration.js:
|
391 |
msgid "Migrate"
|
392 |
msgstr ""
|
393 |
|
394 |
-
#: assets/build/app.js:
|
395 |
#: assets/src/Components/Migration.js:141
|
396 |
msgid "Migrating"
|
397 |
msgstr ""
|
398 |
|
399 |
-
#: assets/build/app.js:
|
400 |
#: assets/src/Components/Migration.js:177
|
401 |
msgid "Start Migration"
|
402 |
msgstr ""
|
403 |
|
404 |
-
#: assets/build/app.js:
|
405 |
-
#: assets/src/Components/Migration.js:
|
406 |
msgid "Edit Content"
|
407 |
msgstr ""
|
408 |
|
409 |
-
#: assets/build/app.js:
|
410 |
-
#: assets/src/Components/Migration.js:
|
411 |
msgid "Dismissed"
|
412 |
msgstr ""
|
413 |
|
414 |
-
#: assets/build/app.js:
|
415 |
-
#: assets/src/Components/Migration.js:
|
416 |
msgid "Dismiss"
|
417 |
msgstr ""
|
418 |
|
419 |
-
#: assets/build/app.js:
|
420 |
-
#: assets/src/Components/
|
|
|
|
|
|
|
|
|
|
|
421 |
msgid "Previous"
|
422 |
msgstr ""
|
423 |
|
424 |
-
#: assets/build/app.js:
|
425 |
-
#: assets/src/Components/PreviewFrame.js:
|
426 |
msgid "Next"
|
427 |
msgstr ""
|
428 |
|
429 |
-
#: assets/build/app.js:
|
430 |
-
#: assets/src/Components/PreviewFrame.js:
|
431 |
msgid "Upgrade and Import"
|
432 |
msgstr ""
|
433 |
|
434 |
-
#: assets/build/app.js:
|
435 |
-
#: assets/src/Components/Search.js:
|
436 |
msgid "Search for a starter site"
|
437 |
msgstr ""
|
438 |
|
439 |
-
#: assets/build/app.js:
|
440 |
-
#: assets/src/Components/StarterSiteCard.js:
|
441 |
-
msgid "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
442 |
msgstr ""
|
2 |
# This file is distributed under the same license as the Templates Patterns Collection plugin.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Templates Patterns Collection 1.0.11\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/templates-patterns-collection\n"
|
7 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
8 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"POT-Creation-Date: 2020-11-23T16:41:37+00:00\n"
|
13 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
14 |
"X-Generator: WP-CLI 2.4.0\n"
|
15 |
"X-Domain: templates-patterns-collection\n"
|
39 |
msgstr ""
|
40 |
|
41 |
#: includes/Admin.php:270
|
42 |
+
#: assets/build/app.js:4365
|
43 |
+
#: assets/src/Components/StarterSiteCard.js:60
|
44 |
msgid "Preview"
|
45 |
msgstr ""
|
46 |
|
47 |
#: includes/Admin.php:271
|
48 |
+
#: assets/build/app.js:4102
|
49 |
+
#: assets/build/app.js:4369
|
50 |
+
#: assets/src/Components/PreviewFrame.js:102
|
51 |
+
#: assets/src/Components/StarterSiteCard.js:68
|
|
|
|
|
52 |
msgid "Import"
|
53 |
msgstr ""
|
54 |
|
61 |
msgstr ""
|
62 |
|
63 |
#: includes/Admin.php:274
|
64 |
+
#: assets/build/app.js:3671
|
65 |
#: assets/src/Components/Migration.js:165
|
66 |
msgid "Cancel"
|
67 |
msgstr ""
|
71 |
msgstr ""
|
72 |
|
73 |
#: includes/Admin.php:276
|
74 |
+
#: assets/build/app.js:2984
|
75 |
+
#: assets/build/app.js:3685
|
76 |
+
#: assets/src/Components/ImportModal.js:603
|
77 |
+
#: assets/src/Components/Migration.js:198
|
78 |
msgid "View Website"
|
79 |
msgstr ""
|
80 |
|
81 |
#: includes/Admin.php:277
|
82 |
+
#: assets/build/app.js:2988
|
83 |
+
#: assets/src/Components/ImportModal.js:613
|
84 |
msgid "Add your own content"
|
85 |
msgstr ""
|
86 |
|
87 |
#: includes/Admin.php:278
|
88 |
+
#: assets/build/app.js:2981
|
89 |
+
#: assets/src/Components/ImportModal.js:594
|
90 |
msgid "Back to Sites Library"
|
91 |
msgstr ""
|
92 |
|
93 |
#: includes/Admin.php:279
|
|
|
|
|
94 |
msgid "Note"
|
95 |
msgstr ""
|
96 |
|
99 |
msgstr ""
|
100 |
|
101 |
#: includes/Admin.php:281
|
102 |
+
#: assets/build/app.js:2723
|
103 |
+
#: assets/src/Components/ImportModal.js:272
|
104 |
msgid "Plugins"
|
105 |
msgstr ""
|
106 |
|
107 |
#: includes/Admin.php:282
|
|
|
|
|
108 |
msgid "General"
|
109 |
msgstr ""
|
110 |
|
117 |
msgstr ""
|
118 |
|
119 |
#: includes/Admin.php:285
|
120 |
+
#: assets/build/app.js:2666
|
121 |
+
#: assets/src/Components/ImportModal.js:200
|
122 |
msgid "Content"
|
123 |
msgstr ""
|
124 |
|
125 |
#: includes/Admin.php:286
|
126 |
+
#: assets/build/app.js:2670
|
127 |
+
#: assets/src/Components/ImportModal.js:204
|
128 |
msgid "Customizer"
|
129 |
msgstr ""
|
130 |
|
131 |
#: includes/Admin.php:287
|
132 |
+
#: assets/build/app.js:2674
|
133 |
+
#: assets/src/Components/ImportModal.js:208
|
134 |
msgid "Widgets"
|
135 |
msgstr ""
|
136 |
|
151 |
msgstr ""
|
152 |
|
153 |
#: includes/Admin.php:292
|
154 |
+
#: assets/build/app.js:2961
|
155 |
+
#: assets/src/Components/ImportModal.js:542
|
156 |
msgid "Content was successfully imported. Enjoy your new site!"
|
157 |
msgstr ""
|
158 |
|
207 |
|
208 |
#. translators: %s - Theme name
|
209 |
#: includes/Admin.php:337
|
210 |
+
msgid "Choose from multiple unique demos, specially designed for you, that can be installed with a single click. You just need to choose your favorite, and we will take care of everything else."
|
211 |
msgstr ""
|
212 |
|
213 |
#: includes/Sites_Listing.php:46
|
228 |
msgid "With Neve, you can choose from multiple unique demos, specially designed for you, that can be installed with a single click. You just need to choose your favorite, and we will take care of everything else."
|
229 |
msgstr ""
|
230 |
|
231 |
+
#: assets/build/app.js:425
|
232 |
+
#: assets/build/app.js:4391
|
233 |
+
#: assets/src/Components/CloudLibrary/DemoSiteTemplatesImport.js:155
|
234 |
+
#: assets/src/Components/StarterSiteCard.js:103
|
235 |
+
msgid "Premium"
|
236 |
+
msgstr ""
|
237 |
+
|
238 |
+
#: assets/build/app.js:447
|
239 |
+
#: assets/build/app.js:3383
|
240 |
+
#: assets/build/app.js:3671
|
241 |
+
#: assets/build/app.js:3921
|
242 |
+
#: assets/build/app.js:4080
|
243 |
+
#: assets/src/Components/CloudLibrary/DemoSiteTemplatesImport.js:206
|
244 |
+
#: assets/src/Components/InstallModal.js:163
|
245 |
+
#: assets/src/Components/Migration.js:161
|
246 |
+
#: assets/src/Components/OnboardingContent.js:153
|
247 |
+
#: assets/src/Components/PreviewFrame.js:54
|
248 |
+
msgid "Close"
|
249 |
+
msgstr ""
|
250 |
+
|
251 |
+
#: assets/build/app.js:780
|
252 |
+
#: assets/src/Components/CloudLibrary/ImportTemplatesModal.js:143
|
253 |
+
msgid "Import done!"
|
254 |
+
msgstr ""
|
255 |
+
|
256 |
+
#: assets/build/app.js:782
|
257 |
+
#: assets/src/Components/CloudLibrary/ImportTemplatesModal.js:150
|
258 |
+
msgid "Template was successfully imported!"
|
259 |
+
msgstr ""
|
260 |
+
|
261 |
+
#: assets/build/app.js:782
|
262 |
+
#: assets/src/Components/CloudLibrary/ImportTemplatesModal.js:154
|
263 |
+
msgid "Templates were successfully imported!"
|
264 |
+
msgstr ""
|
265 |
+
|
266 |
+
#: assets/build/app.js:796
|
267 |
+
#: assets/src/Components/CloudLibrary/ImportTemplatesModal.js:175
|
268 |
+
msgid "Visit"
|
269 |
+
msgstr ""
|
270 |
+
|
271 |
+
#: assets/build/app.js:799
|
272 |
+
#: assets/src/Components/CloudLibrary/ImportTemplatesModal.js:184
|
273 |
+
msgid "Edit"
|
274 |
+
msgstr ""
|
275 |
+
|
276 |
+
#: assets/build/app.js:814
|
277 |
+
#: assets/src/Components/CloudLibrary/ImportTemplatesModal.js:211
|
278 |
+
msgid "An error occurred!"
|
279 |
+
msgstr ""
|
280 |
+
|
281 |
+
#. translators: %s the name of the template
|
282 |
+
#: assets/build/app.js:834
|
283 |
+
#: assets/src/Components/CloudLibrary/ImportTemplatesModal.js:247
|
284 |
+
msgid "The %s template will be imported as a page into your site. This import <strong/> include any plugins or theme settings."
|
285 |
+
msgstr ""
|
286 |
+
|
287 |
+
#. translators: %s the name of the template
|
288 |
+
#: assets/build/app.js:834
|
289 |
+
#: assets/src/Components/CloudLibrary/ImportTemplatesModal.js:253
|
290 |
+
msgid "All the templates that are included in this starter site, will be imported as pages. This import <strong/> include any plugins or theme settings."
|
291 |
+
msgstr ""
|
292 |
+
|
293 |
+
#. translators: name of starter site
|
294 |
+
#: assets/build/app.js:853
|
295 |
+
#: assets/src/Components/CloudLibrary/ImportTemplatesModal.js:278
|
296 |
+
msgid "Import the %s template"
|
297 |
+
msgstr ""
|
298 |
+
|
299 |
+
#. translators: name of template
|
300 |
+
#: assets/build/app.js:855
|
301 |
+
#: assets/src/Components/CloudLibrary/ImportTemplatesModal.js:283
|
302 |
+
msgid "Import all templates from %s"
|
303 |
+
msgstr ""
|
304 |
+
|
305 |
+
#: assets/build/app.js:864
|
306 |
+
#: assets/src/Components/CloudLibrary/ImportTemplatesModal.js:303
|
307 |
+
msgid "I want to import the entire site"
|
308 |
+
msgstr ""
|
309 |
+
|
310 |
+
#: assets/build/app.js:2082
|
311 |
+
#: assets/build/app.js:2111
|
312 |
+
#: assets/build/app.js:2192
|
313 |
#: assets/src/Components/EditorSelector.js:30
|
314 |
#: assets/src/Components/EditorSelector.js:70
|
315 |
#: assets/src/Components/EditorTabs.js:42
|
316 |
msgid "Builder Logo"
|
317 |
msgstr ""
|
318 |
|
319 |
+
#: assets/build/app.js:2554
|
320 |
+
#: assets/build/app.js:2579
|
321 |
+
#: assets/src/Components/ImportModal.js:61
|
322 |
+
#: assets/src/Components/ImportModal.js:97
|
323 |
msgid "Something went wrong while loading the site data. Please refresh the page and try again."
|
324 |
msgstr ""
|
325 |
|
326 |
+
#. translators: name of starter site
|
327 |
+
#: assets/build/app.js:2658
|
328 |
+
#: assets/src/Components/ImportModal.js:180
|
329 |
+
msgid "Import %s as a complete site"
|
330 |
+
msgstr ""
|
331 |
+
|
332 |
+
#: assets/build/app.js:2660
|
333 |
+
#: assets/src/Components/ImportModal.js:188
|
334 |
+
msgid "Import the entire site including customizer options, pages, content and plugins."
|
335 |
+
msgstr ""
|
336 |
+
|
337 |
+
#: assets/build/app.js:2687
|
338 |
+
#: assets/src/Components/ImportModal.js:222
|
339 |
+
msgid "Import settings"
|
340 |
+
msgstr ""
|
341 |
+
|
342 |
+
#: assets/build/app.js:2879
|
343 |
+
#: assets/src/Components/ImportModal.js:427
|
344 |
msgid "Something went wrong while installing the necessary plugins."
|
345 |
msgstr ""
|
346 |
|
347 |
+
#: assets/build/app.js:2880
|
348 |
+
#: assets/src/Components/ImportModal.js:431
|
349 |
msgid "Something went wrong while importing the website content."
|
350 |
msgstr ""
|
351 |
|
352 |
+
#: assets/build/app.js:2881
|
353 |
+
#: assets/src/Components/ImportModal.js:435
|
354 |
msgid "Something went wrong while updating the customizer settings."
|
355 |
msgstr ""
|
356 |
|
357 |
+
#: assets/build/app.js:2882
|
358 |
+
#: assets/src/Components/ImportModal.js:439
|
359 |
msgid "Something went wrong while importing the widgets."
|
360 |
msgstr ""
|
361 |
|
362 |
+
#: assets/build/app.js:2967
|
363 |
+
#: assets/src/Components/ImportModal.js:562
|
364 |
+
msgid "I want to import just the templates"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
365 |
msgstr ""
|
366 |
|
367 |
+
#: assets/build/app.js:2975
|
368 |
+
#: assets/src/Components/ImportModal.js:580
|
369 |
+
msgid "Import entire site"
|
370 |
+
msgstr ""
|
371 |
+
|
372 |
+
#: assets/build/app.js:3058
|
373 |
#: assets/src/Components/ImportModalError.js:26
|
374 |
msgid "Error code"
|
375 |
msgstr ""
|
376 |
|
377 |
+
#: assets/build/app.js:3058
|
378 |
#: assets/src/Components/ImportModalError.js:31
|
379 |
msgid "Error log"
|
380 |
msgstr ""
|
381 |
|
382 |
+
#: assets/build/app.js:3148
|
383 |
#: assets/src/Components/ImportStepper.js:8
|
384 |
msgid "Installing Plugins"
|
385 |
msgstr ""
|
386 |
|
387 |
+
#: assets/build/app.js:3153
|
388 |
#: assets/src/Components/ImportStepper.js:13
|
389 |
msgid "Importing Content"
|
390 |
msgstr ""
|
391 |
|
392 |
+
#: assets/build/app.js:3158
|
393 |
#: assets/src/Components/ImportStepper.js:18
|
394 |
msgid "Importing Customizer Settings"
|
395 |
msgstr ""
|
396 |
|
397 |
+
#: assets/build/app.js:3163
|
398 |
#: assets/src/Components/ImportStepper.js:26
|
399 |
msgid "Importing Widgets"
|
400 |
msgstr ""
|
401 |
|
402 |
#. translators: %s: Error message.
|
403 |
+
#: assets/build/app.js:3287
|
404 |
+
#: assets/src/Components/InstallModal.js:31
|
405 |
msgid "An error has ocurred: %s"
|
406 |
msgstr ""
|
407 |
|
408 |
+
#: assets/build/app.js:3304
|
409 |
+
#: assets/src/Components/InstallModal.js:52
|
410 |
msgid "Could not install theme."
|
411 |
msgstr ""
|
412 |
|
413 |
+
#: assets/build/app.js:3314
|
414 |
+
#: assets/src/Components/InstallModal.js:67
|
415 |
msgid "Could not activate theme."
|
416 |
msgstr ""
|
417 |
|
418 |
+
#: assets/build/app.js:3334
|
419 |
+
#: assets/src/Components/InstallModal.js:89
|
420 |
msgid "Install and Activate Neve"
|
421 |
msgstr ""
|
422 |
|
423 |
+
#: assets/build/app.js:3348
|
424 |
+
#: assets/src/Components/InstallModal.js:102
|
425 |
msgid "Logo"
|
426 |
msgstr ""
|
427 |
|
428 |
+
#: assets/build/app.js:3359
|
429 |
+
#: assets/src/Components/InstallModal.js:116
|
430 |
msgid "In order to import the starter site, Neve theme has to be installed and activated. Click the button below to install and activate Neve"
|
431 |
msgstr ""
|
432 |
|
433 |
+
#: assets/build/app.js:3376
|
434 |
+
#: assets/src/Components/InstallModal.js:147
|
435 |
msgid "Install and Activate"
|
436 |
msgstr ""
|
437 |
|
438 |
+
#: assets/build/app.js:3376
|
439 |
+
#: assets/src/Components/InstallModal.js:151
|
440 |
msgid "Activate"
|
441 |
msgstr ""
|
442 |
|
443 |
+
#: assets/build/app.js:3642
|
444 |
+
#: assets/build/app.js:3714
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
445 |
#: assets/src/Components/Migration.js:82
|
446 |
+
#: assets/src/Components/Migration.js:240
|
447 |
msgid "Migrate"
|
448 |
msgstr ""
|
449 |
|
450 |
+
#: assets/build/app.js:3664
|
451 |
#: assets/src/Components/Migration.js:141
|
452 |
msgid "Migrating"
|
453 |
msgstr ""
|
454 |
|
455 |
+
#: assets/build/app.js:3676
|
456 |
#: assets/src/Components/Migration.js:177
|
457 |
msgid "Start Migration"
|
458 |
msgstr ""
|
459 |
|
460 |
+
#: assets/build/app.js:3682
|
461 |
+
#: assets/src/Components/Migration.js:189
|
462 |
msgid "Edit Content"
|
463 |
msgstr ""
|
464 |
|
465 |
+
#: assets/build/app.js:3725
|
466 |
+
#: assets/src/Components/Migration.js:260
|
467 |
msgid "Dismissed"
|
468 |
msgstr ""
|
469 |
|
470 |
+
#: assets/build/app.js:3729
|
471 |
+
#: assets/src/Components/Migration.js:269
|
472 |
msgid "Dismiss"
|
473 |
msgstr ""
|
474 |
|
475 |
+
#: assets/build/app.js:3930
|
476 |
+
#: assets/src/Components/OnboardingContent.js:171
|
477 |
+
msgid "No results found"
|
478 |
+
msgstr ""
|
479 |
+
|
480 |
+
#: assets/build/app.js:4085
|
481 |
+
#: assets/src/Components/PreviewFrame.js:62
|
482 |
msgid "Previous"
|
483 |
msgstr ""
|
484 |
|
485 |
+
#: assets/build/app.js:4090
|
486 |
+
#: assets/src/Components/PreviewFrame.js:74
|
487 |
msgid "Next"
|
488 |
msgstr ""
|
489 |
|
490 |
+
#: assets/build/app.js:4098
|
491 |
+
#: assets/src/Components/PreviewFrame.js:91
|
492 |
msgid "Upgrade and Import"
|
493 |
msgstr ""
|
494 |
|
495 |
+
#: assets/build/app.js:4242
|
496 |
+
#: assets/src/Components/Search.js:102
|
497 |
msgid "Search for a starter site"
|
498 |
msgstr ""
|
499 |
|
500 |
+
#: assets/build/app.js:4377
|
501 |
+
#: assets/src/Components/StarterSiteCard.js:81
|
502 |
+
msgid "View Pages"
|
503 |
+
msgstr ""
|
504 |
+
|
505 |
+
#: assets/build/app.js:5001
|
506 |
+
#: assets/src/utils/common.js:7
|
507 |
+
msgid "Business"
|
508 |
+
msgstr ""
|
509 |
+
|
510 |
+
#: assets/build/app.js:5001
|
511 |
+
#: assets/src/utils/common.js:8
|
512 |
+
msgid "Ecommerce"
|
513 |
+
msgstr ""
|
514 |
+
|
515 |
+
#: assets/build/app.js:5001
|
516 |
+
#: assets/src/utils/common.js:9
|
517 |
+
msgid "Fashion"
|
518 |
+
msgstr ""
|
519 |
+
|
520 |
+
#: assets/build/app.js:5001
|
521 |
+
#: assets/src/utils/common.js:10
|
522 |
+
msgid "Blogging"
|
523 |
+
msgstr ""
|
524 |
+
|
525 |
+
#: assets/build/app.js:5001
|
526 |
+
#: assets/src/utils/common.js:11
|
527 |
+
msgid "Photography"
|
528 |
msgstr ""
|
readme.txt
CHANGED
@@ -27,6 +27,14 @@ No account is required to access the service template collection and the privacy
|
|
27 |
|
28 |
== Changelog ==
|
29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
##### [Version 1.0.11](https://github.com/Codeinwp/templates-patterns-collection/compare/v1.0.10...v1.0.11) (2020-10-13)
|
31 |
|
32 |
- Moved onboarding to TPC
|
27 |
|
28 |
== Changelog ==
|
29 |
|
30 |
+
#### [Version 1.1.0](https://github.com/Codeinwp/templates-patterns-collection/compare/v1.0.11...v1.1.0) (2020-11-24)
|
31 |
+
|
32 |
+
Single page templates
|
33 |
+
Cloud storage for custom-built templates
|
34 |
+
|
35 |
+
|
36 |
+
|
37 |
+
|
38 |
##### [Version 1.0.11](https://github.com/Codeinwp/templates-patterns-collection/compare/v1.0.10...v1.0.11) (2020-10-13)
|
39 |
|
40 |
- Moved onboarding to TPC
|
templates-patterns-collection.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/**
|
3 |
* Plugin Name: Templates Patterns Collection
|
4 |
* Description: This plugin is an add-on to Neve WordPress theme which offers access to Templates and Block Patterns library service to be used with the theme.
|
5 |
-
* Version: 1.0
|
6 |
* Author: ThemeIsle
|
7 |
* Author URI: https://themeisle.com
|
8 |
* License: GPLv3
|
@@ -17,6 +17,7 @@
|
|
17 |
|
18 |
add_action( 'admin_notices', 'ti_tpc_plugins_page_notice' );
|
19 |
add_action( 'init', 'ti_tpc_load_textdomain' );
|
|
|
20 |
|
21 |
/**
|
22 |
* Plugins page notice if we don't have neve activated.
|
@@ -53,6 +54,22 @@ function ti_tpc_plugins_page_notice() {
|
|
53 |
echo wp_kses_post( $notice );
|
54 |
}
|
55 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
/**
|
57 |
* Load the localisation file.
|
58 |
*/
|
@@ -81,6 +98,3 @@ function ti_tpc_run() {
|
|
81 |
|
82 |
\TIOB\Main::instance();
|
83 |
}
|
84 |
-
|
85 |
-
|
86 |
-
|
2 |
/**
|
3 |
* Plugin Name: Templates Patterns Collection
|
4 |
* Description: This plugin is an add-on to Neve WordPress theme which offers access to Templates and Block Patterns library service to be used with the theme.
|
5 |
+
* Version: 1.1.0
|
6 |
* Author: ThemeIsle
|
7 |
* Author URI: https://themeisle.com
|
8 |
* License: GPLv3
|
17 |
|
18 |
add_action( 'admin_notices', 'ti_tpc_plugins_page_notice' );
|
19 |
add_action( 'init', 'ti_tpc_load_textdomain' );
|
20 |
+
add_action( 'init', 'ti_tpc_flush_premalinks' );
|
21 |
|
22 |
/**
|
23 |
* Plugins page notice if we don't have neve activated.
|
54 |
echo wp_kses_post( $notice );
|
55 |
}
|
56 |
|
57 |
+
/**
|
58 |
+
* Flush the permalinks after import
|
59 |
+
*
|
60 |
+
* @return bool
|
61 |
+
*/
|
62 |
+
function ti_tpc_flush_premalinks() {
|
63 |
+
$flash_rules = get_transient( 'ti_tpc_should_flush_permalinks' );
|
64 |
+
if ( $flash_rules !== 'yes' ) {
|
65 |
+
return false;
|
66 |
+
}
|
67 |
+
|
68 |
+
flush_rewrite_rules();
|
69 |
+
delete_transient( 'ti_tpc_should_flush_permalinks' );
|
70 |
+
return true;
|
71 |
+
}
|
72 |
+
|
73 |
/**
|
74 |
* Load the localisation file.
|
75 |
*/
|
98 |
|
99 |
\TIOB\Main::instance();
|
100 |
}
|
|
|
|
|
|
vendor/autoload.php
CHANGED
@@ -4,4 +4,4 @@
|
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
-
return
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
+
return ComposerAutoloaderInitbc0ea3454a11d1cfb300c7c32b248525::getLoader();
|
vendor/composer/ClassLoader.php
CHANGED
@@ -37,8 +37,8 @@ namespace Composer\Autoload;
|
|
37 |
*
|
38 |
* @author Fabien Potencier <fabien@symfony.com>
|
39 |
* @author Jordi Boggiano <j.boggiano@seld.be>
|
40 |
-
* @see
|
41 |
-
* @see
|
42 |
*/
|
43 |
class ClassLoader
|
44 |
{
|
37 |
*
|
38 |
* @author Fabien Potencier <fabien@symfony.com>
|
39 |
* @author Jordi Boggiano <j.boggiano@seld.be>
|
40 |
+
* @see https://www.php-fig.org/psr/psr-0/
|
41 |
+
* @see https://www.php-fig.org/psr/psr-4/
|
42 |
*/
|
43 |
class ClassLoader
|
44 |
{
|
vendor/composer/InstalledVersions.php
ADDED
@@ -0,0 +1,209 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Composer;
|
4 |
+
|
5 |
+
use Composer\Semver\VersionParser;
|
6 |
+
|
7 |
+
|
8 |
+
|
9 |
+
|
10 |
+
|
11 |
+
|
12 |
+
class InstalledVersions
|
13 |
+
{
|
14 |
+
private static $installed = array (
|
15 |
+
'root' =>
|
16 |
+
array (
|
17 |
+
'pretty_version' => '1.1.0',
|
18 |
+
'version' => '1.1.0.0',
|
19 |
+
'aliases' =>
|
20 |
+
array (
|
21 |
+
),
|
22 |
+
'reference' => NULL,
|
23 |
+
'name' => 'codeinwp/templates-patterns-collection',
|
24 |
+
),
|
25 |
+
'versions' =>
|
26 |
+
array (
|
27 |
+
'codeinwp/templates-patterns-collection' =>
|
28 |
+
array (
|
29 |
+
'pretty_version' => '1.1.0',
|
30 |
+
'version' => '1.1.0.0',
|
31 |
+
'aliases' =>
|
32 |
+
array (
|
33 |
+
),
|
34 |
+
'reference' => NULL,
|
35 |
+
),
|
36 |
+
),
|
37 |
+
);
|
38 |
+
|
39 |
+
|
40 |
+
|
41 |
+
|
42 |
+
|
43 |
+
|
44 |
+
|
45 |
+
public static function getInstalledPackages()
|
46 |
+
{
|
47 |
+
return array_keys(self::$installed['versions']);
|
48 |
+
}
|
49 |
+
|
50 |
+
|
51 |
+
|
52 |
+
|
53 |
+
|
54 |
+
|
55 |
+
|
56 |
+
|
57 |
+
|
58 |
+
public static function isInstalled($packageName)
|
59 |
+
{
|
60 |
+
return isset(self::$installed['versions'][$packageName]);
|
61 |
+
}
|
62 |
+
|
63 |
+
|
64 |
+
|
65 |
+
|
66 |
+
|
67 |
+
|
68 |
+
|
69 |
+
|
70 |
+
|
71 |
+
|
72 |
+
|
73 |
+
|
74 |
+
|
75 |
+
|
76 |
+
public static function satisfies(VersionParser $parser, $packageName, $constraint)
|
77 |
+
{
|
78 |
+
$constraint = $parser->parseConstraints($constraint);
|
79 |
+
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
|
80 |
+
|
81 |
+
return $provided->matches($constraint);
|
82 |
+
}
|
83 |
+
|
84 |
+
|
85 |
+
|
86 |
+
|
87 |
+
|
88 |
+
|
89 |
+
|
90 |
+
|
91 |
+
|
92 |
+
|
93 |
+
public static function getVersionRanges($packageName)
|
94 |
+
{
|
95 |
+
if (!isset(self::$installed['versions'][$packageName])) {
|
96 |
+
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
97 |
+
}
|
98 |
+
|
99 |
+
$ranges = array();
|
100 |
+
if (isset(self::$installed['versions'][$packageName]['pretty_version'])) {
|
101 |
+
$ranges[] = self::$installed['versions'][$packageName]['pretty_version'];
|
102 |
+
}
|
103 |
+
if (array_key_exists('aliases', self::$installed['versions'][$packageName])) {
|
104 |
+
$ranges = array_merge($ranges, self::$installed['versions'][$packageName]['aliases']);
|
105 |
+
}
|
106 |
+
if (array_key_exists('replaced', self::$installed['versions'][$packageName])) {
|
107 |
+
$ranges = array_merge($ranges, self::$installed['versions'][$packageName]['replaced']);
|
108 |
+
}
|
109 |
+
if (array_key_exists('provided', self::$installed['versions'][$packageName])) {
|
110 |
+
$ranges = array_merge($ranges, self::$installed['versions'][$packageName]['provided']);
|
111 |
+
}
|
112 |
+
|
113 |
+
return implode(' || ', $ranges);
|
114 |
+
}
|
115 |
+
|
116 |
+
|
117 |
+
|
118 |
+
|
119 |
+
|
120 |
+
public static function getVersion($packageName)
|
121 |
+
{
|
122 |
+
if (!isset(self::$installed['versions'][$packageName])) {
|
123 |
+
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
124 |
+
}
|
125 |
+
|
126 |
+
if (!isset(self::$installed['versions'][$packageName]['version'])) {
|
127 |
+
return null;
|
128 |
+
}
|
129 |
+
|
130 |
+
return self::$installed['versions'][$packageName]['version'];
|
131 |
+
}
|
132 |
+
|
133 |
+
|
134 |
+
|
135 |
+
|
136 |
+
|
137 |
+
public static function getPrettyVersion($packageName)
|
138 |
+
{
|
139 |
+
if (!isset(self::$installed['versions'][$packageName])) {
|
140 |
+
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
141 |
+
}
|
142 |
+
|
143 |
+
if (!isset(self::$installed['versions'][$packageName]['pretty_version'])) {
|
144 |
+
return null;
|
145 |
+
}
|
146 |
+
|
147 |
+
return self::$installed['versions'][$packageName]['pretty_version'];
|
148 |
+
}
|
149 |
+
|
150 |
+
|
151 |
+
|
152 |
+
|
153 |
+
|
154 |
+
public static function getReference($packageName)
|
155 |
+
{
|
156 |
+
if (!isset(self::$installed['versions'][$packageName])) {
|
157 |
+
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
158 |
+
}
|
159 |
+
|
160 |
+
if (!isset(self::$installed['versions'][$packageName]['reference'])) {
|
161 |
+
return null;
|
162 |
+
}
|
163 |
+
|
164 |
+
return self::$installed['versions'][$packageName]['reference'];
|
165 |
+
}
|
166 |
+
|
167 |
+
|
168 |
+
|
169 |
+
|
170 |
+
|
171 |
+
public static function getRootPackage()
|
172 |
+
{
|
173 |
+
return self::$installed['root'];
|
174 |
+
}
|
175 |
+
|
176 |
+
|
177 |
+
|
178 |
+
|
179 |
+
|
180 |
+
|
181 |
+
|
182 |
+
public static function getRawData()
|
183 |
+
{
|
184 |
+
return self::$installed;
|
185 |
+
}
|
186 |
+
|
187 |
+
|
188 |
+
|
189 |
+
|
190 |
+
|
191 |
+
|
192 |
+
|
193 |
+
|
194 |
+
|
195 |
+
|
196 |
+
|
197 |
+
|
198 |
+
|
199 |
+
|
200 |
+
|
201 |
+
|
202 |
+
|
203 |
+
|
204 |
+
|
205 |
+
public static function reload($data)
|
206 |
+
{
|
207 |
+
self::$installed = $data;
|
208 |
+
}
|
209 |
+
}
|
vendor/composer/autoload_classmap.php
CHANGED
@@ -6,7 +6,9 @@ $vendorDir = dirname(dirname(__FILE__));
|
|
6 |
$baseDir = dirname($vendorDir);
|
7 |
|
8 |
return array(
|
|
|
9 |
'TIOB\\Admin' => $baseDir . '/includes/Admin.php',
|
|
|
10 |
'TIOB\\Importers\\Content_Importer' => $baseDir . '/includes/Importers/Content_Importer.php',
|
11 |
'TIOB\\Importers\\Helpers\\Helper' => $baseDir . '/includes/Importers/Helpers/Helper.php',
|
12 |
'TIOB\\Importers\\Helpers\\Importer_Alterator' => $baseDir . '/includes/Importers/Helpers/Importer_Alterator.php',
|
6 |
$baseDir = dirname($vendorDir);
|
7 |
|
8 |
return array(
|
9 |
+
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
|
10 |
'TIOB\\Admin' => $baseDir . '/includes/Admin.php',
|
11 |
+
'TIOB\\Editor' => $baseDir . '/includes/Editor.php',
|
12 |
'TIOB\\Importers\\Content_Importer' => $baseDir . '/includes/Importers/Content_Importer.php',
|
13 |
'TIOB\\Importers\\Helpers\\Helper' => $baseDir . '/includes/Importers/Helpers/Helper.php',
|
14 |
'TIOB\\Importers\\Helpers\\Importer_Alterator' => $baseDir . '/includes/Importers/Helpers/Importer_Alterator.php',
|
vendor/composer/autoload_real.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
-
class
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
@@ -22,15 +22,15 @@ class ComposerAutoloaderInit860532b18175cf75d2b942ebcd6f4b57
|
|
22 |
return self::$loader;
|
23 |
}
|
24 |
|
25 |
-
spl_autoload_register(array('
|
26 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
27 |
-
spl_autoload_unregister(array('
|
28 |
|
29 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
30 |
if ($useStaticLoader) {
|
31 |
-
|
32 |
|
33 |
-
call_user_func(\Composer\Autoload\
|
34 |
} else {
|
35 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
36 |
foreach ($map as $namespace => $path) {
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
+
class ComposerAutoloaderInitbc0ea3454a11d1cfb300c7c32b248525
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
22 |
return self::$loader;
|
23 |
}
|
24 |
|
25 |
+
spl_autoload_register(array('ComposerAutoloaderInitbc0ea3454a11d1cfb300c7c32b248525', 'loadClassLoader'), true, true);
|
26 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
27 |
+
spl_autoload_unregister(array('ComposerAutoloaderInitbc0ea3454a11d1cfb300c7c32b248525', 'loadClassLoader'));
|
28 |
|
29 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
30 |
if ($useStaticLoader) {
|
31 |
+
require __DIR__ . '/autoload_static.php';
|
32 |
|
33 |
+
call_user_func(\Composer\Autoload\ComposerStaticInitbc0ea3454a11d1cfb300c7c32b248525::getInitializer($loader));
|
34 |
} else {
|
35 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
36 |
foreach ($map as $namespace => $path) {
|
vendor/composer/autoload_static.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
-
class
|
8 |
{
|
9 |
public static $prefixLengthsPsr4 = array (
|
10 |
'T' =>
|
@@ -21,7 +21,9 @@ class ComposerStaticInit860532b18175cf75d2b942ebcd6f4b57
|
|
21 |
);
|
22 |
|
23 |
public static $classMap = array (
|
|
|
24 |
'TIOB\\Admin' => __DIR__ . '/../..' . '/includes/Admin.php',
|
|
|
25 |
'TIOB\\Importers\\Content_Importer' => __DIR__ . '/../..' . '/includes/Importers/Content_Importer.php',
|
26 |
'TIOB\\Importers\\Helpers\\Helper' => __DIR__ . '/../..' . '/includes/Importers/Helpers/Helper.php',
|
27 |
'TIOB\\Importers\\Helpers\\Importer_Alterator' => __DIR__ . '/../..' . '/includes/Importers/Helpers/Importer_Alterator.php',
|
@@ -48,9 +50,9 @@ class ComposerStaticInit860532b18175cf75d2b942ebcd6f4b57
|
|
48 |
public static function getInitializer(ClassLoader $loader)
|
49 |
{
|
50 |
return \Closure::bind(function () use ($loader) {
|
51 |
-
$loader->prefixLengthsPsr4 =
|
52 |
-
$loader->prefixDirsPsr4 =
|
53 |
-
$loader->classMap =
|
54 |
|
55 |
}, null, ClassLoader::class);
|
56 |
}
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
+
class ComposerStaticInitbc0ea3454a11d1cfb300c7c32b248525
|
8 |
{
|
9 |
public static $prefixLengthsPsr4 = array (
|
10 |
'T' =>
|
21 |
);
|
22 |
|
23 |
public static $classMap = array (
|
24 |
+
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
|
25 |
'TIOB\\Admin' => __DIR__ . '/../..' . '/includes/Admin.php',
|
26 |
+
'TIOB\\Editor' => __DIR__ . '/../..' . '/includes/Editor.php',
|
27 |
'TIOB\\Importers\\Content_Importer' => __DIR__ . '/../..' . '/includes/Importers/Content_Importer.php',
|
28 |
'TIOB\\Importers\\Helpers\\Helper' => __DIR__ . '/../..' . '/includes/Importers/Helpers/Helper.php',
|
29 |
'TIOB\\Importers\\Helpers\\Importer_Alterator' => __DIR__ . '/../..' . '/includes/Importers/Helpers/Importer_Alterator.php',
|
50 |
public static function getInitializer(ClassLoader $loader)
|
51 |
{
|
52 |
return \Closure::bind(function () use ($loader) {
|
53 |
+
$loader->prefixLengthsPsr4 = ComposerStaticInitbc0ea3454a11d1cfb300c7c32b248525::$prefixLengthsPsr4;
|
54 |
+
$loader->prefixDirsPsr4 = ComposerStaticInitbc0ea3454a11d1cfb300c7c32b248525::$prefixDirsPsr4;
|
55 |
+
$loader->classMap = ComposerStaticInitbc0ea3454a11d1cfb300c7c32b248525::$classMap;
|
56 |
|
57 |
}, null, ClassLoader::class);
|
58 |
}
|
vendor/composer/installed.json
CHANGED
@@ -1 +1,5 @@
|
|
1 |
-
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"packages": [],
|
3 |
+
"dev": false,
|
4 |
+
"dev-package-names": []
|
5 |
+
}
|
vendor/composer/installed.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php return array (
|
2 |
+
'root' =>
|
3 |
+
array (
|
4 |
+
'pretty_version' => '1.1.0',
|
5 |
+
'version' => '1.1.0.0',
|
6 |
+
'aliases' =>
|
7 |
+
array (
|
8 |
+
),
|
9 |
+
'reference' => NULL,
|
10 |
+
'name' => 'codeinwp/templates-patterns-collection',
|
11 |
+
),
|
12 |
+
'versions' =>
|
13 |
+
array (
|
14 |
+
'codeinwp/templates-patterns-collection' =>
|
15 |
+
array (
|
16 |
+
'pretty_version' => '1.1.0',
|
17 |
+
'version' => '1.1.0.0',
|
18 |
+
'aliases' =>
|
19 |
+
array (
|
20 |
+
),
|
21 |
+
'reference' => NULL,
|
22 |
+
),
|
23 |
+
),
|
24 |
+
);
|
yarn.lock
CHANGED
@@ -2106,6 +2106,15 @@
|
|
2106 |
prettier "npm:wp-prettier@2.0.5"
|
2107 |
requireindex "^1.2.0"
|
2108 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2109 |
"@wordpress/jest-console@^3.9.0":
|
2110 |
version "3.9.0"
|
2111 |
resolved "https://registry.yarnpkg.com/@wordpress/jest-console/-/jest-console-3.9.0.tgz#88a81585e7d95dd1957994b5c9d83e82d9fe8a1a"
|
@@ -2154,6 +2163,15 @@
|
|
2154 |
resolved "https://registry.yarnpkg.com/@wordpress/prettier-config/-/prettier-config-0.4.0.tgz#bc8ab5c234c74a5c3bbb424cbbc3010b2be1be44"
|
2155 |
integrity sha512-7c4VeugkCwDkaHSD7ffxoP0VC5c///gCTEAT032OhI5Rik2dPxE3EkNAB2NhotGE8M4dMAg4g5Wj2OWZIn8TFw==
|
2156 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2157 |
"@wordpress/scripts@^12.2.1":
|
2158 |
version "12.3.0"
|
2159 |
resolved "https://registry.yarnpkg.com/@wordpress/scripts/-/scripts-12.3.0.tgz#9f122adbb87b8ec18481bb936aac82c1c1b9fd2b"
|
@@ -3534,7 +3552,7 @@ class-utils@^0.3.5:
|
|
3534 |
isobject "^3.0.0"
|
3535 |
static-extend "^0.1.1"
|
3536 |
|
3537 |
-
classnames@^2.2.6:
|
3538 |
version "2.2.6"
|
3539 |
resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.2.6.tgz#43935bffdd291f326dad0a205309b38d00f650ce"
|
3540 |
integrity sha512-JR/iSQOSt+LQIWwrwEzJ9uk0xfN3mTVYMwt1Ir5mUcSN6pU+V4zQFFaJsclJbPuAUQH+yfWef6tm7l1quW3C8Q==
|
@@ -10869,6 +10887,15 @@ query-string@^4.1.0:
|
|
10869 |
object-assign "^4.1.0"
|
10870 |
strict-uri-encode "^1.0.0"
|
10871 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10872 |
query-string@^6.8.2:
|
10873 |
version "6.13.5"
|
10874 |
resolved "https://registry.yarnpkg.com/query-string/-/query-string-6.13.5.tgz#99e95e2fb7021db90a6f373f990c0c814b3812d8"
|
@@ -13625,6 +13652,11 @@ uuid@^3.3.2, uuid@^3.3.3:
|
|
13625 |
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee"
|
13626 |
integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==
|
13627 |
|
|
|
|
|
|
|
|
|
|
|
13628 |
v8-compile-cache@^2.0.3, v8-compile-cache@^2.1.1:
|
13629 |
version "2.1.1"
|
13630 |
resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.1.1.tgz#54bc3cdd43317bca91e35dcaf305b1a7237de745"
|
2106 |
prettier "npm:wp-prettier@2.0.5"
|
2107 |
requireindex "^1.2.0"
|
2108 |
|
2109 |
+
"@wordpress/icons@^2.7.0":
|
2110 |
+
version "2.8.0"
|
2111 |
+
resolved "https://registry.yarnpkg.com/@wordpress/icons/-/icons-2.8.0.tgz#cab47c3c6c17089c68e308b60658e8fbb59e070d"
|
2112 |
+
integrity sha512-ZhQXXzNqcDh0JRY/Ro7iePjTDD8FnZ5W8ze8NKg9da9I24QwL5mWCJezt8ZhBo0wxnD+Lk3kKKMYA6P+lh6qWg==
|
2113 |
+
dependencies:
|
2114 |
+
"@babel/runtime" "^7.11.2"
|
2115 |
+
"@wordpress/element" "^2.18.0"
|
2116 |
+
"@wordpress/primitives" "^1.10.0"
|
2117 |
+
|
2118 |
"@wordpress/jest-console@^3.9.0":
|
2119 |
version "3.9.0"
|
2120 |
resolved "https://registry.yarnpkg.com/@wordpress/jest-console/-/jest-console-3.9.0.tgz#88a81585e7d95dd1957994b5c9d83e82d9fe8a1a"
|
2163 |
resolved "https://registry.yarnpkg.com/@wordpress/prettier-config/-/prettier-config-0.4.0.tgz#bc8ab5c234c74a5c3bbb424cbbc3010b2be1be44"
|
2164 |
integrity sha512-7c4VeugkCwDkaHSD7ffxoP0VC5c///gCTEAT032OhI5Rik2dPxE3EkNAB2NhotGE8M4dMAg4g5Wj2OWZIn8TFw==
|
2165 |
|
2166 |
+
"@wordpress/primitives@^1.10.0":
|
2167 |
+
version "1.10.0"
|
2168 |
+
resolved "https://registry.yarnpkg.com/@wordpress/primitives/-/primitives-1.10.0.tgz#8f1e74c98dfa497074450b3fc2e5a0e2b134cd73"
|
2169 |
+
integrity sha512-C1drc//1dEFf7eMVfuk9Z11X9VzFgKHBA8J3yAj5fxJffbATYfzHCLgERcZQIUsnn8GUL4VScNbmRf6+8i2rhw==
|
2170 |
+
dependencies:
|
2171 |
+
"@babel/runtime" "^7.11.2"
|
2172 |
+
"@wordpress/element" "^2.18.0"
|
2173 |
+
classnames "^2.2.5"
|
2174 |
+
|
2175 |
"@wordpress/scripts@^12.2.1":
|
2176 |
version "12.3.0"
|
2177 |
resolved "https://registry.yarnpkg.com/@wordpress/scripts/-/scripts-12.3.0.tgz#9f122adbb87b8ec18481bb936aac82c1c1b9fd2b"
|
3552 |
isobject "^3.0.0"
|
3553 |
static-extend "^0.1.1"
|
3554 |
|
3555 |
+
classnames@^2.2.5, classnames@^2.2.6:
|
3556 |
version "2.2.6"
|
3557 |
resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.2.6.tgz#43935bffdd291f326dad0a205309b38d00f650ce"
|
3558 |
integrity sha512-JR/iSQOSt+LQIWwrwEzJ9uk0xfN3mTVYMwt1Ir5mUcSN6pU+V4zQFFaJsclJbPuAUQH+yfWef6tm7l1quW3C8Q==
|
10887 |
object-assign "^4.1.0"
|
10888 |
strict-uri-encode "^1.0.0"
|
10889 |
|
10890 |
+
query-string@^6.13.6:
|
10891 |
+
version "6.13.6"
|
10892 |
+
resolved "https://registry.yarnpkg.com/query-string/-/query-string-6.13.6.tgz#e5ac7c74f2a5da43fbca0b883b4f0bafba439966"
|
10893 |
+
integrity sha512-/WWZ7d9na6s2wMEGdVCVgKWE9Rt7nYyNIf7k8xmHXcesPMlEzicWo3lbYwHyA4wBktI2KrXxxZeACLbE84hvSQ==
|
10894 |
+
dependencies:
|
10895 |
+
decode-uri-component "^0.2.0"
|
10896 |
+
split-on-first "^1.0.0"
|
10897 |
+
strict-uri-encode "^2.0.0"
|
10898 |
+
|
10899 |
query-string@^6.8.2:
|
10900 |
version "6.13.5"
|
10901 |
resolved "https://registry.yarnpkg.com/query-string/-/query-string-6.13.5.tgz#99e95e2fb7021db90a6f373f990c0c814b3812d8"
|
13652 |
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee"
|
13653 |
integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==
|
13654 |
|
13655 |
+
uuid@^8.3.1:
|
13656 |
+
version "8.3.1"
|
13657 |
+
resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.1.tgz#2ba2e6ca000da60fce5a196954ab241131e05a31"
|
13658 |
+
integrity sha512-FOmRr+FmWEIG8uhZv6C2bTgEVXsHk08kE7mPlrBbEe+c3r9pjceVPgupIfNIhc4yx55H69OXANrUaSuu9eInKg==
|
13659 |
+
|
13660 |
v8-compile-cache@^2.0.3, v8-compile-cache@^2.1.1:
|
13661 |
version "2.1.1"
|
13662 |
resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.1.1.tgz#54bc3cdd43317bca91e35dcaf305b1a7237de745"
|