@odigos/ui-kit 0.0.166 → 0.0.168
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/CHANGELOG.md +14 -0
- package/lib/chunks/{ui-components-e8819fa0.js → ui-components-e54e1ba5.js} +491 -471
- package/lib/chunks/vendor-0965fadc.js +1 -0
- package/lib/components/_v2/badge/index.d.ts +1 -0
- package/lib/components/_v2/cards/section-card/index.d.ts +2 -1
- package/lib/components/_v2/drawer/header/index.d.ts +1 -0
- package/lib/components/_v2/hover-actions/index.d.ts +1 -0
- package/lib/components/_v2/loader/index.d.ts +12 -6
- package/lib/components/_v2/loader/spinner/index.d.ts +5 -0
- package/lib/components/_v2/loader/spinner-old/helpers/animation.d.ts +1 -0
- package/lib/components/_v2/loader/spinner-old/helpers/unitConverter.d.ts +22 -0
- package/lib/components/_v2/loader/spinner-old/index.d.ts +10 -0
- package/lib/components/v2.js +1 -1
- package/lib/components.js +1 -1
- package/lib/constants.js +1 -1
- package/lib/containers/_v2/central-connections/config-drawer/index.d.ts +1 -1
- package/lib/containers/_v2/central-connections/source-drawer/index.d.ts +1 -1
- package/lib/containers/_v2/central-connections/source-drawer/types.d.ts +0 -1
- package/lib/containers/v2.js +26 -22
- package/lib/containers.js +108 -108
- package/lib/contexts.js +1 -1
- package/lib/functions.js +1 -1
- package/lib/hooks.js +1 -1
- package/lib/snippets/_v2/actions/index.d.ts +2 -1
- package/lib/snippets/_v2/cancel-modal/index.d.ts +1 -1
- package/lib/snippets/_v2/delete-modal/index.d.ts +1 -1
- package/lib/snippets/_v2/rich-title/index.d.ts +1 -1
- package/lib/snippets.js +1 -1
- package/lib/store/index.d.ts +1 -1
- package/lib/store/useProgressStore.d.ts +22 -0
- package/lib/store.js +1 -1
- package/lib/theme.js +1 -1
- package/lib/types/snapshot/index.d.ts +2 -3
- package/lib/types/sources/index.d.ts +1 -1
- package/lib/types.js +1 -1
- package/lib/visuals.js +1 -1
- package/package.json +14 -14
- package/lib/chunks/vendor-55cc654c.js +0 -1
- package/lib/store/useInstrumentStore.d.ts +0 -13
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as t from"react";import{flushSync as e}from"react-dom";function o(t,e){let o;try{o=t()}catch(t){return}return{getItem:t=>{var r;const n=t=>null===t?null:JSON.parse(t,null==e?void 0:e.reviver),a=null!=(r=o.getItem(t))?r:null;return a instanceof Promise?a.then(n):n(a)},setItem:(t,r)=>o.setItem(t,JSON.stringify(r,null==e?void 0:e.replacer)),removeItem:t=>o.removeItem(t)}}const r=t=>e=>{try{const o=t(e);return o instanceof Promise?o:{then:t=>r(t)(o),catch(t){return this}}}catch(t){return{then(t){return this},catch:e=>r(e)(t)}}},n=(t,e)=>(n,a,s)=>{let i={storage:o(()=>localStorage),partialize:t=>t,version:0,merge:(t,e)=>({...e,...t}),...e},l=!1;const c=new Set,d=new Set;let u=i.storage;if(!u)return t((...t)=>{n(...t)},a,s);const h=()=>{const t=i.partialize({...a()});return u.setItem(i.name,{state:t,version:i.version})},f=s.setState;s.setState=(t,e)=>(f(t,e),h());const b=t((...t)=>(n(...t),h()),a,s);let p;s.getInitialState=()=>b;const g=()=>{var t,e;if(!u)return;l=!1,c.forEach(t=>{var e;return t(null!=(e=a())?e:b)});const o=(null==(e=i.onRehydrateStorage)?void 0:e.call(i,null!=(t=a())?t:b))||void 0;return r(u.getItem.bind(u))(i.name).then(t=>{if(t){if("number"!=typeof t.version||t.version===i.version)return[!1,t.state];if(i.migrate){const e=i.migrate(t.state,t.version);return e instanceof Promise?e.then(t=>[!0,t]):[!0,e]}}return[!1,void 0]}).then(t=>{var e;const[o,r]=t;if(p=i.merge(r,null!=(e=a())?e:b),n(p,!0),o)return h()}).then(()=>{null==o||o(p,void 0),p=a(),l=!0,d.forEach(t=>t(p))}).catch(t=>{null==o||o(void 0,t)})};return s.persist={setOptions:t=>{i={...i,...t},t.storage&&(u=t.storage)},clearStorage:()=>{null==u||u.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>g(),hasHydrated:()=>l,onHydrate:t=>(c.add(t),()=>{c.delete(t)}),onFinishHydration:t=>(d.add(t),()=>{d.delete(t)})},i.skipHydration||g(),p||b};function a(t,e){void 0===e&&(e={});var o=e.insertAt;if(t&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===o&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}}function s(t,e,o){let r,n=o.initialDeps??[],a=!0;function s(){var s,i,l;let c;o.key&&(null==(s=o.debug)?void 0:s.call(o))&&(c=Date.now());const d=t();if(d.length===n.length&&!d.some((t,e)=>n[e]!==t))return r;let u;return n=d,o.key&&(null==(i=o.debug)?void 0:i.call(o))&&(u=Date.now()),r=e(...d),o.key&&(null==(l=o.debug)?void 0:l.call(o))&&(Math.round(100*(Date.now()-c)),Math.round(100*(Date.now()-u))),!(null==o?void 0:o.onChange)||a&&o.skipInitialOnChange||o.onChange(r),a=!1,r}return s.updateDeps=t=>{n=t},s}function i(t,e){if(void 0===t)throw new Error("Unexpected undefined"+(e?`: ${e}`:""));return t}const l=(t,e,o)=>{let r;return function(...n){t.clearTimeout(r),r=t.setTimeout(()=>e.apply(this,n),o)}},c=t=>{const{offsetWidth:e,offsetHeight:o}=t;return{width:e,height:o}},d=t=>t,u=t=>{const e=Math.max(t.startIndex-t.overscan,0),o=Math.min(t.endIndex+t.overscan,t.count-1),r=[];for(let t=e;t<=o;t++)r.push(t);return r},h=(t,e)=>{const o=t.scrollElement;if(!o)return;const r=t.targetWindow;if(!r)return;const n=t=>{const{width:o,height:r}=t;e({width:Math.round(o),height:Math.round(r)})};if(n(c(o)),!r.ResizeObserver)return()=>{};const a=new r.ResizeObserver(e=>{const r=()=>{const t=e[0];if(null==t?void 0:t.borderBoxSize){const e=t.borderBoxSize[0];if(e)return void n({width:e.inlineSize,height:e.blockSize})}n(c(o))};t.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(o,{box:"border-box"}),()=>{a.unobserve(o)}},f={passive:!0},b="undefined"==typeof window||"onscrollend"in window,p=(t,e)=>{const o=t.scrollElement;if(!o)return;const r=t.targetWindow;if(!r)return;let n=0;const a=t.options.useScrollendEvent&&b?()=>{}:l(r,()=>{e(n,!1)},t.options.isScrollingResetDelay),s=r=>()=>{const{horizontal:s,isRtl:i}=t.options;n=s?o.scrollLeft*(i?-1:1):o.scrollTop,a(),e(n,r)},i=s(!0),c=s(!1);o.addEventListener("scroll",i,f);const d=t.options.useScrollendEvent&&b;return d&&o.addEventListener("scrollend",c,f),()=>{o.removeEventListener("scroll",i),d&&o.removeEventListener("scrollend",c)}},g=(t,e,o)=>{if(null==e?void 0:e.borderBoxSize){const t=e.borderBoxSize[0];if(t)return Math.round(t[o.options.horizontal?"inlineSize":"blockSize"])}return t[o.options.horizontal?"offsetWidth":"offsetHeight"]},x=(t,{adjustments:e=0,behavior:o},r)=>{var n,a;const s=t+e;null==(a=null==(n=r.scrollElement)?void 0:n.scrollTo)||a.call(n,{[r.options.horizontal?"left":"top"]:s,behavior:o})};class _{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.currentScrollToIndex=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let t=null;const e=()=>t||(this.targetWindow&&this.targetWindow.ResizeObserver?t=new this.targetWindow.ResizeObserver(t=>{t.forEach(t=>{const e=()=>{this.t(t.target,t)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(e):e()})}):null);return{disconnect:()=>{var o;null==(o=e())||o.disconnect(),t=null},observe:t=>{var o;return null==(o=e())?void 0:o.observe(t,{box:"border-box"})},unobserve:t=>{var o;return null==(o=e())?void 0:o.unobserve(t)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([e,o])=>{void 0===o&&delete t[e]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:d,rangeExtractor:u,onChange:()=>{},measureElement:g,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...t}},this.notify=t=>{var e,o;null==(o=(e=this.options).onChange)||o.call(e,this,t)},this.maybeNotify=s(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:"production"!==process.env.NODE_ENV&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this.o=()=>()=>{this.cleanup()},this.i=()=>{var t;const e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e)return void this.maybeNotify();this.scrollElement=e,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=(null==(t=this.scrollElement)?void 0:t.window)??null,this.elementsCache.forEach(t=>{this.observer.observe(t)}),this.unsubs.push(this.options.observeElementRect(this,t=>{this.scrollRect=t,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(t,e)=>{this.scrollAdjustments=0,this.scrollDirection=e?this.getScrollOffset()<t?"forward":"backward":null,this.scrollOffset=t,this.isScrolling=e,this.maybeNotify()})),this.l(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??("function"==typeof this.options.initialOffset?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(t,e)=>{const o=new Map,r=new Map;for(let n=e-1;n>=0;n--){const e=t[n];if(o.has(e.lane))continue;const a=r.get(e.lane);if(null==a||e.end>a.end?r.set(e.lane,e):e.end<a.end&&o.set(e.lane,!0),o.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort((t,e)=>t.end===e.end?t.index-e.index:t.end-e.end)[0]:void 0},this.getMeasurementOptions=s(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(t,e,o,r,n,a)=>(void 0!==this.prevLanes&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:e,scrollMargin:o,getItemKey:r,enabled:n,lanes:a}),{key:!1,skipInitialOnChange:!0,onChange:()=>{this.notify(this.isScrolling)}}),this.getMeasurements=s(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:e,scrollMargin:o,getItemKey:r,enabled:n,lanes:a},s)=>{if(!n)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const e of this.laneAssignments.keys())e>=t&&this.laneAssignments.delete(e);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),0!==this.measurementsCache.length||this.lanesSettling||(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(t=>{this.itemSizeCache.set(t.key,t.size)}));const i=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1);const l=this.measurementsCache.slice(0,i),c=new Array(a).fill(void 0);for(let t=0;t<i;t++){const e=l[t];e&&(c[e.lane]=t)}for(let n=i;n<t;n++){const t=r(n),a=this.laneAssignments.get(n);let i,d;if(void 0!==a&&this.options.lanes>1){i=a;const t=c[i],r=void 0!==t?l[t]:void 0;d=r?r.end+this.options.gap:e+o}else{const t=1===this.options.lanes?l[n-1]:this.getFurthestMeasurement(l,n);d=t?t.end+this.options.gap:e+o,i=t?t.lane:n%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(n,i)}const u=s.get(t),h="number"==typeof u?u:this.options.estimateSize(n),f=d+h;l[n]={index:n,start:d,size:h,end:f,key:t,lane:i},c[i]=n}return this.measurementsCache=l,l},{key:"production"!==process.env.NODE_ENV&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=s(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,e,o,r)=>this.range=t.length>0&&e>0?function({measurements:t,outerSize:e,scrollOffset:o,lanes:r}){const n=t.length-1;if(t.length<=r)return{startIndex:0,endIndex:n};let a=w(0,n,e=>t[e].start,o),s=a;if(1===r)for(;s<n&&t[s].end<o+e;)s++;else if(r>1){const i=Array(r).fill(0);for(;s<n&&i.some(t=>t<o+e);){const e=t[s];i[e.lane]=e.end,s++}const l=Array(r).fill(o+e);for(;a>=0&&l.some(t=>t>=o);){const e=t[a];l[e.lane]=e.start,a--}a=Math.max(0,a-a%r),s=Math.min(n,s+(r-1-s%r))}return{startIndex:a,endIndex:s}}({measurements:t,outerSize:e,scrollOffset:o,lanes:r}):null,{key:"production"!==process.env.NODE_ENV&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=s(()=>{let t=null,e=null;const o=this.calculateRange();return o&&(t=o.startIndex,e=o.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,e]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,e]},(t,e,o,r,n)=>null===r||null===n?[]:t({startIndex:r,endIndex:n,overscan:e,count:o}),{key:"production"!==process.env.NODE_ENV&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=t=>{const e=this.options.indexAttribute,o=t.getAttribute(e);return o?parseInt(o,10):-1},this.t=(t,e)=>{const o=this.indexFromElement(t),r=this.measurementsCache[o];if(!r)return;const n=r.key,a=this.elementsCache.get(n);a!==t&&(a&&this.observer.unobserve(a),this.observer.observe(t),this.elementsCache.set(n,t)),t.isConnected&&this.resizeItem(o,this.options.measureElement(t,e,this))},this.resizeItem=(t,e)=>{const o=this.measurementsCache[t];if(!o)return;const r=e-(this.itemSizeCache.get(o.key)??o.size);0!==r&&((void 0!==this.shouldAdjustScrollPositionOnItemSizeChange?this.shouldAdjustScrollPositionOnItemSizeChange(o,r,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&("production"!==process.env.NODE_ENV&&this.options.debug,this.l(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=r,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,e)),this.notify(!1))},this.measureElement=t=>{t?this.t(t,void 0):this.elementsCache.forEach((t,e)=>{t.isConnected||(this.observer.unobserve(t),this.elementsCache.delete(e))})},this.getVirtualItems=s(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,e)=>{const o=[];for(let r=0,n=t.length;r<n;r++){const n=e[t[r]];o.push(n)}return o},{key:"production"!==process.env.NODE_ENV&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const e=this.getMeasurements();if(0!==e.length)return i(e[w(0,e.length-1,t=>i(e[t]).start,t)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(t,e,o=0)=>{if(!this.scrollElement)return 0;const r=this.getSize(),n=this.getScrollOffset();"auto"===e&&(e=t>=n+r?"end":"start"),"center"===e?t+=(o-r)/2:"end"===e&&(t-=r);const a=this.getMaxScrollOffset();return Math.max(Math.min(a,t),0)},this.getOffsetForIndex=(t,e="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const o=this.measurementsCache[t];if(!o)return;const r=this.getSize(),n=this.getScrollOffset();if("auto"===e)if(o.end>=n+r-this.options.scrollPaddingEnd)e="end";else{if(!(o.start<=n+this.options.scrollPaddingStart))return[n,e];e="start"}if("end"===e&&t===this.options.count-1)return[this.getMaxScrollOffset(),e];const a="end"===e?o.end+this.options.scrollPaddingEnd:o.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,e,o.size),e]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(t,{align:e="start",behavior:o}={})=>{"smooth"===o&&this.isDynamicMode(),this.l(this.getOffsetForAlignment(t,e),{adjustments:void 0,behavior:o})},this.scrollToIndex=(t,{align:e="auto",behavior:o}={})=>{"smooth"===o&&this.isDynamicMode(),t=Math.max(0,Math.min(t,this.options.count-1)),this.currentScrollToIndex=t;let r=0;const n=e=>{if(!this.targetWindow)return;const r=this.getOffsetForIndex(t,e);if(!r)return;const[n,s]=r;this.l(n,{adjustments:void 0,behavior:o}),this.targetWindow.requestAnimationFrame(()=>{const e=()=>{if(this.currentScrollToIndex!==t)return;const e=this.getScrollOffset(),o=this.getOffsetForIndex(t,s);var r,n;o&&(r=o[0],n=e,Math.abs(r-n)<1.01||a(s))};this.isDynamicMode()?this.targetWindow.requestAnimationFrame(e):e()})},a=e=>{this.targetWindow&&this.currentScrollToIndex===t&&(r++,r<10&&("production"!==process.env.NODE_ENV&&this.options.debug,this.targetWindow.requestAnimationFrame(()=>n(e))))};n(e)},this.scrollBy=(t,{behavior:e}={})=>{"smooth"===e&&this.isDynamicMode(),this.l(this.getScrollOffset()+t,{adjustments:void 0,behavior:e})},this.getTotalSize=()=>{var t;const e=this.getMeasurements();let o;if(0===e.length)o=this.options.paddingStart;else if(1===this.options.lanes)o=(null==(t=e[e.length-1])?void 0:t.end)??0;else{const t=Array(this.options.lanes).fill(null);let r=e.length-1;for(;r>=0&&t.some(t=>null===t);){const o=e[r];null===t[o.lane]&&(t[o.lane]=o.end),r--}o=Math.max(...t.filter(t=>null!==t))}return Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this.l=(t,{adjustments:e,behavior:o})=>{this.options.scrollToFn(t,{behavior:o,adjustments:e},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(t)}}const w=(t,e,o,r)=>{for(;t<=e;){const n=(t+e)/2|0,a=o(n);if(a<r)t=n+1;else{if(!(a>r))return n;e=n-1}}return t>0?t-1:0},y="undefined"!=typeof document?t.useLayoutEffect:t.useEffect;function v(o){return function({useFlushSync:o=!0,...r}){const n=t.useReducer(()=>({}),{})[1],a={...r,onChange:(t,a)=>{var s;o&&a?e(n):n(),null==(s=r.onChange)||s.call(r,t,a)}},[s]=t.useState(()=>new _(a));return s.setOptions(a),y(()=>s.o(),[]),y(()=>s.i()),s}({observeElementRect:h,observeElementOffset:p,scrollToFn:x,...o})}var m={locale:"en",long:{year:{previous:"last year",current:"this year",next:"next year",past:{one:"{0} year ago",other:"{0} years ago"},future:{one:"in {0} year",other:"in {0} years"}},quarter:{previous:"last quarter",current:"this quarter",next:"next quarter",past:{one:"{0} quarter ago",other:"{0} quarters ago"},future:{one:"in {0} quarter",other:"in {0} quarters"}},month:{previous:"last month",current:"this month",next:"next month",past:{one:"{0} month ago",other:"{0} months ago"},future:{one:"in {0} month",other:"in {0} months"}},week:{previous:"last week",current:"this week",next:"next week",past:{one:"{0} week ago",other:"{0} weeks ago"},future:{one:"in {0} week",other:"in {0} weeks"}},day:{previous:"yesterday",current:"today",next:"tomorrow",past:{one:"{0} day ago",other:"{0} days ago"},future:{one:"in {0} day",other:"in {0} days"}},hour:{current:"this hour",past:{one:"{0} hour ago",other:"{0} hours ago"},future:{one:"in {0} hour",other:"in {0} hours"}},minute:{current:"this minute",past:{one:"{0} minute ago",other:"{0} minutes ago"},future:{one:"in {0} minute",other:"in {0} minutes"}},second:{current:"now",past:{one:"{0} second ago",other:"{0} seconds ago"},future:{one:"in {0} second",other:"in {0} seconds"}}},short:{year:{previous:"last yr.",current:"this yr.",next:"next yr.",past:"{0} yr. ago",future:"in {0} yr."},quarter:{previous:"last qtr.",current:"this qtr.",next:"next qtr.",past:{one:"{0} qtr. ago",other:"{0} qtrs. ago"},future:{one:"in {0} qtr.",other:"in {0} qtrs."}},month:{previous:"last mo.",current:"this mo.",next:"next mo.",past:"{0} mo. ago",future:"in {0} mo."},week:{previous:"last wk.",current:"this wk.",next:"next wk.",past:"{0} wk. ago",future:"in {0} wk."},day:{previous:"yesterday",current:"today",next:"tomorrow",past:{one:"{0} day ago",other:"{0} days ago"},future:{one:"in {0} day",other:"in {0} days"}},hour:{current:"this hour",past:"{0} hr. ago",future:"in {0} hr."},minute:{current:"this minute",past:"{0} min. ago",future:"in {0} min."},second:{current:"now",past:"{0} sec. ago",future:"in {0} sec."}},narrow:{year:{previous:"last yr.",current:"this yr.",next:"next yr.",past:"{0}y ago",future:"in {0}y"},quarter:{previous:"last qtr.",current:"this qtr.",next:"next qtr.",past:"{0}q ago",future:"in {0}q"},month:{previous:"last mo.",current:"this mo.",next:"next mo.",past:"{0}mo ago",future:"in {0}mo"},week:{previous:"last wk.",current:"this wk.",next:"next wk.",past:"{0}w ago",future:"in {0}w"},day:{previous:"yesterday",current:"today",next:"tomorrow",past:"{0}d ago",future:"in {0}d"},hour:{current:"this hour",past:"{0}h ago",future:"in {0}h"},minute:{current:"this minute",past:"{0}m ago",future:"in {0}m"},second:{current:"now",past:"{0}s ago",future:"in {0}s"}},now:{now:{current:"now",future:"in a moment",past:"just now"}},mini:{year:"{0}yr",month:"{0}mo",week:"{0}wk",day:"{0}d",hour:"{0}h",minute:"{0}m",second:"{0}s",now:"now"},"short-time":{year:"{0} yr.",month:"{0} mo.",week:"{0} wk.",day:{one:"{0} day",other:"{0} days"},hour:"{0} hr.",minute:"{0} min.",second:"{0} sec."},"long-time":{year:{one:"{0} year",other:"{0} years"},month:{one:"{0} month",other:"{0} months"},week:{one:"{0} week",other:"{0} weeks"},day:{one:"{0} day",other:"{0} days"},hour:{one:"{0} hour",other:"{0} hours"},minute:{one:"{0} minute",other:"{0} minutes"},second:{one:"{0} second",other:"{0} seconds"}}};a(".react-flow{--xy-edge-stroke-default:#b1b1b7;--xy-edge-stroke-width-default:1;--xy-edge-stroke-selected-default:#555;--xy-connectionline-stroke-default:#b1b1b7;--xy-connectionline-stroke-width-default:1;--xy-attribution-background-color-default:hsla(0,0%,100%,.5);--xy-minimap-background-color-default:#fff;--xy-minimap-mask-background-color-default:hsla(0,0%,94%,.6);--xy-minimap-mask-stroke-color-default:transparent;--xy-minimap-mask-stroke-width-default:1;--xy-minimap-node-background-color-default:#e2e2e2;--xy-minimap-node-stroke-color-default:transparent;--xy-minimap-node-stroke-width-default:2;--xy-background-color-default:transparent;--xy-background-pattern-dots-color-default:#91919a;--xy-background-pattern-lines-color-default:#eee;--xy-background-pattern-cross-color-default:#e2e2e2;--xy-node-color-default:inherit;--xy-node-border-default:1px solid #1a192b;--xy-node-background-color-default:#fff;--xy-node-group-background-color-default:hsla(0,0%,94%,.25);--xy-node-boxshadow-hover-default:0 1px 4px 1px rgba(0,0,0,.08);--xy-node-boxshadow-selected-default:0 0 0 0.5px #1a192b;--xy-node-border-radius-default:3px;--xy-handle-background-color-default:#1a192b;--xy-handle-border-color-default:#fff;--xy-selection-background-color-default:rgba(0,89,220,.08);--xy-selection-border-default:1px dotted rgba(0,89,220,.8);--xy-controls-button-background-color-default:#fefefe;--xy-controls-button-background-color-hover-default:#f4f4f4;--xy-controls-button-color-default:inherit;--xy-controls-button-color-hover-default:inherit;--xy-controls-button-border-color-default:#eee;--xy-controls-box-shadow-default:0 0 2px 1px rgba(0,0,0,.08);--xy-edge-label-background-color-default:#fff;--xy-edge-label-color-default:inherit;--xy-resize-background-color-default:#3367d9;background-color:var(--xy-background-color,var(--xy-background-color-default));direction:ltr}.react-flow.dark{--xy-edge-stroke-default:#3e3e3e;--xy-edge-stroke-width-default:1;--xy-edge-stroke-selected-default:#727272;--xy-connectionline-stroke-default:#b1b1b7;--xy-connectionline-stroke-width-default:1;--xy-attribution-background-color-default:hsla(0,0%,59%,.25);--xy-minimap-background-color-default:#141414;--xy-minimap-mask-background-color-default:rgba(60,60,60,.6);--xy-minimap-mask-stroke-color-default:transparent;--xy-minimap-mask-stroke-width-default:1;--xy-minimap-node-background-color-default:#2b2b2b;--xy-minimap-node-stroke-color-default:transparent;--xy-minimap-node-stroke-width-default:2;--xy-background-color-default:#141414;--xy-background-pattern-dots-color-default:#777;--xy-background-pattern-lines-color-default:#777;--xy-background-pattern-cross-color-default:#777;--xy-node-color-default:#f8f8f8;--xy-node-border-default:1px solid #3c3c3c;--xy-node-background-color-default:#1e1e1e;--xy-node-group-background-color-default:hsla(0,0%,94%,.25);--xy-node-boxshadow-hover-default:0 1px 4px 1px hsla(0,0%,100%,.08);--xy-node-boxshadow-selected-default:0 0 0 0.5px #999;--xy-handle-background-color-default:#bebebe;--xy-handle-border-color-default:#1e1e1e;--xy-selection-background-color-default:rgba(200,200,220,.08);--xy-selection-border-default:1px dotted rgba(200,200,220,.8);--xy-controls-button-background-color-default:#2b2b2b;--xy-controls-button-background-color-hover-default:#3e3e3e;--xy-controls-button-color-default:#f8f8f8;--xy-controls-button-color-hover-default:#fff;--xy-controls-button-border-color-default:#5b5b5b;--xy-controls-box-shadow-default:0 0 2px 1px rgba(0,0,0,.08);--xy-edge-label-background-color-default:#141414;--xy-edge-label-color-default:#f8f8f8}.react-flow__background{background-color:var(--xy-background-color-props,var(--xy-background-color,var(--xy-background-color-default)));pointer-events:none;z-index:-1}.react-flow__container{height:100%;left:0;position:absolute;top:0;width:100%}.react-flow__pane{z-index:1}.react-flow__pane.draggable{cursor:grab}.react-flow__pane.dragging{cursor:grabbing}.react-flow__pane.selection{cursor:pointer}.react-flow__viewport{pointer-events:none;transform-origin:0 0;z-index:2}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow__edge-path{stroke:var(--xy-edge-stroke,var(--xy-edge-stroke-default));stroke-width:var(--xy-edge-stroke-width,var(--xy-edge-stroke-width-default));fill:none}.react-flow__connection-path{stroke:var(--xy-connectionline-stroke,var(--xy-connectionline-stroke-default));stroke-width:var(--xy-connectionline-stroke-width,var(--xy-connectionline-stroke-width-default));fill:none}.react-flow .react-flow__edges{position:absolute}.react-flow .react-flow__edges svg{overflow:visible;pointer-events:none;position:absolute}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selectable:focus .react-flow__edge-path,.react-flow__edge.selectable:focus-visible .react-flow__edge-path,.react-flow__edge.selected .react-flow__edge-path{stroke:var(--xy-edge-stroke-selected,var(--xy-edge-stroke-selected-default))}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__arrowhead polyline{stroke:var(--xy-edge-stroke,var(--xy-edge-stroke-default))}.react-flow__arrowhead polyline.arrowclosed{fill:var(--xy-edge-stroke,var(--xy-edge-stroke-default))}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}svg.react-flow__connectionline{overflow:visible;position:absolute;z-index:1001}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{box-sizing:border-box;cursor:default;pointer-events:all;position:absolute;transform-origin:0 0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__node.selectable{cursor:pointer}.react-flow__node.draggable{cursor:grab;pointer-events:all}.react-flow__node.draggable.dragging{cursor:grabbing}.react-flow__nodesselection{pointer-events:none;transform-origin:left top;z-index:3}.react-flow__nodesselection-rect{cursor:grab;pointer-events:all;position:absolute}.react-flow__handle{background-color:var(--xy-handle-background-color,var(--xy-handle-background-color-default));border:1px solid var(--xy-handle-border-color,var(--xy-handle-border-color-default));border-radius:100%;height:6px;min-height:5px;min-width:5px;pointer-events:none;position:absolute;width:6px}.react-flow__handle.connectingfrom{pointer-events:all}.react-flow__handle.connectionindicator{cursor:crosshair;pointer-events:all}.react-flow__handle-bottom{bottom:0;left:50%;top:auto;transform:translate(-50%,50%)}.react-flow__handle-top{left:50%;top:0;transform:translate(-50%,-50%)}.react-flow__handle-left{left:0;top:50%;transform:translate(-50%,-50%)}.react-flow__handle-right{right:0;top:50%;transform:translate(50%,-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__pane.selection .react-flow__panel{pointer-events:none}.react-flow__panel{margin:15px;position:absolute;z-index:5}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.bottom.center,.react-flow__panel.top.center{left:50%;transform:translateX(-15px) translateX(-50%)}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.left.center,.react-flow__panel.right.center{top:50%;transform:translateY(-15px) translateY(-50%)}.react-flow__attribution{background:var(--xy-attribution-background-color,var(--xy-attribution-background-color-default));font-size:10px;margin:0;padding:2px 3px}.react-flow__attribution a{color:#999;text-decoration:none}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{pointer-events:none}.react-flow__edgelabel-renderer,.react-flow__viewport-portal{height:100%;left:0;position:absolute;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.react-flow__minimap{background:var(\n --xy-minimap-background-color-props,var(--xy-minimap-background-color,var(--xy-minimap-background-color-default))\n )}.react-flow__minimap-svg{display:block}.react-flow__minimap-mask{fill:var(\n --xy-minimap-mask-background-color-props,var(--xy-minimap-mask-background-color,var(--xy-minimap-mask-background-color-default))\n );stroke:var(\n --xy-minimap-mask-stroke-color-props,var(--xy-minimap-mask-stroke-color,var(--xy-minimap-mask-stroke-color-default))\n );stroke-width:var(\n --xy-minimap-mask-stroke-width-props,var(--xy-minimap-mask-stroke-width,var(--xy-minimap-mask-stroke-width-default))\n )}.react-flow__minimap-node{fill:var(\n --xy-minimap-node-background-color-props,var(--xy-minimap-node-background-color,var(--xy-minimap-node-background-color-default))\n );stroke:var(\n --xy-minimap-node-stroke-color-props,var(--xy-minimap-node-stroke-color,var(--xy-minimap-node-stroke-color-default))\n );stroke-width:var(\n --xy-minimap-node-stroke-width-props,var(--xy-minimap-node-stroke-width,var(--xy-minimap-node-stroke-width-default))\n )}.react-flow__background-pattern.dots{fill:var(\n --xy-background-pattern-color-props,var(--xy-background-pattern-color,var(--xy-background-pattern-dots-color-default))\n )}.react-flow__background-pattern.lines{stroke:var(\n --xy-background-pattern-color-props,var(--xy-background-pattern-color,var(--xy-background-pattern-lines-color-default))\n )}.react-flow__background-pattern.cross{stroke:var(\n --xy-background-pattern-color-props,var(--xy-background-pattern-color,var(--xy-background-pattern-cross-color-default))\n )}.react-flow__controls{box-shadow:var(--xy-controls-box-shadow,var(--xy-controls-box-shadow-default));display:flex;flex-direction:column}.react-flow__controls.horizontal{flex-direction:row}.react-flow__controls-button{align-items:center;background:var(--xy-controls-button-background-color,var(--xy-controls-button-background-color-default));border:none;border-bottom:1px solid var(\n --xy-controls-button-border-color-props,var(--xy-controls-button-border-color,var(--xy-controls-button-border-color-default))\n );color:var(\n --xy-controls-button-color-props,var(--xy-controls-button-color,var(--xy-controls-button-color-default))\n );cursor:pointer;display:flex;height:26px;justify-content:center;padding:4px;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:26px}.react-flow__controls-button svg{fill:currentColor;max-height:12px;max-width:12px;width:100%}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-default,.react-flow__node-group,.react-flow__node-input,.react-flow__node-output{background-color:var(--xy-node-background-color,var(--xy-node-background-color-default));border:var(--xy-node-border,var(--xy-node-border-default));border-radius:var(--xy-node-border-radius,var(--xy-node-border-radius-default));color:var(--xy-node-color,var(--xy-node-color-default));font-size:12px;padding:10px;text-align:center;width:150px}.react-flow__node-default.selectable:hover,.react-flow__node-group.selectable:hover,.react-flow__node-input.selectable:hover,.react-flow__node-output.selectable:hover{box-shadow:var(--xy-node-boxshadow-hover,var(--xy-node-boxshadow-hover-default))}.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible,.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible{box-shadow:var(--xy-node-boxshadow-selected,var(--xy-node-boxshadow-selected-default))}.react-flow__node-group{background-color:var(--xy-node-group-background-color,var(--xy-node-group-background-color-default))}.react-flow__nodesselection-rect,.react-flow__selection{background:var(--xy-selection-background-color,var(--xy-selection-background-color-default));border:var(--xy-selection-border,var(--xy-selection-border-default))}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls-button:hover{background:var(\n --xy-controls-button-background-color-hover-props,var(--xy-controls-button-background-color-hover,var(--xy-controls-button-background-color-hover-default))\n );color:var(\n --xy-controls-button-color-hover-props,var(--xy-controls-button-color-hover,var(--xy-controls-button-color-hover-default))\n )}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__controls-button:last-child{border-bottom:none}.react-flow__controls.horizontal .react-flow__controls-button{border-bottom:none;border-right:1px solid var(\n --xy-controls-button-border-color-props,var(--xy-controls-button-border-color,var(--xy-controls-button-border-color-default))\n )}.react-flow__controls.horizontal .react-flow__controls-button:last-child{border-right:none}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.bottom,.react-flow__resize-control.top{cursor:ns-resize}.react-flow__resize-control.bottom.right,.react-flow__resize-control.top.left{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{background-color:var(--xy-resize-background-color,var(--xy-resize-background-color-default));border:1px solid #fff;border-radius:1px;height:5px;translate:-50% -50%;width:5px}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.bottom.left,.react-flow__resize-control.handle.top.left{left:0}.react-flow__resize-control.handle.bottom.right,.react-flow__resize-control.handle.top.right{left:100%}.react-flow__resize-control.line{border-color:var(--xy-resize-background-color,var(--xy-resize-background-color-default));border-style:solid;border-width:0}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{height:100%;top:0;transform:translate(-50%);width:1px}.react-flow__resize-control.line.left{border-left-width:1px;left:0}.react-flow__resize-control.line.right{border-right-width:1px;left:100%}.react-flow__resize-control.line.bottom,.react-flow__resize-control.line.top{height:1px;left:0;transform:translateY(-50%);width:100%}.react-flow__resize-control.line.top{border-top-width:1px;top:0}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}.react-flow__edge-textbg{fill:var(--xy-edge-label-background-color,var(--xy-edge-label-background-color-default))}.react-flow__edge-text{fill:var(--xy-edge-label-color,var(--xy-edge-label-color-default))}");export{o as c,m as e,n as p,a as s,v as u};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type ReactNode, type FC } from 'react';
|
|
2
2
|
import { type SearchProps } from '../../search';
|
|
3
|
-
import { ActionsProps
|
|
3
|
+
import { type ActionsProps } from '@/snippets/_v2/actions';
|
|
4
|
+
import { type RichTitleProps } from '@/snippets/_v2/rich-title';
|
|
4
5
|
export declare enum SectionCardSize {
|
|
5
6
|
S = "small",
|
|
6
7
|
M = "medium"
|
|
@@ -3,6 +3,7 @@ import { type ButtonProps } from '../button';
|
|
|
3
3
|
export interface HoverAction extends Pick<ButtonProps, 'label' | 'leftIcon' | 'rightIcon' | 'loading' | 'disabled'> {
|
|
4
4
|
id: string;
|
|
5
5
|
onClick: () => void;
|
|
6
|
+
tooltip?: string;
|
|
6
7
|
}
|
|
7
8
|
export interface HoverActionsProps {
|
|
8
9
|
isOpen: boolean;
|
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
import { type FC } from 'react';
|
|
1
|
+
import { CSSProperties, type FC } from 'react';
|
|
2
2
|
import type { SVG } from '@/types';
|
|
3
|
-
import {
|
|
3
|
+
import { TypographySize } from '../typography';
|
|
4
4
|
export interface LoaderProps {
|
|
5
|
-
label?: string;
|
|
6
5
|
icon?: SVG;
|
|
6
|
+
title?: string;
|
|
7
|
+
titleColor?: CSSProperties['color'];
|
|
8
|
+
titleSize?: TypographySize;
|
|
9
|
+
subTitle?: string;
|
|
10
|
+
subTitleColor?: CSSProperties['color'];
|
|
11
|
+
subTitleSize?: TypographySize;
|
|
7
12
|
withGradient?: boolean;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
13
|
+
gradientColor?: string;
|
|
14
|
+
withSpinner?: boolean;
|
|
15
|
+
prettySpinner?: boolean;
|
|
16
|
+
percentage?: number;
|
|
11
17
|
}
|
|
12
18
|
export declare const Loader: FC<LoaderProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const createAnimation: (loaderName: string, frames: string, suffix: string) => string;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
interface LengthObject {
|
|
2
|
+
value: number;
|
|
3
|
+
unit: string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* If size is a number, append px to the value as default unit.
|
|
7
|
+
* If size is a string, validate against list of valid units.
|
|
8
|
+
* If unit is valid, return size as is.
|
|
9
|
+
* If unit is invalid, console warn issue, replace with px as the unit.
|
|
10
|
+
*
|
|
11
|
+
* @param {(number | string)} size
|
|
12
|
+
* @return {LengthObject} LengthObject
|
|
13
|
+
*/
|
|
14
|
+
export declare function parseLengthAndUnit(size: number | string): LengthObject;
|
|
15
|
+
/**
|
|
16
|
+
* Take value as an input and return valid css value
|
|
17
|
+
*
|
|
18
|
+
* @param {(number | string)} value
|
|
19
|
+
* @return {string} valid css value
|
|
20
|
+
*/
|
|
21
|
+
export declare function cssValue(value: number | string): string;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type CSSProperties, type DetailedHTMLProps, type FC, type HTMLAttributes } from 'react';
|
|
2
|
+
interface SpinnerOldProps extends DetailedHTMLProps<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement> {
|
|
3
|
+
loading?: boolean;
|
|
4
|
+
color?: string;
|
|
5
|
+
scale?: number;
|
|
6
|
+
speedMultiplier?: number;
|
|
7
|
+
cssOverride?: CSSProperties;
|
|
8
|
+
}
|
|
9
|
+
declare const SpinnerOld: FC<SpinnerOldProps>;
|
|
10
|
+
export { SpinnerOld, type SpinnerOldProps };
|
package/lib/components/v2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{B as Badge,
|
|
1
|
+
export{B as Badge,m as Button,w as ButtonSize,dq as ButtonTab,dr as ButtonTabList,n as ButtonVariants,C as Checkbox,du as CheckboxList,dt as CheckboxSize,Q as CliCommand,K as DataCard,i as Drawer,dw as DropData,G as DropDataAlignX,dv as DropDataAlignY,dx as Header,c7 as HoverActions,M as IconButton,cj as IconButtonSize,dy as Input,I as Island,L as Loader,dz as Modal,dA as Navbar,l as Note,dC as Radio,dD as RadioGroup,dB as RadioSize,k as Search,t as SectionCard,ds as SectionCardSize,U as Segment,dE as SegmentSize,W as StatusCard,x as Table,y as TableVariant,dF as Tag,X as TextCard,d as Toggle,dH as ToggleLabelAlign,dI as ToggleList,e as ToggleSize,dG as ToggleVariant,T as Typography,b as TypographySize,f as TypographyVariants,dJ as WarningModal}from"../chunks/ui-components-e54e1ba5.js";import"../icons.js";import"react";import"styled-components";import"zustand";import"javascript-time-ago";import"../chunks/vendor-0965fadc.js";import"react-dom";import"@xyflow/react";import"react-error-boundary";import"lottie-react";import"prism-react-renderer";
|
package/lib/components.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{aH as AutocompleteInput,a_ as Badge,b0 as Button,as as CancelWarning,j as CenterThis,a6 as Checkbox,d7 as Code,ay as ConditionDetails,az as DataCard,a2 as DataCardFieldTypes,bJ as DataCardFields,d8 as DataFinger,b2 as DataTab,ar as DeleteWarning,c5 as DescribeRow,aI as Divider,ak as DocsButton,aq as Drawer,da as DrawerFooter,d9 as DrawerHeader,bo as Dropdown,db as ErrorBoundary,bw as ExtendArrow,q as FadeLoader,a7 as FieldError,a5 as FieldLabel,F as FlexColumn,a as FlexRow,dc as Header,bv as IconButton,cf as IconGroup,aV as IconTitleBadge,aQ as IconWrapped,c1 as IconsNav,dd as ImageControlled,a9 as Input,af as InputList,ac as InputTable,aY as InteractiveTable,ae as KeyValueInputsList,b$ as LoadingText,aC as Modal,aE as ModalBody,al as MonitorsCheckboxes,aS as MonitorsIcons,aD as NavigationButtons,N as NoDataFound,aF as NotificationNote,dj as Overlay,s as PageContent,bj as Popup,ck as PopupForm,cp as ScrollX,b5 as ScrollY,aj as SectionTitle,ai as Segment,bk as SelectionButton,ba as SkeletonLoader,aK as Status,bI as Stepper,de as TabList,aT as TableContainer,aU as TableTitleWrap,aX as TableWrap,bS as Tag,ah as Text,am as TextArea,ad as Toggle,cn as ToggleCodeComponent,c as Tooltip,aZ as TraceLoader,$ as UpgradeRequiredWrapper,bl as VerticalScroll,di as WarningModal,df as getLinksFromText,dg as getStrongsFromText,dh as renderText}from"./chunks/ui-components-e54e1ba5.js";import"./icons.js";import"react";import"styled-components";import"zustand";import"javascript-time-ago";import"./chunks/vendor-0965fadc.js";import"react-dom";import"@xyflow/react";import"react-error-boundary";import"lottie-react";import"prism-react-renderer";
|
package/lib/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{aw as ACTION_OPTIONS,ap as BUTTON_TEXTS,D as DEFAULT_DATA_STREAM_NAME,bH as DESTINATION_CATEGORIES,bp as DISPLAY_LANGUAGES,a1 as DISPLAY_TITLES,aG as FORM_ALERTS,bW as INSTRUMENTATION_RULE_OPTIONS,c$ as LANGUAGE_OPTIONS,bq as MONITORS_OPTIONS,br as STORAGE_KEYS,d0 as TOKEN_ABOUT_TO_EXPIRE}from"./chunks/ui-components-e54e1ba5.js";import"./icons.js";import"react";import"styled-components";import"zustand";import"javascript-time-ago";import"./chunks/vendor-0965fadc.js";import"react-dom";import"@xyflow/react";import"react-error-boundary";import"lottie-react";import"prism-react-renderer";
|
|
@@ -7,7 +7,7 @@ export interface ConnectionConfigurationsFormData {
|
|
|
7
7
|
export type GetConnectionRemoteConfig = (id: string) => Promise<ConnectionRemoteConfig | undefined>;
|
|
8
8
|
export type ApplyConnectionsConfigurationsFunc = (connectionIds: string[], formData: ConnectionConfigurationsFormData) => Promise<{
|
|
9
9
|
error?: string;
|
|
10
|
-
}>;
|
|
10
|
+
} | undefined>;
|
|
11
11
|
export interface ConfigDrawerProps {
|
|
12
12
|
onClose: DrawerProps['header']['onClose'];
|
|
13
13
|
connections: Connection[];
|
|
@@ -8,5 +8,5 @@ export interface SourceDrawerProps {
|
|
|
8
8
|
setSelectedConnectionIds: Dispatch<SetStateAction<string[]>>;
|
|
9
9
|
persistSources: PersistSourcesFunc;
|
|
10
10
|
}
|
|
11
|
-
export declare const SOURCE_DRAWER_WIDTH = "
|
|
11
|
+
export declare const SOURCE_DRAWER_WIDTH = "75vw";
|
|
12
12
|
export declare const SourceDrawer: FC<SourceDrawerProps>;
|
package/lib/containers/v2.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import e,{useMemo as t,useState as a,useEffect as l,useCallback as n}from"react";import o,{useTheme as s}from"styled-components";import{F as i,a as r,C as c,T as d,b as u,B as p,S as g,c as m,O as h,N as b,d as f,e as y,
|
|
1
|
+
import e,{useMemo as t,useState as a,useEffect as l,useCallback as n}from"react";import o,{useTheme as s}from"styled-components";import{F as i,a as r,C as c,T as d,b as u,B as p,S as g,c as m,O as h,N as b,d as f,e as y,f as w,u as C,g as k,D as v,E as x,h as $,i as S,j as I,L as A,P as R,R as P,k as T,l as D,m as z,n as N,o as L,p as V,q as M,r as O,s as W,t as j,v as F,A as U,w as E,x as H,y as G,z as q,I as Y,G as B,H as K,J as X,K as J,M as Q,Q as Z,Y as _,U as ee,V as te,W as ae,X as le,Z as ne,_ as oe,$ as se,a0 as ie}from"../chunks/ui-components-e54e1ba5.js";import{SourceIcon as re,VSquareIcon as ce,SettingsIcon as de,OdigosLogo as ue,ConnectionsIcon as pe,RefreshIcon as ge,DeleteIcon as me,VIcon as he,XIcon as be,XSquareIcon as fe,PodIcon as ye,ChevronUpIcon as we,ChevronDownIcon as Ce,TerminalIcon as ke,DownloadIcon as ve,PipelineCollectorIcon as xe,GatewayIcon as $e,YamlIcon as Se}from"../icons.js";import"zustand";import"javascript-time-ago";import"../chunks/vendor-0965fadc.js";import"react-dom";import"@xyflow/react";import"react-error-boundary";import"lottie-react";import"prism-react-renderer";const Ie=o(i)`
|
|
2
2
|
width: ${({$width:e})=>e};
|
|
3
3
|
gap: 12px;
|
|
4
4
|
justify-content: space-between;
|
|
5
|
-
|
|
5
|
+
`,Ae=o.div`
|
|
6
6
|
display: flex;
|
|
7
7
|
flex-direction: column;
|
|
8
8
|
padding: 12px;
|
|
9
9
|
gap: ${({$gap:e=0})=>e}px;
|
|
10
10
|
width: calc(100% - 24px);
|
|
11
|
-
height: calc(100vh -
|
|
11
|
+
height: calc(100vh - 300px);
|
|
12
12
|
border-radius: ${({$borderRadius:e})=>e};
|
|
13
13
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
14
14
|
overflow-y: auto;
|
|
15
15
|
overflow-x: hidden;
|
|
16
|
-
`,
|
|
16
|
+
`,Re=o.div`
|
|
17
17
|
display: flex;
|
|
18
18
|
align-items: center;
|
|
19
19
|
justify-content: space-between;
|
|
@@ -25,51 +25,55 @@ import e,{useMemo as t,useState as a,useEffect as l,useCallback as n}from"react"
|
|
|
25
25
|
&:hover {
|
|
26
26
|
background-color: ${({theme:e})=>e.v2.colors.silver[600]};
|
|
27
27
|
}
|
|
28
|
-
`,
|
|
28
|
+
`,Pe=({formData:a,handleSourceChange:l,handleSelectAll:n,selectedArea:o,searchText:i,filters:f})=>{const y=s(),{activeNamespace:w,isAll:C,isSome:k}=t(()=>{const e=o.value.clusterId&&o.value.namespaceName?a.find(({clusterId:e})=>e===o.value.clusterId)?.namespaces.find(({name:e})=>e===o.value.namespaceName):void 0;if(!e)return{activeNamespace:void 0,isAll:!1,isSome:!1};const t=e.workloads.filter(({selected:e})=>e).length;return{activeNamespace:e,isAll:t>0&&t===e.workloads.length,isSome:t>0&&t<e.workloads.length}},[a,o.value.clusterId,o.value.namespaceName]),v=t(()=>{if(!w)return[];const{clusterId:t}=o.value,{name:a,workloads:n}=w;return n.map(({name:n,selected:o,kind:s})=>{if(i&&!n.toLowerCase().includes(i.toLowerCase()))return null;const m=o||!1;if(f.showOnlySelected&&!m)return null;const h=()=>l({clusterId:t,workloadId:{namespace:a,name:n,kind:s}});return e.createElement(Re,{key:`${t}#${a}#${n}#${s}`,onClick:h},e.createElement(r,{$gap:12},e.createElement(c,{value:m,onChange:h}),e.createElement(d,{size:u.XS},n)),e.createElement(p,{label:s,status:g.Info,textSize:u.XXXS,backgroundColor:y.v2.colors.blue[900]}))})},[a,o.value.clusterId,w,i,f]);return e.createElement(Ie,{$width:"50%"},e.createElement(r,{$padding:"0 12px 0 28px",$gap:12},e.createElement(m,{text:(C?"Unselect":"Select")+" all workloads in the selected namespace"},e.createElement(c,{partiallyChecked:k,value:C,onChange:()=>n({clusterId:o.value.clusterId,namespaceName:o.value.namespaceName,boolean:!C}),disabled:!v.length})),e.createElement(r,{$gap:8},e.createElement(d,{size:u.XS,nowrap:!0},o.value.clusterId?`${o.value.clusterName} > ${o.value.namespaceName} > Workloads`:"Workloads"),e.createElement(p,{label:v.length,status:h.Unknown}))),e.createElement(Ae,{$borderRadius:"0 16px 16px 0"},v.length?v:e.createElement(b,{title:"Workloads not found",subTitle:"Please select a namespace to view workloads"})))},Te=({formData:a,handleSourceChange:l,handleSelectAll:n,selectedArea:o,searchText:i,filters:C})=>{const k=s(),{isAll:v,isSome:x}=t(()=>{const e=a.length>0&&a.every(({namespaces:e})=>e.every(({workloads:e})=>e.every(({selected:e})=>e)));return{isAll:e,isSome:!e&&a.length>0&&a.some(({namespaces:e})=>e.some(({workloads:e})=>e.some(({selected:e})=>e)))}},[a]),$=t(()=>a.flatMap(({clusterId:t,clusterName:a,namespaces:n})=>n.map(({name:n,workloads:s,selected:b})=>{if(i&&!n.toLowerCase().includes(i.toLowerCase()))return null;const v=s.filter(({selected:e})=>e).length,x=v>0&&v===s.length,$=v>0&&v<s.length,S=b||!1;if(C.showOnlySelected&&!x&&!$&&!S)return null;const I=o.value.clusterId===t&&o.value.namespaceName===n,A=()=>o.setValue({clusterId:t,clusterName:a,namespaceName:n}),R=e=>{A(),"boolean"==typeof e.all&&s.forEach(({name:a,kind:o})=>{l({clusterId:t,workloadId:{namespace:n,name:a,kind:o},boolean:e.all})}),"boolean"==typeof e.future&&l({clusterId:t,workloadId:{namespace:n},boolean:e.future})};return e.createElement(Re,{key:`${t}#${n}`,$isSelected:I,onClick:A},e.createElement(r,{$gap:12},e.createElement(c,{partiallyChecked:$,value:x,onChange:e=>R({all:e,future:e})}),e.createElement(d,{size:u.XS},`${a} > ${n}`)),e.createElement(r,{$gap:12},e.createElement(m,{text:"Automatically instrument all workloads currently in the namespace, and all workloads that will be deployed to this namespace in the future"},e.createElement(f,{label:"Auto",size:y.S,value:S,onChange:e=>R({future:e})})),e.createElement(r,{$gap:8},e.createElement(d,{variant:w.Span,size:u.XXXS,color:k.v2.colors.silver[200],align:"right"},"Selected"),e.createElement(p,{label:`${v}/${s.length}`,status:I?g.Default:h.Unknown,minWidth:"42px"}))))})),[a,o.value.clusterId,o.value.namespaceName,i,C]);return e.createElement(Ie,{$width:"50%"},e.createElement(r,{$padding:"0 12px 0 28px",$gap:12},e.createElement(m,{text:(v?"Unselect":"Select")+" all workloads in all namespaces"},e.createElement(c,{partiallyChecked:x,value:v,onChange:()=>n({boolean:!v}),disabled:!$.length})),e.createElement(r,{$gap:8},e.createElement(d,{size:u.XS,nowrap:!0},"Namespaces"),e.createElement(p,{label:$.length,status:h.Unknown}))),e.createElement(Ae,{$borderRadius:"16px 0 0 16px"},$.length?$:e.createElement(b,{title:"Namespaces not found",subTitle:""})))},De="75vw",ze=o.div`
|
|
29
29
|
display: flex;
|
|
30
30
|
flex-direction: column;
|
|
31
31
|
border-radius: 16px;
|
|
32
32
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
33
33
|
overflow: hidden;
|
|
34
|
-
`,
|
|
34
|
+
`,Ne=o.div`
|
|
35
35
|
display: flex;
|
|
36
36
|
gap: 12px;
|
|
37
37
|
padding: 16px;
|
|
38
|
-
background-color: ${({theme:e})=>e.v2.colors.silver[
|
|
38
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
39
39
|
position: sticky;
|
|
40
40
|
top: 0;
|
|
41
|
-
`,
|
|
41
|
+
`,Le=o.div`
|
|
42
42
|
display: flex;
|
|
43
43
|
gap: 12px;
|
|
44
44
|
padding: 16px;
|
|
45
|
-
`,
|
|
45
|
+
`,Ve=o.div`
|
|
46
|
+
padding: 5vh 10vw;
|
|
47
|
+
border-radius: 12px;
|
|
48
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
49
|
+
`,Me=o.div`
|
|
46
50
|
display: flex;
|
|
47
51
|
align-items: center;
|
|
48
52
|
justify-content: flex-end;
|
|
49
53
|
gap: 16px;
|
|
50
54
|
padding: 0 12px;
|
|
51
|
-
`,
|
|
55
|
+
`,Oe=(e,t,a)=>{const l=[];return t.workloads.forEach(n=>{const o=e?.workloads.find(e=>e.name===n.name&&e.kind===n.kind);n.selected!==o?.selected&&l.push({namespace:t.name,name:n.name,kind:n.kind,selected:n.selected||!1,currentStreamName:a})}),l},We=({onClose:o,snapshots:i,selectedConnectionIds:c,setSelectedConnectionIds:p,persistSources:m})=>{const h=s(),{selectedStreamName:b}=C(),{progress:w,resetProgress:V}=k(),M=t(()=>b||v,[b]),[O,W]=a(""),[j,F]=a(x.Namespace),[U,E]=a({showOnlySelected:!1}),[H,G]=a(!1),[q,Y]=a(!1),[B,K]=a(void 0),[X,J]=a({clusterId:"",clusterName:"",namespaceName:""}),[Q,Z]=a([]);l(()=>{Z(e=>{const t=((e,t)=>$(((e,t)=>e.clusters.filter(({clusterId:e})=>t.includes(e)))(e,t)))(i,c);return t.map(t=>{const a=e?.find(e=>e.clusterId===t.clusterId);return a??t})})},[i,c]);const{formDiff:_,isFormDirty:ee}=t(()=>{const e=((e,t,a)=>{const l={};return e.forEach(e=>{e.namespaces.forEach(n=>{const o=t.find(t=>t.clusterId===e.clusterId)?.namespaces.find(e=>e.name===n.name),s=n.selected||!1;if(s!==o?.selected){l[e.clusterId]||(l[e.clusterId]=[]);const t={namespace:n.name,selected:s,currentStreamName:a};if(s)l[e.clusterId]=[t];else{l[e.clusterId].push(t);const s=Oe(o,n,a);s.length>0&&l[e.clusterId].push(...s)}}else{const t=Oe(o,n,a);t.length>0&&(l[e.clusterId]||(l[e.clusterId]=[]),l[e.clusterId].push(...t))}})}),l})(Q,i.clusters,M);return{formDiff:e,isFormDirty:Object.keys(e).length>0}},[Q,i,M]),te=n(({clusterId:e,workloadId:t,boolean:a})=>{Z(l=>{const n=$(l),o=n.findIndex(t=>t.clusterId===e);if(-1===o)return n;const s=n[o].namespaces.findIndex(e=>e.name===t.namespace);if(-1===s)return n;if(t.kind&&t.name){const e=n[o].namespaces[s].workloads.findIndex(e=>e.name===t.name&&e.kind===t.kind);if(-1===e)return n;const l="boolean"==typeof a?a:!n[o].namespaces[s].workloads[e].selected;n[o].namespaces[s].workloads[e].selected=l,l?n[o].namespaces[s].workloads.every(e=>e.selected)&&(n[o].namespaces[s].selected=!0):n[o].namespaces[s].selected=!1}else{const e="boolean"==typeof a?a:!n[o].namespaces[s].selected;n[o].namespaces[s].selected=e}return n})},[]),ae=n(({clusterId:e,namespaceName:t,boolean:a})=>{Z(l=>{const n=$(l);return n.forEach((l,o)=>{e&&l.clusterId!==e||l.namespaces.forEach(({name:e,workloads:l},s)=>{t&&e!==t||(n[o].namespaces[s].selected=a,l.forEach((e,t)=>{n[o].namespaces[s].workloads[t].selected=a}))})}),n})},[]),le=()=>{G(!1),o()};return e.createElement(S,{isOpen:!0,hideOverlay:!q,width:De,header:{icon:re,title:"Manage Sources",onClose:o,onCloseDisabled:q}},q?e.createElement(I,{$height:"calc(100vh - 136px)"},e.createElement(Ve,null,e.createElement(A,{title:"Creating Sources...",titleSize:u.S,subTitle:"This may take a few moments while sources are being created.",subTitleSize:u.XXXS,withGradient:!0,withSpinner:!0,prettySpinner:!0,percentage:w[R.BulkInstrumenting]?.percentage||0}))):e.createElement(ze,null,e.createElement(Ne,null,e.createElement(P,{icon:ce,title:"Selected Clusters",badge:{label:c.length}}),e.createElement(T,{width:"300px",value:O,onChange:W,segment:{options:[{label:"Namespace",value:x.Namespace},{label:"Source",value:x.Source}],selected:j,setSelected:F}}),e.createElement(r,{$gap:8},e.createElement(d,{size:u.XXXS,color:h.v2.colors.silver[200],nowrap:!0},"Show only:"),e.createElement(f,{size:y.S,label:"Selected",value:U.showOnlySelected,onChange:e=>E(t=>({...t,showOnlySelected:e}))}))),e.createElement(Le,null,e.createElement(Te,{formData:Q,handleSourceChange:te,handleSelectAll:ae,selectedArea:{value:X,setValue:J},searchText:j===x.Namespace?O:"",filters:U}),e.createElement(Pe,{formData:Q,handleSourceChange:te,handleSelectAll:ae,selectedArea:{value:X,setValue:J},searchText:j===x.Source?O:"",filters:U}))),e.createElement(Me,null,q?null:B?e.createElement(D,{fullWidth:!0,status:g.Error,message:B}):ee?e.createElement(D,{fullWidth:!0,status:g.Info,message:'The values don\'t reflect the current configuration of the selected clusters.\n"Apply" will override the current configurations.'}):ee?null:e.createElement(D,{fullWidth:!0,status:g.Success,message:"The values reflect the current configuration of the selected cluster."}),e.createElement(r,{$gap:8},e.createElement("div",{style:{width:"150px"}},e.createElement(z,{fullWidth:!0,variant:N.Secondary,label:"Cancel",onClick:()=>ee?G(!0):le(),disabled:!ee||q})),e.createElement("div",{style:{width:"150px"}},e.createElement(z,{fullWidth:!0,variant:N.Primary,label:"Save",onClick:async()=>{Y(!0);const e=await m(_);V(R.BulkInstrumenting),Y(!1),e?.error?K(e.error):(p([]),o())},disabled:!ee||q})))),e.createElement(L,{isOpen:H,onClose:()=>G(!1),onApprove:le}))},je="75vw",Fe=o.div`
|
|
52
56
|
display: flex;
|
|
53
57
|
flex-direction: column;
|
|
54
58
|
border-radius: 16px;
|
|
55
59
|
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
56
60
|
overflow: hidden;
|
|
57
|
-
`,
|
|
61
|
+
`,Ue=o.div`
|
|
58
62
|
display: flex;
|
|
59
63
|
gap: 12px;
|
|
60
64
|
padding: 16px;
|
|
61
|
-
background-color: ${({theme:e})=>e.v2.colors.silver[
|
|
65
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
|
|
62
66
|
position: sticky;
|
|
63
67
|
top: 0;
|
|
64
|
-
`,
|
|
68
|
+
`,Ee=o.div`
|
|
65
69
|
display: flex;
|
|
66
70
|
gap: 12px;
|
|
67
71
|
padding: 16px;
|
|
68
|
-
`,
|
|
72
|
+
`,He=o(i)`
|
|
69
73
|
width: ${({$width:e})=>e};
|
|
70
74
|
gap: 12px;
|
|
71
75
|
justify-content: space-between;
|
|
72
|
-
`,
|
|
76
|
+
`,Ge=o.div`
|
|
73
77
|
display: flex;
|
|
74
78
|
flex-direction: column;
|
|
75
79
|
padding: 12px;
|
|
@@ -80,7 +84,7 @@ import e,{useMemo as t,useState as a,useEffect as l,useCallback as n}from"react"
|
|
|
80
84
|
background-color: ${({theme:e})=>e.v2.colors.silver[900]};
|
|
81
85
|
overflow-y: auto;
|
|
82
86
|
overflow-x: hidden;
|
|
83
|
-
`,
|
|
87
|
+
`,qe=o.div`
|
|
84
88
|
display: flex;
|
|
85
89
|
align-items: center;
|
|
86
90
|
gap: 12px;
|
|
@@ -91,13 +95,13 @@ import e,{useMemo as t,useState as a,useEffect as l,useCallback as n}from"react"
|
|
|
91
95
|
&:hover {
|
|
92
96
|
background-color: ${({theme:e})=>e.v2.colors.silver[600]};
|
|
93
97
|
}
|
|
94
|
-
`,
|
|
98
|
+
`,Ye=o.div`
|
|
95
99
|
display: flex;
|
|
96
100
|
align-items: center;
|
|
97
101
|
justify-content: flex-end;
|
|
98
102
|
gap: 16px;
|
|
99
103
|
padding: 0 12px;
|
|
100
|
-
`,
|
|
104
|
+
`,Be=({onClose:n,connections:o,selectedConnectionIds:i,setSelectedConnectionIds:m,getConnectionRemoteConfig:b,onApply:w})=>{const C=s(),[k,v]=a(""),[x,$]=a({showOnlySelected:!1}),I=t(()=>o.filter(e=>(!k||e.name.toLowerCase().includes(k.toLowerCase()))&&(!x.showOnlySelected||i.includes(e.id))),[o,i.length,k,x]),R=e=>{m(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[O,W]=a(!1),[j,F]=a(!1),[U,E]=a(void 0),[H,G]=a(!1),[q,Y]=a(void 0),{formData:B,handleFormChange:K,areFormValuesEqual:X,resetFormData:J}=V(q||{automaticRollout:!0}),{isFormDirty:Q,isFormMatch:Z}=t(()=>({isFormDirty:i.length>1||void 0!==q&&!X(q,B),isFormMatch:1===i.length&&void 0!==q&&X(q,B)}),[i.length,q,B]);l(()=>{1===i.length?(async e=>{if(H)return;G(!0);const t=await b(e);if(t){const e={automaticRollout:!t.rollout?.automaticRolloutDisabled};Y(e),J(e)}G(!1)})(i[0]):Y(void 0)},[i.length]);const _=()=>{W(!1),n()};return e.createElement(S,{isOpen:!0,hideOverlay:!0,width:je,header:{icon:de,title:"Cluster Configuration",onClose:n}},e.createElement(Fe,null,e.createElement(Ue,null,e.createElement(P,{icon:ce,title:"Selected Clusters",badge:{label:i.length}}),e.createElement(T,{width:"300px",placeholder:"Search by cluster name",value:k,onChange:v}),e.createElement(r,{$gap:8},e.createElement(d,{size:u.XXXS,color:C.v2.colors.silver[200],nowrap:!0},"Show only:"),e.createElement(f,{size:y.S,label:"Selected",value:x.showOnlySelected,onChange:e=>$(t=>({...t,showOnlySelected:e}))}))),e.createElement(Ee,null,e.createElement(He,{$width:"40%"},e.createElement(r,{$padding:"0 12px",$justifyContent:"space-between"},e.createElement(r,{$gap:8},e.createElement(d,{size:u.XS},"Clusters"),e.createElement(p,{label:o.length,status:h.Unknown})),e.createElement(r,{$gap:8},e.createElement(d,{size:u.XXXS,color:C.v2.colors.silver[200],align:"right"},"Selected clusters"),e.createElement(p,{label:`${i.length}/${o.length}`,status:h.Unknown}))),e.createElement(Ge,{$borderRadius:"16px 0 0 16px"},I.map(t=>e.createElement(qe,{key:t.id,onClick:()=>R(t.id)},e.createElement(c,{value:i.includes(t.id),onChange:()=>R(t.id)}),e.createElement(d,{size:u.XS},t.name))))),e.createElement(He,{$width:"60%"},e.createElement(r,{$padding:"0 12px"},e.createElement(d,{size:u.XS},"Configurations")),e.createElement(Ge,{$borderRadius:"0 16px 16px 0",$gap:12},H?e.createElement(M,null):e.createElement(f,{label:"Automatic Rollout "+(B.automaticRollout?"Enabled":"Disabled"),tooltip:"Odigos automatically triggers a one-time rollout for workloads when instrumenting or uninstrumenting, ensuring that changes are applied without requiring manual intervention. When automatic rollout is enabled, Odigos will proactively restart workloads as needed to apply updated instrumentation. Users do not need to manually trigger rollouts after adding or removing sources. Any new pods created after enabling or disabling the agent (via automatic rollout, autoscaling, etc.) will still have the agent injected, regardless of this setting. When set to false, additional configurations related to automated rollouts or rollbacks take effect.",value:B.automaticRollout,onChange:e=>K("automaticRollout",e)}))))),e.createElement(Ye,null,H?e.createElement(A,{icon:ue,title:"Fetching Configuration...",titleSize:u.XXS,withGradient:!0}):j?e.createElement(A,{icon:ue,title:"Applying Configurations...",titleSize:u.XXS,withGradient:!0}):U?e.createElement(D,{fullWidth:!0,status:g.Error,message:U}):Q?e.createElement(D,{fullWidth:!0,status:g.Info,message:'The values don\'t reflect the current configuration of the selected clusters.\n"Apply" will override the current configurations.'}):Z?e.createElement(D,{fullWidth:!0,status:g.Success,message:"The values reflect the current configuration of the selected cluster."}):null,e.createElement(r,{$gap:8},e.createElement("div",{style:{width:"150px"}},e.createElement(z,{fullWidth:!0,variant:N.Secondary,label:"Cancel",onClick:()=>Q?W(!0):_(),disabled:j})),e.createElement("div",{style:{width:"150px"}},e.createElement(z,{fullWidth:!0,variant:N.Primary,label:"Save",onClick:async()=>{F(!0);const e=await w(i,B);F(!1),e?.error?E(e.error):(m([]),n())},disabled:!Q||j})))),e.createElement(L,{isOpen:O,onClose:()=>W(!1),onApprove:_}))};var Ke,Xe;!function(e){e.BulkConfig="bulk-config",e.BulkSource="bulk-source",e.BulkDestination="bulk-destination",e.BulkAction="bulk-action",e.BulkInstrumentationRule="bulk-instrumentation-rule",e.Delete="delete"}(Ke||(Ke={})),function(e){e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"}(Xe||(Xe={}));const Je=[{key:Xe.Name,label:"Name"},{key:Xe.Type,label:"Type",textAlign:"right"},{key:Xe.Status,label:"Status"},{key:Xe.OdigosVersion,label:"Odigos Version"},{key:Xe.ConnectedSince,label:"Connected Since"},{key:Xe.LastActivity,label:"Last Activity"}],Qe=(e,t)=>{const a=e.find(e=>e.key===Xe.Id)?.rawValue;a&&t(a.toString())},Ze=({tableRowsMaxHeight:o,connections:i,getConnections:r,onClickConnection:c,deleteConnection:d,getConnectionRemoteConfig:u,applyConfigurations:m,getAllClusterSnapshots:b,persistSources:f})=>{const y=s(),{formatTimeAgo:w}=O(),[C,k]=a(!1),[v,x]=a(i||[]),[$,S]=a(!1),[I,A]=a(null),R=n(async()=>{try{k(!0),x(await r()??[])}catch(e){}finally{k(!1)}},[]),P=n(async()=>{if(b)try{S(!0),A(await b()??null)}catch(e){}finally{S(!1)}},[]);l(()=>{v.length||R()},[v.length,R]),l(()=>{I||P()},[I,P]);const[T,D]=a(""),[z,L]=a(null),[V,M]=a([]),K=t(()=>v.filter(e=>e.status===g.Success),[v]),X=t(()=>v.filter(e=>!T||e.name.toLowerCase().includes(T.toLowerCase())).map(t=>({cells:[{key:Xe.Id,rawValue:t.id},{key:Xe.Name,rawValue:t.name},{key:Xe.Type,rawValue:t.type},{key:Xe.Status,rawValue:t.status,component:()=>(t=>{const a=t===g.Success?"Connection live":"Connection lost",l=t===g.Success?he:be;return e.createElement(p,{status:t,label:a,leftIcon:l})})(t.status)},{key:Xe.OdigosVersion,rawValue:t.odigosVersion},{key:Xe.ConnectedSince,rawValue:t.connectedAt?w(t.connectedAt):"-"},{key:Xe.LastActivity,rawValue:t.lastSeenAt?w(t.lastSeenAt):"-"}],onClick:t.status===g.Success?()=>c(t):void 0,isSelected:V.includes(t.id),onSelect:()=>M(e=>Array.from(new Set([...e,t.id]))),onDeselect:()=>M(e=>e.filter(e=>e!==t.id)),hideCheckbox:t.status!==g.Success})),[v,V,T]);return e.createElement(W,null,e.createElement(j,{richTitle:{icon:pe,title:"Connections",badge:{label:v.length.toString(),status:h.Unknown}},search:{placeholder:"Search by cluster name",value:T,onChange:e=>D(e),width:"300px"},actions:[{id:F(),type:U.Button,buttonProps:{variant:N.Secondary,size:E.S,leftIcon:ge,onClick:async()=>{await R(),await P()},disabled:C||$}}]},e.createElement(H,{variant:G.Pretty,maxHeight:o,headerBackgroundColor:y.v2.colors.silver[1e3],isLoading:C,withCheckboxes:!0,columns:Je,rows:X,rowActionsPushRightPosition:z?`calc(${z===Ke.BulkConfig?je:De} - 24px)`:void 0,getRowActions:({cells:e})=>(e=>e.find(e=>e.key===Xe.Status)?.rawValue===g.Success)(e)?[I&&f?{id:F(),tooltip:"Manage Sources",rightIcon:re,onClick:async()=>{Qe(e,e=>{M([e]),L(Ke.BulkSource)})}}:null,u&&m?{id:F(),tooltip:"Edit Configuration",rightIcon:de,onClick:async()=>{Qe(e,e=>{M([e]),L(Ke.BulkConfig)})}}:null]:[{id:F(),label:"Delete Connection",rightIcon:me,onClick:()=>{Qe(e,e=>{M([e]),L(Ke.Delete)})}}]}),z===Ke.BulkConfig&&u&&m&&e.createElement(Be,{onClose:()=>L(null),connections:K,selectedConnectionIds:V,setSelectedConnectionIds:M,getConnectionRemoteConfig:u,onApply:m}),z===Ke.BulkSource&&I&&f&&e.createElement(We,{onClose:()=>L(null),snapshots:I,selectedConnectionIds:V,setSelectedConnectionIds:M,persistSources:async e=>{if(!f)return{error:"Persist sources function is not defined"};const t=await f(e);return t?.error||await P(),t}}),e.createElement(q,{target:"connection",isOpen:z===Ke.Delete,onClose:()=>{M([]),L(null)},onApprove:async()=>{const e=V[0];e&&(await d(e),await R())}}),e.createElement(Y,{isOpen:!!V.length&&!z,richTitle:{icon:ce,title:"Selected Clusters",badge:{label:V.length}},actions:[{id:F(),type:U.Button,buttonProps:{variant:N.Text,size:E.S,label:"Cancel",onClick:()=>M([])}},I&&f?{id:F(),type:U.ButtonDropData,buttonProps:{variant:N.Secondary,size:E.S,label:"Add Component",onClick:e=>L(e)},dropDataProps:{alignX:B.Left,items:[{id:Ke.BulkSource,label:"Add Source",icon:re}]}}:null,u&&m?{id:F(),type:U.Button,buttonProps:{variant:N.Primary,size:E.S,label:"Manage Configurations",rightIcon:de,onClick:()=>L(Ke.BulkConfig)}}:null]})))},_e=o.div`
|
|
101
105
|
display: flex;
|
|
102
106
|
align-items: center;
|
|
103
107
|
justify-content: space-between;
|
|
@@ -109,10 +113,10 @@ import e,{useMemo as t,useState as a,useEffect as l,useCallback as n}from"react"
|
|
|
109
113
|
&:hover {
|
|
110
114
|
background: ${({theme:e})=>e.v2.colors.silver[700]};
|
|
111
115
|
}
|
|
112
|
-
`,
|
|
113
|
-
animation-name: ${
|
|
114
|
-
`,
|
|
116
|
+
`,et=o.div`
|
|
117
|
+
animation-name: ${K.animations.fade.in};
|
|
118
|
+
`,tt=({pod:n,getExtendedPodInfo:o,onClose:s})=>{const{formatTimeAgo:r}=O(),[c,u]=a(null),[p,m]=a(!1);l(()=>{n?o(n.namespace,n.name).then(e=>u(e??null)):(u(null),m(!1))},[n]);const h=t(()=>[{id:F(),title:"Node",label:c?.node??"-",withCopy:!0},{id:F(),title:"Status",badge:{status:X(c?.status),label:c?.status??"-"}}],[c]),b=t(()=>c?.containers?.map(e=>({id:F(),items:[{id:F(),title:"Container",label:e.name??"-"},{id:F(),title:"Status",label:e.startedAt?`${e.status} (since ${r(e.startedAt)})`:e.status},{id:F(),title:"Ready",badge:{status:e.ready?g.Success:g.Error,leftIcon:e.ready?ce:fe,label:e.ready?"True":"False",invertColors:!0}},{id:F(),title:"Started",badge:{status:e.started?g.Success:g.Error,leftIcon:e.started?ce:fe,label:e.started?"True":"False",invertColors:!0}},{id:F(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:F(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:F(),title:"Restarts",label:e.restarts.toString()},{id:F(),title:"State Reason",label:e.stateReason??"-"},{id:F(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:F(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[c]);return e.createElement(S,{isOpen:!!n,header:{icon:ye,title:"Pod Information",onClose:s}},c?null:e.createElement(I,null,e.createElement(M,null)),c?e.createElement(e.Fragment,null,e.createElement(j,{richTitle:{icon:ye,title:c.name,withCopy:!0}},e.createElement(i,{$gap:24},e.createElement(J,{cellsPerRow:2,items:h}),b.length>0&&e.createElement(i,{$gap:12},e.createElement(_e,{onClick:()=>m(e=>!e)},e.createElement(d,null,"Containers Overview"),e.createElement(Q,{icon:p?we:Ce})),p&&b.map(({id:t,items:a})=>e.createElement(et,{key:t},e.createElement(J,{cellsPerRow:2,items:a})))))),e.createElement(j,{richTitle:{icon:ke,title:"Kubectl Commands"}},e.createElement(i,{$gap:12},e.createElement(Z,{value:`kubectl get pod ${c.name} -n ${c.namespace} -o yaml`}),e.createElement(Z,{value:`kubectl describe pod ${c.name} -n ${c.namespace}`}),e.createElement(Z,{value:`kubectl logs ${c.name} -n ${c.namespace}`}))),e.createElement(_,{yaml:c.manifestYAML})):null)};var at;!function(e){e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.Age="age",e.DockerImage="dockerImage"}(at||(at={}));const lt=[{key:at.PodName,label:"Pod Name"},{key:at.Status,label:"Status"},{key:at.Restarts,label:"Restarts",textAlign:"right"},{key:at.NodeName,label:"Node Name"},{key:at.Age,label:"Age",textAlign:"right"},{key:at.DockerImage,label:"Docker Image",textAlign:"right"}],nt=({isLoading:l,tableRowsMaxHeight:n,pods:o,getExtendedPodInfo:i})=>{const r=s(),{formatTimeAgo:c}=O(),[d,u]=a(null),g=t(()=>o.map(t=>({onClick:()=>u(t),cells:[{key:at.PodName,rawValue:t.name},{key:at.Status,rawValue:t.status,component:()=>{return a=t.status,e.createElement(p,{status:X(a),label:a});var a}},{key:at.Restarts,rawValue:t.restartsCount.toString()},{key:at.NodeName,rawValue:t.nodeName},{key:at.Age,rawValue:c(t.creationTimestamp)},{key:at.DockerImage,rawValue:t.image}]})),[o,r]);return e.createElement(j,{richTitle:{icon:ye,title:"Pods"}},e.createElement(H,{variant:G.Data,maxHeight:n,isLoading:l,columns:lt,rows:g}),e.createElement(tt,{pod:d,getExtendedPodInfo:i,onClose:()=>u(null)}))};var ot;!function(e){e.Gateway="gateway",e.Node="node"}(ot||(ot={}));const st=[{value:ot.Gateway,label:"Gateway"},{value:ot.Node,label:"Node Collector"}],it=o.div`
|
|
115
119
|
display: flex;
|
|
116
120
|
align-items: center;
|
|
117
121
|
justify-content: space-between;
|
|
118
|
-
`,
|
|
122
|
+
`,rt=({selectedTab:a,setSelectedTab:l,onClickDownloadDiagnose:n,onClickRefresh:o,loading:s,disabled:i})=>{const c=t(()=>{const e=[];return n&&e.push({id:F(),type:U.Button,buttonProps:{label:"Download Diagnose",leftIcon:ve,size:E.S,variant:N.Text,onClick:n,disabled:i}}),o&&e.push({id:F(),type:U.Button,buttonProps:{label:"Refresh",leftIcon:ge,size:E.S,variant:N.Text,onClick:o,disabled:i,loading:s}}),e},[n,o,i,s]);return e.createElement(it,null,e.createElement(r,{$gap:12},e.createElement(r,{$gap:8},e.createElement(xe,{size:32}),e.createElement(d,{size:u.M,weight:500},"Pipeline Collectors")),e.createElement(ee,{options:st,selected:a,setSelected:l,disabled:i})),e.createElement(te,{actions:c}))},ct=({isOpen:t,onClose:a,title:l,yaml:n})=>e.createElement(S,{isOpen:t,header:{icon:$e,title:l,onClose:a}},e.createElement(_,{yaml:n}));var dt;!function(e){e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"}(dt||(dt={}));const ut=({richTitle:t,statusCard:l,textCards:n,manifestYaml:o,configMapYaml:s})=>{const[i,c]=a(null);return e.createElement(j,{richTitle:t,actions:[{id:F(),type:U.ButtonDropData,buttonProps:{variant:N.Secondary,size:E.S,label:"View YAML",onClick:e=>c(e)},dropDataProps:{items:[{id:dt.ManifestYaml,label:t.title,icon:Se},{id:dt.ConfigMapYaml,label:"ConfigMap",icon:Se}]}}]},e.createElement(r,{$gap:16},e.createElement(ae,{...l}),n.map(t=>e.createElement(le,{key:t.title,...t}))),e.createElement(ct,{isOpen:i===dt.ManifestYaml,onClose:()=>c(null),title:t.title,yaml:o}),e.createElement(ct,{isOpen:i===dt.ConfigMapYaml,onClose:()=>c(null),title:"ConfigMap",yaml:s}))},pt=e=>{switch(e){case ne.Healthy:return"All desired replicas are updated, available, and ready";case ne.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case ne.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case ne.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case ne.Down:return"No available replicas";case ne.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}},gt=({tableRowsMaxHeight:o,getGatewayInfo:s,getGatewayPods:i,getNodeCollectorInfo:r,getNodeCollectorPods:c,getExtendedPodInfo:d})=>{const{formatTimeAgo:u}=O(),{isVersionSupported:p,version:m}=oe(1.12),[b,f]=a(!1),[y,w]=a(ot.Gateway),[C,k]=a(null),[v,x]=a([]),[$,S]=a(null),[I,A]=a([]),R=n(async()=>{f(!0);try{switch(y){case ot.Gateway:k(await s()??null),x(await i()??[]);break;case ot.Node:S(await r()??null),A(await c()??[])}}catch(e){}f(!1)},[y]);l(()=>{R()},[R]);const P=t(()=>(e=>{switch(e){case ot.Gateway:return"Deployment";case ot.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(y),[y]),T=t(()=>((e,t,a,l)=>{const n={status:h.Disabled,label:"No rollouts yet"};let o=!1,s=null;switch(e){case ot.Gateway:o=t?.rolloutInProgress??!1,s=t?.lastRolloutAt??null;break;case ot.Node:o=a?.rolloutInProgress??!1,s=a?.lastRolloutAt??null;break;default:return n}return o?{status:g.Info,label:"Rollout in progress",rightIcon:ge,useSecondaryTone:!0}:s?{status:h.Disabled,label:`Last Rollout: ${l(s)}`}:n})(y,C,$,u),[C,$,y,u]),D=t(()=>((e,t,a,l)=>{let n=l?g.Info:h.Unknown,o=l?"Loading":ne.Unknown,s=l?"Fetching data...":pt(ne.Unknown);switch(e){case ot.Gateway:n=t?.status?X(t?.status):n,o=t?.status??o,s=t?.status?pt(t.status):s;break;case ot.Node:n=a?.status?X(a?.status):n,o=a?.status??o,s=a?.status?pt(a.status):s}return{status:n,title:o,description:s}})(y,C,$,b),[C,$,y,b]),z=t(()=>((e,t,a,l)=>{switch(e){case ot.Gateway:return[{title:"HPA Spec (Replicas)",cells:[{label:"Min.",value:t?.hpa?.min.toString()??"-",isLoading:l},{label:"Max.",value:t?.hpa?.max.toString()??"-",isLoading:l},{label:"Current",value:t?.hpa?.current.toString()??"-",isLoading:l},{label:"Desired",value:t?.hpa?.desired.toString()??"-",isLoading:l}]},{title:"Requests",cells:[{label:"CPU",value:t?.resources?.requests.cpu??"-",isLoading:l},{label:"Memory",value:t?.resources?.requests.memory??"-",isLoading:l}]},{title:"Limits",cells:[{label:"CPU",value:t?.resources?.limits.cpu??"-",isLoading:l},{label:"Memory",value:t?.resources?.limits.memory??"-",isLoading:l}]},{title:"Docker Image",cells:[{value:t?.imageVersion??"-",isLoading:l}]}];case ot.Node:return[{title:"Nodes",cells:[{label:"Desired",value:a?.nodes?.desired.toString()??"-",isLoading:l},{label:"Ready",value:a?.nodes?.ready.toString()??"-",isLoading:l}]},{title:"Requests",cells:[{label:"CPU",value:a?.resources?.requests.cpu??"-",isLoading:l},{label:"Memory",value:a?.resources?.requests.memory??"-",isLoading:l}]},{title:"Limits",cells:[{label:"CPU",value:a?.resources?.limits.cpu??"-",isLoading:l},{label:"Memory",value:a?.resources?.limits.memory??"-",isLoading:l}]},{title:"Docker Image",cells:[{value:a?.imageVersion??"-",isLoading:l}]}];default:return[]}})(y,C,$,b),[C,$,y,b]),N=t(()=>(y===ot.Gateway?C?.manifestYAML:$?.manifestYAML)??"",[C,$,y]),L=t(()=>(y===ot.Gateway?C?.configMapYAML:$?.configMapYAML)??"",[C,$,y]),V=t(()=>y===ot.Gateway?v:I,[v,I,y]);return e.createElement(W,null,e.createElement(rt,{disabled:!p,loading:b,selectedTab:y,setSelectedTab:w,onClickDownloadDiagnose:void 0,onClickRefresh:R}),e.createElement(se,null,e.createElement(ut,{richTitle:{icon:$e,title:P,badge:T},statusCard:D,textCards:z,manifestYaml:N,configMapYaml:L}),e.createElement(nt,{isLoading:b,tableRowsMaxHeight:o,pods:V,getExtendedPodInfo:d}),!p&&e.createElement(ie,{minSupportedVersion:1.12,currentVersion:m||""})))};export{Ze as CentralConnections,gt as PipelineCollectors};
|