@bendyline/squisq-editor-react 0.1.1 → 1.0.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bendyline/squisq-editor-react",
3
- "version": "0.1.1",
3
+ "version": "1.0.0",
4
4
  "description": "React editor shell with raw/WYSIWYG/preview modes for Squisq documents",
5
5
  "license": "MIT",
6
6
  "author": "Bendyline",
@@ -46,8 +46,8 @@
46
46
  "react-dom": "^18.0.0 || ^19.0.0"
47
47
  },
48
48
  "dependencies": {
49
- "@bendyline/squisq": "^0.1.2",
50
- "@bendyline/squisq-react": "^0.1.3",
49
+ "@bendyline/squisq": "1.0.0",
50
+ "@bendyline/squisq-react": "1.0.0",
51
51
  "@monaco-editor/react": "^4.6.0",
52
52
  "@tiptap/extension-placeholder": "^2.11.0",
53
53
  "@tiptap/extension-table": "^2.11.0",
package/src/Toolbar.tsx CHANGED
@@ -413,52 +413,57 @@ export function Toolbar({ className }: ToolbarProps) {
413
413
  </div>
414
414
 
415
415
  {/* Formatting buttons — hidden in preview mode */}
416
- {!isPreview && <div className="squisq-toolbar-separator" />}
417
- {!isPreview &&
418
- groups.map((group, gi) => (
419
- <div key={group} className="squisq-toolbar-group">
420
- {gi > 0 && <div className="squisq-toolbar-separator" />}
421
- {BUTTONS.filter((b) => b.group === group).map((btn) => {
422
- const active = isWysiwyg ? isTiptapActive(tiptapEditor, btn.id) : false;
423
- return (
424
- <button
425
- key={btn.id}
426
- className={`squisq-toolbar-button${active ? ' squisq-toolbar-button--active' : ''}`}
427
- title={btn.title}
428
- onClick={() => handleAction(btn.id)}
429
- aria-label={btn.title}
430
- aria-pressed={active}
431
- style={btn.iconStyle}
432
- >
433
- {btn.icon}
434
- </button>
435
- );
436
- })}
437
- </div>
438
- ))}
416
+ {!isPreview && (
417
+ <div className="squisq-toolbar-actions">
418
+ {groups.map((group, gi) => (
419
+ <div key={group} className="squisq-toolbar-group">
420
+ {gi > 0 && <div className="squisq-toolbar-separator" />}
421
+ {BUTTONS.filter((b) => b.group === group).map((btn) => {
422
+ const active = isWysiwyg ? isTiptapActive(tiptapEditor, btn.id) : false;
423
+ return (
424
+ <button
425
+ key={btn.id}
426
+ className={`squisq-toolbar-button${active ? ' squisq-toolbar-button--active' : ''}`}
427
+ title={btn.title}
428
+ onClick={() => handleAction(btn.id)}
429
+ aria-label={btn.title}
430
+ aria-pressed={active}
431
+ style={btn.iconStyle}
432
+ >
433
+ {btn.icon}
434
+ </button>
435
+ );
436
+ })}
437
+ </div>
438
+ ))}
439
439
 
440
- {/* Template picker — visible when cursor is in a heading (WYSIWYG) */}
441
- {!isPreview && currentTemplate !== null && (
442
- <>
443
- <div className="squisq-toolbar-separator" />
444
- <div className="squisq-toolbar-group squisq-template-picker">
445
- <label className="squisq-template-picker-label" title="Block template for this heading">
446
- Template:
447
- <select
448
- className="squisq-template-picker-select"
449
- value={currentTemplate}
450
- onChange={(e) => handleTemplatePick(e.target.value)}
451
- >
452
- <option value="">— none —</option>
453
- {templateNames.map((name) => (
454
- <option key={name} value={name}>
455
- {name}
456
- </option>
457
- ))}
458
- </select>
459
- </label>
460
- </div>
461
- </>
440
+ {/* Template picker — visible when cursor is in a heading (WYSIWYG) */}
441
+ {currentTemplate !== null && (
442
+ <>
443
+ <div className="squisq-toolbar-separator" />
444
+ <div className="squisq-toolbar-group squisq-template-picker">
445
+ <label
446
+ className="squisq-template-picker-label"
447
+ title="Block template for this heading"
448
+ >
449
+ Template:
450
+ <select
451
+ className="squisq-template-picker-select"
452
+ value={currentTemplate}
453
+ onChange={(e) => handleTemplatePick(e.target.value)}
454
+ >
455
+ <option value="">— none —</option>
456
+ {templateNames.map((name) => (
457
+ <option key={name} value={name}>
458
+ {name}
459
+ </option>
460
+ ))}
461
+ </select>
462
+ </label>
463
+ </div>
464
+ </>
465
+ )}
466
+ </div>
462
467
  )}
463
468
  </div>
464
469
  );
@@ -57,6 +57,7 @@
57
57
  .squisq-toolbar {
58
58
  display: flex;
59
59
  align-items: center;
60
+ flex-wrap: wrap;
60
61
  padding: 4px 12px;
61
62
  gap: 2px;
62
63
  }
@@ -69,6 +70,12 @@
69
70
  margin-right: 2px;
70
71
  }
71
72
 
73
+ .squisq-toolbar-actions {
74
+ display: flex;
75
+ align-items: center;
76
+ gap: 2px;
77
+ }
78
+
72
79
  .squisq-toolbar-view-tab {
73
80
  padding: 4px 14px;
74
81
  border: none;
@@ -592,3 +599,17 @@
592
599
  background: #374151;
593
600
  color: #e5e7eb;
594
601
  }
602
+
603
+ /* ─── Responsive: toolbar wraps on narrow viewports ──── */
604
+
605
+ @media (max-width: 640px) {
606
+ .squisq-toolbar-view-tabs {
607
+ margin-right: 0;
608
+ }
609
+
610
+ .squisq-toolbar-actions {
611
+ flex-basis: 100%;
612
+ flex-wrap: wrap;
613
+ padding-top: 2px;
614
+ }
615
+ }