@nice2dev/ui-bi 1.0.24 → 1.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +10 -10
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("react"),Y=(a,r)=>r,X=s.createContext(Y);function Z(){return{t:s.useContext(X)}}s.createContext({dir:"ltr",isRTL:!1,flip:a=>a,value:a=>a.ltr});s.createContext(null);s.createContext(null);const Q={radius:"md",shadow:"md",fill:"solid",buttonStyle:"flat",inputStyle:"bordered",cardStyle:"elevated",badgeStyle:"solid",tabStyle:"underline",toggleStyle:"default",tooltipStyle:"dark",modalStyle:"default",tableStyle:"default",menuStyle:"default",animation:"normal",density:"normal"};s.createContext({displayStyle:"default",variantConfig:Q,setDisplayStyle:()=>{}});s.createContext({});s.createContext({direction:"ltr",isRTL:!1,flip:a=>a,flipStyle:(a,r)=>({[a]:r})});s.createContext({permissions:{},getAccessMode:()=>"full"});s.createContext(null);const ee=process.env.NODE_ENV==="development";let L={enabled:ee,slowRenderThreshold:16};const M=[],R=new Map,F=new Map;function re(){M.length=0,R.clear(),F.clear()}function ae(a){const r=L.slowRenderThreshold;return M.filter(c=>c.actualDuration>r)}function x(a){return a<1?`${(a*1e3).toFixed(0)}μs`:a<1e3?`${a.toFixed(2)}ms`:`${(a/1e3).toFixed(2)}s`}function ie(){const a=Array.from(R.values()),r=ae(),c=a.reduce((u,t)=>u+t.renderCount,0),d=a.length>0?a.reduce((u,t)=>u+t.avgRenderTime,0)/a.length:0,y=Array.from(F.values());return{stats:a,slowRenders:r,totalRenders:c,avgRenderTime:d,marks:y}}function ne(){const a=ie();console.group("%c[Nice2Dev Performance Report]","color: var(--nice-info, #6366f1); font-weight: bold; font-size: 14px"),console.log(`Total renders: ${a.totalRenders}`),console.log(`Average render time: ${x(a.avgRenderTime)}`),console.log(`Slow renders: ${a.slowRenders.length}`),console.group("Component Stats"),console.table(a.stats.sort((r,c)=>c.totalRenderTime-r.totalRenderTime).map(r=>({Name:r.componentName,Renders:r.renderCount,"Avg Time":x(r.avgRenderTime),"Max Time":x(r.maxRenderTime),"Total Time":x(r.totalRenderTime),"Slow Renders":r.slowRenderCount}))),console.groupEnd(),a.slowRenders.length>0&&(console.group("Slow Renders (last 10)"),console.table(a.slowRenders.slice(-10).map(r=>({Component:r.componentName,Phase:r.phase,Duration:x(r.actualDuration),Time:new Date(r.timestamp).toLocaleTimeString()}))),console.groupEnd()),a.marks.length>0&&(console.group("Custom Marks"),console.table(a.marks.filter(r=>r.duration).map(r=>({Name:r.name,Duration:x(r.duration)}))),console.groupEnd()),console.groupEnd()}const ce=s.memo(({position:a="bottom-right",defaultCollapsed:r=!0})=>{const[c,d]=s.useState(r),[y,u]=s.useState([]),[t,p]=s.useState({used:0,total:0});if(s.useEffect(()=>{const o=()=>{const g=Array.from(R.values());u(g.sort((_,H)=>H.totalRenderTime-_.totalRenderTime).slice(0,10));const j=window.performance;j.memory&&p({used:j.memory.usedJSHeapSize/1024/1024,total:j.memory.totalJSHeapSize/1024/1024})};o();const b=setInterval(o,2e3);return()=>clearInterval(b)},[]),!L.enabled)return null;const w={position:"fixed",zIndex:99999,...a.includes("top")?{top:8}:{bottom:8},...a.includes("left")?{left:8}:{right:8}};return e.jsxs("div",{style:{...w,background:"var(--nice-overlay-85, rgba(0, 0, 0, 0.85))",color:"var(--bg-primary, #fff)",borderRadius:8,fontSize:11,fontFamily:"Monaco, Consolas, monospace",padding:c?"4px 8px":8,maxWidth:c?"auto":300,maxHeight:c?"auto":400,overflow:"auto"},children:[e.jsxs("div",{style:{cursor:"pointer",display:"flex",alignItems:"center",gap:8},onClick:()=>d(o=>!o),children:[e.jsx("span",{style:{color:"var(--color-success, #22c55e)"},children:"●"}),e.jsx("span",{children:"Profiler"}),t.used>0&&e.jsxs("span",{style:{color:t.used>100?"var(--color-warning, #f59e0b)":"var(--text-muted, #64748b)"},children:[t.used.toFixed(0),"MB"]}),e.jsx("span",{style:{marginLeft:"auto",opacity:.5},children:c?"▼":"▲"})]}),!c&&e.jsxs("div",{style:{marginTop:8},children:[e.jsx("div",{style:{borderBottom:"1px solid var(--border-color, #333)",paddingBottom:4,marginBottom:8},children:e.jsx("strong",{children:"Top Components"})}),y.map(o=>e.jsxs("div",{style:{marginBottom:4,display:"flex",gap:8},children:[e.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis"},children:o.componentName}),e.jsx("span",{style:{color:o.avgRenderTime>16?"var(--color-warning, #f59e0b)":"var(--color-success, #22c55e)"},children:x(o.avgRenderTime)}),e.jsxs("span",{style:{color:"var(--text-muted, #64748b)",minWidth:30,textAlign:"right"},children:["x",o.renderCount]})]},o.componentName)),e.jsxs("div",{style:{marginTop:8,display:"flex",gap:8},children:[e.jsx("button",{onClick:ne,style:{flex:1,padding:"4px 8px",background:"var(--bg-tertiary, #333)",border:"none",borderRadius:4,color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:10},children:"Print Report"}),e.jsx("button",{onClick:re,style:{flex:1,padding:"4px 8px",background:"var(--bg-tertiary, #333)",border:"none",borderRadius:4,color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:10},children:"Clear"})]})]})]})});ce.displayName="ProfilerOverlay";process.env.NODE_ENV;s.createContext(null);const te=s.createContext({enabled:!0,active:!1,run:()=>{}});function se(){return s.useContext(te)}function de(a,r){if(!a)return null;if(a===!0)return r&&r.length>0?r:null;if(Array.isArray(a))return a.length>0?a:null;const c=a.steps??r;return c&&c.length>0?c:null}function oe(a,r){return a.map(c=>({target:c.target,title:c.titleKey?r(c.titleKey,c.title??""):c.title??"",content:c.contentKey?r(c.contentKey,c.content??""):c.content??"",placement:c.placement,highlightPadding:c.highlightPadding,showArrow:c.showArrow,scrollIntoView:c.scrollIntoView,disableInteraction:c.disableInteraction}))}const fe=({steps:a,autoStart:r,label:c,size:d="md",className:y,style:u,"data-testid":t})=>{const{enabled:p,run:w}=se(),{t:o}=Z();if(!p||!a||a.length===0)return null;const b=c??o("tutorial.startAria","Start tutorial");return e.jsx("button",{type:"button",className:`nice-tutorial-button nice-tutorial-button--${d}`+(y?` ${y}`:""),style:u,"data-testid":t,"aria-label":b,title:b,onClick:()=>w(oe(a,o),{autoStart:r}),children:"?"})},P="nice-tutorial-button-styles";if(typeof document<"u"&&!document.getElementById(P)){const a=document.createElement("style");a.id=P,a.textContent=`
|
|
2
2
|
.nice-tutorial-button {
|
|
3
3
|
display: inline-flex;
|
|
4
4
|
align-items: center;
|
package/dist/index.mjs
CHANGED
|
@@ -52,9 +52,9 @@ let W = {
|
|
|
52
52
|
enabled: te,
|
|
53
53
|
slowRenderThreshold: 16
|
|
54
54
|
};
|
|
55
|
-
const O = [], M = /* @__PURE__ */ new Map(),
|
|
55
|
+
const O = [], M = /* @__PURE__ */ new Map(), B = /* @__PURE__ */ new Map();
|
|
56
56
|
function fe() {
|
|
57
|
-
O.length = 0, M.clear(),
|
|
57
|
+
O.length = 0, M.clear(), B.clear();
|
|
58
58
|
}
|
|
59
59
|
function se(a) {
|
|
60
60
|
const r = W.slowRenderThreshold;
|
|
@@ -64,7 +64,7 @@ function H(a) {
|
|
|
64
64
|
return a < 1 ? `${(a * 1e3).toFixed(0)}μs` : a < 1e3 ? `${a.toFixed(2)}ms` : `${(a / 1e3).toFixed(2)}s`;
|
|
65
65
|
}
|
|
66
66
|
function le() {
|
|
67
|
-
const a = Array.from(M.values()), r = se(), c = a.reduce((u, o) => u + o.renderCount, 0), t = a.length > 0 ? a.reduce((u, o) => u + o.avgRenderTime, 0) / a.length : 0, y = Array.from(
|
|
67
|
+
const a = Array.from(M.values()), r = se(), c = a.reduce((u, o) => u + o.renderCount, 0), t = a.length > 0 ? a.reduce((u, o) => u + o.avgRenderTime, 0) / a.length : 0, y = Array.from(B.values());
|
|
68
68
|
return { stats: a, slowRenders: r, totalRenders: c, avgRenderTime: t, marks: y };
|
|
69
69
|
}
|
|
70
70
|
function ye() {
|
|
@@ -329,7 +329,7 @@ if (typeof document < "u" && !document.getElementById(U)) {
|
|
|
329
329
|
b(null);
|
|
330
330
|
b(null);
|
|
331
331
|
b(null);
|
|
332
|
-
const
|
|
332
|
+
const $ = {
|
|
333
333
|
space1: "4px",
|
|
334
334
|
space2: "8px",
|
|
335
335
|
space3: "12px",
|
|
@@ -385,7 +385,7 @@ function i(a, r, c, t, y) {
|
|
|
385
385
|
text: { ...t, inverse: t.inverse ?? "#ffffff" },
|
|
386
386
|
borders: j(y),
|
|
387
387
|
shadows: ge,
|
|
388
|
-
spacing:
|
|
388
|
+
spacing: $,
|
|
389
389
|
typography: V,
|
|
390
390
|
transitions: K
|
|
391
391
|
};
|
|
@@ -408,7 +408,7 @@ function m(a, r, c, t, y) {
|
|
|
408
408
|
text: { ...t, inverse: t.inverse ?? "#0f172a" },
|
|
409
409
|
borders: j(y),
|
|
410
410
|
shadows: we,
|
|
411
|
-
spacing:
|
|
411
|
+
spacing: $,
|
|
412
412
|
typography: V,
|
|
413
413
|
transitions: K
|
|
414
414
|
};
|
|
@@ -1803,7 +1803,7 @@ function De({
|
|
|
1803
1803
|
}) {
|
|
1804
1804
|
const [p, S] = w(
|
|
1805
1805
|
a || { ...xe, id: crypto.randomUUID() }
|
|
1806
|
-
), [f, v] = w(null), [_, C] = w("design"), [T, k] = w(!1), [J, G] = w([]), [D, E] = w(null),
|
|
1806
|
+
), [f, v] = w(null), [_, C] = w("design"), [T, k] = w(!1), [J, G] = w([]), [D, E] = w(null), Y = ie(null), h = x(
|
|
1807
1807
|
(n) => {
|
|
1808
1808
|
S((s) => {
|
|
1809
1809
|
const l = n(s);
|
|
@@ -1875,7 +1875,7 @@ function De({
|
|
|
1875
1875
|
}), v(null);
|
|
1876
1876
|
},
|
|
1877
1877
|
[h]
|
|
1878
|
-
),
|
|
1878
|
+
), Z = x(async () => {
|
|
1879
1879
|
if (t) {
|
|
1880
1880
|
k(!0);
|
|
1881
1881
|
try {
|
|
@@ -1936,7 +1936,7 @@ function De({
|
|
|
1936
1936
|
n
|
|
1937
1937
|
)) }),
|
|
1938
1938
|
/* @__PURE__ */ d("div", { className: "nice-etl-builder__actions", children: [
|
|
1939
|
-
/* @__PURE__ */ e("button", { onClick:
|
|
1939
|
+
/* @__PURE__ */ e("button", { onClick: Z, disabled: T, className: "nice-etl-builder__run-btn", children: T ? "⏳ Running..." : "▶ Run" }),
|
|
1940
1940
|
/* @__PURE__ */ e("button", { className: "nice-etl-builder__save-btn", children: "💾 Save" }),
|
|
1941
1941
|
/* @__PURE__ */ e(he, { steps: be(o, _e) })
|
|
1942
1942
|
] })
|
|
@@ -1984,7 +1984,7 @@ function De({
|
|
|
1984
1984
|
_ === "design" && /* @__PURE__ */ e(
|
|
1985
1985
|
"div",
|
|
1986
1986
|
{
|
|
1987
|
-
ref:
|
|
1987
|
+
ref: Y,
|
|
1988
1988
|
className: "nice-etl-builder__canvas",
|
|
1989
1989
|
onDragOver: (n) => n.preventDefault(),
|
|
1990
1990
|
onDrop: Q,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nice2dev/ui-bi",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.26",
|
|
4
4
|
"description": "Nice2Dev Business Intelligence — Report builder, dashboard studio, ETL pipeline builder",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
"prepublishOnly": "npm run build"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@nice2dev/ui-core": "^1.0.
|
|
36
|
+
"@nice2dev/ui-core": "^1.0.26",
|
|
37
37
|
"react": ">=17.0.0",
|
|
38
38
|
"react-dom": ">=17.0.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@nice2dev/ui": "^1.0.
|
|
42
|
-
"@nice2dev/ui-core": "^1.0.
|
|
41
|
+
"@nice2dev/ui": "^1.0.26",
|
|
42
|
+
"@nice2dev/ui-core": "^1.0.26",
|
|
43
43
|
"@testing-library/jest-dom": "^6.9.1",
|
|
44
44
|
"@testing-library/react": "^14.0.0",
|
|
45
45
|
"@types/react": "^18.2.0",
|