@appkit/dek-lib 0.8.1 → 0.8.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.
- package/dist/index.es.js +21 -23
- package/dist/index.umd.js +21 -23
- package/dist/lib/state.d.ts +2 -3
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -939,7 +939,7 @@ class Api {
|
|
|
939
939
|
if (!component) {
|
|
940
940
|
return;
|
|
941
941
|
}
|
|
942
|
-
return component.element(props);
|
|
942
|
+
return component.element({ ...props, plugin });
|
|
943
943
|
}
|
|
944
944
|
}
|
|
945
945
|
getComponentSchema(integrationKey, componentKey) {
|
|
@@ -58158,16 +58158,17 @@ async function fetchUserData(email, password) {
|
|
|
58158
58158
|
}
|
|
58159
58159
|
const state$1 = proxy({
|
|
58160
58160
|
plugins: {},
|
|
58161
|
-
pluginInstances: {},
|
|
58162
58161
|
data: null,
|
|
58163
58162
|
loading: false,
|
|
58164
58163
|
version: 0
|
|
58165
58164
|
});
|
|
58166
|
-
|
|
58167
|
-
|
|
58165
|
+
let pluginInstances = {};
|
|
58166
|
+
function getPluginInstances() {
|
|
58167
|
+
return pluginInstances;
|
|
58168
58168
|
}
|
|
58169
|
-
function
|
|
58170
|
-
|
|
58169
|
+
function updateStatePlugins(plugins, instances) {
|
|
58170
|
+
pluginInstances = instances;
|
|
58171
|
+
state$1.plugins = plugins;
|
|
58171
58172
|
}
|
|
58172
58173
|
function updateStateData(data) {
|
|
58173
58174
|
state$1.data = data;
|
|
@@ -58228,7 +58229,7 @@ async function fetchUserPlugins(email, password) {
|
|
|
58228
58229
|
result.integrations.push({
|
|
58229
58230
|
key: "base",
|
|
58230
58231
|
pluginName: "base",
|
|
58231
|
-
pluginVersion: "0.8.
|
|
58232
|
+
pluginVersion: "0.8.2",
|
|
58232
58233
|
pluginConfig: []
|
|
58233
58234
|
});
|
|
58234
58235
|
return result;
|
|
@@ -58403,7 +58404,7 @@ const Header = ({ height = 70 }) => {
|
|
|
58403
58404
|
};
|
|
58404
58405
|
const About = () => {
|
|
58405
58406
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(x0, { padding: 20, direction: "vert", children: [
|
|
58406
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(hF1, { children: `Dek ${"0.8.
|
|
58407
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(hF1, { children: `Dek ${"0.8.2"}` }),
|
|
58407
58408
|
/* @__PURE__ */ jsxRuntimeExports.jsx(X4, { children: "From Appkit" })
|
|
58408
58409
|
] });
|
|
58409
58410
|
};
|
|
@@ -93861,14 +93862,12 @@ async function updatePlugins(email, password) {
|
|
|
93861
93862
|
pluginVersions[plugin.name] = plugin.version;
|
|
93862
93863
|
});
|
|
93863
93864
|
await loadPlugins(integrationsAndPlugins);
|
|
93864
|
-
updateStatePlugins(getAllPlugins());
|
|
93865
|
-
updateStatePluginInstances(getAllPluginInstances());
|
|
93865
|
+
updateStatePlugins(getAllPlugins(), getAllPluginInstances());
|
|
93866
93866
|
updateStateLoading(false);
|
|
93867
93867
|
}
|
|
93868
93868
|
async function unloadPlugins() {
|
|
93869
93869
|
await unloadAllPlugins();
|
|
93870
|
-
updateStatePlugins(getAllPlugins());
|
|
93871
|
-
updateStatePluginInstances(getAllPluginInstances());
|
|
93870
|
+
updateStatePlugins(getAllPlugins(), getAllPluginInstances());
|
|
93872
93871
|
}
|
|
93873
93872
|
async function updateLocalPlugin(plugin, pluginConfig) {
|
|
93874
93873
|
updateStateLoading(true);
|
|
@@ -93887,8 +93886,7 @@ async function updateLocalPlugin(plugin, pluginConfig) {
|
|
|
93887
93886
|
if (loadedLocalPluginInstance && loadedLocalPluginInstance.load) {
|
|
93888
93887
|
await loadedLocalPluginInstance.load(window.__dek_api);
|
|
93889
93888
|
}
|
|
93890
|
-
updateStatePlugins(getAllPlugins());
|
|
93891
|
-
updateStatePluginInstances(getAllPluginInstances());
|
|
93889
|
+
updateStatePlugins(getAllPlugins(), getAllPluginInstances());
|
|
93892
93890
|
updateStateLoading(false);
|
|
93893
93891
|
}
|
|
93894
93892
|
async function unloadLocalPlugin() {
|
|
@@ -93897,8 +93895,7 @@ async function unloadLocalPlugin() {
|
|
|
93897
93895
|
}
|
|
93898
93896
|
loadedLocalPluginInstance = void 0;
|
|
93899
93897
|
loadedLocalPlugin = void 0;
|
|
93900
|
-
updateStatePlugins(getAllPlugins());
|
|
93901
|
-
updateStatePluginInstances(getAllPluginInstances());
|
|
93898
|
+
updateStatePlugins(getAllPlugins(), getAllPluginInstances());
|
|
93902
93899
|
}
|
|
93903
93900
|
function useUserConfig(email, password, plugin, pluginConfig) {
|
|
93904
93901
|
const userConfig = useSnapshot(state$1);
|
|
@@ -93927,7 +93924,7 @@ function useUserConfig(email, password, plugin, pluginConfig) {
|
|
|
93927
93924
|
globals.commandGroups = userConfig.data.commandGroups;
|
|
93928
93925
|
}
|
|
93929
93926
|
globals.plugins = userConfig.plugins;
|
|
93930
|
-
globals.pluginInstances =
|
|
93927
|
+
globals.pluginInstances = getPluginInstances();
|
|
93931
93928
|
return userConfig;
|
|
93932
93929
|
}
|
|
93933
93930
|
const Background = () => {
|
|
@@ -94926,15 +94923,16 @@ const Router = ({ userConfig, transitionDelay: transitionDelay2 }) => {
|
|
|
94926
94923
|
const [location2, setLocation] = useLocation();
|
|
94927
94924
|
const [container, setContainer] = useState$1(null);
|
|
94928
94925
|
const [containerNodeRef, setContainerNodeRef] = useState$1(null);
|
|
94929
|
-
const { data
|
|
94926
|
+
const { data } = userConfig;
|
|
94927
|
+
const pluginInstances2 = getPluginInstances();
|
|
94930
94928
|
useEffect$1(() => {
|
|
94931
94929
|
const loadRoutes = async () => {
|
|
94932
94930
|
var _a2, _b2;
|
|
94933
94931
|
const newRoutes = [];
|
|
94934
94932
|
const newBoardKeys = [];
|
|
94935
|
-
if (
|
|
94936
|
-
for (const key in
|
|
94937
|
-
(_a2 =
|
|
94933
|
+
if (pluginInstances2) {
|
|
94934
|
+
for (const key in pluginInstances2) {
|
|
94935
|
+
(_a2 = pluginInstances2[key].screens) == null ? void 0 : _a2.forEach((screen) => {
|
|
94938
94936
|
newRoutes.push({
|
|
94939
94937
|
type: "screen",
|
|
94940
94938
|
plugin: key,
|
|
@@ -94943,7 +94941,7 @@ const Router = ({ userConfig, transitionDelay: transitionDelay2 }) => {
|
|
|
94943
94941
|
nodeRef: createRef()
|
|
94944
94942
|
});
|
|
94945
94943
|
});
|
|
94946
|
-
(_b2 =
|
|
94944
|
+
(_b2 = pluginInstances2[key].boards) == null ? void 0 : _b2.forEach((board) => {
|
|
94947
94945
|
newBoardKeys.push("/" + board.key);
|
|
94948
94946
|
});
|
|
94949
94947
|
}
|
|
@@ -94961,7 +94959,7 @@ const Router = ({ userConfig, transitionDelay: transitionDelay2 }) => {
|
|
|
94961
94959
|
setBoardKeys(newBoardKeys);
|
|
94962
94960
|
};
|
|
94963
94961
|
loadRoutes();
|
|
94964
|
-
}, [
|
|
94962
|
+
}, [pluginInstances2, data == null ? void 0 : data.boards]);
|
|
94965
94963
|
useEffect$1(() => {
|
|
94966
94964
|
const { nodeRef } = routes.find((route) => {
|
|
94967
94965
|
let path = "/:boardKey";
|
package/dist/index.umd.js
CHANGED
|
@@ -956,7 +956,7 @@ var __publicField = (obj, key, value) => {
|
|
|
956
956
|
if (!component) {
|
|
957
957
|
return;
|
|
958
958
|
}
|
|
959
|
-
return component.element(props);
|
|
959
|
+
return component.element({ ...props, plugin });
|
|
960
960
|
}
|
|
961
961
|
}
|
|
962
962
|
getComponentSchema(integrationKey, componentKey) {
|
|
@@ -58175,16 +58175,17 @@ Arguments: ` + Array.prototype.slice.call(h2).join("") + `
|
|
|
58175
58175
|
}
|
|
58176
58176
|
const state$1 = proxy({
|
|
58177
58177
|
plugins: {},
|
|
58178
|
-
pluginInstances: {},
|
|
58179
58178
|
data: null,
|
|
58180
58179
|
loading: false,
|
|
58181
58180
|
version: 0
|
|
58182
58181
|
});
|
|
58183
|
-
|
|
58184
|
-
|
|
58182
|
+
let pluginInstances = {};
|
|
58183
|
+
function getPluginInstances() {
|
|
58184
|
+
return pluginInstances;
|
|
58185
58185
|
}
|
|
58186
|
-
function
|
|
58187
|
-
|
|
58186
|
+
function updateStatePlugins(plugins, instances) {
|
|
58187
|
+
pluginInstances = instances;
|
|
58188
|
+
state$1.plugins = plugins;
|
|
58188
58189
|
}
|
|
58189
58190
|
function updateStateData(data) {
|
|
58190
58191
|
state$1.data = data;
|
|
@@ -58245,7 +58246,7 @@ Arguments: ` + Array.prototype.slice.call(h2).join("") + `
|
|
|
58245
58246
|
result.integrations.push({
|
|
58246
58247
|
key: "base",
|
|
58247
58248
|
pluginName: "base",
|
|
58248
|
-
pluginVersion: "0.8.
|
|
58249
|
+
pluginVersion: "0.8.2",
|
|
58249
58250
|
pluginConfig: []
|
|
58250
58251
|
});
|
|
58251
58252
|
return result;
|
|
@@ -58420,7 +58421,7 @@ Arguments: ` + Array.prototype.slice.call(h2).join("") + `
|
|
|
58420
58421
|
};
|
|
58421
58422
|
const About = () => {
|
|
58422
58423
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(x0, { padding: 20, direction: "vert", children: [
|
|
58423
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(hF1, { children: `Dek ${"0.8.
|
|
58424
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(hF1, { children: `Dek ${"0.8.2"}` }),
|
|
58424
58425
|
/* @__PURE__ */ jsxRuntimeExports.jsx(X4, { children: "From Appkit" })
|
|
58425
58426
|
] });
|
|
58426
58427
|
};
|
|
@@ -93878,14 +93879,12 @@ Arguments: ` + Array.prototype.slice.call(h2).join("") + `
|
|
|
93878
93879
|
pluginVersions[plugin.name] = plugin.version;
|
|
93879
93880
|
});
|
|
93880
93881
|
await loadPlugins(integrationsAndPlugins);
|
|
93881
|
-
updateStatePlugins(getAllPlugins());
|
|
93882
|
-
updateStatePluginInstances(getAllPluginInstances());
|
|
93882
|
+
updateStatePlugins(getAllPlugins(), getAllPluginInstances());
|
|
93883
93883
|
updateStateLoading(false);
|
|
93884
93884
|
}
|
|
93885
93885
|
async function unloadPlugins() {
|
|
93886
93886
|
await unloadAllPlugins();
|
|
93887
|
-
updateStatePlugins(getAllPlugins());
|
|
93888
|
-
updateStatePluginInstances(getAllPluginInstances());
|
|
93887
|
+
updateStatePlugins(getAllPlugins(), getAllPluginInstances());
|
|
93889
93888
|
}
|
|
93890
93889
|
async function updateLocalPlugin(plugin, pluginConfig) {
|
|
93891
93890
|
updateStateLoading(true);
|
|
@@ -93904,8 +93903,7 @@ Arguments: ` + Array.prototype.slice.call(h2).join("") + `
|
|
|
93904
93903
|
if (loadedLocalPluginInstance && loadedLocalPluginInstance.load) {
|
|
93905
93904
|
await loadedLocalPluginInstance.load(window.__dek_api);
|
|
93906
93905
|
}
|
|
93907
|
-
updateStatePlugins(getAllPlugins());
|
|
93908
|
-
updateStatePluginInstances(getAllPluginInstances());
|
|
93906
|
+
updateStatePlugins(getAllPlugins(), getAllPluginInstances());
|
|
93909
93907
|
updateStateLoading(false);
|
|
93910
93908
|
}
|
|
93911
93909
|
async function unloadLocalPlugin() {
|
|
@@ -93914,8 +93912,7 @@ Arguments: ` + Array.prototype.slice.call(h2).join("") + `
|
|
|
93914
93912
|
}
|
|
93915
93913
|
loadedLocalPluginInstance = void 0;
|
|
93916
93914
|
loadedLocalPlugin = void 0;
|
|
93917
|
-
updateStatePlugins(getAllPlugins());
|
|
93918
|
-
updateStatePluginInstances(getAllPluginInstances());
|
|
93915
|
+
updateStatePlugins(getAllPlugins(), getAllPluginInstances());
|
|
93919
93916
|
}
|
|
93920
93917
|
function useUserConfig(email, password, plugin, pluginConfig) {
|
|
93921
93918
|
const userConfig = useSnapshot(state$1);
|
|
@@ -93944,7 +93941,7 @@ Arguments: ` + Array.prototype.slice.call(h2).join("") + `
|
|
|
93944
93941
|
globals.commandGroups = userConfig.data.commandGroups;
|
|
93945
93942
|
}
|
|
93946
93943
|
globals.plugins = userConfig.plugins;
|
|
93947
|
-
globals.pluginInstances =
|
|
93944
|
+
globals.pluginInstances = getPluginInstances();
|
|
93948
93945
|
return userConfig;
|
|
93949
93946
|
}
|
|
93950
93947
|
const Background = () => {
|
|
@@ -94943,15 +94940,16 @@ Arguments: ` + Array.prototype.slice.call(h2).join("") + `
|
|
|
94943
94940
|
const [location2, setLocation] = useLocation();
|
|
94944
94941
|
const [container, setContainer] = React$3.useState(null);
|
|
94945
94942
|
const [containerNodeRef, setContainerNodeRef] = React$3.useState(null);
|
|
94946
|
-
const { data
|
|
94943
|
+
const { data } = userConfig;
|
|
94944
|
+
const pluginInstances2 = getPluginInstances();
|
|
94947
94945
|
React$3.useEffect(() => {
|
|
94948
94946
|
const loadRoutes = async () => {
|
|
94949
94947
|
var _a2, _b2;
|
|
94950
94948
|
const newRoutes = [];
|
|
94951
94949
|
const newBoardKeys = [];
|
|
94952
|
-
if (
|
|
94953
|
-
for (const key in
|
|
94954
|
-
(_a2 =
|
|
94950
|
+
if (pluginInstances2) {
|
|
94951
|
+
for (const key in pluginInstances2) {
|
|
94952
|
+
(_a2 = pluginInstances2[key].screens) == null ? void 0 : _a2.forEach((screen) => {
|
|
94955
94953
|
newRoutes.push({
|
|
94956
94954
|
type: "screen",
|
|
94957
94955
|
plugin: key,
|
|
@@ -94960,7 +94958,7 @@ Arguments: ` + Array.prototype.slice.call(h2).join("") + `
|
|
|
94960
94958
|
nodeRef: React$3.createRef()
|
|
94961
94959
|
});
|
|
94962
94960
|
});
|
|
94963
|
-
(_b2 =
|
|
94961
|
+
(_b2 = pluginInstances2[key].boards) == null ? void 0 : _b2.forEach((board) => {
|
|
94964
94962
|
newBoardKeys.push("/" + board.key);
|
|
94965
94963
|
});
|
|
94966
94964
|
}
|
|
@@ -94978,7 +94976,7 @@ Arguments: ` + Array.prototype.slice.call(h2).join("") + `
|
|
|
94978
94976
|
setBoardKeys(newBoardKeys);
|
|
94979
94977
|
};
|
|
94980
94978
|
loadRoutes();
|
|
94981
|
-
}, [
|
|
94979
|
+
}, [pluginInstances2, data == null ? void 0 : data.boards]);
|
|
94982
94980
|
React$3.useEffect(() => {
|
|
94983
94981
|
const { nodeRef } = routes.find((route) => {
|
|
94984
94982
|
let path = "/:boardKey";
|
package/dist/lib/state.d.ts
CHANGED
|
@@ -2,14 +2,13 @@ import { DekPlugin, DekPluginFactory } from '@appkit/dek-plugin';
|
|
|
2
2
|
import { UserData } from '../data/fetchUserData';
|
|
3
3
|
export type LibraryState = {
|
|
4
4
|
plugins: Record<string, DekPluginFactory>;
|
|
5
|
-
pluginInstances: Record<string, DekPlugin>;
|
|
6
5
|
data: UserData | null;
|
|
7
6
|
loading: boolean;
|
|
8
7
|
version: number;
|
|
9
8
|
};
|
|
10
9
|
declare const state: LibraryState;
|
|
11
|
-
export declare function
|
|
12
|
-
export declare function
|
|
10
|
+
export declare function getPluginInstances(): Record<string, DekPlugin>;
|
|
11
|
+
export declare function updateStatePlugins(plugins: Record<string, DekPluginFactory>, instances: Record<string, DekPlugin>): void;
|
|
13
12
|
export declare function updateStateData(data: UserData | null): void;
|
|
14
13
|
export declare function updateStateLoading(loading: boolean): void;
|
|
15
14
|
export declare function updateStateVersion(): void;
|