@appkit/dek-lib 0.9.0 → 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
@@ -7,7 +7,8 @@ var __publicField = (obj, key, value) => {
7
7
  import * as React$3 from "react";
8
8
  import React__default, { useCallback, useState as useState$1, useEffect as useEffect$1, useRef as useRef$1, useLayoutEffect as useLayoutEffect$1, useMemo, useDebugValue, createContext, forwardRef, isValidElement, createElement, cloneElement, useContext, Fragment, createRef } from "react";
9
9
  import styled, { createGlobalStyle, ThemeProvider } from "styled-components";
10
- import ReactDOM from "react-dom";
10
+ import * as ReactDOM from "react-dom";
11
+ import ReactDOM__default from "react-dom";
11
12
  function _mergeNamespaces(n4, m) {
12
13
  for (var i4 = 0; i4 < m.length; i4++) {
13
14
  const e4 = m[i4];
@@ -862,7 +863,7 @@ class Api {
862
863
  return this.globals.registry;
863
864
  }
864
865
  get boardKey() {
865
- return this.globals.boardKey;
866
+ return this.globals.navigateParams.boardKey || "#error";
866
867
  }
867
868
  get boards() {
868
869
  return this.globals.boards;
@@ -881,6 +882,9 @@ class Api {
881
882
  navigate(path) {
882
883
  this.globals.setLocation(`/${this.boardKey}${path}`);
883
884
  }
885
+ get navigateParams() {
886
+ return this.globals.navigateParams;
887
+ }
884
888
  navigateBack() {
885
889
  history.back();
886
890
  }
@@ -1009,6 +1013,14 @@ function usePluginState(plugin, key, defaultValue) {
1009
1013
  }
1010
1014
  ];
1011
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" }));
1012
1024
  var _8 = Object.defineProperty;
1013
1025
  var P8 = (t2, r4, e4) => r4 in t2 ? _8(t2, r4, { enumerable: true, configurable: true, writable: true, value: e4 }) : t2[r4] = e4;
1014
1026
  var h0 = (t2, r4, e4) => (P8(t2, typeof r4 != "symbol" ? r4 + "" : r4, e4), e4);
@@ -33750,7 +33762,7 @@ function EN1() {
33750
33762
  return S;
33751
33763
  }, g = (S, B, t1) => (d(S, B, "default"), t1 && d(t1, B, "default")), L = (S) => d(r4({}, "__esModule", { value: true }), S), y2 = {};
33752
33764
  l2(y2, { a: () => d1, animated: () => d1 }), t2.exports = L(y2);
33753
- var V = Kt(), k = ReactDOM, E = D1(), q = Y0(), U = /^--/;
33765
+ var V = Kt(), k = ReactDOM__default, E = D1(), q = Y0(), U = /^--/;
33754
33766
  function D(S, B) {
33755
33767
  return B == null || typeof B == "boolean" || B === "" ? "" : typeof B == "number" && B !== 0 && !U.test(S) && !(i1.hasOwnProperty(S) && i1[S]) ? B + "px" : ("" + B).trim();
33756
33768
  }
@@ -33829,7 +33841,7 @@ function TN1() {
33829
33841
  a: () => d1,
33830
33842
  animated: () => d1
33831
33843
  }), t2.exports = L(y2);
33832
- var V = Kt(), k = ReactDOM, E = D1(), q = Y0(), U = /^--/;
33844
+ var V = Kt(), k = ReactDOM__default, E = D1(), q = Y0(), U = /^--/;
33833
33845
  function D(S, B) {
33834
33846
  return B == null || typeof B == "boolean" || B === "" ? "" : typeof B == "number" && B !== 0 && !U.test(S) && !(i1.hasOwnProperty(S) && i1[S]) ? B + "px" : ("" + B).trim();
33835
33847
  }
@@ -34607,7 +34619,7 @@ const XN1 = styled(_3)`
34607
34619
  `, tU1 = styled.div`
34608
34620
  ${({ $vertical: t2, $height: r4, $width: e4, $padding: h2 }) => t2 ? `position: absolute;
34609
34621
  top: 0;
34610
- right: ${h2 + 6}px;
34622
+ right: 0;
34611
34623
  height: ${typeof r4 == "number" ? `${r4}px` : r4};
34612
34624
  display: flex;
34613
34625
  justify-content: center;
@@ -34786,7 +34798,7 @@ function iU1(t2, r4 = {}) {
34786
34798
  }
34787
34799
  const bG1 = ({
34788
34800
  vertical: t2 = false,
34789
- autoplay: r4 = 15e3,
34801
+ autoplay: r4 = 15,
34790
34802
  width: e4,
34791
34803
  height: h2,
34792
34804
  padding: n4 = 10,
@@ -34831,7 +34843,7 @@ const bG1 = ({
34831
34843
  cardSize: t2 ? g.height : g.width,
34832
34844
  cardCount: V,
34833
34845
  cardPadCount: n4,
34834
- autoplay: V > 1 ? r4 : 0,
34846
+ autoplay: V > 1 ? r4 * 1e3 : 0,
34835
34847
  vertical: t2,
34836
34848
  renderCard: k,
34837
34849
  width: g.width,
@@ -37515,7 +37527,7 @@ I1.HTML5_FMT = {
37515
37527
  function RG1(t2 = "ddd, MMM D h:mma", r4 = /* @__PURE__ */ new Date()) {
37516
37528
  return I1(r4).format(t2);
37517
37529
  }
37518
- const dekUi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
37530
+ const dekUiModule = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
37519
37531
  __proto__: null,
37520
37532
  Button: L3,
37521
37533
  ButtonLoadingIcon: mG1,
@@ -52612,7 +52624,6 @@ class Registry {
52612
52624
  }
52613
52625
  const registry = new Registry();
52614
52626
  const globals = {
52615
- boardKey: "",
52616
52627
  boards: {},
52617
52628
  commandGroups: {},
52618
52629
  plugins: {},
@@ -52620,7 +52631,8 @@ const globals = {
52620
52631
  setLocation: () => {
52621
52632
  },
52622
52633
  registry,
52623
- messages: []
52634
+ messages: [],
52635
+ navigateParams: {}
52624
52636
  };
52625
52637
  window.__dek_globals = globals;
52626
52638
  var lodash = { exports: {} };
@@ -58228,7 +58240,7 @@ async function fetchUserPlugins(email, password) {
58228
58240
  result.integrations.push({
58229
58241
  key: "base",
58230
58242
  pluginName: "base",
58231
- pluginVersion: "0.9.0",
58243
+ pluginVersion: "0.10.0",
58232
58244
  pluginConfig: []
58233
58245
  });
58234
58246
  return result;
@@ -58403,7 +58415,7 @@ const Header = ({ height = 70 }) => {
58403
58415
  };
58404
58416
  const About = () => {
58405
58417
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(x0, { padding: 20, direction: "vert", children: [
58406
- /* @__PURE__ */ jsxRuntimeExports.jsx(hF1, { children: `Dek ${"0.9.0"}` }),
58418
+ /* @__PURE__ */ jsxRuntimeExports.jsx(hF1, { children: `Dek ${"0.10.0"}` }),
58407
58419
  /* @__PURE__ */ jsxRuntimeExports.jsx(X4, { children: "From Appkit" })
58408
58420
  ] });
58409
58421
  };
@@ -93754,8 +93766,12 @@ async function loadUserPlugin(name, version2, code) {
93754
93766
  return jsxRuntimeModule;
93755
93767
  case "react":
93756
93768
  return React$3;
93769
+ case "react-dom":
93770
+ return ReactDOM;
93757
93771
  case "@appkit/dek-ui":
93758
- return dekUi;
93772
+ return dekUiModule;
93773
+ case "@appkit/dek-plugin":
93774
+ return dekPluginModule;
93759
93775
  }
93760
93776
  };
93761
93777
  const body = `function( require, module ){ ${code} }`;
@@ -94119,7 +94135,7 @@ var Transition = /* @__PURE__ */ function(_React$Component) {
94119
94135
  this.cancelNextCallback();
94120
94136
  if (nextStatus === ENTERING) {
94121
94137
  if (this.props.unmountOnExit || this.props.mountOnEnter) {
94122
- var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM.findDOMNode(this);
94138
+ var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM__default.findDOMNode(this);
94123
94139
  if (node)
94124
94140
  forceReflow(node);
94125
94141
  }
@@ -94137,7 +94153,7 @@ var Transition = /* @__PURE__ */ function(_React$Component) {
94137
94153
  var _this2 = this;
94138
94154
  var enter = this.props.enter;
94139
94155
  var appearing = this.context ? this.context.isMounting : mounting;
94140
- var _ref2 = this.props.nodeRef ? [appearing] : [ReactDOM.findDOMNode(this), appearing], maybeNode = _ref2[0], maybeAppearing = _ref2[1];
94156
+ var _ref2 = this.props.nodeRef ? [appearing] : [ReactDOM__default.findDOMNode(this), appearing], maybeNode = _ref2[0], maybeAppearing = _ref2[1];
94141
94157
  var timeouts = this.getTimeouts();
94142
94158
  var enterTimeout = appearing ? timeouts.appear : timeouts.enter;
94143
94159
  if (!mounting && !enter || config.disabled) {
@@ -94166,7 +94182,7 @@ var Transition = /* @__PURE__ */ function(_React$Component) {
94166
94182
  var _this3 = this;
94167
94183
  var exit = this.props.exit;
94168
94184
  var timeouts = this.getTimeouts();
94169
- var maybeNode = this.props.nodeRef ? void 0 : ReactDOM.findDOMNode(this);
94185
+ var maybeNode = this.props.nodeRef ? void 0 : ReactDOM__default.findDOMNode(this);
94170
94186
  if (!exit || config.disabled) {
94171
94187
  this.safeSetState({
94172
94188
  status: EXITED
@@ -94216,7 +94232,7 @@ var Transition = /* @__PURE__ */ function(_React$Component) {
94216
94232
  };
94217
94233
  _proto.onTransitionEnd = function onTransitionEnd(timeout2, handler) {
94218
94234
  this.setNextCallback(handler);
94219
- var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM.findDOMNode(this);
94235
+ var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM__default.findDOMNode(this);
94220
94236
  var doesNotHaveTimeoutOrListener = timeout2 == null && !this.props.addEndListener;
94221
94237
  if (!node || doesNotHaveTimeoutOrListener) {
94222
94238
  setTimeout(this.nextCallback, 0);
@@ -94972,7 +94988,7 @@ const Router = ({ userConfig, transitionDelay: transitionDelay2 }) => {
94972
94988
  }) ?? {};
94973
94989
  const containerComponent = /* @__PURE__ */ jsxRuntimeExports.jsx(Container$1, { "aria-label": "router", ref: nodeRef, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Switch, { children: routes.map((route) => {
94974
94990
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: route.route, children: (params) => {
94975
- globals.boardKey = params.boardKey || "#error";
94991
+ globals.navigateParams = params;
94976
94992
  return /* @__PURE__ */ jsxRuntimeExports.jsx(RouteResolver, { route });
94977
94993
  } }, route.route);
94978
94994
  }) }) });
package/dist/index.umd.js CHANGED
@@ -44,6 +44,7 @@ var __publicField = (obj, key, value) => {
44
44
  return Object.freeze(Object.defineProperty(n4, Symbol.toStringTag, { value: "Module" }));
45
45
  }
46
46
  const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React$3);
47
+ const ReactDOM__namespace = /* @__PURE__ */ _interopNamespaceDefault(ReactDOM);
47
48
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
48
49
  function getDefaultExportFromCjs(x) {
49
50
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
@@ -879,7 +880,7 @@ var __publicField = (obj, key, value) => {
879
880
  return this.globals.registry;
880
881
  }
881
882
  get boardKey() {
882
- return this.globals.boardKey;
883
+ return this.globals.navigateParams.boardKey || "#error";
883
884
  }
884
885
  get boards() {
885
886
  return this.globals.boards;
@@ -898,6 +899,9 @@ var __publicField = (obj, key, value) => {
898
899
  navigate(path) {
899
900
  this.globals.setLocation(`/${this.boardKey}${path}`);
900
901
  }
902
+ get navigateParams() {
903
+ return this.globals.navigateParams;
904
+ }
901
905
  navigateBack() {
902
906
  history.back();
903
907
  }
@@ -1026,6 +1030,14 @@ var __publicField = (obj, key, value) => {
1026
1030
  }
1027
1031
  ];
1028
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" }));
1029
1041
  var _8 = Object.defineProperty;
1030
1042
  var P8 = (t2, r4, e4) => r4 in t2 ? _8(t2, r4, { enumerable: true, configurable: true, writable: true, value: e4 }) : t2[r4] = e4;
1031
1043
  var h0 = (t2, r4, e4) => (P8(t2, typeof r4 != "symbol" ? r4 + "" : r4, e4), e4);
@@ -34624,7 +34636,7 @@ Valid keys: ` + JSON.stringify(Object.keys(F), null, " ")
34624
34636
  `, tU1 = styled.div`
34625
34637
  ${({ $vertical: t2, $height: r4, $width: e4, $padding: h2 }) => t2 ? `position: absolute;
34626
34638
  top: 0;
34627
- right: ${h2 + 6}px;
34639
+ right: 0;
34628
34640
  height: ${typeof r4 == "number" ? `${r4}px` : r4};
34629
34641
  display: flex;
34630
34642
  justify-content: center;
@@ -34803,7 +34815,7 @@ Valid keys: ` + JSON.stringify(Object.keys(F), null, " ")
34803
34815
  }
34804
34816
  const bG1 = ({
34805
34817
  vertical: t2 = false,
34806
- autoplay: r4 = 15e3,
34818
+ autoplay: r4 = 15,
34807
34819
  width: e4,
34808
34820
  height: h2,
34809
34821
  padding: n4 = 10,
@@ -34848,7 +34860,7 @@ Valid keys: ` + JSON.stringify(Object.keys(F), null, " ")
34848
34860
  cardSize: t2 ? g.height : g.width,
34849
34861
  cardCount: V,
34850
34862
  cardPadCount: n4,
34851
- autoplay: V > 1 ? r4 : 0,
34863
+ autoplay: V > 1 ? r4 * 1e3 : 0,
34852
34864
  vertical: t2,
34853
34865
  renderCard: k,
34854
34866
  width: g.width,
@@ -37532,7 +37544,7 @@ Arguments: ` + Array.prototype.slice.call(h2).join("") + `
37532
37544
  function RG1(t2 = "ddd, MMM D h:mma", r4 = /* @__PURE__ */ new Date()) {
37533
37545
  return I1(r4).format(t2);
37534
37546
  }
37535
- const dekUi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
37547
+ const dekUiModule = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
37536
37548
  __proto__: null,
37537
37549
  Button: L3,
37538
37550
  ButtonLoadingIcon: mG1,
@@ -52629,7 +52641,6 @@ Arguments: ` + Array.prototype.slice.call(h2).join("") + `
52629
52641
  }
52630
52642
  const registry = new Registry();
52631
52643
  const globals = {
52632
- boardKey: "",
52633
52644
  boards: {},
52634
52645
  commandGroups: {},
52635
52646
  plugins: {},
@@ -52637,7 +52648,8 @@ Arguments: ` + Array.prototype.slice.call(h2).join("") + `
52637
52648
  setLocation: () => {
52638
52649
  },
52639
52650
  registry,
52640
- messages: []
52651
+ messages: [],
52652
+ navigateParams: {}
52641
52653
  };
52642
52654
  window.__dek_globals = globals;
52643
52655
  var lodash = { exports: {} };
@@ -58245,7 +58257,7 @@ Arguments: ` + Array.prototype.slice.call(h2).join("") + `
58245
58257
  result.integrations.push({
58246
58258
  key: "base",
58247
58259
  pluginName: "base",
58248
- pluginVersion: "0.9.0",
58260
+ pluginVersion: "0.10.0",
58249
58261
  pluginConfig: []
58250
58262
  });
58251
58263
  return result;
@@ -58420,7 +58432,7 @@ Arguments: ` + Array.prototype.slice.call(h2).join("") + `
58420
58432
  };
58421
58433
  const About = () => {
58422
58434
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(x0, { padding: 20, direction: "vert", children: [
58423
- /* @__PURE__ */ jsxRuntimeExports.jsx(hF1, { children: `Dek ${"0.9.0"}` }),
58435
+ /* @__PURE__ */ jsxRuntimeExports.jsx(hF1, { children: `Dek ${"0.10.0"}` }),
58424
58436
  /* @__PURE__ */ jsxRuntimeExports.jsx(X4, { children: "From Appkit" })
58425
58437
  ] });
58426
58438
  };
@@ -93771,8 +93783,12 @@ Arguments: ` + Array.prototype.slice.call(h2).join("") + `
93771
93783
  return jsxRuntimeModule;
93772
93784
  case "react":
93773
93785
  return React__namespace;
93786
+ case "react-dom":
93787
+ return ReactDOM__namespace;
93774
93788
  case "@appkit/dek-ui":
93775
- return dekUi;
93789
+ return dekUiModule;
93790
+ case "@appkit/dek-plugin":
93791
+ return dekPluginModule;
93776
93792
  }
93777
93793
  };
93778
93794
  const body = `function( require, module ){ ${code} }`;
@@ -94989,7 +95005,7 @@ Arguments: ` + Array.prototype.slice.call(h2).join("") + `
94989
95005
  }) ?? {};
94990
95006
  const containerComponent = /* @__PURE__ */ jsxRuntimeExports.jsx(Container$1, { "aria-label": "router", ref: nodeRef, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Switch, { children: routes.map((route) => {
94991
95007
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Route, { path: route.route, children: (params) => {
94992
- globals.boardKey = params.boardKey || "#error";
95008
+ globals.navigateParams = params;
94993
95009
  return /* @__PURE__ */ jsxRuntimeExports.jsx(RouteResolver, { route });
94994
95010
  } }, route.route);
94995
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.0",
4
+ "version": "0.10.0",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "build": "tsc && vite build",