@editora/ui-core 0.1.18 → 0.1.20
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/{ElementBase-1b301e7f.js → ElementBase-EV6mVBUV.js} +1 -1
- package/dist/{ElementBase-909688f3.mjs → ElementBase-YlTLMsGk.mjs} +3 -3
- package/dist/accordion.cjs.js +3 -3
- package/dist/accordion.esm.js +39 -62
- package/dist/alert-dialog.cjs.js +19 -19
- package/dist/alert-dialog.esm.js +69 -87
- package/dist/alert.cjs.js +1 -1
- package/dist/alert.esm.js +4 -7
- package/dist/anchor.cjs.js +2 -2
- package/dist/anchor.esm.js +3 -3
- package/dist/animated-beam.cjs.js +83 -83
- package/dist/animated-beam.esm.js +250 -277
- package/dist/animated-list.cjs.js +4 -4
- package/dist/animated-list.esm.js +47 -61
- package/dist/animated-text.cjs.js +2 -2
- package/dist/animated-text.esm.js +13 -24
- package/dist/app-header.cjs.js +3 -3
- package/dist/app-header.esm.js +11 -13
- package/dist/aspect-ratio.cjs.js +1 -1
- package/dist/aspect-ratio.esm.js +4 -7
- package/dist/avatar.cjs.js +1 -1
- package/dist/avatar.esm.js +7 -13
- package/dist/badge.cjs.js +1 -1
- package/dist/badge.esm.js +4 -7
- package/dist/block-controls.cjs.js +2 -2
- package/dist/block-controls.esm.js +19 -35
- package/dist/box.cjs.js +1 -1
- package/dist/box.esm.js +8 -15
- package/dist/breadcrumb.cjs.js +2 -2
- package/dist/breadcrumb.esm.js +20 -37
- package/dist/button.cjs.js +1 -521
- package/dist/button.esm.js +2 -669
- package/dist/{calendar-2c11b824.mjs → calendar-DLY4acgn.mjs} +293 -342
- package/dist/{calendar-a8735e40.js → calendar-Dkof-FTK.js} +25 -25
- package/dist/calendar.cjs.js +1 -1
- package/dist/calendar.esm.js +8 -9
- package/dist/card.cjs.js +4 -4
- package/dist/card.esm.js +13 -19
- package/dist/chart.cjs.js +64 -64
- package/dist/chart.esm.js +223 -254
- package/dist/checkbox.cjs.js +1 -1
- package/dist/checkbox.esm.js +2 -3
- package/dist/collapsible.cjs.js +1 -1
- package/dist/collapsible.esm.js +5 -9
- package/dist/{collection-a1aac0c6.mjs → collection-C7URGjEI.mjs} +8 -14
- package/dist/collection.cjs.js +1 -1
- package/dist/collection.esm.js +4 -7
- package/dist/color-picker.cjs.js +9 -9
- package/dist/color-picker.esm.js +189 -252
- package/dist/combobox.cjs.js +13 -13
- package/dist/combobox.esm.js +93 -126
- package/dist/command-palette.cjs.js +3 -3
- package/dist/command-palette.esm.js +19 -30
- package/dist/command.cjs.js +4 -4
- package/dist/command.esm.js +41 -53
- package/dist/components/ui-button.d.ts +1 -0
- package/dist/components/ui-button.d.ts.map +1 -1
- package/dist/components/ui-date-picker.d.ts.map +1 -1
- package/dist/components/ui-date-range-picker.d.ts.map +1 -1
- package/dist/components/ui-date-range-time-picker.d.ts +1 -0
- package/dist/components/ui-date-range-time-picker.d.ts.map +1 -1
- package/dist/components/ui-date-time-picker.d.ts +1 -0
- package/dist/components/ui-date-time-picker.d.ts.map +1 -1
- package/dist/components/ui-orbiter.d.ts.map +1 -1
- package/dist/components/ui-skeleton.d.ts.map +1 -1
- package/dist/components/ui-split-button.d.ts +1 -0
- package/dist/components/ui-split-button.d.ts.map +1 -1
- package/dist/components/ui-time-picker.d.ts.map +1 -1
- package/dist/container.cjs.js +2 -2
- package/dist/container.esm.js +2 -3
- package/dist/context-menu.cjs.js +8 -8
- package/dist/context-menu.esm.js +157 -219
- package/dist/control-group.cjs.js +1 -1
- package/dist/control-group.esm.js +2 -3
- package/dist/data-table.cjs.js +4 -4
- package/dist/data-table.esm.js +299 -381
- package/dist/date-field.cjs.js +3 -3
- package/dist/date-field.esm.js +68 -80
- package/dist/date-picker.cjs.js +30 -9
- package/dist/date-picker.esm.js +90 -97
- package/dist/date-range-picker.cjs.js +22 -3
- package/dist/date-range-picker.esm.js +103 -108
- package/dist/date-range-time-picker.cjs.js +28 -12
- package/dist/date-range-time-picker.esm.js +137 -150
- package/dist/date-time-picker.cjs.js +25 -9
- package/dist/date-time-picker.esm.js +139 -155
- package/dist/date-time-utils-Dmost5Ee.js +1 -0
- package/dist/date-time-utils-y1N2gvG2.mjs +268 -0
- package/dist/description.cjs.js +1 -1
- package/dist/description.esm.js +3 -5
- package/dist/dialog.cjs.js +12 -12
- package/dist/dialog.esm.js +44 -63
- package/dist/direction-provider.cjs.js +1 -1
- package/dist/direction-provider.esm.js +2 -3
- package/dist/{dismissable-layer-9c7e6b58.mjs → dismissable-layer-BmPIoK80.mjs} +29 -33
- package/dist/dismissable-layer-DNfrKA20.js +1 -0
- package/dist/dismissable-layer.cjs.js +2 -2
- package/dist/dismissable-layer.esm.js +4 -6
- package/dist/dock.cjs.js +5 -5
- package/dist/dock.esm.js +134 -155
- package/dist/drawer.cjs.js +2 -2
- package/dist/drawer.esm.js +18 -35
- package/dist/dropdown.cjs.js +2 -2
- package/dist/dropdown.esm.js +119 -149
- package/dist/dropzone.cjs.js +1 -1
- package/dist/dropzone.esm.js +0 -1
- package/dist/empty-state.cjs.js +1 -1
- package/dist/empty-state.esm.js +1 -1
- package/dist/field-error.cjs.js +1 -1
- package/dist/field-error.esm.js +3 -5
- package/dist/field.cjs.js +5 -5
- package/dist/field.esm.js +27 -34
- package/dist/fieldset.cjs.js +4 -4
- package/dist/fieldset.esm.js +19 -24
- package/dist/file-upload.cjs.js +4 -4
- package/dist/file-upload.esm.js +69 -93
- package/dist/flex.cjs.js +1 -1
- package/dist/flex.esm.js +5 -9
- package/dist/floating-toolbar.cjs.js +4 -4
- package/dist/floating-toolbar.esm.js +60 -85
- package/dist/focus-scope-Bwug2gDv.js +1 -0
- package/dist/{focus-scope-103833ee.mjs → focus-scope-CmEsG5UZ.mjs} +39 -48
- package/dist/focus-scope.cjs.js +2 -2
- package/dist/focus-scope.esm.js +15 -20
- package/dist/form.cjs.js +2 -2
- package/dist/form.esm.js +26 -53
- package/dist/gantt.cjs.js +43 -43
- package/dist/gantt.esm.js +295 -322
- package/dist/grid.cjs.js +1 -1
- package/dist/grid.esm.js +5 -9
- package/dist/hover-card.cjs.js +4 -4
- package/dist/hover-card.esm.js +22 -28
- package/dist/icon-cloud.cjs.js +7 -7
- package/dist/icon-cloud.esm.js +48 -62
- package/dist/icon.cjs.js +1 -1
- package/dist/icon.esm.js +2 -4
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +378 -390
- package/dist/inline-edit.cjs.js +11 -11
- package/dist/inline-edit.esm.js +32 -36
- package/dist/input.cjs.js +17 -17
- package/dist/input.esm.js +50 -63
- package/dist/label.cjs.js +2 -2
- package/dist/label.esm.js +8 -17
- package/dist/layout.cjs.js +2 -2
- package/dist/layout.esm.js +20 -26
- package/dist/listbox-B6QgECax.js +46 -0
- package/dist/listbox-DJamVeFj.mjs +200 -0
- package/dist/listbox.cjs.js +1 -1
- package/dist/listbox.esm.js +2 -4
- package/dist/marquee.cjs.js +5 -5
- package/dist/marquee.esm.js +33 -50
- package/dist/masonry-grid.cjs.js +1 -1
- package/dist/masonry-grid.esm.js +5 -9
- package/dist/menu.cjs.js +3 -3
- package/dist/menu.esm.js +106 -126
- package/dist/menubar.cjs.js +5 -5
- package/dist/menubar.esm.js +118 -164
- package/dist/meter.cjs.js +2 -2
- package/dist/meter.esm.js +4 -4
- package/dist/multi-select.cjs.js +4 -4
- package/dist/multi-select.esm.js +120 -140
- package/dist/navigation-menu.cjs.js +4 -4
- package/dist/navigation-menu.esm.js +44 -55
- package/dist/number-field.cjs.js +2 -2
- package/dist/number-field.esm.js +73 -98
- package/dist/number-ticker.cjs.js +3 -3
- package/dist/number-ticker.esm.js +22 -43
- package/dist/odometer.cjs.js +1 -1
- package/dist/odometer.esm.js +5 -9
- package/dist/orbiter.cjs.js +13 -13
- package/dist/orbiter.esm.js +79 -90
- package/dist/{overlayManager-5bbd4dc3.mjs → overlayManager-BJjU1VA8.mjs} +4 -5
- package/dist/{overlayManager-0eda4e08.js → overlayManager-CSy3fJmJ.js} +1 -1
- package/dist/pagination.cjs.js +2 -2
- package/dist/pagination.esm.js +14 -18
- package/dist/{panel-group-a376cc5e.mjs → panel-group-8sVNnGxg.mjs} +24 -46
- package/dist/panel-group-CaD0_KQf.js +36 -0
- package/dist/panel-group.cjs.js +1 -1
- package/dist/panel-group.esm.js +2 -5
- package/dist/panel.cjs.js +4 -4
- package/dist/panel.esm.js +8 -10
- package/dist/password-field.cjs.js +9 -9
- package/dist/password-field.esm.js +62 -82
- package/dist/pin-input.cjs.js +3 -3
- package/dist/pin-input.esm.js +33 -39
- package/dist/placement-grid.cjs.js +4 -4
- package/dist/placement-grid.esm.js +108 -131
- package/dist/plugin-panel.cjs.js +7 -7
- package/dist/plugin-panel.esm.js +13 -15
- package/dist/popover.cjs.js +2 -2
- package/dist/popover.esm.js +21 -31
- package/dist/portal-DgpQ3Jo1.js +1 -0
- package/dist/{portal-fe73e5cc.mjs → portal-bR42gHvG.mjs} +43 -48
- package/dist/portal.cjs.js +2 -2
- package/dist/portal.esm.js +10 -19
- package/dist/{positioner-e9770c66.mjs → positioner-D0VGxtYU.mjs} +189 -209
- package/dist/positioner-D_fqyx_j.js +1 -0
- package/dist/positioner.cjs.js +2 -2
- package/dist/positioner.esm.js +11 -18
- package/dist/presence.cjs.js +1 -1
- package/dist/presence.esm.js +7 -13
- package/dist/progress.cjs.js +1 -1
- package/dist/progress.esm.js +5 -9
- package/dist/quick-actions.cjs.js +6 -6
- package/dist/quick-actions.esm.js +52 -62
- package/dist/radio-group.cjs.js +13 -13
- package/dist/radio-group.esm.js +39 -51
- package/dist/radio.cjs.js +1 -1
- package/dist/radio.esm.js +5 -9
- package/dist/rating.cjs.js +1 -1
- package/dist/rating.esm.js +12 -23
- package/dist/{roving-focus-group-4350c9a7.mjs → roving-focus-group-Dbm1Jko_.mjs} +3 -6
- package/dist/roving-focus-group.cjs.js +1 -1
- package/dist/roving-focus-group.esm.js +3 -5
- package/dist/runtime-CTaOSmBj.js +1 -0
- package/dist/{runtime-161f68a2.mjs → runtime-D1gFh1fS.mjs} +338 -366
- package/dist/runtime.cjs.js +1 -1
- package/dist/runtime.esm.js +6 -6
- package/dist/scroll-area.cjs.js +3 -3
- package/dist/scroll-area.esm.js +38 -46
- package/dist/{scroll-lock-31da444f.mjs → scroll-lock-LfqXXqsu.mjs} +5 -9
- package/dist/section.cjs.js +1 -1
- package/dist/section.esm.js +1 -1
- package/dist/select.cjs.js +7 -7
- package/dist/select.esm.js +67 -97
- package/dist/selection-popup.cjs.js +1 -1
- package/dist/selection-popup.esm.js +8 -15
- package/dist/separator.cjs.js +1 -1
- package/dist/separator.esm.js +1 -1
- package/dist/sidebar.cjs.js +18 -18
- package/dist/sidebar.esm.js +117 -139
- package/dist/skeleton.cjs.js +11 -11
- package/dist/skeleton.esm.js +27 -24
- package/dist/slider.cjs.js +1 -1
- package/dist/slider.esm.js +6 -11
- package/dist/slot.cjs.js +4 -4
- package/dist/slot.esm.js +16 -19
- package/dist/sortable.cjs.js +45 -45
- package/dist/sortable.esm.js +421 -524
- package/dist/spinning-text.cjs.js +12 -12
- package/dist/spinning-text.esm.js +80 -92
- package/dist/split-button.cjs.js +4 -4
- package/dist/split-button.esm.js +77 -62
- package/dist/splitter.cjs.js +1 -1
- package/dist/splitter.esm.js +1 -1
- package/dist/stepper.cjs.js +8 -8
- package/dist/stepper.esm.js +32 -52
- package/dist/switch.cjs.js +7 -7
- package/dist/switch.esm.js +23 -31
- package/dist/table.cjs.js +2 -2
- package/dist/table.esm.js +46 -56
- package/dist/tabs.cjs.js +3 -3
- package/dist/tabs.esm.js +35 -55
- package/dist/tags-input.cjs.js +4 -4
- package/dist/tags-input.esm.js +45 -62
- package/dist/textarea.cjs.js +6 -6
- package/dist/textarea.esm.js +32 -41
- package/dist/time-field.cjs.js +4 -4
- package/dist/time-field.esm.js +70 -84
- package/dist/time-picker.cjs.js +29 -21
- package/dist/time-picker.esm.js +96 -110
- package/dist/timeline.cjs.js +1 -1
- package/dist/timeline.esm.js +3 -5
- package/dist/toast.cjs.js +2 -2
- package/dist/toast.esm.js +33 -47
- package/dist/toggle-group.cjs.js +6 -6
- package/dist/toggle-group.esm.js +85 -105
- package/dist/toggle.cjs.js +1 -1
- package/dist/toggle.esm.js +3 -5
- package/dist/toolbar.cjs.js +1 -1
- package/dist/toolbar.esm.js +13 -24
- package/dist/tooltip.cjs.js +2 -2
- package/dist/tooltip.esm.js +31 -42
- package/dist/transfer-list.cjs.js +19 -19
- package/dist/transfer-list.esm.js +98 -111
- package/dist/{tree-dcd74a4a.mjs → tree-B3kE8ESs.mjs} +55 -62
- package/dist/tree-Dx_kv_ih.js +39 -0
- package/dist/tree-item.cjs.js +2 -2
- package/dist/tree-item.esm.js +2 -3
- package/dist/tree.cjs.js +1 -1
- package/dist/tree.esm.js +2 -5
- package/dist/ui-button-Q0GNNWKC.mjs +665 -0
- package/dist/ui-button-rXQOS9QJ.js +521 -0
- package/dist/{icon-9e9da03b.js → ui-icon-BzVNC_lr.js} +4 -4
- package/dist/{icon-e2a85cc1.mjs → ui-icon-YI6lyuqU.mjs} +58 -65
- package/dist/visually-hidden.cjs.js +1 -1
- package/dist/visually-hidden.esm.js +1 -1
- package/dist/wizard.cjs.js +14 -14
- package/dist/wizard.esm.js +85 -105
- package/package.json +3 -3
- package/dist/date-time-utils-66480de4.js +0 -1
- package/dist/date-time-utils-a2c7af25.mjs +0 -307
- package/dist/dismissable-layer-193e3bed.js +0 -1
- package/dist/focus-scope-2b12b4e7.js +0 -1
- package/dist/listbox-308789a0.mjs +0 -210
- package/dist/listbox-ef2f708e.js +0 -46
- package/dist/panel-group-40254cdd.js +0 -36
- package/dist/portal-c69756c0.js +0 -1
- package/dist/positioner-33529bb8.js +0 -1
- package/dist/runtime-3f13807b.js +0 -1
- package/dist/tree-0a7a8d05.js +0 -39
- /package/dist/{collection-a2969ad2.js → collection-qv8A8rq4.js} +0 -0
- /package/dist/{menu-item-styles-27fdbac4.mjs → menu-item-styles-CZiPwPwl.mjs} +0 -0
- /package/dist/{menu-item-styles-83ad1e22.js → menu-item-styles-CbNUEwP2.js} +0 -0
- /package/dist/{roving-focus-group-5c059bf9.js → roving-focus-group-BdJ_4Njm.js} +0 -0
- /package/dist/{scroll-lock-d7b0df21.js → scroll-lock-BX6e3Ced.js} +0 -0
package/dist/odometer.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as T } from "./ElementBase-
|
|
1
|
+
import { E as T } from "./ElementBase-YlTLMsGk.mjs";
|
|
2
2
|
const D = `
|
|
3
3
|
:host {
|
|
4
4
|
--ui-odometer-font-family: var(--ui-font-family-mono, var(--font-mono, ui-monospace, 'SF Mono', Menlo, Monaco, Consolas, monospace));
|
|
@@ -299,8 +299,7 @@ function V(e) {
|
|
|
299
299
|
}
|
|
300
300
|
function n(e, t) {
|
|
301
301
|
const i = e.getAttribute(t);
|
|
302
|
-
if (i != null)
|
|
303
|
-
return i;
|
|
302
|
+
if (i != null) return i;
|
|
304
303
|
const r = e[t];
|
|
305
304
|
return typeof r == "string" && r.length > 0 ? r : null;
|
|
306
305
|
}
|
|
@@ -311,8 +310,7 @@ function l(e, t) {
|
|
|
311
310
|
return Number.isNaN(o) ? null : o;
|
|
312
311
|
}
|
|
313
312
|
const r = e[t];
|
|
314
|
-
if (typeof r == "number")
|
|
315
|
-
return Number.isNaN(r) ? null : r;
|
|
313
|
+
if (typeof r == "number") return Number.isNaN(r) ? null : r;
|
|
316
314
|
if (typeof r == "string") {
|
|
317
315
|
const o = parseFloat(r);
|
|
318
316
|
return Number.isNaN(o) ? null : o;
|
|
@@ -321,8 +319,7 @@ function l(e, t) {
|
|
|
321
319
|
}
|
|
322
320
|
function w(e, t) {
|
|
323
321
|
const i = e.getAttribute(t);
|
|
324
|
-
if (i != null)
|
|
325
|
-
return V(i);
|
|
322
|
+
if (i != null) return V(i);
|
|
326
323
|
const r = e[t];
|
|
327
324
|
return typeof r == "boolean" ? r : typeof r == "string" ? V(r) : !1;
|
|
328
325
|
}
|
|
@@ -434,8 +431,7 @@ class j extends T {
|
|
|
434
431
|
];
|
|
435
432
|
}
|
|
436
433
|
connectedCallback() {
|
|
437
|
-
if (super.connectedCallback(), this._initialized)
|
|
438
|
-
return;
|
|
434
|
+
if (super.connectedCallback(), this._initialized) return;
|
|
439
435
|
const t = this._readClampedValue();
|
|
440
436
|
if (this._targetValue = t, this._shouldAnimateOnMount() && t !== this._getMountStartValue()) {
|
|
441
437
|
this._currentValue = this._getMountStartValue(), this._initialized = !0, this.requestRender(), this._animateToValue(t);
|
package/dist/orbiter.cjs.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const B=require("./ElementBase-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const B=require("./ElementBase-EV6mVBUV.js"),O="18s",V="0s",A="88px",P="44px",w="128px",E="28px",$="20px",C=-90,X=6,W=new Set(["none","sm","md","lg","full"]),j=new Set(["clockwise","counterclockwise","alternate"]),Z=new Set(["calm","smooth","snappy","bouncy"]),_={xs:{orbitRadius:"54px",itemSize:"30px",centerSize:"80px",ringGap:"16px",padding:"12px",panelRadius:"22px"},sm:{orbitRadius:"68px",itemSize:"36px",centerSize:"96px",ringGap:"20px",padding:"14px",panelRadius:"24px"},md:{orbitRadius:A,itemSize:P,centerSize:w,ringGap:E,padding:$,panelRadius:"28px"},lg:{orbitRadius:"108px",itemSize:"52px",centerSize:"148px",ringGap:"32px",padding:"24px",panelRadius:"32px"},xl:{orbitRadius:"132px",itemSize:"64px",centerSize:"172px",ringGap:"38px",padding:"28px",panelRadius:"36px"}},M={calm:{durationScale:1.28,accentOpacity:.12},smooth:{durationScale:1,accentOpacity:.16},snappy:{durationScale:.82,accentOpacity:.18},bouncy:{durationScale:.92,accentOpacity:.22}},Q=`
|
|
2
2
|
:host {
|
|
3
|
-
--ui-orbiter-duration: ${
|
|
4
|
-
--ui-orbiter-delay: ${
|
|
3
|
+
--ui-orbiter-duration: ${O};
|
|
4
|
+
--ui-orbiter-delay: ${V};
|
|
5
5
|
--ui-orbiter-orbit-radius: ${A};
|
|
6
|
-
--ui-orbiter-item-size: ${
|
|
7
|
-
--ui-orbiter-center-size: ${
|
|
8
|
-
--ui-orbiter-ring-gap: ${
|
|
9
|
-
--ui-orbiter-padding: ${
|
|
6
|
+
--ui-orbiter-item-size: ${P};
|
|
7
|
+
--ui-orbiter-center-size: ${w};
|
|
8
|
+
--ui-orbiter-ring-gap: ${E};
|
|
9
|
+
--ui-orbiter-padding: ${$};
|
|
10
10
|
--ui-orbiter-radius: 28px;
|
|
11
11
|
--ui-orbiter-stage-size:
|
|
12
12
|
calc((2 * var(--ui-orbiter-farthest-radius, ${A})) + var(--ui-orbiter-item-size));
|
|
@@ -86,10 +86,10 @@
|
|
|
86
86
|
:host([size="md"]),
|
|
87
87
|
:host([size="2"]) {
|
|
88
88
|
--ui-orbiter-orbit-radius: ${A};
|
|
89
|
-
--ui-orbiter-item-size: ${
|
|
90
|
-
--ui-orbiter-center-size: ${
|
|
91
|
-
--ui-orbiter-ring-gap: ${
|
|
92
|
-
--ui-orbiter-padding: ${
|
|
89
|
+
--ui-orbiter-item-size: ${P};
|
|
90
|
+
--ui-orbiter-center-size: ${w};
|
|
91
|
+
--ui-orbiter-ring-gap: ${E};
|
|
92
|
+
--ui-orbiter-padding: ${$};
|
|
93
93
|
--ui-orbiter-radius: 28px;
|
|
94
94
|
}
|
|
95
95
|
|
|
@@ -479,7 +479,7 @@
|
|
|
479
479
|
forced-color-adjust: none;
|
|
480
480
|
}
|
|
481
481
|
}
|
|
482
|
-
`;function
|
|
482
|
+
`;function h(i,t){if(i==null||i==="")return t;const e=i.trim();if(!e)return t;const s=e.split(/\s+/).filter(Boolean);if(!s.length)return t;const b=s.map(a=>/^-?\d+(\.\d+)?$/.test(a)?`${a}px`:/^-?\d*\.?\d+(px|rem|em|%|vh|vw|ch|ex|vmin|vmax)$/.test(a)?a:null);return b.some(a=>a===null)?t:b.join(" ")}function N(i,t){if(i==null||i==="")return t;const e=i.trim();return e?/^-?\d+(\.\d+)?(ms|s)$/i.test(e)?e:/^-?\d+(\.\d+)?$/i.test(e)?`${e}s`:t:t}function F(i,t){if(i==null||i==="")return t;const e=i.trim();return e?/^-?\d+(\.\d+)?ms$/i.test(e)?Number.parseFloat(e):/^-?\d+(\.\d+)?s$/i.test(e)||/^-?\d+(\.\d+)?$/i.test(e)?Number.parseFloat(e)*1e3:t:t}function g(i,t){if(i==null||i==="")return t;const e=Number.parseFloat(i);return Number.isFinite(e)?e:t}function S(i,t){const e=g(i,t);return Number.isFinite(e)&&e>0?e:t}function q(i,t){if(i==null)return t;const e=i.trim().toLowerCase();return e?e==="false"||e==="0"||e==="off"||e==="no"?!1:e==="true"||e==="1"||e==="on"||e==="yes"?!0:t:!0}function v(i,t){return`translate(-50%, -50%) rotate(${i}deg) translateX(${t}) rotate(${-i}deg)`}function z(i){const t=Math.round(g(i,1));return Math.min(X,Math.max(1,t||1))}class D extends B.ElementBase{constructor(){super(),this._itemSlot=null,this._centerSlot=null,this._pathsEl=null,this._items=[],this._centerNodes=[],this._animations=new Map,this._hovering=!1,this._itemHovering=!1,this._focusWithin=!1,this._itemHoverHandlers=new WeakMap,this._boundSlotChange=this._handleSlotChange.bind(this),this._boundPointerEnter=()=>{this._hovering=!0,this._syncState()},this._boundPointerLeave=()=>{this._hovering=!1,this._syncState()},this._boundFocusIn=()=>{this._focusWithin=!0,this._syncState()},this._boundFocusOut=()=>{this._focusWithin=this.matches(":focus-within"),this._syncState()},this.addEventListener("pointerenter",this._boundPointerEnter),this.addEventListener("pointerleave",this._boundPointerLeave),this.addEventListener("focusin",this._boundFocusIn),this.addEventListener("focusout",this._boundFocusOut)}static get observedAttributes(){return["duration","delay","speed","reverse","radius","orbit-radius","icon-size","item-size","center-size","ring-gap","rings","start-angle","direction","animation","variant","tone","size","surface-radius","elevation","padding","path","show-paths","pause-on-hover","pause-on-item-hover","pause-on-focus","paused"]}play(){this.hasAttribute("paused")&&this.removeAttribute("paused"),this._syncState()}pause(){this.hasAttribute("paused")||this.setAttribute("paused",""),this._syncState()}refresh(){this._syncRuntimeStyles(),this._syncItems(),this._renderPaths(),this._syncAnimations(),this._syncState()}disconnectedCallback(){this._cancelAllAnimations(),this._hovering=!1,this._itemHovering=!1,this._focusWithin=!1,super.disconnectedCallback()}render(){this.setContent(`
|
|
483
483
|
<style>${Q}</style>
|
|
484
484
|
<div class="root" part="root">
|
|
485
485
|
<div class="surface" part="surface">
|
|
@@ -492,4 +492,4 @@
|
|
|
492
492
|
</div>
|
|
493
493
|
</div>
|
|
494
494
|
</div>
|
|
495
|
-
`),this._itemSlot=this.root.querySelector("slot:not([name])"),this._centerSlot=this.root.querySelector('slot[name="center"]'),this._pathsEl=this.root.querySelector(".paths"),(t=this._itemSlot)==null||t.addEventListener("slotchange",this._boundSlotChange),(e=this._centerSlot)==null||e.addEventListener("slotchange",this._boundSlotChange),this._syncRuntimeStyles(),this._syncItems(),this._renderPaths(),this._syncAnimations(),this._syncState()}shouldRenderOnAttributeChange(){return!1}attributeChangedCallback(t,e,a){if(!(e===a||!this.isConnected)){if(t==="paused"){this._syncState();return}this._syncRuntimeStyles(),t==="orbit-radius"||t==="radius"||t==="icon-size"||t==="item-size"||t==="center-size"||t==="ring-gap"||t==="rings"||t==="start-angle"||t==="direction"||t==="reverse"||t==="size"?(this._syncItems(),this._renderPaths(),this._syncAnimations()):(t==="duration"||t==="delay"||t==="speed"||t==="animation")&&this._syncAnimations(),this._syncState()}}_handleSlotChange(){this._syncItems(),this._renderPaths(),this._syncAnimations(),this._syncState()}_itemsFromSlot(){return this._itemSlot?this._itemSlot.assignedElements({flatten:!0}).filter(t=>t instanceof HTMLElement):[]}_centerFromSlot(){return this._centerSlot?this._centerSlot.assignedElements({flatten:!0}).filter(t=>t instanceof HTMLElement):[]}_syncItems(){const t=this._itemsFromSlot(),e=this._centerFromSlot(),a=new Set(t),n=new Set(e);for(const r of this._items)a.has(r)||(this._unbindItemHover(r),this._cancelAnimation(r),r.removeAttribute("data-ui-orbiter-managed"),r.removeAttribute("data-ui-orbit-runtime"),r.style.removeProperty("--ui-orbit-index"),r.style.removeProperty("--ui-orbit-ring"),r.style.removeProperty("--ui-orbit-radius"),r.style.removeProperty("--ui-orbit-start-angle"),r.style.removeProperty("--ui-orbit-quarter-angle"),r.style.removeProperty("--ui-orbit-half-angle"),r.style.removeProperty("--ui-orbit-three-quarter-angle"),r.style.removeProperty("--ui-orbit-end-angle"),r.style.removeProperty("--ui-orbit-start-angle-inverse"),r.style.removeProperty("--ui-orbit-quarter-angle-inverse"),r.style.removeProperty("--ui-orbit-half-angle-inverse"),r.style.removeProperty("--ui-orbit-three-quarter-angle-inverse"),r.style.removeProperty("--ui-orbit-end-angle-inverse"),r.style.removeProperty("--ui-orbit-duration"),r.style.removeProperty("--ui-orbit-duration-scale"),r.style.removeProperty("animation"),r.style.removeProperty("transform"),r.hasAttribute("data-ui-orbiter-owned")&&(r.removeAttribute("data-ui-orbiter-item"),r.removeAttribute("data-ui-orbiter-owned")));for(const r of this._centerNodes)n.has(r)||(r.removeAttribute("data-ui-orbiter-managed"),r.hasAttribute("data-ui-orbiter-owned")&&(r.removeAttribute("data-ui-orbiter-center"),r.removeAttribute("data-ui-orbiter-owned")));e.forEach(r=>{r.setAttribute("data-ui-orbiter-managed",""),r.hasAttribute("data-ui-orbiter-center")||(r.setAttribute("data-ui-orbiter-center",""),r.setAttribute("data-ui-orbiter-owned","")),r.setAttribute("slot","center")});const u=P(this.getAttribute("rings")),b=d(this._orbitRadiusValue(),this._sizePreset().orbitRadius),h=d(this.getAttribute("ring-gap"),this._sizePreset().ringGap),o=g(this.getAttribute("start-angle"),M),l=Array.from({length:u},()=>[]);t.forEach((r,c)=>{r.setAttribute("data-ui-orbiter-managed",""),r.hasAttribute("data-ui-orbiter-item")||(r.setAttribute("data-ui-orbiter-item",""),r.setAttribute("data-ui-orbiter-owned","")),this._bindItemHover(r),l[c%u].push({item:r,index:c})}),l.forEach((r,c)=>{const f=r.length?360/r.length:360,x=r.length>1&&c%2===1?f/2:0,p=c===0?b:`calc(${b} + ${c} * ${h})`,v=360*this._directionSign(c);r.forEach(({item:s,index:S},U)=>{const m=o+x+U*f,k=m+v,I=m+v*.25,L=m+v*.5,H=m+v*.75,C=1+c*.14;s.style.setProperty("--ui-orbit-index",String(S)),s.style.setProperty("--ui-orbit-ring",String(c)),s.style.setProperty("--ui-orbit-radius",p),s.style.setProperty("--ui-orbit-duration",`calc(var(--ui-orbiter-duration) * ${C})`),s.style.setProperty("--ui-orbit-duration-scale",String(C)),s.style.setProperty("--ui-orbit-start-angle",`${m}deg`),s.style.setProperty("--ui-orbit-quarter-angle",`${I}deg`),s.style.setProperty("--ui-orbit-half-angle",`${L}deg`),s.style.setProperty("--ui-orbit-three-quarter-angle",`${H}deg`),s.style.setProperty("--ui-orbit-end-angle",`${k}deg`),s.style.setProperty("--ui-orbit-start-angle-inverse",`${-m}deg`),s.style.setProperty("--ui-orbit-quarter-angle-inverse",`${-I}deg`),s.style.setProperty("--ui-orbit-half-angle-inverse",`${-L}deg`),s.style.setProperty("--ui-orbit-three-quarter-angle-inverse",`${-H}deg`),s.style.setProperty("--ui-orbit-end-angle-inverse",`${-k}deg`),s.style.setProperty("transform",y(m,p))})}),this._items=t,this._centerNodes=e,this._itemHovering=this._items.some(r=>r.matches(":hover")),this.setAttribute("data-item-count",String(this._items.length)),this.setAttribute("data-center-count",String(this._centerNodes.length)),this.setAttribute("data-ring-count",String(u))}_renderPaths(){if(!this._pathsEl)return;const t=P(this.getAttribute("rings")),e=d(this._orbitRadiusValue(),this._sizePreset().orbitRadius),a=d(this.getAttribute("ring-gap"),this._sizePreset().ringGap),n=Array.from({length:t},(u,b)=>{const h=b===0?e:`calc(${e} + ${b} * ${a})`;return`<div class="path" part="path path-${b+1}" style="inline-size:calc(2 * (${h}));block-size:calc(2 * (${h}));"></div>`}).join("");this._pathsEl.innerHTML=n,this._pathsEl.toggleAttribute("hidden",!this._pathVisible())}_bindItemHover(t){if(this._itemHoverHandlers.has(t))return;const e=()=>{this._itemHovering=!0,this._syncState()},a=n=>{const u=n.relatedTarget instanceof HTMLElement?n.relatedTarget:null,b=u==null?void 0:u.closest("[data-ui-orbiter-item]");this._itemHovering=b instanceof HTMLElement?this._items.includes(b):!1,this._syncState()};t.addEventListener("pointerenter",e),t.addEventListener("pointerleave",a),this._itemHoverHandlers.set(t,{enter:e,leave:a})}_unbindItemHover(t){const e=this._itemHoverHandlers.get(t);e&&(t.removeEventListener("pointerenter",e.enter),t.removeEventListener("pointerleave",e.leave),this._itemHoverHandlers.delete(t))}_sizePreset(){switch(this.getAttribute("size")){case"xs":case"0":return _.xs;case"sm":case"1":return _.sm;case"lg":case"3":return _.lg;case"xl":case"4":return _.xl;case"md":case"2":default:return _.md}}_motionPreset(){const t=this.getAttribute("animation");return t&&Z.has(t)?N[t]:N.smooth}_direction(){const t=this.getAttribute("direction");return t&&j.has(t)?t:"clockwise"}_directionSign(t){const e=this._direction();let a=e==="counterclockwise"||e==="alternate"&&t%2===1?-1:1;return O(this.getAttribute("reverse"),this.hasAttribute("reverse"))&&(a*=-1),a}_pathVisible(){const t=this.getAttribute("path");return t!=null?O(t,!0):(this.hasAttribute("show-paths"),!0)}_orbitRadiusValue(){return this.getAttribute("radius")??this.getAttribute("orbit-radius")}_iconSizeValue(){return this.getAttribute("icon-size")??this.getAttribute("item-size")}_syncRuntimeStyles(){const t=this._sizePreset(),e=this._motionPreset(),a=F(this.getAttribute("duration"),V),n=F(this.getAttribute("delay"),D),u=d(this._orbitRadiusValue(),t.orbitRadius),b=d(this._iconSizeValue(),t.itemSize),h=d(this.getAttribute("center-size"),t.centerSize),o=d(this.getAttribute("ring-gap"),t.ringGap),l=d(this.getAttribute("padding"),t.padding),r=P(this.getAttribute("rings")),c=z(this.getAttribute("speed"),1),f=r<=1?u:`calc(${u} + ${r-1} * ${o})`,x=`calc((2 * (${f})) + ${b})`;this.style.setProperty("--ui-orbiter-duration",`calc((${a}) * ${e.durationScale} / ${c})`),this.style.setProperty("--ui-orbiter-delay",n),this.style.setProperty("--ui-orbiter-orbit-radius",u),this.style.setProperty("--ui-orbiter-item-size",b),this.style.setProperty("--ui-orbiter-center-size",h),this.style.setProperty("--ui-orbiter-ring-gap",o),this.style.setProperty("--ui-orbiter-padding",l),this.style.setProperty("--ui-orbiter-farthest-radius",f),this.style.setProperty("--ui-orbiter-stage-size",x),this.style.setProperty("--ui-orbiter-path-opacity",String(e.accentOpacity>.18?1:.95));const p=this.getAttribute("surface-radius");!p||W.has(p.trim())?this.style.removeProperty("--ui-orbiter-radius"):this.style.setProperty("--ui-orbiter-radius",d(p,t.panelRadius))}_syncAnimations(){var h;const t=this._items,e=new Set(t);for(const[o,l]of this._animations.entries())e.has(o)||(l.cancel(),this._animations.delete(o));if(typeof window<"u"&&((h=window.matchMedia)!=null&&h.call(window,"(prefers-reduced-motion: reduce)").matches)){this._cancelAllAnimations(),t.forEach(o=>o.removeAttribute("data-ui-orbit-runtime"));return}if(typeof HTMLElement>"u"||typeof HTMLElement.prototype.animate!="function"){t.forEach(o=>o.removeAttribute("data-ui-orbit-runtime"));return}const a=this._motionPreset(),n=q(this.getAttribute("duration"),18e3),u=q(this.getAttribute("delay"),0),b=z(this.getAttribute("speed"),1);for(const o of t){const l=o.style.getPropertyValue("--ui-orbit-radius")||"var(--ui-orbiter-orbit-radius)",r=g(o.style.getPropertyValue("--ui-orbit-start-angle"),M),c=g(o.style.getPropertyValue("--ui-orbit-quarter-angle"),r+90),f=g(o.style.getPropertyValue("--ui-orbit-half-angle"),r+180),x=g(o.style.getPropertyValue("--ui-orbit-three-quarter-angle"),r+270),p=g(o.style.getPropertyValue("--ui-orbit-end-angle"),r+360),T=z(o.style.getPropertyValue("--ui-orbit-duration-scale"),1),v=n*a.durationScale*T/b,s=this._animations.get(o);s==null||s.cancel(),o.setAttribute("data-ui-orbit-runtime","");const S=o.animate([{transform:y(r,l),offset:0},{transform:y(c,l),offset:.25},{transform:y(f,l),offset:.5},{transform:y(x,l),offset:.75},{transform:y(p,l),offset:1}],{duration:Math.max(1,v),delay:Math.max(0,u),easing:"linear",iterations:Number.POSITIVE_INFINITY,fill:"both"});this._animations.set(o,S)}}_cancelAnimation(t){const e=this._animations.get(t);t.removeAttribute("data-ui-orbit-runtime"),e&&(e.cancel(),this._animations.delete(t))}_cancelAllAnimations(){for(const t of this._animations.values())t.cancel();this._animations.clear(),this._items.forEach(t=>{t.removeAttribute("data-ui-orbit-runtime"),this._unbindItemHover(t)})}_effectivePaused(){return!!(this.hasAttribute("paused")||this.hasAttribute("pause-on-hover")&&this._hovering||this.hasAttribute("pause-on-item-hover")&&this._itemHovering||this.hasAttribute("pause-on-focus")&&this._focusWithin)}_syncState(){const t=this._effectivePaused()?"paused":"running";this.setAttribute("data-state",t),this.setAttribute("data-path-visible",this._pathVisible()?"true":"false"),this.setAttribute("data-item-hovered",this._itemHovering?"true":"false");for(const e of this._animations.values())t==="paused"?e.pause():e.play()}}typeof customElements<"u"&&!customElements.get("ui-orbiter")&&customElements.define("ui-orbiter",G);exports.UIOrbiter=G;
|
|
495
|
+
`),this._itemSlot=this.root.querySelector("slot:not([name])"),this._centerSlot=this.root.querySelector('slot[name="center"]'),this._pathsEl=this.root.querySelector(".paths"),this._itemSlot?.addEventListener("slotchange",this._boundSlotChange),this._centerSlot?.addEventListener("slotchange",this._boundSlotChange),this._syncRuntimeStyles(),this._syncItems(),this._renderPaths(),this._syncAnimations(),this._syncState()}shouldRenderOnAttributeChange(){return!1}attributeChangedCallback(t,e,s){if(!(e===s||!this.isConnected)){if(t==="paused"){this._syncState();return}this._syncRuntimeStyles(),t==="orbit-radius"||t==="radius"||t==="icon-size"||t==="item-size"||t==="center-size"||t==="ring-gap"||t==="rings"||t==="start-angle"||t==="direction"||t==="reverse"||t==="size"?(this._syncItems(),this._renderPaths(),this._syncAnimations()):(t==="duration"||t==="delay"||t==="speed"||t==="animation")&&this._syncAnimations(),this._syncState()}}_handleSlotChange(){this._syncItems(),this._renderPaths(),this._syncAnimations(),this._syncState()}_itemsFromSlot(){return this._itemSlot?this._itemSlot.assignedElements({flatten:!0}).filter(t=>t instanceof HTMLElement):[]}_centerFromSlot(){return this._centerSlot?this._centerSlot.assignedElements({flatten:!0}).filter(t=>t instanceof HTMLElement):[]}_syncItems(){const t=this._itemsFromSlot(),e=this._centerFromSlot(),s=new Set(t),b=new Set(e);for(const r of this._items)s.has(r)||(this._unbindItemHover(r),this._cancelAnimation(r),r.removeAttribute("data-ui-orbiter-managed"),r.removeAttribute("data-ui-orbit-runtime"),r.style.removeProperty("--ui-orbit-index"),r.style.removeProperty("--ui-orbit-ring"),r.style.removeProperty("--ui-orbit-radius"),r.style.removeProperty("--ui-orbit-start-angle"),r.style.removeProperty("--ui-orbit-quarter-angle"),r.style.removeProperty("--ui-orbit-half-angle"),r.style.removeProperty("--ui-orbit-three-quarter-angle"),r.style.removeProperty("--ui-orbit-end-angle"),r.style.removeProperty("--ui-orbit-start-angle-inverse"),r.style.removeProperty("--ui-orbit-quarter-angle-inverse"),r.style.removeProperty("--ui-orbit-half-angle-inverse"),r.style.removeProperty("--ui-orbit-three-quarter-angle-inverse"),r.style.removeProperty("--ui-orbit-end-angle-inverse"),r.style.removeProperty("--ui-orbit-duration"),r.style.removeProperty("--ui-orbit-duration-scale"),r.style.removeProperty("animation"),r.style.removeProperty("transform"),r.hasAttribute("data-ui-orbiter-owned")&&(r.removeAttribute("data-ui-orbiter-item"),r.removeAttribute("data-ui-orbiter-owned")));for(const r of this._centerNodes)b.has(r)||(r.removeAttribute("data-ui-orbiter-managed"),r.hasAttribute("data-ui-orbiter-owned")&&(r.removeAttribute("data-ui-orbiter-center"),r.removeAttribute("data-ui-orbiter-owned")));e.forEach(r=>{r.setAttribute("data-ui-orbiter-managed",""),r.hasAttribute("data-ui-orbiter-center")||(r.setAttribute("data-ui-orbiter-center",""),r.setAttribute("data-ui-orbiter-owned","")),r.setAttribute("slot","center")});const a=z(this.getAttribute("rings")),u=h(this._orbitRadiusValue(),this._sizePreset().orbitRadius),o=h(this.getAttribute("ring-gap"),this._sizePreset().ringGap),l=g(this.getAttribute("start-angle"),C),d=Array.from({length:a},()=>[]);t.forEach((r,c)=>{r.setAttribute("data-ui-orbiter-managed",""),r.hasAttribute("data-ui-orbiter-item")||(r.setAttribute("data-ui-orbiter-item",""),r.setAttribute("data-ui-orbiter-owned","")),this._bindItemHover(r),d[c%a].push({item:r,index:c})}),d.forEach((r,c)=>{const f=r.length?360/r.length:360,y=r.length>1&&c%2===1?f/2:0,p=c===0?u:`calc(${u} + ${c} * ${o})`,x=360*this._directionSign(c);r.forEach(({item:n,index:G},U)=>{const m=l+y+U*f,R=m+x,k=m+x*.25,I=m+x*.5,L=m+x*.75,H=1+c*.14;n.style.setProperty("--ui-orbit-index",String(G)),n.style.setProperty("--ui-orbit-ring",String(c)),n.style.setProperty("--ui-orbit-radius",p),n.style.setProperty("--ui-orbit-duration",`calc(var(--ui-orbiter-duration) * ${H})`),n.style.setProperty("--ui-orbit-duration-scale",String(H)),n.style.setProperty("--ui-orbit-start-angle",`${m}deg`),n.style.setProperty("--ui-orbit-quarter-angle",`${k}deg`),n.style.setProperty("--ui-orbit-half-angle",`${I}deg`),n.style.setProperty("--ui-orbit-three-quarter-angle",`${L}deg`),n.style.setProperty("--ui-orbit-end-angle",`${R}deg`),n.style.setProperty("--ui-orbit-start-angle-inverse",`${-m}deg`),n.style.setProperty("--ui-orbit-quarter-angle-inverse",`${-k}deg`),n.style.setProperty("--ui-orbit-half-angle-inverse",`${-I}deg`),n.style.setProperty("--ui-orbit-three-quarter-angle-inverse",`${-L}deg`),n.style.setProperty("--ui-orbit-end-angle-inverse",`${-R}deg`),n.style.setProperty("transform",v(m,p))})}),this._items=t,this._centerNodes=e,this._itemHovering=this._items.some(r=>r.matches(":hover")),this.setAttribute("data-item-count",String(this._items.length)),this.setAttribute("data-center-count",String(this._centerNodes.length)),this.setAttribute("data-ring-count",String(a))}_renderPaths(){if(!this._pathsEl)return;const t=z(this.getAttribute("rings")),e=h(this._orbitRadiusValue(),this._sizePreset().orbitRadius),s=h(this.getAttribute("ring-gap"),this._sizePreset().ringGap),b=Array.from({length:t},(a,u)=>{const o=u===0?e:`calc(${e} + ${u} * ${s})`;return`<div class="path" part="path path-${u+1}" style="inline-size:calc(2 * (${o}));block-size:calc(2 * (${o}));"></div>`}).join("");this._pathsEl.innerHTML=b,this._pathsEl.toggleAttribute("hidden",!this._pathVisible())}_bindItemHover(t){if(this._itemHoverHandlers.has(t))return;const e=()=>{this._itemHovering=!0,this._syncState()},s=b=>{const u=(b.relatedTarget instanceof HTMLElement?b.relatedTarget:null)?.closest("[data-ui-orbiter-item]");this._itemHovering=u instanceof HTMLElement?this._items.includes(u):!1,this._syncState()};t.addEventListener("pointerenter",e),t.addEventListener("pointerleave",s),this._itemHoverHandlers.set(t,{enter:e,leave:s})}_unbindItemHover(t){const e=this._itemHoverHandlers.get(t);e&&(t.removeEventListener("pointerenter",e.enter),t.removeEventListener("pointerleave",e.leave),this._itemHoverHandlers.delete(t))}_sizePreset(){switch(this.getAttribute("size")){case"xs":case"0":return _.xs;case"sm":case"1":return _.sm;case"lg":case"3":return _.lg;case"xl":case"4":return _.xl;default:return _.md}}_motionPreset(){const t=this.getAttribute("animation");return t&&Z.has(t)?M[t]:M.smooth}_direction(){const t=this.getAttribute("direction");return t&&j.has(t)?t:"clockwise"}_directionSign(t){const e=this._direction();let s=e==="counterclockwise"||e==="alternate"&&t%2===1?-1:1;return q(this.getAttribute("reverse"),this.hasAttribute("reverse"))&&(s*=-1),s}_pathVisible(){const t=this.getAttribute("path");return t!=null?q(t,!0):(this.hasAttribute("show-paths"),!0)}_orbitRadiusValue(){return this.getAttribute("radius")??this.getAttribute("orbit-radius")}_iconSizeValue(){return this.getAttribute("icon-size")??this.getAttribute("item-size")}_syncRuntimeStyles(){const t=this._sizePreset(),e=this._motionPreset(),s=N(this.getAttribute("duration"),O),b=N(this.getAttribute("delay"),V),a=h(this._orbitRadiusValue(),t.orbitRadius),u=h(this._iconSizeValue(),t.itemSize),o=h(this.getAttribute("center-size"),t.centerSize),l=h(this.getAttribute("ring-gap"),t.ringGap),d=h(this.getAttribute("padding"),t.padding),r=z(this.getAttribute("rings")),c=S(this.getAttribute("speed"),1),f=r<=1?a:`calc(${a} + ${r-1} * ${l})`,y=`calc((2 * (${f})) + ${u})`;this.style.setProperty("--ui-orbiter-duration",`calc((${s}) * ${e.durationScale} / ${c})`),this.style.setProperty("--ui-orbiter-delay",b),this.style.setProperty("--ui-orbiter-orbit-radius",a),this.style.setProperty("--ui-orbiter-item-size",u),this.style.setProperty("--ui-orbiter-center-size",o),this.style.setProperty("--ui-orbiter-ring-gap",l),this.style.setProperty("--ui-orbiter-padding",d),this.style.setProperty("--ui-orbiter-farthest-radius",f),this.style.setProperty("--ui-orbiter-stage-size",y),this.style.setProperty("--ui-orbiter-path-opacity",String(e.accentOpacity>.18?1:.95));const p=this.getAttribute("surface-radius");!p||W.has(p.trim())?this.style.removeProperty("--ui-orbiter-radius"):this.style.setProperty("--ui-orbiter-radius",h(p,t.panelRadius))}_syncAnimations(){const t=this._items,e=new Set(t);for(const[o,l]of this._animations.entries())e.has(o)||(l.cancel(),this._animations.delete(o));if(typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches){this._cancelAllAnimations(),t.forEach(o=>o.removeAttribute("data-ui-orbit-runtime"));return}if(typeof HTMLElement>"u"||typeof HTMLElement.prototype.animate!="function"){t.forEach(o=>o.removeAttribute("data-ui-orbit-runtime"));return}const s=this._motionPreset(),b=F(this.getAttribute("duration"),18e3),a=F(this.getAttribute("delay"),0),u=S(this.getAttribute("speed"),1);for(const o of t){const l=o.style.getPropertyValue("--ui-orbit-radius")||"var(--ui-orbiter-orbit-radius)",d=g(o.style.getPropertyValue("--ui-orbit-start-angle"),C),r=g(o.style.getPropertyValue("--ui-orbit-quarter-angle"),d+90),c=g(o.style.getPropertyValue("--ui-orbit-half-angle"),d+180),f=g(o.style.getPropertyValue("--ui-orbit-three-quarter-angle"),d+270),y=g(o.style.getPropertyValue("--ui-orbit-end-angle"),d+360),p=S(o.style.getPropertyValue("--ui-orbit-duration-scale"),1),T=b*s.durationScale*p/u;this._animations.get(o)?.cancel(),o.setAttribute("data-ui-orbit-runtime","");const n=o.animate([{transform:v(d,l),offset:0},{transform:v(r,l),offset:.25},{transform:v(c,l),offset:.5},{transform:v(f,l),offset:.75},{transform:v(y,l),offset:1}],{duration:Math.max(1,T),delay:Math.max(0,a),easing:"linear",iterations:Number.POSITIVE_INFINITY,fill:"both"});this._animations.set(o,n)}}_cancelAnimation(t){const e=this._animations.get(t);t.removeAttribute("data-ui-orbit-runtime"),e&&(e.cancel(),this._animations.delete(t))}_cancelAllAnimations(){for(const t of this._animations.values())t.cancel();this._animations.clear(),this._items.forEach(t=>{t.removeAttribute("data-ui-orbit-runtime"),this._unbindItemHover(t)})}_effectivePaused(){return!!(this.hasAttribute("paused")||this.hasAttribute("pause-on-hover")&&this._hovering||this.hasAttribute("pause-on-item-hover")&&this._itemHovering||this.hasAttribute("pause-on-focus")&&this._focusWithin)}_syncState(){const t=this._effectivePaused()?"paused":"running";this.setAttribute("data-state",t),this.setAttribute("data-path-visible",this._pathVisible()?"true":"false"),this.setAttribute("data-item-hovered",this._itemHovering?"true":"false");for(const e of this._animations.values())t==="paused"?e.pause():e.play()}}typeof customElements<"u"&&!customElements.get("ui-orbiter")&&customElements.define("ui-orbiter",D);exports.UIOrbiter=D;
|
package/dist/orbiter.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as U } from "./ElementBase-
|
|
2
|
-
const
|
|
1
|
+
import { E as U } from "./ElementBase-YlTLMsGk.mjs";
|
|
2
|
+
const O = "18s", V = "0s", A = "88px", P = "44px", w = "128px", E = "28px", $ = "20px", C = -90, X = 6, B = /* @__PURE__ */ new Set(["none", "sm", "md", "lg", "full"]), W = /* @__PURE__ */ new Set(["clockwise", "counterclockwise", "alternate"]), j = /* @__PURE__ */ new Set(["calm", "smooth", "snappy", "bouncy"]), _ = {
|
|
3
3
|
xs: {
|
|
4
4
|
orbitRadius: "54px",
|
|
5
5
|
itemSize: "30px",
|
|
@@ -18,10 +18,10 @@ const V = "18s", D = "0s", A = "88px", w = "44px", E = "128px", $ = "28px", R =
|
|
|
18
18
|
},
|
|
19
19
|
md: {
|
|
20
20
|
orbitRadius: A,
|
|
21
|
-
itemSize:
|
|
22
|
-
centerSize:
|
|
23
|
-
ringGap:
|
|
24
|
-
padding:
|
|
21
|
+
itemSize: P,
|
|
22
|
+
centerSize: w,
|
|
23
|
+
ringGap: E,
|
|
24
|
+
padding: $,
|
|
25
25
|
panelRadius: "28px"
|
|
26
26
|
},
|
|
27
27
|
lg: {
|
|
@@ -40,7 +40,7 @@ const V = "18s", D = "0s", A = "88px", w = "44px", E = "128px", $ = "28px", R =
|
|
|
40
40
|
padding: "28px",
|
|
41
41
|
panelRadius: "36px"
|
|
42
42
|
}
|
|
43
|
-
},
|
|
43
|
+
}, N = {
|
|
44
44
|
calm: {
|
|
45
45
|
durationScale: 1.28,
|
|
46
46
|
accentOpacity: 0.12
|
|
@@ -59,13 +59,13 @@ const V = "18s", D = "0s", A = "88px", w = "44px", E = "128px", $ = "28px", R =
|
|
|
59
59
|
}
|
|
60
60
|
}, Z = `
|
|
61
61
|
:host {
|
|
62
|
-
--ui-orbiter-duration: ${
|
|
63
|
-
--ui-orbiter-delay: ${
|
|
62
|
+
--ui-orbiter-duration: ${O};
|
|
63
|
+
--ui-orbiter-delay: ${V};
|
|
64
64
|
--ui-orbiter-orbit-radius: ${A};
|
|
65
|
-
--ui-orbiter-item-size: ${
|
|
66
|
-
--ui-orbiter-center-size: ${
|
|
67
|
-
--ui-orbiter-ring-gap: ${
|
|
68
|
-
--ui-orbiter-padding: ${
|
|
65
|
+
--ui-orbiter-item-size: ${P};
|
|
66
|
+
--ui-orbiter-center-size: ${w};
|
|
67
|
+
--ui-orbiter-ring-gap: ${E};
|
|
68
|
+
--ui-orbiter-padding: ${$};
|
|
69
69
|
--ui-orbiter-radius: 28px;
|
|
70
70
|
--ui-orbiter-stage-size:
|
|
71
71
|
calc((2 * var(--ui-orbiter-farthest-radius, ${A})) + var(--ui-orbiter-item-size));
|
|
@@ -145,10 +145,10 @@ const V = "18s", D = "0s", A = "88px", w = "44px", E = "128px", $ = "28px", R =
|
|
|
145
145
|
:host([size="md"]),
|
|
146
146
|
:host([size="2"]) {
|
|
147
147
|
--ui-orbiter-orbit-radius: ${A};
|
|
148
|
-
--ui-orbiter-item-size: ${
|
|
149
|
-
--ui-orbiter-center-size: ${
|
|
150
|
-
--ui-orbiter-ring-gap: ${
|
|
151
|
-
--ui-orbiter-padding: ${
|
|
148
|
+
--ui-orbiter-item-size: ${P};
|
|
149
|
+
--ui-orbiter-center-size: ${w};
|
|
150
|
+
--ui-orbiter-ring-gap: ${E};
|
|
151
|
+
--ui-orbiter-padding: ${$};
|
|
152
152
|
--ui-orbiter-radius: 28px;
|
|
153
153
|
}
|
|
154
154
|
|
|
@@ -539,47 +539,43 @@ const V = "18s", D = "0s", A = "88px", w = "44px", E = "128px", $ = "28px", R =
|
|
|
539
539
|
}
|
|
540
540
|
}
|
|
541
541
|
`;
|
|
542
|
-
function
|
|
543
|
-
if (i == null || i === "")
|
|
544
|
-
return t;
|
|
542
|
+
function h(i, t) {
|
|
543
|
+
if (i == null || i === "") return t;
|
|
545
544
|
const e = i.trim();
|
|
546
|
-
if (!e)
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
545
|
+
if (!e) return t;
|
|
546
|
+
const s = e.split(/\s+/).filter(Boolean);
|
|
547
|
+
if (!s.length) return t;
|
|
548
|
+
const b = s.map((a) => /^-?\d+(\.\d+)?$/.test(a) ? `${a}px` : /^-?\d*\.?\d+(px|rem|em|%|vh|vw|ch|ex|vmin|vmax)$/.test(a) ? a : null);
|
|
549
|
+
return b.some((a) => a === null) ? t : b.join(" ");
|
|
550
550
|
}
|
|
551
|
-
function
|
|
552
|
-
if (i == null || i === "")
|
|
553
|
-
return t;
|
|
551
|
+
function F(i, t) {
|
|
552
|
+
if (i == null || i === "") return t;
|
|
554
553
|
const e = i.trim();
|
|
555
554
|
return e ? /^-?\d+(\.\d+)?(ms|s)$/i.test(e) ? e : /^-?\d+(\.\d+)?$/i.test(e) ? `${e}s` : t : t;
|
|
556
555
|
}
|
|
557
|
-
function
|
|
558
|
-
if (i == null || i === "")
|
|
559
|
-
return t;
|
|
556
|
+
function M(i, t) {
|
|
557
|
+
if (i == null || i === "") return t;
|
|
560
558
|
const e = i.trim();
|
|
561
559
|
return e ? /^-?\d+(\.\d+)?ms$/i.test(e) ? Number.parseFloat(e) : /^-?\d+(\.\d+)?s$/i.test(e) || /^-?\d+(\.\d+)?$/i.test(e) ? Number.parseFloat(e) * 1e3 : t : t;
|
|
562
560
|
}
|
|
563
561
|
function g(i, t) {
|
|
564
|
-
if (i == null || i === "")
|
|
565
|
-
return t;
|
|
562
|
+
if (i == null || i === "") return t;
|
|
566
563
|
const e = Number.parseFloat(i);
|
|
567
564
|
return Number.isFinite(e) ? e : t;
|
|
568
565
|
}
|
|
569
|
-
function
|
|
566
|
+
function S(i, t) {
|
|
570
567
|
const e = g(i, t);
|
|
571
568
|
return Number.isFinite(e) && e > 0 ? e : t;
|
|
572
569
|
}
|
|
573
|
-
function
|
|
574
|
-
if (i == null)
|
|
575
|
-
return t;
|
|
570
|
+
function q(i, t) {
|
|
571
|
+
if (i == null) return t;
|
|
576
572
|
const e = i.trim().toLowerCase();
|
|
577
573
|
return e ? e === "false" || e === "0" || e === "off" || e === "no" ? !1 : e === "true" || e === "1" || e === "on" || e === "yes" ? !0 : t : !0;
|
|
578
574
|
}
|
|
579
|
-
function
|
|
575
|
+
function v(i, t) {
|
|
580
576
|
return `translate(-50%, -50%) rotate(${i}deg) translateX(${t}) rotate(${-i}deg)`;
|
|
581
577
|
}
|
|
582
|
-
function
|
|
578
|
+
function z(i) {
|
|
583
579
|
const t = Math.round(g(i, 1));
|
|
584
580
|
return Math.min(X, Math.max(1, t || 1));
|
|
585
581
|
}
|
|
@@ -638,7 +634,6 @@ class Q extends U {
|
|
|
638
634
|
this._cancelAllAnimations(), this._hovering = !1, this._itemHovering = !1, this._focusWithin = !1, super.disconnectedCallback();
|
|
639
635
|
}
|
|
640
636
|
render() {
|
|
641
|
-
var t, e;
|
|
642
637
|
this.setContent(`
|
|
643
638
|
<style>${Z}</style>
|
|
644
639
|
<div class="root" part="root">
|
|
@@ -652,13 +647,13 @@ class Q extends U {
|
|
|
652
647
|
</div>
|
|
653
648
|
</div>
|
|
654
649
|
</div>
|
|
655
|
-
`), this._itemSlot = this.root.querySelector("slot:not([name])"), this._centerSlot = this.root.querySelector('slot[name="center"]'), this._pathsEl = this.root.querySelector(".paths"),
|
|
650
|
+
`), this._itemSlot = this.root.querySelector("slot:not([name])"), this._centerSlot = this.root.querySelector('slot[name="center"]'), this._pathsEl = this.root.querySelector(".paths"), this._itemSlot?.addEventListener("slotchange", this._boundSlotChange), this._centerSlot?.addEventListener("slotchange", this._boundSlotChange), this._syncRuntimeStyles(), this._syncItems(), this._renderPaths(), this._syncAnimations(), this._syncState();
|
|
656
651
|
}
|
|
657
652
|
shouldRenderOnAttributeChange() {
|
|
658
653
|
return !1;
|
|
659
654
|
}
|
|
660
|
-
attributeChangedCallback(t, e,
|
|
661
|
-
if (!(e ===
|
|
655
|
+
attributeChangedCallback(t, e, s) {
|
|
656
|
+
if (!(e === s || !this.isConnected)) {
|
|
662
657
|
if (t === "paused") {
|
|
663
658
|
this._syncState();
|
|
664
659
|
return;
|
|
@@ -676,44 +671,42 @@ class Q extends U {
|
|
|
676
671
|
return this._centerSlot ? this._centerSlot.assignedElements({ flatten: !0 }).filter((t) => t instanceof HTMLElement) : [];
|
|
677
672
|
}
|
|
678
673
|
_syncItems() {
|
|
679
|
-
const t = this._itemsFromSlot(), e = this._centerFromSlot(),
|
|
674
|
+
const t = this._itemsFromSlot(), e = this._centerFromSlot(), s = new Set(t), b = new Set(e);
|
|
680
675
|
for (const r of this._items)
|
|
681
|
-
|
|
676
|
+
s.has(r) || (this._unbindItemHover(r), this._cancelAnimation(r), r.removeAttribute("data-ui-orbiter-managed"), r.removeAttribute("data-ui-orbit-runtime"), r.style.removeProperty("--ui-orbit-index"), r.style.removeProperty("--ui-orbit-ring"), r.style.removeProperty("--ui-orbit-radius"), r.style.removeProperty("--ui-orbit-start-angle"), r.style.removeProperty("--ui-orbit-quarter-angle"), r.style.removeProperty("--ui-orbit-half-angle"), r.style.removeProperty("--ui-orbit-three-quarter-angle"), r.style.removeProperty("--ui-orbit-end-angle"), r.style.removeProperty("--ui-orbit-start-angle-inverse"), r.style.removeProperty("--ui-orbit-quarter-angle-inverse"), r.style.removeProperty("--ui-orbit-half-angle-inverse"), r.style.removeProperty("--ui-orbit-three-quarter-angle-inverse"), r.style.removeProperty("--ui-orbit-end-angle-inverse"), r.style.removeProperty("--ui-orbit-duration"), r.style.removeProperty("--ui-orbit-duration-scale"), r.style.removeProperty("animation"), r.style.removeProperty("transform"), r.hasAttribute("data-ui-orbiter-owned") && (r.removeAttribute("data-ui-orbiter-item"), r.removeAttribute("data-ui-orbiter-owned")));
|
|
682
677
|
for (const r of this._centerNodes)
|
|
683
|
-
|
|
678
|
+
b.has(r) || (r.removeAttribute("data-ui-orbiter-managed"), r.hasAttribute("data-ui-orbiter-owned") && (r.removeAttribute("data-ui-orbiter-center"), r.removeAttribute("data-ui-orbiter-owned")));
|
|
684
679
|
e.forEach((r) => {
|
|
685
680
|
r.setAttribute("data-ui-orbiter-managed", ""), r.hasAttribute("data-ui-orbiter-center") || (r.setAttribute("data-ui-orbiter-center", ""), r.setAttribute("data-ui-orbiter-owned", "")), r.setAttribute("slot", "center");
|
|
686
681
|
});
|
|
687
|
-
const
|
|
682
|
+
const a = z(this.getAttribute("rings")), u = h(this._orbitRadiusValue(), this._sizePreset().orbitRadius), o = h(this.getAttribute("ring-gap"), this._sizePreset().ringGap), l = g(this.getAttribute("start-angle"), C), d = Array.from({ length: a }, () => []);
|
|
688
683
|
t.forEach((r, c) => {
|
|
689
|
-
r.setAttribute("data-ui-orbiter-managed", ""), r.hasAttribute("data-ui-orbiter-item") || (r.setAttribute("data-ui-orbiter-item", ""), r.setAttribute("data-ui-orbiter-owned", "")), this._bindItemHover(r),
|
|
690
|
-
}),
|
|
691
|
-
const f = r.length ? 360 / r.length : 360,
|
|
692
|
-
r.forEach(({ item:
|
|
693
|
-
const m =
|
|
694
|
-
|
|
684
|
+
r.setAttribute("data-ui-orbiter-managed", ""), r.hasAttribute("data-ui-orbiter-item") || (r.setAttribute("data-ui-orbiter-item", ""), r.setAttribute("data-ui-orbiter-owned", "")), this._bindItemHover(r), d[c % a].push({ item: r, index: c });
|
|
685
|
+
}), d.forEach((r, c) => {
|
|
686
|
+
const f = r.length ? 360 / r.length : 360, y = r.length > 1 && c % 2 === 1 ? f / 2 : 0, p = c === 0 ? u : `calc(${u} + ${c} * ${o})`, x = 360 * this._directionSign(c);
|
|
687
|
+
r.forEach(({ item: n, index: D }, G) => {
|
|
688
|
+
const m = l + y + G * f, R = m + x, k = m + x * 0.25, I = m + x * 0.5, L = m + x * 0.75, H = 1 + c * 0.14;
|
|
689
|
+
n.style.setProperty("--ui-orbit-index", String(D)), n.style.setProperty("--ui-orbit-ring", String(c)), n.style.setProperty("--ui-orbit-radius", p), n.style.setProperty("--ui-orbit-duration", `calc(var(--ui-orbiter-duration) * ${H})`), n.style.setProperty("--ui-orbit-duration-scale", String(H)), n.style.setProperty("--ui-orbit-start-angle", `${m}deg`), n.style.setProperty("--ui-orbit-quarter-angle", `${k}deg`), n.style.setProperty("--ui-orbit-half-angle", `${I}deg`), n.style.setProperty("--ui-orbit-three-quarter-angle", `${L}deg`), n.style.setProperty("--ui-orbit-end-angle", `${R}deg`), n.style.setProperty("--ui-orbit-start-angle-inverse", `${-m}deg`), n.style.setProperty("--ui-orbit-quarter-angle-inverse", `${-k}deg`), n.style.setProperty("--ui-orbit-half-angle-inverse", `${-I}deg`), n.style.setProperty("--ui-orbit-three-quarter-angle-inverse", `${-L}deg`), n.style.setProperty("--ui-orbit-end-angle-inverse", `${-R}deg`), n.style.setProperty("transform", v(m, p));
|
|
695
690
|
});
|
|
696
|
-
}), this._items = t, this._centerNodes = e, this._itemHovering = this._items.some((r) => r.matches(":hover")), this.setAttribute("data-item-count", String(this._items.length)), this.setAttribute("data-center-count", String(this._centerNodes.length)), this.setAttribute("data-ring-count", String(
|
|
691
|
+
}), this._items = t, this._centerNodes = e, this._itemHovering = this._items.some((r) => r.matches(":hover")), this.setAttribute("data-item-count", String(this._items.length)), this.setAttribute("data-center-count", String(this._centerNodes.length)), this.setAttribute("data-ring-count", String(a));
|
|
697
692
|
}
|
|
698
693
|
_renderPaths() {
|
|
699
|
-
if (!this._pathsEl)
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
return `<div class="path" part="path path-${b + 1}" style="inline-size:calc(2 * (${h}));block-size:calc(2 * (${h}));"></div>`;
|
|
694
|
+
if (!this._pathsEl) return;
|
|
695
|
+
const t = z(this.getAttribute("rings")), e = h(this._orbitRadiusValue(), this._sizePreset().orbitRadius), s = h(this.getAttribute("ring-gap"), this._sizePreset().ringGap), b = Array.from({ length: t }, (a, u) => {
|
|
696
|
+
const o = u === 0 ? e : `calc(${e} + ${u} * ${s})`;
|
|
697
|
+
return `<div class="path" part="path path-${u + 1}" style="inline-size:calc(2 * (${o}));block-size:calc(2 * (${o}));"></div>`;
|
|
704
698
|
}).join("");
|
|
705
|
-
this._pathsEl.innerHTML =
|
|
699
|
+
this._pathsEl.innerHTML = b, this._pathsEl.toggleAttribute("hidden", !this._pathVisible());
|
|
706
700
|
}
|
|
707
701
|
_bindItemHover(t) {
|
|
708
|
-
if (this._itemHoverHandlers.has(t))
|
|
709
|
-
return;
|
|
702
|
+
if (this._itemHoverHandlers.has(t)) return;
|
|
710
703
|
const e = () => {
|
|
711
704
|
this._itemHovering = !0, this._syncState();
|
|
712
|
-
},
|
|
713
|
-
const u =
|
|
714
|
-
this._itemHovering =
|
|
705
|
+
}, s = (b) => {
|
|
706
|
+
const u = (b.relatedTarget instanceof HTMLElement ? b.relatedTarget : null)?.closest("[data-ui-orbiter-item]");
|
|
707
|
+
this._itemHovering = u instanceof HTMLElement ? this._items.includes(u) : !1, this._syncState();
|
|
715
708
|
};
|
|
716
|
-
t.addEventListener("pointerenter", e), t.addEventListener("pointerleave",
|
|
709
|
+
t.addEventListener("pointerenter", e), t.addEventListener("pointerleave", s), this._itemHoverHandlers.set(t, { enter: e, leave: s });
|
|
717
710
|
}
|
|
718
711
|
_unbindItemHover(t) {
|
|
719
712
|
const e = this._itemHoverHandlers.get(t);
|
|
@@ -733,15 +726,13 @@ class Q extends U {
|
|
|
733
726
|
case "xl":
|
|
734
727
|
case "4":
|
|
735
728
|
return _.xl;
|
|
736
|
-
case "md":
|
|
737
|
-
case "2":
|
|
738
729
|
default:
|
|
739
730
|
return _.md;
|
|
740
731
|
}
|
|
741
732
|
}
|
|
742
733
|
_motionPreset() {
|
|
743
734
|
const t = this.getAttribute("animation");
|
|
744
|
-
return t && j.has(t) ?
|
|
735
|
+
return t && j.has(t) ? N[t] : N.smooth;
|
|
745
736
|
}
|
|
746
737
|
_direction() {
|
|
747
738
|
const t = this.getAttribute("direction");
|
|
@@ -749,12 +740,12 @@ class Q extends U {
|
|
|
749
740
|
}
|
|
750
741
|
_directionSign(t) {
|
|
751
742
|
const e = this._direction();
|
|
752
|
-
let
|
|
753
|
-
return
|
|
743
|
+
let s = e === "counterclockwise" || e === "alternate" && t % 2 === 1 ? -1 : 1;
|
|
744
|
+
return q(this.getAttribute("reverse"), this.hasAttribute("reverse")) && (s *= -1), s;
|
|
754
745
|
}
|
|
755
746
|
_pathVisible() {
|
|
756
747
|
const t = this.getAttribute("path");
|
|
757
|
-
return t != null ?
|
|
748
|
+
return t != null ? q(t, !0) : (this.hasAttribute("show-paths"), !0);
|
|
758
749
|
}
|
|
759
750
|
_orbitRadiusValue() {
|
|
760
751
|
return this.getAttribute("radius") ?? this.getAttribute("orbit-radius");
|
|
@@ -763,17 +754,16 @@ class Q extends U {
|
|
|
763
754
|
return this.getAttribute("icon-size") ?? this.getAttribute("item-size");
|
|
764
755
|
}
|
|
765
756
|
_syncRuntimeStyles() {
|
|
766
|
-
const t = this._sizePreset(), e = this._motionPreset(),
|
|
767
|
-
this.style.setProperty("--ui-orbiter-duration", `calc((${
|
|
757
|
+
const t = this._sizePreset(), e = this._motionPreset(), s = F(this.getAttribute("duration"), O), b = F(this.getAttribute("delay"), V), a = h(this._orbitRadiusValue(), t.orbitRadius), u = h(this._iconSizeValue(), t.itemSize), o = h(this.getAttribute("center-size"), t.centerSize), l = h(this.getAttribute("ring-gap"), t.ringGap), d = h(this.getAttribute("padding"), t.padding), r = z(this.getAttribute("rings")), c = S(this.getAttribute("speed"), 1), f = r <= 1 ? a : `calc(${a} + ${r - 1} * ${l})`, y = `calc((2 * (${f})) + ${u})`;
|
|
758
|
+
this.style.setProperty("--ui-orbiter-duration", `calc((${s}) * ${e.durationScale} / ${c})`), this.style.setProperty("--ui-orbiter-delay", b), this.style.setProperty("--ui-orbiter-orbit-radius", a), this.style.setProperty("--ui-orbiter-item-size", u), this.style.setProperty("--ui-orbiter-center-size", o), this.style.setProperty("--ui-orbiter-ring-gap", l), this.style.setProperty("--ui-orbiter-padding", d), this.style.setProperty("--ui-orbiter-farthest-radius", f), this.style.setProperty("--ui-orbiter-stage-size", y), this.style.setProperty("--ui-orbiter-path-opacity", String(e.accentOpacity > 0.18 ? 1 : 0.95));
|
|
768
759
|
const p = this.getAttribute("surface-radius");
|
|
769
|
-
!p || B.has(p.trim()) ? this.style.removeProperty("--ui-orbiter-radius") : this.style.setProperty("--ui-orbiter-radius",
|
|
760
|
+
!p || B.has(p.trim()) ? this.style.removeProperty("--ui-orbiter-radius") : this.style.setProperty("--ui-orbiter-radius", h(p, t.panelRadius));
|
|
770
761
|
}
|
|
771
762
|
_syncAnimations() {
|
|
772
|
-
var h;
|
|
773
763
|
const t = this._items, e = new Set(t);
|
|
774
764
|
for (const [o, l] of this._animations.entries())
|
|
775
765
|
e.has(o) || (l.cancel(), this._animations.delete(o));
|
|
776
|
-
if (typeof window < "u" &&
|
|
766
|
+
if (typeof window < "u" && window.matchMedia?.("(prefers-reduced-motion: reduce)").matches) {
|
|
777
767
|
this._cancelAllAnimations(), t.forEach((o) => o.removeAttribute("data-ui-orbit-runtime"));
|
|
778
768
|
return;
|
|
779
769
|
}
|
|
@@ -781,27 +771,27 @@ class Q extends U {
|
|
|
781
771
|
t.forEach((o) => o.removeAttribute("data-ui-orbit-runtime"));
|
|
782
772
|
return;
|
|
783
773
|
}
|
|
784
|
-
const
|
|
774
|
+
const s = this._motionPreset(), b = M(this.getAttribute("duration"), 18e3), a = M(this.getAttribute("delay"), 0), u = S(this.getAttribute("speed"), 1);
|
|
785
775
|
for (const o of t) {
|
|
786
|
-
const l = o.style.getPropertyValue("--ui-orbit-radius") || "var(--ui-orbiter-orbit-radius)",
|
|
787
|
-
|
|
788
|
-
const
|
|
776
|
+
const l = o.style.getPropertyValue("--ui-orbit-radius") || "var(--ui-orbiter-orbit-radius)", d = g(o.style.getPropertyValue("--ui-orbit-start-angle"), C), r = g(o.style.getPropertyValue("--ui-orbit-quarter-angle"), d + 90), c = g(o.style.getPropertyValue("--ui-orbit-half-angle"), d + 180), f = g(o.style.getPropertyValue("--ui-orbit-three-quarter-angle"), d + 270), y = g(o.style.getPropertyValue("--ui-orbit-end-angle"), d + 360), p = S(o.style.getPropertyValue("--ui-orbit-duration-scale"), 1), T = b * s.durationScale * p / u;
|
|
777
|
+
this._animations.get(o)?.cancel(), o.setAttribute("data-ui-orbit-runtime", "");
|
|
778
|
+
const n = o.animate(
|
|
789
779
|
[
|
|
790
|
-
{ transform:
|
|
791
|
-
{ transform:
|
|
792
|
-
{ transform:
|
|
793
|
-
{ transform:
|
|
794
|
-
{ transform: y
|
|
780
|
+
{ transform: v(d, l), offset: 0 },
|
|
781
|
+
{ transform: v(r, l), offset: 0.25 },
|
|
782
|
+
{ transform: v(c, l), offset: 0.5 },
|
|
783
|
+
{ transform: v(f, l), offset: 0.75 },
|
|
784
|
+
{ transform: v(y, l), offset: 1 }
|
|
795
785
|
],
|
|
796
786
|
{
|
|
797
|
-
duration: Math.max(1,
|
|
798
|
-
delay: Math.max(0,
|
|
787
|
+
duration: Math.max(1, T),
|
|
788
|
+
delay: Math.max(0, a),
|
|
799
789
|
easing: "linear",
|
|
800
790
|
iterations: Number.POSITIVE_INFINITY,
|
|
801
791
|
fill: "both"
|
|
802
792
|
}
|
|
803
793
|
);
|
|
804
|
-
this._animations.set(o,
|
|
794
|
+
this._animations.set(o, n);
|
|
805
795
|
}
|
|
806
796
|
}
|
|
807
797
|
_cancelAnimation(t) {
|
|
@@ -809,8 +799,7 @@ class Q extends U {
|
|
|
809
799
|
t.removeAttribute("data-ui-orbit-runtime"), e && (e.cancel(), this._animations.delete(t));
|
|
810
800
|
}
|
|
811
801
|
_cancelAllAnimations() {
|
|
812
|
-
for (const t of this._animations.values())
|
|
813
|
-
t.cancel();
|
|
802
|
+
for (const t of this._animations.values()) t.cancel();
|
|
814
803
|
this._animations.clear(), this._items.forEach((t) => {
|
|
815
804
|
t.removeAttribute("data-ui-orbit-runtime"), this._unbindItemHover(t);
|
|
816
805
|
});
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as i, a as c } from "./scroll-lock-LfqXXqsu.mjs";
|
|
2
2
|
const r = {
|
|
3
3
|
// Keep manager-driven overlays above dialog/drawer defaults (1200/1201).
|
|
4
4
|
baseZ: 1300,
|
|
5
5
|
stack: [],
|
|
6
6
|
_lockCount: 0,
|
|
7
7
|
register(t) {
|
|
8
|
-
if (!t)
|
|
9
|
-
return;
|
|
8
|
+
if (!t) return;
|
|
10
9
|
const s = this.stack.indexOf(t);
|
|
11
10
|
s !== -1 && this.stack.splice(s, 1), this.stack.push(t), this.reassignZ();
|
|
12
11
|
},
|
|
@@ -28,10 +27,10 @@ const r = {
|
|
|
28
27
|
- lockScroll()/unlockScroll() remain for backwards compat and delegate to the lock-count methods
|
|
29
28
|
*/
|
|
30
29
|
acquireLock() {
|
|
31
|
-
this._lockCount = Math.max(0, (this._lockCount || 0) + 1),
|
|
30
|
+
this._lockCount = Math.max(0, (this._lockCount || 0) + 1), c();
|
|
32
31
|
},
|
|
33
32
|
releaseLock() {
|
|
34
|
-
this._lockCount = Math.max(0, (this._lockCount || 0) - 1),
|
|
33
|
+
this._lockCount = Math.max(0, (this._lockCount || 0) - 1), i();
|
|
35
34
|
},
|
|
36
35
|
lockCount() {
|
|
37
36
|
return this._lockCount || 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const c=require("./scroll-lock-
|
|
1
|
+
"use strict";const c=require("./scroll-lock-BX6e3Ced.js"),i={baseZ:1300,stack:[],_lockCount:0,register(t){if(!t)return;const s=this.stack.indexOf(t);s!==-1&&this.stack.splice(s,1),this.stack.push(t),this.reassignZ()},unregister(t){const s=this.stack.indexOf(t);s!==-1&&(this.stack.splice(s,1),this.reassignZ())},bringToFront(t){this.register(t)},top(){return this.stack.length?this.stack[this.stack.length-1]:null},acquireLock(){this._lockCount=Math.max(0,(this._lockCount||0)+1),c.acquireBodyScrollLock()},releaseLock(){this._lockCount=Math.max(0,(this._lockCount||0)-1),c.releaseBodyScrollLock()},lockCount(){return this._lockCount||0},lockScroll(){this.acquireLock()},unlockScroll(){this.releaseLock()},reassignZ(){for(let t=0;t<this.stack.length;t++){const s=this.stack[t];try{s.style.zIndex=String(this.baseZ+t+1)}catch{}}}};exports.OverlayManager=i;
|
package/dist/pagination.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("./ElementBase-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("./ElementBase-EV6mVBUV.js"),s=`
|
|
2
2
|
:host {
|
|
3
3
|
display: inline-flex;
|
|
4
4
|
max-width: 100%;
|
|
@@ -198,4 +198,4 @@
|
|
|
198
198
|
<nav class="pagination" role="navigation" aria-label="${this.getAttribute("aria-label")||"Pagination"}" tabindex="0">
|
|
199
199
|
${t}
|
|
200
200
|
</nav>
|
|
201
|
-
`);const i=this.root.querySelector(".pagination");i&&(i.removeEventListener("click",this._onClick),i.addEventListener("click",this._onClick),i.removeEventListener("keydown",this._onKeyDown),i.addEventListener("keydown",this._onKeyDown))}goToPage(t){const a=Math.max(1,Math.min(this._count,Number(t)||1));a!==this._page&&this._applyPageChange(a)}nextPage(){this.goToPage(this._page+1)}prevPage(){this.goToPage(this._page-1)}firstPage(){this.goToPage(1)}lastPage(){this.goToPage(this._count)}focusCurrent(){
|
|
201
|
+
`);const i=this.root.querySelector(".pagination");i&&(i.removeEventListener("click",this._onClick),i.addEventListener("click",this._onClick),i.removeEventListener("keydown",this._onKeyDown),i.addEventListener("keydown",this._onKeyDown))}goToPage(t){const a=Math.max(1,Math.min(this._count,Number(t)||1));a!==this._page&&this._applyPageChange(a)}nextPage(){this.goToPage(this._page+1)}prevPage(){this.goToPage(this._page-1)}firstPage(){this.goToPage(1)}lastPage(){this.goToPage(this._count)}focusCurrent(){this.root.querySelector('button[aria-current="page"]')?.focus()}_getPageRange(t,a){return a<=5?[1,a]:t<=3?[1,5]:t>=a-2?[a-4,a]:[t-2,t+2]}_onClick(t){const a=t.target.closest("button[data-page]");if(!a||a.hasAttribute("disabled"))return;const i=Number(a.getAttribute("data-page"));isNaN(i)||i<1||i>this._count||i===this._page||this._applyPageChange(i)}_onKeyDown(t){const a=this.root.querySelector(".pagination");if(!a)return;const i=Array.from(a.querySelectorAll("button:not(:disabled)")),n=this.root.activeElement;let o=i.indexOf(n);t.key==="ArrowRight"||t.key==="ArrowDown"?(o=(o+1)%i.length,i[o].focus(),t.preventDefault()):t.key==="ArrowLeft"||t.key==="ArrowUp"?(o=(o-1+i.length)%i.length,i[o].focus(),t.preventDefault()):t.key==="Home"?(i[0].focus(),t.preventDefault()):t.key==="End"&&(i[i.length-1].focus(),t.preventDefault())}_applyPageChange(t){const a=this._page,i=Math.max(1,Math.min(this._count,Number(t)||1));if(i===a)return;const n=i===1&&a!==1?"first":i===this._count&&a!==this._count?"last":i===a-1?"prev":i===a+1?"next":"change";this.setAttribute("page",String(i));const o={page:i,previousPage:a,count:this._count,reason:n};this.dispatchEvent(new CustomEvent(n,{detail:o,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("change",{detail:o,bubbles:!0,composed:!0}))}}typeof customElements<"u"&&!customElements.get("ui-pagination")&&customElements.define("ui-pagination",e);exports.UIPagination=e;
|