@broadpaper/editor 0.2.1 → 0.4.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
@@ -188,7 +188,11 @@
188
188
  .bpe-input--invalid { border-color: var(--bpe-danger) !important; }
189
189
  .bpe-textarea { height: auto; min-height: 56px; padding: 6px 8px; resize: vertical; line-height: 1.45; }
190
190
  .bpe-select { appearance: none; padding-right: 24px; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round'/></svg>"); background-repeat: no-repeat; background-position: right 8px center; }
191
- .bpe-input-group { position: relative; display: flex; align-items: center; }
191
+ /* `width: 100%`, because a flex container sizes to its content and this one holds
192
+ an input. Without it every field with a unit or a suffix — a width in `%`, a
193
+ size in `px` — shrank to about twenty characters and left the rest of the row
194
+ blank, while the plain inputs beside it filled. */
195
+ .bpe-input-group { position: relative; display: flex; align-items: center; width: 100%; }
192
196
  .bpe-input-group .bpe-input { padding-right: 28px; }
193
197
  .bpe-input-group__suffix { position: absolute; right: 8px; font-size: var(--bpe-text-xs); color: var(--bpe-fg-faint); pointer-events: none; }
194
198
  .bpe-input-group__btn { position: absolute; right: 2px; top: 2px; }
@@ -536,14 +540,49 @@
536
540
  .bpe-binding__btn { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; height: var(--bpe-control-h); padding: 0 8px; border: 1px solid var(--bpe-border); border-radius: var(--bpe-radius); background: var(--bpe-bg); text-align: left; font-size: var(--bpe-text-sm); }
537
541
  .bpe-binding__btn:hover { border-color: var(--bpe-border-strong); }
538
542
  .bpe-binding__btn--empty { color: var(--bpe-fg-faint); }
543
+ /* A value the document works out. Shown, named after the fields it reads, and not
544
+ editable where there is no expression editor to edit it with. */
545
+ .bpe-binding__btn--locked { background: var(--bpe-bg-subtle); color: var(--bpe-fg-muted); cursor: default; }
546
+ .bpe-binding__btn--locked:hover { border-color: var(--bpe-border); }
539
547
  .bpe-binding__btn svg { width: 13px; height: 13px; flex-shrink: 0; color: var(--bpe-fg-muted); }
540
548
  .bpe-expr { font-family: var(--bpe-font-mono); font-size: 11px; }
541
549
  .bpe-picker { width: 300px; max-height: 380px; display: flex; flex-direction: column; padding: 0; overflow: hidden; }
550
+ /* Wider when it is holding the calculation builder, which is three controls on a
551
+ row plus a field name. At 300px every one of them truncated — "a total",
552
+ "Total of", "In…" — so the panel read as an interface that had been broken
553
+ rather than one that was cramped. The field list on the other tab is a single
554
+ column and does not need it, but one width for the panel is better than a
555
+ popover that changes size when you change tab. */
556
+ .bpe-picker--wide { width: 420px; max-height: 460px; }
542
557
  .bpe-picker__search { padding: 8px; border-bottom: 1px solid var(--bpe-border); }
543
558
  .bpe-picker__list { flex: 1; overflow-y: auto; padding: 4px; }
544
559
  .bpe-picker__foot { display: flex; gap: 6px; align-items: center; padding: 8px; border-top: 1px solid var(--bpe-border); }
545
560
  .bpe-picker__foot .bpe-input { flex: 1; }
546
561
  .bpe-picker__group { padding: 6px 6px 2px; font-size: var(--bpe-text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--bpe-fg-faint); }
562
+ /* The value panel's two answers: a field, or a value worked out. Shorter than the
563
+ inspector's own tabs because these carry a word rather than a word and an icon. */
564
+ .bpe-picker__tabs { display: flex; gap: 2px; padding: 6px 6px 0; border-bottom: 1px solid var(--bpe-border); }
565
+ .bpe-picker__tabs .bpe-tab { height: 28px; }
566
+
567
+ /* The calculation builder. A column of rows, each reading as part of a sentence,
568
+ and every control allowed to shrink — the properties panel is resizable, so
569
+ anything in it can be squeezed and `min-width: 0` is what keeps the remove
570
+ button inside the panel rather than out through its `overflow: hidden`. */
571
+ .bpe-calc { display: flex; flex-direction: column; gap: 10px; padding: 10px; min-width: 0; }
572
+ /* A step is a labelled block, not a line of controls.
573
+ Three selects and a field name across one row is what made this unreadable:
574
+ every control shrank to its truncation point and the sentence the builder is
575
+ supposed to read as was unrecoverable from the abbreviations. */
576
+ .bpe-calc__step { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 8px; border: 1px solid var(--bpe-border); border-radius: var(--bpe-radius); background: var(--bpe-bg-subtle); }
577
+ .bpe-calc__row { display: flex; align-items: center; gap: 6px; min-width: 0; }
578
+ .bpe-grow { flex: 1 1 auto; }
579
+ .bpe-calc__lead { flex: 0 0 auto; font-size: var(--bpe-text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--bpe-fg-faint); }
580
+ .bpe-calc__row .bpe-select { flex: 1 1 auto; min-width: 0; }
581
+ .bpe-calc__term { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
582
+ .bpe-calc__term .bpe-binding { width: 100%; }
583
+ .bpe-calc__term .bpe-binding__btn { flex: 1 1 auto; min-width: 0; }
584
+ .bpe-calc__term .bpe-input { width: 100%; }
585
+ .bpe-calc__reads { margin: 2px 0 0; padding-top: 8px; border-top: 1px solid var(--bpe-border); font-size: var(--bpe-text-xs); color: var(--bpe-fg-muted); line-height: 1.5; }
547
586
  .bpe-cond { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
548
587
  .bpe-cond__rule { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px; min-width: 0; padding: 6px; border: 1px solid var(--bpe-border); border-radius: var(--bpe-radius); background: var(--bpe-bg-subtle); }
549
588
  .bpe-cond__row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; min-width: 0; }
@@ -555,6 +594,17 @@
555
594
  .bpe-list-editor__head .bpe-truncate { flex: 1 1 0; min-width: 0; }
556
595
  .bpe-list-editor__item { min-width: 0; }
557
596
  .bpe-list-editor__body { padding: 6px 8px 8px; border-top: 1px solid var(--bpe-border); display: flex; flex-direction: column; gap: 6px; }
597
+ /*
598
+ * Inside a list item, every field is stacked.
599
+ *
600
+ * The two-column field — a 96px label and the control beside it — is right in the
601
+ * panel and wrong one level in: the item is already indented and bordered, so the
602
+ * label column eats a third of what is left and the control ends in the middle of
603
+ * the row with the rest blank. Stacked gives the control the whole width, and it
604
+ * matches the fields in there that were already stacked because they needed it.
605
+ */
606
+ .bpe-list-editor__body .bpe-field { grid-template-columns: 1fr; gap: 4px; }
607
+ .bpe-list-editor__body .bpe-field__label { white-space: normal; overflow: visible; }
558
608
  .bpe-list-editor__drag { cursor: grab; color: var(--bpe-fg-faint); display: inline-flex; }
559
609
  .bpe-issue { display: flex; gap: 8px; align-items: flex-start; width: 100%; padding: 6px 8px; border: 0; border-radius: var(--bpe-radius-sm); background: transparent; text-align: left; font-size: var(--bpe-text-sm); color: var(--bpe-fg); }
560
610
  .bpe-issue:hover { background: var(--bpe-bg-muted); }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@broadpaper/editor",
3
- "version": "0.2.1",
3
+ "version": "0.4.0",
4
4
  "description": "BroadPaper visual report designer. Framework-neutral mount API; React inside.",
5
5
  "keywords": [
6
6
  "pdf",
@@ -55,9 +55,9 @@
55
55
  "prosemirror-view": "^1.37.1",
56
56
  "react": "^19.0.0",
57
57
  "react-dom": "^19.0.0",
58
- "@broadpaper/core": "0.2.1",
59
- "@broadpaper/renderer": "0.2.1",
60
- "@broadpaper/blocks": "0.2.1"
58
+ "@broadpaper/blocks": "0.4.0",
59
+ "@broadpaper/core": "0.4.0",
60
+ "@broadpaper/renderer": "0.4.0"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@types/react": "^19.0.2",