@potch/html-bin 2.2.0 → 2.2.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@potch/html-bin",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
package/src/index.js CHANGED
@@ -115,12 +115,16 @@ const createEditors = (sources, parents, updateFactory) => {
115
115
  create a bin component.
116
116
  Options:
117
117
  - `container` (optional Element): will automatically append the bin if provided
118
+ - `extraClasses`: a string of extra CSS classes to append to the bin element
118
119
  - `sources`: object with optional `{ js, css, html }` strings of source to put
119
- in the corresponding editors
120
+ in the corresponding editors
120
121
  - `split`: number from [0, 1] specifying the ratio between the editor and
121
- preview panes
122
+ preview panes. default is `0.5`.
123
+ - `splitMode`: (default `true`) whether to have the preview in split screen
124
+ with code tabs.
122
125
  - `width`: CSS string to override default `--bin-width` value
123
126
  - `height`: CSS string to override default `--bin-height` value
127
+
124
128
  Returns object with the following fields:
125
129
  - `el`: Element of the outermost HTML element of the bin
126
130
  - `editors`: contains `{ js, css, html }` properties with the CodeMirror
@@ -133,6 +137,7 @@ Returns object with the following fields:
133
137
  */
134
138
  export const createBin = ({
135
139
  container,
140
+ extraClasses = "",
136
141
  sources: rawSources,
137
142
  split = 0.5,
138
143
  initialTab = "js",
@@ -337,7 +342,8 @@ export const createBin = ({
337
342
  {
338
343
  className: computed(
339
344
  () =>
340
- "bin" +
345
+ "bin " +
346
+ extraClasses +
341
347
  maybe(isMiniMode.value, " bin--mini-mode") +
342
348
  maybe(resizing.value, " bin--resizing") +
343
349
  maybe(isFullScreen.value, " bin--fullscreen")
package/src/style.css CHANGED
@@ -24,6 +24,8 @@
24
24
  container-type: inline-size;
25
25
  container-name: bin;
26
26
 
27
+ line-height: 1;
28
+
27
29
  --bg: #aaa;
28
30
  --resizer-split: 0.5;
29
31
  --margin: 2px;
@@ -40,6 +42,7 @@
40
42
  inset: 0;
41
43
  height: 100svh;
42
44
  max-height: 100svh;
45
+ z-index: 99;
43
46
  }
44
47
 
45
48
  .bin__widget {