@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/build/index.min.js +1 -1
- package/build/index.min.js.map +1 -1
- package/package.json +1 -1
- package/src/index.js +9 -8
- package/src/style.css +1 -0
package/package.json
CHANGED
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)
|
|
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(() =>
|
|
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
|
-
|
|
454
|
-
|
|
455
|
-
|
|
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) {
|