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