@revenexx/studio-shared 0.3.1 → 0.3.3

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.
Files changed (85) hide show
  1. package/dist/module.d.mts +4 -0
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +9 -0
  4. package/dist/runtime/components/Dashboard/DashboardConfirmDialog.d.vue.ts +15 -0
  5. package/dist/runtime/components/Dashboard/DashboardConfirmDialog.vue +39 -0
  6. package/dist/runtime/components/Dashboard/DashboardConfirmDialog.vue.d.ts +15 -0
  7. package/dist/runtime/components/Dashboard/DashboardControls.d.vue.ts +57 -0
  8. package/dist/runtime/components/Dashboard/DashboardControls.vue +209 -0
  9. package/dist/runtime/components/Dashboard/DashboardControls.vue.d.ts +57 -0
  10. package/dist/runtime/components/Dashboard/DashboardGrid.d.vue.ts +16 -0
  11. package/dist/runtime/components/Dashboard/DashboardGrid.vue +87 -0
  12. package/dist/runtime/components/Dashboard/DashboardGrid.vue.d.ts +16 -0
  13. package/dist/runtime/components/Dashboard/DashboardNameDialog.d.vue.ts +18 -0
  14. package/dist/runtime/components/Dashboard/DashboardNameDialog.vue +61 -0
  15. package/dist/runtime/components/Dashboard/DashboardNameDialog.vue.d.ts +18 -0
  16. package/dist/runtime/components/Dashboard/DashboardPickerDialog.d.vue.ts +14 -0
  17. package/dist/runtime/components/Dashboard/DashboardPickerDialog.vue +100 -0
  18. package/dist/runtime/components/Dashboard/DashboardPickerDialog.vue.d.ts +14 -0
  19. package/dist/runtime/components/Dashboard/DashboardShareDialog.d.vue.ts +27 -0
  20. package/dist/runtime/components/Dashboard/DashboardShareDialog.vue +155 -0
  21. package/dist/runtime/components/Dashboard/DashboardShareDialog.vue.d.ts +27 -0
  22. package/dist/runtime/components/Dashboard/DashboardTopBar.d.vue.ts +59 -0
  23. package/dist/runtime/components/Dashboard/DashboardTopBar.vue +79 -0
  24. package/dist/runtime/components/Dashboard/DashboardTopBar.vue.d.ts +59 -0
  25. package/dist/runtime/components/Dashboard/DashboardWidgetConfigDialog.d.vue.ts +42 -0
  26. package/dist/runtime/components/Dashboard/DashboardWidgetConfigDialog.vue +153 -0
  27. package/dist/runtime/components/Dashboard/DashboardWidgetConfigDialog.vue.d.ts +42 -0
  28. package/dist/runtime/components/Dashboard/DashboardWidgetFrame.d.vue.ts +27 -0
  29. package/dist/runtime/components/Dashboard/DashboardWidgetFrame.vue +80 -0
  30. package/dist/runtime/components/Dashboard/DashboardWidgetFrame.vue.d.ts +27 -0
  31. package/dist/runtime/components/Dashboard/DashboardWidgetHost.d.vue.ts +6 -0
  32. package/dist/runtime/components/Dashboard/DashboardWidgetHost.vue +30 -0
  33. package/dist/runtime/components/Dashboard/DashboardWidgetHost.vue.d.ts +6 -0
  34. package/dist/runtime/components/Dashboard/DashboardWidgetIcon.d.vue.ts +8 -0
  35. package/dist/runtime/components/Dashboard/DashboardWidgetIcon.vue +13 -0
  36. package/dist/runtime/components/Dashboard/DashboardWidgetIcon.vue.d.ts +8 -0
  37. package/dist/runtime/components/Dashboard/DashboardWidgetLibrary.d.vue.ts +23 -0
  38. package/dist/runtime/components/Dashboard/DashboardWidgetLibrary.vue +140 -0
  39. package/dist/runtime/components/Dashboard/DashboardWidgetLibrary.vue.d.ts +23 -0
  40. package/dist/runtime/components/Dashboard/DashboardWidgetPreview.d.vue.ts +22 -0
  41. package/dist/runtime/components/Dashboard/DashboardWidgetPreview.vue +124 -0
  42. package/dist/runtime/components/Dashboard/DashboardWidgetPreview.vue.d.ts +22 -0
  43. package/dist/runtime/components/DataTable/DataTable.d.vue.ts +39 -3
  44. package/dist/runtime/components/DataTable/DataTable.vue +306 -32
  45. package/dist/runtime/components/DataTable/DataTable.vue.d.ts +39 -3
  46. package/dist/runtime/components/DataTable/FacetChips.d.vue.ts +16 -0
  47. package/dist/runtime/components/DataTable/FacetChips.vue +72 -0
  48. package/dist/runtime/components/DataTable/FacetChips.vue.d.ts +16 -0
  49. package/dist/runtime/components/DataTable/FacetPanel.d.vue.ts +20 -0
  50. package/dist/runtime/components/DataTable/FacetPanel.vue +359 -0
  51. package/dist/runtime/components/DataTable/FacetPanel.vue.d.ts +20 -0
  52. package/dist/runtime/components/DataTable/SavedViewsMenu.d.vue.ts +5 -1
  53. package/dist/runtime/components/DataTable/SavedViewsMenu.vue +83 -63
  54. package/dist/runtime/components/DataTable/SavedViewsMenu.vue.d.ts +5 -1
  55. package/dist/runtime/components/DataTable/SortMenu.d.vue.ts +5 -1
  56. package/dist/runtime/components/DataTable/SortMenu.vue +40 -12
  57. package/dist/runtime/components/DataTable/SortMenu.vue.d.ts +5 -1
  58. package/dist/runtime/components/Media/MediaPickerDialog.d.vue.ts +2 -2
  59. package/dist/runtime/components/Media/MediaPickerDialog.vue.d.ts +2 -2
  60. package/dist/runtime/components/Media/MediaUploader.d.vue.ts +2 -2
  61. package/dist/runtime/components/Media/MediaUploader.vue.d.ts +2 -2
  62. package/dist/runtime/components/Shared/SortHeader.vue +6 -2
  63. package/dist/runtime/components/Shared/TabBar.d.vue.ts +23 -7
  64. package/dist/runtime/components/Shared/TabBar.vue +3 -2
  65. package/dist/runtime/components/Shared/TabBar.vue.d.ts +23 -7
  66. package/dist/runtime/composables/useDashboards.d.ts +27 -0
  67. package/dist/runtime/composables/useDashboards.js +143 -0
  68. package/dist/runtime/composables/useSavedViews.d.ts +44 -0
  69. package/dist/runtime/composables/useSavedViews.js +44 -0
  70. package/dist/runtime/composables/useStickyListView.d.ts +60 -0
  71. package/dist/runtime/composables/useStickyListView.js +32 -0
  72. package/dist/runtime/lib/canonicalJson.d.ts +43 -0
  73. package/dist/runtime/lib/canonicalJson.js +38 -0
  74. package/dist/runtime/lib/dashboardIcons.d.ts +4 -0
  75. package/dist/runtime/lib/dashboardIcons.js +50 -0
  76. package/dist/runtime/lib/facets.d.ts +200 -0
  77. package/dist/runtime/lib/facets.js +171 -0
  78. package/dist/runtime/lib/gridTracks.d.ts +55 -0
  79. package/dist/runtime/lib/gridTracks.js +29 -0
  80. package/dist/runtime/lib/widgetRegistry.d.ts +124 -0
  81. package/dist/runtime/lib/widgetRegistry.js +66 -0
  82. package/dist/runtime/types/dashboard.d.ts +95 -0
  83. package/dist/runtime/types/dashboard.js +2 -0
  84. package/dist/types.d.mts +8 -0
  85. package/package.json +4 -3
@@ -0,0 +1,124 @@
1
+ <script setup>
2
+ defineProps({
3
+ shape: { type: String, required: true },
4
+ dimmed: { type: Boolean, required: false, default: false }
5
+ });
6
+ const BARS = [38, 62, 45, 80, 55, 92, 48, 70, 60, 85, 52, 74];
7
+ const RANKS = [100, 72, 54, 38, 26];
8
+ const FUNNEL = [100, 68, 34];
9
+ </script>
10
+
11
+ <template>
12
+ <div
13
+ class="pointer-events-none flex h-24 w-full flex-col justify-center gap-1.5 overflow-hidden rounded-md border border-black/[0.06] bg-gradient-to-b from-white to-black/[0.02] px-3 py-2.5"
14
+ :class="dimmed ? 'opacity-40 grayscale' : ''"
15
+ aria-hidden="true"
16
+ >
17
+ <!-- One number on a card — what a manifest `EntityCount` draws (PE-618). -->
18
+ <div v-if="shape === 'count'" class="flex h-full flex-col justify-center px-1">
19
+ <div class="h-1 w-1/3 rounded-full bg-black/10" />
20
+ <div class="mt-2 h-5 w-1/2 rounded-sm bg-black/25" />
21
+ <div class="mt-2 h-1 w-2/5 rounded-full bg-black/10" />
22
+ </div>
23
+
24
+ <!-- Four tiles with a number and a spark under each. -->
25
+ <div v-else-if="shape === 'kpi-row'" class="grid grid-cols-4 gap-1.5">
26
+ <div v-for="n in 4" :key="n" class="rounded border border-black/[0.06] bg-white px-1.5 py-1">
27
+ <div class="h-1 w-3/4 rounded-full bg-black/10" />
28
+ <div class="mt-1 h-2 w-2/3 rounded-sm bg-black/25" />
29
+ <div class="mt-1 h-0.5 w-full rounded-full bg-violet-400/60" />
30
+ </div>
31
+ </div>
32
+
33
+ <!-- Daily bars. -->
34
+ <div v-else-if="shape === 'bar-chart'" class="flex h-full items-end gap-[3px]">
35
+ <div
36
+ v-for="(h, i) in BARS"
37
+ :key="i"
38
+ class="flex-1 rounded-t-[2px] bg-violet-500/70"
39
+ :style="{ height: `${h}%` }"
40
+ />
41
+ </div>
42
+
43
+ <!-- Label + value + proportional bar, repeated. -->
44
+ <div v-else-if="shape === 'ranked-list'" class="flex flex-col gap-1.5">
45
+ <div v-for="(w, i) in RANKS.slice(0, 4)" :key="i">
46
+ <div class="flex items-center justify-between gap-2">
47
+ <div class="h-1 rounded-full bg-black/15" :style="{ width: `${30 + i % 3 * 14}%` }" />
48
+ <div class="h-1 w-5 rounded-full bg-black/20" />
49
+ </div>
50
+ <div class="mt-0.5 h-1 rounded-full bg-black/[0.06]">
51
+ <div class="h-full rounded-full bg-violet-500/70" :style="{ width: `${w}%` }" />
52
+ </div>
53
+ </div>
54
+ </div>
55
+
56
+ <!-- Narrowing stages. -->
57
+ <div v-else-if="shape === 'funnel'" class="flex flex-col gap-2">
58
+ <div v-for="(w, i) in FUNNEL" :key="i" class="flex items-center gap-2">
59
+ <div class="h-1 w-8 rounded-full bg-black/15" />
60
+ <div class="h-2 flex-1 rounded-full bg-black/[0.06]">
61
+ <div class="h-full rounded-full" :class="i === 2 ? 'bg-emerald-500/70' : 'bg-violet-500/70'" :style="{ width: `${w}%` }" />
62
+ </div>
63
+ </div>
64
+ </div>
65
+
66
+ <!-- Two or four big figures side by side. -->
67
+ <div v-else-if="shape === 'stat-split'" class="grid grid-cols-2 gap-2">
68
+ <div v-for="n in 4" :key="n" class="flex flex-col gap-1">
69
+ <div class="h-1 w-2/3 rounded-full bg-black/10" />
70
+ <div class="h-2.5 w-1/2 rounded-sm bg-black/25" />
71
+ </div>
72
+ </div>
73
+
74
+ <!-- Rows with an icon chip, two lines and a time on the right. -->
75
+ <div v-else-if="shape === 'feed'" class="flex flex-col gap-1.5">
76
+ <div v-for="n in 4" :key="n" class="flex items-center gap-2">
77
+ <div class="size-3.5 shrink-0 rounded bg-violet-400/40" />
78
+ <div class="min-w-0 flex-1">
79
+ <div class="h-1 rounded-full bg-black/15" :style="{ width: `${52 + n % 3 * 14}%` }" />
80
+ <div class="mt-0.5 h-1 w-1/3 rounded-full bg-black/[0.08]" />
81
+ </div>
82
+ <div class="h-1 w-3 shrink-0 rounded-full bg-black/10" />
83
+ </div>
84
+ </div>
85
+
86
+ <!-- Tiles with a state dot. -->
87
+ <div v-else-if="shape === 'status-grid'" class="grid grid-cols-2 gap-1.5">
88
+ <div v-for="n in 4" :key="n" class="flex items-center gap-1.5 rounded border border-black/[0.06] bg-white px-1.5 py-1.5">
89
+ <span class="size-1.5 rounded-full" :class="n === 3 ? 'bg-amber-500' : 'bg-emerald-500'" />
90
+ <div class="h-1 flex-1 rounded-full bg-black/12" />
91
+ </div>
92
+ </div>
93
+
94
+ <!-- Paragraph. -->
95
+ <div v-else-if="shape === 'text'" class="flex flex-col gap-1.5">
96
+ <div v-for="(w, i) in [96, 88, 92, 54]" :key="i" class="h-1.5 rounded-full bg-black/[0.10]" :style="{ width: `${w}%` }" />
97
+ </div>
98
+
99
+ <!-- Link rows with a chevron. -->
100
+ <div v-else-if="shape === 'links'" class="flex flex-col gap-1.5">
101
+ <div v-for="n in 4" :key="n" class="flex items-center justify-between gap-2 rounded px-1 py-1" :class="n === 1 ? 'bg-black/[0.03]' : ''">
102
+ <div class="h-1 rounded-full bg-black/15" :style="{ width: `${34 + n % 3 * 16}%` }" />
103
+ <div class="size-1.5 rotate-45 border-r border-t border-black/20" />
104
+ </div>
105
+ </div>
106
+
107
+ <!-- A greeting line with a row of action chips. -->
108
+ <div v-else-if="shape === 'greeting'" class="flex flex-col gap-2">
109
+ <div class="h-1 w-1/4 rounded-full bg-black/10" />
110
+ <div class="h-3 w-2/3 rounded-sm bg-black/20" />
111
+ <div class="flex gap-1.5">
112
+ <div v-for="n in 5" :key="n" class="size-4 rounded bg-black/[0.06]" />
113
+ </div>
114
+ </div>
115
+
116
+ <!-- Fallback: small multiples. -->
117
+ <div v-else class="grid grid-cols-3 gap-1.5">
118
+ <div v-for="n in 3" :key="n" class="rounded border border-black/[0.06] bg-white p-1.5">
119
+ <div class="h-1 w-2/3 rounded-full bg-black/10" />
120
+ <div class="mt-1 h-1 w-full rounded-full bg-violet-400/50" />
121
+ </div>
122
+ </div>
123
+ </div>
124
+ </template>
@@ -0,0 +1,22 @@
1
+ /**
2
+ * The picture on a widget's library card (PE-480).
3
+ *
4
+ * A schematic, not a screenshot and not the live widget. The Integration
5
+ * Studio's template gallery draws its preview from the workflow definition for
6
+ * the same reason: a maintained screenshot goes stale the first time the widget
7
+ * changes and nobody notices. Rendering the real widget instead would be
8
+ * accurate but would fire every widget's queries the moment the library opens.
9
+ *
10
+ * So each widget declares a `preview` shape, and this draws it — pure layout,
11
+ * no data, no requests. It says what the widget *looks* like, which is what a
12
+ * person picking from a list actually needs.
13
+ */
14
+ import type { WidgetPreviewShape } from '../../lib/widgetRegistry.js';
15
+ type __VLS_Props = {
16
+ shape: WidgetPreviewShape;
17
+ dimmed?: boolean;
18
+ };
19
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
20
+ dimmed: boolean;
21
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
22
+ export default _default;
@@ -1,3 +1,4 @@
1
+ import type { Facet, FacetSelection } from '../../lib/facets.js';
1
2
  import type { DataTableColumn, DataTableFilter, DataTableRail, DataTableSavedViews, DataTableState, DataTableViewMode, RowKey, SortState } from './types.js';
2
3
  declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
4
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
@@ -5,14 +6,18 @@ declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>
5
6
  readonly "onUpdate:page"?: ((value: number) => any) | undefined;
6
7
  readonly "onUpdate:viewMode"?: ((value: string) => any) | undefined;
7
8
  readonly "onUpdate:railOpen"?: ((value: boolean) => any) | undefined;
9
+ readonly "onUpdate:facetSelection"?: ((value: FacetSelection) => any) | undefined;
8
10
  readonly onRowClick?: ((row: T) => any) | undefined;
9
11
  readonly onStateChange?: ((state: DataTableState) => any) | undefined;
10
- } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onUpdate:sort" | "onUpdate:page" | "onUpdate:viewMode" | "onUpdate:railOpen" | "onRowClick" | "onStateChange"> & ({
12
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onUpdate:sort" | "onUpdate:page" | "onUpdate:viewMode" | "onUpdate:railOpen" | "onUpdate:facetSelection" | "onRowClick" | "onStateChange"> & ({
11
13
  data: T[];
12
14
  columns: DataTableColumn<T>[];
13
15
  rowKey: RowKey<T>;
16
+ /** `label` is the field's accessible name; it defaults to the placeholder
17
+ * where the surface wrote one (see `searchLabel`). */
14
18
  search?: boolean | {
15
19
  placeholder?: string;
20
+ label?: string;
16
21
  };
17
22
  columnsMenu?: boolean;
18
23
  /** Mount the surface's own filter panel in the toolbar's Filter popover
@@ -25,6 +30,25 @@ declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>
25
30
  /** Built-in status/dimension filter pills (static mode). One dimension, or
26
31
  * several (each renders as its own sub-menu). */
27
32
  filterTabs?: DataTableFilter<T> | DataTableFilter<T>[];
33
+ /**
34
+ * The surface's declared dimensions, as one facet model (PE-6xx).
35
+ *
36
+ * The THIRD filter path, and the one the others are being folded into. It
37
+ * differs from `filterTabs` in who does the work: those are filtered in
38
+ * memory here, which a server-paged list cannot use — a facet count taken
39
+ * over one page of fifty rows out of twenty-three thousand is a number
40
+ * nobody can reconcile with the table under it. Here the surface owns the
41
+ * query and the counts, and this component only draws the control and hands
42
+ * back a committed selection (`v-model:facet-selection`).
43
+ *
44
+ * EVERY declared dimension lives in this one panel, committed together, and
45
+ * reads back in one chip strip under the toolbar. There is deliberately no
46
+ * second placement: a tree pinned in a left column beside a panel is two
47
+ * places to look and two commit rules for one question.
48
+ */
49
+ facets?: Facet[];
50
+ /** Say which facet each chip belongs to (see `FacetChips.showFacet`). */
51
+ chipFacetLabels?: boolean;
28
52
  /** Saved views control — the surface supplies snapshot/apply, the table
29
53
  * owns the control, the storage and the dialogs. */
30
54
  savedViews?: DataTableSavedViews | null;
@@ -49,8 +73,13 @@ declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>
49
73
  * sitting above it. That is not a detail: a scrollbar takes width from the
50
74
  * scrolling box, so a header outside it stays wider than the rows and every
51
75
  * column drifts by however wide the scrollbar is.
76
+ *
77
+ * `'fit'` measures instead of guessing: the rows get whatever height is left
78
+ * in the surrounding scroll container, so the table ends where the page ends
79
+ * and nothing below it is pushed out of sight. A short list still ends after
80
+ * its last row — the measurement is a MAXIMUM, not a height.
52
81
  */
53
- scrollBody?: boolean | {
82
+ scrollBody?: boolean | "fit" | {
54
83
  maxHeight?: string;
55
84
  };
56
85
  pagination?: boolean | {
@@ -71,6 +100,13 @@ declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>
71
100
  page?: number;
72
101
  viewMode?: string;
73
102
  railOpen?: boolean;
103
+ /**
104
+ * The committed facet selection. Two-way so a chip removed under the toolbar,
105
+ * a facet picked in the surface's pinned rail and the panel's own Apply all
106
+ * write to one place — and so the surface can seed it from a saved view or a
107
+ * URL without this component holding a second copy to drift from.
108
+ */
109
+ facetSelection?: FacetSelection;
74
110
  }) & Partial<{}>> & import("vue").PublicProps;
75
111
  expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
76
112
  attrs: any;
@@ -98,7 +134,7 @@ declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>
98
134
  } & {
99
135
  empty?: (props: {}) => any;
100
136
  };
101
- emit: (((evt: "rowClick", row: T) => void) & ((evt: "stateChange", state: DataTableState) => void)) & (((evt: "update:sort", value: SortState) => void) & ((evt: "update:page", value: number) => void) & ((evt: "update:viewMode", value: string) => void) & ((evt: "update:railOpen", value: boolean) => void));
137
+ emit: (((evt: "rowClick", row: T) => void) & ((evt: "stateChange", state: DataTableState) => void)) & (((evt: "update:sort", value: SortState) => void) & ((evt: "update:page", value: number) => void) & ((evt: "update:viewMode", value: string) => void) & ((evt: "update:railOpen", value: boolean) => void) & ((evt: "update:facetSelection", value: FacetSelection) => void));
102
138
  }>) => import("vue").VNode & {
103
139
  __ctx?: Awaited<typeof __VLS_setup>;
104
140
  };