@trops/dash-core 0.1.103 → 0.1.104
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/electron/index.js +75 -3
- package/dist/electron/index.js.map +1 -1
- package/dist/index.esm.js +39 -7
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +39 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/electron/index.js
CHANGED
|
@@ -594,6 +594,7 @@ const DASHBOARD_CONFIG_PUBLISH$1 = "dashboard-config-publish";
|
|
|
594
594
|
const DASHBOARD_CONFIG_PREVIEW$1 = "dashboard-config-preview";
|
|
595
595
|
const DASHBOARD_CONFIG_CHECK_UPDATES$1 = "dashboard-config-check-updates";
|
|
596
596
|
const DASHBOARD_CONFIG_PROVIDER_SETUP$1 = "dashboard-config-provider-setup";
|
|
597
|
+
const DASHBOARD_CONFIG_PUBLISH_PREVIEW$1 = "dashboard-config-publish-preview";
|
|
597
598
|
|
|
598
599
|
var dashboardConfigEvents$1 = {
|
|
599
600
|
DASHBOARD_CONFIG_EXPORT: DASHBOARD_CONFIG_EXPORT$1,
|
|
@@ -604,6 +605,7 @@ var dashboardConfigEvents$1 = {
|
|
|
604
605
|
DASHBOARD_CONFIG_PREVIEW: DASHBOARD_CONFIG_PREVIEW$1,
|
|
605
606
|
DASHBOARD_CONFIG_CHECK_UPDATES: DASHBOARD_CONFIG_CHECK_UPDATES$1,
|
|
606
607
|
DASHBOARD_CONFIG_PROVIDER_SETUP: DASHBOARD_CONFIG_PROVIDER_SETUP$1,
|
|
608
|
+
DASHBOARD_CONFIG_PUBLISH_PREVIEW: DASHBOARD_CONFIG_PUBLISH_PREVIEW$1,
|
|
607
609
|
};
|
|
608
610
|
|
|
609
611
|
/**
|
|
@@ -11072,9 +11074,15 @@ async function prepareDashboardForPublish$1(
|
|
|
11072
11074
|
let missingFromRegistry = [];
|
|
11073
11075
|
if (!registryCheckFailed) {
|
|
11074
11076
|
const registryNames = new Set(registryPackages.map((p) => p.name));
|
|
11075
|
-
missingFromRegistry =
|
|
11076
|
-
|
|
11077
|
-
|
|
11077
|
+
missingFromRegistry = [
|
|
11078
|
+
...new Set(
|
|
11079
|
+
widgets
|
|
11080
|
+
.filter(
|
|
11081
|
+
(w) => w.required !== false && !registryNames.has(w.package),
|
|
11082
|
+
)
|
|
11083
|
+
.map((w) => w.package),
|
|
11084
|
+
),
|
|
11085
|
+
];
|
|
11078
11086
|
}
|
|
11079
11087
|
|
|
11080
11088
|
// 6. Generate registry manifest
|
|
@@ -11287,6 +11295,52 @@ function getProviderSetupManifest$1(appId, requiredProviders = []) {
|
|
|
11287
11295
|
return buildProviderSetupManifest(requiredProviders, configuredProviders);
|
|
11288
11296
|
}
|
|
11289
11297
|
|
|
11298
|
+
/**
|
|
11299
|
+
* Get a publish preview for a dashboard workspace.
|
|
11300
|
+
* Returns widget/layout info without creating a ZIP or uploading.
|
|
11301
|
+
*
|
|
11302
|
+
* @param {string} appId - Application identifier
|
|
11303
|
+
* @param {number|string} workspaceId - Workspace to preview
|
|
11304
|
+
* @param {Object} widgetRegistry - WidgetRegistry instance (optional)
|
|
11305
|
+
* @returns {Object} Preview with dashboardName, widgetCount, widgets, componentNames
|
|
11306
|
+
*/
|
|
11307
|
+
function getDashboardPublishPreview$1(appId, workspaceId, widgetRegistry = null) {
|
|
11308
|
+
try {
|
|
11309
|
+
const filename = path$1.join(
|
|
11310
|
+
app$1.getPath("userData"),
|
|
11311
|
+
appName$1,
|
|
11312
|
+
appId,
|
|
11313
|
+
configFilename,
|
|
11314
|
+
);
|
|
11315
|
+
const workspacesArray = getFileContents$1(filename);
|
|
11316
|
+
const workspace = workspacesArray.find(
|
|
11317
|
+
(w) => w.id === workspaceId || w.id === Number(workspaceId),
|
|
11318
|
+
);
|
|
11319
|
+
|
|
11320
|
+
if (!workspace) {
|
|
11321
|
+
return { success: false, error: `Workspace not found: ${workspaceId}` };
|
|
11322
|
+
}
|
|
11323
|
+
|
|
11324
|
+
const layout = workspace.layout || [];
|
|
11325
|
+
const componentNames = collectComponentNames(layout);
|
|
11326
|
+
const widgets = buildWidgetDependencies(componentNames, widgetRegistry);
|
|
11327
|
+
|
|
11328
|
+
return {
|
|
11329
|
+
success: true,
|
|
11330
|
+
dashboardName: workspace.name || workspace.label || "Dashboard",
|
|
11331
|
+
widgetCount: componentNames.length,
|
|
11332
|
+
widgets: widgets.map((w) => ({ name: w.name, package: w.package })),
|
|
11333
|
+
componentNames: [...componentNames],
|
|
11334
|
+
};
|
|
11335
|
+
} catch (error) {
|
|
11336
|
+
console.error(
|
|
11337
|
+
"[DashboardConfigController] Error getting publish preview:",
|
|
11338
|
+
error,
|
|
11339
|
+
);
|
|
11340
|
+
return { success: false, error: error.message };
|
|
11341
|
+
}
|
|
11342
|
+
}
|
|
11343
|
+
|
|
11290
11344
|
var dashboardConfigController$1 = {
|
|
11291
11345
|
exportDashboardConfig: exportDashboardConfig$1,
|
|
11292
11346
|
importDashboardConfig: importDashboardConfig$1,
|
|
@@ -11296,6 +11350,7 @@ var dashboardConfigController$1 = {
|
|
|
11296
11350
|
getDashboardPreview: getDashboardPreview$1,
|
|
11297
11351
|
checkDashboardUpdatesForApp: checkDashboardUpdatesForApp$1,
|
|
11298
11352
|
getProviderSetupManifest: getProviderSetupManifest$1,
|
|
11353
|
+
getDashboardPublishPreview: getDashboardPublishPreview$1,
|
|
11299
11354
|
};
|
|
11300
11355
|
|
|
11301
11356
|
/**
|
|
@@ -11551,6 +11606,7 @@ const {
|
|
|
11551
11606
|
getDashboardPreview,
|
|
11552
11607
|
checkDashboardUpdatesForApp,
|
|
11553
11608
|
getProviderSetupManifest,
|
|
11609
|
+
getDashboardPublishPreview,
|
|
11554
11610
|
} = dashboardConfigController$1;
|
|
11555
11611
|
const {
|
|
11556
11612
|
initiateDeviceFlow,
|
|
@@ -11621,6 +11677,7 @@ var controller = {
|
|
|
11621
11677
|
getDashboardPreview,
|
|
11622
11678
|
checkDashboardUpdatesForApp,
|
|
11623
11679
|
getProviderSetupManifest,
|
|
11680
|
+
getDashboardPublishPreview,
|
|
11624
11681
|
saveDashboardRating,
|
|
11625
11682
|
getDashboardRating,
|
|
11626
11683
|
listDashboardRatings,
|
|
@@ -13018,6 +13075,7 @@ const {
|
|
|
13018
13075
|
DASHBOARD_CONFIG_PREVIEW,
|
|
13019
13076
|
DASHBOARD_CONFIG_CHECK_UPDATES,
|
|
13020
13077
|
DASHBOARD_CONFIG_PROVIDER_SETUP,
|
|
13078
|
+
DASHBOARD_CONFIG_PUBLISH_PREVIEW,
|
|
13021
13079
|
} = events$8;
|
|
13022
13080
|
|
|
13023
13081
|
const dashboardConfigApi$2 = {
|
|
@@ -13123,6 +13181,20 @@ const dashboardConfigApi$2 = {
|
|
|
13123
13181
|
appId,
|
|
13124
13182
|
requiredProviders,
|
|
13125
13183
|
}),
|
|
13184
|
+
|
|
13185
|
+
/**
|
|
13186
|
+
* Get a publish preview for a dashboard workspace.
|
|
13187
|
+
* Returns widget names and package info without creating a ZIP or uploading.
|
|
13188
|
+
*
|
|
13189
|
+
* @param {string} appId - Application identifier
|
|
13190
|
+
* @param {number|string} workspaceId - Workspace to preview
|
|
13191
|
+
* @returns {Promise<Object>} Preview with dashboardName, widgetCount, widgets, componentNames
|
|
13192
|
+
*/
|
|
13193
|
+
getPublishPreview: (appId, workspaceId) =>
|
|
13194
|
+
ipcRenderer$3.invoke(DASHBOARD_CONFIG_PUBLISH_PREVIEW, {
|
|
13195
|
+
appId,
|
|
13196
|
+
workspaceId,
|
|
13197
|
+
}),
|
|
13126
13198
|
};
|
|
13127
13199
|
|
|
13128
13200
|
var dashboardConfigApi_1 = dashboardConfigApi$2;
|