@potch/html-bin 2.1.1 → 2.1.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@potch/html-bin",
3
- "version": "2.1.1",
3
+ "version": "2.1.2",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
package/src/index.js CHANGED
@@ -134,7 +134,7 @@ Returns object with the following fields:
134
134
  export const createBin = ({
135
135
  container,
136
136
  sources: rawSources,
137
- split,
137
+ split = 0.5,
138
138
  initialTab = "js",
139
139
  splitMode = true,
140
140
  width,
@@ -145,7 +145,7 @@ export const createBin = ({
145
145
  document.head.append(injectedStyles);
146
146
  }
147
147
 
148
- const editorSplit = signal(parseFloat(split) || 0.5);
148
+ const editorSplit = signal(parseFloat(split));
149
149
 
150
150
  const teardownFns = [];
151
151
  const stopCapturingEffects = onEffect((fn) => teardownFns.push(fn));
@@ -453,10 +453,9 @@ export const createBin = ({
453
453
 
454
454
  // set the split in CSS, factoring in expanded panes
455
455
  effect(() => {
456
- binEl.style.setProperty(
457
- "--resizer-split",
458
- splitOverride.value !== null ? splitOverride.value : editorSplit.value
459
- );
456
+ const o = splitOverride.value;
457
+ const s = editorSplit.value;
458
+ binEl.style.setProperty("--resizer-split", o !== null ? o : s);
460
459
  });
461
460
 
462
461
  // editor tabs
@@ -490,7 +489,6 @@ export const createBin = ({
490
489
 
491
490
  // destroy / teardown
492
491
  stopCapturingEffects();
493
- console.log(teardownFns);
494
492
 
495
493
  const teardown = () => {
496
494
  while (teardownFns.length) {
package/src/style.css CHANGED
@@ -103,6 +103,7 @@
103
103
  }
104
104
 
105
105
  .bin__resizer {
106
+ user-select: none;
106
107
  grid-area: resizer;
107
108
  cursor: ew-resize;
108
109
  position: relative;