matterviz 0.1.6 → 0.1.8

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.
Files changed (104) hide show
  1. package/dist/{DraggablePanel.svelte → DraggablePane.svelte} +119 -122
  2. package/dist/{DraggablePanel.svelte.d.ts → DraggablePane.svelte.d.ts} +7 -7
  3. package/dist/FilePicker.svelte +263 -0
  4. package/dist/FilePicker.svelte.d.ts +15 -0
  5. package/dist/Icon.svelte +7 -3
  6. package/dist/SettingsSection.svelte +116 -0
  7. package/dist/SettingsSection.svelte.d.ts +11 -0
  8. package/dist/{mp-api.js → api/mp.js} +1 -1
  9. package/dist/api/optimade.d.ts +45 -0
  10. package/dist/api/optimade.js +135 -0
  11. package/dist/app.css +14 -2
  12. package/dist/composition/BarChart.svelte +1 -1
  13. package/dist/composition/BarChart.svelte.d.ts +4 -9
  14. package/dist/composition/BubbleChart.svelte +4 -2
  15. package/dist/composition/BubbleChart.svelte.d.ts +7 -11
  16. package/dist/composition/Composition.svelte +1 -4
  17. package/dist/composition/PieChart.svelte +5 -4
  18. package/dist/composition/PieChart.svelte.d.ts +11 -13
  19. package/dist/composition/index.d.ts +10 -0
  20. package/dist/element/ElementHeading.svelte +2 -2
  21. package/dist/element/ElementHeading.svelte.d.ts +1 -0
  22. package/dist/element/ElementPhoto.svelte +3 -3
  23. package/dist/element/ElementStats.svelte +3 -4
  24. package/dist/element/ElementStats.svelte.d.ts +1 -1
  25. package/dist/element/ElementTile.svelte +4 -5
  26. package/dist/element/ElementTile.svelte.d.ts +1 -1
  27. package/dist/icons.d.ts +46 -8
  28. package/dist/icons.js +77 -8
  29. package/dist/index.d.ts +13 -19
  30. package/dist/index.js +22 -1
  31. package/dist/io/export.d.ts +0 -10
  32. package/dist/io/export.js +17 -346
  33. package/dist/io/index.d.ts +0 -2
  34. package/dist/io/index.js +31 -49
  35. package/dist/labels.d.ts +3 -3
  36. package/dist/labels.js +1 -1
  37. package/dist/math.d.ts +5 -3
  38. package/dist/math.js +38 -49
  39. package/dist/periodic-table/PeriodicTable.svelte +1 -1
  40. package/dist/periodic-table/PeriodicTable.svelte.d.ts +3 -3
  41. package/dist/periodic-table/TableInset.svelte +2 -2
  42. package/dist/plot/ColorBar.svelte +17 -18
  43. package/dist/plot/Histogram.svelte +9 -12
  44. package/dist/plot/Histogram.svelte.d.ts +2 -2
  45. package/dist/plot/HistogramControls.svelte +155 -115
  46. package/dist/plot/HistogramControls.svelte.d.ts +3 -3
  47. package/dist/plot/Line.svelte +1 -1
  48. package/dist/plot/Line.svelte.d.ts +1 -1
  49. package/dist/plot/PlotLegend.svelte +12 -15
  50. package/dist/plot/ScatterPlot.svelte +25 -27
  51. package/dist/plot/ScatterPlot.svelte.d.ts +3 -3
  52. package/dist/plot/ScatterPlotControls.svelte +228 -218
  53. package/dist/plot/ScatterPlotControls.svelte.d.ts +4 -4
  54. package/dist/plot/index.js +3 -4
  55. package/dist/plot/scales.js +9 -7
  56. package/dist/settings.d.ts +46 -16
  57. package/dist/settings.js +175 -45
  58. package/dist/state.svelte.d.ts +2 -2
  59. package/dist/state.svelte.js +1 -7
  60. package/dist/structure/Bond.svelte +49 -4
  61. package/dist/structure/Bond.svelte.d.ts +8 -1
  62. package/dist/structure/CanvasTooltip.svelte +25 -0
  63. package/dist/structure/CanvasTooltip.svelte.d.ts +10 -0
  64. package/dist/structure/Lattice.svelte +29 -6
  65. package/dist/structure/Lattice.svelte.d.ts +3 -2
  66. package/dist/structure/Structure.svelte +293 -162
  67. package/dist/structure/Structure.svelte.d.ts +4 -6
  68. package/dist/structure/StructureControls.svelte +597 -379
  69. package/dist/structure/StructureControls.svelte.d.ts +7 -6
  70. package/dist/structure/{StructureInfoPanel.svelte → StructureInfoPane.svelte} +21 -30
  71. package/dist/structure/StructureInfoPane.svelte.d.ts +14 -0
  72. package/dist/structure/StructureLegend.svelte +1 -1
  73. package/dist/structure/StructureScene.svelte +329 -133
  74. package/dist/structure/StructureScene.svelte.d.ts +15 -16
  75. package/dist/structure/Vector.svelte +5 -3
  76. package/dist/structure/bonding.d.ts +22 -9
  77. package/dist/structure/bonding.js +230 -112
  78. package/dist/structure/export.d.ts +10 -0
  79. package/dist/structure/export.js +339 -0
  80. package/dist/structure/index.d.ts +11 -2
  81. package/dist/structure/index.js +3 -1
  82. package/dist/structure/measure.d.ts +8 -0
  83. package/dist/structure/measure.js +38 -0
  84. package/dist/{io → structure}/parse.d.ts +6 -21
  85. package/dist/{io → structure}/parse.js +489 -189
  86. package/dist/structure/pbc.js +55 -36
  87. package/dist/structure/supercell.d.ts +8 -0
  88. package/dist/structure/supercell.js +157 -0
  89. package/dist/theme/ThemeControl.svelte +12 -11
  90. package/dist/theme/themes.js +9 -17
  91. package/dist/trajectory/Trajectory.svelte +121 -102
  92. package/dist/trajectory/Trajectory.svelte.d.ts +2 -1
  93. package/dist/trajectory/TrajectoryError.svelte +2 -2
  94. package/dist/trajectory/{TrajectoryInfoPanel.svelte → TrajectoryInfoPane.svelte} +19 -23
  95. package/dist/trajectory/TrajectoryInfoPane.svelte.d.ts +18 -0
  96. package/dist/trajectory/index.d.ts +3 -3
  97. package/dist/trajectory/index.js +2 -3
  98. package/dist/trajectory/parse.d.ts +5 -4
  99. package/dist/trajectory/parse.js +31 -12
  100. package/package.json +19 -19
  101. package/readme.md +29 -17
  102. package/dist/structure/StructureInfoPanel.svelte.d.ts +0 -14
  103. package/dist/trajectory/TrajectoryInfoPanel.svelte.d.ts +0 -18
  104. /package/dist/{mp-api.d.ts → api/mp.d.ts} +0 -0
@@ -1,31 +1,30 @@
1
1
  <script lang="ts">import { Icon } from './';
2
2
  import { draggable, tooltip } from 'svelte-multiselect/attachments';
3
- let { show = $bindable(false), show_panel = true, children, toggle_props = {}, open_icon = `Cross`, closed_icon = `Settings`, icon_style = ``, offset = { x: 5, y: 5 }, max_width = `450px`, panel_props = {}, onclose = () => { }, on_drag_start = () => { }, custom_toggle = undefined, toggle_panel_btn, panel_div, has_been_dragged = $bindable(false), currently_dragging = $bindable(false), } = $props();
3
+ let { show = $bindable(false), show_pane = true, children, toggle_props = {}, open_icon = `Cross`, closed_icon = `Settings`, icon_style = ``, offset = { x: 5, y: 5 }, max_width = `450px`, pane_props = {}, onclose = () => { }, on_drag_start = () => { }, custom_toggle = undefined, toggle_pane_btn = $bindable(undefined), pane_div = $bindable(undefined), has_been_dragged = $bindable(false), currently_dragging = $bindable(false), } = $props();
4
4
  let initial_position = $state({ left: `50px`, top: `50px` });
5
5
  let show_control_buttons = $state(false);
6
6
  // Keyboard shortcuts
7
7
  function on_keydown(event) {
8
8
  if (event.key === `Escape`) {
9
9
  event.preventDefault();
10
- close_panel();
10
+ close_pane();
11
11
  }
12
12
  }
13
- // Panel actions
14
- function toggle_panel() {
13
+ function toggle_pane() {
15
14
  show = !show;
16
15
  if (!show)
17
16
  onclose();
18
17
  }
19
- function close_panel() {
18
+ function close_pane() {
20
19
  show = false;
21
20
  onclose();
22
21
  }
23
22
  function reset_position() {
24
- if (toggle_panel_btn) {
23
+ if (toggle_pane_btn) {
25
24
  const pos = calculate_position();
26
25
  initial_position = pos;
27
- if (panel_div) {
28
- Object.assign(panel_div.style, {
26
+ if (pane_div) {
27
+ Object.assign(pane_div.style, {
29
28
  left: pos.left,
30
29
  top: pos.top,
31
30
  right: `auto`,
@@ -47,24 +46,24 @@ function handle_drag_start() {
47
46
  }
48
47
  // Position calculation
49
48
  function calculate_position() {
50
- if (!toggle_panel_btn)
49
+ if (!toggle_pane_btn)
51
50
  return { left: `50px`, top: `50px` };
52
- const toggle_rect = toggle_panel_btn.getBoundingClientRect();
53
- const panel_width = panel_div?.getBoundingClientRect().width || 450;
54
- const positioned_ancestor = toggle_panel_btn.offsetParent;
51
+ const toggle_rect = toggle_pane_btn.getBoundingClientRect();
52
+ const pane_width = pane_div?.getBoundingClientRect().width || 450;
53
+ const positioned_ancestor = toggle_pane_btn.offsetParent;
55
54
  const ancestor_rect = positioned_ancestor?.getBoundingClientRect();
56
55
  if (!ancestor_rect) {
57
56
  // Fallback to document positioning
58
57
  const scroll_x = window.scrollX || document.documentElement.scrollLeft;
59
58
  const scroll_y = window.scrollY || document.documentElement.scrollTop;
60
59
  return {
61
- left: `${toggle_rect.right - panel_width + (offset.x ?? 5) + scroll_x}px`,
60
+ left: `${toggle_rect.right - pane_width + (offset.x ?? 5) + scroll_x}px`,
62
61
  top: `${toggle_rect.bottom + (offset.y ?? 5) + scroll_y}px`,
63
62
  };
64
63
  }
65
64
  // Position relative to positioned ancestor
66
65
  return {
67
- left: `${toggle_rect.right - ancestor_rect.left - panel_width + (offset.x ?? 5)}px`,
66
+ left: `${toggle_rect.right - ancestor_rect.left - pane_width + (offset.x ?? 5)}px`,
68
67
  top: `${toggle_rect.bottom - ancestor_rect.top + (offset.y ?? 5)}px`,
69
68
  };
70
69
  }
@@ -73,20 +72,18 @@ function handle_click_outside(event) {
73
72
  if (!show)
74
73
  return;
75
74
  const target = event.target;
76
- const is_toggle_button = toggle_panel_btn &&
77
- (target === toggle_panel_btn || toggle_panel_btn.contains(target));
78
- const is_inside_panel = panel_div &&
79
- (target === panel_div || panel_div.contains(target));
80
- if (!is_toggle_button && !is_inside_panel && !has_been_dragged &&
81
- !currently_dragging) {
82
- close_panel();
83
- }
75
+ const is_toggle_button = toggle_pane_btn &&
76
+ (target === toggle_pane_btn || toggle_pane_btn.contains(target));
77
+ const is_inside_pane = pane_div &&
78
+ (target === pane_div || pane_div.contains(target));
79
+ if (!is_toggle_button && !is_inside_pane && !currently_dragging)
80
+ close_pane();
84
81
  }
85
82
  // Button click handler
86
- function handle_button_click(event, action) {
83
+ const handle_button_click = (action) => (event) => {
87
84
  event.stopPropagation();
88
85
  action();
89
- }
86
+ };
90
87
  // Debounced resize handler for better performance
91
88
  let resize_timeout = $state(undefined);
92
89
  function handle_resize() {
@@ -97,26 +94,27 @@ function handle_resize() {
97
94
  const current_timeout = setTimeout(() => {
98
95
  if (resize_timeout !== current_timeout)
99
96
  return;
100
- if (show && toggle_panel_btn && !has_been_dragged && panel_div) {
97
+ if (show && toggle_pane_btn && !has_been_dragged && pane_div) {
101
98
  const pos = calculate_position();
102
99
  initial_position = pos;
103
- panel_div.style.left = pos.left;
104
- panel_div.style.top = pos.top;
100
+ pane_div.style.left = pos.left;
101
+ pane_div.style.top = pos.top;
105
102
  }
106
103
  }, 50); // Debounce resize events
107
104
  resize_timeout = current_timeout;
108
105
  }
109
- // Position panel when shown
106
+ // Position pane when shown
110
107
  $effect(() => {
111
- if (show && toggle_panel_btn && !has_been_dragged) {
108
+ if (show && toggle_pane_btn && !has_been_dragged) {
112
109
  const pos = calculate_position();
113
110
  initial_position = pos;
114
- if (panel_div) {
115
- Object.assign(panel_div.style, {
111
+ if (pane_div) {
112
+ Object.assign(pane_div.style, {
116
113
  left: pos.left,
117
114
  top: pos.top,
118
115
  right: `auto`,
119
116
  bottom: `auto`,
117
+ width: ``,
120
118
  });
121
119
  }
122
120
  }
@@ -126,15 +124,15 @@ $effect(() => {
126
124
  <svelte:window onkeydown={on_keydown} onresize={handle_resize} />
127
125
  <svelte:document onclick={handle_click_outside} />
128
126
 
129
- {#if show_panel}
127
+ {#if show_pane}
130
128
  <button
131
- bind:this={toggle_panel_btn}
132
- onclick={(event) => handle_button_click(event, custom_toggle || toggle_panel)}
129
+ type="button"
130
+ bind:this={toggle_pane_btn}
131
+ onclick={handle_button_click(custom_toggle || toggle_pane)}
133
132
  aria-expanded={show}
134
- aria-controls="draggable-panel"
135
133
  {...toggle_props}
136
- class="panel-toggle {toggle_props.class ?? ``}"
137
- {@attach tooltip({ content: toggle_props.title ?? (show ? `Close panel` : `Open panel`) })}
134
+ class="pane-toggle {toggle_props.class ?? ``}"
135
+ {@attach tooltip({ content: toggle_props.title ?? (show ? `Close pane` : `Open pane`) })}
138
136
  >
139
137
  <Icon icon={show ? open_icon : closed_icon} style={icon_style} />
140
138
  </button>
@@ -145,43 +143,43 @@ $effect(() => {
145
143
  on_drag_start: handle_drag_start,
146
144
  on_drag_end: () => (currently_dragging = false),
147
145
  })}
148
- bind:this={panel_div}
146
+ bind:this={pane_div}
149
147
  role="dialog"
150
- aria-label="Draggable panel"
148
+ aria-label="Draggable pane"
151
149
  aria-modal="false"
152
150
  style:max-width={max_width}
153
151
  style:top={initial_position.top}
154
152
  style:left={initial_position.left}
155
153
  style:display={show ? `grid` : `none`}
156
- {...panel_props}
157
- class="draggable-panel {show ? `panel-open` : ``} {panel_props.class ?? ``}"
154
+ {...pane_props}
155
+ class="draggable-pane {show ? `pane-open` : ``} {pane_props.class ?? ``}"
158
156
  >
159
- <div class="panel-header">
160
- <div class="control-buttons">
161
- {#if show_control_buttons}
162
- <button
163
- class="reset-button"
164
- onclick={(event) => handle_button_click(event, reset_position)}
165
- title="Reset panel position"
166
- aria-label="Reset panel position"
167
- >
168
- <Icon icon="Reset" style="width: 1.25em; height: 1.25em" />
169
- </button>
170
- <button
171
- class="close-button"
172
- onclick={(event) => handle_button_click(event, close_panel)}
173
- title="Close panel"
174
- aria-label="Close panel"
175
- >
176
- <Icon icon="Cross" style="width: 1.25em; height: 1.25em" />
177
- </button>
178
- {/if}
179
- <Icon
180
- icon="DragIndicator"
181
- class="drag-handle"
182
- style="width: 1.25em; height: 1.25em"
183
- />
184
- </div>
157
+ <div class="control-buttons">
158
+ {#if show_control_buttons}
159
+ <button
160
+ type="button"
161
+ class="reset-button"
162
+ onclick={handle_button_click(reset_position)}
163
+ title="Reset pane position"
164
+ aria-label="Reset pane position"
165
+ >
166
+ <Icon icon="Reset" style="width: 1.25em; height: 1.25em" />
167
+ </button>
168
+ <button
169
+ type="button"
170
+ class="close-button"
171
+ onclick={handle_button_click(close_pane)}
172
+ title="Close pane"
173
+ aria-label="Close pane"
174
+ >
175
+ <Icon icon="Cross" style="width: 1.25em; height: 1.25em" />
176
+ </button>
177
+ {/if}
178
+ <Icon
179
+ icon="DragIndicator"
180
+ class="drag-handle"
181
+ style="width: 1.25em; height: 1.25em"
182
+ />
185
183
  </div>
186
184
 
187
185
  {@render children()}
@@ -189,27 +187,27 @@ $effect(() => {
189
187
  {/if}
190
188
 
191
189
  <style>
192
- button.panel-toggle {
190
+ button.pane-toggle {
193
191
  box-sizing: border-box;
194
192
  display: flex;
195
193
  place-items: center;
196
- padding: var(--panel-toggle-padding, 2pt);
197
- border-radius: var(--panel-toggle-border-radius, 3pt);
194
+ padding: var(--pane-toggle-padding, 2pt);
195
+ border-radius: var(--pane-toggle-border-radius, 3pt);
198
196
  background-color: transparent;
199
197
  transition: background-color 0.2s;
200
- font-size: clamp(1em, 2cqw, 1.6em);
198
+ font-size: var(--pane-toggle-font-size, clamp(1.1em, calc(1cqw + 1cqh), 1.4em));
201
199
  }
202
- button.panel-toggle:hover {
200
+ button.pane-toggle:hover {
203
201
  background-color: color-mix(in srgb, currentColor 8%, transparent);
204
202
  }
205
- .draggable-panel {
206
- position: absolute; /* Use absolute so panel scrolls with page content */
207
- background: var(--panel-bg);
208
- border: var(--panel-border, 1px solid rgba(255, 255, 255, 0.15));
203
+ div.draggable-pane {
204
+ position: absolute; /* Use absolute so pane scrolls with page content */
205
+ background: var(--pane-bg, var(--page-bg, light-dark(white, black)));
206
+ border: var(--pane-border, 1px solid rgba(255, 255, 255, 0.15));
209
207
  border-radius: 6px;
210
- padding: var(--panel-padding, 1ex);
208
+ padding: var(--pane-padding, 1ex);
211
209
  box-sizing: border-box;
212
- z-index: 10;
210
+ z-index: var(--pane-z-index, 10);
213
211
  display: grid;
214
212
  gap: 4pt;
215
213
  text-align: left;
@@ -219,53 +217,52 @@ $effect(() => {
219
217
  max-width: 90cqw;
220
218
  overflow-x: hidden;
221
219
  overflow-y: auto;
222
- max-height: calc(100vh - 3em);
220
+ max-height: min(90vh, 800px);
223
221
  pointer-events: auto;
224
222
  }
225
- :global(body.fullscreen) .draggable-panel {
223
+ :global(body.fullscreen) .draggable-pane {
226
224
  position: fixed !important; /* In fullscreen, we want viewport-relative positioning */
227
225
  top: 3.3em !important;
228
226
  right: 1em !important;
229
227
  left: auto !important;
230
228
  }
231
- /* Panel content styling */
232
- .draggable-panel :global(h4) {
229
+ /* Pane content styling */
230
+ .draggable-pane :global(h4) {
233
231
  margin: 2pt 0;
234
232
  font-size: 0.95em;
235
233
  }
236
- .draggable-panel :global(hr) {
234
+ .draggable-pane :global(hr) {
237
235
  border: none;
238
- background: var(--panel-hr-bg, rgba(255, 255, 255, 0.1));
236
+ background: var(--pane-hr-bg, rgba(255, 255, 255, 0.1));
239
237
  margin: 4pt 0;
240
238
  height: 1px;
241
239
  }
242
- .draggable-panel :global(label) {
240
+ .draggable-pane :global(label) {
243
241
  display: flex;
244
242
  align-items: center;
245
243
  gap: 2pt;
246
244
  }
247
- .draggable-panel :global(input[type='text']) {
245
+ .draggable-pane :global(input[type='text']) {
248
246
  flex: 1;
249
247
  padding: 4px 6px;
248
+ margin: var(--pane-input-margin, 0 0 0 5pt);
250
249
  }
251
- .draggable-panel :global(input[type='text'].invalid) {
250
+ .draggable-pane :global(input[type='text'].invalid) {
252
251
  border-color: var(--error-color, #ff6b6b);
253
252
  background: rgba(255, 107, 107, 0.1);
254
253
  }
255
- .draggable-panel :global(input[type='text'].invalid):focus {
254
+ .draggable-pane :global(input[type='text'].invalid):focus {
256
255
  outline-color: var(--error-color, #ff6b6b);
257
256
  box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.2);
258
257
  }
259
- .draggable-panel :global(input[type='range']) {
258
+ .draggable-pane :global(input[type='range']) {
260
259
  margin-left: 4pt;
261
260
  width: 100px;
262
261
  flex-shrink: 0;
263
- }
264
- .draggable-panel :global(input[type='range']) {
265
262
  flex: 1;
266
263
  min-width: 60px;
267
264
  }
268
- .draggable-panel :global(input[type='number']) {
265
+ .draggable-pane :global(input[type='number']) {
269
266
  box-sizing: border-box;
270
267
  text-align: center;
271
268
  border-radius: 3pt;
@@ -273,58 +270,59 @@ $effect(() => {
273
270
  margin: 0 3pt 0 6pt;
274
271
  flex-shrink: 0;
275
272
  }
276
- .draggable-panel :global(input::-webkit-inner-spin-button) {
273
+ .draggable-pane :global(input::-webkit-inner-spin-button) {
277
274
  display: none;
278
275
  }
279
- .draggable-panel :global(button) {
276
+ .draggable-pane :global(button) {
280
277
  width: max-content;
281
- background-color: var(--panel-btn-bg, rgba(255, 255, 255, 0.1));
278
+ background-color: var(--pane-btn-bg, rgba(255, 255, 255, 0.1));
282
279
  }
283
- .draggable-panel :global(button:hover) {
284
- background-color: var(--panel-btn-hover-bg, rgba(255, 255, 255, 0.2));
280
+ .draggable-pane :global(button:hover) {
281
+ background-color: var(--pane-btn-bg-hover, rgba(255, 255, 255, 0.2));
285
282
  }
286
- .draggable-panel :global(select) {
283
+ .draggable-pane :global(select) {
287
284
  margin: 0 0 0 5pt;
288
285
  flex: 1;
289
286
  border-radius: 3px;
290
287
  padding: 2px 4px;
291
288
  font-size: 0.8em;
292
289
  }
293
- .draggable-panel :global(input[type='color']) {
290
+ .draggable-pane :global(input[type='color']) {
294
291
  width: 40px;
295
292
  height: 16px;
296
293
  margin: 0 0 0 5pt;
297
294
  border: 1px solid rgba(255, 255, 255, 0.05);
298
295
  box-sizing: border-box;
299
296
  }
300
- .draggable-panel :global(.panel-row) {
297
+ .draggable-pane :global(.pane-row) {
301
298
  display: flex;
302
299
  gap: 8pt;
303
300
  align-items: center;
304
301
  }
305
- .draggable-panel :global(.panel-row label.slider-control) {
302
+ .draggable-pane :global(.pane-grid) {
303
+ display: grid;
304
+ gap: 8pt;
305
+ align-items: center;
306
+ }
307
+ .draggable-pane :global(label:has(input[type='range'])) {
306
308
  flex: 1;
307
309
  }
308
- /* Panel header styling */
309
- .draggable-panel .panel-header {
310
+ .draggable-pane .control-buttons {
310
311
  display: flex;
311
- justify-content: flex-end;
312
+ justify-content: end;
312
313
  align-items: center;
313
- position: absolute;
314
- top: 5px;
315
- left: 5px;
316
- right: 5px;
317
- height: 1.3em;
318
- z-index: 10;
319
- pointer-events: none; /* Allow events to pass through to children */
320
- }
321
- .draggable-panel .control-buttons {
322
- display: flex;
314
+ position: sticky;
315
+ top: 0;
316
+ right: 0;
317
+ height: 0;
318
+ /* Cancel the 12 pt top/bottom padding without relying on width-based percentages */
323
319
  gap: 5px;
324
- align-items: center;
325
- pointer-events: auto; /* Re-enable pointer events for buttons */
320
+ padding: 12pt 3pt;
321
+ margin-bottom: calc(-2 * 12pt);
322
+ box-sizing: border-box;
323
+ justify-self: end;
326
324
  }
327
- .draggable-panel :global(.drag-handle) {
325
+ .draggable-pane :global(.drag-handle) {
328
326
  width: 1.3em;
329
327
  height: 1.3em;
330
328
  cursor: grab;
@@ -335,17 +333,16 @@ $effect(() => {
335
333
  background-color: color-mix(in srgb, currentColor 10%, transparent);
336
334
  pointer-events: auto; /* Re-enable pointer events for drag handle */
337
335
  }
338
- .draggable-panel :global(.drag-handle:hover) {
336
+ .draggable-pane :global(.drag-handle:hover) {
339
337
  opacity: 0.8;
340
338
  background-color: color-mix(in srgb, currentColor 20%, transparent);
341
339
  }
342
340
  /* Ensure drag handle cursor changes properly */
343
- .draggable-panel :global(.drag-handle:active) {
341
+ .draggable-pane :global(.drag-handle:active) {
344
342
  cursor: grabbing;
345
343
  }
346
344
  /* Reset and close button styling */
347
- .draggable-panel .reset-button,
348
- .draggable-panel .close-button {
345
+ .draggable-pane :where(.reset-button, .close-button) {
349
346
  background: none;
350
347
  border: none;
351
348
  padding: 2px;
@@ -360,7 +357,7 @@ $effect(() => {
360
357
  opacity: 0.6;
361
358
  background-color: color-mix(in srgb, currentColor 10%, transparent);
362
359
  }
363
- .draggable-panel :where(.reset-button:hover, .close-button:hover) {
360
+ .draggable-pane :where(.reset-button:hover, .close-button:hover) {
364
361
  opacity: 0.8;
365
362
  background-color: color-mix(in srgb, currentColor 20%, transparent);
366
363
  }
@@ -3,7 +3,7 @@ import type { Snippet } from 'svelte';
3
3
  import type { HTMLAttributes } from 'svelte/elements';
4
4
  interface Props {
5
5
  show?: boolean;
6
- show_panel?: boolean;
6
+ show_pane?: boolean;
7
7
  children: Snippet<[]>;
8
8
  toggle_props?: HTMLAttributes<HTMLButtonElement>;
9
9
  open_icon?: IconName;
@@ -14,15 +14,15 @@ interface Props {
14
14
  y?: number;
15
15
  };
16
16
  max_width?: string;
17
- panel_props?: HTMLAttributes<HTMLDivElement>;
17
+ pane_props?: HTMLAttributes<HTMLDivElement>;
18
18
  onclose?: () => void;
19
19
  on_drag_start?: () => void;
20
20
  custom_toggle?: () => void;
21
- toggle_panel_btn?: HTMLButtonElement;
22
- panel_div?: HTMLDivElement;
21
+ toggle_pane_btn?: HTMLButtonElement;
22
+ pane_div?: HTMLDivElement;
23
23
  has_been_dragged?: boolean;
24
24
  currently_dragging?: boolean;
25
25
  }
26
- declare const DraggablePanel: import("svelte").Component<Props, {}, "show" | "has_been_dragged" | "currently_dragging">;
27
- type DraggablePanel = ReturnType<typeof DraggablePanel>;
28
- export default DraggablePanel;
26
+ declare const DraggablePane: import("svelte").Component<Props, {}, "show" | "toggle_pane_btn" | "pane_div" | "has_been_dragged" | "currently_dragging">;
27
+ type DraggablePane = ReturnType<typeof DraggablePane>;
28
+ export default DraggablePane;