@septkit/ui 0.0.65 → 0.0.67

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.
@@ -0,0 +1,124 @@
1
+ import e from "../explorer/explorer.js";
2
+ import "../explorer/index.js";
3
+ import { buildTree as t, pruneForSearch as n } from "./build-tree.js";
4
+ import { computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, defineComponent as c, normalizeClass as l, openBlock as u, ref as d, toDisplayString as f, unref as p, vModelText as m, withCtx as h, withDirectives as g } from "vue";
5
+ //#region lib/library-browser/library-browser.vue?vue&type=script&setup=true&lang.ts
6
+ var _ = { class: "library-browser" }, v = {
7
+ key: 0,
8
+ class: "library-browser__empty-hint",
9
+ "data-testid": "library-browser-empty-hint"
10
+ }, y = {
11
+ key: 1,
12
+ class: "library-browser__offline-hint"
13
+ }, b = "::", x = /*@__PURE__*/ c({
14
+ __name: "library-browser",
15
+ props: {
16
+ sources: {},
17
+ extensions: {},
18
+ storageKey: {}
19
+ },
20
+ emits: ["select"],
21
+ setup(c, { emit: x }) {
22
+ let S = c, C = x, w = d(""), T = r(() => S.extensions.map((e) => e.toLowerCase())), E = r(() => {
23
+ let e = w.value.trim().toLowerCase();
24
+ return S.sources.map((r) => {
25
+ let i = r.status === "online" ? t(r.entries, T.value) : [];
26
+ return {
27
+ source: r,
28
+ nodes: e ? n(i, e) : i
29
+ };
30
+ });
31
+ }), D = r(() => {
32
+ let e = /* @__PURE__ */ new Set(), t = /* @__PURE__ */ new Set();
33
+ return {
34
+ items: E.value.map(({ source: n, nodes: r }) => (n.status === "offline" ? t.add(n.id) : r.some((e) => e.matchesExtension) || e.add(n.id), {
35
+ id: n.id,
36
+ name: n.label,
37
+ tag: "",
38
+ selectable: !1,
39
+ children: n.status === "online" ? r.map((t) => F(t, n.id, e)) : void 0
40
+ })),
41
+ emptyHints: e,
42
+ offline: t
43
+ };
44
+ });
45
+ function O(e) {
46
+ return !e.includes(b);
47
+ }
48
+ let k = r(() => w.value.trim().length > 0), A = d(N()), j = r(() => k.value ? {
49
+ scoped: [],
50
+ all: !0
51
+ } : A.value);
52
+ function M(e) {
53
+ k.value || (A.value = e, S.storageKey && localStorage.setItem(S.storageKey, JSON.stringify(e)));
54
+ }
55
+ function N() {
56
+ if (!S.storageKey) return {
57
+ scoped: [],
58
+ all: !1
59
+ };
60
+ try {
61
+ let e = localStorage.getItem(S.storageKey), t = e ? JSON.parse(e) : void 0;
62
+ if (t && Array.isArray(t.scoped)) return {
63
+ scoped: t.scoped,
64
+ all: !!t.all
65
+ };
66
+ } catch {}
67
+ return {
68
+ scoped: [],
69
+ all: !1
70
+ };
71
+ }
72
+ function P(e) {
73
+ let t = e.id.indexOf(b);
74
+ e.selectable === !1 || t === -1 || C("select", {
75
+ sourceId: e.id.slice(0, t),
76
+ path: e.id.slice(t + 2)
77
+ });
78
+ }
79
+ function F(e, t, n) {
80
+ let r = `${t}${b}${e.path}`;
81
+ return e.kind === "directory" ? (e.matchesExtension || n.add(r), {
82
+ id: r,
83
+ name: e.name,
84
+ tag: "",
85
+ selectable: !1,
86
+ children: e.children.map((e) => F(e, t, n))
87
+ }) : {
88
+ id: r,
89
+ name: e.name,
90
+ tag: "",
91
+ selectable: !0
92
+ };
93
+ }
94
+ return (t, n) => (u(), o("div", _, [g(s("input", {
95
+ "onUpdate:modelValue": n[0] ||= (e) => w.value = e,
96
+ type: "search",
97
+ class: "input input-sm library-browser__search",
98
+ placeholder: "Search...",
99
+ "data-testid": "library-browser-search"
100
+ }, null, 512), [[m, w.value]]), D.value.items.length ? (u(), i(p(e), {
101
+ key: 0,
102
+ items: D.value.items,
103
+ expanded: j.value,
104
+ "aria-label": "Template Library Browser",
105
+ "onUpdate:expanded": M,
106
+ onSelect: P
107
+ }, {
108
+ "node-label": h(({ node: e }) => [
109
+ s("span", {
110
+ class: l(["library-browser__label", {
111
+ offline: D.value.offline.has(e.id),
112
+ "library-browser__label--root": O(e.id)
113
+ }]),
114
+ "data-testid": "library-browser-node-label"
115
+ }, f(e.name), 3),
116
+ D.value.emptyHints.has(e.id) ? (u(), o("span", v, " No matching files ")) : a("", !0),
117
+ D.value.offline.has(e.id) ? (u(), o("span", y, " Offline ")) : a("", !0)
118
+ ]),
119
+ _: 1
120
+ }, 8, ["items", "expanded"])) : a("", !0)]));
121
+ }
122
+ });
123
+ //#endregion
124
+ export { x as default };
@@ -0,0 +1,4 @@
1
+ import { NOTE_CATEGORIES as e, NOTE_CATEGORY_LABELS as t, NOTE_STATUSES as n, parseNoteData as r, serializeNoteData as i } from "./note-data.js";
2
+ import a from "./note-category-tag.js";
3
+ import o from "./note-category-picker.js";
4
+ export { e as NOTE_CATEGORIES, t as NOTE_CATEGORY_LABELS, n as NOTE_STATUSES, o as NoteCategoryPicker, a as NoteCategoryTag, r as parseNoteData, i as serializeNoteData };
@@ -0,0 +1,8 @@
1
+ //#region lib/notes/note-category-colors.ts
2
+ var e = {
3
+ feedback: "[--badge-color:#0969da]",
4
+ instantiation: "[--badge-color:#8250df]",
5
+ interlock: "[--badge-color:#bc4c00]"
6
+ };
7
+ //#endregion
8
+ export { e as NOTE_CATEGORY_COLOR_CLASSES };
@@ -0,0 +1,5 @@
1
+ import e from "./note-category-picker.vue_vue_type_script_setup_true_lang.js";
2
+ //#region lib/notes/note-category-picker.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -0,0 +1,31 @@
1
+ import e from "../external/.pnpm/@lucide_vue@1.23.0_vue@3.5.39_typescript@5.8.3_/node_modules/@lucide/vue/dist/esm/icons/check.js";
2
+ import { NOTE_CATEGORIES as t, NOTE_CATEGORY_LABELS as n } from "./note-data.js";
3
+ import { NOTE_CATEGORY_COLOR_CLASSES as r } from "./note-category-colors.js";
4
+ import { Fragment as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, defineComponent as u, normalizeClass as d, openBlock as f, renderList as p, toDisplayString as m, unref as h, useModel as g, vModelCheckbox as _, withDirectives as v } from "vue";
5
+ //#region lib/notes/note-category-picker.vue?vue&type=script&setup=true&lang.ts
6
+ var y = { class: "fieldset py-0" }, b = { class: "flex flex-wrap gap-1.5" }, x = ["value"], S = /*@__PURE__*/ u({
7
+ __name: "note-category-picker",
8
+ props: {
9
+ modelValue: { required: !0 },
10
+ modelModifiers: {}
11
+ },
12
+ emits: ["update:modelValue"],
13
+ setup(u) {
14
+ let S = g(u, "modelValue");
15
+ return (u, g) => (f(), s("fieldset", y, [g[1] ||= c("legend", { class: "fieldset-legend py-1 font-normal text-base-content/60" }, "Categories", -1), c("div", b, [(f(!0), s(i, null, p(h(t), (t) => (f(), s("label", {
16
+ key: t,
17
+ class: "cursor-pointer"
18
+ }, [v(c("input", {
19
+ "onUpdate:modelValue": g[0] ||= (e) => S.value = e,
20
+ class: "peer sr-only",
21
+ type: "checkbox",
22
+ value: t
23
+ }, null, 8, x), [[_, S.value]]), c("span", { class: d(["badge badge-sm gap-1 font-semibold select-none transition-colors peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:outline-(--badge-color)", [h(r)[t], S.value.includes(t) ? "[--badge-fg:#fff]" : "badge-outline hover:[--badge-bg:color-mix(in_oklab,var(--badge-color)_12%,transparent)]"]]) }, [S.value.includes(t) ? (f(), a(h(e), {
24
+ key: 0,
25
+ class: "size-3",
26
+ "stroke-width": 3
27
+ })) : o("", !0), l(" " + m(h(n)[t]), 1)], 2)]))), 128))])]));
28
+ }
29
+ });
30
+ //#endregion
31
+ export { S as default };
@@ -0,0 +1,5 @@
1
+ import e from "./note-category-tag.vue_vue_type_script_setup_true_lang.js";
2
+ //#region lib/notes/note-category-tag.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -0,0 +1,13 @@
1
+ import { NOTE_CATEGORY_LABELS as e } from "./note-data.js";
2
+ import { NOTE_CATEGORY_COLOR_CLASSES as t } from "./note-category-colors.js";
3
+ import { createElementBlock as n, defineComponent as r, normalizeClass as i, openBlock as a, toDisplayString as o, unref as s } from "vue";
4
+ //#region lib/notes/note-category-tag.vue?vue&type=script&setup=true&lang.ts
5
+ var c = /*@__PURE__*/ r({
6
+ __name: "note-category-tag",
7
+ props: { category: {} },
8
+ setup(r) {
9
+ return (c, l) => (a(), n("span", { class: i(["badge badge-sm font-semibold [--badge-fg:#fff]", s(t)[r.category]]) }, o(s(e)[r.category]), 3));
10
+ }
11
+ });
12
+ //#endregion
13
+ export { c as default };
@@ -0,0 +1,49 @@
1
+ //#region lib/notes/note-data.ts
2
+ var e = [
3
+ "open",
4
+ "resolved",
5
+ "removed"
6
+ ], t = [
7
+ "feedback",
8
+ "instantiation",
9
+ "interlock"
10
+ ], n = {
11
+ feedback: "Feedback",
12
+ instantiation: "Instantiation",
13
+ interlock: "Interlock"
14
+ };
15
+ function r(t) {
16
+ try {
17
+ let n = JSON.parse(t ?? "");
18
+ if (typeof n.user == "string" && typeof n.created == "string" && typeof n.lastModified == "string" && e.includes(n.status) && typeof n.text == "string") {
19
+ let { tags: e, ...t } = n;
20
+ return {
21
+ ...t,
22
+ ...a(e)
23
+ };
24
+ }
25
+ return;
26
+ } catch {
27
+ return;
28
+ }
29
+ }
30
+ function i({ categories: e, otherTags: n, ...r }) {
31
+ let i = [...t.filter((t) => e.includes(t)), ...n].join(";");
32
+ return JSON.stringify(i ? {
33
+ ...r,
34
+ tags: i
35
+ } : r);
36
+ }
37
+ function a(e) {
38
+ if (typeof e != "string") return {
39
+ categories: [],
40
+ otherTags: []
41
+ };
42
+ let n = [...new Set(e.split(";").map((e) => e.trim()))].filter(Boolean);
43
+ return {
44
+ categories: t.filter((e) => n.includes(e)),
45
+ otherTags: n.filter((e) => !t.includes(e))
46
+ };
47
+ }
48
+ //#endregion
49
+ export { t as NOTE_CATEGORIES, n as NOTE_CATEGORY_LABELS, e as NOTE_STATUSES, r as parseNoteData, i as serializeNoteData };