From 156b11799577525cf9c9e5918d275ebde2d1f89e Mon Sep 17 00:00:00 2001
From: Francois Xavier Lemieux <flemieux@coldfrontlabs.ca>
Date: Wed, 16 Apr 2025 20:02:03 +0000
Subject: [PATCH] fix(plugin): enable ckeditor5's table and table cell
 properties for responsive table

---
 ckeditor_responsive_table.ckeditor5.yml | 38 +++++++++++++++++++++++++
 css/responsiveTableStyles.css           | 12 ++++++++
 2 files changed, 50 insertions(+)

diff --git a/ckeditor_responsive_table.ckeditor5.yml b/ckeditor_responsive_table.ckeditor5.yml
index 73739c4..740c528 100644
--- a/ckeditor_responsive_table.ckeditor5.yml
+++ b/ckeditor_responsive_table.ckeditor5.yml
@@ -53,3 +53,41 @@ ckeditor_responsive_table_custom:
       - <tfoot>
       - <caption>
       - <caption class>
+ckeditor_responsive_table_properties:
+  ckeditor5:
+    plugins:
+        - table.TableProperties
+    config:
+      table:
+        contentToolbar: [tableProperties]
+  drupal:
+    label: Table properties
+    library: ckeditor_responsive_table/responsive_table
+    conditions:
+      plugins:
+          - ckeditor_responsive_table_custom
+          # When arbitrary HTML is already allowed, it's harmless to enable CKEditor 5's UI for table properties.
+          - ckeditor5_arbitraryHtmlSupport
+    elements:
+        - <table style>
+
+ckeditor_responsive_table_cell_properties:
+  ckeditor5:
+    plugins:
+        - table.TableCellProperties
+    config:
+      table:
+        contentToolbar: [tableCellProperties]
+  drupal:
+    label: Table cell properties
+    library: ckeditor_responsive_table/responsive_table
+    conditions:
+      plugins:
+          - ckeditor_responsive_table_custom
+          # When arbitrary HTML is already allowed, it's harmless to enable CKEditor 5's UI for table cell properties.
+          - ckeditor5_arbitraryHtmlSupport
+    elements:
+        - <td style>
+        - <td rowspan colspan style>
+        - <th style>
+        - <th rowspan colspan style>
diff --git a/css/responsiveTableStyles.css b/css/responsiveTableStyles.css
index 8ab666a..9f9a36e 100644
--- a/css/responsiveTableStyles.css
+++ b/css/responsiveTableStyles.css
@@ -2,3 +2,15 @@ figure.table figcaption.hide-caption,
 figure.table.hide-caption figcaption{
   display: none;
 }
+
+/**
+ * Allow users to specify the background color in all themes.
+ *
+ * (Users can set this using CKEditor 5's optional TableProperties and
+ * TableCellProperties plugins.)
+ */
+.ck tr,
+.ck th,
+.ck td {
+  background-color: transparent;
+}
-- 
GitLab