@nonoun/native-ui 0.2.9 → 0.3.0
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/dist/{ui-layout-inspector-element.js → components.js} +2279 -386
- package/dist/{register-all2.js → core.js} +78 -35
- package/dist/custom-elements.json +1999 -1999
- package/dist/kernel.js +175 -174
- package/dist/native-ui.js +4 -49
- package/dist/register-all.js +4 -4
- package/dist/traits.js +3 -5
- package/dist/ui-icon.js +56 -0
- package/package.json +6 -9
- package/dist/dialog-controller.js +0 -391
- package/dist/inspector/build-inspector.d.ts +0 -8
- package/dist/inspector/build-inspector.d.ts.map +0 -1
- package/dist/inspector/ds-color-swatch-element.d.ts +0 -15
- package/dist/inspector/ds-color-swatch-element.d.ts.map +0 -1
- package/dist/inspector/ds-color-swatch.d.ts +0 -3
- package/dist/inspector/ds-color-swatch.d.ts.map +0 -1
- package/dist/inspector/ds-colors-element.d.ts +0 -14
- package/dist/inspector/ds-colors-element.d.ts.map +0 -1
- package/dist/inspector/ds-colors.d.ts +0 -4
- package/dist/inspector/ds-colors.d.ts.map +0 -1
- package/dist/inspector/ds-inspector-element.d.ts +0 -15
- package/dist/inspector/ds-inspector-element.d.ts.map +0 -1
- package/dist/inspector/ds-inspector.d.ts +0 -3
- package/dist/inspector/ds-inspector.d.ts.map +0 -1
- package/dist/inspector/ds-themes-element.d.ts +0 -13
- package/dist/inspector/ds-themes-element.d.ts.map +0 -1
- package/dist/inspector/ds-themes.d.ts +0 -4
- package/dist/inspector/ds-themes.d.ts.map +0 -1
- package/dist/inspector/ds-variable-element.d.ts +0 -19
- package/dist/inspector/ds-variable-element.d.ts.map +0 -1
- package/dist/inspector/ds-variable.d.ts +0 -4
- package/dist/inspector/ds-variable.d.ts.map +0 -1
- package/dist/inspector/index.d.ts +0 -10
- package/dist/inspector/index.d.ts.map +0 -1
- package/dist/inspector.css +0 -231
- package/dist/inspector.d.ts +0 -11
- package/dist/inspector.d.ts.map +0 -1
- package/dist/inspector.js +0 -610
- package/dist/list-navigate-controller.js +0 -457
- package/dist/ui-icon-element.js +0 -986
- package/dist/uid.js +0 -147
package/dist/native-ui.js
CHANGED
|
@@ -1,49 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import { _ as _e, a as ve, c as ye, d as be, f as xe, g as Se, h as Ce, i as we, l as Te, m as Ee, n as De, o as Oe, p as ke, r as Ae, s as je, t as Q, u as Me, v as Ne } from "./ui-icon-element.js";
|
|
6
|
-
import { $ as Pe, A as Fe, B as Ie, C as Le, D as Re, E as ze, F as Be, G as Ve, H as He, I as Ue, J as We, K as Ge, L as Ke, M as qe, N as Je, O as Ye, P as Xe, Q as Ze, R as Qe, S as $e, T as et, U as tt, V as nt, W as rt, X as it, Y as at, Z as ot, _ as st, a as ct, at as lt, b as ut, c as dt, ct as ft, d as pt, et as mt, f as ht, g as gt, h as _t, i as vt, it as yt, j as bt, k as xt, l as St, lt as Ct, m as wt, n as Tt, nt as Et, o as Dt, ot as Ot, p as kt, q as At, r as jt, rt as Mt, s as Nt, st as Pt, t as Ft, tt as It, u as Lt, v as Rt, w as zt, x as Bt, y as Vt, z as Ht } from "./ui-layout-inspector-element.js";
|
|
7
|
-
var $ = class extends Event {
|
|
8
|
-
context;
|
|
9
|
-
callback;
|
|
10
|
-
constructor(e, t) {
|
|
11
|
-
super("context-request", {
|
|
12
|
-
bubbles: !0,
|
|
13
|
-
composed: !0
|
|
14
|
-
}), this.context = e, this.callback = t;
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
function Ut(e) {
|
|
18
|
-
return class extends e {
|
|
19
|
-
#e = /* @__PURE__ */ new Map();
|
|
20
|
-
provideContext(e, t) {
|
|
21
|
-
this.#e.set(e, t);
|
|
22
|
-
}
|
|
23
|
-
connectedCallback() {
|
|
24
|
-
super.connectedCallback?.(), this.addEventListener("context-request", this.#t);
|
|
25
|
-
}
|
|
26
|
-
disconnectedCallback() {
|
|
27
|
-
super.disconnectedCallback?.(), this.removeEventListener("context-request", this.#t);
|
|
28
|
-
}
|
|
29
|
-
#t = (e) => {
|
|
30
|
-
if (!(e instanceof $)) return;
|
|
31
|
-
let t = this.#e.get(e.context);
|
|
32
|
-
t !== void 0 && (e.stopPropagation(), e.callback(t));
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
function Wt(e) {
|
|
37
|
-
return class extends e {
|
|
38
|
-
#e = /* @__PURE__ */ new Map();
|
|
39
|
-
requestContext(e, t) {
|
|
40
|
-
this.dispatchEvent(new $(e, (n) => {
|
|
41
|
-
this.#e.set(e, n), t?.(n);
|
|
42
|
-
}));
|
|
43
|
-
}
|
|
44
|
-
getContext(e) {
|
|
45
|
-
return this.#e.get(e) ?? null;
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
export { Fe as CalendarStore, f as ClipboardController, u as CollapsibleController, Qe as ColumnResizeController, Wt as ContextConsumer, Ut as ContextProvider, $ as ContextRequestEvent, _ as CopyController, ke as DataListController, o as DialogController, pe as DismissController, de as DismissStack, a as DragController, F as DropZoneController, m as EditController, v as FocusTrapController, Ce as FormAssociable, ce as GestureRouter, y as HoverController, g as IntersectController, he as ListNavigateController, ue as PopoverController, Z as PressController, w as RangeSelectController, i as ResizeController, se as RovingFocusController, b as SearchController, je as SelectController, X as SelectionController, s as SortController, h as SwipeController, Ht as TableStore, d as ToastController, me as ToastManager, At as UIAccordion, Ge as UIAccordionItem, zt as UIAvatar, Le as UIBadge, Bt as UIBreadcrumb, ut as UIBreadcrumbItem, Me as UIButton, xt as UICalendar, Nt as UICard, dt as UIChatInput, mt as UICheckbox, Ye as UICombobox, Ot as UICommand, It as UICommandEmpty, Et as UICommandGroup, lt as UICommandInput, Mt as UICommandItem, yt as UICommandList, St as UIController, Ve as UIDialog, Rt as UIDrawer, ge as UIElement, Re as UIField, Q as UIIcon, Ct as UIInput, et as UIInputOtp, $e as UIKbd, Tt as UILayoutChat, Ft as UILayoutInspector, vt as UILayoutSidebar, jt as UILayoutSidebarItem, Te as UIListbox, kt as UINav, pt as UINavGroup, Lt as UINavGroupHeader, ht as UINavItem, ye as UIOption, Pt as UIOptionGroup, ft as UIOptionGroupHeader, Vt as UIPagination, Ze as UIRadio, ot as UIRadioGroup, ve as UIRange, Dt as UISection, at as UISegment, it as UISegmentedControl, Oe as UISelect, wt as UISlide, _t as UISlideshow, Pe as UISwitch, tt as UITab, He as UITabPanel, nt as UITabPanels, Ke as UITable, Be as UITableBody, Je as UITableCell, Ue as UITableHead, qe as UITableHeader, Xe as UITableRow, rt as UITabs, ze as UITextarea, ct as UIToolbar, We as UITooltip, st as UITree, gt as UITreeItem, I as ValidateController, c as VirtualScrollController, te as batch, P as clippableAdapter, E as collapsibleAdapter, ie as collectTraitOptions, e as computed, l as copyableAdapter, bt as createCalendarStore, Ee as createDataList, Ne as createDisabledEffect, Ie as createTableStore, p as debugReactive, n as define, A as dialogableAdapter, N as dismissableAdapter, G as draggableAdapter, J as droppableAdapter, z as editableAdapter, t as effect, be as fetchDataOptions, K as focusTrappableAdapter, De as getIcon, fe as getRegisteredTraitNames, le as getTrait, re as getTraitRuntime, q as hoverableAdapter, x as intersectableAdapter, C as isComputed, T as isSignal, j as listNavigableAdapter, Ae as onIconRegistered, xe as parseDataOptions, ae as parseTraitAttribute, V as popoverableAdapter, S as pressableAdapter, Se as prop, L as rangeSelectableAdapter, W as registerAllTraits, we as registerIcon, oe as registerTrait, k as resizableAdapter, M as rovingFocusableAdapter, D as searchableAdapter, B as selectableAdapter, ee as signal, O as sortableAdapter, H as swipeableAdapter, _e as syncProp, R as toastableAdapter, ne as uid, r as untrack, Y as validatableAdapter, U as virtualizableAdapter };
|
|
1
|
+
import { $ as e, A as t, At as n, B as r, Bt as i, C as a, Ct as o, D as s, Dt as c, E as l, Et as u, F as d, Ft as f, G as p, Gt as m, H as h, Ht as g, I as _, It as v, J as y, K as b, Kt as x, L as S, Lt as C, M as w, Mt as T, N as E, Nt as D, O, Ot as k, P as A, Pt as j, Q as M, R as N, Rt as P, S as F, St as I, T as L, Tt as R, U as z, Ut as B, V, Vt as H, W as U, Wt as W, X as G, Y as K, Z as q, _ as J, _t as Y, a as X, at as Z, b as Q, bt as $, c as ee, ct as te, d as ne, dt as re, et as ie, f as ae, ft as oe, g as se, gt as ce, h as le, ht as ue, i as de, it as fe, j as pe, jt as me, k as he, kt as ge, l as _e, lt as ve, m as ye, mt as be, n as xe, nt as Se, o as Ce, ot as we, p as Te, pt as Ee, q as De, qt as Oe, r as ke, rt as Ae, s as je, st as Me, t as Ne, tt as Pe, u as Fe, ut as Ie, v as Le, vt as Re, w as ze, wt as Be, x as Ve, xt as He, y as Ue, yt as We, z as Ge, zt as Ke } from "./components.js";
|
|
2
|
+
import { A as qe, B as Je, C as Ye, D as Xe, E as Ze, F as Qe, G as $e, H as et, I as tt, J as nt, K as rt, L as it, M as at, N as ot, O as st, P as ct, R as lt, S as ut, T as dt, U as ft, V as pt, W as mt, _ as ht, a as gt, b as _t, c as vt, d as yt, f as bt, g as xt, h as St, i as Ct, j as wt, k as Tt, l as Et, m as Dt, n as Ot, o as kt, p as At, q as jt, r as Mt, s as Nt, t as Pt, u as Ft, v as It, w as Lt, x as Rt, y as zt, z as Bt } from "./core.js";
|
|
3
|
+
import { i as Vt, n as Ht, r as Ut, t as Wt } from "./ui-icon.js";
|
|
4
|
+
export { E as CalendarStore, Qe as ClipboardController, Xe as CollapsibleController, V as ColumnResizeController, et as ContextConsumer, ft as ContextProvider, mt as ContextRequestEvent, ot as CopyController, u as DataListController, ce as DialogController, We as DismissController, k as DismissStack, o as DragController, wt as DropZoneController, tt as EditController, st as FocusTrapController, T as FormAssociable, me as GestureRouter, ct as HoverController, at as IntersectController, Y as ListNavigateController, Re as PopoverController, He as PressController, pt as RangeSelectController, I as ResizeController, $ as RovingFocusController, lt as SearchController, pe as SelectController, Bt as SelectionController, qe as SortController, it as SwipeController, h as TableStore, Ze as ToastController, ge as ToastManager, G as UIAccordion, K as UIAccordionItem, ze as UIAvatar, a as UIBadge, Ve as UIBreadcrumb, Q as UIBreadcrumbItem, ue as UIButton, w as UICalendar, je as UICard, ee as UIChatInput, Ae as UICheckbox, he as UICombobox, ve as UICommand, fe as UICommandEmpty, Z as UICommandGroup, te as UICommandInput, we as UICommandItem, Me as UICommandList, _e as UIController, y as UIDialog, Le as UIDrawer, C as UIElement, O as UIField, Wt as UIIcon, be as UIInput, L as UIInputOtp, F as UIKbd, xe as UILayoutChat, Ne as UILayoutInspector, de as UILayoutSidebar, ke as UILayoutSidebarItem, Ee as UIListbox, Te as UINav, ne as UINavGroup, Fe as UINavGroupHeader, ae as UINavItem, oe as UIOption, Ie as UIOptionGroup, re as UIOptionGroupHeader, Ue as UIPagination, Pe as UIRadio, ie as UIRadioGroup, l as UIRange, Ce as UISection, M as UISegment, e as UISegmentedControl, t as UISelect, ye as UISlide, le as UISlideshow, Se as UISwitch, b as UITab, p as UITabPanel, U as UITabPanels, r as UITable, N as UITableBody, _ as UITableCell, Ge as UITableHead, d as UITableHeader, S as UITableRow, De as UITabs, s as UITextarea, X as UIToolbar, q as UITooltip, J as UITree, se as UITreeItem, Tt as ValidateController, Je as VirtualScrollController, W as batch, Ct as clippableAdapter, ht as collapsibleAdapter, P as collectTraitOptions, x as computed, Ye as copyableAdapter, A as createCalendarStore, c as createDataList, f as createDisabledEffect, z as createTableStore, rt as debugReactive, $e as define, yt as dialogableAdapter, St as dismissableAdapter, Ft as draggableAdapter, Rt as droppableAdapter, Ot as editableAdapter, m as effect, Be as fetchDataOptions, It as focusTrappableAdapter, Ht as getIcon, i as getRegisteredTraitNames, H as getTrait, n as getTraitRuntime, Lt as hoverableAdapter, ut as intersectableAdapter, jt as isComputed, nt as isSignal, bt as listNavigableAdapter, Ut as onIconRegistered, R as parseDataOptions, Ke as parseTraitAttribute, At as popoverableAdapter, dt as pressableAdapter, D as prop, Et as rangeSelectableAdapter, Pt as registerAllTraits, Vt as registerIcon, g as registerTrait, vt as resizableAdapter, xt as rovingFocusableAdapter, gt as searchableAdapter, kt as selectableAdapter, Oe as signal, _t as sortableAdapter, Mt as swipeableAdapter, j as syncProp, Dt as toastableAdapter, v as uid, B as untrack, zt as validatableAdapter, Nt as virtualizableAdapter };
|
package/dist/register-all.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { $ as e, A as t, B as ee, C as n, D as r, E as i, F as a, G as o, I as s, J as c, K as l, L as u, M as d, O as f, Q as p, R as m, S as h, T as g, W as _, X as v, Y as y, Z as b, _ as x, a as S, at as C, b as w, c as T, ct as E, d as D, dt as O, et as te, f as k, ft as A, g as j, h as M, ht as N, i as P, it as F, k as I, l as L, lt as R, m as z, mt as B, n as V, nt as H, o as U, ot as W, p as G, pt as K, q, r as J, rt as Y, s as X, st as Z, tt as Q, u as ne, ut as re, v as ie, w as ae, x as oe, y as se, z as ce } from "./components.js";
|
|
2
|
+
import { G as $ } from "./core.js";
|
|
3
|
+
import { t as le } from "./ui-icon.js";
|
|
4
|
+
$("ui-button", N), $("ui-input", B), $("ui-listbox", K), $("ui-option", A), $("ui-option-group", re), $("ui-option-group-header", O), $("ui-select", t), $("ui-combobox", I), $("ui-command", R), $("ui-command-input", E), $("ui-command-list", Z), $("ui-command-group", C), $("ui-command-item", W), $("ui-command-empty", F), $("ui-checkbox", Y), $("ui-switch", H), $("ui-radio", Q), $("ui-radio-group", te), $("ui-segmented-control", e), $("ui-segment", p), $("ui-tooltip", b), $("ui-accordion", v), $("ui-accordion-item", y), $("ui-dialog", c), $("ui-tabs", q), $("ui-tab", l), $("ui-tab-panel", o), $("ui-tab-panels", _), $("ui-table", ee), $("ui-table-head", ce), $("ui-table-body", m), $("ui-table-row", u), $("ui-table-header", a), $("ui-table-cell", s), $("ui-calendar", d), $("ui-field", f), $("ui-textarea", r), $("ui-range", i), $("ui-input-otp", g), $("ui-avatar", ae), $("ui-badge", n), $("ui-kbd", h), $("ui-breadcrumb", oe), $("ui-breadcrumb-item", w), $("ui-pagination", se), $("ui-drawer", ie), $("ui-tree", x), $("ui-tree-item", j), $("ui-slideshow", M), $("ui-slide", z), $("ui-nav", G), $("ui-nav-group", D), $("ui-nav-group-header", ne), $("ui-nav-item", k), $("ui-chat-input", T), $("ui-controller", L), $("ui-card", X), $("ui-section", U), $("ui-toolbar", S), $("ui-layout-sidebar", P), $("ui-layout-sidebar-item", J), $("ui-layout-chat", V), $("ui-icon", le);
|
package/dist/traits.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as
|
|
3
|
-
|
|
4
|
-
import { a as ee, c as te, d as ne, f as re, g as ie, i as ae, m as oe, n as se, o as ce, p as le, r as ue, s as de, t as fe, u as pe } from "./list-navigate-controller.js";
|
|
5
|
-
export { h as ClipboardController, p as CollapsibleController, b as CopyController, l as DialogController, ue as DismissController, ce as DismissStack, c as DragController, R as DropZoneController, _ as EditController, x as FocusTrapController, S as HoverController, y as IntersectController, fe as ListNavigateController, se as PopoverController, ee as PressController, D as RangeSelectController, s as ResizeController, ae as RovingFocusController, C as SearchController, $ as SelectionController, u as SortController, v as SwipeController, m as ToastController, de as ToastManager, pe as UIElement, z as ValidateController, d as VirtualScrollController, i as batch, L as clippableAdapter, k as collapsibleAdapter, ne as collectTraitOptions, e as computed, f as copyableAdapter, g as debugReactive, n as define, N as dialogableAdapter, I as dismissableAdapter, J as draggableAdapter, Z as droppableAdapter, H as editableAdapter, t as effect, Y as focusTrappableAdapter, le as getRegisteredTraitNames, oe as getTrait, te as getTraitRuntime, X as hoverableAdapter, w as intersectableAdapter, E as isComputed, O as isSignal, P as listNavigableAdapter, re as parseTraitAttribute, W as popoverableAdapter, T as pressableAdapter, B as rangeSelectableAdapter, q as registerAllTraits, ie as registerTrait, M as resizableAdapter, F as rovingFocusableAdapter, A as searchableAdapter, U as selectableAdapter, r as signal, j as sortableAdapter, G as swipeableAdapter, V as toastableAdapter, a as uid, o as untrack, Q as validatableAdapter, K as virtualizableAdapter };
|
|
1
|
+
import { At as e, Bt as t, Ct as n, Gt as r, Ht as i, It as a, Kt as o, Lt as s, Ot as c, Rt as l, St as u, Ut as d, Vt as f, Wt as p, _t as m, bt as h, gt as g, kt as _, qt as v, vt as y, xt as b, yt as x, zt as S } from "./components.js";
|
|
2
|
+
import { A as C, B as w, C as T, D as E, E as D, F as O, G as k, I as A, J as j, K as M, L as N, M as P, N as F, O as I, P as L, R, S as z, T as B, V, _ as H, a as U, b as W, c as G, d as K, f as q, g as J, h as Y, i as X, j as Z, k as Q, l as $, m as ee, n as te, o as ne, p as re, q as ie, r as ae, s as oe, t as se, u as ce, v as le, w as ue, x as de, y as fe, z as pe } from "./core.js";
|
|
3
|
+
export { O as ClipboardController, E as CollapsibleController, F as CopyController, g as DialogController, x as DismissController, c as DismissStack, n as DragController, Z as DropZoneController, A as EditController, I as FocusTrapController, L as HoverController, P as IntersectController, m as ListNavigateController, y as PopoverController, b as PressController, V as RangeSelectController, u as ResizeController, h as RovingFocusController, R as SearchController, pe as SelectionController, C as SortController, N as SwipeController, D as ToastController, _ as ToastManager, s as UIElement, Q as ValidateController, w as VirtualScrollController, p as batch, X as clippableAdapter, H as collapsibleAdapter, l as collectTraitOptions, o as computed, T as copyableAdapter, M as debugReactive, k as define, K as dialogableAdapter, Y as dismissableAdapter, ce as draggableAdapter, de as droppableAdapter, te as editableAdapter, r as effect, le as focusTrappableAdapter, t as getRegisteredTraitNames, f as getTrait, e as getTraitRuntime, ue as hoverableAdapter, z as intersectableAdapter, ie as isComputed, j as isSignal, q as listNavigableAdapter, S as parseTraitAttribute, re as popoverableAdapter, B as pressableAdapter, $ as rangeSelectableAdapter, se as registerAllTraits, i as registerTrait, G as resizableAdapter, J as rovingFocusableAdapter, U as searchableAdapter, ne as selectableAdapter, v as signal, W as sortableAdapter, ae as swipeableAdapter, ee as toastableAdapter, a as uid, d as untrack, fe as validatableAdapter, oe as virtualizableAdapter };
|
package/dist/ui-icon.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Lt as e } from "./components.js";
|
|
2
|
+
var t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set();
|
|
3
|
+
function r(e, r) {
|
|
4
|
+
t.set(e, r), n.forEach((t) => t(e));
|
|
5
|
+
}
|
|
6
|
+
function i(e) {
|
|
7
|
+
return t.get(e);
|
|
8
|
+
}
|
|
9
|
+
function a(e) {
|
|
10
|
+
return n.add(e), () => n.delete(e);
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Icon component rendering SVG from the global icon registry.
|
|
14
|
+
* @attr {string} name - Icon name from the Phosphor icon set
|
|
15
|
+
* @attr {string} weight - Icon weight: "regular" (default) or "fill"
|
|
16
|
+
* @attr {string} size - Icon size override
|
|
17
|
+
* @attr {string} aria-label - Accessible label (sets role="img" when present)
|
|
18
|
+
*/
|
|
19
|
+
var o = class extends e {
|
|
20
|
+
static observedAttributes = [
|
|
21
|
+
"name",
|
|
22
|
+
"weight",
|
|
23
|
+
"size",
|
|
24
|
+
"aria-label"
|
|
25
|
+
];
|
|
26
|
+
#e = null;
|
|
27
|
+
setup() {
|
|
28
|
+
super.setup(), this.#t(), this.#r();
|
|
29
|
+
}
|
|
30
|
+
attributeChangedCallback(e, t, n) {
|
|
31
|
+
super.attributeChangedCallback(e, t, n), (e === "name" || e === "weight") && this.#r(), e === "aria-label" && this.#t();
|
|
32
|
+
}
|
|
33
|
+
disconnectedCallback() {
|
|
34
|
+
super.disconnectedCallback(), this.#e?.(), this.#e = null;
|
|
35
|
+
}
|
|
36
|
+
#t() {
|
|
37
|
+
this.hasAttribute("aria-label") ? (this.setAttribute("role", "img"), this.removeAttribute("aria-hidden")) : (this.setAttribute("aria-hidden", "true"), this.removeAttribute("role"));
|
|
38
|
+
}
|
|
39
|
+
/** Compute the effective registry key from name + weight attributes. */
|
|
40
|
+
#n() {
|
|
41
|
+
let e = this.getAttribute("name");
|
|
42
|
+
return e ? this.getAttribute("weight") === "fill" && !e.endsWith("-fill") ? `${e}-fill` : e : null;
|
|
43
|
+
}
|
|
44
|
+
#r() {
|
|
45
|
+
let e = this.#n();
|
|
46
|
+
if (!e) {
|
|
47
|
+
this.innerHTML = "", this.#e?.(), this.#e = null;
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
let t = i(e);
|
|
51
|
+
t ? (this.innerHTML = t, this.#e?.(), this.#e = null) : (this.innerHTML = "", this.#e ||= a((e) => {
|
|
52
|
+
e === this.#n() && this.#r();
|
|
53
|
+
}));
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
export { r as i, i as n, a as r, o as t };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nonoun/native-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Zero-dependency web component library with an OKLCH CSS design system, signal-based reactivity, and composable trait controllers",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -24,23 +24,20 @@
|
|
|
24
24
|
"types": "./dist/register-all.d.ts",
|
|
25
25
|
"default": "./dist/register-all.js"
|
|
26
26
|
},
|
|
27
|
-
"./inspector": {
|
|
28
|
-
"types": "./dist/inspector.d.ts",
|
|
29
|
-
"default": "./dist/inspector.js"
|
|
30
|
-
},
|
|
31
27
|
"./css": "./dist/native-ui.css",
|
|
32
28
|
"./css/foundation": "./dist/foundation.css",
|
|
33
29
|
"./css/components": "./dist/components.css",
|
|
34
30
|
"./css/components-lean": "./dist/components-lean.css",
|
|
35
|
-
"./css/lean": "./dist/native-ui-lean.css"
|
|
36
|
-
"./css/inspector": "./dist/inspector.css"
|
|
31
|
+
"./css/lean": "./dist/native-ui-lean.css"
|
|
37
32
|
},
|
|
38
33
|
"files": [
|
|
39
34
|
"dist"
|
|
40
35
|
],
|
|
41
36
|
"sideEffects": [
|
|
42
|
-
"./dist/register-all.js"
|
|
43
|
-
|
|
37
|
+
"./dist/register-all.js"
|
|
38
|
+
],
|
|
39
|
+
"workspaces": [
|
|
40
|
+
"packages/*"
|
|
44
41
|
],
|
|
45
42
|
"keywords": [
|
|
46
43
|
"web-components",
|
|
@@ -1,391 +0,0 @@
|
|
|
1
|
-
import { c as e, u as t } from "./uid.js";
|
|
2
|
-
function n(n) {
|
|
3
|
-
let r = e();
|
|
4
|
-
t(null);
|
|
5
|
-
try {
|
|
6
|
-
return n();
|
|
7
|
-
} finally {
|
|
8
|
-
t(r);
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
/** Enables pointer-driven drag-and-drop with drop, slot, or preview reordering. */
|
|
12
|
-
var r = class {
|
|
13
|
-
host;
|
|
14
|
-
selector;
|
|
15
|
-
dropZoneSelector;
|
|
16
|
-
axis;
|
|
17
|
-
mode;
|
|
18
|
-
disabled;
|
|
19
|
-
animate;
|
|
20
|
-
#e = null;
|
|
21
|
-
#t = null;
|
|
22
|
-
#n = null;
|
|
23
|
-
#r = 0;
|
|
24
|
-
#i = 0;
|
|
25
|
-
#a = 0;
|
|
26
|
-
#o = 0;
|
|
27
|
-
#s = -1;
|
|
28
|
-
#c = -1;
|
|
29
|
-
#l = !1;
|
|
30
|
-
#u = null;
|
|
31
|
-
#d = null;
|
|
32
|
-
#f = -1;
|
|
33
|
-
constructor(e, t) {
|
|
34
|
-
this.host = e, this.selector = t.selector, this.dropZoneSelector = t.dropZoneSelector ?? "", this.axis = t.axis ?? "both", this.mode = t.mode ?? "drop", this.disabled = t.disabled ?? !1, this.animate = t.animate ?? !0, this.attach();
|
|
35
|
-
}
|
|
36
|
-
attach() {
|
|
37
|
-
this.#l || (this.#l = !0, this.host.addEventListener("pointerdown", this.#_), this.host.addEventListener("pointerenter", this.#h, !0), this.host.addEventListener("pointerleave", this.#g, !0));
|
|
38
|
-
}
|
|
39
|
-
detach() {
|
|
40
|
-
this.#l && (this.#l = !1, this.host.removeEventListener("pointerdown", this.#_), this.host.removeEventListener("pointerenter", this.#h, !0), this.host.removeEventListener("pointerleave", this.#g, !0), this.#A());
|
|
41
|
-
}
|
|
42
|
-
destroy() {
|
|
43
|
-
this.detach();
|
|
44
|
-
}
|
|
45
|
-
#p() {
|
|
46
|
-
return this.selector ? [...this.host.querySelectorAll(this.selector)] : [];
|
|
47
|
-
}
|
|
48
|
-
#m() {
|
|
49
|
-
return this.dropZoneSelector ? [...this.host.querySelectorAll(this.dropZoneSelector)] : this.#p();
|
|
50
|
-
}
|
|
51
|
-
#h = (e) => {
|
|
52
|
-
if (this.disabled || !this.selector || this.#t) return;
|
|
53
|
-
let t = e.target.closest?.(this.selector);
|
|
54
|
-
!t || !this.host.contains(t) || (t.style.outline = "2px solid var(--ui-focus-ring, highlight)", t.style.outlineOffset = "2px");
|
|
55
|
-
};
|
|
56
|
-
#g = (e) => {
|
|
57
|
-
if (!this.selector) return;
|
|
58
|
-
let t = e.target.closest?.(this.selector);
|
|
59
|
-
!t || !this.host.contains(t) || (t.style.removeProperty("outline"), t.style.removeProperty("outline-offset"));
|
|
60
|
-
};
|
|
61
|
-
#_ = (e) => {
|
|
62
|
-
if (e.button !== 0 || this.disabled || !this.selector) return;
|
|
63
|
-
let t = e.target.closest?.(this.selector);
|
|
64
|
-
if (!t || !this.host.contains(t)) return;
|
|
65
|
-
let n = this.#p().indexOf(t);
|
|
66
|
-
if (n === -1) return;
|
|
67
|
-
e.preventDefault(), this.#e = t, this.#s = n, this.#r = e.clientX, this.#i = e.clientY;
|
|
68
|
-
let r = t.getBoundingClientRect();
|
|
69
|
-
this.#a = r.left + r.width / 2 - e.clientX, this.#o = r.top + r.height / 2 - e.clientY, document.addEventListener("pointermove", this.#v), document.addEventListener("pointerup", this.#E), document.addEventListener("pointercancel", this.#D), document.addEventListener("keydown", this.#O);
|
|
70
|
-
};
|
|
71
|
-
#v = (e) => {
|
|
72
|
-
if (!this.#e) return;
|
|
73
|
-
if (!this.#t) {
|
|
74
|
-
this.#e.style.removeProperty("outline"), this.#e.style.removeProperty("outline-offset");
|
|
75
|
-
try {
|
|
76
|
-
this.#k(e);
|
|
77
|
-
} catch {
|
|
78
|
-
this.#A();
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
this.#e.setAttribute("dragging", ""), this.mode === "preview" && (this.#u = this.#e.parentElement, this.#d = this.#e.nextElementSibling, this.#f = -1, this.animate && this.#C()), this.host.dispatchEvent(new CustomEvent("ui-drag-start", {
|
|
82
|
-
bubbles: !0,
|
|
83
|
-
composed: !0,
|
|
84
|
-
detail: {
|
|
85
|
-
item: this.#e,
|
|
86
|
-
index: this.#s
|
|
87
|
-
}
|
|
88
|
-
}));
|
|
89
|
-
}
|
|
90
|
-
let t = e.clientX - this.#r, n = e.clientY - this.#i;
|
|
91
|
-
this.#t.style.transform = `translate(${t}px, ${n}px) scale(0.9)`, this.host.dispatchEvent(new CustomEvent("ui-drag-move", {
|
|
92
|
-
bubbles: !0,
|
|
93
|
-
composed: !0,
|
|
94
|
-
detail: {
|
|
95
|
-
item: this.#e,
|
|
96
|
-
x: e.clientX,
|
|
97
|
-
y: e.clientY
|
|
98
|
-
}
|
|
99
|
-
}));
|
|
100
|
-
let r = this.#m().filter((e) => e !== this.#t);
|
|
101
|
-
if (this.mode === "slot") {
|
|
102
|
-
let t = e.clientX + this.#a, n = e.clientY + this.#o, i = r.filter((e) => e !== this.#e), a = 0;
|
|
103
|
-
for (let e = 0; e < i.length; e++) {
|
|
104
|
-
let r = i[e].getBoundingClientRect(), o = r.left + r.width / 2, s = r.top + r.height / 2;
|
|
105
|
-
if (this.axis === "horizontal" ? t > o : (this.axis === "vertical" || t > o) && n > s) a = e + 1;
|
|
106
|
-
else break;
|
|
107
|
-
}
|
|
108
|
-
this.#b(r, a);
|
|
109
|
-
} else if (this.mode === "preview") {
|
|
110
|
-
let t = e.clientX + this.#a, n = e.clientY + this.#o;
|
|
111
|
-
this.#S(r, t, n);
|
|
112
|
-
} else {
|
|
113
|
-
let t = null, n = -1;
|
|
114
|
-
for (let i = 0; i < r.length; i++) {
|
|
115
|
-
let a = r[i].getBoundingClientRect(), o = a.left + a.width / 2, s = a.top + a.height / 2;
|
|
116
|
-
if (this.axis === "vertical" ? e.clientY >= a.top && e.clientY <= a.bottom : this.axis === "horizontal" ? e.clientX >= a.left && e.clientX <= a.right : e.clientX >= a.left && e.clientX <= a.right && e.clientY >= a.top && e.clientY <= a.bottom) {
|
|
117
|
-
n = (this.axis === "horizontal" ? e.clientX < o : e.clientY < s) ? i : i + 1, t = r[i];
|
|
118
|
-
break;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
this.#y(r, t, n);
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
#y(e, t, n) {
|
|
125
|
-
for (let n of e) n !== t && (n.removeAttribute("drag-over"), n.style.removeProperty("outline"), n.style.removeProperty("outline-offset"));
|
|
126
|
-
t && (t.setAttribute("drag-over", ""), t.style.outline = "2px solid var(--ui-focus-ring, highlight)", t.style.outlineOffset = "2px", this.host.dispatchEvent(new CustomEvent("ui-drag-over", {
|
|
127
|
-
bubbles: !0,
|
|
128
|
-
composed: !0,
|
|
129
|
-
detail: {
|
|
130
|
-
item: this.#e,
|
|
131
|
-
target: t,
|
|
132
|
-
index: n
|
|
133
|
-
}
|
|
134
|
-
})));
|
|
135
|
-
}
|
|
136
|
-
#b(e, t) {
|
|
137
|
-
if (t === -1 || t === this.#c) return;
|
|
138
|
-
this.#c = t, this.#x(e), this.#n || (this.#n = document.createElement("div"), this.#n.className = "drag-placeholder", this.#n.setAttribute("aria-hidden", "true"));
|
|
139
|
-
let n = e.filter((e) => e !== this.#e), r = Math.min(t, n.length);
|
|
140
|
-
r < n.length ? n[r].before(this.#n) : n.length > 0 ? n[n.length - 1].after(this.#n) : this.host.appendChild(this.#n), r < n.length && n[r].setAttribute("drag-slot-before", ""), r > 0 && r - 1 < n.length && n[r - 1].setAttribute("drag-slot-after", "");
|
|
141
|
-
let i = r < n.length ? n[r] : null;
|
|
142
|
-
this.host.dispatchEvent(new CustomEvent("ui-drag-over", {
|
|
143
|
-
bubbles: !0,
|
|
144
|
-
composed: !0,
|
|
145
|
-
detail: {
|
|
146
|
-
item: this.#e,
|
|
147
|
-
index: t,
|
|
148
|
-
insertBefore: i
|
|
149
|
-
}
|
|
150
|
-
}));
|
|
151
|
-
}
|
|
152
|
-
#x(e) {
|
|
153
|
-
for (let t of e) t.removeAttribute("drag-slot-before"), t.removeAttribute("drag-slot-after");
|
|
154
|
-
}
|
|
155
|
-
#S(e, t, n) {
|
|
156
|
-
let r = e.filter((e) => e !== this.#e);
|
|
157
|
-
if (r.length === 0) return;
|
|
158
|
-
let i = e[0].getBoundingClientRect(), a = 1;
|
|
159
|
-
for (let t = 1; t < e.length && Math.abs(e[t].getBoundingClientRect().top - i.top) < i.height * .5; t++) a = t + 1;
|
|
160
|
-
let o = a > 1 ? e[1].getBoundingClientRect().left - i.left : i.width, s = a < e.length ? e[a].getBoundingClientRect().top - i.top : i.height, c = Math.round((t - (i.left + i.width / 2)) / o), l = Math.round((n - (i.top + i.height / 2)) / s), u = Math.ceil(r.length / a) - 1, d = Math.max(0, Math.min(c, a - 1)), f = Math.max(0, Math.min(l, u)) * a + d;
|
|
161
|
-
if (f = Math.max(0, Math.min(f, r.length)), f === this.#f) return;
|
|
162
|
-
this.#f = f;
|
|
163
|
-
let p = f < r.length ? r[f] : null, m = () => {
|
|
164
|
-
p ? p.before(this.#e) : r[r.length - 1].after(this.#e);
|
|
165
|
-
};
|
|
166
|
-
this.animate && typeof document.startViewTransition == "function" ? document.startViewTransition(() => {
|
|
167
|
-
m(), this.#C();
|
|
168
|
-
}) : m(), this.host.dispatchEvent(new CustomEvent("ui-drag-over", {
|
|
169
|
-
bubbles: !0,
|
|
170
|
-
composed: !0,
|
|
171
|
-
detail: {
|
|
172
|
-
item: this.#e,
|
|
173
|
-
index: f,
|
|
174
|
-
insertBefore: p
|
|
175
|
-
}
|
|
176
|
-
}));
|
|
177
|
-
}
|
|
178
|
-
#C() {
|
|
179
|
-
let e = this.#p();
|
|
180
|
-
for (let t = 0; t < e.length; t++) e[t].style.viewTransitionName = e[t] === this.#e ? "none" : `drag-item-${t}`;
|
|
181
|
-
}
|
|
182
|
-
#w() {
|
|
183
|
-
for (let e of this.#p()) e.style.removeProperty("view-transition-name");
|
|
184
|
-
}
|
|
185
|
-
#T() {
|
|
186
|
-
if (this.mode !== "preview" || !this.#e || !this.#u) return;
|
|
187
|
-
let e = this.#e, t = this.#d, n = this.#u, r = () => {
|
|
188
|
-
t && t.isConnected ? t.before(e) : n.appendChild(e);
|
|
189
|
-
};
|
|
190
|
-
this.animate && typeof document.startViewTransition == "function" ? document.startViewTransition(() => {
|
|
191
|
-
r(), this.#C();
|
|
192
|
-
}) : r();
|
|
193
|
-
}
|
|
194
|
-
#E = (e) => {
|
|
195
|
-
if (this.#e) {
|
|
196
|
-
if (this.#t) if (this.mode === "slot") {
|
|
197
|
-
let e = this.#p().filter((e) => e !== this.#e), t = this.#c >= 0 && this.#c < e.length ? e[this.#c] : null;
|
|
198
|
-
this.host.dispatchEvent(new CustomEvent("ui-drop", {
|
|
199
|
-
bubbles: !0,
|
|
200
|
-
composed: !0,
|
|
201
|
-
detail: {
|
|
202
|
-
item: this.#e,
|
|
203
|
-
fromIndex: this.#s,
|
|
204
|
-
toIndex: this.#c,
|
|
205
|
-
insertBefore: t
|
|
206
|
-
}
|
|
207
|
-
}));
|
|
208
|
-
} else if (this.mode === "preview") {
|
|
209
|
-
let e = this.#p(), t = this.#e ? e.indexOf(this.#e) : -1;
|
|
210
|
-
this.#u = null, this.#d = null, this.host.dispatchEvent(new CustomEvent("ui-drop", {
|
|
211
|
-
bubbles: !0,
|
|
212
|
-
composed: !0,
|
|
213
|
-
detail: {
|
|
214
|
-
item: this.#e,
|
|
215
|
-
fromIndex: this.#s,
|
|
216
|
-
toIndex: t
|
|
217
|
-
}
|
|
218
|
-
}));
|
|
219
|
-
} else {
|
|
220
|
-
let e = this.#m(), t = e.find((e) => e.hasAttribute("drag-over")) ?? null, n = t ? e.indexOf(t) : -1;
|
|
221
|
-
this.host.dispatchEvent(new CustomEvent("ui-drop", {
|
|
222
|
-
bubbles: !0,
|
|
223
|
-
composed: !0,
|
|
224
|
-
detail: {
|
|
225
|
-
item: this.#e,
|
|
226
|
-
target: t,
|
|
227
|
-
fromIndex: this.#s,
|
|
228
|
-
toIndex: n
|
|
229
|
-
}
|
|
230
|
-
}));
|
|
231
|
-
}
|
|
232
|
-
this.#A();
|
|
233
|
-
}
|
|
234
|
-
};
|
|
235
|
-
#D = () => {
|
|
236
|
-
this.#e && (this.#T(), this.#t && this.host.dispatchEvent(new CustomEvent("ui-drag-cancel", {
|
|
237
|
-
bubbles: !0,
|
|
238
|
-
composed: !0,
|
|
239
|
-
detail: { item: this.#e }
|
|
240
|
-
})), this.#A());
|
|
241
|
-
};
|
|
242
|
-
#O = (e) => {
|
|
243
|
-
e.key === "Escape" && this.#e && (e.preventDefault(), this.#T(), this.#t && this.host.dispatchEvent(new CustomEvent("ui-drag-cancel", {
|
|
244
|
-
bubbles: !0,
|
|
245
|
-
composed: !0,
|
|
246
|
-
detail: { item: this.#e }
|
|
247
|
-
})), this.#A());
|
|
248
|
-
};
|
|
249
|
-
#k(e) {
|
|
250
|
-
if (!this.#e) return;
|
|
251
|
-
let t = this.#e.getBoundingClientRect(), n = this.#e.cloneNode(!0);
|
|
252
|
-
n.setAttribute("popover", "manual"), n.setAttribute("aria-hidden", "true"), document.body.appendChild(n), n.showPopover(), n.style.position = "fixed", n.style.inset = "unset", n.style.left = `${t.left}px`, n.style.top = `${t.top}px`, n.style.width = `${t.width}px`, n.style.height = `${t.height}px`, n.style.margin = "0", n.style.pointerEvents = "none", n.style.opacity = "0.8", n.style.transformOrigin = "center center", n.style.border = "none", n.style.outline = "none", this.#t = n, this.#r = e.clientX, this.#i = e.clientY;
|
|
253
|
-
}
|
|
254
|
-
#A() {
|
|
255
|
-
if (this.#t) {
|
|
256
|
-
if (this.#t.isConnected) try {
|
|
257
|
-
this.#t.hidePopover();
|
|
258
|
-
} catch {}
|
|
259
|
-
this.#t.remove(), this.#t = null;
|
|
260
|
-
}
|
|
261
|
-
this.#e && this.#e.removeAttribute("dragging"), this.mode === "preview" && this.animate && this.#w();
|
|
262
|
-
let e = this.#m();
|
|
263
|
-
if (this.mode === "slot") this.#x(e);
|
|
264
|
-
else for (let t of e) t.removeAttribute("drag-over"), t.style.removeProperty("outline"), t.style.removeProperty("outline-offset");
|
|
265
|
-
this.#n &&= (this.#n.remove(), null), this.#e = null, this.#s = -1, this.#c = -1, this.#u = null, this.#d = null, this.#f = -1, document.removeEventListener("pointermove", this.#v), document.removeEventListener("pointerup", this.#E), document.removeEventListener("pointercancel", this.#D), document.removeEventListener("keydown", this.#O);
|
|
266
|
-
}
|
|
267
|
-
}, i = class {
|
|
268
|
-
host;
|
|
269
|
-
handleSelector;
|
|
270
|
-
axis;
|
|
271
|
-
min;
|
|
272
|
-
max;
|
|
273
|
-
disabled;
|
|
274
|
-
reverse;
|
|
275
|
-
#e = 0;
|
|
276
|
-
#t = 0;
|
|
277
|
-
#n = 0;
|
|
278
|
-
#r = 0;
|
|
279
|
-
#i = !1;
|
|
280
|
-
#a = !1;
|
|
281
|
-
constructor(e, t) {
|
|
282
|
-
this.host = e, this.handleSelector = t.handleSelector, this.axis = t.axis ?? "horizontal", this.min = t.min ?? 0, this.max = t.max ?? Infinity, this.disabled = t.disabled ?? !1, this.reverse = t.reverse ?? !1, this.attach();
|
|
283
|
-
}
|
|
284
|
-
attach() {
|
|
285
|
-
this.#a || (this.#a = !0, this.host.addEventListener("pointerdown", this.#o));
|
|
286
|
-
}
|
|
287
|
-
detach() {
|
|
288
|
-
this.#a && (this.#a = !1, this.host.removeEventListener("pointerdown", this.#o), this.#d());
|
|
289
|
-
}
|
|
290
|
-
destroy() {
|
|
291
|
-
this.detach();
|
|
292
|
-
}
|
|
293
|
-
#o = (e) => {
|
|
294
|
-
if (e.button !== 0 || this.disabled || !this.handleSelector) return;
|
|
295
|
-
let t = e.target.closest?.(this.handleSelector);
|
|
296
|
-
if (!t || !this.host.contains(t)) return;
|
|
297
|
-
e.preventDefault(), this.#i = !0, this.#e = e.clientX, this.#t = e.clientY;
|
|
298
|
-
let n = this.host.getBoundingClientRect();
|
|
299
|
-
this.#n = n.width, this.#r = n.height, this.host.setAttribute("resizing", ""), this.host.setPointerCapture(e.pointerId), document.addEventListener("pointermove", this.#s), document.addEventListener("pointerup", this.#c), document.addEventListener("pointercancel", this.#l), document.addEventListener("keydown", this.#u), this.host.dispatchEvent(new CustomEvent("ui-resize-start", {
|
|
300
|
-
bubbles: !0,
|
|
301
|
-
composed: !0,
|
|
302
|
-
detail: {
|
|
303
|
-
width: this.#n,
|
|
304
|
-
height: this.#r
|
|
305
|
-
}
|
|
306
|
-
}));
|
|
307
|
-
};
|
|
308
|
-
#s = (e) => {
|
|
309
|
-
if (!this.#i) return;
|
|
310
|
-
let t = this.reverse ? -1 : 1, n = (e.clientX - this.#e) * t, r = (e.clientY - this.#t) * t;
|
|
311
|
-
if (this.axis === "horizontal" || this.axis === "both") {
|
|
312
|
-
let e = Math.min(this.max, Math.max(this.min, this.#n + n));
|
|
313
|
-
this.host.style.width = `${e}px`;
|
|
314
|
-
}
|
|
315
|
-
if (this.axis === "vertical" || this.axis === "both") {
|
|
316
|
-
let e = Math.min(this.max, Math.max(this.min, this.#r + r));
|
|
317
|
-
this.host.style.height = `${e}px`;
|
|
318
|
-
}
|
|
319
|
-
let i = this.host.getBoundingClientRect();
|
|
320
|
-
this.host.dispatchEvent(new CustomEvent("ui-resize-move", {
|
|
321
|
-
bubbles: !0,
|
|
322
|
-
composed: !0,
|
|
323
|
-
detail: {
|
|
324
|
-
width: i.width,
|
|
325
|
-
height: i.height
|
|
326
|
-
}
|
|
327
|
-
}));
|
|
328
|
-
};
|
|
329
|
-
#c = (e) => {
|
|
330
|
-
if (!this.#i) return;
|
|
331
|
-
let t = this.host.getBoundingClientRect();
|
|
332
|
-
this.host.dispatchEvent(new CustomEvent("ui-resize-end", {
|
|
333
|
-
bubbles: !0,
|
|
334
|
-
composed: !0,
|
|
335
|
-
detail: {
|
|
336
|
-
width: t.width,
|
|
337
|
-
height: t.height
|
|
338
|
-
}
|
|
339
|
-
})), this.#d();
|
|
340
|
-
};
|
|
341
|
-
#l = () => {
|
|
342
|
-
this.#i && ((this.axis === "horizontal" || this.axis === "both") && (this.host.style.width = `${this.#n}px`), (this.axis === "vertical" || this.axis === "both") && (this.host.style.height = `${this.#r}px`), this.#d());
|
|
343
|
-
};
|
|
344
|
-
#u = (e) => {
|
|
345
|
-
e.key === "Escape" && this.#i && (e.preventDefault(), (this.axis === "horizontal" || this.axis === "both") && (this.host.style.width = `${this.#n}px`), (this.axis === "vertical" || this.axis === "both") && (this.host.style.height = `${this.#r}px`), this.#d());
|
|
346
|
-
};
|
|
347
|
-
#d() {
|
|
348
|
-
this.#i = !1, this.host.removeAttribute("resizing"), document.removeEventListener("pointermove", this.#s), document.removeEventListener("pointerup", this.#c), document.removeEventListener("pointercancel", this.#l), document.removeEventListener("keydown", this.#u);
|
|
349
|
-
}
|
|
350
|
-
}, a = class {
|
|
351
|
-
host;
|
|
352
|
-
#e = null;
|
|
353
|
-
#t;
|
|
354
|
-
constructor(e, t = {}) {
|
|
355
|
-
this.host = e, this.#t = t.contentTarget, this.#a();
|
|
356
|
-
}
|
|
357
|
-
get open() {
|
|
358
|
-
return this.#e?.open ?? !1;
|
|
359
|
-
}
|
|
360
|
-
showModal() {
|
|
361
|
-
!this.#e || this.open || (this.#e.showModal(), this.host.toggleAttribute("open", !0), queueMicrotask(() => {
|
|
362
|
-
let e = this.#e?.querySelector("[autofocus]");
|
|
363
|
-
if (e) {
|
|
364
|
-
e.focus();
|
|
365
|
-
return;
|
|
366
|
-
}
|
|
367
|
-
(this.#e?.querySelector("ui-input, ui-textarea, ui-button, ui-select, ui-listbox, input, textarea, select, button, [tabindex]:not([tabindex=\"-1\"])"))?.focus();
|
|
368
|
-
}));
|
|
369
|
-
}
|
|
370
|
-
close() {
|
|
371
|
-
!this.#e || !this.open || (this.#e.close(), this.host.toggleAttribute("open", !1), this.host.dispatchEvent(new Event("close")));
|
|
372
|
-
}
|
|
373
|
-
destroy() {
|
|
374
|
-
this.#e && (this.#e.removeEventListener("cancel", this.#n), this.#e.removeEventListener("click", this.#r)), this.host.removeEventListener("ui-dismiss", this.#i), this.#e = null;
|
|
375
|
-
}
|
|
376
|
-
#n = (e) => {
|
|
377
|
-
e.preventDefault(), this.host.hasAttribute("no-close-on-escape") || this.close();
|
|
378
|
-
};
|
|
379
|
-
#r = (e) => {
|
|
380
|
-
e.target === this.#e && !this.host.hasAttribute("no-close-on-backdrop") && this.close();
|
|
381
|
-
};
|
|
382
|
-
#i = () => {
|
|
383
|
-
this.host.hasAttribute("no-close-on-escape") || this.close();
|
|
384
|
-
};
|
|
385
|
-
#a() {
|
|
386
|
-
let e = document.createElement("dialog"), t = this.#t ? this.#t(e) : e;
|
|
387
|
-
for (; this.host.firstChild;) t.appendChild(this.host.firstChild);
|
|
388
|
-
t !== e && e.appendChild(t), this.host.appendChild(e), this.#e = e, e.addEventListener("cancel", this.#n), e.addEventListener("click", this.#r), this.host.addEventListener("ui-dismiss", this.#i);
|
|
389
|
-
}
|
|
390
|
-
};
|
|
391
|
-
export { n as i, i as n, r, a as t };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import './ds-variable.ts';
|
|
2
|
-
import './ds-colors.ts';
|
|
3
|
-
import './ds-color-swatch.ts';
|
|
4
|
-
import './ds-themes.ts';
|
|
5
|
-
import '../components/ui-range/ui-range.ts';
|
|
6
|
-
import '../components/ui-select/ui-select.ts';
|
|
7
|
-
export declare function buildInspector(container: HTMLElement): void;
|
|
8
|
-
//# sourceMappingURL=build-inspector.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"build-inspector.d.ts","sourceRoot":"","sources":["../../src/inspector/build-inspector.ts"],"names":[],"mappings":"AAGA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,gBAAgB,CAAC;AACxB,OAAO,sBAAsB,CAAC;AAC9B,OAAO,gBAAgB,CAAC;AACxB,OAAO,oCAAoC,CAAC;AAC5C,OAAO,sCAAsC,CAAC;AA4E9C,wBAAgB,cAAc,CAAC,SAAS,EAAE,WAAW,GAAG,IAAI,CAgI3D"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { UIElement } from '../core/ui-element.ts';
|
|
2
|
-
export declare class DSColorSwatch extends UIElement {
|
|
3
|
-
#private;
|
|
4
|
-
static observedAttributes: string[];
|
|
5
|
-
get token(): string;
|
|
6
|
-
set token(val: string);
|
|
7
|
-
get name(): string;
|
|
8
|
-
set name(val: string);
|
|
9
|
-
attributeChangedCallback(name: string, old: string | null, val: string | null): void;
|
|
10
|
-
setup(): void;
|
|
11
|
-
teardown(): void;
|
|
12
|
-
/** Refresh background and contrast from current token value. */
|
|
13
|
-
refresh(): void;
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=ds-color-swatch-element.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ds-color-swatch-element.d.ts","sourceRoot":"","sources":["../../src/inspector/ds-color-swatch-element.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAoJlD,qBAAa,aAAc,SAAQ,SAAS;;IAC1C,MAAM,CAAC,kBAAkB,WAAqB;IAM9C,IAAI,KAAK,IAAI,MAAM,CAA6C;IAChE,IAAI,KAAK,CAAC,GAAG,EAAE,MAAM,EAAsC;IAE3D,IAAI,IAAI,IAAI,MAAM,CAA4C;IAC9D,IAAI,IAAI,CAAC,GAAG,EAAE,MAAM,EAAqC;IAEzD,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAapF,KAAK,IAAI,IAAI;IAqCb,QAAQ,IAAI,IAAI;IAUhB,gEAAgE;IAChE,OAAO,IAAI,IAAI;CAsEhB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ds-color-swatch.d.ts","sourceRoot":"","sources":["../../src/inspector/ds-color-swatch.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAI7D,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { UIElement } from '../core/ui-element.ts';
|
|
2
|
-
export interface DSColorEntry {
|
|
3
|
-
name: string;
|
|
4
|
-
token: string;
|
|
5
|
-
}
|
|
6
|
-
export declare class DSColors extends UIElement {
|
|
7
|
-
#private;
|
|
8
|
-
static observedAttributes: string[];
|
|
9
|
-
attributeChangedCallback(name: string, old: string | null, val: string | null): void;
|
|
10
|
-
setup(): void;
|
|
11
|
-
teardown(): void;
|
|
12
|
-
refresh(): void;
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=ds-colors-element.d.ts.map
|