@potch/html-bin 2.1.0 → 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.0",
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));
@@ -164,7 +164,10 @@ export const createBin = ({
164
164
  }
165
165
  });
166
166
 
167
- const isMiniMode = computed(() => !splitMode || actualWidth.value <= 700);
167
+ const isMiniMode = computed(() => {
168
+ const w = actualWidth.value;
169
+ return !splitMode || w <= 700;
170
+ });
168
171
  const resizing = signal(false);
169
172
  const splitOverride = signal(
170
173
  splitMode && initialTab === "preview" ? 0 : null
@@ -450,10 +453,9 @@ export const createBin = ({
450
453
 
451
454
  // set the split in CSS, factoring in expanded panes
452
455
  effect(() => {
453
- binEl.style.setProperty(
454
- "--resizer-split",
455
- splitOverride.value !== null ? splitOverride.value : editorSplit.value
456
- );
456
+ const o = splitOverride.value;
457
+ const s = editorSplit.value;
458
+ binEl.style.setProperty("--resizer-split", o !== null ? o : s);
457
459
  });
458
460
 
459
461
  // editor tabs
@@ -487,7 +489,6 @@ export const createBin = ({
487
489
 
488
490
  // destroy / teardown
489
491
  stopCapturingEffects();
490
- console.log(teardownFns);
491
492
 
492
493
  const teardown = () => {
493
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;