@signalsafe/tree-spec-editor-theme-bootstrap 0.1.0 → 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/README.md CHANGED
@@ -14,8 +14,9 @@ Host apps may keep a thin bridge stylesheet for DeliveryPlus-specific layout, re
14
14
 
15
15
  ## What this package includes
16
16
 
17
- - **Slice 1 (current):** design tokens on `.graph-editor-root`, primitives (buttons, forms, lists, badges, spacing, typography, surfaces, flex), and shell chrome (toolbar, cards, modals, panels, dropdowns, selection).
18
- - **Not included yet:** React Flow / canvas node CSS, choice row layout, aria-label icon bridges, or DeliveryPlus page/read-only/injected-form bridges.
17
+ - **Slice 1:** design tokens on `.graph-editor-root`, primitives (buttons, forms, lists, badges, spacing, typography, surfaces, flex), and shell chrome (toolbar, cards, modals, panels, dropdowns, selection).
18
+ - **Slice 2 (current):** canvas and React Flow styling (`graph-editor-canvas*`, node cards, choice rows, handles).
19
+ - **Not included yet:** aria-label icon bridges or DeliveryPlus page/read-only/injected-form bridges.
19
20
 
20
21
  ## Requirements
21
22
 
@@ -30,4 +31,5 @@ styles.css # public entry (@import chain)
30
31
  src/tokens.css
31
32
  src/primitives/*.css
32
33
  src/shell/*.css
34
+ src/canvas/*.css
33
35
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signalsafe/tree-spec-editor-theme-bootstrap",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "type": "module",
5
5
  "description": "Bootstrap-token theme for @signalsafe/tree-spec-editor semantic classes.",
6
6
  "license": "MIT",
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Canvas choice rows, drag/drop affordances, and append targets.
3
+ */
4
+
5
+ .graph-editor-canvas-node .graph-editor-choice-row {
6
+ padding: 0.3125rem 0.5rem;
7
+ }
8
+
9
+ .graph-editor-choice-row {
10
+ position: relative;
11
+ min-width: 0;
12
+ }
13
+
14
+ .graph-editor-choice-row-selectable {
15
+ cursor: pointer;
16
+ }
17
+
18
+ .graph-editor-choice-row-select {
19
+ appearance: none;
20
+ background: transparent;
21
+ border: 0;
22
+ margin: 0;
23
+ padding: 0;
24
+ text-align: start;
25
+ color: inherit;
26
+ font: inherit;
27
+ line-height: inherit;
28
+ text-decoration: none;
29
+ }
30
+
31
+ .graph-editor-choice-row-select:not(:disabled):hover,
32
+ .graph-editor-choice-row-select:not(:disabled):focus-visible {
33
+ color: inherit;
34
+ text-decoration: none;
35
+ }
36
+
37
+ .graph-editor-choice-row-selectable:not(:disabled):focus-visible {
38
+ outline: 2px solid var(--graph-editor-accent);
39
+ outline-offset: -2px;
40
+ }
41
+
42
+ .graph-editor-choice-drag-handle {
43
+ appearance: none;
44
+ background: transparent;
45
+ border: 0;
46
+ margin: 0;
47
+ padding: 0;
48
+ width: 0.625rem;
49
+ display: inline-flex;
50
+ align-items: center;
51
+ justify-content: center;
52
+ flex-shrink: 0;
53
+ cursor: grab;
54
+ touch-action: none;
55
+ color: var(--graph-editor-muted);
56
+ line-height: 1;
57
+ font-size: 0.75rem;
58
+ }
59
+
60
+ .graph-editor-choice-drag-handle:active {
61
+ cursor: grabbing;
62
+ }
63
+
64
+ .graph-editor-choice-drop-target {
65
+ outline: 2px dashed var(--graph-editor-accent);
66
+ outline-offset: -2px;
67
+ background-color: var(--bs-primary-bg-subtle);
68
+ }
69
+
70
+ .graph-editor-choice-drop-append,
71
+ .graph-editor-list__append-target {
72
+ min-height: 0.5rem;
73
+ }
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Invisible React Flow connection handles and target-handle tone modifiers.
3
+ */
4
+
5
+ .graph-editor-canvas .graph-editor-handle {
6
+ opacity: 0 !important;
7
+ background: transparent !important;
8
+ border: 0 !important;
9
+ box-shadow: none !important;
10
+ }
11
+
12
+ .graph-editor-handle {
13
+ width: 10px;
14
+ height: 10px;
15
+ }
16
+
17
+ .graph-editor-root .graph-editor-choice-handle,
18
+ .graph-editor-root .graph-editor-target-handle {
19
+ width: 1px !important;
20
+ height: 1px !important;
21
+ min-width: 1px !important;
22
+ min-height: 1px !important;
23
+ opacity: 0 !important;
24
+ background: transparent !important;
25
+ border: 0 !important;
26
+ box-shadow: none !important;
27
+ }
28
+
29
+ .graph-editor-root .graph-editor-choice-handle {
30
+ position: absolute !important;
31
+ top: 50% !important;
32
+ right: calc(-1px - var(--graph-editor-node-border-width, 4px) / 2) !important;
33
+ left: auto !important;
34
+ transform: translateY(-50%) !important;
35
+ margin: 0 !important;
36
+ }
37
+
38
+ .graph-editor-root .graph-editor-target-handle {
39
+ top: 50% !important;
40
+ left: calc(-1px - var(--graph-editor-node-border-width, 4px) / 2) !important;
41
+ transform: translateY(-50%) !important;
42
+ }
43
+
44
+ .graph-editor-root .graph-editor-target-handle--default,
45
+ .graph-editor-root .graph-editor-target-handle--danger {
46
+ opacity: 0 !important;
47
+ background: transparent !important;
48
+ border: 0 !important;
49
+ box-shadow: none !important;
50
+ }
@@ -0,0 +1,99 @@
1
+ /**
2
+ * Canvas node cards, text truncation, and flush choice lists.
3
+ */
4
+
5
+ .graph-editor-node-text-wrap {
6
+ overflow-wrap: anywhere;
7
+ }
8
+
9
+ .graph-editor-node-text-truncate {
10
+ display: block;
11
+ min-width: 0;
12
+ max-width: 100%;
13
+ overflow: hidden;
14
+ text-overflow: ellipsis;
15
+ white-space: nowrap;
16
+ }
17
+
18
+ .graph-editor-node-flex-truncate {
19
+ flex: 1 1 0;
20
+ min-width: 0;
21
+ overflow: hidden;
22
+ text-overflow: ellipsis;
23
+ white-space: nowrap;
24
+ }
25
+
26
+ .graph-editor-canvas-node {
27
+ min-width: 0;
28
+ border-radius: var(--bs-card-border-radius, var(--graph-editor-radius));
29
+ overflow: visible;
30
+ border-style: solid;
31
+ border-width: var(--graph-editor-node-border-width);
32
+ }
33
+
34
+ .graph-editor-canvas-node--border-danger {
35
+ border-color: var(--graph-editor-danger) !important;
36
+ }
37
+
38
+ .graph-editor-canvas-node--border-warning {
39
+ border-color: var(--bs-warning) !important;
40
+ }
41
+
42
+ .graph-editor-canvas-node--end-width {
43
+ width: 180px;
44
+ }
45
+
46
+ .graph-editor-canvas-node > .graph-editor-card__header:first-child {
47
+ border-top-left-radius: calc(var(--bs-card-border-radius, var(--graph-editor-radius)) - 1px);
48
+ border-top-right-radius: calc(var(--bs-card-border-radius, var(--graph-editor-radius)) - 1px);
49
+ }
50
+
51
+ .graph-editor-canvas-node-body {
52
+ min-width: 0;
53
+ }
54
+
55
+ .graph-editor-canvas-node .graph-editor-card__body {
56
+ min-width: 0;
57
+ background-color: transparent;
58
+ }
59
+
60
+ .graph-editor-canvas-node .graph-editor-list__item {
61
+ background-color: transparent;
62
+ }
63
+
64
+ .graph-editor-list--flush {
65
+ border-radius: 0;
66
+ }
67
+
68
+ .graph-editor-list--flush > .graph-editor-list__item {
69
+ border-left: 0;
70
+ border-right: 0;
71
+ }
72
+
73
+ .graph-editor-canvas-node .graph-editor-list__item--plain {
74
+ padding: 0;
75
+ border-top: var(--graph-editor-border-width) solid
76
+ var(--graph-editor-border-subtle);
77
+ }
78
+
79
+ .graph-editor-canvas-node .graph-editor-list--flush > .graph-editor-list__item--plain:first-child {
80
+ border-top: 0;
81
+ }
82
+
83
+ .graph-editor-canvas-node .graph-editor-canvas-node-body > .graph-editor-list--flush {
84
+ border-top: var(--graph-editor-border-width) solid var(--graph-editor-border-subtle);
85
+ }
86
+
87
+ .graph-editor-canvas-node.graph-editor-canvas__selected
88
+ .graph-editor-canvas-node-body
89
+ > .graph-editor-list--flush,
90
+ .graph-editor-canvas-selected.graph-editor-canvas-node
91
+ .graph-editor-canvas-node-body
92
+ > .graph-editor-list--flush {
93
+ border-top-color: var(--bs-primary-border-subtle);
94
+ }
95
+
96
+ .graph-editor-canvas-node.graph-editor-canvas__selected .graph-editor-card__header,
97
+ .graph-editor-canvas-node.graph-editor-canvas__selected .graph-editor-list__item {
98
+ border-color: var(--bs-primary-border-subtle);
99
+ }
@@ -0,0 +1,84 @@
1
+ /**
2
+ * Canvas root, React Flow chrome, and dark-mode sync.
3
+ */
4
+
5
+ .graph-editor-canvas-root {
6
+ min-height: 0;
7
+ flex: 1 1 auto;
8
+ }
9
+
10
+ /* NodeResizer: invisible edge hit targets with resize cursors (square line frame stays hidden). */
11
+ .graph-editor-canvas .react-flow__node .react-flow__resize-control {
12
+ z-index: 5;
13
+ }
14
+
15
+ .graph-editor-canvas .react-flow__node .react-flow__resize-control.line {
16
+ opacity: 0;
17
+ border-color: transparent;
18
+ }
19
+
20
+ .graph-editor-canvas .react-flow__node .react-flow__resize-control.left,
21
+ .graph-editor-canvas .react-flow__node .react-flow__resize-control.right {
22
+ cursor: ew-resize;
23
+ }
24
+
25
+ .graph-editor-canvas .react-flow__node .react-flow__resize-control.top,
26
+ .graph-editor-canvas .react-flow__node .react-flow__resize-control.bottom {
27
+ cursor: ns-resize;
28
+ }
29
+
30
+ .graph-editor-canvas .react-flow__node .react-flow__resize-control.top.left,
31
+ .graph-editor-canvas .react-flow__node .react-flow__resize-control.bottom.right {
32
+ cursor: nwse-resize;
33
+ }
34
+
35
+ .graph-editor-canvas .react-flow__node .react-flow__resize-control.bottom.left,
36
+ .graph-editor-canvas .react-flow__node .react-flow__resize-control.top.right {
37
+ cursor: nesw-resize;
38
+ }
39
+
40
+ .graph-editor-canvas .react-flow__node .react-flow__resize-control.line.left,
41
+ .graph-editor-canvas .react-flow__node .react-flow__resize-control.line.right {
42
+ width: 10px;
43
+ }
44
+
45
+ .graph-editor-canvas .react-flow__node .react-flow__resize-control.line.top,
46
+ .graph-editor-canvas .react-flow__node .react-flow__resize-control.bottom {
47
+ height: 10px;
48
+ }
49
+
50
+ .graph-editor-canvas .react-flow__node .react-flow__resize-control.handle {
51
+ width: 10px;
52
+ height: 10px;
53
+ border: none;
54
+ background: transparent;
55
+ opacity: 0;
56
+ }
57
+
58
+ .graph-editor-canvas .react-flow__node .react-flow__resize-control.handle:hover {
59
+ opacity: 1;
60
+ border: 1px solid var(--graph-editor-accent);
61
+ border-radius: 2px;
62
+ background-color: var(--bs-primary-bg-subtle);
63
+ }
64
+
65
+ .graph-editor-canvas .react-flow__node:has(.graph-editor-canvas-node),
66
+ .graph-editor-canvas .react-flow__node:has(.graph-editor-canvas-node--border-danger) {
67
+ overflow: visible;
68
+ }
69
+
70
+ /* React Flow canvas theme sync (RF v11 — host passes colorMode from ThemeContext). */
71
+ .graph-editor-canvas[data-color-mode='dark'] .react-flow__background {
72
+ background-color: var(--graph-editor-bg);
73
+ }
74
+
75
+ .graph-editor-canvas[data-color-mode='dark'] .react-flow__controls-button {
76
+ background: var(--bs-secondary-bg);
77
+ border-color: var(--graph-editor-border);
78
+ color: var(--graph-editor-text);
79
+ fill: currentColor;
80
+ }
81
+
82
+ .graph-editor-canvas[data-color-mode='dark'] .react-flow__minimap {
83
+ background: var(--bs-secondary-bg);
84
+ }
package/styles.css CHANGED
@@ -17,3 +17,7 @@
17
17
  @import './src/shell/panels.css';
18
18
  @import './src/shell/dropdowns.css';
19
19
  @import './src/shell/selection.css';
20
+ @import './src/canvas/react-flow.css';
21
+ @import './src/canvas/nodes.css';
22
+ @import './src/canvas/choices.css';
23
+ @import './src/canvas/handles.css';