@braincrew-lab/langchain-canvas 0.1.13 → 0.2.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/dist/styles.css CHANGED
@@ -212,6 +212,16 @@
212
212
  .cv-body--flush { padding: 0; overflow: hidden; }
213
213
  .cv-fallback { color: var(--cv-muted); font-size: 14px; }
214
214
 
215
+ /* Browsing an old version: a preview, not an editing surface. Interaction is
216
+ blocked wholesale — renderers patch by artifact id, so edits made "in the
217
+ past" would silently overwrite the live version. */
218
+ .cv-body--history > :not(.cv-history-note) { pointer-events: none; user-select: none; }
219
+ .cv-history-note {
220
+ position: sticky; top: 0; z-index: 5; margin-bottom: 12px;
221
+ padding: 6px 12px; border-radius: 8px; font-size: 12.5px; font-weight: 600;
222
+ color: var(--cv-muted); background: var(--cv-surface); border: 1px solid var(--cv-border);
223
+ }
224
+
215
225
  /* --- inline editing (document / table / slides) ------------------------------- */
216
226
 
217
227
  .cv-edit-toolbar { display: flex; justify-content: flex-end; margin-bottom: 10px; }
@@ -404,6 +414,23 @@
404
414
  .cv-sheet-tools__filter { min-width: 96px; max-width: 160px; }
405
415
  .cv-sheet-tools__sort:focus, .cv-sheet-tools__filter:focus { outline: none; border-color: var(--cv-accent); }
406
416
  .cv-sheet-tools__hint { margin-left: auto; font-size: 11px; color: var(--cv-muted); }
417
+
418
+ /* selection formatting cluster — reads as one tight group between separators */
419
+ .cv-sheet-tools__fmt { display: inline-flex; align-items: center; gap: 3px; }
420
+ .cv-sheet-tools__fmt button:disabled,
421
+ .cv-sheet-tools button:disabled { opacity: 0.4; cursor: default; }
422
+ .cv-sheet-tools button:disabled:hover { border-color: var(--cv-border); color: var(--cv-text); }
423
+ .cv-sheet-tools__bold, .cv-sheet-tools__align { width: 28px; padding: 4px 0 !important; text-align: center; }
424
+ .cv-sheet-tools__bold--on,
425
+ .cv-sheet-tools__freeze--on {
426
+ background: var(--cv-accent-weak) !important; border-color: var(--cv-accent) !important;
427
+ color: var(--cv-accent) !important;
428
+ }
429
+ .cv-sheet-tools__color {
430
+ width: 28px; height: 26px; padding: 2px; border: 1px solid var(--cv-border);
431
+ border-radius: 6px; background: var(--cv-bg); cursor: pointer;
432
+ }
433
+ .cv-sheet-tools__color:disabled { opacity: 0.4; cursor: default; }
407
434
  .cv-sheet { position: relative; width: 100%; flex: 1; height: auto; min-height: 0; }
408
435
  .cv-sheet .fortune-container { height: 100% !important; width: 100% !important; }
409
436
  .cv-sheet--empty { display: grid; place-items: center; height: 200px; color: var(--cv-muted); font-size: 14px; }
@@ -613,6 +640,31 @@
613
640
  .cv-free__fmt input[type="number"] { width: 46px; height: 24px; border: 1px solid var(--cv-border); border-radius: 5px; background: var(--cv-bg); color: var(--cv-text); font-size: 12px; padding: 0 4px; }
614
641
  .cv-free__fmt input[type="color"] { width: 26px; height: 24px; padding: 0; border: 1px solid var(--cv-border); border-radius: 5px; background: none; cursor: pointer; }
615
642
 
643
+ /* multi-select: marquee, selection state, floating action bar */
644
+ .cv-free { outline: none; } /* the canvas is focusable for keyboard nudge/shortcuts */
645
+ .cv-free:focus-visible { outline: 2px solid var(--cv-accent); outline-offset: -2px; border-radius: 4px; }
646
+ .cv-free__marquee {
647
+ position: absolute; z-index: 7; pointer-events: none;
648
+ border: 1px solid var(--cv-accent);
649
+ background: color-mix(in srgb, var(--cv-accent) 10%, transparent);
650
+ border-radius: 2px;
651
+ }
652
+ .cv-free__el--selected { outline: 1.5px solid var(--cv-accent); outline-offset: 1px; }
653
+ .cv-free__multibar {
654
+ position: absolute; z-index: 8; transform: translate(-50%, calc(-100% - 8px));
655
+ display: flex; align-items: center; gap: 2px;
656
+ padding: 3px; background: var(--cv-bg); border: 1px solid var(--cv-border);
657
+ border-radius: 8px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.16); cursor: default;
658
+ }
659
+ .cv-free__multibar--below { transform: translate(-50%, 8px); }
660
+ .cv-free__multibar button {
661
+ min-width: 24px; height: 24px; padding: 0 6px; border: none; border-radius: 5px;
662
+ background: transparent; color: var(--cv-text); cursor: pointer; font-size: 12px; white-space: nowrap;
663
+ }
664
+ .cv-free__multibar button:hover { background: var(--cv-surface); }
665
+ .cv-free__multibar button:disabled { opacity: 0.4; cursor: default; background: transparent; }
666
+ .cv-free__multibar-del:hover { background: #fee2e2 !important; color: #dc2626; }
667
+
616
668
  /* toolbar: background swatch + present button */
617
669
  .cv-deck__bg input[type="color"] {
618
670
  width: 30px; height: 30px; padding: 0;
@@ -656,6 +708,22 @@
656
708
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.08);
657
709
  border-radius: 10px; padding: 12px 16px; cursor: default; white-space: pre-wrap;
658
710
  }
711
+ /* Deck progress: a hairline track pinned to the bottom edge, plus a counter chip. */
712
+ .cv-present__progress {
713
+ position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
714
+ background: rgba(255, 255, 255, 0.08);
715
+ }
716
+ .cv-present__progress-fill {
717
+ height: 100%; background: var(--cv-accent);
718
+ transition: width 0.28s ease;
719
+ }
720
+ @media (prefers-reduced-motion: reduce) { .cv-present__progress-fill { transition: none; } }
721
+ .cv-present__count {
722
+ position: absolute; top: 16px; right: 20px;
723
+ color: #9aa4b2; font-size: 13px; font-variant-numeric: tabular-nums;
724
+ background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.08);
725
+ border-radius: 999px; padding: 3px 10px; cursor: default;
726
+ }
659
727
 
660
728
  /* in-place editing cues */
661
729
  .cv-word .cv-doc { cursor: text; }
@@ -840,6 +908,49 @@
840
908
  .cv-html-act:hover { background: var(--cv-surface); }
841
909
  .cv-html-act--del:hover { background: #fee2e2; color: #dc2626; border-color: #fecaca; }
842
910
  .cv-html-bar__spacer { flex: 1; }
911
+
912
+ /* ── Unified, polished toolbar controls ─────────────────────────────────────────
913
+ One button language across every renderer: a consistent 8px radius, a hairline
914
+ of depth, a soft hover lift, a tactile press, and a real focus ring. */
915
+ .cv-html-add, .cv-html-tpl, .cv-html-act, .cv-deck__toolbar button, .cv-edit-btn,
916
+ .cv-sheet-tools button, .cv-doc-bar button {
917
+ border-radius: 8px;
918
+ font-weight: 500;
919
+ box-shadow: 0 1px 0 rgba(17, 17, 26, 0.02);
920
+ transition: background 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease, color 0.14s ease, transform 0.06s ease;
921
+ }
922
+ .cv-html-add:hover, .cv-html-tpl:hover, .cv-html-act:hover,
923
+ .cv-deck__toolbar button:hover:not(:disabled), .cv-edit-btn:hover,
924
+ .cv-sheet-tools button:hover, .cv-doc-bar button:hover {
925
+ background: var(--cv-surface);
926
+ border-color: color-mix(in srgb, var(--cv-text) 22%, var(--cv-border));
927
+ color: var(--cv-text);
928
+ box-shadow: 0 1px 3px rgba(17, 17, 26, 0.07);
929
+ }
930
+ .cv-html-add:active, .cv-html-tpl:active, .cv-html-act:active,
931
+ .cv-deck__toolbar button:active, .cv-edit-btn:active,
932
+ .cv-sheet-tools button:active, .cv-doc-bar button:active { transform: translateY(0.5px); }
933
+ .cv-html-add:focus-visible, .cv-html-tpl:focus-visible, .cv-html-act:focus-visible,
934
+ .cv-deck__toolbar button:focus-visible, .cv-edit-btn:focus-visible,
935
+ .cv-sheet-tools button:focus-visible, .cv-doc-bar button:focus-visible,
936
+ .cv-html-seg button:focus-visible {
937
+ outline: 2px solid color-mix(in srgb, var(--cv-accent) 48%, transparent);
938
+ outline-offset: 1px;
939
+ }
940
+ /* Segmented controls (Design/Code · device preview) */
941
+ .cv-html-seg { border-radius: 8px; box-shadow: 0 1px 0 rgba(17, 17, 26, 0.02); }
942
+ .cv-html-seg button { font-weight: 500; transition: background 0.14s ease, color 0.14s ease; }
943
+ .cv-html-seg button:hover:not(.is-on) { background: var(--cv-surface); }
944
+ .cv-html-seg button.is-on { box-shadow: inset 0 -1.5px 0 color-mix(in srgb, #000 16%, var(--cv-accent)); }
945
+ /* Primary actions (Present · chart done) get a little lift and gloss */
946
+ .cv-edit-btn.is-primary, .cv-deck__present {
947
+ box-shadow: 0 1px 2px rgba(99, 102, 241, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.18);
948
+ }
949
+ .cv-edit-btn.is-primary:hover, .cv-deck__present:hover {
950
+ background: color-mix(in srgb, #000 8%, var(--cv-accent)) !important;
951
+ border-color: transparent;
952
+ box-shadow: 0 2px 6px rgba(99, 102, 241, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.18);
953
+ }
843
954
  .cv-html-stage {
844
955
  flex: 1; min-height: 0; overflow: auto; display: flex; justify-content: center;
845
956
  padding: 10px; background: var(--cv-surface); border-radius: 10px;
@@ -1043,6 +1154,36 @@
1043
1154
  color: var(--cv-muted);
1044
1155
  }
1045
1156
 
1157
+ /* --- PDF viewer ---------------------------------------------------------------- */
1158
+
1159
+ /* Fills the flush body outright — `flex: 1` alone collapsed the iframe to its
1160
+ content height (a thin strip of page) because `.cv-body` is a block, not a
1161
+ flex container. */
1162
+ .cv-pdf-panel { display: flex; flex-direction: column; height: 100%; min-height: 480px; }
1163
+ .cv-pdf-tools {
1164
+ display: flex; align-items: center; gap: 6px; padding: 6px 10px;
1165
+ border-bottom: 1px solid var(--cv-border); background: var(--cv-bg); flex: 0 0 auto;
1166
+ }
1167
+ .cv-pdf-tools button {
1168
+ font-size: 12px; font-weight: 600; padding: 4px 10px; border: 1px solid var(--cv-border);
1169
+ border-radius: 6px; background: var(--cv-bg); color: var(--cv-text); cursor: pointer;
1170
+ }
1171
+ .cv-pdf-tools button:hover { border-color: var(--cv-accent); color: var(--cv-accent); }
1172
+ .cv-pdf-tools__name {
1173
+ font-size: 12px; font-weight: 600; color: var(--cv-muted);
1174
+ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 55%;
1175
+ }
1176
+ .cv-pdf-tools__spacer { flex: 1; }
1177
+ .cv-pdf-tools__sep { width: 1px; height: 18px; background: var(--cv-border); margin: 0 2px; }
1178
+ .cv-pdf-tools__zoom { display: inline-flex; align-items: center; gap: 3px; }
1179
+ .cv-pdf-tools__zoom button { min-width: 26px; }
1180
+ .cv-pdf-tools__zoom-label {
1181
+ min-width: 52px; font-variant-numeric: tabular-nums; color: var(--cv-muted);
1182
+ }
1183
+ .cv-pdf { position: relative; flex: 1; min-height: 0; background: var(--cv-surface); }
1184
+ .cv-pdf__frame { display: block; width: 100%; height: 100%; border: 0; }
1185
+ .cv-pdf--empty { display: grid; place-items: center; min-height: 200px; color: var(--cv-muted); }
1186
+
1046
1187
  /* --- inline artifact card (for the transcript) -------------------------------- */
1047
1188
 
1048
1189
  .cv-card {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@braincrew-lab/langchain-canvas",
3
- "version": "0.1.13",
3
+ "version": "0.2.0",
4
4
  "description": "A live canvas for LangChain agents — stream documents, charts, and rich artifacts into a React panel.",
5
5
  "license": "MIT",
6
6
  "type": "module",