@editora/ui-core 0.1.19 → 0.1.21
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 -671
- 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 +30 -29
- package/dist/color-picker.cjs.js +10 -10
- package/dist/color-picker.esm.js +190 -253
- 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-collection.d.ts.map +1 -1
- package/dist/components/ui-multi-select.d.ts.map +1 -1
- package/dist/components/ui-orbiter.d.ts.map +1 -1
- package/dist/components/ui-portal.d.ts.map +1 -1
- package/dist/components/ui-positioner.d.ts.map +1 -1
- package/dist/components/ui-skeleton.d.ts.map +1 -1
- package/dist/components/ui-sortable.d.ts +8 -0
- package/dist/components/ui-sortable.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-tabs.d.ts.map +1 -1
- package/dist/components/ui-textarea.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 +9 -9
- package/dist/date-picker.esm.js +69 -97
- package/dist/date-range-picker.cjs.js +3 -3
- package/dist/date-range-picker.esm.js +32 -56
- package/dist/date-range-time-picker.cjs.js +9 -9
- package/dist/date-range-time-picker.esm.js +111 -140
- package/dist/date-time-picker.cjs.js +7 -7
- package/dist/date-time-picker.esm.js +115 -147
- 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 +5 -5
- package/dist/multi-select.esm.js +125 -137
- 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 +3 -3
- package/dist/portal.esm.js +20 -28
- 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 +22 -28
- package/dist/presence.cjs.js +1 -1
- package/dist/presence.esm.js +7 -13
- package/dist/primitives/auto-scroll.d.ts +9 -0
- package/dist/primitives/auto-scroll.d.ts.map +1 -0
- package/dist/primitives/selector.d.ts +4 -0
- package/dist/primitives/selector.d.ts.map +1 -0
- 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/selector-BvAh35ve.js +1 -0
- package/dist/selector-WI8pD7YO.mjs +18 -0
- 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 +79 -65
- package/dist/sortable.esm.js +714 -734
- 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 +8 -8
- package/dist/tabs.esm.js +89 -109
- package/dist/tags-input.cjs.js +4 -4
- package/dist/tags-input.esm.js +45 -62
- package/dist/textarea.cjs.js +10 -10
- package/dist/textarea.esm.js +49 -52
- package/dist/time-field.cjs.js +4 -4
- package/dist/time-field.esm.js +70 -84
- package/dist/time-picker.cjs.js +22 -22
- package/dist/time-picker.esm.js +88 -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 +31 -31
- package/dist/transfer-list.esm.js +114 -127
- 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 +2 -2
- 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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const _=require("./ElementBase-EV6mVBUV.js"),o="520ms",l="90ms",d="0ms",x=1400,h=.24,y=new Set(["none","sm","md","lg","full"]),v=new Set(["load","visible","manual"]),A=new Set(["calm","smooth","snappy","bouncy"]),S=`
|
|
2
2
|
:host {
|
|
3
3
|
--ui-animated-list-duration: ${o};
|
|
4
4
|
--ui-animated-list-stagger: ${l};
|
|
@@ -660,8 +660,8 @@
|
|
|
660
660
|
forced-color-adjust: none;
|
|
661
661
|
}
|
|
662
662
|
}
|
|
663
|
-
`;function
|
|
664
|
-
<style>${
|
|
663
|
+
`;function s(a,t){if(a==null||a==="")return t;const e=a.trim();return e?/^-?\d+(\.\d+)?ms$/i.test(e)?Math.max(0,Number.parseFloat(e)):/^-?\d+(\.\d+)?s$/i.test(e)?Math.max(0,Number.parseFloat(e)*1e3):/^-?\d+(\.\d+)?$/i.test(e)?Math.max(0,Number.parseFloat(e)):t:t}function m(a,t){if(a==null||a==="")return t;const e=a.trim();return e?/^-?\d+(\.\d+)?(ms|s)$/i.test(e)?e:/^-?\d+(\.\d+)?$/i.test(e)?`${e}ms`:t:t}function u(a){if(a==null||a==="")return null;const t=a.trim();if(!t)return null;const e=t.split(/\s+/).filter(Boolean);return e.length?e.map(i=>/^-?\d+(\.\d+)?$/.test(i)?`${i}px`:i).join(" "):null}function p(a){if(a==null||a==="")return h;const t=Number.parseFloat(a);return Number.isFinite(t)?Math.min(1,Math.max(0,t)):h}class g extends _.ElementBase{constructor(){super(...arguments),this._slotEl=null,this._items=[],this._phase="idle",this._playToken=0,this._hasTriggeredOnce=!1,this._inView=!1,this._completionTimer=null,this._completionStartedAt=0,this._completionRemaining=0,this._loopTimer=null,this._loopStartedAt=0,this._loopRemaining=0,this._rafA=0,this._rafB=0,this._intersectionObserver=null,this._mediaQuery=null,this._animations=[],this._boundSlotChange=this._handleSlotChange.bind(this),this._boundReducedMotionChange=this._handleReducedMotionChange.bind(this)}static get observedAttributes(){return["effect","trigger","duration","stagger","delay","animation","loop","loop-delay","paused","threshold","variant","tone","size","radius","elevation","padding","gap"]}connectedCallback(){super.connectedCallback(),this._bindReducedMotionWatcher()}disconnectedCallback(){this._clearTimers(),this._disconnectIntersectionObserver(),this._mediaQuery?.removeEventListener?.("change",this._boundReducedMotionChange),this._mediaQuery?.removeListener?.(this._boundReducedMotionChange),this._mediaQuery=null,super.disconnectedCallback()}attributeChangedCallback(t,e,i){if(!(e===i||!this.isConnected)){if(t==="paused"){this.hasAttribute("paused")?(this._pauseTimers(),this._pauseAnimations()):(this._resumeTimers(),this._resumeAnimations()),this._syncStateAttributes();return}if(this._syncRuntimeStyles(),t==="trigger"||t==="threshold"){this._syncTrigger(),this._autoStartIfNeeded();return}if(t==="duration"||t==="stagger"||t==="delay"||t==="loop"||t==="loop-delay"){this._phase==="running"&&!this.hasAttribute("paused")?this._scheduleCompletion(this._totalAnimationMs()):this._phase==="complete"&&this._hasLoop()&&!this.hasAttribute("paused")&&this._scheduleLoop(this._loopDelayMs());return}if(t==="effect"||t==="animation"){this._phase==="running"&&!this.hasAttribute("paused")&&this.replay();return}}}play(){if(this.hasAttribute("paused")&&this._phase==="running"){this.removeAttribute("paused");return}if(this.hasAttribute("paused")&&this.removeAttribute("paused"),this._hasTriggeredOnce=!0,this._clearTimers(),this._prefersReducedMotion()||this._items.length===0){this._setPhase("complete");return}const t=++this._playToken;this._setPhase("ready"),this._rafA=requestAnimationFrame(()=>{t!==this._playToken||!this.isConnected||(this._rafB=requestAnimationFrame(()=>{t!==this._playToken||!this.isConnected||(this._setPhase("running"),this._startAnimations(),this.hasAttribute("paused")||this._scheduleCompletion(this._totalAnimationMs()))}))})}pause(){this.hasAttribute("paused")||this.setAttribute("paused","")}replay(){this.play()}refresh(){this._syncItems(),this._syncRuntimeStyles(),this._syncTrigger(),this._phase==="complete"?this._setPhase("complete"):this._phase==="running"&&!this.hasAttribute("paused")&&this._scheduleCompletion(this._totalAnimationMs()),this._autoStartIfNeeded()}render(){this.setContent(`
|
|
664
|
+
<style>${S}</style>
|
|
665
665
|
<div class="root" part="root">
|
|
666
666
|
<div class="surface" part="surface">
|
|
667
667
|
<div class="list" part="list">
|
|
@@ -669,4 +669,4 @@
|
|
|
669
669
|
</div>
|
|
670
670
|
</div>
|
|
671
671
|
</div>
|
|
672
|
-
`),this._slotEl=this.root.querySelector("slot"),(t=this._slotEl)==null||t.addEventListener("slotchange",this._boundSlotChange),this._syncRuntimeStyles(),this._syncItems(),this._syncTrigger(),this._autoStartIfNeeded()}shouldRenderOnAttributeChange(){return!1}_handleSlotChange(){this._syncItems(),this._phase==="complete"&&this._setPhase("complete"),this._autoStartIfNeeded()}_handleReducedMotionChange(){if(this._prefersReducedMotion()){this._clearTimers(),this._setPhase("complete");return}this._autoStartIfNeeded()}_bindReducedMotionWatcher(){var t,e,i,a;typeof window>"u"||typeof window.matchMedia!="function"||this._mediaQuery||(this._mediaQuery=window.matchMedia("(prefers-reduced-motion: reduce)"),(e=(t=this._mediaQuery).addEventListener)==null||e.call(t,"change",this._boundReducedMotionChange),(a=(i=this._mediaQuery).addListener)==null||a.call(i,this._boundReducedMotionChange))}_prefersReducedMotion(){var t;return!!((t=this._mediaQuery)!=null&&t.matches)}_itemsFromSlot(){return this._slotEl?this._slotEl.assignedElements({flatten:!0}).filter(t=>t instanceof HTMLElement):[]}_syncItems(){const t=this._itemsFromSlot(),e=new Set(t);for(const i of this._items)e.has(i)||(i.style.removeProperty("--ui-animated-list-index"),i.removeAttribute("data-ui-animated-list-managed"),i.hasAttribute("data-ui-animated-list-owned")&&(i.removeAttribute("data-ui-animated-list-item"),i.removeAttribute("data-ui-animated-list-owned")));t.forEach((i,a)=>{i.setAttribute("data-ui-animated-list-managed",""),i.hasAttribute("data-ui-animated-list-item")||(i.setAttribute("data-ui-animated-list-item",""),i.setAttribute("data-ui-animated-list-owned","")),i.style.setProperty("--ui-animated-list-index",String(a))}),this._items=t,this._items.length||this._setPhase("complete")}_syncRuntimeStyles(){this.style.setProperty("--ui-animated-list-duration",m(this.getAttribute("duration"),o)),this.style.setProperty("--ui-animated-list-stagger",m(this.getAttribute("stagger"),l)),this.style.setProperty("--ui-animated-list-delay",m(this.getAttribute("delay"),d));const t=u(this.getAttribute("padding"));t?this.style.setProperty("--ui-animated-list-padding",t):this.style.removeProperty("--ui-animated-list-padding");const e=u(this.getAttribute("gap"));e?this.style.setProperty("--ui-animated-list-gap",e):this.style.removeProperty("--ui-animated-list-gap");const i=this.getAttribute("radius");if(!i||v.has(i.trim())){this.style.removeProperty("--ui-animated-list-radius"),this.style.removeProperty("--ui-animated-list-item-radius");return}const a=u(i);a?(this.style.setProperty("--ui-animated-list-radius",a),this.style.setProperty("--ui-animated-list-item-radius",a)):(this.style.removeProperty("--ui-animated-list-radius"),this.style.removeProperty("--ui-animated-list-item-radius"))}_trigger(){const t=this.getAttribute("trigger");return t&&A.has(t)?t:"load"}_hasLoop(){return this.hasAttribute("loop")}_animationPreset(){const t=this.getAttribute("animation");return t&&S.has(t)?t:"smooth"}_motionProfile(){switch(this._animationPreset()){case"calm":return{durationScale:1.12,distanceScale:.78,blurScale:.75,rotateScale:.82,overshootY:-1,overshootScale:1.01,easing:"cubic-bezier(0.22, 1, 0.36, 1)"};case"snappy":return{durationScale:.88,distanceScale:1.12,blurScale:.92,rotateScale:1.08,overshootY:-2.5,overshootScale:1.028,easing:"cubic-bezier(0.16, 1, 0.3, 1)"};case"bouncy":return{durationScale:1.08,distanceScale:1.18,blurScale:1,rotateScale:1.18,overshootY:-4,overshootScale:1.05,easing:"cubic-bezier(0.2, 1.18, 0.28, 1)"};case"smooth":default:return{durationScale:1,distanceScale:1,blurScale:1,rotateScale:1,overshootY:-2,overshootScale:1.02,easing:"cubic-bezier(0.2, 0.9, 0.24, 1)"}}}_loopDelayMs(){return n(this.getAttribute("loop-delay"),y)}_totalAnimationMs(){const t=Math.max(this._items.length,1),e=n(this.getAttribute("duration"),n(o,520))*this._motionProfile().durationScale,i=n(this.getAttribute("stagger"),n(l,90)),a=n(this.getAttribute("delay"),n(d,0));return Math.max(0,a+e+i*Math.max(0,t-1))}_scheduleCompletion(t){if(this._clearCompletionTimer(),this.hasAttribute("paused")){this._completionRemaining=t;return}if(this._completionRemaining=t,t<=0){queueMicrotask(()=>this._completeRun());return}this._completionStartedAt=Date.now();const e=this._playToken;this._completionTimer=setTimeout(()=>{e===this._playToken&&(this._completionTimer=null,this._completionRemaining=0,this._completeRun())},t)}_scheduleLoop(t){if(this._clearLoopTimer(),!this._hasLoop()||this.hasAttribute("paused")){this._loopRemaining=t;return}if(this._loopRemaining=t,t<=0){queueMicrotask(()=>this.replay());return}this._loopStartedAt=Date.now();const e=this._playToken;this._loopTimer=setTimeout(()=>{e===this._playToken&&(this._loopTimer=null,this._loopRemaining=0,this.replay())},t)}_completeRun(){this._setPhase("complete"),this._hasLoop()&&!this._prefersReducedMotion()&&this._scheduleLoop(this._loopDelayMs())}_pauseTimers(){if(this._completionTimer){const t=Date.now()-this._completionStartedAt;this._completionRemaining=Math.max(0,this._completionRemaining-t),this._clearCompletionTimer()}if(this._loopTimer){const t=Date.now()-this._loopStartedAt;this._loopRemaining=Math.max(0,this._loopRemaining-t),this._clearLoopTimer()}}_resumeTimers(){if(this._phase==="running"){this._completionRemaining>0?this._scheduleCompletion(this._completionRemaining):this._scheduleCompletion(this._totalAnimationMs());return}this._phase==="complete"&&this._hasLoop()&&(this._loopRemaining>0?this._scheduleLoop(this._loopRemaining):this._scheduleLoop(this._loopDelayMs()))}_clearTimers(){this._playToken+=1,this._clearAnimations(),this._clearCompletionTimer(),this._clearLoopTimer(),this._rafA&&cancelAnimationFrame(this._rafA),this._rafB&&cancelAnimationFrame(this._rafB),this._rafA=0,this._rafB=0,this._completionRemaining=0,this._loopRemaining=0}_clearCompletionTimer(){this._completionTimer&&(clearTimeout(this._completionTimer),this._completionTimer=null)}_clearLoopTimer(){this._loopTimer&&(clearTimeout(this._loopTimer),this._loopTimer=null)}_setPhase(t){this._phase=t,this.setAttribute("data-phase",t),this._syncStateAttributes()}_syncStateAttributes(){const t=this.hasAttribute("paused")&&(this._phase==="running"||this._loopRemaining>0);this.setAttribute("data-state",t?"paused":this._phase)}_syncTrigger(){if(this._trigger()!=="visible"){this._disconnectIntersectionObserver(),this._inView=!0;return}if(typeof IntersectionObserver>"u"){this._inView=!0;return}this._disconnectIntersectionObserver(),this._intersectionObserver=new IntersectionObserver(t=>{const e=t[0];e&&(this._inView=e.isIntersecting&&e.intersectionRatio>=g(this.getAttribute("threshold")),this._inView&&this._autoStartIfNeeded())},{threshold:[0,g(this.getAttribute("threshold")),1]}),this._intersectionObserver.observe(this)}_disconnectIntersectionObserver(){var t;(t=this._intersectionObserver)==null||t.disconnect(),this._intersectionObserver=null}_autoStartIfNeeded(){if(!(!this.isConnected||this.hasAttribute("paused"))){if(this._prefersReducedMotion()){this._setPhase("complete");return}if(this._trigger()==="manual"){this._phase==="idle"&&this._setPhase("ready");return}if(this._trigger()==="visible"&&!this._inView){this._phase==="idle"&&this._setPhase("ready");return}this._hasTriggeredOnce||this.play()}}_pauseAnimations(){for(const t of this._animations)try{t.pause()}catch{}}_resumeAnimations(){for(const t of this._animations)try{t.play()}catch{}}_clearAnimations(){for(const t of this._animations)try{t.cancel()}catch{}this._animations=[]}_effectKeyframes(){const t=this.getAttribute("effect"),e=this._motionProfile(),i=e.distanceScale,a=12*e.blurScale,r=e.rotateScale;switch(t){case"fade-down":return[{opacity:0,transform:`translate3d(0, ${-18*i}px, 0)`,filter:"none"},{opacity:1,transform:"translate3d(0, 0, 0)",filter:"none"}];case"slide-left":return[{opacity:0,transform:`translate3d(${28*i}px, 0, 0)`,filter:"none"},{opacity:1,transform:"translate3d(0, 0, 0)",filter:"none"}];case"slide-right":return[{opacity:0,transform:`translate3d(${-28*i}px, 0, 0)`,filter:"none"},{opacity:1,transform:"translate3d(0, 0, 0)",filter:"none"}];case"scale-in":return[{opacity:0,transform:`translate3d(0, ${10*i}px, 0) scale(${1-.06*i})`,filter:"none"},{opacity:1,transform:"translate3d(0, 0, 0) scale(1)",filter:"none"}];case"blur-in":return[{opacity:0,transform:`translate3d(0, ${14*i}px, 0) scale(${1-.02*i})`,filter:`blur(${a}px)`},{opacity:1,transform:"translate3d(0, 0, 0) scale(1)",filter:"blur(0)"}];case"pop":return[{opacity:0,transform:`translate3d(0, ${8*i}px, 0) scale(${1-.12*i})`,filter:"none",offset:0},{opacity:1,transform:`translate3d(0, ${e.overshootY}px, 0) scale(${e.overshootScale})`,filter:"none",offset:.6},{opacity:1,transform:"translate3d(0, 0, 0) scale(1)",filter:"none",offset:1}];case"flip-in":return[{opacity:0,transform:`perspective(900px) rotateX(${-18*r}deg) translate3d(0, ${14*i}px, 0)`,filter:"none"},{opacity:1,transform:"perspective(900px) rotateX(0deg) translate3d(0, 0, 0)",filter:"none"}];case"rotate-in":return[{opacity:0,transform:`translate3d(0, ${12*i}px, 0) rotate(${-10*r}deg) scale(${1-.03*i})`,filter:"none"},{opacity:1,transform:"translate3d(0, 0, 0) rotate(0deg) scale(1)",filter:"none"}];case"tilt-in":return[{opacity:0,transform:`perspective(900px) rotateY(${-14*r}deg) translate3d(0, ${12*i}px, 0)`,filter:"none"},{opacity:1,transform:"perspective(900px) rotateY(0deg) translate3d(0, 0, 0)",filter:"none"}];case"float-up":return[{opacity:0,transform:`translate3d(0, ${26*i}px, 0) scale(${1-.015*i})`,filter:"none",offset:0},{opacity:1,transform:`translate3d(0, ${Math.min(e.overshootY,-1)}px, 0) scale(${Math.max(1.01,e.overshootScale-.005)})`,filter:"none",offset:.62},{opacity:1,transform:"translate3d(0, 0, 0) scale(1)",filter:"none",offset:1}];case"swing-in":return[{opacity:0,transform:`translate3d(${-16*i}px, 0, 0) rotate(${-7*r}deg)`,filter:"none",offset:0},{opacity:1,transform:"translate3d(1px, 0, 0) rotate(1deg)",filter:"none",offset:.7},{opacity:1,transform:"translate3d(0, 0, 0) rotate(0deg)",filter:"none",offset:1}];case"fade-up":default:return[{opacity:0,transform:`translate3d(0, ${18*i}px, 0)`,filter:"none"},{opacity:1,transform:"translate3d(0, 0, 0)",filter:"none"}]}}_startAnimations(){var c;if(this._clearAnimations(),typeof((c=this._items[0])==null?void 0:c.animate)!="function")return;const t=this._motionProfile(),e=n(this.getAttribute("duration"),n(o,520))*t.durationScale,i=n(this.getAttribute("stagger"),n(l,90)),a=n(this.getAttribute("delay"),n(d,0)),r=this._effectKeyframes();this._animations=this._items.map((f,_)=>{f.style.animation="none";const h=f.animate(r,{duration:e,delay:a+_*i,fill:"both",easing:t.easing});if(this.hasAttribute("paused"))try{h.pause()}catch{}return h})}}typeof customElements<"u"&&!customElements.get("ui-animated-list")&&customElements.define("ui-animated-list",b);exports.UIAnimatedList=b;
|
|
672
|
+
`),this._slotEl=this.root.querySelector("slot"),this._slotEl?.addEventListener("slotchange",this._boundSlotChange),this._syncRuntimeStyles(),this._syncItems(),this._syncTrigger(),this._autoStartIfNeeded()}shouldRenderOnAttributeChange(){return!1}_handleSlotChange(){this._syncItems(),this._phase==="complete"&&this._setPhase("complete"),this._autoStartIfNeeded()}_handleReducedMotionChange(){if(this._prefersReducedMotion()){this._clearTimers(),this._setPhase("complete");return}this._autoStartIfNeeded()}_bindReducedMotionWatcher(){typeof window>"u"||typeof window.matchMedia!="function"||this._mediaQuery||(this._mediaQuery=window.matchMedia("(prefers-reduced-motion: reduce)"),this._mediaQuery.addEventListener?.("change",this._boundReducedMotionChange),this._mediaQuery.addListener?.(this._boundReducedMotionChange))}_prefersReducedMotion(){return!!this._mediaQuery?.matches}_itemsFromSlot(){return this._slotEl?this._slotEl.assignedElements({flatten:!0}).filter(t=>t instanceof HTMLElement):[]}_syncItems(){const t=this._itemsFromSlot(),e=new Set(t);for(const i of this._items)e.has(i)||(i.style.removeProperty("--ui-animated-list-index"),i.removeAttribute("data-ui-animated-list-managed"),i.hasAttribute("data-ui-animated-list-owned")&&(i.removeAttribute("data-ui-animated-list-item"),i.removeAttribute("data-ui-animated-list-owned")));t.forEach((i,n)=>{i.setAttribute("data-ui-animated-list-managed",""),i.hasAttribute("data-ui-animated-list-item")||(i.setAttribute("data-ui-animated-list-item",""),i.setAttribute("data-ui-animated-list-owned","")),i.style.setProperty("--ui-animated-list-index",String(n))}),this._items=t,this._items.length||this._setPhase("complete")}_syncRuntimeStyles(){this.style.setProperty("--ui-animated-list-duration",m(this.getAttribute("duration"),o)),this.style.setProperty("--ui-animated-list-stagger",m(this.getAttribute("stagger"),l)),this.style.setProperty("--ui-animated-list-delay",m(this.getAttribute("delay"),d));const t=u(this.getAttribute("padding"));t?this.style.setProperty("--ui-animated-list-padding",t):this.style.removeProperty("--ui-animated-list-padding");const e=u(this.getAttribute("gap"));e?this.style.setProperty("--ui-animated-list-gap",e):this.style.removeProperty("--ui-animated-list-gap");const i=this.getAttribute("radius");if(!i||y.has(i.trim())){this.style.removeProperty("--ui-animated-list-radius"),this.style.removeProperty("--ui-animated-list-item-radius");return}const n=u(i);n?(this.style.setProperty("--ui-animated-list-radius",n),this.style.setProperty("--ui-animated-list-item-radius",n)):(this.style.removeProperty("--ui-animated-list-radius"),this.style.removeProperty("--ui-animated-list-item-radius"))}_trigger(){const t=this.getAttribute("trigger");return t&&v.has(t)?t:"load"}_hasLoop(){return this.hasAttribute("loop")}_animationPreset(){const t=this.getAttribute("animation");return t&&A.has(t)?t:"smooth"}_motionProfile(){switch(this._animationPreset()){case"calm":return{durationScale:1.12,distanceScale:.78,blurScale:.75,rotateScale:.82,overshootY:-1,overshootScale:1.01,easing:"cubic-bezier(0.22, 1, 0.36, 1)"};case"snappy":return{durationScale:.88,distanceScale:1.12,blurScale:.92,rotateScale:1.08,overshootY:-2.5,overshootScale:1.028,easing:"cubic-bezier(0.16, 1, 0.3, 1)"};case"bouncy":return{durationScale:1.08,distanceScale:1.18,blurScale:1,rotateScale:1.18,overshootY:-4,overshootScale:1.05,easing:"cubic-bezier(0.2, 1.18, 0.28, 1)"};default:return{durationScale:1,distanceScale:1,blurScale:1,rotateScale:1,overshootY:-2,overshootScale:1.02,easing:"cubic-bezier(0.2, 0.9, 0.24, 1)"}}}_loopDelayMs(){return s(this.getAttribute("loop-delay"),x)}_totalAnimationMs(){const t=Math.max(this._items.length,1),e=s(this.getAttribute("duration"),s(o,520))*this._motionProfile().durationScale,i=s(this.getAttribute("stagger"),s(l,90)),n=s(this.getAttribute("delay"),s(d,0));return Math.max(0,n+e+i*Math.max(0,t-1))}_scheduleCompletion(t){if(this._clearCompletionTimer(),this.hasAttribute("paused")){this._completionRemaining=t;return}if(this._completionRemaining=t,t<=0){queueMicrotask(()=>this._completeRun());return}this._completionStartedAt=Date.now();const e=this._playToken;this._completionTimer=setTimeout(()=>{e===this._playToken&&(this._completionTimer=null,this._completionRemaining=0,this._completeRun())},t)}_scheduleLoop(t){if(this._clearLoopTimer(),!this._hasLoop()||this.hasAttribute("paused")){this._loopRemaining=t;return}if(this._loopRemaining=t,t<=0){queueMicrotask(()=>this.replay());return}this._loopStartedAt=Date.now();const e=this._playToken;this._loopTimer=setTimeout(()=>{e===this._playToken&&(this._loopTimer=null,this._loopRemaining=0,this.replay())},t)}_completeRun(){this._setPhase("complete"),this._hasLoop()&&!this._prefersReducedMotion()&&this._scheduleLoop(this._loopDelayMs())}_pauseTimers(){if(this._completionTimer){const t=Date.now()-this._completionStartedAt;this._completionRemaining=Math.max(0,this._completionRemaining-t),this._clearCompletionTimer()}if(this._loopTimer){const t=Date.now()-this._loopStartedAt;this._loopRemaining=Math.max(0,this._loopRemaining-t),this._clearLoopTimer()}}_resumeTimers(){if(this._phase==="running"){this._completionRemaining>0?this._scheduleCompletion(this._completionRemaining):this._scheduleCompletion(this._totalAnimationMs());return}this._phase==="complete"&&this._hasLoop()&&(this._loopRemaining>0?this._scheduleLoop(this._loopRemaining):this._scheduleLoop(this._loopDelayMs()))}_clearTimers(){this._playToken+=1,this._clearAnimations(),this._clearCompletionTimer(),this._clearLoopTimer(),this._rafA&&cancelAnimationFrame(this._rafA),this._rafB&&cancelAnimationFrame(this._rafB),this._rafA=0,this._rafB=0,this._completionRemaining=0,this._loopRemaining=0}_clearCompletionTimer(){this._completionTimer&&(clearTimeout(this._completionTimer),this._completionTimer=null)}_clearLoopTimer(){this._loopTimer&&(clearTimeout(this._loopTimer),this._loopTimer=null)}_setPhase(t){this._phase=t,this.setAttribute("data-phase",t),this._syncStateAttributes()}_syncStateAttributes(){const t=this.hasAttribute("paused")&&(this._phase==="running"||this._loopRemaining>0);this.setAttribute("data-state",t?"paused":this._phase)}_syncTrigger(){if(this._trigger()!=="visible"){this._disconnectIntersectionObserver(),this._inView=!0;return}if(typeof IntersectionObserver>"u"){this._inView=!0;return}this._disconnectIntersectionObserver(),this._intersectionObserver=new IntersectionObserver(t=>{const e=t[0];e&&(this._inView=e.isIntersecting&&e.intersectionRatio>=p(this.getAttribute("threshold")),this._inView&&this._autoStartIfNeeded())},{threshold:[0,p(this.getAttribute("threshold")),1]}),this._intersectionObserver.observe(this)}_disconnectIntersectionObserver(){this._intersectionObserver?.disconnect(),this._intersectionObserver=null}_autoStartIfNeeded(){if(!(!this.isConnected||this.hasAttribute("paused"))){if(this._prefersReducedMotion()){this._setPhase("complete");return}if(this._trigger()==="manual"){this._phase==="idle"&&this._setPhase("ready");return}if(this._trigger()==="visible"&&!this._inView){this._phase==="idle"&&this._setPhase("ready");return}this._hasTriggeredOnce||this.play()}}_pauseAnimations(){for(const t of this._animations)try{t.pause()}catch{}}_resumeAnimations(){for(const t of this._animations)try{t.play()}catch{}}_clearAnimations(){for(const t of this._animations)try{t.cancel()}catch{}this._animations=[]}_effectKeyframes(){const t=this.getAttribute("effect"),e=this._motionProfile(),i=e.distanceScale,n=12*e.blurScale,r=e.rotateScale;switch(t){case"fade-down":return[{opacity:0,transform:`translate3d(0, ${-18*i}px, 0)`,filter:"none"},{opacity:1,transform:"translate3d(0, 0, 0)",filter:"none"}];case"slide-left":return[{opacity:0,transform:`translate3d(${28*i}px, 0, 0)`,filter:"none"},{opacity:1,transform:"translate3d(0, 0, 0)",filter:"none"}];case"slide-right":return[{opacity:0,transform:`translate3d(${-28*i}px, 0, 0)`,filter:"none"},{opacity:1,transform:"translate3d(0, 0, 0)",filter:"none"}];case"scale-in":return[{opacity:0,transform:`translate3d(0, ${10*i}px, 0) scale(${1-.06*i})`,filter:"none"},{opacity:1,transform:"translate3d(0, 0, 0) scale(1)",filter:"none"}];case"blur-in":return[{opacity:0,transform:`translate3d(0, ${14*i}px, 0) scale(${1-.02*i})`,filter:`blur(${n}px)`},{opacity:1,transform:"translate3d(0, 0, 0) scale(1)",filter:"blur(0)"}];case"pop":return[{opacity:0,transform:`translate3d(0, ${8*i}px, 0) scale(${1-.12*i})`,filter:"none",offset:0},{opacity:1,transform:`translate3d(0, ${e.overshootY}px, 0) scale(${e.overshootScale})`,filter:"none",offset:.6},{opacity:1,transform:"translate3d(0, 0, 0) scale(1)",filter:"none",offset:1}];case"flip-in":return[{opacity:0,transform:`perspective(900px) rotateX(${-18*r}deg) translate3d(0, ${14*i}px, 0)`,filter:"none"},{opacity:1,transform:"perspective(900px) rotateX(0deg) translate3d(0, 0, 0)",filter:"none"}];case"rotate-in":return[{opacity:0,transform:`translate3d(0, ${12*i}px, 0) rotate(${-10*r}deg) scale(${1-.03*i})`,filter:"none"},{opacity:1,transform:"translate3d(0, 0, 0) rotate(0deg) scale(1)",filter:"none"}];case"tilt-in":return[{opacity:0,transform:`perspective(900px) rotateY(${-14*r}deg) translate3d(0, ${12*i}px, 0)`,filter:"none"},{opacity:1,transform:"perspective(900px) rotateY(0deg) translate3d(0, 0, 0)",filter:"none"}];case"float-up":return[{opacity:0,transform:`translate3d(0, ${26*i}px, 0) scale(${1-.015*i})`,filter:"none",offset:0},{opacity:1,transform:`translate3d(0, ${Math.min(e.overshootY,-1)}px, 0) scale(${Math.max(1.01,e.overshootScale-.005)})`,filter:"none",offset:.62},{opacity:1,transform:"translate3d(0, 0, 0) scale(1)",filter:"none",offset:1}];case"swing-in":return[{opacity:0,transform:`translate3d(${-16*i}px, 0, 0) rotate(${-7*r}deg)`,filter:"none",offset:0},{opacity:1,transform:"translate3d(1px, 0, 0) rotate(1deg)",filter:"none",offset:.7},{opacity:1,transform:"translate3d(0, 0, 0) rotate(0deg)",filter:"none",offset:1}];default:return[{opacity:0,transform:`translate3d(0, ${18*i}px, 0)`,filter:"none"},{opacity:1,transform:"translate3d(0, 0, 0)",filter:"none"}]}}_startAnimations(){if(this._clearAnimations(),typeof this._items[0]?.animate!="function")return;const t=this._motionProfile(),e=s(this.getAttribute("duration"),s(o,520))*t.durationScale,i=s(this.getAttribute("stagger"),s(l,90)),n=s(this.getAttribute("delay"),s(d,0)),r=this._effectKeyframes();this._animations=this._items.map((c,b)=>{c.style.animation="none";const f=c.animate(r,{duration:e,delay:n+b*i,fill:"both",easing:t.easing});if(this.hasAttribute("paused"))try{f.pause()}catch{}return f})}}typeof customElements<"u"&&!customElements.get("ui-animated-list")&&customElements.define("ui-animated-list",g);exports.UIAnimatedList=g;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as
|
|
2
|
-
const o = "520ms", l = "90ms", d = "0ms",
|
|
1
|
+
import { E as b } from "./ElementBase-YlTLMsGk.mjs";
|
|
2
|
+
const o = "520ms", l = "90ms", d = "0ms", _ = 1400, h = 0.24, x = /* @__PURE__ */ new Set(["none", "sm", "md", "lg", "full"]), y = /* @__PURE__ */ new Set(["load", "visible", "manual"]), v = /* @__PURE__ */ new Set(["calm", "smooth", "snappy", "bouncy"]), A = `
|
|
3
3
|
:host {
|
|
4
4
|
--ui-animated-list-duration: ${o};
|
|
5
5
|
--ui-animated-list-stagger: ${l};
|
|
@@ -662,34 +662,29 @@ const o = "520ms", l = "90ms", d = "0ms", x = 1400, p = 0.24, y = /* @__PURE__ *
|
|
|
662
662
|
}
|
|
663
663
|
}
|
|
664
664
|
`;
|
|
665
|
-
function
|
|
666
|
-
if (
|
|
667
|
-
|
|
668
|
-
const e = s.trim();
|
|
665
|
+
function s(a, t) {
|
|
666
|
+
if (a == null || a === "") return t;
|
|
667
|
+
const e = a.trim();
|
|
669
668
|
return e ? /^-?\d+(\.\d+)?ms$/i.test(e) ? Math.max(0, Number.parseFloat(e)) : /^-?\d+(\.\d+)?s$/i.test(e) ? Math.max(0, Number.parseFloat(e) * 1e3) : /^-?\d+(\.\d+)?$/i.test(e) ? Math.max(0, Number.parseFloat(e)) : t : t;
|
|
670
669
|
}
|
|
671
|
-
function m(
|
|
672
|
-
if (
|
|
673
|
-
|
|
674
|
-
const e = s.trim();
|
|
670
|
+
function m(a, t) {
|
|
671
|
+
if (a == null || a === "") return t;
|
|
672
|
+
const e = a.trim();
|
|
675
673
|
return e ? /^-?\d+(\.\d+)?(ms|s)$/i.test(e) ? e : /^-?\d+(\.\d+)?$/i.test(e) ? `${e}ms` : t : t;
|
|
676
674
|
}
|
|
677
|
-
function u(
|
|
678
|
-
if (
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
if (!t)
|
|
682
|
-
return null;
|
|
675
|
+
function u(a) {
|
|
676
|
+
if (a == null || a === "") return null;
|
|
677
|
+
const t = a.trim();
|
|
678
|
+
if (!t) return null;
|
|
683
679
|
const e = t.split(/\s+/).filter(Boolean);
|
|
684
680
|
return e.length ? e.map((i) => /^-?\d+(\.\d+)?$/.test(i) ? `${i}px` : i).join(" ") : null;
|
|
685
681
|
}
|
|
686
|
-
function
|
|
687
|
-
if (
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
return Number.isFinite(t) ? Math.min(1, Math.max(0, t)) : p;
|
|
682
|
+
function p(a) {
|
|
683
|
+
if (a == null || a === "") return h;
|
|
684
|
+
const t = Number.parseFloat(a);
|
|
685
|
+
return Number.isFinite(t) ? Math.min(1, Math.max(0, t)) : h;
|
|
691
686
|
}
|
|
692
|
-
class
|
|
687
|
+
class S extends b {
|
|
693
688
|
constructor() {
|
|
694
689
|
super(...arguments), this._slotEl = null, this._items = [], this._phase = "idle", this._playToken = 0, this._hasTriggeredOnce = !1, this._inView = !1, this._completionTimer = null, this._completionStartedAt = 0, this._completionRemaining = 0, this._loopTimer = null, this._loopStartedAt = 0, this._loopRemaining = 0, this._rafA = 0, this._rafB = 0, this._intersectionObserver = null, this._mediaQuery = null, this._animations = [], this._boundSlotChange = this._handleSlotChange.bind(this), this._boundReducedMotionChange = this._handleReducedMotionChange.bind(this);
|
|
695
690
|
}
|
|
@@ -718,8 +713,7 @@ class T extends _ {
|
|
|
718
713
|
super.connectedCallback(), this._bindReducedMotionWatcher();
|
|
719
714
|
}
|
|
720
715
|
disconnectedCallback() {
|
|
721
|
-
|
|
722
|
-
this._clearTimers(), this._disconnectIntersectionObserver(), (e = (t = this._mediaQuery) == null ? void 0 : t.removeEventListener) == null || e.call(t, "change", this._boundReducedMotionChange), (a = (i = this._mediaQuery) == null ? void 0 : i.removeListener) == null || a.call(i, this._boundReducedMotionChange), this._mediaQuery = null, super.disconnectedCallback();
|
|
716
|
+
this._clearTimers(), this._disconnectIntersectionObserver(), this._mediaQuery?.removeEventListener?.("change", this._boundReducedMotionChange), this._mediaQuery?.removeListener?.(this._boundReducedMotionChange), this._mediaQuery = null, super.disconnectedCallback();
|
|
723
717
|
}
|
|
724
718
|
attributeChangedCallback(t, e, i) {
|
|
725
719
|
if (!(e === i || !this.isConnected)) {
|
|
@@ -767,9 +761,8 @@ class T extends _ {
|
|
|
767
761
|
this._syncItems(), this._syncRuntimeStyles(), this._syncTrigger(), this._phase === "complete" ? this._setPhase("complete") : this._phase === "running" && !this.hasAttribute("paused") && this._scheduleCompletion(this._totalAnimationMs()), this._autoStartIfNeeded();
|
|
768
762
|
}
|
|
769
763
|
render() {
|
|
770
|
-
var t;
|
|
771
764
|
this.setContent(`
|
|
772
|
-
<style>${
|
|
765
|
+
<style>${A}</style>
|
|
773
766
|
<div class="root" part="root">
|
|
774
767
|
<div class="surface" part="surface">
|
|
775
768
|
<div class="list" part="list">
|
|
@@ -777,7 +770,7 @@ class T extends _ {
|
|
|
777
770
|
</div>
|
|
778
771
|
</div>
|
|
779
772
|
</div>
|
|
780
|
-
`), this._slotEl = this.root.querySelector("slot"),
|
|
773
|
+
`), this._slotEl = this.root.querySelector("slot"), this._slotEl?.addEventListener("slotchange", this._boundSlotChange), this._syncRuntimeStyles(), this._syncItems(), this._syncTrigger(), this._autoStartIfNeeded();
|
|
781
774
|
}
|
|
782
775
|
shouldRenderOnAttributeChange() {
|
|
783
776
|
return !1;
|
|
@@ -793,12 +786,10 @@ class T extends _ {
|
|
|
793
786
|
this._autoStartIfNeeded();
|
|
794
787
|
}
|
|
795
788
|
_bindReducedMotionWatcher() {
|
|
796
|
-
|
|
797
|
-
typeof window > "u" || typeof window.matchMedia != "function" || this._mediaQuery || (this._mediaQuery = window.matchMedia("(prefers-reduced-motion: reduce)"), (e = (t = this._mediaQuery).addEventListener) == null || e.call(t, "change", this._boundReducedMotionChange), (a = (i = this._mediaQuery).addListener) == null || a.call(i, this._boundReducedMotionChange));
|
|
789
|
+
typeof window > "u" || typeof window.matchMedia != "function" || this._mediaQuery || (this._mediaQuery = window.matchMedia("(prefers-reduced-motion: reduce)"), this._mediaQuery.addEventListener?.("change", this._boundReducedMotionChange), this._mediaQuery.addListener?.(this._boundReducedMotionChange));
|
|
798
790
|
}
|
|
799
791
|
_prefersReducedMotion() {
|
|
800
|
-
|
|
801
|
-
return !!((t = this._mediaQuery) != null && t.matches);
|
|
792
|
+
return !!this._mediaQuery?.matches;
|
|
802
793
|
}
|
|
803
794
|
_itemsFromSlot() {
|
|
804
795
|
return this._slotEl ? this._slotEl.assignedElements({ flatten: !0 }).filter((t) => t instanceof HTMLElement) : [];
|
|
@@ -807,8 +798,8 @@ class T extends _ {
|
|
|
807
798
|
const t = this._itemsFromSlot(), e = new Set(t);
|
|
808
799
|
for (const i of this._items)
|
|
809
800
|
e.has(i) || (i.style.removeProperty("--ui-animated-list-index"), i.removeAttribute("data-ui-animated-list-managed"), i.hasAttribute("data-ui-animated-list-owned") && (i.removeAttribute("data-ui-animated-list-item"), i.removeAttribute("data-ui-animated-list-owned")));
|
|
810
|
-
t.forEach((i,
|
|
811
|
-
i.setAttribute("data-ui-animated-list-managed", ""), i.hasAttribute("data-ui-animated-list-item") || (i.setAttribute("data-ui-animated-list-item", ""), i.setAttribute("data-ui-animated-list-owned", "")), i.style.setProperty("--ui-animated-list-index", String(
|
|
801
|
+
t.forEach((i, n) => {
|
|
802
|
+
i.setAttribute("data-ui-animated-list-managed", ""), i.hasAttribute("data-ui-animated-list-item") || (i.setAttribute("data-ui-animated-list-item", ""), i.setAttribute("data-ui-animated-list-owned", "")), i.style.setProperty("--ui-animated-list-index", String(n));
|
|
812
803
|
}), this._items = t, this._items.length || this._setPhase("complete");
|
|
813
804
|
}
|
|
814
805
|
_syncRuntimeStyles() {
|
|
@@ -818,23 +809,23 @@ class T extends _ {
|
|
|
818
809
|
const e = u(this.getAttribute("gap"));
|
|
819
810
|
e ? this.style.setProperty("--ui-animated-list-gap", e) : this.style.removeProperty("--ui-animated-list-gap");
|
|
820
811
|
const i = this.getAttribute("radius");
|
|
821
|
-
if (!i ||
|
|
812
|
+
if (!i || x.has(i.trim())) {
|
|
822
813
|
this.style.removeProperty("--ui-animated-list-radius"), this.style.removeProperty("--ui-animated-list-item-radius");
|
|
823
814
|
return;
|
|
824
815
|
}
|
|
825
|
-
const
|
|
826
|
-
|
|
816
|
+
const n = u(i);
|
|
817
|
+
n ? (this.style.setProperty("--ui-animated-list-radius", n), this.style.setProperty("--ui-animated-list-item-radius", n)) : (this.style.removeProperty("--ui-animated-list-radius"), this.style.removeProperty("--ui-animated-list-item-radius"));
|
|
827
818
|
}
|
|
828
819
|
_trigger() {
|
|
829
820
|
const t = this.getAttribute("trigger");
|
|
830
|
-
return t &&
|
|
821
|
+
return t && y.has(t) ? t : "load";
|
|
831
822
|
}
|
|
832
823
|
_hasLoop() {
|
|
833
824
|
return this.hasAttribute("loop");
|
|
834
825
|
}
|
|
835
826
|
_animationPreset() {
|
|
836
827
|
const t = this.getAttribute("animation");
|
|
837
|
-
return t &&
|
|
828
|
+
return t && v.has(t) ? t : "smooth";
|
|
838
829
|
}
|
|
839
830
|
_motionProfile() {
|
|
840
831
|
switch (this._animationPreset()) {
|
|
@@ -868,7 +859,6 @@ class T extends _ {
|
|
|
868
859
|
overshootScale: 1.05,
|
|
869
860
|
easing: "cubic-bezier(0.2, 1.18, 0.28, 1)"
|
|
870
861
|
};
|
|
871
|
-
case "smooth":
|
|
872
862
|
default:
|
|
873
863
|
return {
|
|
874
864
|
durationScale: 1,
|
|
@@ -882,11 +872,11 @@ class T extends _ {
|
|
|
882
872
|
}
|
|
883
873
|
}
|
|
884
874
|
_loopDelayMs() {
|
|
885
|
-
return
|
|
875
|
+
return s(this.getAttribute("loop-delay"), _);
|
|
886
876
|
}
|
|
887
877
|
_totalAnimationMs() {
|
|
888
|
-
const t = Math.max(this._items.length, 1), e =
|
|
889
|
-
return Math.max(0,
|
|
878
|
+
const t = Math.max(this._items.length, 1), e = s(this.getAttribute("duration"), s(o, 520)) * this._motionProfile().durationScale, i = s(this.getAttribute("stagger"), s(l, 90)), n = s(this.getAttribute("delay"), s(d, 0));
|
|
879
|
+
return Math.max(0, n + e + i * Math.max(0, t - 1));
|
|
890
880
|
}
|
|
891
881
|
_scheduleCompletion(t) {
|
|
892
882
|
if (this._clearCompletionTimer(), this.hasAttribute("paused")) {
|
|
@@ -966,14 +956,13 @@ class T extends _ {
|
|
|
966
956
|
this._disconnectIntersectionObserver(), this._intersectionObserver = new IntersectionObserver(
|
|
967
957
|
(t) => {
|
|
968
958
|
const e = t[0];
|
|
969
|
-
e && (this._inView = e.isIntersecting && e.intersectionRatio >=
|
|
959
|
+
e && (this._inView = e.isIntersecting && e.intersectionRatio >= p(this.getAttribute("threshold")), this._inView && this._autoStartIfNeeded());
|
|
970
960
|
},
|
|
971
|
-
{ threshold: [0,
|
|
961
|
+
{ threshold: [0, p(this.getAttribute("threshold")), 1] }
|
|
972
962
|
), this._intersectionObserver.observe(this);
|
|
973
963
|
}
|
|
974
964
|
_disconnectIntersectionObserver() {
|
|
975
|
-
|
|
976
|
-
(t = this._intersectionObserver) == null || t.disconnect(), this._intersectionObserver = null;
|
|
965
|
+
this._intersectionObserver?.disconnect(), this._intersectionObserver = null;
|
|
977
966
|
}
|
|
978
967
|
_autoStartIfNeeded() {
|
|
979
968
|
if (!(!this.isConnected || this.hasAttribute("paused"))) {
|
|
@@ -1015,7 +1004,7 @@ class T extends _ {
|
|
|
1015
1004
|
this._animations = [];
|
|
1016
1005
|
}
|
|
1017
1006
|
_effectKeyframes() {
|
|
1018
|
-
const t = this.getAttribute("effect"), e = this._motionProfile(), i = e.distanceScale,
|
|
1007
|
+
const t = this.getAttribute("effect"), e = this._motionProfile(), i = e.distanceScale, n = 12 * e.blurScale, r = e.rotateScale;
|
|
1019
1008
|
switch (t) {
|
|
1020
1009
|
case "fade-down":
|
|
1021
1010
|
return [
|
|
@@ -1042,7 +1031,7 @@ class T extends _ {
|
|
|
1042
1031
|
{
|
|
1043
1032
|
opacity: 0,
|
|
1044
1033
|
transform: `translate3d(0, ${14 * i}px, 0) scale(${1 - 0.02 * i})`,
|
|
1045
|
-
filter: `blur(${
|
|
1034
|
+
filter: `blur(${n}px)`
|
|
1046
1035
|
},
|
|
1047
1036
|
{ opacity: 1, transform: "translate3d(0, 0, 0) scale(1)", filter: "blur(0)" }
|
|
1048
1037
|
];
|
|
@@ -1101,7 +1090,6 @@ class T extends _ {
|
|
|
1101
1090
|
{ opacity: 1, transform: "translate3d(1px, 0, 0) rotate(1deg)", filter: "none", offset: 0.7 },
|
|
1102
1091
|
{ opacity: 1, transform: "translate3d(0, 0, 0) rotate(0deg)", filter: "none", offset: 1 }
|
|
1103
1092
|
];
|
|
1104
|
-
case "fade-up":
|
|
1105
1093
|
default:
|
|
1106
1094
|
return [
|
|
1107
1095
|
{ opacity: 0, transform: `translate3d(0, ${18 * i}px, 0)`, filter: "none" },
|
|
@@ -1110,28 +1098,26 @@ class T extends _ {
|
|
|
1110
1098
|
}
|
|
1111
1099
|
}
|
|
1112
1100
|
_startAnimations() {
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
f.style.animation = "none";
|
|
1119
|
-
const h = f.animate(r, {
|
|
1101
|
+
if (this._clearAnimations(), typeof this._items[0]?.animate != "function") return;
|
|
1102
|
+
const t = this._motionProfile(), e = s(this.getAttribute("duration"), s(o, 520)) * t.durationScale, i = s(this.getAttribute("stagger"), s(l, 90)), n = s(this.getAttribute("delay"), s(d, 0)), r = this._effectKeyframes();
|
|
1103
|
+
this._animations = this._items.map((c, g) => {
|
|
1104
|
+
c.style.animation = "none";
|
|
1105
|
+
const f = c.animate(r, {
|
|
1120
1106
|
duration: e,
|
|
1121
|
-
delay:
|
|
1107
|
+
delay: n + g * i,
|
|
1122
1108
|
fill: "both",
|
|
1123
1109
|
easing: t.easing
|
|
1124
1110
|
});
|
|
1125
1111
|
if (this.hasAttribute("paused"))
|
|
1126
1112
|
try {
|
|
1127
|
-
|
|
1113
|
+
f.pause();
|
|
1128
1114
|
} catch {
|
|
1129
1115
|
}
|
|
1130
|
-
return
|
|
1116
|
+
return f;
|
|
1131
1117
|
});
|
|
1132
1118
|
}
|
|
1133
1119
|
}
|
|
1134
|
-
typeof customElements < "u" && !customElements.get("ui-animated-list") && customElements.define("ui-animated-list",
|
|
1120
|
+
typeof customElements < "u" && !customElements.get("ui-animated-list") && customElements.define("ui-animated-list", S);
|
|
1135
1121
|
export {
|
|
1136
|
-
|
|
1122
|
+
S as UIAnimatedList
|
|
1137
1123
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const k=require("./ElementBase-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const k=require("./ElementBase-EV6mVBUV.js"),T="720ms",A="55ms",M="0ms",x=1400,S=new Set(["fade-up","fade-down","slide-left","slide-right","blur","blur-up","pop","wave","zoom-in","rotate-in","flip-up","skew-in","glow","typewriter"]),z=new Set(["chars","words","lines"]),C=new Set(["load","visible","manual"]),R=new Set(["none","sm","md","lg","full"]),L=`
|
|
2
2
|
:host {
|
|
3
3
|
--ui-animated-text-duration: ${T};
|
|
4
4
|
--ui-animated-text-stagger: ${A};
|
|
@@ -651,7 +651,7 @@
|
|
|
651
651
|
background: CanvasText;
|
|
652
652
|
}
|
|
653
653
|
}
|
|
654
|
-
`;function p(a){return a.split("&").join("&").split("<").join("<").split(">").join(">").split('"').join(""").split("'").join("'")}function I(a){return/^\s+$/.test(a)}function h(a){if(!a)return null;const t=a.trim();return t?/^-?\d+(\.\d+)?$/.test(t)?`${t}ms`:/^-?\d+(\.\d+)?m?s$/.test(t)?t:null:null}function g(a){if(!a)return null;const t=a.trim();if(!t)return null;const e=t.split(/\s+/).filter(Boolean);return e.length?e.map(i=>/^-?\d+(\.\d+)?$/.test(i)?`${i}px`:i).join(" "):null}function f(a,t){const e=h(a);if(!e)return t;if(e.endsWith("ms")){const i=Number.parseFloat(e.slice(0,-2));return Number.isFinite(i)&&i>=0?i:t}if(e.endsWith("s")){const i=Number.parseFloat(e.slice(0,-1));return Number.isFinite(i)&&i>=0?i*1e3:t}return t}function P(a){const t=globalThis.Intl.Segmenter;if(typeof t=="function"){const e=new t(void 0,{granularity:"grapheme"});return Array.from(e.segment(a),i=>i.segment)}return Array.from(a)}function E(a){const t=globalThis.Intl.Segmenter;if(typeof t=="function"){const e=new t(void 0,{granularity:"word"});return Array.from(e.segment(a),i=>i.segment).filter(Boolean)}return a.split(/(\s+)/).filter(Boolean)}function b(a,t){return a?t==="lines"?a.split(/\r\n|\r|\n/).map(i=>({text:i||" ",animated:!!i.trim(),line:!0})):(t==="chars"?P(a):E(a)).map(i=>({text:i,animated:!I(i),line:!1})):[]}function $(a,t){const e=(t||"").trim();if(e)return{mode:"custom",value:e};const i=(a||"").trim();return i?S.has(i)?{mode:"builtin",value:i}:{mode:"custom",value:i}:{mode:"builtin",value:"fade-up"}}function O(a,t){if(t==="typewriter")return"chars";const e=(a||"").trim();return z.has(e)?e:"words"}function Q(a){const t=(a||"").trim();return C.has(t)?t:"load"}class v extends k.ElementBase{constructor(){super(),this._sourceObserver=null,this._intersectionObserver=null,this._mediaQuery=null,this._loopTimer=null,this._visible=!1,this._hasStarted=!1,this._runId=0,this._handleSourceMutation=this._handleSourceMutation.bind(this),this._handleIntersection=this._handleIntersection.bind(this),this._handleReducedMotionChange=this._handleReducedMotionChange.bind(this)}static get observedAttributes(){return["text","effect","split","trigger","duration","stagger","delay","loop-delay","paused","loop","custom-effect","effect-timing","effect-direction","effect-iteration-count","effect-fill-mode","variant","tone","size","radius","padding","elevation","align"]}connectedCallback(){super.connectedCallback(),this.setAttribute("role","text"),this._sourceObserver=new MutationObserver(this._handleSourceMutation),this._sourceObserver.observe(this,{childList:!0,subtree:!0,characterData:!0}),this._setupReducedMotionQuery(),this._updateVisibilityObservation(),this._syncHostStyles(),queueMicrotask(()=>{this._triggerMode()==="load"&&this._resolvedText().trim()?this._startIfNeeded():this._updateRuntimeState(),this._syncLoopTimer()})}disconnectedCallback(){var t,e;(t=this._sourceObserver)==null||t.disconnect(),this._sourceObserver=null,(e=this._intersectionObserver)==null||e.disconnect(),this._intersectionObserver=null,this._detachReducedMotionQuery(),this._clearLoopTimer(),super.disconnectedCallback()}get text(){return this.getAttribute("text")??this._sourceText()}set text(t){t?this.setAttribute("text",t):this.removeAttribute("text")}pause(){this.hasAttribute("paused")?(this._syncLoopTimer(),this._updateRuntimeState()):this.setAttribute("paused","")}play(){this.hasAttribute("paused")&&this.removeAttribute("paused"),this._startIfNeeded(),this._syncLoopTimer(),this._updateRuntimeState()}replay(){this._resolvedText().trim()&&(this._hasStarted=!0,this._runId+=1,this.invalidateContentCache(),this.requestRender(),this._syncLoopTimer(),this._updateRuntimeState())}refresh(){this.invalidateContentCache(),this.requestRender(),this._syncLoopTimer(),this._updateRuntimeState()}attributeChangedCallback(t,e,i){e!==i&&(t==="trigger"&&(this._updateVisibilityObservation(),this._triggerMode()==="load"&&this._resolvedText().trim()&&this._startIfNeeded()),t==="text"&&this._handleTextChange(),super.attributeChangedCallback(t,e,i),this._syncHostStyles(),this._syncLoopTimer(),this._updateRuntimeState())}_sourceText(){return this.textContent||""}_resolvedText(){return this.getAttribute("text")??this._sourceText()}_resolvedEffect(){return $(this.getAttribute("effect"),this.getAttribute("custom-effect"))}_effect(){const t=this._resolvedEffect();return t.mode==="builtin"?t.value:"fade-up"}_splitMode(){return O(this.getAttribute("split"),this._effect())}_triggerMode(){return Q(this.getAttribute("trigger"))}_durationMs(){return f(this.getAttribute("duration"),720)}_staggerMs(){return f(this.getAttribute("stagger"),55)}_delayMs(){return f(this.getAttribute("delay"),0)}_loopDelayMs(){const t=this.getAttribute("loop-delay");if(!t)return x;const e=f(t,x);return Math.max(0,e)}_shouldLoop(){return this.hasAttribute("loop")}_hiddenUntilStarted(){if(this._hasStarted)return!1;const t=this._triggerMode();return t==="manual"?!0:t==="visible"&&!this._visible}_shouldAnimate(){return this._hasStarted&&!this._isMotionReduced()&&!!this._resolvedText().trim()}_isMotionReduced(){var t;return!!((t=this._mediaQuery)!=null&&t.matches)}_isMotionPaused(){return this._hasStarted?!!(this.hasAttribute("paused")||this._isMotionReduced()||this._triggerMode()==="visible"&&!this._visible):!1}_currentAlignValue(){const t=(this.getAttribute("align")||"").trim().toLowerCase();return t==="center"?"center":t==="right"||t==="end"?"end":"start"}_countAnimatedSegments(t,e){return b(t,e).filter(i=>i.animated).length}_cycleDurationMs(t){const e=this._countAnimatedSegments(t,this._splitMode());return e<=0?this._durationMs()+this._delayMs():this._delayMs()+this._durationMs()+this._staggerMs()*Math.max(0,e-1)}_syncHostStyles(){const t=h(this.getAttribute("duration")),e=h(this.getAttribute("stagger")),i=h(this.getAttribute("delay")),n=this.getAttribute("radius"),o=g(this.getAttribute("padding")),d=(this.getAttribute("effect-timing")||"").trim(),u=(this.getAttribute("effect-direction")||"").trim(),m=(this.getAttribute("effect-iteration-count")||"").trim(),l=(this.getAttribute("effect-fill-mode")||"").trim(),s=this._resolvedEffect();if(t?this.style.setProperty("--ui-animated-text-duration",t):this.style.removeProperty("--ui-animated-text-duration"),e?this.style.setProperty("--ui-animated-text-stagger",e):this.style.removeProperty("--ui-animated-text-stagger"),i?this.style.setProperty("--ui-animated-text-delay",i):this.style.removeProperty("--ui-animated-text-delay"),n&&!R.has(n)){const c=g(n);c?this.style.setProperty("--ui-animated-text-radius",c):this.style.removeProperty("--ui-animated-text-radius")}else this.style.removeProperty("--ui-animated-text-radius");o?this.style.setProperty("--ui-animated-text-padding",o):this.style.removeProperty("--ui-animated-text-padding"),s.mode==="custom"&&s.value?this.style.setProperty("--ui-animated-text-custom-animation-name",s.value):this.style.removeProperty("--ui-animated-text-custom-animation-name"),d?this.style.setProperty("--ui-animated-text-animation-timing",d):this.style.removeProperty("--ui-animated-text-animation-timing"),u?this.style.setProperty("--ui-animated-text-animation-direction",u):this.style.removeProperty("--ui-animated-text-animation-direction"),m?this.style.setProperty("--ui-animated-text-animation-iteration-count",m):this.style.removeProperty("--ui-animated-text-animation-iteration-count"),l?this.style.setProperty("--ui-animated-text-animation-fill-mode",l):this.style.removeProperty("--ui-animated-text-animation-fill-mode")}_setupReducedMotionQuery(){if(!(typeof window>"u"||typeof window.matchMedia!="function")){if(this._mediaQuery=window.matchMedia("(prefers-reduced-motion: reduce)"),typeof this._mediaQuery.addEventListener=="function"){this._mediaQuery.addEventListener("change",this._handleReducedMotionChange);return}this._mediaQuery.addListener(this._handleReducedMotionChange)}}_detachReducedMotionQuery(){this._mediaQuery&&(typeof this._mediaQuery.removeEventListener=="function"?this._mediaQuery.removeEventListener("change",this._handleReducedMotionChange):this._mediaQuery.removeListener(this._handleReducedMotionChange),this._mediaQuery=null)}_handleReducedMotionChange(){this.invalidateContentCache(),this.requestRender(),this._syncLoopTimer(),this._updateRuntimeState()}_updateVisibilityObservation(){var t;if((t=this._intersectionObserver)==null||t.disconnect(),this._intersectionObserver=null,this._triggerMode()!=="visible"){this._visible=!0;return}if(typeof IntersectionObserver>"u"){this._visible=!0;return}this._visible=!1,this._intersectionObserver=new IntersectionObserver(this._handleIntersection,{threshold:.2}),this._intersectionObserver.observe(this)}_handleIntersection(t){const e=t[t.length-1],i=!!(e!=null&&e.isIntersecting);this._visible!==i&&(this._visible=i,this._visible?this._startIfNeeded():(this._syncLoopTimer(),this._updateRuntimeState(),this.requestRender()))}_handleSourceMutation(){this.hasAttribute("text")||this._handleTextChange()}_handleTextChange(){if(!this._resolvedText().trim()){this._hasStarted=!1,this._clearLoopTimer(),this._updateRuntimeState(),this.requestRender();return}if(this._triggerMode()==="manual"&&!this._hasStarted){this.invalidateContentCache(),this.requestRender(),this._updateRuntimeState();return}if(this._triggerMode()==="visible"&&!this._visible&&!this._hasStarted){this.invalidateContentCache(),this.requestRender(),this._updateRuntimeState();return}this._hasStarted=!0,this._runId+=1,this.invalidateContentCache(),this.requestRender(),this._syncLoopTimer(),this._updateRuntimeState()}_startIfNeeded(){if(!this._resolvedText().trim()){this._updateRuntimeState();return}if(this._triggerMode()==="visible"&&!this._visible){this._updateRuntimeState();return}this._hasStarted||(this._hasStarted=!0,this._runId+=1,this.invalidateContentCache(),this.requestRender()),this._syncLoopTimer(),this._updateRuntimeState()}_clearLoopTimer(){this._loopTimer!=null&&(window.clearTimeout(this._loopTimer),this._loopTimer=null)}_syncLoopTimer(){this._clearLoopTimer();const t=this._resolvedText();if(!this._shouldLoop()||!this._shouldAnimate()||this._isMotionPaused()||!t.trim())return;const e=this._cycleDurationMs(t)+this._loopDelayMs();this._loopTimer=window.setTimeout(()=>{this._loopTimer=null,this.replay()},Math.max(0,e))}_updateRuntimeState(){if(!this._resolvedText().trim()){this.setAttribute("data-state","idle");return}if(!this._hasStarted){this.setAttribute("data-state","idle");return}if(this._isMotionPaused()){this.setAttribute("data-state","paused");return}this.setAttribute("data-state","running")}render(){const t=this._resolvedText(),e=this._resolvedEffect(),i=e.mode==="builtin"?e.value:"custom",n=this._splitMode(),o=this._shouldAnimate(),d=this._hiddenUntilStarted(),u=this._isMotionPaused(),m=this._currentAlignValue(),l=(this.getAttribute("variant")||"default").trim(),s=b(t,n);let c=0;const y=s.map(r=>{const _=r.animated?c++:0,w=r.text===" "?" ":p(r.text);return`
|
|
654
|
+
`;function p(a){return a.split("&").join("&").split("<").join("<").split(">").join(">").split('"').join(""").split("'").join("'")}function I(a){return/^\s+$/.test(a)}function h(a){if(!a)return null;const t=a.trim();return t?/^-?\d+(\.\d+)?$/.test(t)?`${t}ms`:/^-?\d+(\.\d+)?m?s$/.test(t)?t:null:null}function g(a){if(!a)return null;const t=a.trim();if(!t)return null;const e=t.split(/\s+/).filter(Boolean);return e.length?e.map(i=>/^-?\d+(\.\d+)?$/.test(i)?`${i}px`:i).join(" "):null}function f(a,t){const e=h(a);if(!e)return t;if(e.endsWith("ms")){const i=Number.parseFloat(e.slice(0,-2));return Number.isFinite(i)&&i>=0?i:t}if(e.endsWith("s")){const i=Number.parseFloat(e.slice(0,-1));return Number.isFinite(i)&&i>=0?i*1e3:t}return t}function P(a){const t=globalThis.Intl.Segmenter;if(typeof t=="function"){const e=new t(void 0,{granularity:"grapheme"});return Array.from(e.segment(a),i=>i.segment)}return Array.from(a)}function E(a){const t=globalThis.Intl.Segmenter;if(typeof t=="function"){const e=new t(void 0,{granularity:"word"});return Array.from(e.segment(a),i=>i.segment).filter(Boolean)}return a.split(/(\s+)/).filter(Boolean)}function b(a,t){return a?t==="lines"?a.split(/\r\n|\r|\n/).map(i=>({text:i||" ",animated:!!i.trim(),line:!0})):(t==="chars"?P(a):E(a)).map(i=>({text:i,animated:!I(i),line:!1})):[]}function $(a,t){const e=(t||"").trim();if(e)return{mode:"custom",value:e};const i=(a||"").trim();return i?S.has(i)?{mode:"builtin",value:i}:{mode:"custom",value:i}:{mode:"builtin",value:"fade-up"}}function O(a,t){if(t==="typewriter")return"chars";const e=(a||"").trim();return z.has(e)?e:"words"}function Q(a){const t=(a||"").trim();return C.has(t)?t:"load"}class v extends k.ElementBase{constructor(){super(),this._sourceObserver=null,this._intersectionObserver=null,this._mediaQuery=null,this._loopTimer=null,this._visible=!1,this._hasStarted=!1,this._runId=0,this._handleSourceMutation=this._handleSourceMutation.bind(this),this._handleIntersection=this._handleIntersection.bind(this),this._handleReducedMotionChange=this._handleReducedMotionChange.bind(this)}static get observedAttributes(){return["text","effect","split","trigger","duration","stagger","delay","loop-delay","paused","loop","custom-effect","effect-timing","effect-direction","effect-iteration-count","effect-fill-mode","variant","tone","size","radius","padding","elevation","align"]}connectedCallback(){super.connectedCallback(),this.setAttribute("role","text"),this._sourceObserver=new MutationObserver(this._handleSourceMutation),this._sourceObserver.observe(this,{childList:!0,subtree:!0,characterData:!0}),this._setupReducedMotionQuery(),this._updateVisibilityObservation(),this._syncHostStyles(),queueMicrotask(()=>{this._triggerMode()==="load"&&this._resolvedText().trim()?this._startIfNeeded():this._updateRuntimeState(),this._syncLoopTimer()})}disconnectedCallback(){this._sourceObserver?.disconnect(),this._sourceObserver=null,this._intersectionObserver?.disconnect(),this._intersectionObserver=null,this._detachReducedMotionQuery(),this._clearLoopTimer(),super.disconnectedCallback()}get text(){return this.getAttribute("text")??this._sourceText()}set text(t){t?this.setAttribute("text",t):this.removeAttribute("text")}pause(){this.hasAttribute("paused")?(this._syncLoopTimer(),this._updateRuntimeState()):this.setAttribute("paused","")}play(){this.hasAttribute("paused")&&this.removeAttribute("paused"),this._startIfNeeded(),this._syncLoopTimer(),this._updateRuntimeState()}replay(){this._resolvedText().trim()&&(this._hasStarted=!0,this._runId+=1,this.invalidateContentCache(),this.requestRender(),this._syncLoopTimer(),this._updateRuntimeState())}refresh(){this.invalidateContentCache(),this.requestRender(),this._syncLoopTimer(),this._updateRuntimeState()}attributeChangedCallback(t,e,i){e!==i&&(t==="trigger"&&(this._updateVisibilityObservation(),this._triggerMode()==="load"&&this._resolvedText().trim()&&this._startIfNeeded()),t==="text"&&this._handleTextChange(),super.attributeChangedCallback(t,e,i),this._syncHostStyles(),this._syncLoopTimer(),this._updateRuntimeState())}_sourceText(){return this.textContent||""}_resolvedText(){return this.getAttribute("text")??this._sourceText()}_resolvedEffect(){return $(this.getAttribute("effect"),this.getAttribute("custom-effect"))}_effect(){const t=this._resolvedEffect();return t.mode==="builtin"?t.value:"fade-up"}_splitMode(){return O(this.getAttribute("split"),this._effect())}_triggerMode(){return Q(this.getAttribute("trigger"))}_durationMs(){return f(this.getAttribute("duration"),720)}_staggerMs(){return f(this.getAttribute("stagger"),55)}_delayMs(){return f(this.getAttribute("delay"),0)}_loopDelayMs(){const t=this.getAttribute("loop-delay");if(!t)return x;const e=f(t,x);return Math.max(0,e)}_shouldLoop(){return this.hasAttribute("loop")}_hiddenUntilStarted(){if(this._hasStarted)return!1;const t=this._triggerMode();return t==="manual"?!0:t==="visible"&&!this._visible}_shouldAnimate(){return this._hasStarted&&!this._isMotionReduced()&&!!this._resolvedText().trim()}_isMotionReduced(){return!!this._mediaQuery?.matches}_isMotionPaused(){return this._hasStarted?!!(this.hasAttribute("paused")||this._isMotionReduced()||this._triggerMode()==="visible"&&!this._visible):!1}_currentAlignValue(){const t=(this.getAttribute("align")||"").trim().toLowerCase();return t==="center"?"center":t==="right"||t==="end"?"end":"start"}_countAnimatedSegments(t,e){return b(t,e).filter(i=>i.animated).length}_cycleDurationMs(t){const e=this._countAnimatedSegments(t,this._splitMode());return e<=0?this._durationMs()+this._delayMs():this._delayMs()+this._durationMs()+this._staggerMs()*Math.max(0,e-1)}_syncHostStyles(){const t=h(this.getAttribute("duration")),e=h(this.getAttribute("stagger")),i=h(this.getAttribute("delay")),n=this.getAttribute("radius"),o=g(this.getAttribute("padding")),d=(this.getAttribute("effect-timing")||"").trim(),u=(this.getAttribute("effect-direction")||"").trim(),m=(this.getAttribute("effect-iteration-count")||"").trim(),l=(this.getAttribute("effect-fill-mode")||"").trim(),s=this._resolvedEffect();if(t?this.style.setProperty("--ui-animated-text-duration",t):this.style.removeProperty("--ui-animated-text-duration"),e?this.style.setProperty("--ui-animated-text-stagger",e):this.style.removeProperty("--ui-animated-text-stagger"),i?this.style.setProperty("--ui-animated-text-delay",i):this.style.removeProperty("--ui-animated-text-delay"),n&&!R.has(n)){const c=g(n);c?this.style.setProperty("--ui-animated-text-radius",c):this.style.removeProperty("--ui-animated-text-radius")}else this.style.removeProperty("--ui-animated-text-radius");o?this.style.setProperty("--ui-animated-text-padding",o):this.style.removeProperty("--ui-animated-text-padding"),s.mode==="custom"&&s.value?this.style.setProperty("--ui-animated-text-custom-animation-name",s.value):this.style.removeProperty("--ui-animated-text-custom-animation-name"),d?this.style.setProperty("--ui-animated-text-animation-timing",d):this.style.removeProperty("--ui-animated-text-animation-timing"),u?this.style.setProperty("--ui-animated-text-animation-direction",u):this.style.removeProperty("--ui-animated-text-animation-direction"),m?this.style.setProperty("--ui-animated-text-animation-iteration-count",m):this.style.removeProperty("--ui-animated-text-animation-iteration-count"),l?this.style.setProperty("--ui-animated-text-animation-fill-mode",l):this.style.removeProperty("--ui-animated-text-animation-fill-mode")}_setupReducedMotionQuery(){if(!(typeof window>"u"||typeof window.matchMedia!="function")){if(this._mediaQuery=window.matchMedia("(prefers-reduced-motion: reduce)"),typeof this._mediaQuery.addEventListener=="function"){this._mediaQuery.addEventListener("change",this._handleReducedMotionChange);return}this._mediaQuery.addListener(this._handleReducedMotionChange)}}_detachReducedMotionQuery(){this._mediaQuery&&(typeof this._mediaQuery.removeEventListener=="function"?this._mediaQuery.removeEventListener("change",this._handleReducedMotionChange):this._mediaQuery.removeListener(this._handleReducedMotionChange),this._mediaQuery=null)}_handleReducedMotionChange(){this.invalidateContentCache(),this.requestRender(),this._syncLoopTimer(),this._updateRuntimeState()}_updateVisibilityObservation(){if(this._intersectionObserver?.disconnect(),this._intersectionObserver=null,this._triggerMode()!=="visible"){this._visible=!0;return}if(typeof IntersectionObserver>"u"){this._visible=!0;return}this._visible=!1,this._intersectionObserver=new IntersectionObserver(this._handleIntersection,{threshold:.2}),this._intersectionObserver.observe(this)}_handleIntersection(t){const i=!!t[t.length-1]?.isIntersecting;this._visible!==i&&(this._visible=i,this._visible?this._startIfNeeded():(this._syncLoopTimer(),this._updateRuntimeState(),this.requestRender()))}_handleSourceMutation(){this.hasAttribute("text")||this._handleTextChange()}_handleTextChange(){if(!this._resolvedText().trim()){this._hasStarted=!1,this._clearLoopTimer(),this._updateRuntimeState(),this.requestRender();return}if(this._triggerMode()==="manual"&&!this._hasStarted){this.invalidateContentCache(),this.requestRender(),this._updateRuntimeState();return}if(this._triggerMode()==="visible"&&!this._visible&&!this._hasStarted){this.invalidateContentCache(),this.requestRender(),this._updateRuntimeState();return}this._hasStarted=!0,this._runId+=1,this.invalidateContentCache(),this.requestRender(),this._syncLoopTimer(),this._updateRuntimeState()}_startIfNeeded(){if(!this._resolvedText().trim()){this._updateRuntimeState();return}if(this._triggerMode()==="visible"&&!this._visible){this._updateRuntimeState();return}this._hasStarted||(this._hasStarted=!0,this._runId+=1,this.invalidateContentCache(),this.requestRender()),this._syncLoopTimer(),this._updateRuntimeState()}_clearLoopTimer(){this._loopTimer!=null&&(window.clearTimeout(this._loopTimer),this._loopTimer=null)}_syncLoopTimer(){this._clearLoopTimer();const t=this._resolvedText();if(!this._shouldLoop()||!this._shouldAnimate()||this._isMotionPaused()||!t.trim())return;const e=this._cycleDurationMs(t)+this._loopDelayMs();this._loopTimer=window.setTimeout(()=>{this._loopTimer=null,this.replay()},Math.max(0,e))}_updateRuntimeState(){if(!this._resolvedText().trim()){this.setAttribute("data-state","idle");return}if(!this._hasStarted){this.setAttribute("data-state","idle");return}if(this._isMotionPaused()){this.setAttribute("data-state","paused");return}this.setAttribute("data-state","running")}render(){const t=this._resolvedText(),e=this._resolvedEffect(),i=e.mode==="builtin"?e.value:"custom",n=this._splitMode(),o=this._shouldAnimate(),d=this._hiddenUntilStarted(),u=this._isMotionPaused(),m=this._currentAlignValue(),l=(this.getAttribute("variant")||"default").trim(),s=b(t,n);let c=0;const y=s.map(r=>{const _=r.animated?c++:0,w=r.text===" "?" ":p(r.text);return`
|
|
655
655
|
<span
|
|
656
656
|
class="segment"
|
|
657
657
|
part="segment"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as w } from "./ElementBase-
|
|
1
|
+
import { E as w } from "./ElementBase-YlTLMsGk.mjs";
|
|
2
2
|
const k = "720ms", T = "55ms", A = "0ms", x = 1400, M = /* @__PURE__ */ new Set([
|
|
3
3
|
"fade-up",
|
|
4
4
|
"fade-down",
|
|
@@ -675,24 +675,20 @@ function L(a) {
|
|
|
675
675
|
return /^\s+$/.test(a);
|
|
676
676
|
}
|
|
677
677
|
function h(a) {
|
|
678
|
-
if (!a)
|
|
679
|
-
return null;
|
|
678
|
+
if (!a) return null;
|
|
680
679
|
const t = a.trim();
|
|
681
680
|
return t ? /^-?\d+(\.\d+)?$/.test(t) ? `${t}ms` : /^-?\d+(\.\d+)?m?s$/.test(t) ? t : null : null;
|
|
682
681
|
}
|
|
683
682
|
function g(a) {
|
|
684
|
-
if (!a)
|
|
685
|
-
return null;
|
|
683
|
+
if (!a) return null;
|
|
686
684
|
const t = a.trim();
|
|
687
|
-
if (!t)
|
|
688
|
-
return null;
|
|
685
|
+
if (!t) return null;
|
|
689
686
|
const e = t.split(/\s+/).filter(Boolean);
|
|
690
687
|
return e.length ? e.map((i) => /^-?\d+(\.\d+)?$/.test(i) ? `${i}px` : i).join(" ") : null;
|
|
691
688
|
}
|
|
692
689
|
function f(a, t) {
|
|
693
690
|
const e = h(a);
|
|
694
|
-
if (!e)
|
|
695
|
-
return t;
|
|
691
|
+
if (!e) return t;
|
|
696
692
|
if (e.endsWith("ms")) {
|
|
697
693
|
const i = Number.parseFloat(e.slice(0, -2));
|
|
698
694
|
return Number.isFinite(i) && i >= 0 ? i : t;
|
|
@@ -732,14 +728,12 @@ function b(a, t) {
|
|
|
732
728
|
}
|
|
733
729
|
function E(a, t) {
|
|
734
730
|
const e = (t || "").trim();
|
|
735
|
-
if (e)
|
|
736
|
-
return { mode: "custom", value: e };
|
|
731
|
+
if (e) return { mode: "custom", value: e };
|
|
737
732
|
const i = (a || "").trim();
|
|
738
733
|
return i ? M.has(i) ? { mode: "builtin", value: i } : { mode: "custom", value: i } : { mode: "builtin", value: "fade-up" };
|
|
739
734
|
}
|
|
740
735
|
function $(a, t) {
|
|
741
|
-
if (t === "typewriter")
|
|
742
|
-
return "chars";
|
|
736
|
+
if (t === "typewriter") return "chars";
|
|
743
737
|
const e = (a || "").trim();
|
|
744
738
|
return S.has(e) ? e : "words";
|
|
745
739
|
}
|
|
@@ -787,8 +781,7 @@ class Q extends w {
|
|
|
787
781
|
});
|
|
788
782
|
}
|
|
789
783
|
disconnectedCallback() {
|
|
790
|
-
|
|
791
|
-
(t = this._sourceObserver) == null || t.disconnect(), this._sourceObserver = null, (e = this._intersectionObserver) == null || e.disconnect(), this._intersectionObserver = null, this._detachReducedMotionQuery(), this._clearLoopTimer(), super.disconnectedCallback();
|
|
784
|
+
this._sourceObserver?.disconnect(), this._sourceObserver = null, this._intersectionObserver?.disconnect(), this._intersectionObserver = null, this._detachReducedMotionQuery(), this._clearLoopTimer(), super.disconnectedCallback();
|
|
792
785
|
}
|
|
793
786
|
get text() {
|
|
794
787
|
return this.getAttribute("text") ?? this._sourceText();
|
|
@@ -841,8 +834,7 @@ class Q extends w {
|
|
|
841
834
|
}
|
|
842
835
|
_loopDelayMs() {
|
|
843
836
|
const t = this.getAttribute("loop-delay");
|
|
844
|
-
if (!t)
|
|
845
|
-
return x;
|
|
837
|
+
if (!t) return x;
|
|
846
838
|
const e = f(t, x);
|
|
847
839
|
return Math.max(0, e);
|
|
848
840
|
}
|
|
@@ -850,8 +842,7 @@ class Q extends w {
|
|
|
850
842
|
return this.hasAttribute("loop");
|
|
851
843
|
}
|
|
852
844
|
_hiddenUntilStarted() {
|
|
853
|
-
if (this._hasStarted)
|
|
854
|
-
return !1;
|
|
845
|
+
if (this._hasStarted) return !1;
|
|
855
846
|
const t = this._triggerMode();
|
|
856
847
|
return t === "manual" ? !0 : t === "visible" && !this._visible;
|
|
857
848
|
}
|
|
@@ -859,8 +850,7 @@ class Q extends w {
|
|
|
859
850
|
return this._hasStarted && !this._isMotionReduced() && !!this._resolvedText().trim();
|
|
860
851
|
}
|
|
861
852
|
_isMotionReduced() {
|
|
862
|
-
|
|
863
|
-
return !!((t = this._mediaQuery) != null && t.matches);
|
|
853
|
+
return !!this._mediaQuery?.matches;
|
|
864
854
|
}
|
|
865
855
|
_isMotionPaused() {
|
|
866
856
|
return this._hasStarted ? !!(this.hasAttribute("paused") || this._isMotionReduced() || this._triggerMode() === "visible" && !this._visible) : !1;
|
|
@@ -901,8 +891,7 @@ class Q extends w {
|
|
|
901
891
|
this.invalidateContentCache(), this.requestRender(), this._syncLoopTimer(), this._updateRuntimeState();
|
|
902
892
|
}
|
|
903
893
|
_updateVisibilityObservation() {
|
|
904
|
-
|
|
905
|
-
if ((t = this._intersectionObserver) == null || t.disconnect(), this._intersectionObserver = null, this._triggerMode() !== "visible") {
|
|
894
|
+
if (this._intersectionObserver?.disconnect(), this._intersectionObserver = null, this._triggerMode() !== "visible") {
|
|
906
895
|
this._visible = !0;
|
|
907
896
|
return;
|
|
908
897
|
}
|
|
@@ -915,7 +904,7 @@ class Q extends w {
|
|
|
915
904
|
}), this._intersectionObserver.observe(this);
|
|
916
905
|
}
|
|
917
906
|
_handleIntersection(t) {
|
|
918
|
-
const
|
|
907
|
+
const i = !!t[t.length - 1]?.isIntersecting;
|
|
919
908
|
this._visible !== i && (this._visible = i, this._visible ? this._startIfNeeded() : (this._syncLoopTimer(), this._updateRuntimeState(), this.requestRender()));
|
|
920
909
|
}
|
|
921
910
|
_handleSourceMutation() {
|
package/dist/app-header.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./ElementBase-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./ElementBase-EV6mVBUV.js"),p=`
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
--ui-app-header-height: var(--base-app-header-height, 64px);
|
|
@@ -332,7 +332,7 @@
|
|
|
332
332
|
--ui-app-header-muted: CanvasText;
|
|
333
333
|
}
|
|
334
334
|
}
|
|
335
|
-
`;class i extends t.ElementBase{static get observedAttributes(){return["sticky","bordered","dense","headless","show-menu-button","variant","tone","size","radius","elevation"]}constructor(){super(),this._onRootClick=this._onRootClick.bind(this)}_normalizeRadius(
|
|
335
|
+
`;class i extends t.ElementBase{static get observedAttributes(){return["sticky","bordered","dense","headless","show-menu-button","variant","tone","size","radius","elevation"]}constructor(){super(),this._onRootClick=this._onRootClick.bind(this)}_normalizeRadius(e){if(e==null)return"var(--base-app-header-radius, var(--ui-radius, 4px))";const a=e.trim().toLowerCase();return a?a==="full"||a==="pill"?"999px":/^-?\d+(\.\d+)?$/.test(a)?`${a}px`:e:"var(--base-app-header-radius, var(--ui-radius, 4px))"}connectedCallback(){super.connectedCallback(),this.root.addEventListener("click",this._onRootClick),this.style.setProperty("--ui-app-header-radius",this._normalizeRadius(this.getAttribute("radius")))}disconnectedCallback(){this.root.removeEventListener("click",this._onRootClick),super.disconnectedCallback()}_onRootClick(e){e.target?.closest(".menu-btn")&&this.dispatchEvent(new CustomEvent("menu-trigger",{bubbles:!0}))}attributeChangedCallback(e,a,r){a!==r&&(e==="radius"&&this.style.setProperty("--ui-app-header-radius",this._normalizeRadius(r)),super.attributeChangedCallback(e,a,r))}render(){this.setContent(`
|
|
336
336
|
<style>${p}</style>
|
|
337
337
|
<header role="banner">
|
|
338
338
|
<div class="start">
|
|
@@ -362,4 +362,4 @@
|
|
|
362
362
|
<slot name="end"></slot>
|
|
363
363
|
</div>
|
|
364
364
|
</header>
|
|
365
|
-
`)}shouldRenderOnAttributeChange(a,
|
|
365
|
+
`)}shouldRenderOnAttributeChange(e,a,r){return e==="show-menu-button"}}typeof customElements<"u"&&!customElements.get("ui-app-header")&&customElements.define("ui-app-header",i);exports.UIAppHeader=i;
|
package/dist/app-header.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as i } from "./ElementBase-
|
|
1
|
+
import { E as i } from "./ElementBase-YlTLMsGk.mjs";
|
|
2
2
|
const t = `
|
|
3
3
|
:host {
|
|
4
4
|
display: block;
|
|
@@ -352,11 +352,10 @@ class p extends i {
|
|
|
352
352
|
constructor() {
|
|
353
353
|
super(), this._onRootClick = this._onRootClick.bind(this);
|
|
354
354
|
}
|
|
355
|
-
_normalizeRadius(
|
|
356
|
-
if (
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
return e ? e === "full" || e === "pill" ? "999px" : /^-?\d+(\.\d+)?$/.test(e) ? `${e}px` : a : "var(--base-app-header-radius, var(--ui-radius, 4px))";
|
|
355
|
+
_normalizeRadius(e) {
|
|
356
|
+
if (e == null) return "var(--base-app-header-radius, var(--ui-radius, 4px))";
|
|
357
|
+
const a = e.trim().toLowerCase();
|
|
358
|
+
return a ? a === "full" || a === "pill" ? "999px" : /^-?\d+(\.\d+)?$/.test(a) ? `${a}px` : e : "var(--base-app-header-radius, var(--ui-radius, 4px))";
|
|
360
359
|
}
|
|
361
360
|
connectedCallback() {
|
|
362
361
|
super.connectedCallback(), this.root.addEventListener("click", this._onRootClick), this.style.setProperty("--ui-app-header-radius", this._normalizeRadius(this.getAttribute("radius")));
|
|
@@ -364,16 +363,15 @@ class p extends i {
|
|
|
364
363
|
disconnectedCallback() {
|
|
365
364
|
this.root.removeEventListener("click", this._onRootClick), super.disconnectedCallback();
|
|
366
365
|
}
|
|
367
|
-
_onRootClick(
|
|
368
|
-
|
|
369
|
-
e != null && e.closest(".menu-btn") && this.dispatchEvent(
|
|
366
|
+
_onRootClick(e) {
|
|
367
|
+
e.target?.closest(".menu-btn") && this.dispatchEvent(
|
|
370
368
|
new CustomEvent("menu-trigger", {
|
|
371
369
|
bubbles: !0
|
|
372
370
|
})
|
|
373
371
|
);
|
|
374
372
|
}
|
|
375
|
-
attributeChangedCallback(
|
|
376
|
-
|
|
373
|
+
attributeChangedCallback(e, a, r) {
|
|
374
|
+
a !== r && (e === "radius" && this.style.setProperty("--ui-app-header-radius", this._normalizeRadius(r)), super.attributeChangedCallback(e, a, r));
|
|
377
375
|
}
|
|
378
376
|
render() {
|
|
379
377
|
this.setContent(`
|
|
@@ -408,8 +406,8 @@ class p extends i {
|
|
|
408
406
|
</header>
|
|
409
407
|
`);
|
|
410
408
|
}
|
|
411
|
-
shouldRenderOnAttributeChange(
|
|
412
|
-
return
|
|
409
|
+
shouldRenderOnAttributeChange(e, a, r) {
|
|
410
|
+
return e === "show-menu-button";
|
|
413
411
|
}
|
|
414
412
|
}
|
|
415
413
|
typeof customElements < "u" && !customElements.get("ui-app-header") && customElements.define("ui-app-header", p);
|
package/dist/aspect-ratio.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("./ElementBase-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("./ElementBase-EV6mVBUV.js"),p=`
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
width: 100%;
|