@rebasepro/plugin-insights 0.0.1-canary.eae7889 → 0.1.0
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/core/src/components/BootstrapAdminBanner.d.ts +4 -0
- package/dist/core/src/components/LoginView/LoginView.d.ts +22 -0
- package/dist/core/src/components/common/useDataTableController.d.ts +3 -3
- package/dist/core/src/components/index.d.ts +1 -0
- package/dist/core/src/hooks/data/useRelationSelector.d.ts +2 -2
- package/dist/core/src/hooks/index.d.ts +1 -0
- package/dist/core/src/hooks/useCollapsedGroups.d.ts +16 -1
- package/dist/core/src/hooks/useResolvedComponent.d.ts +47 -0
- package/dist/index.es.js +314 -214
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +314 -214
- package/dist/index.umd.js.map +1 -1
- package/dist/plugin-insights/src/components/CollectionInsightsInline.d.ts +3 -2
- package/dist/plugin-insights/src/components/InsightWidget.d.ts +4 -1
- package/dist/plugin-insights/src/components/InsightWidgetSkeleton.d.ts +6 -0
- package/dist/plugin-insights/src/engine/useInsightsData.d.ts +2 -2
- package/dist/plugin-insights/src/types/engine.d.ts +10 -1
- package/dist/types/src/controllers/auth.d.ts +8 -2
- package/dist/types/src/controllers/client.d.ts +13 -0
- package/dist/types/src/controllers/collection_registry.d.ts +2 -1
- package/dist/types/src/controllers/data_driver.d.ts +36 -1
- package/dist/types/src/controllers/navigation.d.ts +18 -6
- package/dist/types/src/controllers/registry.d.ts +9 -1
- package/dist/types/src/controllers/side_entity_controller.d.ts +7 -0
- package/dist/types/src/rebase_context.d.ts +17 -0
- package/dist/types/src/types/backend_hooks.d.ts +187 -0
- package/dist/types/src/types/collections.d.ts +31 -11
- package/dist/types/src/types/component_ref.d.ts +47 -0
- package/dist/types/src/types/cron.d.ts +1 -1
- package/dist/types/src/types/entity_views.d.ts +6 -7
- package/dist/types/src/types/formex.d.ts +40 -0
- package/dist/types/src/types/index.d.ts +3 -0
- package/dist/types/src/types/plugins.d.ts +6 -3
- package/dist/types/src/types/properties.d.ts +72 -88
- package/dist/types/src/types/slots.d.ts +20 -10
- package/dist/types/src/types/translations.d.ts +6 -0
- package/dist/ui/src/components/FileUpload.d.ts +1 -1
- package/dist/ui/src/components/SearchBar.d.ts +5 -1
- package/dist/ui/src/styles.d.ts +2 -2
- package/package.json +3 -3
- package/src/components/CollectionInsightsInline.tsx +10 -2
- package/src/components/HomeCardInsightSlot.tsx +5 -1
- package/src/components/InsightWidget.tsx +5 -1
- package/src/components/InsightWidgetSkeleton.tsx +116 -34
- package/src/engine/useInsightsData.ts +5 -5
- package/src/types/engine.ts +11 -1
- package/src/useInsightsPlugin.tsx +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -85,8 +85,8 @@
|
|
|
85
85
|
function useInsightsEngine() {
|
|
86
86
|
return React.useContext(InsightsContext);
|
|
87
87
|
}
|
|
88
|
-
function useInsightsData(definition,
|
|
89
|
-
const $ = reactCompilerRuntime.c(
|
|
88
|
+
function useInsightsData(definition, context) {
|
|
89
|
+
const $ = reactCompilerRuntime.c(18);
|
|
90
90
|
const engine = useInsightsEngine();
|
|
91
91
|
const cache = engine?.cache ?? null;
|
|
92
92
|
const {
|
|
@@ -99,9 +99,9 @@
|
|
|
99
99
|
const [data, setData] = React.useState(null);
|
|
100
100
|
const [loading, setLoading] = React.useState(true);
|
|
101
101
|
const [error, setError] = React.useState(null);
|
|
102
|
-
const cacheKey = `${definition.id}:${collectionSlug ?? "global"}`;
|
|
102
|
+
const cacheKey = `${definition.id}:${context.path ?? context.collectionSlug ?? "global"}`;
|
|
103
103
|
let t0;
|
|
104
|
-
if ($[0] !== authReady || $[1] !== cache || $[2] !== cacheKey || $[3] !== definition) {
|
|
104
|
+
if ($[0] !== authReady || $[1] !== cache || $[2] !== cacheKey || $[3] !== context || $[4] !== definition) {
|
|
105
105
|
t0 = () => {
|
|
106
106
|
if (!authReady || !cache) {
|
|
107
107
|
return;
|
|
@@ -134,7 +134,7 @@
|
|
|
134
134
|
}
|
|
135
135
|
setLoading(true);
|
|
136
136
|
setError(null);
|
|
137
|
-
const promise = definition.data();
|
|
137
|
+
const promise = definition.data(context);
|
|
138
138
|
cache.setInflight(cacheKey, promise);
|
|
139
139
|
promise.then((result_0) => {
|
|
140
140
|
cache.set(cacheKey, result_0);
|
|
@@ -157,38 +157,40 @@
|
|
|
157
157
|
$[0] = authReady;
|
|
158
158
|
$[1] = cache;
|
|
159
159
|
$[2] = cacheKey;
|
|
160
|
-
$[3] =
|
|
161
|
-
$[4] =
|
|
160
|
+
$[3] = context;
|
|
161
|
+
$[4] = definition;
|
|
162
|
+
$[5] = t0;
|
|
162
163
|
} else {
|
|
163
|
-
t0 = $[
|
|
164
|
+
t0 = $[5];
|
|
164
165
|
}
|
|
165
166
|
let t1;
|
|
166
|
-
if ($[
|
|
167
|
-
t1 = [definition.id, definition.data, collectionSlug, cacheKey, cache, authReady];
|
|
168
|
-
$[
|
|
169
|
-
$[
|
|
170
|
-
$[
|
|
171
|
-
$[
|
|
172
|
-
$[
|
|
173
|
-
$[
|
|
174
|
-
$[
|
|
175
|
-
|
|
176
|
-
|
|
167
|
+
if ($[6] !== authReady || $[7] !== cache || $[8] !== cacheKey || $[9] !== context.collectionSlug || $[10] !== context.path || $[11] !== definition.data || $[12] !== definition.id) {
|
|
168
|
+
t1 = [definition.id, definition.data, context.path, context.collectionSlug, cacheKey, cache, authReady];
|
|
169
|
+
$[6] = authReady;
|
|
170
|
+
$[7] = cache;
|
|
171
|
+
$[8] = cacheKey;
|
|
172
|
+
$[9] = context.collectionSlug;
|
|
173
|
+
$[10] = context.path;
|
|
174
|
+
$[11] = definition.data;
|
|
175
|
+
$[12] = definition.id;
|
|
176
|
+
$[13] = t1;
|
|
177
|
+
} else {
|
|
178
|
+
t1 = $[13];
|
|
177
179
|
}
|
|
178
180
|
React.useEffect(t0, t1);
|
|
179
181
|
let t2;
|
|
180
|
-
if ($[
|
|
182
|
+
if ($[14] !== data || $[15] !== error || $[16] !== loading) {
|
|
181
183
|
t2 = {
|
|
182
184
|
data,
|
|
183
185
|
loading,
|
|
184
186
|
error
|
|
185
187
|
};
|
|
186
|
-
$[
|
|
187
|
-
$[
|
|
188
|
-
$[
|
|
189
|
-
$[
|
|
188
|
+
$[14] = data;
|
|
189
|
+
$[15] = error;
|
|
190
|
+
$[16] = loading;
|
|
191
|
+
$[17] = t2;
|
|
190
192
|
} else {
|
|
191
|
-
t2 = $[
|
|
193
|
+
t2 = $[17];
|
|
192
194
|
}
|
|
193
195
|
return t2;
|
|
194
196
|
}
|
|
@@ -478,7 +480,7 @@
|
|
|
478
480
|
}
|
|
479
481
|
InsightsScorecardView.displayName = "InsightsScorecardView";
|
|
480
482
|
function InsightWidgetSkeleton(t0) {
|
|
481
|
-
const $ = reactCompilerRuntime.c(
|
|
483
|
+
const $ = reactCompilerRuntime.c(17);
|
|
482
484
|
const {
|
|
483
485
|
config,
|
|
484
486
|
compact: t1,
|
|
@@ -491,282 +493,363 @@
|
|
|
491
493
|
const hasDateRange = Boolean(config.dateRange);
|
|
492
494
|
if (compact) {
|
|
493
495
|
const t32 = embedded ? "h-full px-2.5 py-2" : "flex flex-col gap-0.5 rounded-md bg-transparent border min-w-0 px-2.5 py-2";
|
|
494
|
-
const
|
|
495
|
-
let
|
|
496
|
-
if ($[0] !== t32 || $[1] !==
|
|
497
|
-
|
|
496
|
+
const t4 = !embedded && ui.defaultBorderMixin;
|
|
497
|
+
let t5;
|
|
498
|
+
if ($[0] !== t32 || $[1] !== t4) {
|
|
499
|
+
t5 = ui.cls("animate-pulse", t32, t4);
|
|
498
500
|
$[0] = t32;
|
|
499
|
-
$[1] =
|
|
500
|
-
$[2] =
|
|
501
|
+
$[1] = t4;
|
|
502
|
+
$[2] = t5;
|
|
501
503
|
} else {
|
|
502
|
-
|
|
504
|
+
t5 = $[2];
|
|
503
505
|
}
|
|
504
|
-
let
|
|
506
|
+
let t6;
|
|
505
507
|
if ($[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
506
|
-
|
|
508
|
+
t6 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-surface-200 dark:bg-surface-700 rounded-sm", style: {
|
|
507
509
|
height: 14,
|
|
508
510
|
width: 48
|
|
509
511
|
} });
|
|
510
|
-
$[3] =
|
|
512
|
+
$[3] = t6;
|
|
511
513
|
} else {
|
|
512
|
-
|
|
514
|
+
t6 = $[3];
|
|
513
515
|
}
|
|
514
|
-
let
|
|
516
|
+
let t7;
|
|
515
517
|
if ($[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
516
|
-
|
|
518
|
+
t7 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-surface-200 dark:bg-surface-700 rounded-sm", style: {
|
|
517
519
|
height: 20,
|
|
518
520
|
width: 40
|
|
519
521
|
} });
|
|
520
|
-
$[4] =
|
|
522
|
+
$[4] = t7;
|
|
521
523
|
} else {
|
|
522
|
-
|
|
524
|
+
t7 = $[4];
|
|
523
525
|
}
|
|
524
|
-
let
|
|
526
|
+
let t8;
|
|
525
527
|
if ($[5] !== hasComparison) {
|
|
526
|
-
|
|
528
|
+
t8 = hasComparison && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-surface-200/60 dark:bg-surface-700/60 rounded-sm", style: {
|
|
527
529
|
height: 14,
|
|
528
530
|
width: 28
|
|
529
531
|
} });
|
|
530
532
|
$[5] = hasComparison;
|
|
531
|
-
$[6] =
|
|
533
|
+
$[6] = t8;
|
|
532
534
|
} else {
|
|
533
|
-
|
|
535
|
+
t8 = $[6];
|
|
534
536
|
}
|
|
535
|
-
let
|
|
536
|
-
if ($[7] !==
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
537
|
+
let t9;
|
|
538
|
+
if ($[7] !== t8) {
|
|
539
|
+
t9 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-baseline gap-1.5", children: [
|
|
540
|
+
t7,
|
|
541
|
+
t8
|
|
540
542
|
] });
|
|
541
|
-
$[7] =
|
|
542
|
-
$[8] =
|
|
543
|
+
$[7] = t8;
|
|
544
|
+
$[8] = t9;
|
|
543
545
|
} else {
|
|
544
|
-
|
|
546
|
+
t9 = $[8];
|
|
545
547
|
}
|
|
546
|
-
let
|
|
547
|
-
if ($[9] !==
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
548
|
+
let t10;
|
|
549
|
+
if ($[9] !== t5 || $[10] !== t9) {
|
|
550
|
+
t10 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: t5, children: [
|
|
551
|
+
t6,
|
|
552
|
+
t9
|
|
551
553
|
] });
|
|
552
|
-
$[9] =
|
|
553
|
-
$[10] =
|
|
554
|
-
$[11] =
|
|
554
|
+
$[9] = t5;
|
|
555
|
+
$[10] = t9;
|
|
556
|
+
$[11] = t10;
|
|
555
557
|
} else {
|
|
556
|
-
|
|
558
|
+
t10 = $[11];
|
|
557
559
|
}
|
|
558
|
-
return
|
|
560
|
+
return t10;
|
|
559
561
|
}
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
$[
|
|
566
|
-
$[
|
|
567
|
-
$[
|
|
562
|
+
let t3;
|
|
563
|
+
if ($[12] !== embedded || $[13] !== hasComparison || $[14] !== hasDateRange || $[15] !== hasIcon) {
|
|
564
|
+
t3 = /* @__PURE__ */ jsxRuntime.jsx(StandardSkeleton, { hasComparison, hasIcon, hasDateRange, embedded });
|
|
565
|
+
$[12] = embedded;
|
|
566
|
+
$[13] = hasComparison;
|
|
567
|
+
$[14] = hasDateRange;
|
|
568
|
+
$[15] = hasIcon;
|
|
569
|
+
$[16] = t3;
|
|
568
570
|
} else {
|
|
569
|
-
|
|
571
|
+
t3 = $[16];
|
|
570
572
|
}
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
573
|
+
return t3;
|
|
574
|
+
}
|
|
575
|
+
function StandardSkeleton(t0) {
|
|
576
|
+
const $ = reactCompilerRuntime.c(36);
|
|
577
|
+
const {
|
|
578
|
+
hasComparison,
|
|
579
|
+
hasIcon,
|
|
580
|
+
hasDateRange,
|
|
581
|
+
embedded
|
|
582
|
+
} = t0;
|
|
583
|
+
const containerRef = React.useRef(null);
|
|
584
|
+
const [containerWidth, setContainerWidth] = React.useState(null);
|
|
585
|
+
let t1;
|
|
586
|
+
let t2;
|
|
587
|
+
if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
588
|
+
t1 = () => {
|
|
589
|
+
if (!containerRef.current) {
|
|
590
|
+
return;
|
|
591
|
+
}
|
|
592
|
+
setContainerWidth(containerRef.current.offsetWidth);
|
|
593
|
+
const observer = new ResizeObserver((entries) => {
|
|
594
|
+
for (const entry of entries) {
|
|
595
|
+
setContainerWidth(entry.contentRect.width);
|
|
596
|
+
}
|
|
597
|
+
});
|
|
598
|
+
observer.observe(containerRef.current);
|
|
599
|
+
return () => observer.disconnect();
|
|
600
|
+
};
|
|
601
|
+
t2 = [];
|
|
602
|
+
$[0] = t1;
|
|
603
|
+
$[1] = t2;
|
|
604
|
+
} else {
|
|
605
|
+
t1 = $[0];
|
|
606
|
+
t2 = $[1];
|
|
607
|
+
}
|
|
608
|
+
React.useLayoutEffect(t1, t2);
|
|
609
|
+
const isSmall = containerWidth !== null && containerWidth < 200;
|
|
610
|
+
const titleHeight = isSmall ? 15 : 16.5;
|
|
611
|
+
const valueHeight = isSmall ? 22.5 : containerWidth !== null && containerWidth < 300 ? 25 : 30;
|
|
612
|
+
const iconSize = isSmall ? 14 : 18;
|
|
613
|
+
let t3;
|
|
614
|
+
let t4;
|
|
615
|
+
if ($[2] !== embedded || $[3] !== isSmall) {
|
|
616
|
+
const baseClass = embedded ? `flex flex-col min-w-0 h-full ${isSmall ? "px-3.5 py-3" : "px-5 py-4"}` : ui.cls("rounded-lg flex flex-col min-w-0 bg-transparent border", ui.defaultBorderMixin, isSmall ? "px-3.5 py-3" : "px-5 py-4");
|
|
617
|
+
t3 = containerRef;
|
|
618
|
+
t4 = ui.cls("animate-pulse", baseClass);
|
|
619
|
+
$[2] = embedded;
|
|
620
|
+
$[3] = isSmall;
|
|
621
|
+
$[4] = t3;
|
|
622
|
+
$[5] = t4;
|
|
623
|
+
} else {
|
|
624
|
+
t3 = $[4];
|
|
625
|
+
t4 = $[5];
|
|
626
|
+
}
|
|
627
|
+
let t5;
|
|
628
|
+
if ($[6] !== embedded || $[7] !== isSmall) {
|
|
629
|
+
t5 = embedded ? void 0 : {
|
|
630
|
+
minHeight: isSmall ? 68 : 92
|
|
575
631
|
};
|
|
576
|
-
$[
|
|
577
|
-
$[
|
|
632
|
+
$[6] = embedded;
|
|
633
|
+
$[7] = isSmall;
|
|
634
|
+
$[8] = t5;
|
|
578
635
|
} else {
|
|
579
|
-
|
|
636
|
+
t5 = $[8];
|
|
580
637
|
}
|
|
638
|
+
const t6 = `flex items-center justify-between ${isSmall ? "mb-1" : "mb-2"}`;
|
|
581
639
|
let t7;
|
|
582
|
-
if ($[
|
|
640
|
+
if ($[9] !== titleHeight) {
|
|
583
641
|
t7 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-surface-200 dark:bg-surface-700 rounded", style: {
|
|
584
|
-
height:
|
|
642
|
+
height: titleHeight,
|
|
585
643
|
width: "60%"
|
|
586
644
|
} });
|
|
587
|
-
$[
|
|
645
|
+
$[9] = titleHeight;
|
|
646
|
+
$[10] = t7;
|
|
588
647
|
} else {
|
|
589
|
-
t7 = $[
|
|
648
|
+
t7 = $[10];
|
|
590
649
|
}
|
|
591
650
|
let t8;
|
|
592
|
-
if ($[
|
|
593
|
-
t8 = hasDateRange && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-surface-200/60 dark:bg-surface-700/60 rounded mt-0.5", style: {
|
|
651
|
+
if ($[11] !== hasDateRange || $[12] !== isSmall) {
|
|
652
|
+
t8 = hasDateRange && !isSmall && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-surface-200/60 dark:bg-surface-700/60 rounded mt-0.5", style: {
|
|
594
653
|
height: 14,
|
|
595
654
|
width: "40%"
|
|
596
655
|
} });
|
|
597
|
-
$[
|
|
598
|
-
$[
|
|
656
|
+
$[11] = hasDateRange;
|
|
657
|
+
$[12] = isSmall;
|
|
658
|
+
$[13] = t8;
|
|
599
659
|
} else {
|
|
600
|
-
t8 = $[
|
|
660
|
+
t8 = $[13];
|
|
601
661
|
}
|
|
602
662
|
let t9;
|
|
603
|
-
if ($[
|
|
663
|
+
if ($[14] !== t7 || $[15] !== t8) {
|
|
604
664
|
t9 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col min-w-0", children: [
|
|
605
665
|
t7,
|
|
606
666
|
t8
|
|
607
667
|
] });
|
|
608
|
-
$[
|
|
609
|
-
$[
|
|
668
|
+
$[14] = t7;
|
|
669
|
+
$[15] = t8;
|
|
670
|
+
$[16] = t9;
|
|
610
671
|
} else {
|
|
611
|
-
t9 = $[
|
|
672
|
+
t9 = $[16];
|
|
612
673
|
}
|
|
613
674
|
let t10;
|
|
614
|
-
if ($[
|
|
615
|
-
t10 = hasIcon && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-surface-200 dark:bg-surface-700 rounded
|
|
616
|
-
height:
|
|
617
|
-
width:
|
|
618
|
-
} });
|
|
619
|
-
$[
|
|
620
|
-
$[
|
|
675
|
+
if ($[17] !== hasIcon || $[18] !== iconSize) {
|
|
676
|
+
t10 = hasIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-2 shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-surface-200 dark:bg-surface-700 rounded", style: {
|
|
677
|
+
height: iconSize,
|
|
678
|
+
width: iconSize
|
|
679
|
+
} }) });
|
|
680
|
+
$[17] = hasIcon;
|
|
681
|
+
$[18] = iconSize;
|
|
682
|
+
$[19] = t10;
|
|
621
683
|
} else {
|
|
622
|
-
t10 = $[
|
|
684
|
+
t10 = $[19];
|
|
623
685
|
}
|
|
624
686
|
let t11;
|
|
625
|
-
if ($[
|
|
626
|
-
t11 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
687
|
+
if ($[20] !== t10 || $[21] !== t6 || $[22] !== t9) {
|
|
688
|
+
t11 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: t6, children: [
|
|
627
689
|
t9,
|
|
628
690
|
t10
|
|
629
691
|
] });
|
|
630
|
-
$[
|
|
631
|
-
$[
|
|
632
|
-
$[
|
|
692
|
+
$[20] = t10;
|
|
693
|
+
$[21] = t6;
|
|
694
|
+
$[22] = t9;
|
|
695
|
+
$[23] = t11;
|
|
633
696
|
} else {
|
|
634
|
-
t11 = $[
|
|
697
|
+
t11 = $[23];
|
|
635
698
|
}
|
|
636
699
|
let t12;
|
|
637
|
-
if ($[
|
|
700
|
+
if ($[24] !== valueHeight) {
|
|
638
701
|
t12 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-surface-200 dark:bg-surface-700 rounded", style: {
|
|
639
|
-
height:
|
|
702
|
+
height: valueHeight,
|
|
640
703
|
width: "40%"
|
|
641
704
|
} });
|
|
642
|
-
$[
|
|
705
|
+
$[24] = valueHeight;
|
|
706
|
+
$[25] = t12;
|
|
643
707
|
} else {
|
|
644
|
-
t12 = $[
|
|
708
|
+
t12 = $[25];
|
|
645
709
|
}
|
|
646
710
|
let t13;
|
|
647
|
-
if ($[
|
|
648
|
-
t13 = hasComparison && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-surface-200/60 dark:bg-surface-700/60 rounded
|
|
711
|
+
if ($[26] !== hasComparison || $[27] !== isSmall) {
|
|
712
|
+
t13 = hasComparison && /* @__PURE__ */ jsxRuntime.jsx("div", { className: isSmall ? "mt-0.5" : "mt-1", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-surface-200/60 dark:bg-surface-700/60 rounded", style: {
|
|
649
713
|
height: 16,
|
|
650
714
|
width: "25%"
|
|
651
|
-
} });
|
|
652
|
-
$[
|
|
653
|
-
$[
|
|
715
|
+
} }) });
|
|
716
|
+
$[26] = hasComparison;
|
|
717
|
+
$[27] = isSmall;
|
|
718
|
+
$[28] = t13;
|
|
654
719
|
} else {
|
|
655
|
-
t13 = $[
|
|
720
|
+
t13 = $[28];
|
|
656
721
|
}
|
|
657
722
|
let t14;
|
|
658
|
-
if ($[
|
|
659
|
-
t14 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
723
|
+
if ($[29] !== t11 || $[30] !== t12 || $[31] !== t13 || $[32] !== t3 || $[33] !== t4 || $[34] !== t5) {
|
|
724
|
+
t14 = /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: t3, className: t4, style: t5, children: [
|
|
660
725
|
t11,
|
|
661
726
|
t12,
|
|
662
727
|
t13
|
|
663
728
|
] });
|
|
664
|
-
$[
|
|
729
|
+
$[29] = t11;
|
|
730
|
+
$[30] = t12;
|
|
665
731
|
$[31] = t13;
|
|
666
|
-
$[32] =
|
|
667
|
-
$[33] =
|
|
668
|
-
$[34] =
|
|
732
|
+
$[32] = t3;
|
|
733
|
+
$[33] = t4;
|
|
734
|
+
$[34] = t5;
|
|
735
|
+
$[35] = t14;
|
|
669
736
|
} else {
|
|
670
|
-
t14 = $[
|
|
737
|
+
t14 = $[35];
|
|
671
738
|
}
|
|
672
739
|
return t14;
|
|
673
740
|
}
|
|
674
741
|
InsightWidgetSkeleton.displayName = "InsightWidgetSkeleton";
|
|
675
742
|
function InsightWidget(t0) {
|
|
676
|
-
const $ = reactCompilerRuntime.c(
|
|
743
|
+
const $ = reactCompilerRuntime.c(25);
|
|
677
744
|
const {
|
|
678
745
|
definition,
|
|
679
746
|
collectionSlug,
|
|
747
|
+
path,
|
|
748
|
+
parentCollectionSlugs,
|
|
680
749
|
compact: t1,
|
|
681
750
|
embedded: t2
|
|
682
751
|
} = t0;
|
|
683
752
|
const compact = t1 === void 0 ? false : t1;
|
|
684
753
|
const embedded = t2 === void 0 ? false : t2;
|
|
754
|
+
let t3;
|
|
755
|
+
if ($[0] !== collectionSlug || $[1] !== parentCollectionSlugs || $[2] !== path) {
|
|
756
|
+
t3 = {
|
|
757
|
+
path,
|
|
758
|
+
collectionSlug,
|
|
759
|
+
parentCollectionSlugs
|
|
760
|
+
};
|
|
761
|
+
$[0] = collectionSlug;
|
|
762
|
+
$[1] = parentCollectionSlugs;
|
|
763
|
+
$[2] = path;
|
|
764
|
+
$[3] = t3;
|
|
765
|
+
} else {
|
|
766
|
+
t3 = $[3];
|
|
767
|
+
}
|
|
685
768
|
const {
|
|
686
769
|
data,
|
|
687
770
|
loading,
|
|
688
771
|
error
|
|
689
|
-
} = useInsightsData(definition,
|
|
772
|
+
} = useInsightsData(definition, t3);
|
|
690
773
|
if (loading) {
|
|
691
|
-
let
|
|
692
|
-
if ($[
|
|
693
|
-
|
|
694
|
-
$[
|
|
695
|
-
$[
|
|
696
|
-
$[
|
|
697
|
-
$[
|
|
774
|
+
let t42;
|
|
775
|
+
if ($[4] !== compact || $[5] !== definition.scorecard || $[6] !== embedded) {
|
|
776
|
+
t42 = /* @__PURE__ */ jsxRuntime.jsx(InsightWidgetSkeleton, { config: definition.scorecard, compact, embedded });
|
|
777
|
+
$[4] = compact;
|
|
778
|
+
$[5] = definition.scorecard;
|
|
779
|
+
$[6] = embedded;
|
|
780
|
+
$[7] = t42;
|
|
698
781
|
} else {
|
|
699
|
-
|
|
782
|
+
t42 = $[7];
|
|
700
783
|
}
|
|
701
|
-
return
|
|
784
|
+
return t42;
|
|
702
785
|
}
|
|
703
786
|
if (error) {
|
|
704
|
-
const
|
|
705
|
-
let
|
|
706
|
-
if ($[
|
|
707
|
-
|
|
708
|
-
$[
|
|
709
|
-
$[
|
|
710
|
-
} else {
|
|
711
|
-
t42 = $[5];
|
|
712
|
-
}
|
|
713
|
-
let t5;
|
|
714
|
-
if ($[6] !== error.message) {
|
|
715
|
-
t5 = /* @__PURE__ */ jsxRuntime.jsx("div", { children: error.message });
|
|
716
|
-
$[6] = error.message;
|
|
717
|
-
$[7] = t5;
|
|
787
|
+
const t42 = `text-red-500/70 dark:text-red-400/70 text-[0.8125rem] ${embedded ? "px-5 py-4 h-full" : `rounded-lg bg-red-500/5 dark:bg-red-400/5 border border-red-500/10 dark:border-red-400/10 ${compact ? "px-3.5 py-3" : "px-5 py-4"}`}`;
|
|
788
|
+
let t52;
|
|
789
|
+
if ($[8] !== definition.title) {
|
|
790
|
+
t52 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-semibold mb-1", children: definition.title });
|
|
791
|
+
$[8] = definition.title;
|
|
792
|
+
$[9] = t52;
|
|
718
793
|
} else {
|
|
719
|
-
|
|
794
|
+
t52 = $[9];
|
|
720
795
|
}
|
|
721
796
|
let t6;
|
|
722
|
-
if ($[
|
|
723
|
-
t6 = /* @__PURE__ */ jsxRuntime.
|
|
724
|
-
|
|
725
|
-
t5
|
|
726
|
-
] });
|
|
727
|
-
$[8] = t32;
|
|
728
|
-
$[9] = t42;
|
|
729
|
-
$[10] = t5;
|
|
797
|
+
if ($[10] !== error.message) {
|
|
798
|
+
t6 = /* @__PURE__ */ jsxRuntime.jsx("div", { children: error.message });
|
|
799
|
+
$[10] = error.message;
|
|
730
800
|
$[11] = t6;
|
|
731
801
|
} else {
|
|
732
802
|
t6 = $[11];
|
|
733
803
|
}
|
|
734
|
-
|
|
804
|
+
let t7;
|
|
805
|
+
if ($[12] !== t42 || $[13] !== t52 || $[14] !== t6) {
|
|
806
|
+
t7 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: t42, children: [
|
|
807
|
+
t52,
|
|
808
|
+
t6
|
|
809
|
+
] });
|
|
810
|
+
$[12] = t42;
|
|
811
|
+
$[13] = t52;
|
|
812
|
+
$[14] = t6;
|
|
813
|
+
$[15] = t7;
|
|
814
|
+
} else {
|
|
815
|
+
t7 = $[15];
|
|
816
|
+
}
|
|
817
|
+
return t7;
|
|
735
818
|
}
|
|
736
819
|
if (!data || data.rows.length === 0) {
|
|
737
|
-
const
|
|
738
|
-
let
|
|
739
|
-
if ($[
|
|
740
|
-
|
|
820
|
+
const t42 = `text-surface-400 dark:text-surface-500 text-[0.8125rem] ${embedded ? "px-5 py-4 h-full" : `rounded-lg bg-surface-100 dark:bg-surface-800 border border-surface-200 dark:border-surface-700 ${compact ? "px-3.5 py-3" : "px-5 py-4"}`}`;
|
|
821
|
+
let t52;
|
|
822
|
+
if ($[16] !== definition.title || $[17] !== t42) {
|
|
823
|
+
t52 = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: t42, children: [
|
|
741
824
|
definition.title,
|
|
742
825
|
" — No data"
|
|
743
826
|
] });
|
|
744
|
-
$[
|
|
745
|
-
$[
|
|
746
|
-
$[
|
|
827
|
+
$[16] = definition.title;
|
|
828
|
+
$[17] = t42;
|
|
829
|
+
$[18] = t52;
|
|
747
830
|
} else {
|
|
748
|
-
|
|
831
|
+
t52 = $[18];
|
|
749
832
|
}
|
|
750
|
-
return
|
|
833
|
+
return t52;
|
|
751
834
|
}
|
|
752
|
-
const
|
|
753
|
-
let
|
|
754
|
-
if ($[
|
|
755
|
-
|
|
756
|
-
$[
|
|
757
|
-
$[
|
|
758
|
-
$[
|
|
759
|
-
$[
|
|
760
|
-
$[
|
|
761
|
-
$[
|
|
762
|
-
} else {
|
|
763
|
-
|
|
764
|
-
}
|
|
765
|
-
return
|
|
835
|
+
const t4 = data.rows[0];
|
|
836
|
+
let t5;
|
|
837
|
+
if ($[19] !== compact || $[20] !== definition.scorecard || $[21] !== definition.title || $[22] !== embedded || $[23] !== t4) {
|
|
838
|
+
t5 = /* @__PURE__ */ jsxRuntime.jsx(InsightsScorecardView, { config: definition.scorecard, data: t4, title: definition.title, compact, embedded });
|
|
839
|
+
$[19] = compact;
|
|
840
|
+
$[20] = definition.scorecard;
|
|
841
|
+
$[21] = definition.title;
|
|
842
|
+
$[22] = embedded;
|
|
843
|
+
$[23] = t4;
|
|
844
|
+
$[24] = t5;
|
|
845
|
+
} else {
|
|
846
|
+
t5 = $[24];
|
|
847
|
+
}
|
|
848
|
+
return t5;
|
|
766
849
|
}
|
|
767
850
|
InsightWidget.displayName = "InsightWidget";
|
|
768
851
|
function HomeCardInsightSlot(t0) {
|
|
769
|
-
const $ = reactCompilerRuntime.c(
|
|
852
|
+
const $ = reactCompilerRuntime.c(10);
|
|
770
853
|
const {
|
|
771
854
|
slug,
|
|
772
855
|
insights
|
|
@@ -774,39 +857,43 @@
|
|
|
774
857
|
if (!insights || insights.length === 0) {
|
|
775
858
|
return null;
|
|
776
859
|
}
|
|
860
|
+
const estimatedRows = Math.ceil(insights.length / 2);
|
|
861
|
+
const minHeight = estimatedRows * 42 + (estimatedRows - 1) * 6;
|
|
777
862
|
let t1;
|
|
778
|
-
if ($[0]
|
|
863
|
+
if ($[0] !== minHeight) {
|
|
779
864
|
t1 = {
|
|
780
|
-
minHeight
|
|
865
|
+
minHeight
|
|
781
866
|
};
|
|
782
|
-
$[0] =
|
|
867
|
+
$[0] = minHeight;
|
|
868
|
+
$[1] = t1;
|
|
783
869
|
} else {
|
|
784
|
-
t1 = $[
|
|
870
|
+
t1 = $[1];
|
|
785
871
|
}
|
|
786
872
|
let t2;
|
|
787
|
-
if ($[
|
|
873
|
+
if ($[2] !== insights || $[3] !== slug) {
|
|
788
874
|
let t32;
|
|
789
|
-
if ($[
|
|
875
|
+
if ($[5] !== slug) {
|
|
790
876
|
t32 = (def) => /* @__PURE__ */ jsxRuntime.jsx(InsightWidget, { definition: def, collectionSlug: slug, compact: true }, def.id);
|
|
791
|
-
$[
|
|
792
|
-
$[
|
|
877
|
+
$[5] = slug;
|
|
878
|
+
$[6] = t32;
|
|
793
879
|
} else {
|
|
794
|
-
t32 = $[
|
|
880
|
+
t32 = $[6];
|
|
795
881
|
}
|
|
796
882
|
t2 = insights.map(t32);
|
|
797
|
-
$[
|
|
798
|
-
$[
|
|
799
|
-
$[
|
|
883
|
+
$[2] = insights;
|
|
884
|
+
$[3] = slug;
|
|
885
|
+
$[4] = t2;
|
|
800
886
|
} else {
|
|
801
|
-
t2 = $[
|
|
887
|
+
t2 = $[4];
|
|
802
888
|
}
|
|
803
889
|
let t3;
|
|
804
|
-
if ($[
|
|
890
|
+
if ($[7] !== t1 || $[8] !== t2) {
|
|
805
891
|
t3 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap items-center gap-1.5 mt-2", style: t1, children: t2 });
|
|
806
|
-
$[
|
|
807
|
-
$[
|
|
892
|
+
$[7] = t1;
|
|
893
|
+
$[8] = t2;
|
|
894
|
+
$[9] = t3;
|
|
808
895
|
} else {
|
|
809
|
-
t3 = $[
|
|
896
|
+
t3 = $[9];
|
|
810
897
|
}
|
|
811
898
|
return t3;
|
|
812
899
|
}
|
|
@@ -830,7 +917,7 @@
|
|
|
830
917
|
}
|
|
831
918
|
let t2;
|
|
832
919
|
if ($[1] !== insights) {
|
|
833
|
-
t2 = insights.map(_temp
|
|
920
|
+
t2 = insights.map(_temp);
|
|
834
921
|
$[1] = insights;
|
|
835
922
|
$[2] = t2;
|
|
836
923
|
} else {
|
|
@@ -846,39 +933,52 @@
|
|
|
846
933
|
}
|
|
847
934
|
return t3;
|
|
848
935
|
}
|
|
849
|
-
function _temp
|
|
936
|
+
function _temp(def) {
|
|
850
937
|
return /* @__PURE__ */ jsxRuntime.jsx(InsightWidget, { definition: def }, def.id);
|
|
851
938
|
}
|
|
852
939
|
HomeInsightsSlot.displayName = "HomeInsightsSlot";
|
|
853
940
|
function CollectionInsightsInline(t0) {
|
|
854
|
-
const $ = reactCompilerRuntime.c(
|
|
941
|
+
const $ = reactCompilerRuntime.c(11);
|
|
855
942
|
const {
|
|
856
|
-
insights
|
|
943
|
+
insights,
|
|
944
|
+
path,
|
|
945
|
+
parentCollectionSlugs,
|
|
946
|
+
parentEntityIds
|
|
857
947
|
} = t0;
|
|
858
948
|
if (!insights || insights.length === 0) {
|
|
859
949
|
return null;
|
|
860
950
|
}
|
|
861
951
|
let t1;
|
|
862
|
-
if ($[0] !== insights) {
|
|
863
|
-
|
|
952
|
+
if ($[0] !== insights || $[1] !== parentCollectionSlugs || $[2] !== parentEntityIds || $[3] !== path) {
|
|
953
|
+
let t22;
|
|
954
|
+
if ($[5] !== parentCollectionSlugs || $[6] !== parentEntityIds || $[7] !== path) {
|
|
955
|
+
t22 = (def) => /* @__PURE__ */ jsxRuntime.jsx(InsightWidget, { definition: def, path, parentCollectionSlugs, parentEntityIds }, def.id);
|
|
956
|
+
$[5] = parentCollectionSlugs;
|
|
957
|
+
$[6] = parentEntityIds;
|
|
958
|
+
$[7] = path;
|
|
959
|
+
$[8] = t22;
|
|
960
|
+
} else {
|
|
961
|
+
t22 = $[8];
|
|
962
|
+
}
|
|
963
|
+
t1 = insights.map(t22);
|
|
864
964
|
$[0] = insights;
|
|
865
|
-
$[1] =
|
|
965
|
+
$[1] = parentCollectionSlugs;
|
|
966
|
+
$[2] = parentEntityIds;
|
|
967
|
+
$[3] = path;
|
|
968
|
+
$[4] = t1;
|
|
866
969
|
} else {
|
|
867
|
-
t1 = $[
|
|
970
|
+
t1 = $[4];
|
|
868
971
|
}
|
|
869
972
|
let t2;
|
|
870
|
-
if ($[
|
|
973
|
+
if ($[9] !== t1) {
|
|
871
974
|
t2 = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3 pb-4", children: t1 });
|
|
872
|
-
$[
|
|
873
|
-
$[
|
|
975
|
+
$[9] = t1;
|
|
976
|
+
$[10] = t2;
|
|
874
977
|
} else {
|
|
875
|
-
t2 = $[
|
|
978
|
+
t2 = $[10];
|
|
876
979
|
}
|
|
877
980
|
return t2;
|
|
878
981
|
}
|
|
879
|
-
function _temp(def) {
|
|
880
|
-
return /* @__PURE__ */ jsxRuntime.jsx(InsightWidget, { definition: def }, def.id);
|
|
881
|
-
}
|
|
882
982
|
CollectionInsightsInline.displayName = "CollectionInsightsInline";
|
|
883
983
|
function useInsightsPlugin(config) {
|
|
884
984
|
const {
|