@scayle/storefront-devtools 0.2.0-alpha.1 → 0.2.0-alpha.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.
Files changed (106) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +113 -83
  3. package/dist/_chunks/coalesce-cmmfn4qq.mjs +1585 -0
  4. package/dist/group.d.ts +29 -21
  5. package/dist/group.d.ts.map +1 -1
  6. package/dist/index.d.ts +4 -1
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.mjs +40 -65
  9. package/dist/inertia/channel.d.ts +54 -0
  10. package/dist/inertia/channel.d.ts.map +1 -0
  11. package/dist/inertia/client/index.d.ts +1 -6
  12. package/dist/inertia/client/index.d.ts.map +1 -1
  13. package/dist/inertia/client/index.mjs +246 -109
  14. package/dist/inertia/client/publish.d.ts +24 -0
  15. package/dist/inertia/client/publish.d.ts.map +1 -0
  16. package/dist/inertia/core/network.d.ts +1 -1
  17. package/dist/inertia/core/network.d.ts.map +1 -1
  18. package/dist/inertia/core/response.d.ts +3 -3
  19. package/dist/inertia/core/response.d.ts.map +1 -1
  20. package/dist/inertia/plugin.d.ts +8 -6
  21. package/dist/inertia/plugin.d.ts.map +1 -1
  22. package/dist/orpc/channel.d.ts +29 -0
  23. package/dist/orpc/channel.d.ts.map +1 -0
  24. package/dist/orpc/client/index.d.ts +1 -6
  25. package/dist/orpc/client/index.d.ts.map +1 -1
  26. package/dist/orpc/client/index.mjs +152 -137
  27. package/dist/orpc/client/publish.d.ts +15 -0
  28. package/dist/orpc/client/publish.d.ts.map +1 -0
  29. package/dist/orpc/core/serialize.d.ts +1 -1
  30. package/dist/orpc/core/stats.d.ts +10 -0
  31. package/dist/orpc/core/stats.d.ts.map +1 -0
  32. package/dist/orpc/core/store.d.ts +1 -2
  33. package/dist/orpc/core/store.d.ts.map +1 -1
  34. package/dist/orpc/plugin.d.ts +8 -5
  35. package/dist/orpc/plugin.d.ts.map +1 -1
  36. package/dist/shared/clipboard.d.ts +2 -3
  37. package/dist/shared/clipboard.d.ts.map +1 -1
  38. package/dist/shared/coalesce.d.ts +14 -0
  39. package/dist/shared/coalesce.d.ts.map +1 -0
  40. package/dist/shared/panel-channel.d.ts +49 -0
  41. package/dist/shared/panel-channel.d.ts.map +1 -0
  42. package/dist/shared/publish-options.d.ts +13 -0
  43. package/dist/shared/publish-options.d.ts.map +1 -0
  44. package/dist/shared/safe-clone.d.ts +2 -1
  45. package/dist/shared/safe-clone.d.ts.map +1 -1
  46. package/dist/storefront/plugin.d.ts +6 -4
  47. package/dist/storefront/plugin.d.ts.map +1 -1
  48. package/dist/ui/assets/App-BlEKD1MK.js +4 -0
  49. package/dist/ui/assets/App-C1rr07m5.js +1 -0
  50. package/dist/ui/assets/App-C5-JscO0.css +1 -0
  51. package/dist/ui/assets/App-M0iU7c4p.css +1 -0
  52. package/dist/ui/assets/App-VElUrn9P.js +5 -0
  53. package/dist/ui/assets/App-jiQKInbo.css +1 -0
  54. package/dist/ui/assets/_plugin-vue_export-helper-BDNMzG2s.js +1 -0
  55. package/dist/ui/assets/channel-D7V7aU79.js +1 -0
  56. package/dist/ui/assets/clipboard-BnEeWyfh.css +1 -0
  57. package/dist/ui/assets/clipboard-n-T06WI3.js +1 -0
  58. package/dist/ui/assets/panel-channel-DjMENemf.js +2 -0
  59. package/dist/ui/assets/panels-B4LTsmli.css +1 -0
  60. package/dist/ui/assets/panels-BLV_p6Kz.js +2 -0
  61. package/dist/ui/assets/preload-helper-J6bGWMBq.js +2 -0
  62. package/dist/{vue-devtools/ui/assets/index-Dby9TIQH.js → ui/assets/vue-BAMMushd.js} +19 -20
  63. package/dist/{vue-devtools/ui/assets/index-sSkqWPzY.css → ui/assets/vue-Kq4tvBbL.css} +1 -1
  64. package/dist/ui/panels/index.html +15 -0
  65. package/dist/{vue-devtools/ui → ui/vue}/index.html +4 -2
  66. package/dist/vue-devtools/client/index.mjs +0 -1
  67. package/dist/vue-devtools/plugin.d.ts +10 -9
  68. package/dist/vue-devtools/plugin.d.ts.map +1 -1
  69. package/package.json +11 -29
  70. package/dist/_chunks/clipboard-DrVHc2QA.mjs +0 -61
  71. package/dist/_chunks/diff-DzJ5arJj.mjs +0 -169
  72. package/dist/_chunks/panel-uV5ITqhY.mjs +0 -51
  73. package/dist/_chunks/redact-DmIF-iyk.mjs +0 -96
  74. package/dist/_chunks/useStore-Db8RZW8T.mjs +0 -10
  75. package/dist/inertia/client/index.d.mts +0 -13
  76. package/dist/inertia/renderer/index.d.mts +0 -16
  77. package/dist/inertia/renderer/index.mjs +0 -771
  78. package/dist/orpc/client/index.d.mts +0 -13
  79. package/dist/orpc/renderer/index.d.mts +0 -16
  80. package/dist/orpc/renderer/index.mjs +0 -457
  81. package/dist/resource-center/client/index.mjs +0 -21
  82. package/dist/resource-center/client.d.ts +0 -3
  83. package/dist/resource-center/client.d.ts.map +0 -1
  84. package/dist/resource-center/plugin.d.ts +0 -12
  85. package/dist/resource-center/plugin.d.ts.map +0 -1
  86. package/dist/shared/use-window-store.d.ts +0 -18
  87. package/dist/shared/use-window-store.d.ts.map +0 -1
  88. package/dist/storefront/renderer/index.d.mts +0 -16
  89. package/dist/storefront/renderer/index.mjs +0 -124
  90. /package/dist/{vue-devtools/ui → ui}/assets/css-8QJvnqUH.js +0 -0
  91. /package/dist/{vue-devtools/ui → ui}/assets/css-CaJ9TzKE.js +0 -0
  92. /package/dist/{vue-devtools/ui → ui}/assets/diff-woXpYk--.js +0 -0
  93. /package/dist/{vue-devtools/ui → ui}/assets/html-BHDw6EPc.js +0 -0
  94. /package/dist/{vue-devtools/ui → ui}/assets/html-GueGcY0x.js +0 -0
  95. /package/dist/{vue-devtools/ui → ui}/assets/javascript-BzbQS41l.js +0 -0
  96. /package/dist/{vue-devtools/ui → ui}/assets/javascript-Yelw-5ZN.js +0 -0
  97. /package/dist/{vue-devtools/ui → ui}/assets/json-B88Oqtu5.js +0 -0
  98. /package/dist/{vue-devtools/ui → ui}/assets/json-CaljABEy.js +0 -0
  99. /package/dist/{vue-devtools/ui → ui}/assets/shellscript-CLZ0U2zV.js +0 -0
  100. /package/dist/{vue-devtools/ui → ui}/assets/typescript-Utq2Cl8c.js +0 -0
  101. /package/dist/{vue-devtools/ui → ui}/assets/typescript-j_1H8WHN.js +0 -0
  102. /package/dist/{vue-devtools/ui → ui}/assets/vitesse-dark-BZCL-v6S.js +0 -0
  103. /package/dist/{vue-devtools/ui → ui}/assets/vitesse-light-VbXTXTou.js +0 -0
  104. /package/dist/{vue-devtools/ui → ui}/assets/vue-B1Tf5CHw.js +0 -0
  105. /package/dist/{vue-devtools/ui → ui}/assets/vue-html-CGMs_6qn.js +0 -0
  106. /package/dist/{vue-devtools/ui → ui}/assets/yaml-rwi0_p6S.js +0 -0
package/dist/group.d.ts CHANGED
@@ -1,27 +1,33 @@
1
1
  import { Plugin } from 'vite';
2
- /**
3
- * Dock group ID that every SCAYLE Storefront devtools panel attaches to via
4
- * `groupId`. Panels register as independent entries and the dock collapses them
5
- * under this group's single launcher button.
6
- */
7
- export declare const STOREFRONT_GROUP_ID = "scayle-storefront";
8
2
  /** SCAYLE brand purple. Drives the dock's primary ramp and tints the group launcher. */
9
3
  export declare const SCAYLE_PRIMARY_COLOR: string;
10
4
  /**
11
- * The V3 boilerplate favicon (`public/logo.svg`), inlined as a data URI so
12
- * the dock icon resolves without depending on an app-served path (the
13
- * country-prefix redirect would rewrite it). Keep in sync with the
14
- * boilerplate favicon if it changes.
5
+ * The Storefront Application V3 favicon (`public/logo.svg`), inlined as a
6
+ * data URI so the dock icon resolves without depending on an app-served path
7
+ * (the country-prefix redirect would rewrite it). Keep in sync with the
8
+ * Storefront Application V3 favicon if it changes.
15
9
  */
16
10
  export declare const STOREFRONT_GROUP_ICON: string;
17
11
  /**
18
- * Creates the Vite plugin that registers the "SCAYLE Storefront" dock group.
19
- * Panels (Inertia, oRPC, Storefront) attach to it by setting `groupId` to
20
- * {@link STOREFRONT_GROUP_ID}. The dock renders a single grouped launcher
21
- * instead of one button per panel.
12
+ * Route the dock loads every iframe page from. `@scayle/storefront-build`
13
+ * excludes it from the Hono dev server, so the country redirect leaves it alone.
14
+ */
15
+ export declare const UI_ROUTE = "/__storefront-devtools/";
16
+ /**
17
+ * Creates the Vite plugin that registers the "SCAYLE Storefront" dock group
18
+ * and serves the iframe pages under {@link UI_ROUTE}. Panels (Inertia, oRPC,
19
+ * Storefront) attach to the group through {@link createPanelPlugin}, so the
20
+ * dock renders a single grouped launcher instead of one button per panel.
21
+ *
22
+ * @returns A Vite plugin with a `devtools.setup` hook.
22
23
  */
23
24
  export declare function createGroupPlugin(): Plugin;
24
- /** Options for a `custom-render` panel registered via {@link createPanelPlugin}. */
25
+ /**
26
+ * Views the panel app can mount. `VIEWS` in `src/ui/panels/main.ts` is typed
27
+ * from this union, so the compiler flags a view added to one but not the other.
28
+ */
29
+ export type PanelView = 'inertia' | 'orpc' | 'storefront';
30
+ /** Options for an iframe panel registered via {@link createPanelPlugin}. */
25
31
  export interface PanelPluginOptions {
26
32
  /** Dock entry id, e.g. `storefront-devtools:inertia`. */
27
33
  id: string;
@@ -29,14 +35,16 @@ export interface PanelPluginOptions {
29
35
  title: string;
30
36
  /** Dock launcher icon, a data URI or Iconify name. */
31
37
  icon: string;
32
- /** Bare specifier the dock imports to load the panel's renderer. */
33
- rendererImportFrom: string;
38
+ /** The `?view=` value the panel app mounts for this entry. */
39
+ view: PanelView;
34
40
  }
35
41
  /**
36
- * Creates the Vite plugin that registers one `custom-render` dock entry,
37
- * attached to the "SCAYLE Storefront" group. Every panel in this package
38
- * (Inertia, oRPC, Storefront) registers this way; only the id, title, icon,
39
- * and renderer module differ between them.
42
+ * Creates the Vite plugin that registers one iframe dock entry, attached to the
43
+ * "SCAYLE Storefront" group. The iframe loads the panel app served under
44
+ * {@link UI_ROUTE} and mounts the view named in `options.view`.
45
+ *
46
+ * @param options - The entry's id, title, icon, and view.
47
+ * @returns A Vite plugin with a `devtools.setup` hook.
40
48
  */
41
49
  export declare function createPanelPlugin(options: PanelPluginOptions): Plugin;
42
50
  //# sourceMappingURL=group.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"group.d.ts","sourceRoot":"","sources":["../src/group.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAElC;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,sBAAsB,CAAA;AAEtD,wFAAwF;AACxF,eAAO,MAAM,oBAAoB,EAAE,MAAkB,CAAA;AAErD;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,EAAE,MAEjC,CAAA;AAEH;;;;;GAKG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAe1C;AAED,oFAAoF;AACpF,MAAM,WAAW,kBAAkB;IACjC,yDAAyD;IACzD,EAAE,EAAE,MAAM,CAAA;IACV,8CAA8C;IAC9C,KAAK,EAAE,MAAM,CAAA;IACb,sDAAsD;IACtD,IAAI,EAAE,MAAM,CAAA;IACZ,oEAAoE;IACpE,kBAAkB,EAAE,MAAM,CAAA;CAC3B;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,kBAAkB,GAAG,MAAM,CAmBrE"}
1
+ {"version":3,"file":"group.d.ts","sourceRoot":"","sources":["../src/group.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAWlC,wFAAwF;AACxF,eAAO,MAAM,oBAAoB,EAAE,MAAkB,CAAA;AAErD;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,EAAE,MAEjC,CAAA;AAEH;;;GAGG;AACH,eAAO,MAAM,QAAQ,4BAA4B,CAAA;AAOjD;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAyB1C;AAED;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,YAAY,CAAA;AAEzD,4EAA4E;AAC5E,MAAM,WAAW,kBAAkB;IACjC,yDAAyD;IACzD,EAAE,EAAE,MAAM,CAAA;IACV,8CAA8C;IAC9C,KAAK,EAAE,MAAM,CAAA;IACb,sDAAsD;IACtD,IAAI,EAAE,MAAM,CAAA;IACZ,8DAA8D;IAC9D,IAAI,EAAE,SAAS,CAAA;CAChB;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,kBAAkB,GAAG,MAAM,CAgBrE"}
package/dist/index.d.ts CHANGED
@@ -7,7 +7,7 @@ import { PluginOption } from 'vite';
7
7
  * application entry, so no app code changes are needed.
8
8
  *
9
9
  * This owns the full Vue DevTools integration (backend bridge and applet UI)
10
- * and surfaces it as the dock's "Vue" entry, so the app does not wire
10
+ * and surfaces it as the dock's "Vue" entry, so the app does not add
11
11
  * `vite-plugin-vue-devtools` separately.
12
12
  *
13
13
  * @example
@@ -18,6 +18,9 @@ import { PluginOption } from 'vite';
18
18
  * plugins: [storefront(config), ...storefrontDevtools()],
19
19
  * })
20
20
  * ```
21
+ *
22
+ * @returns The dock host, the inject plugin, and every panel plugin, to
23
+ * spread into the Vite `plugins` array.
21
24
  */
22
25
  export default function storefrontDevtools(): PluginOption[];
23
26
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAcxC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,IAAI,YAAY,EAAE,CAsD3D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAaxC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,IAAI,YAAY,EAAE,CAkD3D"}
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { DevTools as e } from "@vitejs/devtools";
2
2
  import { DEVTOOLS_MOUNT_PATH as t } from "@vitejs/devtools-kit/constants";
3
- import { fileURLToPath as n } from "node:url";
4
- import r from "sirv";
3
+ import { existsSync as n } from "node:fs";
4
+ import { fileURLToPath as r } from "node:url";
5
5
  //#region src/inject.ts
6
6
  var i = `${t}embedded.js`, a = /src\/client\/main\.ts$/;
7
7
  function o(e) {
@@ -24,12 +24,16 @@ if (typeof document !== 'undefined') {
24
24
  }
25
25
  //#endregion
26
26
  //#region src/group.ts
27
- var s = "scayle-storefront", c = "#5328e1", l = "data:image/svg+xml,%3Csvg%20width%3D%2228%22%20height%3D%2228%22%20viewBox%3D%220%200%2028%2028%22%20fill%3D%22%235328E1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2228%22%20height%3D%2228%22%20rx%3D%227%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M14%207a7%207%200%201%201%200%2014%207%207%200%200%201%200-14Zm0%202.051c-2.625%200-4.755%202.216-4.755%204.948s2.13%204.948%204.755%204.948c2.628%200%204.755-2.215%204.755-4.948%200-.948-.255-1.834-.7-2.587l-2.106%202.15-1.518-1.55%202.137-2.178A4.6%204.6%200%200%200%2014%209.05Z%22%20fill%3D%22%23fff%22%20stroke%3D%22%23fff%22%20stroke-width%3D%22.2%22%2F%3E%3C%2Fsvg%3E";
28
- function u() {
27
+ var s = "scayle-storefront", c = "#5328e1", l = "data:image/svg+xml,%3Csvg%20width%3D%2228%22%20height%3D%2228%22%20viewBox%3D%220%200%2028%2028%22%20fill%3D%22%235328E1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%2228%22%20height%3D%2228%22%20rx%3D%227%22%2F%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M14%207a7%207%200%201%201%200%2014%207%207%200%200%201%200-14Zm0%202.051c-2.625%200-4.755%202.216-4.755%204.948s2.13%204.948%204.755%204.948c2.628%200%204.755-2.215%204.755-4.948%200-.948-.255-1.834-.7-2.587l-2.106%202.15-1.518-1.55%202.137-2.178A4.6%204.6%200%200%200%2014%209.05Z%22%20fill%3D%22%23fff%22%20stroke%3D%22%23fff%22%20stroke-width%3D%22.2%22%2F%3E%3C%2Fsvg%3E", u = "/__storefront-devtools/", d = r(new URL(
28
+ /* @vite-ignore */
29
+ "./ui",
30
+ import.meta.url
31
+ ));
32
+ function f() {
29
33
  return {
30
34
  name: "storefront-devtools:group",
31
35
  devtools: { setup(e) {
32
- e.docks.register({
36
+ n(d) ? e.views.hostStatic(u, d) : console.warn(`[storefront-devtools] Panel UI not found at ${d}. Build @scayle/storefront-devtools and restart the dev server to serve the panels.`), e.docks.register({
33
37
  id: s,
34
38
  title: "SCAYLE Storefront",
35
39
  icon: l,
@@ -39,7 +43,7 @@ function u() {
39
43
  } }
40
44
  };
41
45
  }
42
- function d(e) {
46
+ function p(e) {
43
47
  return {
44
48
  name: `storefront-devtools:${e.id}`,
45
49
  devtools: { setup(t) {
@@ -47,11 +51,8 @@ function d(e) {
47
51
  id: e.id,
48
52
  title: e.title,
49
53
  icon: e.icon,
50
- type: "custom-render",
51
- renderer: {
52
- importFrom: e.rendererImportFrom,
53
- importName: "default"
54
- },
54
+ type: "iframe",
55
+ url: `${u}panels/?view=${e.view}`,
55
56
  groupId: s
56
57
  });
57
58
  } }
@@ -59,90 +60,66 @@ function d(e) {
59
60
  }
60
61
  //#endregion
61
62
  //#region src/inertia/plugin.ts
62
- var f = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22128%22%20height%3D%22128%22%20viewBox%3D%220%200%20128%20128%22%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M92.433%2028.433H55.625L91.192%2064L55.625%2099.567h36.808L128%2064zm-55.625%200H0L35.567%2064L0%2099.567h36.808L72.375%2064z%22%2F%3E%3C%2Fsvg%3E";
63
- function p() {
64
- return d({
63
+ var m = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22128%22%20height%3D%22128%22%20viewBox%3D%220%200%20128%20128%22%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M92.433%2028.433H55.625L91.192%2064L55.625%2099.567h36.808L128%2064zm-55.625%200H0L35.567%2064L0%2099.567h36.808L72.375%2064z%22%2F%3E%3C%2Fsvg%3E";
64
+ function h() {
65
+ return p({
65
66
  id: "storefront-devtools:inertia",
66
67
  title: "Inertia.js",
67
- icon: f,
68
- rendererImportFrom: "@scayle/storefront-devtools/inertia/renderer"
68
+ icon: m,
69
+ view: "inertia"
69
70
  });
70
71
  }
71
72
  //#endregion
72
73
  //#region src/orpc/plugin.ts
73
- var m = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23fff%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M4%207h16M4%2012h16M4%2017h10%22%2F%3E%3C%2Fsvg%3E";
74
- function h() {
75
- return d({
74
+ var g = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23fff%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M4%207h16M4%2012h16M4%2017h10%22%2F%3E%3C%2Fsvg%3E";
75
+ function _() {
76
+ return p({
76
77
  id: "storefront-devtools:orpc",
77
78
  title: "oRPC",
78
- icon: m,
79
- rendererImportFrom: "@scayle/storefront-devtools/orpc/renderer"
79
+ icon: g,
80
+ view: "orpc"
80
81
  });
81
82
  }
82
83
  //#endregion
83
- //#region src/resource-center/plugin.ts
84
- var g = "https://scayle.dev/documentation/storefront/storefront-application/getting-started/what-is-storefront", _ = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M11.07%2012.85c.77-1.39%202.25-2.21%203.11-3.44c.91-1.29.4-3.7-2.18-3.7c-1.69%200-2.52%201.28-2.87%202.34L6.54%206.96C7.25%204.83%209.18%203%2011.99%203c2.35%200%203.96%201.07%204.78%202.41c.7%201.15%201.11%203.3.03%204.9c-1.2%201.77-2.35%202.31-2.97%203.45c-.25.46-.35.76-.35%202.24h-2.89c-.01-.78-.13-2.05.48-3.15M14%2020c0%201.1-.9%202-2%202s-2-.9-2-2s.9-2%202-2s2%20.9%202%202%22%2F%3E%3C%2Fsvg%3E";
85
- function v() {
86
- return {
87
- name: "storefront-devtools:resource-center",
88
- devtools: { setup(e) {
89
- e.docks.register({
90
- id: "storefront-devtools:resource-center",
91
- title: "Resource Center",
92
- icon: _,
93
- type: "iframe",
94
- url: g,
95
- groupId: s
96
- });
97
- } }
98
- };
99
- }
100
- //#endregion
101
84
  //#region src/storefront/plugin.ts
102
- var y = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23fff%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%209l1.5-5h15L21%209M4%209h16v10a1%201%200%200%201-1%201H5a1%201%200%200%201-1-1V9zM9%2020v-6h6v6%22%2F%3E%3C%2Fsvg%3E";
103
- function b() {
104
- return d({
85
+ var v = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23fff%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%209l1.5-5h15L21%209M4%209h16v10a1%201%200%200%201-1%201H5a1%201%200%200%201-1-1V9zM9%2020v-6h6v6%22%2F%3E%3C%2Fsvg%3E";
86
+ function y() {
87
+ return p({
105
88
  id: "storefront-devtools:storefront",
106
89
  title: "Storefront",
107
- icon: y,
108
- rendererImportFrom: "@scayle/storefront-devtools/storefront/renderer"
90
+ icon: v,
91
+ view: "storefront"
109
92
  });
110
93
  }
111
94
  //#endregion
112
95
  //#region src/vue-devtools/plugin.ts
113
- var x = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20width%3D%2224%22%20height%3D%2224%22%3E%3Cpath%20fill%3D%22%2341b883%22%20d%3D%22M12%202%201%2021h22z%22%20opacity%3D%22.4%22%2F%3E%3Cpath%20fill%3D%22%2341b883%22%20d%3D%22M2%203h4l6%2010.5L18%203h4L12%2021z%22%2F%3E%3Cpath%20fill%3D%22%2335495e%22%20d%3D%22M6%203h3l3%205%203-5h3l-6%2010z%22%2F%3E%3C%2Fsvg%3E", S = "/__storefront-devtools/vue/", C = n(new URL("./vue-devtools/ui", "" + import.meta.url));
114
- function w() {
96
+ var b = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20width%3D%2224%22%20height%3D%2224%22%3E%3Cpath%20fill%3D%22%2341b883%22%20d%3D%22M12%202%201%2021h22z%22%20opacity%3D%22.4%22%2F%3E%3Cpath%20fill%3D%22%2341b883%22%20d%3D%22M2%203h4l6%2010.5L18%203h4L12%2021z%22%2F%3E%3Cpath%20fill%3D%22%2335495e%22%20d%3D%22M6%203h3l3%205%203-5h3l-6%2010z%22%2F%3E%3C%2Fsvg%3E", x = `${u}vue/`;
97
+ function S() {
115
98
  return {
116
99
  name: "storefront-devtools:vue-panel",
117
100
  apply: "serve",
118
- configureServer(e) {
119
- e.middlewares.use(S, r(C, {
120
- dev: !0,
121
- single: !0
122
- }));
123
- },
124
101
  devtools: { setup(e) {
125
102
  let t = "storefront-devtools:vue";
126
103
  e.docks.register({
127
104
  id: t,
128
105
  title: "Vue",
129
- icon: x,
106
+ icon: b,
130
107
  type: "group",
131
108
  accentColor: "#41b883",
132
109
  defaultChildId: "storefront-devtools:vue-components"
133
110
  }), e.docks.register({
134
111
  id: "storefront-devtools:vue-components",
135
112
  title: "Components",
136
- icon: x,
113
+ icon: b,
137
114
  type: "iframe",
138
- url: `${S}?view=components`,
115
+ url: `${x}?view=components`,
139
116
  groupId: t
140
117
  }), e.docks.register({
141
118
  id: "storefront-devtools:vue-timeline",
142
119
  title: "Timeline",
143
- icon: x,
120
+ icon: b,
144
121
  type: "iframe",
145
- url: `${S}?view=timeline`,
122
+ url: `${x}?view=timeline`,
146
123
  groupId: t
147
124
  });
148
125
  } }
@@ -150,7 +127,7 @@ function w() {
150
127
  }
151
128
  //#endregion
152
129
  //#region src/index.ts
153
- function T() {
130
+ function C() {
154
131
  return [
155
132
  e({
156
133
  builtinDevTools: !1,
@@ -163,16 +140,14 @@ function T() {
163
140
  o([
164
141
  "@scayle/storefront-devtools/vue-devtools/client",
165
142
  "@scayle/storefront-devtools/orpc/client",
166
- "@scayle/storefront-devtools/resource-center/client",
167
143
  "@scayle/storefront-devtools/inertia/client"
168
144
  ]),
169
- u(),
170
- p(),
171
- v(),
145
+ f(),
172
146
  h(),
173
- b(),
174
- w()
147
+ _(),
148
+ y(),
149
+ S()
175
150
  ];
176
151
  }
177
152
  //#endregion
178
- export { T as default };
153
+ export { C as default };
@@ -0,0 +1,54 @@
1
+ import { InPageChannelProtocol } from 'devframe/in-page-channel';
2
+ import { InertiaPage } from './core/protocol';
3
+ import { RequestRecord, SessionRequestSummary } from './core/types';
4
+ /** Channel between the Inertia page script and the Inertia panel. */
5
+ export declare const INERTIA_CHANNEL = "storefront-devtools:inertia";
6
+ /** Channel between the Inertia page script and the Storefront context panel. */
7
+ export declare const STOREFRONT_CHANNEL = "storefront-devtools:storefront";
8
+ /** Snapshot of the Inertia capture that the page script sends to the Inertia panel. */
9
+ export interface InertiaPanelState {
10
+ /** Captured requests, oldest first. */
11
+ requests: RequestRecord[];
12
+ /** The page Inertia currently shows, `null` before the first page loads. */
13
+ currentPage: InertiaPage | null;
14
+ /** Number of requests dropped because the capture hit its record limit. */
15
+ evictedCount: number;
16
+ /** Whether capture is paused. */
17
+ paused: boolean;
18
+ /** Summaries from the previous page load, empty after Clear or when none were saved. */
19
+ previousSession: SessionRequestSummary[];
20
+ }
21
+ /** Contract of {@link INERTIA_CHANNEL}. */
22
+ export interface InertiaChannelProtocol extends InPageChannelProtocol {
23
+ functions: {
24
+ pageScript: {
25
+ getState: () => InertiaPanelState;
26
+ clear: () => void;
27
+ setPaused: (paused: boolean) => void;
28
+ };
29
+ };
30
+ events: {
31
+ panel: {
32
+ state: (state: InertiaPanelState) => void;
33
+ };
34
+ };
35
+ }
36
+ /** Snapshot that the page script sends to the Storefront context panel. */
37
+ export interface StorefrontPanelState {
38
+ /** The page Inertia currently shows, `null` before the first page loads. */
39
+ currentPage: InertiaPage | null;
40
+ }
41
+ /** Contract of {@link STOREFRONT_CHANNEL}. */
42
+ export interface StorefrontChannelProtocol extends InPageChannelProtocol {
43
+ functions: {
44
+ pageScript: {
45
+ getState: () => StorefrontPanelState;
46
+ };
47
+ };
48
+ events: {
49
+ panel: {
50
+ state: (state: StorefrontPanelState) => void;
51
+ };
52
+ };
53
+ }
54
+ //# sourceMappingURL=channel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../../src/inertia/channel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AAExE,qEAAqE;AACrE,eAAO,MAAM,eAAe,gCAAgC,CAAA;AAE5D,gFAAgF;AAChF,eAAO,MAAM,kBAAkB,mCAAmC,CAAA;AAElE,uFAAuF;AACvF,MAAM,WAAW,iBAAiB;IAChC,uCAAuC;IACvC,QAAQ,EAAE,aAAa,EAAE,CAAA;IACzB,4EAA4E;IAC5E,WAAW,EAAE,WAAW,GAAG,IAAI,CAAA;IAC/B,2EAA2E;IAC3E,YAAY,EAAE,MAAM,CAAA;IACpB,iCAAiC;IACjC,MAAM,EAAE,OAAO,CAAA;IACf,wFAAwF;IACxF,eAAe,EAAE,qBAAqB,EAAE,CAAA;CACzC;AAED,2CAA2C;AAC3C,MAAM,WAAW,sBAAuB,SAAQ,qBAAqB;IACnE,SAAS,EAAE;QACT,UAAU,EAAE;YACV,QAAQ,EAAE,MAAM,iBAAiB,CAAA;YACjC,KAAK,EAAE,MAAM,IAAI,CAAA;YACjB,SAAS,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAA;SACrC,CAAA;KACF,CAAA;IACD,MAAM,EAAE;QACN,KAAK,EAAE;YACL,KAAK,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAA;SAC1C,CAAA;KACF,CAAA;CACF;AAED,2EAA2E;AAC3E,MAAM,WAAW,oBAAoB;IACnC,4EAA4E;IAC5E,WAAW,EAAE,WAAW,GAAG,IAAI,CAAA;CAChC;AAED,8CAA8C;AAC9C,MAAM,WAAW,yBAA0B,SAAQ,qBAAqB;IACtE,SAAS,EAAE;QACT,UAAU,EAAE;YACV,QAAQ,EAAE,MAAM,oBAAoB,CAAA;SACrC,CAAA;KACF,CAAA;IACD,MAAM,EAAE;QACN,KAAK,EAAE;YACL,KAAK,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,CAAA;SAC7C,CAAA;KACF,CAAA;CACF"}
@@ -1,7 +1,2 @@
1
- import { DevToolsStore } from '../core/store';
2
- declare global {
3
- interface Window {
4
- __STOREFRONT_DEVTOOLS_STORE__?: DevToolsStore;
5
- }
6
- }
1
+ export {};
7
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/inertia/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAM7C,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,6BAA6B,CAAC,EAAE,aAAa,CAAA;KAC9C;CACF"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/inertia/client/index.ts"],"names":[],"mappings":""}