(kind = 'empty', { locked = false, encrypted = false } = {})
| 1030 | SVG icon helpers |
| 1031 | ----------------------*/ |
| 1032 | export function folderSVG(kind = 'empty', { locked = false, encrypted = false } = {}) { |
| 1033 | const gid = makeUid('g'); |
| 1034 | return ` |
| 1035 | <svg viewBox="0 0 24 24" aria-hidden="true" focusable="false" style="display:block;shape-rendering:geometricPrecision"> |
| 1036 | <defs> |
| 1037 | <clipPath id="${gid}-clipBack"><path d="M3.5 7.5 H10.5 L12.5 9.5 H20.5 C21.6 9.5 22.5 10.4 22.5 11.5 V19.5 C22.5 20.6 21.6 21.5 20.5 21.5 H5.5 C4.4 21.5 3.5 20.6 3.5 19.5 V9.5 C3.5 8.4 4.4 7.5 5.5 7.5 Z"/></clipPath> |
| 1038 | <clipPath id="${gid}-clipFront"><path d="M2.5 10.5 H11.5 L13.5 8.5 H20.5 C21.6 8.5 22.5 9.4 22.5 10.5 V17.5 C22.5 18.6 21.6 19.5 20.5 19.5 H4.5 C3.4 19.5 2.5 18.6 2.5 17.5 V10.5 Z"/></clipPath> |
| 1039 | <linearGradient id="${gid}-back" x1="4" y1="20" x2="20" y2="4" gradientUnits="userSpaceOnUse"> |
| 1040 | <stop offset="0" stop-color="#fff" stop-opacity="0"/><stop offset=".55" stop-color="#fff" stop-opacity=".10"/><stop offset="1" stop-color="#fff" stop-opacity="0"/> |
| 1041 | </linearGradient> |
| 1042 | <linearGradient id="${gid}-front" x1="6" y1="19" x2="19" y2="7" gradientUnits="userSpaceOnUse"> |
| 1043 | <stop offset="0" stop-color="#000" stop-opacity="0"/><stop offset="1" stop-color="#000" stop-opacity=".06"/> |
| 1044 | </linearGradient> |
| 1045 | </defs> |
| 1046 | <g class="back-group" clip-path="url(#${gid}-clipBack)"> |
| 1047 | <path class="folder-back" d="M3.5 7.5 H10.5 L12.5 9.5 H20.5 C21.6 9.5 22.5 10.4 22.5 11.5 V19.5 C22.5 20.6 21.6 21.5 20.5 21.5 H5.5 C4.4 21.5 3.5 20.6 3.5 19.5 V9.5 C3.5 8.4 4.4 7.5 5.5 7.5 Z"/> |
| 1048 | <path d="M3.5 7.5 H10.5 L12.5 9.5 H20.5 V21.5 H3.5 Z" fill="url(#${gid}-back)" pointer-events="none"/> |
| 1049 | </g> |
| 1050 | ${kind === 'paper' ? ` |
| 1051 | <g class="paper-group" transform="translate(0, -1.2)"> |
| 1052 | <rect class="paper" x="6.5" y="6.5" width="11" height="10" rx="1"/> |
| 1053 | <path class="paper-fold" d="M17.5 6.5 H15.2 L17.5 9.0 Z"/> |
| 1054 | <g transform="translate(0, -2.4)"> |
| 1055 | <path class="paper-ink" d="M9 11.3 H14.2" stroke="#4da3ff" stroke-width=".9" fill="none" stroke-linecap="round" stroke-linejoin="round" paint-order="normal" vector-effect="non-scaling-stroke"/> |
| 1056 | <path class="paper-ink" d="M9 12.8 H16.4" stroke="#4da3ff" stroke-width=".9" fill="none" stroke-linecap="round" stroke-linejoin="round" paint-order="normal" vector-effect="non-scaling-stroke"/> |
| 1057 | </g> |
| 1058 | </g>` : ``} |
| 1059 | <g class="front-group" clip-path="url(#${gid}-clipFront)"> |
| 1060 | <path class="folder-front" d="M2.5 10.5 H11.5 L13.5 8.5 H20.5 C21.6 8.5 22.5 9.4 22.5 10.5 V17.5 C22.5 18.6 21.6 19.5 20.5 19.5 H4.5 C3.4 19.5 2.5 18.6 2.5 17.5 V10.5 Z"/> |
| 1061 | <path d="M2.5 10.5 H11.5 L13.5 8.5 H20.5 V19.5 H2.5 Z" fill="url(#${gid}-front)" pointer-events="none"/> |
| 1062 | </g> |
| 1063 | |
| 1064 | ${locked ? ` |
| 1065 | <!-- Small padlock, positioned on the folder front, non-interactive --> |
| 1066 | <g class="lock-overlay" transform="translate(14.6, 10.6)" pointer-events="none"> |
| 1067 | <path class="lock-shackle" d="M1.9 3 V2.2 C1.9 1.2 2.8 0.3 3.8 0.3 C4.8 0.3 5.7 1.2 5.7 2.2 V3"/> |
| 1068 | <rect class="lock-body" x="0" y="3" width="7.6" height="5.6" rx="1.2"></rect> |
| 1069 | <circle class="lock-keyhole" cx="3.8" cy="6" r="0.7"></circle> |
| 1070 | </g>` : ``} |
| 1071 | |
| 1072 | ${(!locked && encrypted) ? ` |
| 1073 | <!-- Small "encrypted" badge (distinct from ACL lock) --> |
| 1074 | <g class="enc-overlay" transform="translate(2.0, 11.9) scale(1.12)" pointer-events="none"> |
| 1075 | <circle class="enc-badge" cx="4.5" cy="4.35" r="3.95"></circle> |
| 1076 | <path class="enc-mark-shackle" d="M3.25 4.05 V3.65 C3.25 2.95 3.80 2.40 4.50 2.40 C5.20 2.40 5.75 2.95 5.75 3.65 V4.05" /> |
| 1077 | <rect class="enc-mark-body" x="2.55" y="4.05" width="3.9" height="2.9" rx="0.65"></rect> |
| 1078 | <circle class="enc-mark-keyhole" cx="4.5" cy="5.6" r="0.45"></circle> |
| 1079 | </g>` : ``} |
| 1080 | |
| 1081 | <path class="lip-highlight" d="M3 10.5 H11.5 L13.5 8.5 H20.3"/> |
| 1082 | </svg>`; |
| 1083 | } |
| 1084 | function setFolderIconForOption(optEl, kind) { |
| 1085 | const iconEl = optEl.querySelector('.folder-icon'); |
| 1086 | if (!iconEl) return; |
no test coverage detected