@apia/dashboard-controller 2.0.9 → 2.0.10

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.
Files changed (162) hide show
  1. package/dist/actions/basicAction.d.ts +15 -0
  2. package/dist/actions/basicAction.d.ts.map +1 -0
  3. package/dist/actions/basicAction.js +40 -0
  4. package/dist/actions/basicAction.js.map +1 -0
  5. package/dist/actions/externalFirePanelAction.d.ts +6 -0
  6. package/dist/actions/externalFirePanelAction.d.ts.map +1 -0
  7. package/dist/actions/externalFirePanelAction.js +12 -0
  8. package/dist/actions/externalFirePanelAction.js.map +1 -0
  9. package/dist/actions/firePanelAction.d.ts +6 -0
  10. package/dist/actions/firePanelAction.d.ts.map +1 -0
  11. package/dist/actions/firePanelAction.js +75 -0
  12. package/dist/actions/firePanelAction.js.map +1 -0
  13. package/dist/actions/usePanelActions.d.ts +63 -0
  14. package/dist/actions/usePanelActions.d.ts.map +1 -0
  15. package/dist/actions/usePanelActions.js +55 -0
  16. package/dist/actions/usePanelActions.js.map +1 -0
  17. package/dist/actions/usePanelIsLoading.d.ts +4 -0
  18. package/dist/actions/usePanelIsLoading.d.ts.map +1 -0
  19. package/dist/actions/usePanelIsLoading.js +14 -0
  20. package/dist/actions/usePanelIsLoading.js.map +1 -0
  21. package/dist/actions/usePanelNetworkState.d.ts +8 -0
  22. package/dist/actions/usePanelNetworkState.d.ts.map +1 -0
  23. package/dist/actions/usePanelNetworkState.js +21 -0
  24. package/dist/actions/usePanelNetworkState.js.map +1 -0
  25. package/dist/common/usePanelIdentity.d.ts +10 -0
  26. package/dist/common/usePanelIdentity.d.ts.map +1 -0
  27. package/dist/common/usePanelIdentity.js +12 -0
  28. package/dist/common/usePanelIdentity.js.map +1 -0
  29. package/dist/config/parametersStore.d.ts +15 -0
  30. package/dist/config/parametersStore.d.ts.map +1 -0
  31. package/dist/config/parametersStore.js +25 -0
  32. package/dist/config/parametersStore.js.map +1 -0
  33. package/dist/config/saveParameters.d.ts +11 -0
  34. package/dist/config/saveParameters.d.ts.map +1 -0
  35. package/dist/config/saveParameters.js +16 -0
  36. package/dist/config/saveParameters.js.map +1 -0
  37. package/dist/config/usePanelConfig.js +22 -0
  38. package/dist/config/usePanelConfig.js.map +1 -0
  39. package/dist/config/usePanelParametersSelector.d.ts +25 -0
  40. package/dist/config/usePanelParametersSelector.d.ts.map +1 -0
  41. package/dist/config/usePanelParametersSelector.js +17 -0
  42. package/dist/config/usePanelParametersSelector.js.map +1 -0
  43. package/dist/dashboard/DashboardContext.d.ts +6 -0
  44. package/dist/dashboard/DashboardContext.d.ts.map +1 -0
  45. package/dist/dashboard/DashboardContext.js +12 -0
  46. package/dist/dashboard/DashboardContext.js.map +1 -0
  47. package/dist/dashboard/DashboardPanel.d.ts +45 -0
  48. package/dist/dashboard/DashboardPanel.d.ts.map +1 -0
  49. package/dist/dashboard/DashboardPanel.js +236 -0
  50. package/dist/dashboard/DashboardPanel.js.map +1 -0
  51. package/dist/dashboard/DashboardPanelContext.d.ts +6 -0
  52. package/dist/dashboard/DashboardPanelContext.d.ts.map +1 -0
  53. package/dist/dashboard/DashboardPanelContext.js +12 -0
  54. package/dist/dashboard/DashboardPanelContext.js.map +1 -0
  55. package/dist/dashboard/DashboardPanelsBootstraper.d.ts +33 -0
  56. package/dist/dashboard/DashboardPanelsBootstraper.d.ts.map +1 -0
  57. package/dist/dashboard/DashboardPanelsBootstraper.js +135 -0
  58. package/dist/dashboard/DashboardPanelsBootstraper.js.map +1 -0
  59. package/dist/dashboard/DashboardRouter.d.ts +30 -0
  60. package/dist/dashboard/DashboardRouter.d.ts.map +1 -0
  61. package/dist/dashboard/DashboardRouter.js +74 -0
  62. package/dist/dashboard/DashboardRouter.js.map +1 -0
  63. package/dist/dashboard/PanelNotFound.js +14 -0
  64. package/dist/dashboard/PanelNotFound.js.map +1 -0
  65. package/dist/dashboard/dashboard.d.ts +26 -0
  66. package/dist/dashboard/dashboard.d.ts.map +1 -0
  67. package/dist/dashboard/dashboard.js +167 -0
  68. package/dist/dashboard/dashboard.js.map +1 -0
  69. package/dist/eventsController/eventsController.d.ts +11 -0
  70. package/dist/eventsController/eventsController.d.ts.map +1 -0
  71. package/dist/eventsController/eventsController.js +57 -0
  72. package/dist/eventsController/eventsController.js.map +1 -0
  73. package/dist/eventsController/types.d.ts +21 -0
  74. package/dist/eventsController/types.d.ts.map +1 -0
  75. package/dist/eventsController/usePanelFireEvent.d.ts +13 -0
  76. package/dist/eventsController/usePanelFireEvent.d.ts.map +1 -0
  77. package/dist/eventsController/usePanelFireEvent.js +21 -0
  78. package/dist/eventsController/usePanelFireEvent.js.map +1 -0
  79. package/dist/eventsController/usePanelOnEvent.d.ts +12 -0
  80. package/dist/eventsController/usePanelOnEvent.d.ts.map +1 -0
  81. package/dist/eventsController/usePanelOnEvent.js +14 -0
  82. package/dist/eventsController/usePanelOnEvent.js.map +1 -0
  83. package/dist/index.d.ts +23 -409
  84. package/dist/index.js +22 -2201
  85. package/dist/index.js.map +1 -1
  86. package/dist/panelsStore/createPanelStore.d.ts +16 -0
  87. package/dist/panelsStore/createPanelStore.d.ts.map +1 -0
  88. package/dist/panelsStore/createPanelStore.js +58 -0
  89. package/dist/panelsStore/createPanelStore.js.map +1 -0
  90. package/dist/panelsStore/panelsStore.js +59 -0
  91. package/dist/panelsStore/panelsStore.js.map +1 -0
  92. package/dist/panelsStore/usePanelSelector.js +32 -0
  93. package/dist/panelsStore/usePanelSelector.js.map +1 -0
  94. package/dist/panelsUtil/usePanelChangeTitle.d.ts +5 -0
  95. package/dist/panelsUtil/usePanelChangeTitle.d.ts.map +1 -0
  96. package/dist/panelsUtil/usePanelChangeTitle.js +23 -0
  97. package/dist/panelsUtil/usePanelChangeTitle.js.map +1 -0
  98. package/dist/panelsUtil/usePanelTitleAction.js +34 -0
  99. package/dist/panelsUtil/usePanelTitleAction.js.map +1 -0
  100. package/dist/position/usePanelPosition.d.ts +13 -0
  101. package/dist/position/usePanelPosition.d.ts.map +1 -0
  102. package/dist/position/usePanelPosition.js +40 -0
  103. package/dist/position/usePanelPosition.js.map +1 -0
  104. package/dist/splash/events/Dragleave.js +15 -0
  105. package/dist/splash/events/Dragleave.js.map +1 -0
  106. package/dist/splash/events/Dragover.js +120 -0
  107. package/dist/splash/events/Dragover.js.map +1 -0
  108. package/dist/splash/events/Dragstart.js +65 -0
  109. package/dist/splash/events/Dragstart.js.map +1 -0
  110. package/dist/splash/events/Drop.js +60 -0
  111. package/dist/splash/events/Drop.js.map +1 -0
  112. package/dist/splash/panels/DefaultPanelWrapper/NetworkState.js +28 -0
  113. package/dist/splash/panels/DefaultPanelWrapper/NetworkState.js.map +1 -0
  114. package/dist/splash/panels/DefaultPanelWrapper/PanelButtons.js +16 -0
  115. package/dist/splash/panels/DefaultPanelWrapper/PanelButtons.js.map +1 -0
  116. package/dist/splash/panels/DefaultPanelWrapper/RefreshButton.js +35 -0
  117. package/dist/splash/panels/DefaultPanelWrapper/RefreshButton.js.map +1 -0
  118. package/dist/splash/panels/DefaultPanelWrapper/SettingsButton.js +45 -0
  119. package/dist/splash/panels/DefaultPanelWrapper/SettingsButton.js.map +1 -0
  120. package/dist/splash/panels/DefaultPanelWrapper/defaultPanelWrapperStyles.js +103 -0
  121. package/dist/splash/panels/DefaultPanelWrapper/defaultPanelWrapperStyles.js.map +1 -0
  122. package/dist/splash/panels/DefaultPanelWrapper/index.js +57 -0
  123. package/dist/splash/panels/DefaultPanelWrapper/index.js.map +1 -0
  124. package/dist/splash/panels/LandingPagePanelWrapper.d.ts +6 -0
  125. package/dist/splash/panels/LandingPagePanelWrapper.d.ts.map +1 -0
  126. package/dist/splash/panels/LandingPagePanelWrapper.js +52 -0
  127. package/dist/splash/panels/LandingPagePanelWrapper.js.map +1 -0
  128. package/dist/splash/panels/PanelContext/PanelFooter.js +70 -0
  129. package/dist/splash/panels/PanelContext/PanelFooter.js.map +1 -0
  130. package/dist/splash/panels/PanelContext/index.d.ts +26 -0
  131. package/dist/splash/panels/PanelContext/index.d.ts.map +1 -0
  132. package/dist/splash/panels/PanelContext/index.js +73 -0
  133. package/dist/splash/panels/PanelContext/index.js.map +1 -0
  134. package/dist/splash/panels/PanelContext/usePanelContextLayout.d.ts +6 -0
  135. package/dist/splash/panels/PanelContext/usePanelContextLayout.d.ts.map +1 -0
  136. package/dist/splash/panels/PanelContext/usePanelContextLayout.js +38 -0
  137. package/dist/splash/panels/PanelContext/usePanelContextLayout.js.map +1 -0
  138. package/dist/splash/panels/PanelContext/usePanelFooter.js +38 -0
  139. package/dist/splash/panels/PanelContext/usePanelFooter.js.map +1 -0
  140. package/dist/splash/panels/PanelContext/useYieldPanelIsReady.d.ts +45 -0
  141. package/dist/splash/panels/PanelContext/useYieldPanelIsReady.d.ts.map +1 -0
  142. package/dist/splash/panels/PanelContext/useYieldPanelIsReady.js +12 -0
  143. package/dist/splash/panels/PanelContext/useYieldPanelIsReady.js.map +1 -0
  144. package/dist/splash/panels/PanelErrorBoundary.js +53 -0
  145. package/dist/splash/panels/PanelErrorBoundary.js.map +1 -0
  146. package/dist/splash/panels/PanelIdentifier.d.ts +16 -0
  147. package/dist/splash/panels/PanelIdentifier.d.ts.map +1 -0
  148. package/dist/splash/panels/PanelIdentifier.js +19 -0
  149. package/dist/splash/panels/PanelIdentifier.js.map +1 -0
  150. package/dist/splash/util/DragAndDrop.js +243 -0
  151. package/dist/splash/util/DragAndDrop.js.map +1 -0
  152. package/dist/splash/util/getColumnAreas.js +19 -0
  153. package/dist/splash/util/getColumnAreas.js.map +1 -0
  154. package/dist/splash/util/isCursorInArea.js +13 -0
  155. package/dist/splash/util/isCursorInArea.js.map +1 -0
  156. package/dist/types.d.ts +27 -0
  157. package/dist/types.d.ts.map +1 -0
  158. package/dist/util.d.ts +8 -0
  159. package/dist/util.d.ts.map +1 -0
  160. package/dist/util.js +30 -0
  161. package/dist/util.js.map +1 -0
  162. package/package.json +4 -4
@@ -0,0 +1,45 @@
1
+ /**
2
+ * **Favor de leer con cuidado el siguiente contenido, es muy importante para
3
+ * la performance**
4
+ *
5
+ * El hook useYieldPanelIsReady es una parte muy importante del flujo de
6
+ * trabajo de los dashboards. **El no reportar la carga de un panel tiene
7
+ * penalizaciones graves en el tiempo de renderizado inicial**, esto es porque
8
+ * el dashboard espera que todos los paneles hayan terminado la carga
9
+ * estructural básica antes de empezar con los refresh iniciales, y esto termina
10
+ * impactando en el tiempo que demora en bajar la cortina.
11
+ *
12
+ * **Aclaración:** Actualmente se espera las cargas estructurales para lanzar
13
+ * los refresh iniciales por motivos de arquitectura. Esa restricción será
14
+ * eliminada probablemente en el corto plazo, pero eso no cambia la necesidad de
15
+ * reportar las estructuras ya que esta información es igualmente utilizada para
16
+ * el bajado de la cortina de Skeletons.
17
+ *
18
+ * Por ejemplo, si todos los paneles están optimizados para lograr cargas
19
+ * iniciales rápidas pero el logo de la aplicación no reporta que su estructura
20
+ * está pronta, el dashboard va a bajar su cortina solamente luego de que expire
21
+ * el timeout **DASH_COURTAIN_TRESHOLD**, que por defecto viene establecido en 5
22
+ * segundos.
23
+ *
24
+ * Esto significa que aún cuando la cortina se hubiera podido bajar quizás a
25
+ * los pocos ms de cargado el html inicial, no lo hará porque supone que el
26
+ * panel Logo aún no terminó su carga estructural.
27
+ *
28
+ * Siempre que un panel esté presente en un dashboard, deberá reportar cuando
29
+ * la carga estructural esté pronta. Esto puede ser hecho de dos formas:
30
+ *
31
+ * - Usando { setRef } = usePanelContext(): En el elemento crucial de HTML del
32
+ * elemento hacer ref={setRef}. Esta es la forma más óptima ya que nos garantiza
33
+ * que el panel se reporte cuando su estructura HTML ya esté disponible,
34
+ * evitando ninguna demora.
35
+ *
36
+ * - Usando useYieldPanelIsReady(): Este hook es una alternativa disponible
37
+ * para las situaciones en las que no tenemos ningún elemento HTML de
38
+ * importancia o cuando ese elemento no está disponible hasta después de la
39
+ * carga inicial. Al usar este hook el panel se reportará automáticamente una
40
+ * vez que haya hecho el renderizado inicial.
41
+ */
42
+ declare function useYieldPanelIsReady(): void;
43
+
44
+ export { useYieldPanelIsReady };
45
+ //# sourceMappingURL=useYieldPanelIsReady.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useYieldPanelIsReady.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ import { useMount } from '@apia/util';
2
+ import { usePanelContext } from './index.js';
3
+
4
+ function useYieldPanelIsReady() {
5
+ const { setRef } = usePanelContext();
6
+ useMount(() => {
7
+ setRef({});
8
+ });
9
+ }
10
+
11
+ export { useYieldPanelIsReady };
12
+ //# sourceMappingURL=useYieldPanelIsReady.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useYieldPanelIsReady.js","sources":["../../../../src/splash/panels/PanelContext/useYieldPanelIsReady.ts"],"sourcesContent":["import { useMount } from '@apia/util';\r\nimport { usePanelContext } from '.';\r\n\r\n/**\r\n * **Favor de leer con cuidado el siguiente contenido, es muy importante para\r\n * la performance**\r\n *\r\n * El hook useYieldPanelIsReady es una parte muy importante del flujo de\r\n * trabajo de los dashboards. **El no reportar la carga de un panel tiene\r\n * penalizaciones graves en el tiempo de renderizado inicial**, esto es porque\r\n * el dashboard espera que todos los paneles hayan terminado la carga\r\n * estructural básica antes de empezar con los refresh iniciales, y esto termina\r\n * impactando en el tiempo que demora en bajar la cortina.\r\n *\r\n * **Aclaración:** Actualmente se espera las cargas estructurales para lanzar\r\n * los refresh iniciales por motivos de arquitectura. Esa restricción será\r\n * eliminada probablemente en el corto plazo, pero eso no cambia la necesidad de\r\n * reportar las estructuras ya que esta información es igualmente utilizada para\r\n * el bajado de la cortina de Skeletons.\r\n *\r\n * Por ejemplo, si todos los paneles están optimizados para lograr cargas\r\n * iniciales rápidas pero el logo de la aplicación no reporta que su estructura\r\n * está pronta, el dashboard va a bajar su cortina solamente luego de que expire\r\n * el timeout **DASH_COURTAIN_TRESHOLD**, que por defecto viene establecido en 5\r\n * segundos.\r\n *\r\n * Esto significa que aún cuando la cortina se hubiera podido bajar quizás a\r\n * los pocos ms de cargado el html inicial, no lo hará porque supone que el\r\n * panel Logo aún no terminó su carga estructural.\r\n *\r\n * Siempre que un panel esté presente en un dashboard, deberá reportar cuando\r\n * la carga estructural esté pronta. Esto puede ser hecho de dos formas:\r\n *\r\n * - Usando { setRef } = usePanelContext(): En el elemento crucial de HTML del\r\n * elemento hacer ref={setRef}. Esta es la forma más óptima ya que nos garantiza\r\n * que el panel se reporte cuando su estructura HTML ya esté disponible,\r\n * evitando ninguna demora.\r\n *\r\n * - Usando useYieldPanelIsReady(): Este hook es una alternativa disponible\r\n * para las situaciones en las que no tenemos ningún elemento HTML de\r\n * importancia o cuando ese elemento no está disponible hasta después de la\r\n * carga inicial. Al usar este hook el panel se reportará automáticamente una\r\n * vez que haya hecho el renderizado inicial.\r\n */\r\nexport function useYieldPanelIsReady() {\r\n const { setRef } = usePanelContext();\r\n\r\n useMount(() => {\r\n setRef({} as HTMLElement);\r\n });\r\n}\r\n"],"names":[],"mappings":";;;AA4CO,SAAS,oBAAuB,GAAA;AACrC,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,eAAgB,EAAA,CAAA;AAEnC,EAAA,QAAA,CAAS,MAAM;AACb,IAAA,MAAA,CAAO,EAAiB,CAAA,CAAA;AAAA,GACzB,CAAA,CAAA;AACH;;;;"}
@@ -0,0 +1,53 @@
1
+ import { jsxs, jsx } from '@apia/theme/jsx-runtime';
2
+ import { makeStyledComponent, Box, Heading, Paragraph } from '@apia/theme';
3
+ import { Component } from 'react';
4
+
5
+ var __defProp = Object.defineProperty;
6
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7
+ var __publicField = (obj, key, value) => {
8
+ __defNormalProp(obj, key + "" , value);
9
+ return value;
10
+ };
11
+ const Error2 = makeStyledComponent(
12
+ "Error",
13
+ "layout.panels.error",
14
+ {
15
+ ".panelError__wrapper": {
16
+ display: "flex",
17
+ flexDirection: "column",
18
+ gap: 3,
19
+ h3: {
20
+ color: "palette.error.main"
21
+ }
22
+ }
23
+ },
24
+ ({ error }) => {
25
+ return /* @__PURE__ */ jsxs(Box, { className: "panelError__wrapper", children: [
26
+ /* @__PURE__ */ jsx(Heading, { as: "h3", children: "Oops! Something went wrong" }),
27
+ /* @__PURE__ */ jsx(Heading, { as: "h4", children: "Error:" }),
28
+ /* @__PURE__ */ jsx(Paragraph, { children: error })
29
+ ] });
30
+ }
31
+ );
32
+ class PanelErrorBoundary extends Component {
33
+ constructor() {
34
+ super(...arguments);
35
+ __publicField(this, "state", {
36
+ hasError: false,
37
+ errorMessage: ""
38
+ });
39
+ }
40
+ static getDerivedStateFromError(error) {
41
+ if (!(error instanceof Promise))
42
+ return { hasError: true, errorMessage: String(error) };
43
+ }
44
+ render() {
45
+ if (this.state.hasError) {
46
+ return /* @__PURE__ */ jsx(Error2, { error: this.state.errorMessage });
47
+ }
48
+ return this.props.children;
49
+ }
50
+ }
51
+
52
+ export { PanelErrorBoundary };
53
+ //# sourceMappingURL=PanelErrorBoundary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PanelErrorBoundary.js","sources":["../../../src/splash/panels/PanelErrorBoundary.tsx"],"sourcesContent":["import { makeStyledComponent } from '@apia/theme';\r\nimport { Component, ReactNode } from 'react';\r\nimport { Box, Heading, Paragraph } from '@apia/theme';\r\n\r\nconst Error = makeStyledComponent(\r\n 'Error',\r\n 'layout.panels.error',\r\n {\r\n '.panelError__wrapper': {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n gap: 3,\r\n\r\n h3: {\r\n color: 'palette.error.main',\r\n },\r\n },\r\n },\r\n ({ error }: { error: string }) => {\r\n return (\r\n <Box className=\"panelError__wrapper\">\r\n <Heading as=\"h3\">Oops! Something went wrong</Heading>\r\n <Heading as=\"h4\">Error:</Heading>\r\n <Paragraph>{error}</Paragraph>\r\n </Box>\r\n );\r\n },\r\n);\r\n\r\nexport class PanelErrorBoundary extends Component<\r\n { children: ReactNode },\r\n { hasError: boolean; errorMessage: string }\r\n> {\r\n state: Readonly<{ hasError: boolean; errorMessage: string }> = {\r\n hasError: false,\r\n errorMessage: '',\r\n };\r\n\r\n static getDerivedStateFromError(error: unknown) {\r\n if (!(error instanceof Promise))\r\n return { hasError: true, errorMessage: String(error) };\r\n }\r\n\r\n render() {\r\n if (this.state.hasError) {\r\n return <Error error={this.state.errorMessage} />;\r\n }\r\n\r\n return this.props.children;\r\n }\r\n}\r\n"],"names":["Error"],"mappings":";;;;;;;;;;AAIA,MAAMA,MAAQ,GAAA,mBAAA;AAAA,EACZ,OAAA;AAAA,EACA,qBAAA;AAAA,EACA;AAAA,IACE,sBAAwB,EAAA;AAAA,MACtB,OAAS,EAAA,MAAA;AAAA,MACT,aAAe,EAAA,QAAA;AAAA,MACf,GAAK,EAAA,CAAA;AAAA,MAEL,EAAI,EAAA;AAAA,QACF,KAAO,EAAA,oBAAA;AAAA,OACT;AAAA,KACF;AAAA,GACF;AAAA,EACA,CAAC,EAAE,KAAA,EAA+B,KAAA;AAChC,IACE,uBAAA,IAAA,CAAC,GAAI,EAAA,EAAA,SAAA,EAAU,qBACb,EAAA,QAAA,EAAA;AAAA,sBAAC,GAAA,CAAA,OAAA,EAAA,EAAQ,EAAG,EAAA,IAAA,EAAK,QAA0B,EAAA,4BAAA,EAAA,CAAA;AAAA,sBAC1C,GAAA,CAAA,OAAA,EAAA,EAAQ,EAAG,EAAA,IAAA,EAAK,QAAM,EAAA,QAAA,EAAA,CAAA;AAAA,sBACvB,GAAA,CAAC,aAAW,QAAM,EAAA,KAAA,EAAA,CAAA;AAAA,KACpB,EAAA,CAAA,CAAA;AAAA,GAEJ;AACF,CAAA,CAAA;AAEO,MAAM,2BAA2B,SAGtC,CAAA;AAAA,EAHK,WAAA,GAAA;AAAA,IAAA,KAAA,CAAA,GAAA,SAAA,CAAA,CAAA;AAIL,IAA+D,aAAA,CAAA,IAAA,EAAA,OAAA,EAAA;AAAA,MAC7D,QAAU,EAAA,KAAA;AAAA,MACV,YAAc,EAAA,EAAA;AAAA,KAChB,CAAA,CAAA;AAAA,GAAA;AAAA,EAEA,OAAO,yBAAyB,KAAgB,EAAA;AAC9C,IAAA,IAAI,EAAE,KAAiB,YAAA,OAAA,CAAA;AACrB,MAAA,OAAO,EAAE,QAAU,EAAA,IAAA,EAAM,YAAc,EAAA,MAAA,CAAO,KAAK,CAAE,EAAA,CAAA;AAAA,GACzD;AAAA,EAEA,MAAS,GAAA;AACP,IAAI,IAAA,IAAA,CAAK,MAAM,QAAU,EAAA;AACvB,MAAA,2BAAQA,MAAA,EAAA,EAAM,KAAO,EAAA,IAAA,CAAK,MAAM,YAAc,EAAA,CAAA,CAAA;AAAA,KAChD;AAEA,IAAA,OAAO,KAAK,KAAM,CAAA,QAAA,CAAA;AAAA,GACpB;AACF;;;;"}
@@ -0,0 +1,16 @@
1
+ import * as react from 'react';
2
+ import { ReactNode } from 'react';
3
+ import { TPanelIdentifier } from '../../eventsController/types.js';
4
+
5
+ declare const PanelIdentifierContext: react.Context<TPanelIdentifier | undefined>;
6
+ interface TPanelIdentifierProps {
7
+ children: ReactNode;
8
+ id: string;
9
+ name: string;
10
+ title: string;
11
+ type: string;
12
+ }
13
+ declare const PanelIdentifier: ({ children, name, id, title, type, }: TPanelIdentifierProps) => react.JSX.Element;
14
+
15
+ export { PanelIdentifier, PanelIdentifierContext, type TPanelIdentifierProps };
16
+ //# sourceMappingURL=PanelIdentifier.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PanelIdentifier.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,19 @@
1
+ import { jsx } from '@apia/theme/jsx-runtime';
2
+ import { createContext, useMemo } from 'react';
3
+
4
+ const PanelIdentifierContext = createContext(void 0);
5
+ const PanelIdentifier = ({
6
+ children,
7
+ name,
8
+ id,
9
+ title,
10
+ type
11
+ }) => {
12
+ const contextValue = useMemo(() => {
13
+ return { panelName: name, panelId: id, panelTitle: title, panelType: type };
14
+ }, []);
15
+ return /* @__PURE__ */ jsx(PanelIdentifierContext.Provider, { value: contextValue, children });
16
+ };
17
+
18
+ export { PanelIdentifier, PanelIdentifierContext };
19
+ //# sourceMappingURL=PanelIdentifier.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PanelIdentifier.js","sources":["../../../src/splash/panels/PanelIdentifier.tsx"],"sourcesContent":["import { ReactNode, createContext, useMemo } from 'react';\r\nimport { TPanelIdentifier } from '../../eventsController/types';\r\n\r\nexport const PanelIdentifierContext = createContext<\r\n TPanelIdentifier | undefined\r\n>(undefined);\r\n\r\nexport interface TPanelIdentifierProps {\r\n children: ReactNode;\r\n id: string;\r\n name: string;\r\n title: string;\r\n type: string;\r\n}\r\n\r\nexport const PanelIdentifier = ({\r\n children,\r\n name,\r\n id,\r\n title,\r\n type,\r\n}: TPanelIdentifierProps) => {\r\n const contextValue: TPanelIdentifier = useMemo(() => {\r\n return { panelName: name, panelId: id, panelTitle: title, panelType: type };\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, []);\r\n\r\n return (\r\n <PanelIdentifierContext.Provider value={contextValue}>\r\n {children}\r\n </PanelIdentifierContext.Provider>\r\n );\r\n};\r\n"],"names":[],"mappings":";;;AAGa,MAAA,sBAAA,GAAyB,cAEpC,KAAS,CAAA,EAAA;AAUJ,MAAM,kBAAkB,CAAC;AAAA,EAC9B,QAAA;AAAA,EACA,IAAA;AAAA,EACA,EAAA;AAAA,EACA,KAAA;AAAA,EACA,IAAA;AACF,CAA6B,KAAA;AAC3B,EAAM,MAAA,YAAA,GAAiC,QAAQ,MAAM;AACnD,IAAO,OAAA,EAAE,WAAW,IAAM,EAAA,OAAA,EAAS,IAAI,UAAY,EAAA,KAAA,EAAO,WAAW,IAAK,EAAA,CAAA;AAAA,GAE5E,EAAG,EAAE,CAAA,CAAA;AAEL,EAAA,2BACG,sBAAuB,CAAA,QAAA,EAAvB,EAAgC,KAAA,EAAO,cACrC,QACH,EAAA,CAAA,CAAA;AAEJ;;;;"}
@@ -0,0 +1,243 @@
1
+ import { getSpecificParent } from '@apia/util';
2
+ import { dragleave } from '../events/Dragleave.js';
3
+ import { dragover } from '../events/Dragover.js';
4
+ import { dragstart } from '../events/Dragstart.js';
5
+ import { Drop } from '../events/Drop.js';
6
+
7
+ var __defProp = Object.defineProperty;
8
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
+ var __publicField = (obj, key, value) => {
10
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
11
+ return value;
12
+ };
13
+ var __accessCheck = (obj, member, msg) => {
14
+ if (!member.has(obj))
15
+ throw TypeError("Cannot " + msg);
16
+ };
17
+ var __privateGet = (obj, member, getter) => {
18
+ __accessCheck(obj, member, "read from private field");
19
+ return getter ? getter.call(obj) : member.get(obj);
20
+ };
21
+ var __privateAdd = (obj, member, value) => {
22
+ if (member.has(obj))
23
+ throw TypeError("Cannot add the same private member more than once");
24
+ member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
25
+ };
26
+ var __privateSet = (obj, member, value, setter) => {
27
+ __accessCheck(obj, member, "write to private field");
28
+ member.set(obj, value);
29
+ return value;
30
+ };
31
+ var _unsuscribers;
32
+ class DragAndDrop {
33
+ constructor() {
34
+ __privateAdd(this, _unsuscribers, []);
35
+ __publicField(this, "bootstrap", () => {
36
+ __privateGet(this, _unsuscribers).forEach((unsuscribe) => unsuscribe());
37
+ __privateSet(this, _unsuscribers, []);
38
+ this.body.addEventListener("dragover", this.dragOver);
39
+ this.body.addEventListener("drop", this.drop);
40
+ __privateGet(this, _unsuscribers).push(() => {
41
+ this.body.removeEventListener("dragover", this.dragOver);
42
+ this.body.removeEventListener("drop", this.drop);
43
+ });
44
+ if (this.splash) {
45
+ this.splash.addEventListener("dragleave", this.dragLeave);
46
+ this.splash.addEventListener("dragenter", this.dragEnter);
47
+ this.body.addEventListener("dragenter", this.dragEnter);
48
+ __privateGet(this, _unsuscribers).push(() => {
49
+ this.splash.removeEventListener("dragleave", this.dragLeave);
50
+ this.splash.removeEventListener("dragenter", this.dragEnter);
51
+ this.body.removeEventListener("dragenter", this.dragEnter);
52
+ });
53
+ }
54
+ this.panels.map((el) => {
55
+ el.addEventListener("dragstart", (ev) => {
56
+ this.dragStart(ev, el);
57
+ });
58
+ __privateGet(this, _unsuscribers).push(() => {
59
+ el.removeEventListener("dragstart", (ev) => {
60
+ this.dragStart(ev, el);
61
+ });
62
+ });
63
+ return el;
64
+ });
65
+ });
66
+ __publicField(this, "panelData", []);
67
+ __publicField(this, "minimap", null);
68
+ __publicField(this, "timeout", -1);
69
+ __publicField(this, "sectionData", []);
70
+ __publicField(this, "body", document.querySelector("[data-layout]"));
71
+ __publicField(this, "splash", document.querySelector("[data-splash]"));
72
+ __publicField(this, "dragoverPosition", { x: 0, y: 0 });
73
+ __publicField(this, "shadowDivData", null);
74
+ __publicField(this, "shadowDiv", null);
75
+ __publicField(this, "placeholderImage", null);
76
+ __publicField(this, "panels", [
77
+ ...document.querySelectorAll("[data-panel][data-id]")
78
+ ]);
79
+ __publicField(this, "currentScroll", document.scrollingElement?.scrollTop ?? 0);
80
+ __publicField(this, "draggingPanel", null);
81
+ __publicField(this, "draggingPanelId", "");
82
+ __publicField(this, "draggingPanelSectionId", "");
83
+ __publicField(this, "currentBottomPanel");
84
+ __publicField(this, "updateMinimap", () => {
85
+ const frameElement = document.querySelector(".windowFrame");
86
+ if (frameElement) {
87
+ frameElement.style.top = `${(document.scrollingElement?.scrollTop ?? 0) * Number(frameElement.dataset.aspect)}px`;
88
+ }
89
+ });
90
+ __publicField(this, "removePlaceholder", () => {
91
+ this.clearTimeout();
92
+ const falseDivs = document.querySelectorAll(".apia_panel_falseDiv");
93
+ falseDivs.forEach((el) => {
94
+ el.remove();
95
+ });
96
+ this.placeholderImage?.remove();
97
+ this.placeholderImage = null;
98
+ });
99
+ __publicField(this, "clearTimeout", () => {
100
+ clearTimeout(this.timeout);
101
+ });
102
+ __publicField(this, "debounceAppend", (target, child) => {
103
+ if (!this.draggingPanelId)
104
+ return;
105
+ if (this.timeout === -1) {
106
+ target.appendChild(child);
107
+ }
108
+ clearTimeout(this.timeout);
109
+ this.timeout = setTimeout(() => {
110
+ target.appendChild(child);
111
+ }, 500);
112
+ });
113
+ __publicField(this, "debounceBefore", (reference, child, container) => {
114
+ if (!this.draggingPanelId)
115
+ return;
116
+ if (this.timeout === -1)
117
+ container.insertBefore(child, reference);
118
+ clearTimeout(this.timeout);
119
+ this.timeout = setTimeout(() => {
120
+ container.insertBefore(child, reference);
121
+ }, 500);
122
+ });
123
+ __publicField(this, "debounceAfter", (child, reference) => {
124
+ if (!this.draggingPanelId)
125
+ return;
126
+ if (this.timeout === -1)
127
+ reference.after(child);
128
+ clearTimeout(this.timeout);
129
+ this.timeout = setTimeout(() => {
130
+ reference.after(child);
131
+ }, 500);
132
+ });
133
+ __publicField(this, "dragOver", (event) => {
134
+ dragover(event, this);
135
+ this.updateMinimap();
136
+ });
137
+ __publicField(this, "dragStart", (ev, el) => {
138
+ dragstart(ev, el, this);
139
+ });
140
+ __publicField(this, "dragLeave", (_ev) => {
141
+ dragleave(_ev, this);
142
+ });
143
+ __publicField(this, "dragEnter", (_ev) => {
144
+ _ev.preventDefault();
145
+ });
146
+ __publicField(this, "drop", (event) => {
147
+ Drop(event, this);
148
+ });
149
+ __publicField(this, "snapshot", () => {
150
+ this.panelData = [];
151
+ const innerPanels = this.body.querySelectorAll(
152
+ "[data-panel][data-id]"
153
+ );
154
+ innerPanels.forEach((panel) => {
155
+ if (panel.classList.contains("apia_panel_falseDiv")) {
156
+ this.shadowDivData = {
157
+ id: panel.getAttribute("data-id") ?? "",
158
+ isShadow: true,
159
+ panelBottom: panel.getBoundingClientRect().bottom + this.currentScroll,
160
+ panelTop: panel.getBoundingClientRect().top + this.currentScroll,
161
+ panelRight: panel.getBoundingClientRect().right,
162
+ panelLeft: panel.getBoundingClientRect().left,
163
+ panelWidth: panel.getBoundingClientRect().width,
164
+ panelHeight: panel.getBoundingClientRect().height,
165
+ row: getSpecificParent(
166
+ panel,
167
+ (current) => !!current.dataset.locationid
168
+ )?.classList.contains("apia_section_row") ?? false,
169
+ sectionId: getSpecificParent(
170
+ panel,
171
+ (current) => !!current.dataset.locationid
172
+ )?.dataset.locationid ?? 0
173
+ };
174
+ }
175
+ if (this.panelData.every((innerPanel) => {
176
+ return innerPanel.id !== panel.getAttribute("data-id") && !panel.classList.contains("apia_panel_falseDiv");
177
+ })) {
178
+ this.panelData.push({
179
+ isShadow: panel.classList.contains("apia_panel_falseDiv"),
180
+ panelBottom: panel.getBoundingClientRect().bottom + this.currentScroll,
181
+ panelTop: panel.getBoundingClientRect().top + this.currentScroll,
182
+ panelRight: panel.getBoundingClientRect().right,
183
+ panelLeft: panel.getBoundingClientRect().left,
184
+ panelWidth: panel.getBoundingClientRect().width,
185
+ panelHeight: panel.getBoundingClientRect().height,
186
+ row: getSpecificParent(
187
+ panel,
188
+ (current) => !!current.dataset.locationid
189
+ )?.classList.contains("apia_section_row") ?? false,
190
+ sectionId: getSpecificParent(
191
+ panel,
192
+ (current) => !!current.dataset.locationid
193
+ )?.dataset.locationid ?? 0,
194
+ id: getSpecificParent(
195
+ panel,
196
+ (current) => !!current.dataset.id
197
+ )?.dataset.id ?? 0
198
+ });
199
+ }
200
+ });
201
+ this.sectionData = [];
202
+ const sections = this.body?.querySelectorAll("[data-locationid]");
203
+ sections?.forEach((sec) => {
204
+ if (this.sectionData.every(
205
+ (innerSection) => innerSection.sectionId !== sec.getAttribute("data-locationid")
206
+ )) {
207
+ this.sectionData.push({
208
+ sectionBottom: sec.getBoundingClientRect().bottom + this.currentScroll,
209
+ sectionLeft: sec.getBoundingClientRect().left,
210
+ sectionTop: sec.getBoundingClientRect().top + this.currentScroll,
211
+ sectionRight: sec.getBoundingClientRect().right,
212
+ sectionWidth: sec.getBoundingClientRect().width,
213
+ sectionHeight: sec.getBoundingClientRect().height,
214
+ sectionId: getSpecificParent(
215
+ sec,
216
+ (current) => !!current.dataset.locationid
217
+ )?.dataset.locationid ?? 0
218
+ });
219
+ }
220
+ });
221
+ this.drawMinimap();
222
+ });
223
+ __publicField(this, "findBottomPanel", (x, y) => {
224
+ const bottomPanel = this.panelData.find((panel) => {
225
+ return panel.panelBottom >= y && panel.panelTop <= y && panel.panelLeft <= x && panel.panelRight >= x;
226
+ });
227
+ return bottomPanel;
228
+ });
229
+ __publicField(this, "findBottomSection", (x, y) => {
230
+ const bottomSection = this.sectionData.find((sec) => {
231
+ return sec.sectionBottom >= y && sec.sectionTop <= y && sec.sectionLeft <= x && sec.sectionRight >= x;
232
+ });
233
+ return bottomSection;
234
+ });
235
+ }
236
+ drawMinimap() {
237
+ return;
238
+ }
239
+ }
240
+ _unsuscribers = new WeakMap();
241
+
242
+ export { DragAndDrop };
243
+ //# sourceMappingURL=DragAndDrop.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DragAndDrop.js","sources":["../../../src/splash/util/DragAndDrop.ts"],"sourcesContent":["import { getSpecificParent } from '@apia/util';\r\nimport { dragleave } from '../events/Dragleave';\r\nimport { dragover } from '../events/Dragover';\r\nimport { dragstart } from '../events/Dragstart';\r\nimport { Drop } from '../events/Drop';\r\nimport { TPanelData, TSectionData } from '../types';\r\n\r\nexport class DragAndDrop {\r\n #unsuscribers: (() => void)[] = [];\r\n\r\n bootstrap = () => {\r\n this.#unsuscribers.forEach((unsuscribe) => unsuscribe());\r\n this.#unsuscribers = [];\r\n\r\n this.body.addEventListener('dragover', this.dragOver);\r\n this.body.addEventListener('drop', this.drop);\r\n this.#unsuscribers.push(() => {\r\n this.body.removeEventListener('dragover', this.dragOver);\r\n this.body.removeEventListener('drop', this.drop);\r\n });\r\n if (this.splash) {\r\n this.splash.addEventListener('dragleave', this.dragLeave);\r\n this.splash.addEventListener('dragenter', this.dragEnter);\r\n this.body.addEventListener('dragenter', this.dragEnter);\r\n this.#unsuscribers.push(() => {\r\n this.splash.removeEventListener('dragleave', this.dragLeave);\r\n this.splash.removeEventListener('dragenter', this.dragEnter);\r\n this.body.removeEventListener('dragenter', this.dragEnter);\r\n });\r\n }\r\n this.panels.map((el) => {\r\n (el as HTMLElement).addEventListener('dragstart', (ev) => {\r\n this.dragStart(ev, el);\r\n });\r\n this.#unsuscribers.push(() => {\r\n (el as HTMLElement).removeEventListener('dragstart', (ev) => {\r\n this.dragStart(ev, el);\r\n });\r\n });\r\n return el;\r\n });\r\n };\r\n panelData: TPanelData[] = [];\r\n minimap: HTMLElement | null = null;\r\n drawMinimap() {\r\n return;\r\n }\r\n timeout = -1;\r\n sectionData: TSectionData[] = [];\r\n body = document.querySelector('[data-layout]') as HTMLElement;\r\n splash = document.querySelector('[data-splash]') as HTMLElement;\r\n dragoverPosition: {\r\n x: string | number;\r\n y: string | number;\r\n } = { x: 0, y: 0 };\r\n shadowDivData: TPanelData | null = null;\r\n shadowDiv: HTMLDivElement | null = null;\r\n placeholderImage: HTMLElement | null = null;\r\n panels = [\r\n ...document.querySelectorAll('[data-panel][data-id]'),\r\n ] as HTMLElement[];\r\n currentScroll = document.scrollingElement?.scrollTop ?? 0;\r\n draggingPanel: HTMLElement | null = null;\r\n draggingPanelId = '';\r\n draggingPanelSectionId = '';\r\n currentBottomPanel: TPanelData | undefined = undefined;\r\n\r\n updateMinimap = () => {\r\n const frameElement = document.querySelector<HTMLElement>('.windowFrame');\r\n if (frameElement) {\r\n frameElement.style.top = `${\r\n (document.scrollingElement?.scrollTop ?? 0) *\r\n Number(frameElement.dataset.aspect)\r\n }px`;\r\n }\r\n };\r\n removePlaceholder = () => {\r\n this.clearTimeout();\r\n const falseDivs = document.querySelectorAll('.apia_panel_falseDiv');\r\n\r\n falseDivs.forEach((el) => {\r\n el.remove();\r\n });\r\n\r\n this.placeholderImage?.remove();\r\n this.placeholderImage = null;\r\n };\r\n clearTimeout = () => {\r\n clearTimeout(this.timeout);\r\n };\r\n debounceAppend = (target: HTMLElement, child: HTMLElement) => {\r\n if (!this.draggingPanelId) return;\r\n if (this.timeout === -1) {\r\n target.appendChild(child);\r\n }\r\n clearTimeout(this.timeout);\r\n this.timeout = setTimeout(() => {\r\n target.appendChild(child);\r\n }, 500) as unknown as number;\r\n };\r\n debounceBefore = (reference: Node, child: Node, container: HTMLElement) => {\r\n if (!this.draggingPanelId) return;\r\n if (this.timeout === -1) container.insertBefore(child, reference);\r\n clearTimeout(this.timeout);\r\n this.timeout = setTimeout(() => {\r\n container.insertBefore(child, reference);\r\n }, 500) as unknown as number;\r\n };\r\n debounceAfter = (child: Node, reference: Node) => {\r\n if (!this.draggingPanelId) return;\r\n if (this.timeout === -1) (reference as HTMLElement).after(child);\r\n clearTimeout(this.timeout);\r\n this.timeout = setTimeout(() => {\r\n (reference as HTMLElement).after(child);\r\n }, 500) as unknown as number;\r\n };\r\n dragOver = (event: Event) => {\r\n dragover(event, this);\r\n this.updateMinimap();\r\n };\r\n dragStart = (ev: DragEvent, el: Element) => {\r\n dragstart(ev, el, this);\r\n };\r\n dragLeave = (_ev: Event) => {\r\n dragleave(_ev, this);\r\n };\r\n dragEnter = (_ev: Event) => {\r\n _ev.preventDefault();\r\n };\r\n drop = (event: Event) => {\r\n Drop(event, this);\r\n };\r\n snapshot = () => {\r\n this.panelData = [];\r\n const innerPanels = (this.body as HTMLElement).querySelectorAll(\r\n '[data-panel][data-id]',\r\n );\r\n innerPanels.forEach((panel) => {\r\n if (panel.classList.contains('apia_panel_falseDiv')) {\r\n this.shadowDivData = {\r\n id: panel.getAttribute('data-id') ?? '',\r\n isShadow: true,\r\n panelBottom:\r\n panel.getBoundingClientRect().bottom + this.currentScroll,\r\n panelTop: panel.getBoundingClientRect().top + this.currentScroll,\r\n panelRight: panel.getBoundingClientRect().right,\r\n panelLeft: panel.getBoundingClientRect().left,\r\n panelWidth: panel.getBoundingClientRect().width,\r\n panelHeight: panel.getBoundingClientRect().height,\r\n row:\r\n getSpecificParent(\r\n panel as HTMLElement,\r\n (current) => !!current.dataset.locationid,\r\n )?.classList.contains('apia_section_row') ?? false,\r\n sectionId:\r\n getSpecificParent(\r\n panel as HTMLElement,\r\n (current) => !!current.dataset.locationid,\r\n )?.dataset.locationid ?? 0,\r\n };\r\n }\r\n if (\r\n this.panelData.every((innerPanel) => {\r\n return (\r\n innerPanel.id !== panel.getAttribute('data-id') &&\r\n !panel.classList.contains('apia_panel_falseDiv')\r\n );\r\n })\r\n ) {\r\n this.panelData.push({\r\n isShadow: panel.classList.contains('apia_panel_falseDiv'),\r\n panelBottom:\r\n panel.getBoundingClientRect().bottom + this.currentScroll,\r\n panelTop: panel.getBoundingClientRect().top + this.currentScroll,\r\n panelRight: panel.getBoundingClientRect().right,\r\n panelLeft: panel.getBoundingClientRect().left,\r\n panelWidth: panel.getBoundingClientRect().width,\r\n panelHeight: panel.getBoundingClientRect().height,\r\n row:\r\n getSpecificParent(\r\n panel as HTMLElement,\r\n (current) => !!current.dataset.locationid,\r\n )?.classList.contains('apia_section_row') ?? false,\r\n sectionId:\r\n getSpecificParent(\r\n panel as HTMLElement,\r\n (current) => !!current.dataset.locationid,\r\n )?.dataset.locationid ?? 0,\r\n id:\r\n getSpecificParent(\r\n panel as HTMLElement,\r\n (current) => !!current.dataset.id,\r\n )?.dataset.id ?? 0,\r\n });\r\n }\r\n });\r\n this.sectionData = [];\r\n const sections = this.body?.querySelectorAll('[data-locationid]');\r\n\r\n sections?.forEach((sec) => {\r\n if (\r\n this.sectionData.every(\r\n (innerSection) =>\r\n innerSection.sectionId !== sec.getAttribute('data-locationid'),\r\n )\r\n ) {\r\n this.sectionData.push({\r\n sectionBottom:\r\n sec.getBoundingClientRect().bottom + this.currentScroll,\r\n sectionLeft: sec.getBoundingClientRect().left,\r\n sectionTop: sec.getBoundingClientRect().top + this.currentScroll,\r\n sectionRight: sec.getBoundingClientRect().right,\r\n sectionWidth: sec.getBoundingClientRect().width,\r\n sectionHeight: sec.getBoundingClientRect().height,\r\n sectionId:\r\n getSpecificParent(\r\n sec as HTMLElement,\r\n (current) => !!current.dataset.locationid,\r\n )?.dataset.locationid ?? 0,\r\n });\r\n }\r\n });\r\n\r\n this.drawMinimap();\r\n };\r\n findBottomPanel = (x: number, y: number) => {\r\n const bottomPanel = this.panelData.find((panel) => {\r\n return (\r\n panel.panelBottom >= y &&\r\n panel.panelTop <= y &&\r\n panel.panelLeft <= x &&\r\n panel.panelRight >= x\r\n );\r\n });\r\n return bottomPanel;\r\n };\r\n findBottomSection = (x: number, y: number) => {\r\n const bottomSection = this.sectionData.find((sec) => {\r\n return (\r\n sec.sectionBottom >= y &&\r\n sec.sectionTop <= y &&\r\n sec.sectionLeft <= x &&\r\n sec.sectionRight >= x\r\n );\r\n });\r\n return bottomSection;\r\n };\r\n}\r\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA,aAAA,CAAA;AAOO,MAAM,WAAY,CAAA;AAAA,EAAlB,WAAA,GAAA;AACL,IAAA,YAAA,CAAA,IAAA,EAAA,aAAA,EAAgC,EAAC,CAAA,CAAA;AAEjC,IAAA,aAAA,CAAA,IAAA,EAAA,WAAA,EAAY,MAAM;AAChB,MAAA,YAAA,CAAA,IAAA,EAAK,aAAc,CAAA,CAAA,OAAA,CAAQ,CAAC,UAAA,KAAe,YAAY,CAAA,CAAA;AACvD,MAAA,YAAA,CAAA,IAAA,EAAK,eAAgB,EAAC,CAAA,CAAA;AAEtB,MAAA,IAAA,CAAK,IAAK,CAAA,gBAAA,CAAiB,UAAY,EAAA,IAAA,CAAK,QAAQ,CAAA,CAAA;AACpD,MAAA,IAAA,CAAK,IAAK,CAAA,gBAAA,CAAiB,MAAQ,EAAA,IAAA,CAAK,IAAI,CAAA,CAAA;AAC5C,MAAK,YAAA,CAAA,IAAA,EAAA,aAAA,CAAA,CAAc,KAAK,MAAM;AAC5B,QAAA,IAAA,CAAK,IAAK,CAAA,mBAAA,CAAoB,UAAY,EAAA,IAAA,CAAK,QAAQ,CAAA,CAAA;AACvD,QAAA,IAA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AAI,aAAiB,IAAA,CAAA,IACrB,GAAI,CAAA,UAAA,IAAc,KAClB,GAAI,CAAA,WAAA,IAAe,CACnB,IAAA,GAAA,CAAI,YAAgB,IAAA,CAAA,CAAA;AAAA,OAEvB,CAAA,CAAA;AACD,MAAO,OAAA,aAAA,CAAA;AAAA,KACT,CAAA,CAAA;AAAA,GAAA;AAAA,EA1MA,WAAc,GAAA;AACZ,IAAA,OAAA;AAAA,GACF;AAyMF,CAAA;AA/OE,aAAA,GAAA,IAAA,OAAA,EAAA;;;;"}
@@ -0,0 +1,19 @@
1
+ const getColumnAreas = (specificPanel) => {
2
+ return {
3
+ top: {
4
+ top: specificPanel.panelTop,
5
+ bottom: specificPanel.panelTop + specificPanel.panelHeight / 2,
6
+ left: specificPanel.panelLeft,
7
+ right: specificPanel.panelRight
8
+ },
9
+ bottom: {
10
+ top: specificPanel.panelBottom - specificPanel.panelHeight / 2,
11
+ bottom: specificPanel.panelBottom,
12
+ right: specificPanel.panelRight,
13
+ left: specificPanel.panelLeft
14
+ }
15
+ };
16
+ };
17
+
18
+ export { getColumnAreas };
19
+ //# sourceMappingURL=getColumnAreas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getColumnAreas.js","sources":["../../../src/splash/util/getColumnAreas.ts"],"sourcesContent":["import { TPanelData } from '../types';\r\n\r\nexport const getColumnAreas = (specificPanel: TPanelData) => {\r\n return {\r\n top: {\r\n top: specificPanel.panelTop,\r\n bottom: specificPanel.panelTop + specificPanel.panelHeight / 2,\r\n left: specificPanel.panelLeft,\r\n right: specificPanel.panelRight,\r\n },\r\n bottom: {\r\n top: specificPanel.panelBottom - specificPanel.panelHeight / 2,\r\n bottom: specificPanel.panelBottom,\r\n right: specificPanel.panelRight,\r\n left: specificPanel.panelLeft,\r\n },\r\n };\r\n};\r\n"],"names":[],"mappings":"AAEa,MAAA,cAAA,GAAiB,CAAC,aAA8B,KAAA;AAC3D,EAAO,OAAA;AAAA,IACL,GAAK,EAAA;AAAA,MACH,KAAK,aAAc,CAAA,QAAA;AAAA,MACnB,MAAQ,EAAA,aAAA,CAAc,QAAW,GAAA,aAAA,CAAc,WAAc,GAAA,CAAA;AAAA,MAC7D,MAAM,aAAc,CAAA,SAAA;AAAA,MACpB,OAAO,aAAc,CAAA,UAAA;AAAA,KACvB;AAAA,IACA,MAAQ,EAAA;AAAA,MACN,GAAK,EAAA,aAAA,CAAc,WAAc,GAAA,aAAA,CAAc,WAAc,GAAA,CAAA;AAAA,MAC7D,QAAQ,aAAc,CAAA,WAAA;AAAA,MACtB,OAAO,aAAc,CAAA,UAAA;AAAA,MACrB,MAAM,aAAc,CAAA,SAAA;AAAA,KACtB;AAAA,GACF,CAAA;AACF;;;;"}
@@ -0,0 +1,13 @@
1
+ const isCursorInArea = ({
2
+ top,
3
+ bottom,
4
+ left,
5
+ right,
6
+ cursorX,
7
+ cursorY
8
+ }) => {
9
+ return top <= cursorY && cursorY <= bottom && left <= cursorX && cursorX <= right;
10
+ };
11
+
12
+ export { isCursorInArea };
13
+ //# sourceMappingURL=isCursorInArea.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isCursorInArea.js","sources":["../../../src/splash/util/isCursorInArea.ts"],"sourcesContent":["import { TPanelZoneCoordinates } from '../types';\r\n\r\nexport const isCursorInArea = ({\r\n top,\r\n bottom,\r\n left,\r\n right,\r\n cursorX,\r\n cursorY,\r\n}: TPanelZoneCoordinates) => {\r\n return (\r\n top <= cursorY && cursorY <= bottom && left <= cursorX && cursorX <= right\r\n );\r\n};\r\n"],"names":[],"mappings":"AAEO,MAAM,iBAAiB,CAAC;AAAA,EAC7B,GAAA;AAAA,EACA,MAAA;AAAA,EACA,IAAA;AAAA,EACA,KAAA;AAAA,EACA,OAAA;AAAA,EACA,OAAA;AACF,CAA6B,KAAA;AAC3B,EAAA,OACE,OAAO,OAAW,IAAA,OAAA,IAAW,MAAU,IAAA,IAAA,IAAQ,WAAW,OAAW,IAAA,KAAA,CAAA;AAEzE;;;;"}
@@ -0,0 +1,27 @@
1
+ import { ReactNode, FC } from 'react';
2
+
3
+ interface TPanelProps {
4
+ canMove: boolean;
5
+ children: ReactNode;
6
+ hasRss: boolean;
7
+ id: string;
8
+ initialData: {
9
+ initialData: unknown;
10
+ };
11
+ isConfigurable: boolean;
12
+ isRefreshable: boolean;
13
+ name: string;
14
+ refreshOnStart: boolean;
15
+ refreshOnHome: boolean;
16
+ showTitle: boolean;
17
+ title: string;
18
+ type: string;
19
+ }
20
+ type TLoadedPanelProps = Omit<TPanelProps, 'children'>;
21
+ type TPanelId = TPanelProps['id'];
22
+ type TPanelName = TPanelProps['name'];
23
+ type TPanelType = TPanelProps['type'];
24
+ type PanelContainer = FC<TPanelProps>;
25
+
26
+ export type { PanelContainer, TLoadedPanelProps, TPanelId, TPanelName, TPanelProps, TPanelType };
27
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/dist/util.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ import { ComponentType } from 'react';
2
+
3
+ declare function importPanel(path: string): ComponentType<{
4
+ initialData: unknown;
5
+ }>;
6
+
7
+ export { importPanel };
8
+ //# sourceMappingURL=util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"util.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/dist/util.js ADDED
@@ -0,0 +1,30 @@
1
+ import { lazy } from 'react';
2
+ import { PanelNotFound } from './dashboard/PanelNotFound.js';
3
+
4
+ const importedPanels = {};
5
+ function importPanel(path) {
6
+ if (!importedPanels[path])
7
+ importedPanels[path] = lazy(() => {
8
+ return new Promise((resolve) => {
9
+ import(
10
+ /* webpackChunkName: "[request]" */
11
+ /* webpackInclude: /\.tsx?$/ */
12
+ /* webpackPreload: true */
13
+ `/panels/${path}`
14
+ ).then(
15
+ (result) => {
16
+ console.log(result);
17
+ resolve(result.default);
18
+ }
19
+ ).catch(() => {
20
+ resolve({
21
+ default: PanelNotFound
22
+ });
23
+ });
24
+ });
25
+ });
26
+ return importedPanels[path];
27
+ }
28
+
29
+ export { importPanel };
30
+ //# sourceMappingURL=util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"util.js","sources":["../src/util.ts"],"sourcesContent":["import { ComponentType, lazy } from 'react';\r\nimport { PanelNotFound } from './dashboard/PanelNotFound';\r\n\r\nconst importedPanels: Record<\r\n string,\r\n ComponentType<{ initialData: unknown }>\r\n> = {};\r\nexport function importPanel(path: string) {\r\n if (!importedPanels[path])\r\n importedPanels[path] = lazy<ComponentType<{ initialData: unknown }>>(() => {\r\n return new Promise<{\r\n default: ComponentType<{ initialData: unknown }>;\r\n }>((resolve) => {\r\n import(\r\n /* webpackChunkName: \"[request]\" */\r\n /* webpackInclude: /\\.tsx?$/ */\r\n /* webpackPreload: true */\r\n `/panels/${path}`\r\n )\r\n .then(\r\n (result: {\r\n default: { default: ComponentType<{ initialData: unknown }> };\r\n }) => {\r\n console.log(result);\r\n resolve(result.default);\r\n },\r\n )\r\n .catch(() => {\r\n resolve({\r\n default: PanelNotFound,\r\n });\r\n });\r\n });\r\n });\r\n\r\n return importedPanels[path];\r\n}\r\n"],"names":[],"mappings":";;;AAGA,MAAM,iBAGF,EAAC,CAAA;AACE,SAAS,YAAY,IAAc,EAAA;AACxC,EAAI,IAAA,CAAC,eAAe,IAAI,CAAA;AACtB,IAAe,cAAA,CAAA,IAAI,CAAI,GAAA,IAAA,CAA8C,MAAM;AACzE,MAAO,OAAA,IAAI,OAER,CAAA,CAAC,OAAY,KAAA;AACd,QAAA;AAAA;AAAA;AAAA;AAAA,UAIE,WAAW,IAAI,CAAA,CAAA;AAAA,SAEd,CAAA,IAAA;AAAA,UACC,CAAC,MAEK,KAAA;AACJ,YAAA,OAAA,CAAQ,IAAI,MAAM,CAAA,CAAA;AAClB,YAAA,OAAA,CAAQ,OAAO,OAAO,CAAA,CAAA;AAAA,WACxB;AAAA,SACF,CACC,MAAM,MAAM;AACX,UAAQ,OAAA,CAAA;AAAA,YACN,OAAS,EAAA,aAAA;AAAA,WACV,CAAA,CAAA;AAAA,SACF,CAAA,CAAA;AAAA,OACJ,CAAA,CAAA;AAAA,KACF,CAAA,CAAA;AAEH,EAAA,OAAO,eAAe,IAAI,CAAA,CAAA;AAC5B;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apia/dashboard-controller",
3
- "version": "2.0.9",
3
+ "version": "2.0.10",
4
4
  "sideEffects": false,
5
5
  "author": "Alexis Leite <alexisleite@live.com>",
6
6
  "main": "dist/index.js",
@@ -13,8 +13,8 @@
13
13
  "libWatch": "rollup --watch --config ../../config/rollup.common.mjs --environment MODE:development,ENTRY:index.ts,WATCH:true"
14
14
  },
15
15
  "dependencies": {
16
- "@apia/api": "^2.0.9",
17
- "@apia/components": "^2.0.9",
16
+ "@apia/api": "^2.0.10",
17
+ "@apia/components": "^2.0.10",
18
18
  "@apia/icons": "^2.0.8",
19
19
  "@apia/store": "^2.0.8",
20
20
  "@apia/theme": "^2.0.8",
@@ -37,5 +37,5 @@
37
37
  "access": "public",
38
38
  "registry": "https://registry.npmjs.org/"
39
39
  },
40
- "gitHead": "0fec582924d14ada0f317defb5e024b1a8f96c4d"
40
+ "gitHead": "7c24cfee81e9960f174af5ede68e8f9f514db1d9"
41
41
  }