Skip to content

Commit 396d299

Browse files
authored
Merge pull request #3872 from reduxframework/update-extendify-tmng798
Update Extendify Library
2 parents 81c883f + c81ca1a commit 396d299

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+1217
-583
lines changed

extendify-sdk/app/Admin.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ public function addScopedScriptsAndStyles()
129129
'sdk_partner' => \esc_attr(APP::$sdkPartner),
130130
'asset_path' => \esc_url(EXTENDIFY_URL . 'public/assets'),
131131
'standalone' => \esc_attr(APP::$standalone),
132+
'devbuild' => \esc_attr(APP::$environment === 'DEVELOPMENT'),
132133
]
133134
);
134135
\wp_enqueue_script(App::$slug . '-scripts');

extendify-sdk/app/App.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class App
8383
*/
8484
public function __construct()
8585
{
86-
if (isset($GLOBALS['extendify_sdk_partner'])) {
86+
if (isset($GLOBALS['extendify_sdk_partner']) && $GLOBALS['extendify_sdk_partner']) {
8787
self::$sdkPartner = $GLOBALS['extendify_sdk_partner'];
8888
}
8989

extendify-sdk/app/Controllers/UserController.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,17 @@ public static function store($request)
5555
return new \WP_REST_Response(User::state());
5656
}
5757

58+
/**
59+
* Delete the data
60+
*
61+
* @return array
62+
*/
63+
public static function delete()
64+
{
65+
\delete_user_meta(\get_current_user_id(), 'extendifysdk_user_data');
66+
return new \WP_REST_Response(User::state());
67+
}
68+
5869
/**
5970
* Sign up the user to the mailing list.
6071
*

extendify-sdk/jsconfig.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"compilerOptions": {
3+
"baseUrl": "./",
4+
"paths": {
5+
"@extendify/*": ["src/*"]
6+
}
7+
}
8+
}

extendify-sdk/loader.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ function extendifyCheckPluginInstalled($name)
2121
include_once ABSPATH . 'wp-admin/includes/plugin.php';
2222
}
2323

24-
foreach (get_plugins() as $plugin => $data) {
24+
$plugins = get_plugins();
25+
// Don't cache plugins this early.
26+
wp_cache_delete('plugins', 'plugins');
27+
foreach ($plugins as $plugin => $data) {
2528
if ($data['TextDomain'] === $name) {
2629
return $plugin;
2730
}
@@ -37,7 +40,7 @@ function extendifyCheckPluginInstalled($name)
3740
// Remember, this file is only loaded by partner plugins.
3841
if (is_plugin_active($extendifyPluginName)) {
3942
// If the SDK is active then ignore the partner plugins.
40-
$GLOBALS['extendify_sdk_partner'] = '';
43+
$GLOBALS['extendify_sdk_partner'] = 'standalone';
4144
return false;
4245
}
4346
}

extendify-sdk/public/build/extendify.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

extendify-sdk/public/build/extendify.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

extendify-sdk/readme.txt

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1-
=== Extendify ===
1+
=== Extendify — Gutenberg Patterns and Templates ===
22
Contributors: extendify, richtabor, kbat82, clubkert, arturgrabo
3-
Tags: page builder, editor, patterns, drag-and-drop, blocks, visual editor, wysiwyg, design, website builder, landing page builder, front-end builder
3+
Tags: templates, patterns, layouts, blocks, gutenberg
44
Requires at least: 5.4
55
Tested up to: 5.9.0
6-
Stable tag: 0.4.0
6+
Stable tag: 0.6.0
77
Requires PHP: 5.6
88
License: GPLv2
99
License URI: https://www.gnu.org/licenses/gpl-2.0.html
1010

11+
The best WordPress templates, pattern, and layout library with 1,000+ designs built for the Gutenberg block editor.
12+
13+
== Description ==
14+
1115
Extendify is the platform of site design and creation tools for people that want to build a beautiful WordPress website with a library of patterns and full page layouts for the Gutenberg block editor.
1216

1317
Make a beautiful WordPress website easier and faster than ever before with Extendify's library of Gutenberg block patterns, templates, and page layouts for Gutenberg.
@@ -120,6 +124,17 @@ Nope! Extendify imports lightweight block-based content that is served directly
120124

121125
== Changelog ==
122126

127+
= 0.6.0 - 2022-03-08 =
128+
- Add new design categories
129+
- Add ability to open library via search param
130+
- Tweak get_plugins call to not cache results
131+
- Improve toolbar on mobile
132+
133+
= 0.5.0 - 2022-02-22 =
134+
- Add support for inverted style patterns
135+
- Improve library loading time
136+
- Add pattern library variants to open the library
137+
123138
= 0.4.0 - 2022-02-08 =
124139
- Enhance layout view with autoscroll
125140
- Improve modal layout design consistency

extendify-sdk/routes/api.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ function () {
3131

3232
ApiRouter::get('/user', [UserController::class, 'show']);
3333
ApiRouter::post('/user', [UserController::class, 'store']);
34+
ApiRouter::post('/clear-user', [UserController::class, 'delete']);
3435
ApiRouter::get('/user-meta', [UserController::class, 'meta']);
3536
ApiRouter::get('/max-free-imports', [UserController::class, 'maxImports']);
3637

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,50 @@
1-
import { useEffect, useCallback, useState } from '@wordpress/element'
2-
import { useGlobalStore } from './state/GlobalState'
3-
import { useUserStore } from './state/User'
4-
import { useTemplatesStore } from './state/Templates'
5-
import MainWindow from './pages/MainWindow'
6-
import './utility-control'
7-
import useTaxonomies from './hooks/useTaxonomies'
8-
import { General as GeneralApi } from './api/General'
1+
import { useEffect, useCallback } from '@wordpress/element'
2+
import { General as GeneralApi } from '@extendify/api/General'
3+
import MainWindow from '@extendify/pages/MainWindow'
4+
import { useGlobalStore } from '@extendify/state/GlobalState'
5+
import { useTemplatesStore } from '@extendify/state/Templates'
6+
import { useUserStore } from '@extendify/state/User'
7+
import '@extendify/utility-control'
8+
import { useTaxonomyStore } from './state/Taxonomies'
99

1010
export default function ExtendifyLibrary({ show = false }) {
1111
const open = useGlobalStore((state) => state.open)
12+
const setReady = useGlobalStore((state) => state.setReady)
1213
const setOpen = useGlobalStore((state) => state.setOpen)
13-
const [ready, setReady] = useState(false)
1414
const showLibrary = useCallback(() => setOpen(true), [setOpen])
1515
const hideLibrary = useCallback(() => setOpen(false), [setOpen])
1616
const initTemplateData = useTemplatesStore(
1717
(state) => state.initTemplateData,
1818
)
19+
const fetchTaxonomies = useTaxonomyStore((state) => state.fetchTaxonomies)
1920

2021
// When the uuid of the user comes back from the database, we can
2122
// assume that the state object is ready. This is important to check
2223
// as the library may be "open" when loaded, but not ready.
23-
const userStoreReady = useUserStore((state) => state.uuid.length > 0)
24-
const templatesStoreReady = useTemplatesStore(
24+
const userHasHydrated = useUserStore((state) => state._hasHydrated)
25+
const taxonomiesReady = useTemplatesStore(
2526
(state) => Object.keys(state.taxonomyDefaultState).length > 0,
2627
)
27-
useTaxonomies(open)
2828

2929
useEffect(() => {
30-
if (userStoreReady && templatesStoreReady) {
30+
if (!open) return
31+
fetchTaxonomies().then(() => {
32+
useTemplatesStore.getState().setupDefaultTaxonomies()
33+
})
34+
}, [open, fetchTaxonomies])
35+
36+
useEffect(() => {
37+
if (userHasHydrated && taxonomiesReady) {
3138
initTemplateData()
3239
setReady(true)
3340
}
34-
}, [userStoreReady, templatesStoreReady, initTemplateData])
41+
}, [userHasHydrated, taxonomiesReady, initTemplateData, setReady])
3542

3643
useEffect(() => {
37-
show && setOpen(true)
44+
const search = new URLSearchParams(window.location.search)
45+
if (show || search.has('ext-open')) {
46+
setOpen(true)
47+
}
3848
}, [show, setOpen])
3949

4050
useEffect(() => {
@@ -55,8 +65,5 @@ export default function ExtendifyLibrary({ show = false }) {
5565
}
5666
}, [hideLibrary, showLibrary])
5767

58-
if (!ready) {
59-
return null
60-
}
6168
return <MainWindow />
6269
}

0 commit comments

Comments
 (0)