@appkit/dek-lib 0.3.0 → 0.5.1
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/data/types/gql.d.ts +2 -2
- package/dist/data/types/graphql.d.ts +3 -0
- package/dist/index.es.js +21 -16
- package/dist/index.umd.js +21 -16
- package/package.json +1 -1
package/dist/data/types/gql.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ declare const documents: {
|
|
|
14
14
|
"\n query userData {\n currentUser {\n id\n name\n email\n location\n avatar\n boards {\n id\n title\n key\n layout\n zones {\n key\n plugin\n component\n props {\n key\n value\n }\n containerProps {\n key\n value\n }\n }\n }\n commandGroups {\n title\n key\n commands {\n title\n plugin\n component\n props {\n key\n value\n }\n }\n }\n }\n }\n": DocumentNode<types.UserDataQuery, types.Exact<{
|
|
15
15
|
[key: string]: never;
|
|
16
16
|
}>>;
|
|
17
|
-
"\n query userPluginsAndIntegrations {\n currentUser {\n plugins {\n name\n code\n }\n integrations {\n key\n pluginName\n pluginVersion\n pluginConfig {\n key\n value\n }\n }\n }\n }\n": DocumentNode<types.UserPluginsAndIntegrationsQuery, types.Exact<{
|
|
17
|
+
"\n query userPluginsAndIntegrations {\n currentUser {\n plugins {\n name\n code\n version\n }\n integrations {\n key\n pluginName\n pluginVersion\n pluginConfig {\n key\n value\n }\n }\n }\n }\n": DocumentNode<types.UserPluginsAndIntegrationsQuery, types.Exact<{
|
|
18
18
|
[key: string]: never;
|
|
19
19
|
}>>;
|
|
20
20
|
"\n subscription userChange {\n userChange {\n user {\n id\n }\n }\n }\n": DocumentNode<types.UserChangeSubscription, types.Exact<{
|
|
@@ -41,7 +41,7 @@ export declare function gql(source: "\n query userData {\n currentUser {\n
|
|
|
41
41
|
/**
|
|
42
42
|
* The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
43
43
|
*/
|
|
44
|
-
export declare function gql(source: "\n query userPluginsAndIntegrations {\n currentUser {\n plugins {\n name\n code\n }\n integrations {\n key\n pluginName\n pluginVersion\n pluginConfig {\n key\n value\n }\n }\n }\n }\n"): (typeof documents)["\n query userPluginsAndIntegrations {\n currentUser {\n plugins {\n name\n code\n }\n integrations {\n key\n pluginName\n pluginVersion\n pluginConfig {\n key\n value\n }\n }\n }\n }\n"];
|
|
44
|
+
export declare function gql(source: "\n query userPluginsAndIntegrations {\n currentUser {\n plugins {\n name\n code\n version\n }\n integrations {\n key\n pluginName\n pluginVersion\n pluginConfig {\n key\n value\n }\n }\n }\n }\n"): (typeof documents)["\n query userPluginsAndIntegrations {\n currentUser {\n plugins {\n name\n code\n version\n }\n integrations {\n key\n pluginName\n pluginVersion\n pluginConfig {\n key\n value\n }\n }\n }\n }\n"];
|
|
45
45
|
/**
|
|
46
46
|
* The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
47
47
|
*/
|
|
@@ -697,11 +697,13 @@ export type PluginComponent = {
|
|
|
697
697
|
description: Scalars['String']['output'];
|
|
698
698
|
key: Scalars['String']['output'];
|
|
699
699
|
name: Scalars['String']['output'];
|
|
700
|
+
schema?: Maybe<Scalars['String']['output']>;
|
|
700
701
|
};
|
|
701
702
|
export type PluginComponentInput = {
|
|
702
703
|
description: Scalars['String']['input'];
|
|
703
704
|
key: Scalars['String']['input'];
|
|
704
705
|
name: Scalars['String']['input'];
|
|
706
|
+
schema?: InputMaybe<Scalars['String']['input']>;
|
|
705
707
|
};
|
|
706
708
|
export type PluginConfig = {
|
|
707
709
|
__typename?: 'PluginConfig';
|
|
@@ -1245,6 +1247,7 @@ export type UserPluginsAndIntegrationsQuery = {
|
|
|
1245
1247
|
__typename?: 'Plugin';
|
|
1246
1248
|
name: string;
|
|
1247
1249
|
code: string;
|
|
1250
|
+
version: string;
|
|
1248
1251
|
}>;
|
|
1249
1252
|
integrations: Array<{
|
|
1250
1253
|
__typename?: 'Integration';
|
package/dist/index.es.js
CHANGED
|
@@ -52075,11 +52075,11 @@ async function getClient(email, password) {
|
|
|
52075
52075
|
});
|
|
52076
52076
|
}
|
|
52077
52077
|
const UserDataDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "userData" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "currentUser" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "name" } }, { "kind": "Field", "name": { "kind": "Name", "value": "email" } }, { "kind": "Field", "name": { "kind": "Name", "value": "location" } }, { "kind": "Field", "name": { "kind": "Name", "value": "avatar" } }, { "kind": "Field", "name": { "kind": "Name", "value": "boards" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "title" } }, { "kind": "Field", "name": { "kind": "Name", "value": "key" } }, { "kind": "Field", "name": { "kind": "Name", "value": "layout" } }, { "kind": "Field", "name": { "kind": "Name", "value": "zones" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "key" } }, { "kind": "Field", "name": { "kind": "Name", "value": "plugin" } }, { "kind": "Field", "name": { "kind": "Name", "value": "component" } }, { "kind": "Field", "name": { "kind": "Name", "value": "props" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "key" } }, { "kind": "Field", "name": { "kind": "Name", "value": "value" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "containerProps" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "key" } }, { "kind": "Field", "name": { "kind": "Name", "value": "value" } }] } }] } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "commandGroups" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "title" } }, { "kind": "Field", "name": { "kind": "Name", "value": "key" } }, { "kind": "Field", "name": { "kind": "Name", "value": "commands" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "title" } }, { "kind": "Field", "name": { "kind": "Name", "value": "plugin" } }, { "kind": "Field", "name": { "kind": "Name", "value": "component" } }, { "kind": "Field", "name": { "kind": "Name", "value": "props" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "key" } }, { "kind": "Field", "name": { "kind": "Name", "value": "value" } }] } }] } }] } }] } }] } }] };
|
|
52078
|
-
const UserPluginsAndIntegrationsDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "userPluginsAndIntegrations" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "currentUser" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "plugins" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "name" } }, { "kind": "Field", "name": { "kind": "Name", "value": "code" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "integrations" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "key" } }, { "kind": "Field", "name": { "kind": "Name", "value": "pluginName" } }, { "kind": "Field", "name": { "kind": "Name", "value": "pluginVersion" } }, { "kind": "Field", "name": { "kind": "Name", "value": "pluginConfig" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "key" } }, { "kind": "Field", "name": { "kind": "Name", "value": "value" } }] } }] } }] } }] } }] };
|
|
52078
|
+
const UserPluginsAndIntegrationsDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "userPluginsAndIntegrations" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "currentUser" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "plugins" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "name" } }, { "kind": "Field", "name": { "kind": "Name", "value": "code" } }, { "kind": "Field", "name": { "kind": "Name", "value": "version" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "integrations" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "key" } }, { "kind": "Field", "name": { "kind": "Name", "value": "pluginName" } }, { "kind": "Field", "name": { "kind": "Name", "value": "pluginVersion" } }, { "kind": "Field", "name": { "kind": "Name", "value": "pluginConfig" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "key" } }, { "kind": "Field", "name": { "kind": "Name", "value": "value" } }] } }] } }] } }] } }] };
|
|
52079
52079
|
const UserChangeDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "subscription", "name": { "kind": "Name", "value": "userChange" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "userChange" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "user" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }] } }] } }] } }] };
|
|
52080
52080
|
const documents = {
|
|
52081
52081
|
"\n query userData {\n currentUser {\n id\n name\n email\n location\n avatar\n boards {\n id\n title\n key\n layout\n zones {\n key\n plugin\n component\n props {\n key\n value\n }\n containerProps {\n key\n value\n }\n }\n }\n commandGroups {\n title\n key\n commands {\n title\n plugin\n component\n props {\n key\n value\n }\n }\n }\n }\n }\n": UserDataDocument,
|
|
52082
|
-
"\n query userPluginsAndIntegrations {\n currentUser {\n plugins {\n name\n code\n }\n integrations {\n key\n pluginName\n pluginVersion\n pluginConfig {\n key\n value\n }\n }\n }\n }\n": UserPluginsAndIntegrationsDocument,
|
|
52082
|
+
"\n query userPluginsAndIntegrations {\n currentUser {\n plugins {\n name\n code\n version\n }\n integrations {\n key\n pluginName\n pluginVersion\n pluginConfig {\n key\n value\n }\n }\n }\n }\n": UserPluginsAndIntegrationsDocument,
|
|
52083
52083
|
"\n subscription userChange {\n userChange {\n user {\n id\n }\n }\n }\n": UserChangeDocument
|
|
52084
52084
|
};
|
|
52085
52085
|
function gql(source) {
|
|
@@ -57797,7 +57797,7 @@ async function updateData(email, password, plugin) {
|
|
|
57797
57797
|
let userData = await fetchUserData(email, password);
|
|
57798
57798
|
if (plugin) {
|
|
57799
57799
|
const pluginInstance = new plugin();
|
|
57800
|
-
if (pluginInstance.config
|
|
57800
|
+
if (!pluginInstance.config || pluginInstance.config.private !== "true") {
|
|
57801
57801
|
userData = _.cloneDeep(userData);
|
|
57802
57802
|
userData.boards = [
|
|
57803
57803
|
{
|
|
@@ -57822,6 +57822,7 @@ const USER_PLUGIN_AND_INTEGRATIONS_QUERY = gql(`
|
|
|
57822
57822
|
plugins {
|
|
57823
57823
|
name
|
|
57824
57824
|
code
|
|
57825
|
+
version
|
|
57825
57826
|
}
|
|
57826
57827
|
integrations {
|
|
57827
57828
|
key
|
|
@@ -57844,7 +57845,7 @@ async function fetchUserPlugins(email, password) {
|
|
|
57844
57845
|
result.integrations.push({
|
|
57845
57846
|
key: "base",
|
|
57846
57847
|
pluginName: "base",
|
|
57847
|
-
pluginVersion: "0.
|
|
57848
|
+
pluginVersion: "0.5.0",
|
|
57848
57849
|
pluginConfig: []
|
|
57849
57850
|
});
|
|
57850
57851
|
return result;
|
|
@@ -58019,7 +58020,7 @@ const Header = ({ height = 70 }) => {
|
|
|
58019
58020
|
};
|
|
58020
58021
|
const About = () => {
|
|
58021
58022
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(y0, { padding: 20, direction: "vert", children: [
|
|
58022
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(xT1, { children: `Dek ${"0.
|
|
58023
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(xT1, { children: `Dek ${"0.5.0"}` }),
|
|
58023
58024
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Y4, { children: "From Appkit" })
|
|
58024
58025
|
] });
|
|
58025
58026
|
};
|
|
@@ -58189,7 +58190,7 @@ const PluginDev = () => {
|
|
|
58189
58190
|
};
|
|
58190
58191
|
const SettingsScreen = ({ isPluginDev }) => {
|
|
58191
58192
|
const api2 = usePluginApi();
|
|
58192
|
-
|
|
58193
|
+
const isPrivatePluginDev = !isPluginDev && api2.plugin("plugin").available;
|
|
58193
58194
|
const [selectedKey, setSelectedKey] = useState$1(
|
|
58194
58195
|
isPluginDev ? "plugin-dev" : "boards"
|
|
58195
58196
|
);
|
|
@@ -58210,18 +58211,19 @@ const SettingsScreen = ({ isPluginDev }) => {
|
|
|
58210
58211
|
key: "about"
|
|
58211
58212
|
}
|
|
58212
58213
|
];
|
|
58213
|
-
if (isPluginDev) {
|
|
58214
|
-
menuItems.unshift({
|
|
58215
|
-
title: "Your Plugin",
|
|
58216
|
-
key: "plugin-dev"
|
|
58217
|
-
});
|
|
58218
|
-
} else {
|
|
58214
|
+
if (!isPluginDev || isPrivatePluginDev) {
|
|
58219
58215
|
menuItems.unshift({
|
|
58220
58216
|
title: "Boards",
|
|
58221
58217
|
key: "boards"
|
|
58222
58218
|
});
|
|
58223
58219
|
}
|
|
58224
|
-
|
|
58220
|
+
if (isPluginDev || isPrivatePluginDev) {
|
|
58221
|
+
menuItems.unshift({
|
|
58222
|
+
title: "Your Plugin",
|
|
58223
|
+
key: "plugin-dev"
|
|
58224
|
+
});
|
|
58225
|
+
}
|
|
58226
|
+
const title = isPluginDev && !isPrivatePluginDev ? "Plugin Development" : "Settings";
|
|
58225
58227
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(_Y1, { overlay: selectedKey !== "backgrounds", children: [
|
|
58226
58228
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(SY1, { fullscreen: true, cols: "250px auto", padding: 20, paddingTop: 90, gap: 20, children: [
|
|
58227
58229
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -93342,6 +93344,7 @@ const builtinPlugins = {
|
|
|
93342
93344
|
calendar: Plugin$1,
|
|
93343
93345
|
"home-assistant": Plugin3
|
|
93344
93346
|
};
|
|
93347
|
+
const pluginVersions = {};
|
|
93345
93348
|
const loadedDekPlugins = {};
|
|
93346
93349
|
const loadedDekPluginInstances = {};
|
|
93347
93350
|
let loadedLocalPlugin;
|
|
@@ -93365,10 +93368,9 @@ async function loadUserPlugin(code) {
|
|
|
93365
93368
|
return module2.exports;
|
|
93366
93369
|
}
|
|
93367
93370
|
function constructPluginInstance(integration, plugin) {
|
|
93368
|
-
console.log("constructPluginInstance", integration, plugin);
|
|
93369
93371
|
const pluginConfig = {
|
|
93370
93372
|
plugin: integration.pluginName,
|
|
93371
|
-
version: integration.pluginVersion || "",
|
|
93373
|
+
version: integration.pluginVersion || pluginVersions[integration.pluginName] || "latest",
|
|
93372
93374
|
integration: integration.key
|
|
93373
93375
|
};
|
|
93374
93376
|
for (const config2 of integration.pluginConfig) {
|
|
@@ -93444,6 +93446,9 @@ async function updatePlugins(email, password) {
|
|
|
93444
93446
|
updateStateLoading(true);
|
|
93445
93447
|
await unloadAllPlugins();
|
|
93446
93448
|
const integrationsAndPlugins = await fetchUserPlugins(email, password);
|
|
93449
|
+
integrationsAndPlugins.plugins.forEach((plugin) => {
|
|
93450
|
+
pluginVersions[plugin.name] = plugin.version;
|
|
93451
|
+
});
|
|
93447
93452
|
await loadPlugins(integrationsAndPlugins);
|
|
93448
93453
|
updateStatePlugins(getAllPlugins());
|
|
93449
93454
|
updateStatePluginInstances(getAllPluginInstances());
|
|
@@ -93458,7 +93463,7 @@ async function updateLocalPlugin(plugin) {
|
|
|
93458
93463
|
updateStateLoading(true);
|
|
93459
93464
|
const integration = {
|
|
93460
93465
|
pluginName: "local",
|
|
93461
|
-
pluginVersion: "
|
|
93466
|
+
pluginVersion: "latest",
|
|
93462
93467
|
key: "local",
|
|
93463
93468
|
pluginConfig: []
|
|
93464
93469
|
};
|
package/dist/index.umd.js
CHANGED
|
@@ -52092,11 +52092,11 @@ Arguments: ` + Array.prototype.slice.call(h2).join("") + `
|
|
|
52092
52092
|
});
|
|
52093
52093
|
}
|
|
52094
52094
|
const UserDataDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "userData" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "currentUser" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "name" } }, { "kind": "Field", "name": { "kind": "Name", "value": "email" } }, { "kind": "Field", "name": { "kind": "Name", "value": "location" } }, { "kind": "Field", "name": { "kind": "Name", "value": "avatar" } }, { "kind": "Field", "name": { "kind": "Name", "value": "boards" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "title" } }, { "kind": "Field", "name": { "kind": "Name", "value": "key" } }, { "kind": "Field", "name": { "kind": "Name", "value": "layout" } }, { "kind": "Field", "name": { "kind": "Name", "value": "zones" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "key" } }, { "kind": "Field", "name": { "kind": "Name", "value": "plugin" } }, { "kind": "Field", "name": { "kind": "Name", "value": "component" } }, { "kind": "Field", "name": { "kind": "Name", "value": "props" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "key" } }, { "kind": "Field", "name": { "kind": "Name", "value": "value" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "containerProps" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "key" } }, { "kind": "Field", "name": { "kind": "Name", "value": "value" } }] } }] } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "commandGroups" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "title" } }, { "kind": "Field", "name": { "kind": "Name", "value": "key" } }, { "kind": "Field", "name": { "kind": "Name", "value": "commands" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "title" } }, { "kind": "Field", "name": { "kind": "Name", "value": "plugin" } }, { "kind": "Field", "name": { "kind": "Name", "value": "component" } }, { "kind": "Field", "name": { "kind": "Name", "value": "props" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "key" } }, { "kind": "Field", "name": { "kind": "Name", "value": "value" } }] } }] } }] } }] } }] } }] };
|
|
52095
|
-
const UserPluginsAndIntegrationsDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "userPluginsAndIntegrations" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "currentUser" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "plugins" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "name" } }, { "kind": "Field", "name": { "kind": "Name", "value": "code" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "integrations" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "key" } }, { "kind": "Field", "name": { "kind": "Name", "value": "pluginName" } }, { "kind": "Field", "name": { "kind": "Name", "value": "pluginVersion" } }, { "kind": "Field", "name": { "kind": "Name", "value": "pluginConfig" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "key" } }, { "kind": "Field", "name": { "kind": "Name", "value": "value" } }] } }] } }] } }] } }] };
|
|
52095
|
+
const UserPluginsAndIntegrationsDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "userPluginsAndIntegrations" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "currentUser" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "plugins" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "name" } }, { "kind": "Field", "name": { "kind": "Name", "value": "code" } }, { "kind": "Field", "name": { "kind": "Name", "value": "version" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "integrations" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "key" } }, { "kind": "Field", "name": { "kind": "Name", "value": "pluginName" } }, { "kind": "Field", "name": { "kind": "Name", "value": "pluginVersion" } }, { "kind": "Field", "name": { "kind": "Name", "value": "pluginConfig" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "key" } }, { "kind": "Field", "name": { "kind": "Name", "value": "value" } }] } }] } }] } }] } }] };
|
|
52096
52096
|
const UserChangeDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "subscription", "name": { "kind": "Name", "value": "userChange" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "userChange" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "user" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }] } }] } }] } }] };
|
|
52097
52097
|
const documents = {
|
|
52098
52098
|
"\n query userData {\n currentUser {\n id\n name\n email\n location\n avatar\n boards {\n id\n title\n key\n layout\n zones {\n key\n plugin\n component\n props {\n key\n value\n }\n containerProps {\n key\n value\n }\n }\n }\n commandGroups {\n title\n key\n commands {\n title\n plugin\n component\n props {\n key\n value\n }\n }\n }\n }\n }\n": UserDataDocument,
|
|
52099
|
-
"\n query userPluginsAndIntegrations {\n currentUser {\n plugins {\n name\n code\n }\n integrations {\n key\n pluginName\n pluginVersion\n pluginConfig {\n key\n value\n }\n }\n }\n }\n": UserPluginsAndIntegrationsDocument,
|
|
52099
|
+
"\n query userPluginsAndIntegrations {\n currentUser {\n plugins {\n name\n code\n version\n }\n integrations {\n key\n pluginName\n pluginVersion\n pluginConfig {\n key\n value\n }\n }\n }\n }\n": UserPluginsAndIntegrationsDocument,
|
|
52100
52100
|
"\n subscription userChange {\n userChange {\n user {\n id\n }\n }\n }\n": UserChangeDocument
|
|
52101
52101
|
};
|
|
52102
52102
|
function gql(source) {
|
|
@@ -57814,7 +57814,7 @@ Arguments: ` + Array.prototype.slice.call(h2).join("") + `
|
|
|
57814
57814
|
let userData = await fetchUserData(email, password);
|
|
57815
57815
|
if (plugin) {
|
|
57816
57816
|
const pluginInstance = new plugin();
|
|
57817
|
-
if (pluginInstance.config
|
|
57817
|
+
if (!pluginInstance.config || pluginInstance.config.private !== "true") {
|
|
57818
57818
|
userData = _.cloneDeep(userData);
|
|
57819
57819
|
userData.boards = [
|
|
57820
57820
|
{
|
|
@@ -57839,6 +57839,7 @@ Arguments: ` + Array.prototype.slice.call(h2).join("") + `
|
|
|
57839
57839
|
plugins {
|
|
57840
57840
|
name
|
|
57841
57841
|
code
|
|
57842
|
+
version
|
|
57842
57843
|
}
|
|
57843
57844
|
integrations {
|
|
57844
57845
|
key
|
|
@@ -57861,7 +57862,7 @@ Arguments: ` + Array.prototype.slice.call(h2).join("") + `
|
|
|
57861
57862
|
result.integrations.push({
|
|
57862
57863
|
key: "base",
|
|
57863
57864
|
pluginName: "base",
|
|
57864
|
-
pluginVersion: "0.
|
|
57865
|
+
pluginVersion: "0.5.0",
|
|
57865
57866
|
pluginConfig: []
|
|
57866
57867
|
});
|
|
57867
57868
|
return result;
|
|
@@ -58036,7 +58037,7 @@ Arguments: ` + Array.prototype.slice.call(h2).join("") + `
|
|
|
58036
58037
|
};
|
|
58037
58038
|
const About = () => {
|
|
58038
58039
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(y0, { padding: 20, direction: "vert", children: [
|
|
58039
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(xT1, { children: `Dek ${"0.
|
|
58040
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(xT1, { children: `Dek ${"0.5.0"}` }),
|
|
58040
58041
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Y4, { children: "From Appkit" })
|
|
58041
58042
|
] });
|
|
58042
58043
|
};
|
|
@@ -58206,7 +58207,7 @@ Arguments: ` + Array.prototype.slice.call(h2).join("") + `
|
|
|
58206
58207
|
};
|
|
58207
58208
|
const SettingsScreen = ({ isPluginDev }) => {
|
|
58208
58209
|
const api2 = usePluginApi();
|
|
58209
|
-
|
|
58210
|
+
const isPrivatePluginDev = !isPluginDev && api2.plugin("plugin").available;
|
|
58210
58211
|
const [selectedKey, setSelectedKey] = React$3.useState(
|
|
58211
58212
|
isPluginDev ? "plugin-dev" : "boards"
|
|
58212
58213
|
);
|
|
@@ -58227,18 +58228,19 @@ Arguments: ` + Array.prototype.slice.call(h2).join("") + `
|
|
|
58227
58228
|
key: "about"
|
|
58228
58229
|
}
|
|
58229
58230
|
];
|
|
58230
|
-
if (isPluginDev) {
|
|
58231
|
-
menuItems.unshift({
|
|
58232
|
-
title: "Your Plugin",
|
|
58233
|
-
key: "plugin-dev"
|
|
58234
|
-
});
|
|
58235
|
-
} else {
|
|
58231
|
+
if (!isPluginDev || isPrivatePluginDev) {
|
|
58236
58232
|
menuItems.unshift({
|
|
58237
58233
|
title: "Boards",
|
|
58238
58234
|
key: "boards"
|
|
58239
58235
|
});
|
|
58240
58236
|
}
|
|
58241
|
-
|
|
58237
|
+
if (isPluginDev || isPrivatePluginDev) {
|
|
58238
|
+
menuItems.unshift({
|
|
58239
|
+
title: "Your Plugin",
|
|
58240
|
+
key: "plugin-dev"
|
|
58241
|
+
});
|
|
58242
|
+
}
|
|
58243
|
+
const title = isPluginDev && !isPrivatePluginDev ? "Plugin Development" : "Settings";
|
|
58242
58244
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(_Y1, { overlay: selectedKey !== "backgrounds", children: [
|
|
58243
58245
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(SY1, { fullscreen: true, cols: "250px auto", padding: 20, paddingTop: 90, gap: 20, children: [
|
|
58244
58246
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -93359,6 +93361,7 @@ Arguments: ` + Array.prototype.slice.call(h2).join("") + `
|
|
|
93359
93361
|
calendar: Plugin$1,
|
|
93360
93362
|
"home-assistant": Plugin
|
|
93361
93363
|
};
|
|
93364
|
+
const pluginVersions = {};
|
|
93362
93365
|
const loadedDekPlugins = {};
|
|
93363
93366
|
const loadedDekPluginInstances = {};
|
|
93364
93367
|
let loadedLocalPlugin;
|
|
@@ -93382,10 +93385,9 @@ Arguments: ` + Array.prototype.slice.call(h2).join("") + `
|
|
|
93382
93385
|
return module2.exports;
|
|
93383
93386
|
}
|
|
93384
93387
|
function constructPluginInstance(integration, plugin) {
|
|
93385
|
-
console.log("constructPluginInstance", integration, plugin);
|
|
93386
93388
|
const pluginConfig = {
|
|
93387
93389
|
plugin: integration.pluginName,
|
|
93388
|
-
version: integration.pluginVersion || "",
|
|
93390
|
+
version: integration.pluginVersion || pluginVersions[integration.pluginName] || "latest",
|
|
93389
93391
|
integration: integration.key
|
|
93390
93392
|
};
|
|
93391
93393
|
for (const config2 of integration.pluginConfig) {
|
|
@@ -93461,6 +93463,9 @@ Arguments: ` + Array.prototype.slice.call(h2).join("") + `
|
|
|
93461
93463
|
updateStateLoading(true);
|
|
93462
93464
|
await unloadAllPlugins();
|
|
93463
93465
|
const integrationsAndPlugins = await fetchUserPlugins(email, password);
|
|
93466
|
+
integrationsAndPlugins.plugins.forEach((plugin) => {
|
|
93467
|
+
pluginVersions[plugin.name] = plugin.version;
|
|
93468
|
+
});
|
|
93464
93469
|
await loadPlugins(integrationsAndPlugins);
|
|
93465
93470
|
updateStatePlugins(getAllPlugins());
|
|
93466
93471
|
updateStatePluginInstances(getAllPluginInstances());
|
|
@@ -93475,7 +93480,7 @@ Arguments: ` + Array.prototype.slice.call(h2).join("") + `
|
|
|
93475
93480
|
updateStateLoading(true);
|
|
93476
93481
|
const integration = {
|
|
93477
93482
|
pluginName: "local",
|
|
93478
|
-
pluginVersion: "
|
|
93483
|
+
pluginVersion: "latest",
|
|
93479
93484
|
key: "local",
|
|
93480
93485
|
pluginConfig: []
|
|
93481
93486
|
};
|