@adhese/sdk-devtools 0.7.1 → 0.7.2

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.cjs CHANGED
@@ -1,8 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const sdk = require("@adhese/sdk");
4
3
  const react = require("react");
5
- const createDevtools = (context) => {
4
+ const createDevtools = (context, {
5
+ onInit,
6
+ onDispose
7
+ }) => {
6
8
  const wrapperElement = document.createElement("div");
7
9
  let unmount;
8
10
  async function initDevtools() {
@@ -12,7 +14,7 @@ const createDevtools = (context) => {
12
14
  unmount = main.createAdheseDevtools(wrapperElement, context);
13
15
  }
14
16
  }
15
- sdk.onInit(async () => {
17
+ onInit(async () => {
16
18
  var _a;
17
19
  if (context.debug)
18
20
  await initDevtools();
@@ -29,7 +31,7 @@ const createDevtools = (context) => {
29
31
  if (wrapperElement.parentElement)
30
32
  wrapperElement.outerHTML = "";
31
33
  }
32
- sdk.onDispose(dispose);
34
+ onDispose(dispose);
33
35
  };
34
36
  const Devtools = react.lazy(() => Promise.resolve().then(() => require("./devtools-aidsR1fI.cjs")).then((n) => n.Devtools).then((module2) => ({ default: module2.Devtools })));
35
37
  exports.Devtools = Devtools;
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../src/index.ts"],"sourcesContent":["import { type AdheseContext, type AdhesePlugin, onDispose, onInit } from '@adhese/sdk';\nimport { lazy } from 'react';\n\nexport const createDevtools: AdhesePlugin = (context: AdheseContext) => {\n const wrapperElement = document.createElement('div');\n let unmount: (() => void) | undefined;\n\n async function initDevtools(): Promise<void> {\n const main = await import('./main');\n\n if (!unmount) {\n document.body.appendChild(wrapperElement);\n\n unmount = main.createAdheseDevtools(wrapperElement, context);\n }\n }\n\n onInit(async () => {\n if (context.debug)\n await initDevtools();\n\n context.events?.debugChange.addListener(async (debug) => {\n if (debug)\n await initDevtools();\n else\n dispose();\n });\n });\n\n function dispose(): void {\n unmount?.();\n unmount = undefined;\n if (wrapperElement.parentElement)\n wrapperElement.outerHTML = '';\n }\n\n onDispose(dispose);\n};\n\n// eslint-disable-next-line ts/naming-convention\nexport const Devtools = lazy(() => import('./Devtools').then(module => ({ default: module.Devtools })));\n"],"names":["onInit","onDispose","lazy","module"],"mappings":";;;;AAGa,MAAA,iBAA+B,CAAC,YAA2B;AAChE,QAAA,iBAAiB,SAAS,cAAc,KAAK;AAC/C,MAAA;AAEJ,iBAAe,eAA8B;AACrC,UAAA,OAAO,MAAM,QAAO,QAAA,EAAA,KAAA,MAAA,QAAA,yBAAQ;AAElC,QAAI,CAAC,SAAS;AACH,eAAA,KAAK,YAAY,cAAc;AAE9B,gBAAA,KAAK,qBAAqB,gBAAgB,OAAO;AAAA,IAC7D;AAAA,EACF;AAEAA,MAAAA,OAAO,YAAY;;AACjB,QAAI,QAAQ;AACV,YAAM,aAAa;AAErB,kBAAQ,WAAR,mBAAgB,YAAY,YAAY,OAAO,UAAU;AACnD,UAAA;AACF,cAAM,aAAa;AAAA;AAEX;IAAA;AAAA,EACX,CACF;AAED,WAAS,UAAgB;AACb;AACA,cAAA;AACV,QAAI,eAAe;AACjB,qBAAe,YAAY;AAAA,EAC/B;AAEAC,MAAA,UAAU,OAAO;AACnB;AAGO,MAAM,WAAWC,MAAA,KAAK,MAAM,QAAO,QAAA,EAAA,KAAA,MAAA,QAAA,yBAAY,CAAA,EAAA,KAAA,OAAA,EAAA,QAAA,EAAE,KAAK,CAAAC,aAAW,EAAE,SAASA,QAAO,WAAW,CAAC;;;"}
1
+ {"version":3,"file":"index.cjs","sources":["../src/index.ts"],"sourcesContent":["import type { AdheseContext, AdhesePlugin } from '@adhese/sdk';\nimport { lazy } from 'react';\n\nexport const createDevtools: AdhesePlugin = (context: AdheseContext, {\n onInit,\n onDispose,\n}) => {\n const wrapperElement = document.createElement('div');\n let unmount: (() => void) | undefined;\n\n async function initDevtools(): Promise<void> {\n const main = await import('./main');\n\n if (!unmount) {\n document.body.appendChild(wrapperElement);\n\n unmount = main.createAdheseDevtools(wrapperElement, context);\n }\n }\n\n onInit(async () => {\n if (context.debug)\n await initDevtools();\n\n context.events?.debugChange.addListener(async (debug) => {\n if (debug)\n await initDevtools();\n else\n dispose();\n });\n });\n\n function dispose(): void {\n unmount?.();\n unmount = undefined;\n if (wrapperElement.parentElement)\n wrapperElement.outerHTML = '';\n }\n\n onDispose(dispose);\n};\n\n// eslint-disable-next-line ts/naming-convention\nexport const Devtools = lazy(() => import('./Devtools').then(module => ({ default: module.Devtools })));\n"],"names":["lazy","module"],"mappings":";;;AAGa,MAAA,iBAA+B,CAAC,SAAwB;AAAA,EACnE;AAAA,EACA;AACF,MAAM;AACE,QAAA,iBAAiB,SAAS,cAAc,KAAK;AAC/C,MAAA;AAEJ,iBAAe,eAA8B;AACrC,UAAA,OAAO,MAAM,QAAO,QAAA,EAAA,KAAA,MAAA,QAAA,yBAAQ;AAElC,QAAI,CAAC,SAAS;AACH,eAAA,KAAK,YAAY,cAAc;AAE9B,gBAAA,KAAK,qBAAqB,gBAAgB,OAAO;AAAA,IAC7D;AAAA,EACF;AAEA,SAAO,YAAY;;AACjB,QAAI,QAAQ;AACV,YAAM,aAAa;AAErB,kBAAQ,WAAR,mBAAgB,YAAY,YAAY,OAAO,UAAU;AACnD,UAAA;AACF,cAAM,aAAa;AAAA;AAEX;IAAA;AAAA,EACX,CACF;AAED,WAAS,UAAgB;AACb;AACA,cAAA;AACV,QAAI,eAAe;AACjB,qBAAe,YAAY;AAAA,EAC/B;AAEA,YAAU,OAAO;AACnB;AAGO,MAAM,WAAWA,MAAA,KAAK,MAAM,QAAO,QAAA,EAAA,KAAA,MAAA,QAAA,yBAAY,CAAA,EAAA,KAAA,OAAA,EAAA,QAAA,EAAE,KAAK,CAAAC,aAAW,EAAE,SAASA,QAAO,WAAW,CAAC;;;"}
package/dist/index.js CHANGED
@@ -1,6 +1,8 @@
1
- import { onInit, onDispose } from "@adhese/sdk";
2
1
  import { lazy } from "react";
3
- const createDevtools = (context) => {
2
+ const createDevtools = (context, {
3
+ onInit,
4
+ onDispose
5
+ }) => {
4
6
  const wrapperElement = document.createElement("div");
5
7
  let unmount;
6
8
  async function initDevtools() {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import { type AdheseContext, type AdhesePlugin, onDispose, onInit } from '@adhese/sdk';\nimport { lazy } from 'react';\n\nexport const createDevtools: AdhesePlugin = (context: AdheseContext) => {\n const wrapperElement = document.createElement('div');\n let unmount: (() => void) | undefined;\n\n async function initDevtools(): Promise<void> {\n const main = await import('./main');\n\n if (!unmount) {\n document.body.appendChild(wrapperElement);\n\n unmount = main.createAdheseDevtools(wrapperElement, context);\n }\n }\n\n onInit(async () => {\n if (context.debug)\n await initDevtools();\n\n context.events?.debugChange.addListener(async (debug) => {\n if (debug)\n await initDevtools();\n else\n dispose();\n });\n });\n\n function dispose(): void {\n unmount?.();\n unmount = undefined;\n if (wrapperElement.parentElement)\n wrapperElement.outerHTML = '';\n }\n\n onDispose(dispose);\n};\n\n// eslint-disable-next-line ts/naming-convention\nexport const Devtools = lazy(() => import('./Devtools').then(module => ({ default: module.Devtools })));\n"],"names":[],"mappings":";;AAGa,MAAA,iBAA+B,CAAC,YAA2B;AAChE,QAAA,iBAAiB,SAAS,cAAc,KAAK;AAC/C,MAAA;AAEJ,iBAAe,eAA8B;AACrC,UAAA,OAAO,MAAM,OAAO,wBAAQ;AAElC,QAAI,CAAC,SAAS;AACH,eAAA,KAAK,YAAY,cAAc;AAE9B,gBAAA,KAAK,qBAAqB,gBAAgB,OAAO;AAAA,IAC7D;AAAA,EACF;AAEA,SAAO,YAAY;;AACjB,QAAI,QAAQ;AACV,YAAM,aAAa;AAErB,kBAAQ,WAAR,mBAAgB,YAAY,YAAY,OAAO,UAAU;AACnD,UAAA;AACF,cAAM,aAAa;AAAA;AAEX;IAAA;AAAA,EACX,CACF;AAED,WAAS,UAAgB;AACb;AACA,cAAA;AACV,QAAI,eAAe;AACjB,qBAAe,YAAY;AAAA,EAC/B;AAEA,YAAU,OAAO;AACnB;AAGO,MAAM,WAAW,KAAK,MAAM,OAAO,wBAAY,EAAA,KAAA,OAAA,EAAA,CAAA,EAAE,KAAK,CAAA,YAAW,EAAE,SAAS,OAAO,WAAW,CAAC;"}
1
+ {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import type { AdheseContext, AdhesePlugin } from '@adhese/sdk';\nimport { lazy } from 'react';\n\nexport const createDevtools: AdhesePlugin = (context: AdheseContext, {\n onInit,\n onDispose,\n}) => {\n const wrapperElement = document.createElement('div');\n let unmount: (() => void) | undefined;\n\n async function initDevtools(): Promise<void> {\n const main = await import('./main');\n\n if (!unmount) {\n document.body.appendChild(wrapperElement);\n\n unmount = main.createAdheseDevtools(wrapperElement, context);\n }\n }\n\n onInit(async () => {\n if (context.debug)\n await initDevtools();\n\n context.events?.debugChange.addListener(async (debug) => {\n if (debug)\n await initDevtools();\n else\n dispose();\n });\n });\n\n function dispose(): void {\n unmount?.();\n unmount = undefined;\n if (wrapperElement.parentElement)\n wrapperElement.outerHTML = '';\n }\n\n onDispose(dispose);\n};\n\n// eslint-disable-next-line ts/naming-convention\nexport const Devtools = lazy(() => import('./Devtools').then(module => ({ default: module.Devtools })));\n"],"names":[],"mappings":";AAGa,MAAA,iBAA+B,CAAC,SAAwB;AAAA,EACnE;AAAA,EACA;AACF,MAAM;AACE,QAAA,iBAAiB,SAAS,cAAc,KAAK;AAC/C,MAAA;AAEJ,iBAAe,eAA8B;AACrC,UAAA,OAAO,MAAM,OAAO,wBAAQ;AAElC,QAAI,CAAC,SAAS;AACH,eAAA,KAAK,YAAY,cAAc;AAE9B,gBAAA,KAAK,qBAAqB,gBAAgB,OAAO;AAAA,IAC7D;AAAA,EACF;AAEA,SAAO,YAAY;;AACjB,QAAI,QAAQ;AACV,YAAM,aAAa;AAErB,kBAAQ,WAAR,mBAAgB,YAAY,YAAY,OAAO,UAAU;AACnD,UAAA;AACF,cAAM,aAAa;AAAA;AAEX;IAAA;AAAA,EACX,CACF;AAED,WAAS,UAAgB;AACb;AACA,cAAA;AACV,QAAI,eAAe;AACjB,qBAAe,YAAY;AAAA,EAC/B;AAEA,YAAU,OAAO;AACnB;AAGO,MAAM,WAAW,KAAK,MAAM,OAAO,wBAAY,EAAA,KAAA,OAAA,EAAA,CAAA,EAAE,KAAK,CAAA,YAAW,EAAE,SAAS,OAAO,WAAW,CAAC;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@adhese/sdk-devtools",
3
3
  "type": "module",
4
- "version": "0.7.1",
4
+ "version": "0.7.2",
5
5
  "description": "Adhese SDK Devtools",
6
6
  "license": "GPL-3.0",
7
7
  "repository": {
@@ -25,11 +25,11 @@
25
25
  "prepareRelease": "npm run build"
26
26
  },
27
27
  "peerDependencies": {
28
+ "@adhese/sdk": "^0",
28
29
  "react": ">=16.13",
29
30
  "react-dom": ">=16.13"
30
31
  },
31
32
  "dependencies": {
32
- "@adhese/sdk": "^0.8.0",
33
33
  "@radix-ui/react-dialog": "^1.0.5",
34
34
  "@radix-ui/react-icons": "^1.3.0",
35
35
  "@radix-ui/react-label": "^2.0.2",