@hackbuild/ai-views 0.1.1 → 0.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/README.md +25 -5
- package/dist/elements.d.ts +1 -1
- package/dist/elements.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/loaders.d.ts +100 -0
- package/dist/loaders.js +308 -0
- package/dist/mount-model.d.ts +10 -1
- package/dist/mount-model.js +25 -4
- package/dist/single/elements.iife.js +26 -3
- package/dist/single/elements.js +25 -4
- package/dist/single/index.iife.js +17032 -6187
- package/dist/single/index.js +17030 -6188
- package/dist/single/vue.iife.js +24 -3
- package/dist/single/vue.js +24 -3
- package/llms.md +100 -0
- package/package.json +3 -1
package/dist/single/elements.js
CHANGED
|
@@ -8720,9 +8720,29 @@ function pickSheet(pick) {
|
|
|
8720
8720
|
}
|
|
8721
8721
|
};
|
|
8722
8722
|
}
|
|
8723
|
+
const FILLER = /^(instruct|chat|it|mlc|onnx|gguf|hf|q\d\w*|f16|f32|fp16|int8|bf16|uniform)$/i;
|
|
8724
|
+
/**
|
|
8725
|
+
* A model name cut for the bar chip: filler words (instruct, chat, quant tags)
|
|
8726
|
+
* go, and a name of more than three words keeps its first two and its last,
|
|
8727
|
+
* which is usually the size: "hermes 3 llama 3.2 3b" reads "hermes 3 3b".
|
|
8728
|
+
* A note in brackets goes first: "slimsam 77 uniform (point prompts)" reads "slimsam 77".
|
|
8729
|
+
*/
|
|
8730
|
+
function shortName(name) {
|
|
8731
|
+
const w = name.replace(/\s*\([^)]*\)/g, "").split(/\s+/).filter((x) => x && !FILLER.test(x));
|
|
8732
|
+
return (w.length > 3 ? [
|
|
8733
|
+
w[0],
|
|
8734
|
+
w[1],
|
|
8735
|
+
w[w.length - 1]
|
|
8736
|
+
] : w).join(" ") || name;
|
|
8737
|
+
}
|
|
8738
|
+
/** The chip's words: the short name, then the download size, or the state once it moves. */
|
|
8723
8739
|
function chipWords(s) {
|
|
8724
|
-
const
|
|
8725
|
-
|
|
8740
|
+
const r = s.row;
|
|
8741
|
+
if (!r) return s.empty;
|
|
8742
|
+
const w = $r(r, s.empty);
|
|
8743
|
+
const name = shortName(r.name);
|
|
8744
|
+
if ((r.state === "loading" || r.state === "loaded" || r.state === "error") && w.state) return `${name}, ${w.state}`;
|
|
8745
|
+
return `${name}, ${r.noDownload ? "no download" : r.size ?? "size unknown"}`;
|
|
8726
8746
|
}
|
|
8727
8747
|
/** The closed picker over a host; pressing it opens the sheet. */
|
|
8728
8748
|
function mountModelSelect(host, pick, o = {}) {
|
|
@@ -8732,7 +8752,8 @@ function mountModelSelect(host, pick, o = {}) {
|
|
|
8732
8752
|
if (o.variant === "chip") {
|
|
8733
8753
|
const draw = (s) => {
|
|
8734
8754
|
const words = chipWords(s);
|
|
8735
|
-
|
|
8755
|
+
const full = s.row ? `model: ${s.row.name}${s.row.size ? `, ${s.row.size}` : ""}${$r(s.row, s.empty).state ? `, ${$r(s.row, s.empty).state}` : ""}` : `model: ${s.empty}`;
|
|
8756
|
+
host.innerHTML = `<button type="button" class="hb-msel-chip${s.row?.state ? ` is-${s.row.state}` : ""}" aria-haspopup="dialog" aria-label="${esc(full)}" title="${esc(full)}"><span>${esc(words)}</span></button>`;
|
|
8736
8757
|
};
|
|
8737
8758
|
l.on(host, "click", (e) => {
|
|
8738
8759
|
if (e.target.closest(".hb-msel-chip")) sheet.open();
|
|
@@ -9570,4 +9591,4 @@ function define(prefix = "", registry, Base) {
|
|
|
9570
9591
|
return tag;
|
|
9571
9592
|
});
|
|
9572
9593
|
}
|
|
9573
|
-
export { ELEMENT_NAMES, define, gateWords, mountCameraFeed, mountChatList, mountChatPane, mountComposer, mountContextMeter, mountFrameView, mountMaskRack, mountMaskStudio, mountMaskTools, mountMaskVerbs, mountMemoryInspector, mountModelJobs, mountModelSelect, mountTranscribeDrop, mountTranscribeQueue, mountTranscriptExports, mountTranscriptView, pickSheet, transcriptHtml, turnHtml };
|
|
9594
|
+
export { ELEMENT_NAMES, chipWords, define, gateWords, mountCameraFeed, mountChatList, mountChatPane, mountComposer, mountContextMeter, mountFrameView, mountMaskRack, mountMaskStudio, mountMaskTools, mountMaskVerbs, mountMemoryInspector, mountModelJobs, mountModelSelect, mountTranscribeDrop, mountTranscribeQueue, mountTranscriptExports, mountTranscriptView, pickSheet, shortName, transcriptHtml, turnHtml };
|