Skip to content

Commit

Permalink
The generate cache feature should pass the Tailwind CSS version
Browse files Browse the repository at this point in the history
  • Loading branch information
suabahasa committed Dec 12, 2024
1 parent 53b8c47 commit 73dcfef
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 14 deletions.
2 changes: 1 addition & 1 deletion assets/integration/breakdance/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ logger('Loading...');
await import('./modules/generate-cache/main.js');

// tailwindcss-v4
if (Number(bdeIframe.contentWindow.windpress?._tailwind_version) === 4) {
if (Number(bdeIframe.contentWindow.windpress?._tailwindcss_version) === 4) {
await import('./modules/variable-picker/main.js');
}

Expand Down
4 changes: 3 additions & 1 deletion assets/integration/breakdance/modules/generate-cache/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*/

import { logger } from '@/integration/common/logger';
import { bdeIframe } from '@/integration/breakdance/constant.js';

const channel = new BroadcastChannel('windpress');

Expand All @@ -24,7 +25,8 @@ const channel = new BroadcastChannel('windpress');
target: 'windpress/dashboard',
task: 'windpress.generate-cache',
payload: {
force_pull: true
force_pull: true,
tailwindcss_version: Number(bdeIframe.contentWindow.windpress?._tailwindcss_version)
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion assets/integration/bricks/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ logger('Loading...');
await import('./modules/generate-cache/main.js');

// tailwindcss-v4
if (Number(brxIframe.contentWindow.windpress?._tailwind_version) === 4) {
if (Number(brxIframe.contentWindow.windpress?._tailwindcss_version) === 4) {
await import('./modules/color-palette/main.js');
await import('./modules/variables/main.js');
await import('./modules/variable-picker/main.js');
Expand Down
5 changes: 3 additions & 2 deletions assets/integration/bricks/modules/generate-cache/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

import { logger } from '@/integration/common/logger';
import { settingsState } from '@/integration/bricks/constant.js';
import { settingsState, brxIframe } from '@/integration/bricks/constant.js';

const channel = new BroadcastChannel('windpress');

Expand Down Expand Up @@ -38,7 +38,8 @@ const channel = new BroadcastChannel('windpress');
target: 'windpress/dashboard',
task: 'windpress.generate-cache',
payload: {
force_pull: true
force_pull: true,
tailwindcss_version: Number(brxIframe.contentWindow.windpress?._tailwindcss_version)
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion assets/integration/builderius/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ logger('Loading...');
await import('./modules/generate-cache/main.js');

// tailwindcss-v4
if (Number(uniIframe.contentWindow.windpress?._tailwind_version) === 4) {
if (Number(uniIframe.contentWindow.windpress?._tailwindcss_version) === 4) {
await import('./modules/monaco/main.js');
await import('./modules/variable-picker/main.js');
}
Expand Down
4 changes: 3 additions & 1 deletion assets/integration/builderius/modules/generate-cache/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*/

import { logger } from '@/integration/common/logger';
import { uniIframe } from '@/integration/builderius/constant.js';

const channel = new BroadcastChannel('windpress');

Expand Down Expand Up @@ -35,7 +36,8 @@ const channel = new BroadcastChannel('windpress');
target: 'windpress/dashboard',
task: 'windpress.generate-cache',
payload: {
force_pull: true
force_pull: true,
tailwindcss_version: Number(uniIframe.contentWindow.windpress?._tailwindcss_version)
}
});
}
Expand Down
5 changes: 5 additions & 0 deletions assets/integration/livecanvas/constant.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const previewIframe = document.getElementById('previewiframe');

export {
previewIframe
};
4 changes: 3 additions & 1 deletion assets/integration/livecanvas/modules/generate-cache/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*/

import { logger } from '@/integration/common/logger';
import { previewIframe } from '@/integration/livecanvas/constant.js';

const channel = new BroadcastChannel('windpress');

Expand All @@ -31,7 +32,8 @@ const channel = new BroadcastChannel('windpress');
target: 'windpress/dashboard',
task: 'windpress.generate-cache',
payload: {
force_pull: true
force_pull: true,
tailwindcss_version: Number(previewIframe.contentWindow.windpress?._tailwindcss_version)
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion assets/integration/oxygen/editor/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ logger('Loading...');
await import('./modules/generate-cache/main.js');

// tailwindcss-v4
if (Number(oxyIframe.contentWindow.windpress?._tailwind_version) === 4) {
if (Number(oxyIframe.contentWindow.windpress?._tailwindcss_version) === 4) {
await import('./modules/variable-picker/main.js');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

import { logger } from '@/integration/common/logger';
import { iframeScope } from "@/integration/oxygen/editor/constant.js";
import { iframeScope, oxyIframe } from "@/integration/oxygen/editor/constant.js";

const channel = new BroadcastChannel('windpress');

Expand All @@ -22,7 +22,8 @@ iframeScope.allSaved = function () {
target: 'windpress/dashboard',
task: 'windpress.generate-cache',
payload: {
force_pull: true
force_pull: true,
tailwindcss_version: Number(oxyIframe.contentWindow.windpress?._tailwindcss_version)
}
});
};
Expand Down
5 changes: 3 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,12 @@ Free version 1.**0**.4
Pro version 1.**1**.4

= unreleased =
* **Fix**: [Gutenberg] The CSS class field autofocusing issue on the block editor
* **Fix**: [Gutenberg] The CSS class field autofocusing issue on the block editor
* **Fix**: [Gutenberg, Breakdance, Bricks, Builderius, LiveCanvas, Oxygen] The generate cache on save feature doesn't use the selected Tailwind CSS version

= 3.2.21 =
* **New**: Upgraded to Tailwind CSS v4 (4.0.0-beta.6 next)
* **Fix**: [Breakdance] Editor style is mixed with admin-bar style (margin-top).
* **Fix**: [Breakdance] Editor style is mixed with admin-bar style (margin-top)

= 3.2.20 =
* **Fix**: [Gutenberg, Breakdance, Bricks, Oxygen] The hover preview feature is too late to disappear when the mouse is moved away from the class name
Expand Down
2 changes: 1 addition & 1 deletion src/Core/Runtime.php
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ public function assets_metadata()
{
$metadata = [
'_version' => WIND_PRESS::VERSION,
'_tailwind_version' => static::tailwindcss_version(),
'_tailwindcss_version' => static::tailwindcss_version(),
'_via_wp_org' => ! Common::is_updater_library_available(),
'is_ubiquitous' => $this->is_ubiquitous_panel(),
'assets' => [
Expand Down

0 comments on commit 73dcfef

Please sign in to comment.