@griddle/svelte 0.1.0 → 0.1.1

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.
@@ -16,6 +16,10 @@ $: tilesAll = $tilesStore;
16
16
  $: ver = $versionStore;
17
17
  // Loop mode delegates rendering to LoopGrid.
18
18
  $: loopOn = cfg.loop?.enabled === true;
19
+ // 'none' scroll mode: the grid sizes to content and lets the host page own
20
+ // scrolling/panning — no internal scroll box, no touch-action lock.
21
+ $: contained = cfg.scroll !== 'none';
22
+ $: heightCss = typeof height === 'number' ? height + 'px' : height;
19
23
  $: colSize = cfg.unitWidth + (cfg.gap ?? 0);
20
24
  $: rowSize = cfg.unitHeight + (cfg.gap ?? 0);
21
25
  $: halfGap = (cfg.gap ?? 0) / 2;
@@ -363,7 +367,9 @@ $: indicatorRect = (() => {
363
367
  <div
364
368
  bind:this={scrollEl}
365
369
  class="griddle-scroll"
366
- style:height={typeof height === 'number' ? height + 'px' : height}
370
+ style:overflow={contained ? 'auto' : 'visible'}
371
+ style:touch-action={contained ? 'none' : 'auto'}
372
+ style:height={contained ? heightCss : 'auto'}
367
373
  >
368
374
  <div
369
375
  class="griddle-content"
@@ -422,9 +428,8 @@ $: indicatorRect = (() => {
422
428
 
423
429
  <style>
424
430
  .griddle-scroll {
431
+ /* overflow / touch-action / height are set inline, driven by cfg.scroll. */
425
432
  position: relative;
426
- overflow: auto;
427
- touch-action: none;
428
433
  }
429
434
  .griddle-content {
430
435
  position: relative;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@griddle/svelte",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Svelte bindings for Griddle — a headless, zero-dependency grid/canvas engine.",
5
5
  "keywords": [
6
6
  "grid",
@@ -26,7 +26,10 @@
26
26
  "license": "MIT",
27
27
  "author": "Trustybits",
28
28
  "type": "module",
29
- "sideEffects": ["**/*.svelte", "**/*.css"],
29
+ "sideEffects": [
30
+ "**/*.svelte",
31
+ "**/*.css"
32
+ ],
30
33
  "svelte": "./dist/index.js",
31
34
  "types": "./dist/index.d.ts",
32
35
  "exports": {
@@ -35,7 +38,9 @@
35
38
  "svelte": "./dist/index.js"
36
39
  }
37
40
  },
38
- "files": ["dist"],
41
+ "files": [
42
+ "dist"
43
+ ],
39
44
  "engines": {
40
45
  "node": ">=18"
41
46
  },