@mxtommy/kip 4.0.7 → 4.0.8-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,50 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ if ! command -v jq >/dev/null 2>&1; then
5
+ echo "Error: jq is required (brew install jq)" >&2
6
+ exit 1
7
+ fi
8
+
9
+ if [[ $# -lt 1 ]]; then
10
+ echo "Usage: $0 <package-name> [deprecation-message] [channel]" >&2
11
+ echo "Example: $0 mypkg \"Deprecated: use >=1.2.0\" beta" >&2
12
+ exit 1
13
+ fi
14
+
15
+ PKG="$1"; shift || true
16
+ MSG="${1-Deprecated prerelease: please install a stable version}"; [[ $# -gt 0 ]] && shift || true
17
+ CHANNEL="${1-beta}"
18
+
19
+ # Get all published versions
20
+ versions_json=$(npm view "$PKG" versions --json 2>/dev/null || true)
21
+ if [[ -z "${versions_json:-}" || "${versions_json}" == "null" ]]; then
22
+ echo "No versions found or package not accessible: $PKG" >&2
23
+ exit 1
24
+ fi
25
+
26
+ # Select prereleases that contain -<channel>, e.g. -beta
27
+ VERSIONS=$(printf '%s' "$versions_json" \
28
+ | jq -r --arg ch "$CHANNEL" 'if type=="array" then . else [.] end | .[] | select(test("-(\($ch))","i"))')
29
+
30
+ if [[ -z "${VERSIONS:-}" ]]; then
31
+ echo "No $CHANNEL versions found for $PKG."
32
+ exit 0
33
+ fi
34
+
35
+ echo "Found $CHANNEL versions for $PKG:"
36
+ printf ' %s\n' $VERSIONS
37
+
38
+ read -r -p "Deprecate these versions with message: \"$MSG\"? [y/N] " ans
39
+ case "$ans" in
40
+ y|Y|yes|YES) ;;
41
+ *) echo "Aborted."; exit 0 ;;
42
+ esac
43
+
44
+ set -x
45
+ for v in $VERSIONS; do
46
+ npm deprecate "$PKG@$v" "$MSG"
47
+ done
48
+ set +x
49
+
50
+ echo "Done."
@@ -1 +0,0 @@
1
- import{d as D}from"./chunk-QLTN6G6E.js";import{a as f,d as I,e as S,m as b}from"./chunk-XDPHEQEO.js";import{$c as E,Ic as A,Nc as P,Oc as m,Sc as M,Wc as j,a as g,b as v,c as C,ca as u,cc as p,ec as h,f as R,ga as a,j as w,l as y,pa as N,ra as l,t as _}from"./chunk-OB3QLUH6.js";var T=[{id:null,name:"Dashboard 1",icon:"dashboard-dashboard",configuration:[{w:24,h:24,id:"d1d58e6f-f8b4-4a72-9597-7f92aa6776fc",selector:"widget-host2",input:{widgetProperties:{type:"widget-tutorial",uuid:"d1d58e6f-f8b4-4a72-9597-7f92aa6776fc"}},x:0,y:0}],collapseSplitShell:!1}];var x=(()=>{class i{_settings=a(b);_router=a(j);dashboards=l([],{equal:S});activeDashboard=l(0);_widgetAction=new y(null);widgetAction$=this._widgetAction.asObservable();isDashboardStatic=l(!0);layoutEditSaved=l(0);layoutEditCanceled=l(0);constructor(){let e=this._settings.getDashboardConfig();if(!e||e.length===0){console.warn("[Dashboard Service] No dashboards found in settings, creating blank dashboard");let t=T.map(r=>v(g({},r),{id:f.create()}));this.dashboards.set([...t])}else this.dashboards.set(this._settings.getDashboardConfig());h(()=>{let t=this.dashboards();this._settings.saveDashboards(t)})}toggleStaticDashboard(){this.isDashboardStatic.set(!this.isDashboardStatic())}add(e,t,r,s){let n=0;return this.dashboards.update(o=>{let c=[...o,{id:f.create(),name:e,icon:r??"dashboard-dashboard",configuration:t,collapseSplitShell:s??!1}];return n=c.length-1,c}),n}update(e,t,r,s){this.dashboards.update(n=>n.map((o,c)=>c===e?v(g({},o),{name:t,icon:r??"dashboard-dashboard",collapseSplitShell:s??!1}):o))}delete(e){this.dashboards.update(t=>t.filter((r,s)=>s!==e)),this.dashboards().length===0?(this.add("Dashboard "+(this.dashboards().length+1),[]),this.activeDashboard.set(0)):this.activeDashboard()>this.dashboards().length-1&&this.activeDashboard.set(this.dashboards().length-1)}duplicate(e,t,r,s){if(e<0||e>=this.dashboards().length)return console.error(`[Dashboard Service] Invalid itemIndex: ${e}`),-1;let n=this.dashboards()[e],o=I(n);o.id=f.create(),o.name=t,o.icon=r||"dashboard-dashboard",o.collapseSplitShell=s??!1,Array.isArray(o.configuration)?o.configuration.forEach(d=>{d&&d.input?.widgetProperties?(d.id=f.create(),d.input.widgetProperties.uuid=d.id):console.error("Dashboard Service] Widget configuration is missing required properties:",d)}):(console.error("Dashboard Service] Dashboard configuration is not an array:",o.configuration),o.configuration=[]);let c=-1;return this.dashboards.update(d=>{let k=[...d,o];return c=k.length-1,k}),c}updateConfiguration(e,t){this.dashboards.update(r=>r.map((s,n)=>n===e?S(s.configuration,t)?s:v(g({},s),{configuration:t}):s))}previousDashboard(){this.activeDashboard()+1>this.dashboards().length-1?this.activeDashboard.set(0):this.activeDashboard.set(this.activeDashboard()+1)}nextDashboard(){this.activeDashboard()-1<0?this.activeDashboard.set(this.dashboards().length-1):this.activeDashboard.set(this.activeDashboard()-1)}setActiveDashboard(e){e!==this.activeDashboard()&&(e>=0&&e<this.dashboards().length?this.activeDashboard.set(e):console.error(`[Dashboard Service] Invalid dashboard ID: ${e}`))}navigateToActive(){this._router.navigate(["/dashboard",this.activeDashboard()])}navigateTo(e){e>=0&&e<this.dashboards().length?this._router.navigate(["/dashboard",e]):console.error(`[Dashboard Service] Invalid dashboard ID: ${e}`)}navigateToNextDashboard(){let e=null;this.activeDashboard()-1<0?e=this.dashboards().length-1:e=this.activeDashboard()-1,this._router.navigate(["/dashboard",e])}navigateToPreviousDashboard(){let e=null;this.activeDashboard()+1>=this.dashboards().length?e=0:e=this.activeDashboard()+1,this._router.navigate(["/dashboard",e])}deleteWidget(e){this._widgetAction.next({id:e,operation:"delete"})}duplicateWidget(e){this._widgetAction.next({id:e,operation:"duplicate"})}setStaticDashboard(e){this.isDashboardStatic.set(e)}notifyLayoutEditSaved(){this.layoutEditSaved.update(e=>e+1)}notifyLayoutEditCanceled(){this.layoutEditCanceled.update(e=>e+1)}static \u0275fac=function(t){return new(t||i)};static \u0275prov=u({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var $={name:"@mxtommy/kip",version:"4.0.7",description:"An advanced and versatile marine instrumentation package to display Signal K data.",license:"MIT",author:{name:"Thomas St.Pierre, David Godin"},contributors:[{name:"David Godin",email:"godind@hotmail.com"},{name:"Thomas St.Pierre",email:"thomas@samoht.ca"}],homepage:"https://github.com/mxtommy/Kip",bugs:"https://github.com/mxtommy/Kip/issues",repository:{type:"git",url:"git+https://github.com/mxtommy/Kip.git"},keywords:["signalk-webapp","signalk-category-instruments","signalk-category-notifications","signalk-node-server-plugin","signal k","signalk","instruments","dashboard","marine","nmea"],signalk:{appIcon:"assets/icon-72x72.png",displayName:"KIP Instrument MFD"},main:"plugin/index.js","signalk-plugin-enabled-by-default":!0,scripts:{test:"CI=1 ng test --watch=false","test:interactive":"ng test","test:headless":"CI=1 ng test --browsers=ChromeHeadless --watch=false",lint:"ng lint",dev:"ng serve --configuration=dev --serve-path=/@mxtommy/kip/","build:plugin":"tsc -p ./kip-plugin/tsconfig.plugin.json","build:dev":"ng build --configuration=dev","build:prod":"ng build --configuration=production","build:all":"npm run build:plugin && npm run build:prod",e2e:"ng e2e","generate:widget":"npx schematics ./tools/schematics/collection.json:create-host2-widget --dry-run=false"},schematics:"tools/schematics/collection.json",devDependencies:{"@angular-devkit/schematics-cli":"^20.1.6","@angular-devkit/build-angular":"^20.1.6","@angular/animations":"20.1.7","@angular/build":"^20.1.6","@angular/cdk":"20.1.6","@angular/cli":"^20.1.6","@angular/common":"20.1.7","@angular/compiler":"20.1.7","@angular/compiler-cli":"20.1.7","@angular/core":"20.1.7","@angular/forms":"20.1.7","@angular/language-service":"20.1.7","@angular/material":"20.1.6","@angular/platform-browser":"20.1.7","@angular/platform-browser-dynamic":"20.1.7","@angular/router":"20.1.7","@godind/ng-canvas-gauges":"^6.2.1","@robloche/chartjs-plugin-streaming":"^3.1.0","@types/canvas-gauges":"^2.1.8","@types/howler":"^2.2.10","@types/jasmine":"~3.6.0","@types/jasminewd2":"^2.0.9","@types/js-quantities":"^1.6.6","@types/lodash-es":"^4.17.9","@types/node":"^24.1.0","@zakj/no-sleep":"^0.13.5","angular-eslint":"20.1.1","chart.js":"^4.4.9","chartjs-adapter-date-fns":"^3.0.0","chartjs-plugin-annotation":"^3.0.1",codelyzer:"^6.0.0","compare-versions":"^6.1.1","core-js":"^3.13.1","date-fns":"^2.30.0",eslint:"^9.29.0",gridstack:"^12.3.3",howler:"^2.2.4","jasmine-core":"~4.0.1","jasmine-spec-reporter":"~5.0.0","js-quantities":"^1.8.0",karma:"^6.4.4","karma-spec-reporter":"^0.0.36","karma-chrome-launcher":"~3.1.0","karma-cli":"~2.0.0","karma-coverage":"^2.2.0","karma-jasmine":"~4.0.0","karma-jasmine-html-reporter":"^1.6.0","lodash-es":"^4.17.21","ng-packagr":"^20.0.1","ngx-markdown":"^20.0.0",prismjs:"^1.30.0",clipboard:"^2.0.11","ngx-resize-observer":"^3.1.0",protractor:"~7.0.0","pwa-asset-generator":"^8.1.1",rxjs:"^7.8.2",sass:"^1.49.9",screenfull:"^6.0.2",steelseries:"^2.0.9","ts-node":"^10.9.2",tslib:"^2.6.2",typescript:"^5.8.3","zone.js":"^0.15.1"},dependencies:{"@signalk/server-api":"^2.7.2"}};var L=(()=>{class i{_http=a(A);_settings=a(b);_dashboard=a(x);_data=a(D);_destroyRef=a(N);_displayName=m(this._settings.getInstanceNameAsO());_isRemoteControl=m(this._settings.getIsRemoteControlAsO());PLUGIN_URL=this._settings.signalkUrl.url+"/plugins/kip";KIP_UUID=this._settings.KipUUID;ACTIVE_SCREEN_PATH=`self.displays.${this.KIP_UUID}.activeScreen`;previousIsRemoteControl=!1;isRemoteScreenIdxCleared=!0;constructor(){let e=this.setActiveDashboard(this.KIP_UUID,null).then(()=>{console.log("[Remote Dashboards] Startup: cleared stale activeScreen (unconditional)")}).catch(t=>{console.warn("[Remote Dashboards] Startup: failed to clear stale activeScreen",t)});h(()=>{let t=this._isRemoteControl();if(!t&&!this.previousIsRemoteControl)return;let r=this._displayName(),s=this._dashboard.dashboards();p(()=>{this.previousIsRemoteControl=t;let n;if(!t)n=null;else{let o=s.map(k=>{var V=k,{configuration:c}=V,d=C(V,["configuration"]);return d});n={displayName:r,screens:o},this.isRemoteScreenIdxCleared=!1}this.shareScreens(this.KIP_UUID,n).then(()=>{console.log("[Remote Dashboards] Screen configuration shared")}).catch(o=>{console.error("[Remote Dashboards] Error sharing screen configuration:",o)})})}),h(()=>{let t=this._isRemoteControl(),r=this._dashboard.activeDashboard();p(()=>{t?this.setActiveDashboard(this.KIP_UUID,r).then(()=>{}).catch(s=>{console.error("[Remote Dashboards] Error sharing active dashboard:",s)}):this.isRemoteScreenIdxCleared||(this.setActiveDashboard(this.KIP_UUID,null).then(()=>{console.log("[Remote Dashboards] Disabled: Cleared active dashboard on server")}).catch(s=>{console.error("[Remote Dashboards] Error clearing active dashboard on server:",s)}),this.isRemoteScreenIdxCleared=!0)})}),e.finally(()=>this.setupRemoteControlListener())}setupRemoteControlListener(){this._settings.getIsRemoteControlAsO().pipe(P(this._destroyRef)).subscribe(e=>{e?this._data.subscribePath(this.ACTIVE_SCREEN_PATH,"default").pipe(P(this._destroyRef)).subscribe(t=>{if(t.data.value==null)return;let r=Number(t.data.value);!isNaN(r)&&r>=0&&r<this._dashboard.dashboards().length&&this._dashboard.activeDashboard()!==r&&(console.log(`[Remote Dashboards] Setting active dashboard to ${r} from remote update`),this._dashboard.navigateTo(r))}):this._data.unsubscribePath(this.ACTIVE_SCREEN_PATH)})}setActiveDashboard(e,t){return R(this,null,function*(){let r=t===null?null:{screenIdx:t};return _(this._http.put(`${this.PLUGIN_URL}/displays/${e}/activeScreen`,r))})}shareScreens(e,t){let r=t===null?null:g({},t);return _(this._http.put(`${this.PLUGIN_URL}/displays/${e}`,r))}static \u0275fac=function(t){return new(t||i)};static \u0275prov=u({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var De=(()=>{class i{MODE_PATH="self.environment.mode";configurableThemeColors=[{label:"Contrast",value:"contrast"},{label:"Blue",value:"blue"},{label:"Green",value:"green"},{label:"Orange",value:"orange"},{label:"Yellow",value:"yellow"},{label:"Pink",value:"pink"},{label:"Purple",value:"purple"},{label:"Grey",value:"grey"}];snackbarAppNotifications=new w;cssThemeColorRoles$=new y(null);_cssThemeColorRoles=null;_settings=a(b);_data=a(D);_iconRegistry=a(E);_sanitizer=a(M);_remote=a(L);isNightMode=l(!1);_useAutoNightMode=m(this._settings.getAutoNightModeAsO(),{requireSync:!0});_theme=m(this._settings.getThemeNameAsO(),{requireSync:!0});_redNightMode=m(this._settings.getRedNightModeAsO(),{requireSync:!0});_environmentMode=m(this._data.subscribePath(this.MODE_PATH,"default"));previousEnvironmentMode=null;appVersion=l($.version);browserVersion=l("Unknown");osVersion=l("Unknown");constructor(){this._iconRegistry.addSvgIconSet(this._sanitizer.bypassSecurityTrustResourceUrl("assets/svg/icons.svg")),h(()=>{this._theme()==="light-theme"?document.body.classList.toggle("light-theme",this._theme()==="light-theme"):document.body.classList.remove("light-theme")}),h(()=>{let e=this._environmentMode().data.value;p(()=>{this.previousEnvironmentMode!==e&&(this.previousEnvironmentMode=e,this._useAutoNightMode()&&(this.isNightMode.set(e==="night"),this.toggleDayNightMode()))})}),h(()=>{let e=this._redNightMode();p(()=>{e?this.toggleDayNightMode():this.toggleDayNightMode()})}),this.readThemeCssRoleVariables(),this._cssThemeColorRoles=this.cssThemeColorRoles$.getValue(),this.browserVersion.set(this.getBrowserVersion()),this.osVersion.set(this.getOSVersion()),console.log("*********** KIP Version Information ***********"),console.log(`** App Version: ${this.appVersion()}`),console.log(`** Browser Version: ${this.browserVersion()}`),console.log(`** OS Version: ${this.osVersion()}`),console.log("***********************************************")}sendSnackbarNotification(e,t=1e4,r=!1,s="Dismiss"){this.snackbarAppNotifications.next({message:e,duration:t,silent:r,action:s})}getSnackbarAppNotifications(){return this.snackbarAppNotifications.asObservable()}readThemeCssRoleVariables(){let e=document.body,t=getComputedStyle(e),r={background:t.getPropertyValue("--mat-sys-background").trim(),cardColor:t.getPropertyValue("--kip-widget-card-background-color").trim(),blue:t.getPropertyValue("--kip-blue-color").trim(),blueDim:t.getPropertyValue("--kip-blue-dim-color").trim(),blueDimmer:t.getPropertyValue("--kip-blue-dimmer-color").trim(),green:t.getPropertyValue("--kip-green-color").trim(),greenDim:t.getPropertyValue("--kip-green-dim-color").trim(),greenDimmer:t.getPropertyValue("--kip-green-dimmer-color").trim(),grey:t.getPropertyValue("--kip-grey-color").trim(),greyDim:t.getPropertyValue("--kip-grey-dim-color").trim(),greyDimmer:t.getPropertyValue("--kip-grey-dimmer-color").trim(),orange:t.getPropertyValue("--kip-orange-color").trim(),orangeDim:t.getPropertyValue("--kip-orange-dim-color").trim(),orangeDimmer:t.getPropertyValue("--kip-orange-dimmer-color").trim(),pink:t.getPropertyValue("--kip-pink-color").trim(),pinkDim:t.getPropertyValue("--kip-pink-dim-color").trim(),pinkDimmer:t.getPropertyValue("--kip-pink-dimmer-color").trim(),purple:t.getPropertyValue("--kip-purple-color").trim(),purpleDim:t.getPropertyValue("--kip-purple-dim-color").trim(),purpleDimmer:t.getPropertyValue("--kip-purple-dimmer-color").trim(),contrast:t.getPropertyValue("--kip-contrast-color").trim(),contrastDim:t.getPropertyValue("--kip-contrast-dim-color").trim(),contrastDimmer:t.getPropertyValue("--kip-contrast-dimmer-color").trim(),yellow:t.getPropertyValue("--kip-yellow-color").trim(),yellowDim:t.getPropertyValue("--kip-yellow-dim-color").trim(),yellowDimmer:t.getPropertyValue("--kip-yellow-dimmer-color").trim(),port:t.getPropertyValue("--kip-port-color").trim(),starboard:t.getPropertyValue("--kip-starboard-color").trim(),zoneNominal:t.getPropertyValue("--kip-zone-nominal-color").trim(),zoneAlert:t.getPropertyValue("--kip-zone-alert-color").trim(),zoneWarn:t.getPropertyValue("--kip-zone-warn-color").trim(),zoneAlarm:t.getPropertyValue("--kip-zone-alarm-color").trim(),zoneEmergency:t.getPropertyValue("--kip-zone-emergency-color").trim()};this.cssThemeColorRoles$.next(r)}get cssThemeColors(){return this._cssThemeColorRoles}setBrightness(e,t=!1){let r=document.body;r.style.setProperty("--kip-nightModeBrightness",`${e}`);let s=t?" sepia(0.5) hue-rotate(-30deg)":"";r.style.setProperty("--kip-nightModeFilters",s)}toggleDayNightMode(){this.isNightMode()?this._redNightMode()?(document.body.classList.toggle("night-theme",!0),this.setBrightness(1,!1)):(this.setBrightness(this._settings.getNightModeBrightness(),!0),document.body.classList.remove("night-theme"),this._theme()==="light-theme"?document.body.classList.toggle("light-theme",this._theme()==="light-theme"):document.body.classList.remove("light-theme")):(document.body.classList.remove("night-theme"),this._theme()==="light-theme"&&document.body.classList.toggle("light-theme",this._theme()==="light-theme"),this.setBrightness(1,!1)),this.readThemeCssRoleVariables(),this._cssThemeColorRoles=this.cssThemeColorRoles$.getValue()}getBrowserVersion(){let e=navigator.userAgent,t="Unknown";return e.includes("Edg")?t=`Edge ${e.match(/Edg\/(\d+)/)?.[1]}`:e.includes("Chrome")&&!e.includes("Edg")&&!e.includes("Chromium")?t=`Chrome ${e.match(/Chrome\/(\d+)/)?.[1]}`:e.includes("Chromium")?t=`Chromium ${e.match(/Chromium\/(\d+)/)?.[1]}`:e.includes("Firefox")?t=`Firefox ${e.match(/Firefox\/(\d+)/)?.[1]}`:e.includes("Safari")&&!e.includes("Chrome")&&!e.includes("Chromium")?t=`Safari ${e.match(/Version\/(\d+)/)?.[1]}`:(e.includes("Opera")||e.includes("OPR"))&&(t=`Opera ${e.match(/(Opera|OPR)\/(\d+)/)?.[2]}`),t}getOSVersion(){let e=navigator.platform,t=navigator.userAgent;return e.startsWith("Mac")?"macOS":e.startsWith("Win")?"Windows":/Linux/.test(e)?t.includes("ARM")||t.includes("aarch64")||t.includes("Raspberry")||e.includes("armv7l")||e.includes("armv8l")?"Raspberry Pi":"Linux":"Unknown OS"}static \u0275fac=function(t){return new(t||i)};static \u0275prov=u({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();export{x as a,De as b};