@fusion.dev/helix 0.115.0 → 0.117.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.
@@ -87,6 +87,13 @@ registerElementEvents({
87
87
  'toggle',
88
88
  ],
89
89
  'helix-filter-menu': ['helix-facet'],
90
+ 'helix-graph': [
91
+ 'helix-activate',
92
+ 'helix-before-activate',
93
+ 'helix-graph-pan',
94
+ 'helix-graph-ready',
95
+ 'helix-graph-zoom',
96
+ ],
90
97
  'helix-heatmap': ['helix-resize'],
91
98
  'helix-image': ['error', 'load'],
92
99
  'helix-input': ['change', 'helix-before-change', 'input'],
@@ -0,0 +1 @@
1
+ export { HelixGraph } from './root/graph-root.js';
@@ -0,0 +1 @@
1
+ export { HelixGraph } from './root/graph-root.js';
@@ -0,0 +1 @@
1
+ export declare const styles: import("lit").CSSResult;
@@ -0,0 +1,208 @@
1
+ import { createSheet } from '@fusion.dev/helix-core';
2
+ export const styles = createSheet(`:host {
3
+ display: contents;
4
+ }
5
+
6
+ [part="region"] {
7
+ background-color: var(--graph-background-color, var(--helix-color-surface-sunken));
8
+ block-size: var(--graph-block-size, 32rem);
9
+ border: var(--helix-border-thin) solid var(--graph-border-color, var(--helix-color-border));
10
+ border-radius: var(--helix-radii-sm);
11
+ box-sizing: border-box;
12
+ container-type: inline-size;
13
+ display: grid;
14
+ grid-template-rows: auto minmax(0, 1fr) auto;
15
+ overflow: hidden;
16
+ position: relative;
17
+ }
18
+
19
+ [part="body"] {
20
+ display: grid;
21
+ grid-template-columns: minmax(0, 1fr) var(--graph-panel-size, 18rem);
22
+ min-block-size: 0;
23
+ }
24
+
25
+ [part="stage"] {
26
+ isolation: isolate;
27
+ min-block-size: 0;
28
+ overflow: hidden;
29
+ position: relative;
30
+ }
31
+
32
+ [part="viewport"] {
33
+ inset: 0;
34
+ position: absolute;
35
+ }
36
+
37
+ [part="viewport"] ::slotted(*) {
38
+ block-size: 100%;
39
+ inline-size: 100%;
40
+ }
41
+
42
+ [part="panel"] {
43
+ background-color: var(--helix-color-surface);
44
+ border-inline-start: var(--helix-border-thin) solid var(--helix-color-border);
45
+ color: var(--helix-color-foreground);
46
+ display: grid;
47
+
48
+ grid-template-columns: minmax(0, 1fr);
49
+ grid-template-rows: auto minmax(0, 1fr);
50
+ min-block-size: 0;
51
+ }
52
+
53
+ @container (inline-size < 40rem) {
54
+ [part="body"] {
55
+ grid-template-columns: minmax(0, 1fr);
56
+ grid-template-rows: minmax(0, 3fr) minmax(0, 2fr);
57
+ }
58
+
59
+ [part="panel"] {
60
+ border-block-start: var(--helix-border-thin) solid var(--helix-color-border);
61
+ border-inline-start: none;
62
+ }
63
+ }
64
+
65
+ [part="search"] {
66
+ align-items: center;
67
+ border-block-end: var(--helix-border-thin) solid var(--helix-color-border);
68
+ display: flex;
69
+ gap: var(--helix-space-2xs);
70
+ padding: var(--helix-space-2xs);
71
+ padding-inline-start: var(--helix-space-xs);
72
+ }
73
+
74
+ [part="filter-icon"] {
75
+ align-items: center;
76
+ color: var(--helix-color-foreground-subtle);
77
+ display: inline-flex;
78
+ flex: 0 0 auto;
79
+ }
80
+
81
+ [part="filter-icon"] svg,
82
+ slot[name="filter-icon"]::slotted(*) {
83
+ --icon-size: var(--helix-size-icon-tight);
84
+
85
+ block-size: var(--helix-size-icon-tight);
86
+ inline-size: var(--helix-size-icon-tight);
87
+ }
88
+
89
+ [part="search-field"] {
90
+ appearance: none;
91
+ background-color: transparent;
92
+ block-size: var(--helix-size-control-tight);
93
+ border: none;
94
+ box-sizing: border-box;
95
+ color: var(--helix-color-foreground);
96
+ flex: 1 1 auto;
97
+ font-family: var(--helix-font-sans);
98
+ font-size: var(--helix-text-sm);
99
+ font-weight: var(--helix-weight-medium);
100
+ min-inline-size: 0;
101
+ padding-inline: var(--helix-space-2xs);
102
+ }
103
+
104
+ [part="search-field"]::placeholder {
105
+ color: var(--helix-color-foreground-subtle);
106
+ }
107
+
108
+ [part="search-field"]:focus-visible {
109
+ outline: none;
110
+ }
111
+
112
+ [part="search"]:has([part="search-field"]:focus-visible),
113
+ [part="list"]:focus-visible {
114
+ outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);
115
+ outline-offset: calc(var(--helix-size-focus-offset) * -1);
116
+ }
117
+
118
+ [part="count"] {
119
+ color: var(--helix-color-foreground-muted);
120
+ flex: 0 0 auto;
121
+ font-size: var(--helix-text-xs);
122
+ font-variant-numeric: tabular-nums;
123
+
124
+ padding-inline-end: calc(var(--helix-space-xs) - var(--helix-space-2xs));
125
+ }
126
+
127
+ [part="list"] {
128
+ min-block-size: 0;
129
+ overflow-y: auto;
130
+ overscroll-behavior: contain;
131
+ padding-block: var(--helix-space-2xs);
132
+ }
133
+
134
+ [part~="note"] {
135
+ align-items: center;
136
+ box-sizing: border-box;
137
+ cursor: pointer;
138
+ display: flex;
139
+ font-size: var(--helix-text-sm);
140
+ gap: var(--helix-space-sm);
141
+ min-block-size: var(--helix-size-control-tight);
142
+ padding-block: var(--helix-space-2xs);
143
+ padding-inline: var(--helix-space-xs);
144
+ user-select: none;
145
+ }
146
+
147
+ [part~="note"]:hover,
148
+ [part="list"]:focus-visible [part~="note-cursor"] {
149
+ --_graph-wash: light-dark(
150
+ color-mix(in oklab, var(--helix-color-foreground) 8%, transparent),
151
+ color-mix(in oklab, var(--helix-color-foreground) 12%, transparent)
152
+ );
153
+
154
+ background-image: linear-gradient(var(--_graph-wash), var(--_graph-wash));
155
+ }
156
+
157
+ [part="note-name"] {
158
+ flex: 0 1 auto;
159
+ max-inline-size: 70%;
160
+ min-inline-size: 0;
161
+ overflow: hidden;
162
+ text-overflow: ellipsis;
163
+ white-space: nowrap;
164
+ }
165
+
166
+ [part="note-relation"] {
167
+ color: var(--helix-color-foreground-muted);
168
+ flex: 1 1 0;
169
+ font-size: var(--helix-text-xs);
170
+ min-inline-size: 0;
171
+ overflow: hidden;
172
+ text-align: end;
173
+ text-overflow: ellipsis;
174
+ white-space: nowrap;
175
+ }
176
+
177
+ [part~="note-selected"] {
178
+ background-color: var(--helix-color-surface-sunken);
179
+ }
180
+
181
+ [part~="note-selected"] [part="note-name"] {
182
+ font-weight: var(--helix-weight-semibold);
183
+ }
184
+
185
+ [part="header"],
186
+ [part="footer"] {
187
+ min-inline-size: 0;
188
+ }
189
+
190
+ @media (forced-colors: active) {
191
+ [part="list"]:focus-visible [part~="note-cursor"] {
192
+ outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);
193
+ outline-offset: calc(var(--helix-size-focus-offset) * -1);
194
+ }
195
+
196
+ [part~="note-selected"],
197
+ [part~="note-selected"] [part="note-relation"] {
198
+ background-color: Highlight;
199
+ color: HighlightText;
200
+ forced-color-adjust: none;
201
+ }
202
+ }
203
+
204
+ @media print {
205
+ :host {
206
+ print-color-adjust: economy;
207
+ }
208
+ }`);
@@ -0,0 +1,31 @@
1
+ import { HelixHeadlessGraph } from '@fusion.dev/helix-headless/graph';
2
+ import type { CSSResultGroup } from 'lit';
3
+ /**
4
+ * @summary A frame around a graph of notes drawn by another library, and the list that makes it readable.
5
+ *
6
+ * @description
7
+ * The styled frame: the drawing with its zoom and fullscreen buttons, and the
8
+ * list of notes beside it, which moves below the drawing where the frame is
9
+ * narrower than 40rem. The selected note leads the list on a surface of its
10
+ * own, and the notes linked to it are named by how they link.
11
+ *
12
+ * @since 0.116.0
13
+ * @status experimental
14
+ * @category media
15
+ * @aliases Knowledge graph, Network, Note graph, Second brain
16
+ * @documentation https://fusion.dev/helix/components/graph
17
+ *
18
+ * @cssproperty --graph-background-color - The color behind the drawing while it loads.
19
+ * @cssproperty --graph-block-size - The frame's height, as a length.
20
+ * @cssproperty --graph-border-color - The frame's border color.
21
+ * @cssproperty --graph-panel-size - The list's width beside the drawing.
22
+ * @cssproperty --viewport-control-background-color - The background of the zoom and fullscreen buttons. Map and Canvas use the same property.
23
+ */
24
+ export declare class HelixGraph extends HelixHeadlessGraph {
25
+ static styles: CSSResultGroup;
26
+ }
27
+ declare global {
28
+ interface HTMLElementTagNameMap {
29
+ 'helix-graph': HelixGraph;
30
+ }
31
+ }
@@ -0,0 +1,18 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { customElement } from '@fusion.dev/helix-core';
8
+ import { HelixHeadlessGraph } from '@fusion.dev/helix-headless/graph';
9
+ import { styles as liveStyles } from '../../shared/live/live.css.js';
10
+ import { styles as viewportStyles } from '../../shared/viewport/viewport.css.js';
11
+ import { styles } from './graph-root.css.js';
12
+ let HelixGraph = class HelixGraph extends HelixHeadlessGraph {
13
+ static { this.styles = [liveStyles, viewportStyles, styles]; }
14
+ };
15
+ HelixGraph = __decorate([
16
+ customElement('helix-graph')
17
+ ], HelixGraph);
18
+ export { HelixGraph };
package/dist/index.d.ts CHANGED
@@ -45,6 +45,7 @@ export * from './file-input/index.js';
45
45
  export * from './filter-input/index.js';
46
46
  export * from './flex/index.js';
47
47
  export * from './format-date/index.js';
48
+ export * from './graph/index.js';
48
49
  export * from './grid/index.js';
49
50
  export * from './heatmap/index.js';
50
51
  export * from './icon/index.js';
package/dist/index.js CHANGED
@@ -40,6 +40,7 @@ export * from './file-input/index.js';
40
40
  export * from './filter-input/index.js';
41
41
  export * from './flex/index.js';
42
42
  export * from './format-date/index.js';
43
+ export * from './graph/index.js';
43
44
  export * from './grid/index.js';
44
45
  export * from './heatmap/index.js';
45
46
  export * from './icon/index.js';
@@ -31,6 +31,43 @@ overflow: hidden;
31
31
  position: relative;
32
32
  }
33
33
 
34
+ [part="gesture-hint"],
35
+ [part="gesture-status"] {
36
+ background-color: var(--helix-color-surface-inverse);
37
+ border-radius: var(--helix-radii-sm);
38
+ color: var(--helix-color-foreground-inverse);
39
+
40
+ left: 50%;
41
+ max-inline-size: calc(100% - var(--helix-space-lg) * 2);
42
+ pointer-events: none;
43
+ position: absolute;
44
+ text-align: center;
45
+ z-index: calc(var(--helix-layer-raised) + 2);
46
+ }
47
+
48
+ [part="gesture-hint"] {
49
+ font-size: var(--helix-text-sm);
50
+ inset-block-start: clamp(
51
+ var(--helix-space-2xl),
52
+ var(--_map-hint-y, 50%),
53
+ calc(100% - var(--helix-space-2xl))
54
+ );
55
+ padding: var(--helix-space-xs) var(--helix-space-sm);
56
+ translate: -50% -50%;
57
+ }
58
+
59
+ [part="gesture-status"] {
60
+ font-size: var(--helix-text-xs);
61
+ inset-block-start: var(--helix-space-xs);
62
+ padding: var(--helix-space-2xs) var(--helix-space-xs);
63
+ translate: -50% 0;
64
+ }
65
+
66
+ [part="gesture-hint"][hidden],
67
+ [part="gesture-status"][hidden] {
68
+ display: none;
69
+ }
70
+
34
71
  [part="layers"] {
35
72
  block-size: 1px;
36
73
  clip-path: inset(50%);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fusion.dev/helix",
3
3
  "description": "Styled component tier. Extends the headless tier with token-driven presentation.",
4
- "version": "0.115.0",
4
+ "version": "0.117.0",
5
5
  "license": "MIT",
6
6
  "author": "Ross Sheppard <ross.sheppard@fusion.dev>",
7
7
  "repository": {
@@ -51,13 +51,13 @@
51
51
  },
52
52
  "bugs": "https://github.com/project-fusion/fusion/issues",
53
53
  "dependencies": {
54
- "@fusion.dev/helix-core": "0.115.0",
55
- "@fusion.dev/helix-headless": "0.115.0",
56
- "@fusion.dev/helix-styles": "0.115.0"
54
+ "@fusion.dev/helix-core": "0.117.0",
55
+ "@fusion.dev/helix-headless": "0.117.0",
56
+ "@fusion.dev/helix-styles": "0.117.0"
57
57
  },
58
58
  "devDependencies": {
59
- "@fusion.dev/helix-cem": "0.115.0",
60
- "@fusion.dev/helix-testing": "0.115.0",
59
+ "@fusion.dev/helix-cem": "0.117.0",
60
+ "@fusion.dev/helix-testing": "0.117.0",
61
61
  "@fusion.dev/scripts": "0.0.0-dev",
62
62
  "@happy-dom/global-registrator": "^20.0.0",
63
63
  "@lit-labs/ssr": "^4.1.0",