smeditor 0.3.0 → 0.3.4

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.
@@ -310,7 +310,7 @@
310
310
  /* Color swatch grid inside the color-picker dropdowns */
311
311
  .smeditor-color-grid {
312
312
  display: grid;
313
- grid-template-columns: repeat(8, 1fr);
313
+ grid-template-columns: repeat(10, 22px);
314
314
  gap: 4px;
315
315
  padding: 6px;
316
316
  }
@@ -1202,6 +1202,145 @@
1202
1202
  }
1203
1203
  }
1204
1204
 
1205
+ /* ===========================================================================
1206
+ * Colour pickers — current-colour indicator and labelled panel
1207
+ * ======================================================================== */
1208
+
1209
+ .smeditor-color-trigger {
1210
+ display: inline-flex;
1211
+ flex-direction: column;
1212
+ align-items: center;
1213
+ gap: 1px;
1214
+ }
1215
+
1216
+ .smeditor-color-trigger__bar {
1217
+ display: block;
1218
+ width: 14px;
1219
+ height: 3px;
1220
+ border-radius: 1px;
1221
+ }
1222
+
1223
+ .smeditor-color-trigger__bar[data-empty="true"] {
1224
+ background: transparent;
1225
+ box-shadow: inset 0 0 0 1px var(--sme-color-border-strong);
1226
+ }
1227
+
1228
+ .smeditor-color-trigger__bar[data-empty="false"] {
1229
+ box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
1230
+ }
1231
+
1232
+ .smeditor-dropdown--color .smeditor-dropdown__menu {
1233
+ min-width: 0;
1234
+ max-width: none;
1235
+ }
1236
+
1237
+ .smeditor-color-panel {
1238
+ display: flex;
1239
+ flex-direction: column;
1240
+ gap: 6px;
1241
+ padding: 4px;
1242
+ }
1243
+
1244
+ .smeditor-color-panel .smeditor-color-grid {
1245
+ padding: 0;
1246
+ }
1247
+
1248
+ .smeditor-color-panel__title {
1249
+ font-size: 11px;
1250
+ font-weight: 600;
1251
+ letter-spacing: 0.04em;
1252
+ text-transform: uppercase;
1253
+ color: var(--sme-color-text-muted);
1254
+ }
1255
+
1256
+ .smeditor-color-panel__widths {
1257
+ display: flex;
1258
+ gap: 4px;
1259
+ }
1260
+
1261
+ .smeditor-color-panel__chip,
1262
+ .smeditor-color-panel__clear {
1263
+ appearance: none;
1264
+ font: inherit;
1265
+ font-size: var(--sme-text-sm);
1266
+ color: var(--sme-color-text);
1267
+ background: transparent;
1268
+ border: 1px solid var(--sme-color-border);
1269
+ border-radius: var(--sme-radius-sm);
1270
+ padding: 5px 8px;
1271
+ cursor: pointer;
1272
+ }
1273
+
1274
+ .smeditor-color-panel__chip {
1275
+ flex: 1 1 0;
1276
+ white-space: nowrap;
1277
+ }
1278
+
1279
+ .smeditor-color-panel__chip:hover,
1280
+ .smeditor-color-panel__clear:hover {
1281
+ background: var(--sme-color-surface-muted);
1282
+ }
1283
+
1284
+ .smeditor-color-panel__chip.is-active {
1285
+ color: var(--sme-color-accent);
1286
+ background: var(--sme-color-accent-soft);
1287
+ border-color: var(--sme-color-accent);
1288
+ }
1289
+
1290
+ .smeditor-color-panel__clear:disabled {
1291
+ opacity: 0.45;
1292
+ cursor: not-allowed;
1293
+ }
1294
+
1295
+ .smeditor-color-panel__clear:disabled:hover {
1296
+ background: transparent;
1297
+ }
1298
+
1299
+ /* Value pickers show the current value (font / size / spacing) */
1300
+ .smeditor-dropdown__label--text {
1301
+ max-width: 96px;
1302
+ overflow: hidden;
1303
+ text-overflow: ellipsis;
1304
+ white-space: nowrap;
1305
+ }
1306
+
1307
+ /* Bubble menu — one row, compact dividers */
1308
+ .smeditor-bubble-menu {
1309
+ flex-wrap: nowrap;
1310
+ white-space: nowrap;
1311
+ }
1312
+
1313
+ .smeditor-bubble-menu .smeditor-toolbar__divider {
1314
+ height: 18px;
1315
+ margin: 0 2px;
1316
+ }
1317
+
1318
+ /* Filled text (extension-background-color). `.smeditor-text-outline` is
1319
+ * the class the 0.3.2 Rails build wrote for the same thing. */
1320
+ .smeditor-editor :where(.smeditor-fill, .smeditor-text-outline),
1321
+ .smeditor-content :where(.smeditor-fill, .smeditor-text-outline) {
1322
+ padding: 0.04em 0.18em;
1323
+ border-radius: 0.22em;
1324
+ -webkit-box-decoration-break: clone;
1325
+ box-decoration-break: clone;
1326
+ }
1327
+
1328
+ /* Colour dot on the "text in outline" chips */
1329
+ .smeditor-color-panel__chip {
1330
+ display: inline-flex;
1331
+ align-items: center;
1332
+ justify-content: center;
1333
+ gap: 6px;
1334
+ }
1335
+ .smeditor-color-panel__chip::before {
1336
+ content: "";
1337
+ width: 10px;
1338
+ height: 10px;
1339
+ border-radius: 50%;
1340
+ background: var(--sme-chip-swatch, conic-gradient(#1a1a1f 0 50%, #ffffff 0));
1341
+ box-shadow: inset 0 0 0 1px var(--sme-color-border-strong);
1342
+ }
1343
+
1205
1344
 
1206
1345
  /* Rails self-contained adapter / style isolation */
1207
1346
  :host {
@@ -13,7 +13,7 @@ module SMEditor
13
13
  module_function
14
14
 
15
15
  # Attributes kept on surviving tags. `style` is included because
16
- # SMEditor serializes color, background, highlight, text stroke,
16
+ # SMEditor serializes color, background, highlight, underline colour, text stroke,
17
17
  # font size, font family and alignment as constrained inline CSS.
18
18
  ALLOWED_ATTRS = %w[
19
19
  href src alt title class style target rel
@@ -111,7 +111,7 @@ module SMEditor
111
111
  case name
112
112
  when "text-align"
113
113
  sanitize_text_align(value)
114
- when "color", "background-color", "background"
114
+ when "color", "background-color", "background", "text-decoration-color"
115
115
  sanitize_color(value)
116
116
  when "font-family"
117
117
  sanitize_font_family(value)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module SMEditor
4
4
  module Rails
5
- VERSION = "0.3.0"
5
+ VERSION = "0.3.4"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smeditor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - SMEditor contributors
@@ -96,7 +96,7 @@ metadata:
96
96
  source_code_uri: https://github.com/sCruze/smeditor/tree/main/gems/smeditor
97
97
  changelog_uri: https://github.com/sCruze/smeditor/blob/main/gems/smeditor/CHANGELOG.md
98
98
  bug_tracker_uri: https://github.com/sCruze/smeditor/issues
99
- documentation_uri: https://rubydoc.info/gems/smeditor/0.3.0
99
+ documentation_uri: https://rubydoc.info/gems/smeditor/0.3.4
100
100
  rubygems_mfa_required: 'true'
101
101
  rdoc_options: []
102
102
  require_paths: