cms-block-editor 1.0.4 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,6 +4,7 @@ A powerful, feature-rich block editor for CMS applications built with Lexical an
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/cms-block-editor.svg)](https://www.npmjs.com/package/cms-block-editor)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
7
+ <img width="1440" height="813" alt="image" src="https://github.com/user-attachments/assets/be60464e-7fd3-4efa-b340-1761b68bfe4f" />
7
8
 
8
9
  ## Features
9
10
 
@@ -13,6 +14,7 @@ A powerful, feature-rich block editor for CMS applications built with Lexical an
13
14
  🖼️ **Images** - Upload, resize, and drag-and-drop images
14
15
  🎥 **Embeds** - YouTube, Facebook, Instagram, Twitter, TikTok, Vimeo, Spotify, SoundCloud
15
16
  🔗 **Links** - Custom link insertion with labels and options
17
+ 📊 **Tables** - Visual table builder with configurable rows/columns and professional styling
16
18
  🎨 **Styling** - Background colors, images, gradients, opacity controls
17
19
  📱 **Responsive** - Mobile-first design with automatic responsive behavior
18
20
  💾 **Export/Import** - HTML and Markdown support
@@ -93,6 +95,7 @@ Read-only renderer for displaying saved content.
93
95
  - **Images**: Upload from computer, resize with 8-point handles, drag-and-drop positioning
94
96
  - **YouTube**: Embed videos with custom sizing
95
97
  - **Embeds**: Support for 8+ platforms with automatic URL detection
98
+ - **Tables**: Visual builder with configurable dimensions, header rows, and professional styling
96
99
 
97
100
  ### Sections
98
101
  10 pre-designed templates:
@@ -249,6 +252,7 @@ Comprehensive guides available:
249
252
  - [Section Editing Guide](./SECTION-EDITING-GUIDE.md)
250
253
  - [Background Image Guide](./BACKGROUND-IMAGE-GUIDE.md)
251
254
  - [Embed Guide](./EMBED-GUIDE.md)
255
+ - [Table Guide](./TABLE-GUIDE.md)
252
256
  - [Responsive Rendering Guide](./RESPONSIVE-RENDERING-GUIDE.md)
253
257
 
254
258
  ## Contributing
package/dist/index.css CHANGED
@@ -2058,6 +2058,247 @@
2058
2058
  width: 100%;
2059
2059
  }
2060
2060
  }
2061
+ .cms-table-plugin {
2062
+ position: relative;
2063
+ display: inline-block;
2064
+ }
2065
+ .cms-table-modal {
2066
+ position: fixed;
2067
+ background: white;
2068
+ border: 1px solid #e0e0e0;
2069
+ border-radius: 12px;
2070
+ box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
2071
+ width: 450px;
2072
+ max-width: 90vw;
2073
+ max-height: 85vh;
2074
+ overflow-y: auto;
2075
+ z-index: 10002;
2076
+ animation: slideDown 0.2s ease-out;
2077
+ top: 50%;
2078
+ left: 50%;
2079
+ transform: translate(-50%, -50%);
2080
+ }
2081
+ .cms-table-modal-header {
2082
+ padding: 16px 20px;
2083
+ border-bottom: 1px solid #e0e0e0;
2084
+ background:
2085
+ linear-gradient(
2086
+ 135deg,
2087
+ #667eea 0%,
2088
+ #764ba2 100%);
2089
+ color: white;
2090
+ border-radius: 12px 12px 0 0;
2091
+ font-weight: 600;
2092
+ font-size: 14px;
2093
+ }
2094
+ .cms-table-modal-content {
2095
+ padding: 20px;
2096
+ display: flex;
2097
+ flex-direction: column;
2098
+ gap: 20px;
2099
+ }
2100
+ .cms-table-preview {
2101
+ background: #f8f9fa;
2102
+ padding: 20px;
2103
+ border-radius: 8px;
2104
+ display: flex;
2105
+ flex-direction: column;
2106
+ align-items: center;
2107
+ gap: 12px;
2108
+ }
2109
+ .cms-table-preview-grid {
2110
+ display: flex;
2111
+ flex-direction: column;
2112
+ gap: 2px;
2113
+ background: #dee2e6;
2114
+ border: 2px solid #dee2e6;
2115
+ border-radius: 4px;
2116
+ overflow: hidden;
2117
+ }
2118
+ .cms-table-preview-row {
2119
+ display: flex;
2120
+ gap: 2px;
2121
+ }
2122
+ .cms-table-preview-cell {
2123
+ width: 40px;
2124
+ height: 32px;
2125
+ background: white;
2126
+ transition: background 0.2s;
2127
+ }
2128
+ .cms-table-preview-cell.header {
2129
+ background: #667eea;
2130
+ }
2131
+ .cms-table-preview-label {
2132
+ font-size: 13px;
2133
+ font-weight: 600;
2134
+ color: #495057;
2135
+ }
2136
+ .cms-number-input-group {
2137
+ display: flex;
2138
+ gap: 8px;
2139
+ align-items: center;
2140
+ }
2141
+ .cms-number-button {
2142
+ width: 36px;
2143
+ height: 36px;
2144
+ background: #f8f9fa;
2145
+ border: 2px solid #e0e0e0;
2146
+ border-radius: 6px;
2147
+ font-size: 18px;
2148
+ font-weight: 600;
2149
+ color: #495057;
2150
+ cursor: pointer;
2151
+ transition: all 0.2s;
2152
+ display: flex;
2153
+ align-items: center;
2154
+ justify-content: center;
2155
+ }
2156
+ .cms-number-button:hover {
2157
+ background: #667eea;
2158
+ border-color: #667eea;
2159
+ color: white;
2160
+ }
2161
+ .cms-number-input {
2162
+ flex: 1;
2163
+ padding: 10px 12px;
2164
+ border: 2px solid #e0e0e0;
2165
+ border-radius: 8px;
2166
+ font-size: 14px;
2167
+ color: #2c3e50;
2168
+ text-align: center;
2169
+ font-weight: 600;
2170
+ transition: border-color 0.2s;
2171
+ }
2172
+ .cms-number-input:hover {
2173
+ border-color: #667eea;
2174
+ }
2175
+ .cms-number-input:focus {
2176
+ outline: none;
2177
+ border-color: #667eea;
2178
+ box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
2179
+ }
2180
+ .cms-checkbox-label {
2181
+ display: flex;
2182
+ align-items: center;
2183
+ gap: 10px;
2184
+ cursor: pointer;
2185
+ user-select: none;
2186
+ }
2187
+ .cms-checkbox {
2188
+ width: 20px;
2189
+ height: 20px;
2190
+ cursor: pointer;
2191
+ accent-color: #667eea;
2192
+ }
2193
+ .cms-checkbox-label span {
2194
+ font-size: 14px;
2195
+ color: #2c3e50;
2196
+ font-weight: 500;
2197
+ }
2198
+ .cms-table-presets {
2199
+ background: #f8f9fa;
2200
+ padding: 15px;
2201
+ border-radius: 8px;
2202
+ }
2203
+ .cms-table-presets-title {
2204
+ margin: 0 0 10px 0;
2205
+ font-size: 12px;
2206
+ font-weight: 600;
2207
+ color: #6c757d;
2208
+ text-transform: uppercase;
2209
+ letter-spacing: 0.5px;
2210
+ }
2211
+ .cms-table-preset-buttons {
2212
+ display: grid;
2213
+ grid-template-columns: repeat(4, 1fr);
2214
+ gap: 8px;
2215
+ }
2216
+ .cms-preset-button {
2217
+ padding: 8px 12px;
2218
+ background: white;
2219
+ border: 2px solid #e0e0e0;
2220
+ border-radius: 6px;
2221
+ font-size: 13px;
2222
+ font-weight: 600;
2223
+ color: #495057;
2224
+ cursor: pointer;
2225
+ transition: all 0.2s;
2226
+ }
2227
+ .cms-preset-button:hover {
2228
+ background: #667eea;
2229
+ border-color: #667eea;
2230
+ color: white;
2231
+ transform: translateY(-1px);
2232
+ }
2233
+ .cms-editor-content table {
2234
+ border-collapse: collapse;
2235
+ width: 100%;
2236
+ margin: 20px 0;
2237
+ border: 1px solid #dee2e6;
2238
+ border-radius: 8px;
2239
+ overflow: hidden;
2240
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
2241
+ }
2242
+ .cms-editor-content th,
2243
+ .cms-editor-content td {
2244
+ border: 1px solid #dee2e6;
2245
+ padding: 12px 16px;
2246
+ text-align: left;
2247
+ min-width: 100px;
2248
+ position: relative;
2249
+ }
2250
+ .cms-editor-content th {
2251
+ background: #667eea;
2252
+ color: white;
2253
+ font-weight: 600;
2254
+ font-size: 14px;
2255
+ text-transform: uppercase;
2256
+ letter-spacing: 0.5px;
2257
+ }
2258
+ .cms-editor-content td {
2259
+ background: white;
2260
+ font-size: 14px;
2261
+ color: #2c3e50;
2262
+ }
2263
+ .cms-editor-content tr:nth-child(even) td {
2264
+ background: #f8f9fa;
2265
+ }
2266
+ .cms-editor-content tr:hover td {
2267
+ background: #e9ecef;
2268
+ }
2269
+ .cms-editor-content td:focus,
2270
+ .cms-editor-content th:focus {
2271
+ outline: 2px solid #667eea;
2272
+ outline-offset: -2px;
2273
+ background: #fff;
2274
+ }
2275
+ .cms-editor-content .TableNode__cell--selected {
2276
+ background: rgba(102, 126, 234, 0.1) !important;
2277
+ outline: 2px solid #667eea;
2278
+ outline-offset: -2px;
2279
+ }
2280
+ @media (max-width: 768px) {
2281
+ .cms-table-modal {
2282
+ width: 90vw;
2283
+ max-width: 400px;
2284
+ }
2285
+ .cms-table-preview-cell {
2286
+ width: 32px;
2287
+ height: 28px;
2288
+ }
2289
+ .cms-table-preset-buttons {
2290
+ grid-template-columns: repeat(2, 1fr);
2291
+ }
2292
+ }
2293
+ @media (max-width: 480px) {
2294
+ .cms-table-modal {
2295
+ width: 95vw;
2296
+ }
2297
+ .cms-table-preview-cell {
2298
+ width: 28px;
2299
+ height: 24px;
2300
+ }
2301
+ }
2061
2302
 
2062
2303
  /* src/styles/renderer.css */
2063
2304
  .cms-renderer {
@@ -2630,4 +2871,80 @@
2630
2871
  height: 250px;
2631
2872
  }
2632
2873
  }
2874
+ .cms-renderer-content table {
2875
+ border-collapse: collapse;
2876
+ width: 100%;
2877
+ margin: 20px 0;
2878
+ border: 1px solid #dee2e6;
2879
+ border-radius: 8px;
2880
+ overflow: hidden;
2881
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
2882
+ background: white;
2883
+ }
2884
+ .cms-renderer-content th,
2885
+ .cms-renderer-content td {
2886
+ border: 1px solid #dee2e6;
2887
+ padding: 12px 16px;
2888
+ text-align: left;
2889
+ }
2890
+ .cms-renderer-content th {
2891
+ background: #667eea;
2892
+ color: white;
2893
+ font-weight: 600;
2894
+ font-size: 14px;
2895
+ text-transform: uppercase;
2896
+ letter-spacing: 0.5px;
2897
+ }
2898
+ .cms-renderer-content td {
2899
+ background: white;
2900
+ font-size: 14px;
2901
+ color: #2c3e50;
2902
+ }
2903
+ .cms-renderer-content tr:nth-child(even) td {
2904
+ background: #f8f9fa;
2905
+ }
2906
+ .cms-renderer-content tr:hover td {
2907
+ background: #e9ecef;
2908
+ transition: background 0.2s;
2909
+ }
2910
+ @media (max-width: 768px) {
2911
+ .cms-renderer-content table {
2912
+ display: block;
2913
+ overflow-x: auto;
2914
+ white-space: nowrap;
2915
+ -webkit-overflow-scrolling: touch;
2916
+ }
2917
+ .cms-renderer-content th,
2918
+ .cms-renderer-content td {
2919
+ padding: 10px 12px;
2920
+ font-size: 13px;
2921
+ }
2922
+ }
2923
+ @media (max-width: 480px) {
2924
+ .cms-renderer-content th,
2925
+ .cms-renderer-content td {
2926
+ padding: 8px 10px;
2927
+ font-size: 12px;
2928
+ }
2929
+ }
2930
+ @media (prefers-color-scheme: dark) {
2931
+ .cms-renderer-content table {
2932
+ border-color: #3e3e3e;
2933
+ background: #2a2a2a;
2934
+ }
2935
+ .cms-renderer-content th {
2936
+ background: #667eea;
2937
+ }
2938
+ .cms-renderer-content td {
2939
+ background: #2a2a2a;
2940
+ color: #e0e0e0;
2941
+ border-color: #3e3e3e;
2942
+ }
2943
+ .cms-renderer-content tr:nth-child(even) td {
2944
+ background: #333;
2945
+ }
2946
+ .cms-renderer-content tr:hover td {
2947
+ background: #3a3a3a;
2948
+ }
2949
+ }
2633
2950
  /*# sourceMappingURL=index.css.map */