@hkdigital/lib-sveltekit 0.1.89 → 0.1.91

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.
@@ -86,9 +86,9 @@
86
86
  const dragState = createOrGetDragState(contextKey);
87
87
 
88
88
  let currentState = $state(READY);
89
- let dropzoneElement; // Reference to the dropzone DOM element
89
+ let dropZoneElement; // Reference to the drop zone DOM element
90
90
 
91
- // We'll use a flag to track if we're currently in the dropzone
91
+ // We'll use a flag to track if we're currently in the drop zone
92
92
  // without relying on a counter approach
93
93
  let isCurrentlyOver = $state(false);
94
94
 
@@ -191,7 +191,7 @@
191
191
  // If we're already in a drag-over state, don't reset anything
192
192
  if (isCurrentlyOver) return;
193
193
 
194
- // Now we're over this dropzone
194
+ // Now we're over this drop zone
195
195
  isCurrentlyOver = true;
196
196
 
197
197
  // Get the drag data
@@ -216,7 +216,7 @@
216
216
  // Prevent default to allow drop
217
217
  event.preventDefault();
218
218
 
219
- // If we're not currently over this dropzone (despite dragover firing),
219
+ // If we're not currently over this drop zone (despite dragover firing),
220
220
  // treat it as an enter event
221
221
  if (!isCurrentlyOver) {
222
222
  handleDragEnter(event);
@@ -247,15 +247,15 @@
247
247
  * @param {DragEvent} event
248
248
  */
249
249
  function handleDragLeave(event) {
250
- // We need to check if we're actually leaving the dropzone or just
251
- // entering a child element within the dropzone
250
+ // We need to check if we're actually leaving the drop zone or just
251
+ // entering a child element within the drop zone
252
252
 
253
253
  // relatedTarget is the element we're moving to
254
254
  const relatedTarget = event.relatedTarget;
255
255
 
256
- // If relatedTarget is null or outside our dropzone, we're truly leaving
256
+ // If relatedTarget is null or outside our drop zone, we're truly leaving
257
257
  const isActuallyLeaving =
258
- !relatedTarget || !dropzoneElement.contains(relatedTarget);
258
+ !relatedTarget || !dropZoneElement.contains(relatedTarget);
259
259
 
260
260
  if (isActuallyLeaving) {
261
261
  isCurrentlyOver = false;
@@ -296,24 +296,24 @@
296
296
  // Notify listener
297
297
  onDropStart?.({ event, zone, data: dragData });
298
298
 
299
- const style = window.getComputedStyle(dropzoneElement);
299
+ const style = window.getComputedStyle(dropZoneElement);
300
300
 
301
301
  // Parse border widths from computed style
302
302
  const borderLeftWidth = parseInt(style.borderLeftWidth, 10) || 0;
303
303
  const borderTopWidth = parseInt(style.borderTopWidth, 10) || 0;
304
304
 
305
- // Get dropzone rectangle
306
- const dropzoneRect = dropzoneElement.getBoundingClientRect();
305
+ // Get drop zone rectangle
306
+ const dropZoneRect = dropZoneElement.getBoundingClientRect();
307
307
 
308
308
  // Calculate position with both dragData.offsetX/Y adjustment and border adjustment
309
309
  const dropOffsetX =
310
310
  event.clientX -
311
- dropzoneRect.left -
311
+ dropZoneRect.left -
312
312
  borderLeftWidth;
313
313
 
314
314
  const dropOffsetY =
315
315
  event.clientY -
316
- dropzoneRect.top -
316
+ dropZoneRect.top -
317
317
  borderTopWidth;
318
318
 
319
319
  const x = dropOffsetX - (dragData.offsetX ?? 0);
@@ -356,8 +356,8 @@
356
356
  </script>
357
357
 
358
358
  <div
359
- data-component="dropzone"
360
- bind:this={dropzoneElement}
359
+ data-component="drop-zone"
360
+ bind:this={dropZoneElement}
361
361
  ondragenter={handleDragEnter}
362
362
  ondragover={handleDragOver}
363
363
  ondragleave={handleDragLeave}
@@ -1,6 +1,6 @@
1
- @define-mixin component-dropzone {
1
+ @define-mixin component-drop-zone {
2
2
  /* Visual styling and customizable aspects */
3
- [data-component='dropzone'] {
3
+ [data-component='drop-zone'] {
4
4
  /*min-height: 100px;*/
5
5
  border: 1px dashed rgb(var(--color-surface-400));
6
6
  border-radius: var(--theme-rounded-container);
@@ -12,7 +12,7 @@
12
12
  /*@import "./components/buttons/skip-button.css";*/
13
13
 
14
14
  @import './components/drag-drop/draggable.css';
15
- @import './components/drag-drop/dropzone.css';
15
+ @import './components/drag-drop/drop-zone.css';
16
16
 
17
17
  /* Icons */
18
18
  @import './components/icons/icon-steeze.css';
@@ -40,7 +40,7 @@
40
40
  /* @mixin buttons-skip-button;*/
41
41
 
42
42
  @mixin component-draggable;
43
- @mixin component-dropzone;
43
+ @mixin component-drop-zone;
44
44
 
45
45
  @mixin component-icon-steeze;
46
46
 
@@ -44,12 +44,14 @@ export function rootDesignVarsHTML(design, clamping) {
44
44
  --design-width: ${design.width};
45
45
  --design-height: ${design.height};
46
46
 
47
- /* Base clamping units */
47
+ /* Scaling factors */
48
48
  --scale-w: 1;
49
49
  --scale-h: 1;
50
- --scale-viewport: min(var(--scale-w), var(--scale-h));
51
50
 
52
- /* Scaling factors with configurable clamping */
51
+ /* --scale-viewport: min(var(--scale-w), var(--scale-h)); */
52
+ --scale-viewport: 1;
53
+
54
+ /* Base clamping units */
53
55
  --scale-ui: clamp(${clamping.ui.min}, var(--scale-viewport), ${clamping.ui.max});
54
56
  --scale-text-base: clamp(${clamping.textBase.min}, var(--scale-viewport), ${clamping.textBase.max});
55
57
  --scale-text-heading: clamp(${clamping.textHeading.min}, var(--scale-viewport), ${clamping.textHeading.max});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hkdigital/lib-sveltekit",
3
- "version": "0.1.89",
3
+ "version": "0.1.91",
4
4
  "author": {
5
5
  "name": "HKdigital",
6
6
  "url": "https://hkdigital.nl"