stalefish 8.1.14 → 8.1.16

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.
@@ -35,12 +35,12 @@ let styles = css`
35
35
 
36
36
  export default ({ chevronStyle = null, on = true, content, heading = '', collapsed = false, thinBorder = false, light = false, optionsMenu, tooltipHeading = false, headerAction, dragStartAction, dragOverAction, dragEndAction, dragLeaveAction, draggable, collapseToggleAction, closeAction }) => {
37
37
  return on ? html`<div ondragover=${e => {
38
- if (dragOverAction) {
39
- e.preventDefault()
40
- e.dataTransfer.dropEffect = 'move'
41
- }
38
+ if (dragOverAction) {
39
+ e.preventDefault()
40
+ e.dataTransfer.dropEffect = 'move'
41
+ }
42
42
  }} class="${styles.panel}" style='box-sizing: border-box; position: relative; top: 0; left: 0; text-align: left; box-shadow: 0 3px 1px -2px rgba(0,0,0,.2), 0 2px 2px 0 rgba(0,0,0,.14), 0 1px 5px 0 rgba(0,0,0,.12); border: solid ${thinBorder ? '3px' : '5px'} ${light ? '#DDD' : '#4371AD'}; background-color: #FBFBFB;'>
43
- <div title="${tooltipHeading && collapsed ? heading : ''}" style="position: relative;" ondragleave="${e => dragLeaveAction && dragLeaveAction(e)}" ondragend="${e => dragEndAction && dragEndAction(e)}" ondragover="${e => dragOverAction && dragOverAction(e)}" ondragstart="${e => dragStartAction && dragStartAction(e)}" draggable="${draggable ? 'true' : ''}" >
43
+ <div title="${tooltipHeading && collapsed ? heading : ''}" style="position: relative;" ondragleave=${e => dragLeaveAction && dragLeaveAction(e)} ondragend=${e => dragEndAction && dragEndAction(e)} ondragover=${e => dragOverAction && dragOverAction(e)} ondragstart=${e => dragStartAction && dragStartAction(e)} draggable="${draggable ? 'true' : ''}" >
44
44
  ${heading ? html`<div class="${styles.header}" onclick=${e => headerAction && headerAction(e)}>
45
45
  <h3 style="margin: 12px; max-width: calc(100% - ${optionsMenu ? '70' : '50'}px); color: ${light ? '#555;' : '#22487e'} ${collapsed ? 'text-overflow: ellipsis; white-space: nowrap; overflow: hidden;' : ''}">${heading}</h3>
46
46
 
@@ -49,13 +49,13 @@ export default ({ chevronStyle = null, on = true, content, heading = '', collaps
49
49
  ${moreVertical({ colour: '#ccc' })}
50
50
  </div>
51
51
  ${dropdown({
52
- side: 'right',
53
- width: '200px',
54
- margin: '5px',
55
- visible: optionsMenu.on,
56
- menuItems: optionsMenu.menuItems,
57
- backgroundColour: 'white'
58
- })}
52
+ side: 'right',
53
+ width: '200px',
54
+ margin: '5px',
55
+ visible: optionsMenu.on,
56
+ menuItems: optionsMenu.menuItems,
57
+ backgroundColour: 'white'
58
+ })}
59
59
  </div>` : ''}
60
60
  </div>` : ''}
61
61
  </div>
@@ -2,7 +2,7 @@ import { html, css, fieldIsTouched } from 'halfcab'
2
2
  import uploadIcon from './icons/upload.mjs'
3
3
 
4
4
  // Known extension groups used to infer acceptance from MIME major types during dragover
5
- const IMAGE_EXTS = new Set(['.jpg', '.jpeg', '.gif', '.bmp', '.tif', '.tiff', '.png', '.svg'])
5
+ const IMAGE_EXTS = new Set(['.jpg', '.jpeg', '.gif', '.bmp', '.tif', '.tiff', '.png', '.svg, .webp, .avif'])
6
6
  const VIDEO_EXTS = new Set(['.mxf', '.mkv', '.webm', '.mov', '.wmv', '.mp4', '.3gp', '.avi', '.mpg', '.mpeg', '.flv', '.asx', '.asf', '.divx', '.rm', '.m1v', '.m2v', '.m4v'])
7
7
  const PDF_EXTS = new Set(['.pdf'])
8
8
 
package/example/app.mjs CHANGED
@@ -214,7 +214,7 @@ const Showcase = () => html`
214
214
  property: 'fileImage',
215
215
  label: 'Upload image',
216
216
  placeholder: 'Choose/drop an image',
217
- accept: '.jpg, .jpeg, .gif, .bmp, .tif, .tiff, .png, .svg',
217
+ accept: '.jpg, .jpeg, .gif, .bmp, .tif, .tiff, .png, .svg, .webp, .avif',
218
218
  onchange: (e) => {
219
219
  const files = (e && e.files) || (e && e.target && (e.target.files || e.target._droppedFiles))
220
220
  const f = files && files[0]
@@ -22,6 +22,8 @@ const mime = (filePath) => {
22
22
  case '.png': return 'image/png'
23
23
  case '.jpg':
24
24
  case '.jpeg': return 'image/jpeg'
25
+ case '.webp': return 'image/webp'
26
+ case '.avif': return 'image/avif'
25
27
  case '.gif': return 'image/gif'
26
28
  default: return 'application/octet-stream'
27
29
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stalefish",
3
- "version": "8.1.14",
3
+ "version": "8.1.16",
4
4
  "description": "Simple function based component library for halfcab tagged template literals",
5
5
  "main": "index.mjs",
6
6
  "module": "index.mjs",
@@ -31,7 +31,7 @@
31
31
  },
32
32
  "homepage": "https://github.com/lorengreenfield/stalefish#readme",
33
33
  "devDependencies": {
34
- "halfcab": "^15.0.4",
34
+ "halfcab": "^15.0.6",
35
35
  "standard": "^12.0.1"
36
36
  },
37
37
  "dependencies": {