diff --git a/content/plugins/datatables.md b/content/plugins/datatables.md index 1bd0b58d..9632af63 100644 --- a/content/plugins/datatables.md +++ b/content/plugins/datatables.md @@ -24,6 +24,7 @@ All examples are responsive, dark mode and RTL support included and by installin Before continuing make sure that you have Tailwind CSS, Flowbite, and Simple Datables in your project. 1. Install Tailwind CSS and follow our }}">quickstart guide to install Flowbite and the official plugin + 2. Set the field `datatables` to the value `true` inside the `tailwind.config.js` file: ```javascript diff --git a/content/plugins/wysiwyg.md b/content/plugins/wysiwyg.md index 5e32c85c..5a959ff2 100644 --- a/content/plugins/wysiwyg.md +++ b/content/plugins/wysiwyg.md @@ -41,7 +41,19 @@ Require the plugin inside the `tailwind.config.js` file: } ``` -3. Finally, install Tip Tap either via NPM or skip this step if you're using CDN: +3. Set the `wysiwyg` field from the Flowbite plugin to `true` to enable pseudo styles: + +```javascript +```javascript +plugins: [ + require('flowbite/plugin')({ + wysiwyg: true, + }), + // ... other plugins +] +``` + +4. Finally, install Tip Tap either via NPM or skip this step if you're using CDN: ```bash npm install @tiptap/core @tiptap/pm @tiptap/starter-kit @@ -1779,6 +1791,11 @@ window.addEventListener('load', function() { document.getElementById('deleteTableButton').addEventListener('click', () => { editor.chain().focus().deleteTable().run(); }); + + // merge cells + document.getElementById('mergeCellsButton').addEventListener('click', () => { + editor.chain().focus().mergeCells().run(); + }); } }) ` >}} @@ -1874,6 +1891,18 @@ window.addEventListener('load', function() { +
+ + +
diff --git a/plugin.js b/plugin.js index 5630ecce..2536aea5 100644 --- a/plugin.js +++ b/plugin.js @@ -15,6 +15,7 @@ module.exports = plugin.withOptions( datatables = false, forms = true, tooltips = true, + wysiwyg = false, } = options; return function ({ addBase, addComponents, theme }) { @@ -529,6 +530,23 @@ module.exports = plugin.withOptions( }); } + if (wysiwyg) { + addComponents({ + '.selectedCell': { + backgroundColor: `${theme( + 'colors.gray.50', + colors.gray[50] + )}`, + }, + '.dark .selectedCell': { + backgroundColor: `${theme( + 'colors.gray.700', + colors.gray[700] + )}`, + }, + }); + } + // datatable styles if (datatables) { addComponents({ @@ -1269,6 +1287,7 @@ module.exports = plugin.withOptions( datatables = false, forms = true, tooltips = true, + wysiwyg = false, } = options; const safelist = [ @@ -1289,6 +1308,7 @@ module.exports = plugin.withOptions( 'shadow-lg', '!bg-gray-50', 'dark:!bg-gray-700', + 'selectedCell', ]; if (charts) { diff --git a/tailwind.config.js b/tailwind.config.js index 39d3c8e8..adf1380e 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -77,6 +77,7 @@ module.exports = { forms: true, tooltips: true, datatables: true, + wysiwyg: true, }), require('flowbite-typography'), ],