@appkit/dek-lib 0.9.1 → 0.10.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 CHANGED
@@ -863,7 +863,7 @@ class Api {
863
863
  return this.globals.registry;
864
864
  }
865
865
  get boardKey() {
866
- return this.globals.boardKey;
866
+ return this.globals.navigateParams.boardKey || "#error";
867
867
  }
868
868
  get boards() {
869
869
  return this.globals.boards;
@@ -882,6 +882,9 @@ class Api {
882
882
  navigate(path) {
883
883
  this.globals.setLocation(`/${this.boardKey}${path}`);
884
884
  }
885
+ get navigateParams() {
886
+ return this.globals.navigateParams;
887
+ }
885
888
  navigateBack() {
886
889
  history.back();
887
890
  }
@@ -1010,6 +1013,14 @@ function usePluginState(plugin, key, defaultValue) {
1010
1013
  }
1011
1014
  ];
1012
1015
  }
1016
+ function __debug() {
1017
+ }
1018
+ const dekPluginModule = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1019
+ __proto__: null,
1020
+ __debug,
1021
+ usePluginApi,
1022
+ usePluginState
1023
+ }, Symbol.toStringTag, { value: "Module" }));
1013
1024
  var _8 = Object.defineProperty;
1014
1025
  var P8 = (t2, r4, e4) => r4 in t2 ? _8(t2, r4, { enumerable: true, configurable: true, writable: true, value: e4 }) : t2[r4] = e4;
1015
1026
  var h0 = (t2, r4, e4) => (P8(t2, typeof r4 != "symbol" ? r4 + "" : r4, e4), e4);
@@ -34608,7 +34619,7 @@ const XN1 = styled(_3)`
34608
34619
  `, tU1 = styled.div`
34609
34620
  ${({ $vertical: t2, $height: r4, $width: e4, $padding: h2 }) => t2 ? `position: absolute;
34610
34621
  top: 0;
34611
- right: ${h2 + 6}px;
34622
+ right: 0;
34612
34623
  height: ${typeof r4 == "number" ? `${r4}px` : r4};
34613
34624
  display: flex;
34614
34625
  justify-content: center;
@@ -34787,7 +34798,7 @@ function iU1(t2, r4 = {}) {
34787
34798
  }
34788
34799
  const bG1 = ({
34789
34800
  vertical: t2 = false,
34790
- autoplay: r4 = 15e3,
34801
+ autoplay: r4 = 15,
34791
34802
  width: e4,
34792
34803
  height: h2,
34793
34804
  padding: n4 = 10,
@@ -34832,7 +34843,7 @@ const bG1 = ({
34832
34843
  cardSize: t2 ? g.height : g.width,
34833
34844
  cardCount: V,
34834
34845
  cardPadCount: n4,
34835
- autoplay: V > 1 ? r4 : 0,
34846
+ autoplay: V > 1 ? r4 * 1e3 : 0,
34836
34847
  vertical: t2,
34837
34848
  renderCard: k,
34838
34849
  width: g.width,
@@ -37516,7 +37527,7 @@ I1.HTML5_FMT = {
37516
37527
  function RG1(t2 = "ddd, MMM D h:mma", r4 = /* @__PURE__ */ new Date()) {
37517
37528
  return I1(r4).format(t2);
37518
37529
  }
37519
- const dekUi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
37530
+ const dekUiModule = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
37520
37531
  __proto__: null,
37521
37532
  Button: L3,
37522
37533
  ButtonLoadingIcon: mG1,
@@ -52613,7 +52624,6 @@ class Registry {
52613
52624
  }
52614
52625
  const registry = new Registry();
52615
52626
  const globals = {
52616
- boardKey: "",
52617
52627
  boards: {},
52618
52628
  commandGroups: {},
52619
52629
  plugins: {},
@@ -52621,7 +52631,8 @@ const globals = {
52621
52631
  setLocation: () => {
52622
52632
  },
52623
52633
  registry,
52624
- messages: []
52634
+ messages: [],
52635
+ navigateParams: {}
52625
52636
  };
52626
52637
  window.__dek_globals = globals;
52627
52638
  var lodash = { exports: {} };
@@ -58229,7 +58240,7 @@ async function fetchUserPlugins(email, password) {
58229
58240
  result.integrations.push({
58230
58241
  key: "base",
58231
58242
  pluginName: "base",
58232
- pluginVersion: "0.9.1",
58243
+ pluginVersion: "0.10.0",
58233
58244
  pluginConfig: []
58234
58245
  });
58235
58246
  return result;
@@ -58404,7 +58415,7 @@ const Header = ({ height = 70 }) => {
58404
58415
  };
58405
58416
  const About = () => {
58406
58417
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(x0, { padding: 20, direction: "vert", children: [
58407
- /* @__PURE__ */ jsxRuntimeExports.jsx(hF1, { children: `Dek ${"0.9.1"}` }),
58418
+ /* @__PURE__ */ jsxRuntimeExports.jsx(hF1, { children: `Dek ${"0.10.0"}` }),
58408
58419
  /* @__PURE__ */ jsxRuntimeExports.jsx(X4, { children: "From Appkit" })
58409
58420
  ] });
58410
58421
  };
@@ -93758,7 +93769,9 @@ async function loadUserPlugin(name, version2, code) {
93758
93769
  case "react-dom":
93759
93770
  return ReactDOM;
93760
93771
  case "@appkit/dek-ui":
93761
- return dekUi;
93772
+ return dekUiModule;
93773
+ case "@appkit/dek-plugin":
93774
+ return dekPluginModule;
93762
93775
  }
93763
93776
  };
93764
93777
  const body = `function( require, module ){ ${code} }`;
@@ -94975,7 +94988,7 @@ const Router = ({ userConfig, transitionDelay: transitionDelay2 }) => {
94975
94988
  }) ?? {};
94976
94989
  const containerComponent = /* @__PURE__ */ jsxRuntimeExports.jsx(Container$1, { "aria-label": "router", ref: nodeRef, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Switch, { children: routes.map((route) => {
94977
94990
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: route.route, children: (params) => {
94978
- globals.boardKey = params.boardKey || "#error";
94991
+ globals.navigateParams = params;
94979
94992
  return /* @__PURE__ */ jsxRuntimeExports.jsx(RouteResolver, { route });
94980
94993
  } }, route.route);
94981
94994
  }) }) });
package/dist/index.umd.js CHANGED
@@ -880,7 +880,7 @@ var __publicField = (obj, key, value) => {
880
880
  return this.globals.registry;
881
881
  }
882
882
  get boardKey() {
883
- return this.globals.boardKey;
883
+ return this.globals.navigateParams.boardKey || "#error";
884
884
  }
885
885
  get boards() {
886
886
  return this.globals.boards;
@@ -899,6 +899,9 @@ var __publicField = (obj, key, value) => {
899
899
  navigate(path) {
900
900
  this.globals.setLocation(`/${this.boardKey}${path}`);
901
901
  }
902
+ get navigateParams() {
903
+ return this.globals.navigateParams;
904
+ }
902
905
  navigateBack() {
903
906
  history.back();
904
907
  }
@@ -1027,6 +1030,14 @@ var __publicField = (obj, key, value) => {
1027
1030
  }
1028
1031
  ];
1029
1032
  }
1033
+ function __debug() {
1034
+ }
1035
+ const dekPluginModule = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1036
+ __proto__: null,
1037
+ __debug,
1038
+ usePluginApi,
1039
+ usePluginState
1040
+ }, Symbol.toStringTag, { value: "Module" }));
1030
1041
  var _8 = Object.defineProperty;
1031
1042
  var P8 = (t2, r4, e4) => r4 in t2 ? _8(t2, r4, { enumerable: true, configurable: true, writable: true, value: e4 }) : t2[r4] = e4;
1032
1043
  var h0 = (t2, r4, e4) => (P8(t2, typeof r4 != "symbol" ? r4 + "" : r4, e4), e4);
@@ -34625,7 +34636,7 @@ Valid keys: ` + JSON.stringify(Object.keys(F), null, " ")
34625
34636
  `, tU1 = styled.div`
34626
34637
  ${({ $vertical: t2, $height: r4, $width: e4, $padding: h2 }) => t2 ? `position: absolute;
34627
34638
  top: 0;
34628
- right: ${h2 + 6}px;
34639
+ right: 0;
34629
34640
  height: ${typeof r4 == "number" ? `${r4}px` : r4};
34630
34641
  display: flex;
34631
34642
  justify-content: center;
@@ -34804,7 +34815,7 @@ Valid keys: ` + JSON.stringify(Object.keys(F), null, " ")
34804
34815
  }
34805
34816
  const bG1 = ({
34806
34817
  vertical: t2 = false,
34807
- autoplay: r4 = 15e3,
34818
+ autoplay: r4 = 15,
34808
34819
  width: e4,
34809
34820
  height: h2,
34810
34821
  padding: n4 = 10,
@@ -34849,7 +34860,7 @@ Valid keys: ` + JSON.stringify(Object.keys(F), null, " ")
34849
34860
  cardSize: t2 ? g.height : g.width,
34850
34861
  cardCount: V,
34851
34862
  cardPadCount: n4,
34852
- autoplay: V > 1 ? r4 : 0,
34863
+ autoplay: V > 1 ? r4 * 1e3 : 0,
34853
34864
  vertical: t2,
34854
34865
  renderCard: k,
34855
34866
  width: g.width,
@@ -37533,7 +37544,7 @@ Arguments: ` + Array.prototype.slice.call(h2).join("") + `
37533
37544
  function RG1(t2 = "ddd, MMM D h:mma", r4 = /* @__PURE__ */ new Date()) {
37534
37545
  return I1(r4).format(t2);
37535
37546
  }
37536
- const dekUi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
37547
+ const dekUiModule = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
37537
37548
  __proto__: null,
37538
37549
  Button: L3,
37539
37550
  ButtonLoadingIcon: mG1,
@@ -52630,7 +52641,6 @@ Arguments: ` + Array.prototype.slice.call(h2).join("") + `
52630
52641
  }
52631
52642
  const registry = new Registry();
52632
52643
  const globals = {
52633
- boardKey: "",
52634
52644
  boards: {},
52635
52645
  commandGroups: {},
52636
52646
  plugins: {},
@@ -52638,7 +52648,8 @@ Arguments: ` + Array.prototype.slice.call(h2).join("") + `
52638
52648
  setLocation: () => {
52639
52649
  },
52640
52650
  registry,
52641
- messages: []
52651
+ messages: [],
52652
+ navigateParams: {}
52642
52653
  };
52643
52654
  window.__dek_globals = globals;
52644
52655
  var lodash = { exports: {} };
@@ -58246,7 +58257,7 @@ Arguments: ` + Array.prototype.slice.call(h2).join("") + `
58246
58257
  result.integrations.push({
58247
58258
  key: "base",
58248
58259
  pluginName: "base",
58249
- pluginVersion: "0.9.1",
58260
+ pluginVersion: "0.10.0",
58250
58261
  pluginConfig: []
58251
58262
  });
58252
58263
  return result;
@@ -58421,7 +58432,7 @@ Arguments: ` + Array.prototype.slice.call(h2).join("") + `
58421
58432
  };
58422
58433
  const About = () => {
58423
58434
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(x0, { padding: 20, direction: "vert", children: [
58424
- /* @__PURE__ */ jsxRuntimeExports.jsx(hF1, { children: `Dek ${"0.9.1"}` }),
58435
+ /* @__PURE__ */ jsxRuntimeExports.jsx(hF1, { children: `Dek ${"0.10.0"}` }),
58425
58436
  /* @__PURE__ */ jsxRuntimeExports.jsx(X4, { children: "From Appkit" })
58426
58437
  ] });
58427
58438
  };
@@ -93775,7 +93786,9 @@ Arguments: ` + Array.prototype.slice.call(h2).join("") + `
93775
93786
  case "react-dom":
93776
93787
  return ReactDOM__namespace;
93777
93788
  case "@appkit/dek-ui":
93778
- return dekUi;
93789
+ return dekUiModule;
93790
+ case "@appkit/dek-plugin":
93791
+ return dekPluginModule;
93779
93792
  }
93780
93793
  };
93781
93794
  const body = `function( require, module ){ ${code} }`;
@@ -94992,7 +95005,7 @@ Arguments: ` + Array.prototype.slice.call(h2).join("") + `
94992
95005
  }) ?? {};
94993
95006
  const containerComponent = /* @__PURE__ */ jsxRuntimeExports.jsx(Container$1, { "aria-label": "router", ref: nodeRef, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Switch, { children: routes.map((route) => {
94994
95007
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: route.route, children: (params) => {
94995
- globals.boardKey = params.boardKey || "#error";
95008
+ globals.navigateParams = params;
94996
95009
  return /* @__PURE__ */ jsxRuntimeExports.jsx(RouteResolver, { route });
94997
95010
  } }, route.route);
94998
95011
  }) }) });
@@ -3,7 +3,6 @@ export type SetLocationFunc = (to: string, options?: {
3
3
  replace?: boolean | undefined;
4
4
  } | undefined) => void;
5
5
  type Globals = {
6
- boardKey: string;
7
6
  boards: Record<string, any>;
8
7
  commandGroups: Record<string, any>;
9
8
  plugins: Readonly<Record<string, Readonly<DekPluginFactory>>>;
@@ -11,6 +10,7 @@ type Globals = {
11
10
  setLocation: SetLocationFunc;
12
11
  registry: DekRegistry;
13
12
  messages: DekApiMessage[];
13
+ navigateParams: Record<string, string | undefined>;
14
14
  };
15
15
  declare const globals: Globals;
16
16
  export default globals;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@appkit/dek-lib",
3
3
  "private": false,
4
- "version": "0.9.1",
4
+ "version": "0.10.0",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "build": "tsc && vite build",