Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 | 117x 117x 117x 117x | import { DateTime } from 'luxon';
import { Plugin } from '../../model/plugin';
import { Mod } from '../../model/tag';
import { Template } from '../../model/template';
export const imagePlugin: Plugin = {
tag: 'plugin/image',
name: $localize`🖼️ Image`,
config: {
mod: $localize`🖼️ Images`,
version: 1,
type: 'plugin',
default: true,
proxy: true,
add: true,
embeddable: true,
generated: $localize`Generated by jasper-ui ${DateTime.now().toISO()}`,
submit: $localize`🖼️ image`,
icons: [{ label: $localize`🖼️`, order: 2 }],
filters: [
{ query: 'plugin/image', label: $localize`🖼️ image`, title: $localize`Images`, group: $localize`Media 🎬️` },
],
extensions: ['.png', '.jpg', '.jpeg', '.gif', '.svg', '.webp'],
description: $localize`Display an image.`,
advancedForm: [{
key: 'url',
type: 'image',
props: {
label: $localize`URL: `,
},
}, {
key: 'width',
type: 'number',
props: {
label: $localize`Width: `,
},
}, {
key: 'height',
type: 'number',
props: {
label: $localize`Height: `,
},
}],
},
schema: {
optionalProperties: {
url: { type: 'string' },
width: { type: 'uint16' },
height: { type: 'uint16' },
},
},
};
export const imageTemplate: Template = {
tag: 'plugin/image',
name: $localize`🖼️ Images`,
config: {
mod: $localize`🖼️ Images`,
version: 1,
type: 'plugin',
default: true,
generated: $localize`Generated by jasper-ui ${DateTime.now().toISO()}`,
view: $localize`🖼️`,
description: $localize`Activates built-in Image viewer mode for viewing Refs.`,
// language=CSS
css: `
app-ref-list.plugin_image {
.list-container {
grid-auto-flow: row dense;
padding: 4px;
gap: 8px;
grid-template-columns: 1fr;
@media (min-width: 1000px) {
grid-template-columns: 1fr 1fr;
}
@media (min-width: 1500px) {
grid-template-columns: 1fr 1fr 1fr;
}
@media (min-width: 2000px) {
grid-template-columns: 1fr 1fr 1fr 1fr;
}
.list-number {
display: none;
}
.ref {
position: relative;
margin: 0;
padding: 0;
.expand {
display: none;
}
.image-expand {
position: relative;
min-width: 100%;
min-height: 100%;
border-radius: 7px;
overflow: hidden;
margin: 0;
padding: 0;
}
& > .row {
display: none;
position: absolute;
top: 6px;
left: 6px;
overflow: hidden;
padding: 8px;
border-radius: 8px;
z-index: 2;
}
&:hover > .row {
display: block;
}
&:focus-within > .row:not(:focus-within) {
display: none;
}
&.mobile-unlock > .row {
display: block !important;
}
.toggle,
.thumbnail {
display: none;
}
@media (max-width: 740px) {
.actions, .info {
height: 28px;
}
}
}
}
}
body.dark-theme app-ref-list.plugin_image {
.list-container .ref > .row {
backdrop-filter: grayscale(1) contrast(0.4) brightness(0.4) blur(8px);
border: 0.5px solid rgba(255, 255, 255, 0.2);
}
.list-container .ref .image-expand {
backdrop-filter: grayscale(1) brightness(0.9) blur(0.5px);
}
}
body.light-theme app-ref-list.plugin_image {
.list-container .ref > .row {
backdrop-filter: grayscale(1) contrast(0.3) brightness(1.5) blur(8px);
}
.list-container .ref .image-expand {
backdrop-filter: grayscale(1) brightness(0.9) blur(0.5px);
}
}
`,
advancedForm: [{
key: 'defaultExpanded',
type: 'boolean',
defaultValue: true,
props: {
label: $localize`Default Expanded:`,
},
}, {
key: 'hideEdit',
type: 'boolean',
defaultValue: true,
props: {
label: $localize`Hide Edit:`,
},
}, {
key: 'disableResize',
type: 'boolean',
defaultValue: true,
props: {
label: $localize`Disable Resize:`,
},
}],
},
defaults: {
defaultExpanded: true,
hideEdit: true,
disableResize: true,
defaultCols: 0, // Leave to CSS screen size detection, but show cols dropdown
}
};
export const imageMod: Mod = {
plugin: [
imagePlugin,
],
template: [
imageTemplate,
],
};
|