piral-dashboard 0.15.0-alpha.3555 → 0.15.0-alpha.3564
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/esm/Dashboard.d.ts +1 -1
- package/esm/components.d.ts +3 -3
- package/esm/components.js.map +1 -1
- package/esm/types.d.ts +3 -3
- package/lib/Dashboard.d.ts +1 -1
- package/lib/components.d.ts +3 -3
- package/lib/components.js.map +1 -1
- package/lib/types.d.ts +3 -3
- package/package.json +12 -6
- package/piral-dashboard.min.js +1 -0
- package/src/Dashboard.tsx +1 -1
- package/src/components.tsx +3 -4
- package/src/types.ts +3 -3
package/esm/Dashboard.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { RouteComponentProps } from 'react-router-dom';
|
|
2
|
+
import type { RouteComponentProps } from 'react-router-dom';
|
|
3
3
|
import { TileRegistration } from './types';
|
|
4
4
|
export interface DashboardProps extends RouteComponentProps {
|
|
5
5
|
filter?(tile: TileRegistration): boolean;
|
package/esm/components.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
2
|
import { DashboardContainerProps, DashboardTileProps } from './types';
|
|
3
|
-
export declare const PiralDashboardContainer:
|
|
4
|
-
export declare const PiralDashboardTile:
|
|
3
|
+
export declare const PiralDashboardContainer: ComponentType<DashboardContainerProps>;
|
|
4
|
+
export declare const PiralDashboardTile: ComponentType<DashboardTileProps>;
|
package/esm/components.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.js","sourceRoot":"","sources":["../src/components.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAG/C,MAAM,CAAC,MAAM,uBAAuB,
|
|
1
|
+
{"version":3,"file":"components.js","sourceRoot":"","sources":["../src/components.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAG/C,MAAM,CAAC,MAAM,uBAAuB,GAA2C,iBAAiB,CAAC,oBAAoB,CAAC,CAAC;AACvH,MAAM,CAAC,MAAM,kBAAkB,GAAsC,iBAAiB,CAAC,eAAe,CAAC,CAAC"}
|
package/esm/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ComponentType } from 'react';
|
|
2
|
-
import { RouteComponentProps } from 'react-router-dom';
|
|
3
|
-
import { Dict, WrappedComponent, BaseComponentProps, AnyComponent, BaseRegistration, RegistrationDisposer } from 'piral-core';
|
|
1
|
+
import type { ComponentType } from 'react';
|
|
2
|
+
import type { RouteComponentProps } from 'react-router-dom';
|
|
3
|
+
import type { Dict, WrappedComponent, BaseComponentProps, AnyComponent, BaseRegistration, RegistrationDisposer } from 'piral-core';
|
|
4
4
|
declare module 'piral-core/lib/types/custom' {
|
|
5
5
|
interface PiletCustomApi extends PiletDashboardApi {
|
|
6
6
|
}
|
package/lib/Dashboard.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { RouteComponentProps } from 'react-router-dom';
|
|
2
|
+
import type { RouteComponentProps } from 'react-router-dom';
|
|
3
3
|
import { TileRegistration } from './types';
|
|
4
4
|
export interface DashboardProps extends RouteComponentProps {
|
|
5
5
|
filter?(tile: TileRegistration): boolean;
|
package/lib/components.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
2
|
import { DashboardContainerProps, DashboardTileProps } from './types';
|
|
3
|
-
export declare const PiralDashboardContainer:
|
|
4
|
-
export declare const PiralDashboardTile:
|
|
3
|
+
export declare const PiralDashboardContainer: ComponentType<DashboardContainerProps>;
|
|
4
|
+
export declare const PiralDashboardTile: ComponentType<DashboardTileProps>;
|
package/lib/components.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.js","sourceRoot":"","sources":["../src/components.tsx"],"names":[],"mappings":";;;AACA,2CAA+C;AAGlC,QAAA,uBAAuB,
|
|
1
|
+
{"version":3,"file":"components.js","sourceRoot":"","sources":["../src/components.tsx"],"names":[],"mappings":";;;AACA,2CAA+C;AAGlC,QAAA,uBAAuB,GAA2C,IAAA,8BAAiB,EAAC,oBAAoB,CAAC,CAAC;AAC1G,QAAA,kBAAkB,GAAsC,IAAA,8BAAiB,EAAC,eAAe,CAAC,CAAC"}
|
package/lib/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ComponentType } from 'react';
|
|
2
|
-
import { RouteComponentProps } from 'react-router-dom';
|
|
3
|
-
import { Dict, WrappedComponent, BaseComponentProps, AnyComponent, BaseRegistration, RegistrationDisposer } from 'piral-core';
|
|
1
|
+
import type { ComponentType } from 'react';
|
|
2
|
+
import type { RouteComponentProps } from 'react-router-dom';
|
|
3
|
+
import type { Dict, WrappedComponent, BaseComponentProps, AnyComponent, BaseRegistration, RegistrationDisposer } from 'piral-core';
|
|
4
4
|
declare module 'piral-core/lib/types/custom' {
|
|
5
5
|
interface PiletCustomApi extends PiletDashboardApi {
|
|
6
6
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "piral-dashboard",
|
|
3
|
-
"version": "0.15.0-alpha.
|
|
3
|
+
"version": "0.15.0-alpha.3564",
|
|
4
4
|
"description": "Plugin for creating a centralized dashboard in Piral.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"piral",
|
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
"files": [
|
|
25
25
|
"esm",
|
|
26
26
|
"lib",
|
|
27
|
-
"src"
|
|
27
|
+
"src",
|
|
28
|
+
"piral-dashboard.min.js"
|
|
28
29
|
],
|
|
29
30
|
"repository": {
|
|
30
31
|
"type": "git",
|
|
@@ -34,17 +35,22 @@
|
|
|
34
35
|
"url": "https://github.com/smapiot/piral/issues"
|
|
35
36
|
},
|
|
36
37
|
"scripts": {
|
|
37
|
-
"build": "yarn build:commonjs && yarn build:esnext",
|
|
38
|
+
"build": "yarn build:bundle && yarn build:commonjs && yarn build:esnext",
|
|
39
|
+
"build:bundle": "esbuild src/index.ts --outfile=piral-dashboard.min.js --bundle --external:piral-core --external:react --minify --global-name=piralDashboard",
|
|
38
40
|
"build:commonjs": "tsc --project tsconfig.json --outDir lib --module commonjs",
|
|
39
41
|
"build:esnext": "tsc --project tsconfig.json --outDir esm --module esnext",
|
|
40
42
|
"typedoc": "typedoc --json ../../../docs/types/piral-dashboard.json src --exclude \"src/**/*.test.*\"",
|
|
41
43
|
"test": "echo \"Error: run tests from root\" && exit 1"
|
|
42
44
|
},
|
|
43
45
|
"devDependencies": {
|
|
44
|
-
"
|
|
46
|
+
"@types/react": "^17.0.0",
|
|
47
|
+
"@types/react-router-dom": "^5.1.6",
|
|
48
|
+
"piral-core": "0.15.0-alpha.3564",
|
|
49
|
+
"react": "^17.0.1"
|
|
45
50
|
},
|
|
46
51
|
"peerDependencies": {
|
|
47
|
-
"piral-core": "0.14.x"
|
|
52
|
+
"piral-core": "0.14.x",
|
|
53
|
+
"react": ">=16.8.0"
|
|
48
54
|
},
|
|
49
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "e5af009799d073993a1c415c4ee63029f9b3d547"
|
|
50
56
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var piralDashboard=(()=>{var q=Object.create;var u=Object.defineProperty,v=Object.defineProperties,B=Object.getOwnPropertyDescriptor,H=Object.getOwnPropertyDescriptors,J=Object.getOwnPropertyNames,S=Object.getOwnPropertySymbols,L=Object.getPrototypeOf,G=Object.prototype.hasOwnProperty,M=Object.prototype.propertyIsEnumerable;var I=(e,r,t)=>r in e?u(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,i=(e,r)=>{for(var t in r||(r={}))G.call(r,t)&&I(e,t,r[t]);if(S)for(var t of S(r))M.call(r,t)&&I(e,t,r[t]);return e},s=(e,r)=>v(e,H(r)),F=e=>u(e,"__esModule",{value:!0});var p=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(r,t)=>(typeof require!="undefined"?require:r)[t]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var k=(e,r)=>{F(e);for(var t in r)u(e,t,{get:r[t],enumerable:!0})},Q=(e,r,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of J(r))!G.call(e,o)&&o!=="default"&&u(e,o,{get:()=>r[o],enumerable:!(t=B(r,o))||t.enumerable});return e},c=e=>Q(F(u(e!=null?q(L(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e);var X={};k(X,{Dashboard:()=>d,PiralDashboardContainer:()=>x,PiralDashboardTile:()=>R,createDashboardApi:()=>W});var y={};k(y,{registerTile:()=>U,unregisterTile:()=>V});var g=c(p("piral-core"));function U(e,r,t){e.dispatch(o=>s(i({},o),{registry:s(i({},o.registry),{tiles:(0,g.withKey)(o.registry.tiles,r,t)})}))}function V(e,r){e.dispatch(t=>s(i({},t),{registry:s(i({},t.registry),{tiles:(0,g.withoutKey)(t.registry.tiles,r)})}))}var l=c(p("piral-core"));var P=c(p("react")),z=c(p("piral-core"));var C=c(p("piral-core")),x=(0,C.getPiralComponent)("DashboardContainer"),R=(0,C.getPiralComponent)("DashboardTile");var d=e=>{let r=(0,z.useGlobalState)(a=>a.registry.tiles),{filter:t=()=>!0}=e,o=Object.keys(r).filter(a=>t(r[a])).map(a=>{let{component:m,preferences:T}=r[a],{initialColumns:f=1,initialRows:D=1,resizable:n=!1}=T;return P.createElement(R,{key:a,columns:f,rows:D,resizable:n,meta:T},P.createElement(m,{columns:f,rows:D}))});return P.createElement(x,s(i({},e),{children:o}))};d.displayName="Dashboard";var E=c(p("react")),b=c(p("piral-core")),K=e=>E.createElement(b.ExtensionSlot,{name:"dashboard",params:e,empty:()=>(0,b.defaultRender)(e.children,"default_dashboard")}),N=e=>(0,b.defaultRender)(e.children);function w(e,r={}){return i(i({},e),r)}function j(e,r){let t={},o=0;for(let{component:a,preferences:m}of e)t[`global-${o++}`]={pilet:void 0,component:a,preferences:w(r,m)};return t}function O(e){return r=>s(i({},r),{components:i({DashboardTile:N,DashboardContainer:K},r.components),registry:s(i({},r.registry),{tiles:e})})}function _(e){return r=>s(i({},r),{routes:i(i({},r.routes),e.reduce((t,o)=>(t[o]=d,t),{}))})}function W(e={}){let{tiles:r=[],defaultPreferences:t={},routes:o=["/"]}=e;return a=>(a.defineActions(y),a.dispatch((0,l.withAll)(O(j(r,t)),(0,l.withRootExtension)("piral-dashboard",d),_(o))),(m,T)=>{let f=T.name,D=0;return{registerTile(n,h,A){typeof n!="string"&&(A=h,h=n,n=D++);let $=(0,l.buildName)(f,n);return a.registerTile($,{pilet:f,component:(0,l.withApi)(a,h,m,"tile"),preferences:w(t,A)}),()=>m.unregisterTile(n)},unregisterTile(n){let h=(0,l.buildName)(f,n);a.unregisterTile(h)}}})}return X;})();
|
package/src/Dashboard.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { RouteComponentProps } from 'react-router-dom';
|
|
2
|
+
import type { RouteComponentProps } from 'react-router-dom';
|
|
3
3
|
import { useGlobalState } from 'piral-core';
|
|
4
4
|
import { PiralDashboardContainer, PiralDashboardTile } from './components';
|
|
5
5
|
import { TileRegistration } from './types';
|
package/src/components.tsx
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
2
|
import { getPiralComponent } from 'piral-core';
|
|
3
3
|
import { DashboardContainerProps, DashboardTileProps } from './types';
|
|
4
4
|
|
|
5
|
-
export const PiralDashboardContainer:
|
|
6
|
-
|
|
7
|
-
export const PiralDashboardTile: React.ComponentType<DashboardTileProps> = getPiralComponent('DashboardTile');
|
|
5
|
+
export const PiralDashboardContainer: ComponentType<DashboardContainerProps> = getPiralComponent('DashboardContainer');
|
|
6
|
+
export const PiralDashboardTile: ComponentType<DashboardTileProps> = getPiralComponent('DashboardTile');
|
package/src/types.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ComponentType } from 'react';
|
|
2
|
-
import { RouteComponentProps } from 'react-router-dom';
|
|
3
|
-
import {
|
|
1
|
+
import type { ComponentType } from 'react';
|
|
2
|
+
import type { RouteComponentProps } from 'react-router-dom';
|
|
3
|
+
import type {
|
|
4
4
|
Dict,
|
|
5
5
|
WrappedComponent,
|
|
6
6
|
BaseComponentProps,
|