@plitzi/sdk-dev-tools 0.38.16 → 0.38.18

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 (48) hide show
  1. package/CHANGELOG.md +115 -0
  2. package/dist/DevToolsContainer.mjs +2 -2
  3. package/dist/DevToolsContextProvider.mjs +7 -7
  4. package/dist/DevToolsRoot.mjs +14 -14
  5. package/dist/agentInspector/inspector.mjs +1 -1
  6. package/dist/agentInspector/report.mjs +1 -1
  7. package/dist/agentInspector/useAgentInspector.mjs +4 -4
  8. package/dist/components/DevToolsIndicator/DevToolsIndicator.mjs +3 -11
  9. package/dist/components/DevToolsPanel/DevToolsBody.mjs +1 -1
  10. package/dist/components/DevToolsPanel/DevToolsPanel.mjs +1 -1
  11. package/dist/components/DevToolsPanel/DevToolsSubHeader.mjs +11 -11
  12. package/dist/components/DevToolsPanel/ThemeControl.mjs +1 -1
  13. package/dist/components/DevToolsPanel/tabs/ElementsViewer/components/ElementDetails/ElementDetails.mjs +1 -1
  14. package/dist/components/DevToolsPanel/tabs/ElementsViewer/helpers/renderTree.mjs +2 -2
  15. package/dist/components/DevToolsPanel/tabs/FlagsViewer/FlagSource.d.ts +1 -1
  16. package/dist/components/DevToolsPanel/tabs/FlagsViewer/FlagsListItem.d.ts +2 -1
  17. package/dist/components/DevToolsPanel/tabs/HistoryViewer/components/HistoryEntryItem/index.mjs +1 -2
  18. package/dist/components/DevToolsPanel/tabs/HistoryViewer/components/HistoryToolbar/index.mjs +1 -2
  19. package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/BodyHeader.mjs +1 -1
  20. package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/ExecutionTree/ExecutionTree.mjs +1 -1
  21. package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/InteractionNode/InteractionNode.mjs +1 -1
  22. package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/InteractionNode/NodeMetadata.mjs +7 -7
  23. package/dist/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/LogInteraction.mjs +1 -1
  24. package/dist/components/DevToolsPanel/tabs/Logs/categories/LogNavigation/LogNavigationBody.mjs +1 -1
  25. package/dist/components/DevToolsPanel/tabs/Logs/categories/LogNavigation/LogNavigationHeader.mjs +1 -1
  26. package/dist/components/DevToolsPanel/tabs/Logs/categories/LogStore/LogStoreHeader.mjs +1 -1
  27. package/dist/components/DevToolsPanel/tabs/Logs/categories/LogStore/index.mjs +1 -2
  28. package/dist/components/DevToolsPanel/tabs/PluginsViewer/PluginDetails.mjs +21 -21
  29. package/dist/components/DevToolsPanel/tabs/PluginsViewer/PluginsViewer.mjs +2 -2
  30. package/dist/components/DevToolsPanel/tabs/QaViewer/QaReplayButton.mjs +1 -1
  31. package/dist/components/DevToolsPanel/tabs/QaViewer/QaRuleItem.mjs +10 -10
  32. package/dist/components/DevToolsPanel/tabs/StoreViewer/StoreViewer.mjs +17 -17
  33. package/dist/components/DevToolsPanel/tabs/TracingViewer/components/CommitCause/index.mjs +1 -2
  34. package/dist/components/DevToolsPanel/tabs/TracingViewer/components/CommitStrip/index.mjs +1 -2
  35. package/dist/components/DevToolsPanel/tabs/TracingViewer/components/DetailSidebar/index.mjs +1 -2
  36. package/dist/components/DevToolsPanel/tabs/TracingViewer/components/DurationLegend/index.mjs +1 -2
  37. package/dist/components/DevToolsPanel/tabs/TracingViewer/components/Flamegraph/index.mjs +1 -2
  38. package/dist/components/DevToolsPanel/tabs/TracingViewer/components/HotspotSidebar/index.mjs +1 -2
  39. package/dist/components/DevToolsPanel/tabs/TracingViewer/components/HotspotsList/index.mjs +1 -2
  40. package/dist/components/DevToolsPanel/tabs/TracingViewer/components/MetricToggle/index.mjs +1 -2
  41. package/dist/components/DevToolsPanel/tabs/TracingViewer/components/RankedList/index.mjs +1 -2
  42. package/dist/components/DevToolsPanel/tabs/TracingViewer/components/SidebarShell/index.mjs +1 -2
  43. package/dist/components/DevToolsPanel/tabs/TracingViewer/components/SidebarToggle/index.mjs +1 -2
  44. package/dist/components/DevToolsPanel/tabs/TracingViewer/components/TracingToolbar/index.mjs +1 -2
  45. package/dist/components/DevToolsPanel/tabs/TracingViewer/index.mjs +1 -2
  46. package/dist/components/PayloadView/PayloadView.mjs +1 -1
  47. package/dist/qa/QaLayer.mjs +1 -1
  48. package/package.json +16 -1194
package/CHANGELOG.md CHANGED
@@ -1,5 +1,120 @@
1
1
  # @plitzi/sdk-dev-tools
2
2
 
3
+ ## 0.38.18
4
+
5
+ ### Patch Changes
6
+
7
+ - b3023c9: ## Security
8
+
9
+ - **A page of the same site on another origin is no longer this server's own** (`@plitzi/sdk-server`): the guard
10
+ against writes another page caused (`crossSiteWrites`, the sign-in's login-CSRF check and `createOriginGuardMiddleware`)
11
+ trusted `Sec-Fetch-Site: same-site` — and a site has no port and spans every sub-domain, so another port of the host
12
+ (where `createAuthoringHost` serves pages an agent wrote) or a sibling sub-domain (every space of a platform on one
13
+ domain) could write as if it were the server's own page. Now only `same-origin` (and `none`, a typed URL) is; `same-site`
14
+ is refused 403 `reason: 'foreign'` unless its origin is named (`crossSiteWrites.origins`, `identity.platformOrigins`),
15
+ and the `Origin` fallback compares host and port. In production an app and its spaces are already on different sites,
16
+ so a deployment that works there needs nothing; one that relied on a sibling sub-domain locally names it.
17
+ `createAuthoringHost`'s docs now say to serve on a host of its own — a cookie belongs to a host whatever its port.
18
+
19
+ ## Server
20
+ - **An open page takes a new version of its space where it stands** (`@plitzi/sdk-server`, `@plitzi/plitzi-sdk`):
21
+ `server.updatePages(documents, { draft? })` hands the pages showing that space — or that draft — its new documents,
22
+ and each swaps them in place, its state, scroll and focus kept (`replaceSpace` on what the SDK's `render` returns;
23
+ `false`, and the page loads again, for a page with elements the server draws). The development loop of a project uses
24
+ it: a save to the space no longer reloads the open page. `createAuthoringHost`'s `put` over an id that pages show
25
+ hands them the new version and answers how many took it (`updated`), so a page an agent keeps improving is seen to
26
+ grow instead of reloading — no second iframe needed.
27
+ - **`devReload` is `livePages`** (`@plitzi/sdk-server`): the channel the open pages listen on now carries the space,
28
+ not only "load again", and a host that is not developing uses it too. Its address is `/__plitzi/live`; a draft's page
29
+ listens for its own changes alone (`?__pt=`). A plugin swapped where it is drawn stays a development server's
30
+ (`devMode`). `plitzi upgrade migrations --write` renames the option in a project's code (`livePagesOption`).
31
+
32
+ ## Packages
33
+ - **`@plitzi/sdk-server` starts in half the time** (`@plitzi/sdk-shared`, `@plitzi/sdk-server`): importing it took
34
+ ~310 ms, ~200 of them `date-fns` — 108 modules nothing on the server uses, brought by `@plitzi/sdk-shared/helpers` —
35
+ and loaded the browser's hooks and contexts of every folder of `@plitzi/sdk-shared` it read, `@plitzi/nexus/react`
36
+ with them. Now ~150 ms (`@plitzi/sdk-shared` 139 → 113 modules, `@plitzi/nexus` 53 → 31). What moved, each
37
+ rewritten by `plitzi upgrade migrations --write` (`movedExports`):
38
+ - the dates — `formatDate`, `formatDateUTC`, `formatFromNow`, `formatUTCToLocal`, `getDurationMs`, `isDate`,
39
+ `isValidFormat`, `parseDate`, `toUnixSeconds`, `SupportedLocale` — from `@plitzi/sdk-shared/helpers` to
40
+ `@plitzi/sdk-shared/dates`;
41
+ - React's bindings to an entry of their own beside each area, as `@plitzi/nexus/react` is: `useDisplayMode`,
42
+ `useElementSize` → `@plitzi/sdk-shared/style/react`; `SchemaContext` → `schema/react`; `PluginsContext` →
43
+ `plugins/react`; `DevToolsContext` → `devTools/react`; `useFlagResolution` → `flags/react` (`flagUserFrom` stays
44
+ in `flags`);
45
+ - `PROJECT_DATA_PREFIX` from `@plitzi/sdk-shared/server` to `@plitzi/sdk-shared/project/paths` — the project's
46
+ layout names, an entry a browser imports too (`@plitzi/sdk-shared/project` stays Node only and re-exports them).
47
+ The theme cookie's helpers (`themeFromCookies`…) are also `@plitzi/sdk-shared/theme/cookie`, still exported by
48
+ `@plitzi/sdk-shared/theme`.
49
+
50
+ `yarn check:server-footprint` (in CI after the build) holds what the server's root loads, package by package — Plitzi's
51
+ and every other — to a budget: a heavy library or a folder of hooks coming back fails with what came in.
52
+
53
+ ## CLI
54
+ - **`plitzi upgrade migrations --write` writes a file import's new home when it has one** (`@plitzi/cli`): the
55
+ `folderImports` migration of 0.38.17 named every import of a package's FILE and wrote none. It now reads the installed
56
+ declarations with the project's own TypeScript and rewrites each `import` / `export … from` whose every name the folder
57
+ exports under one name — `import usePlitzi from '@plitzi/sdk-shared/hooks/usePlitzi'` →
58
+ `import { usePlitzi } from '@plitzi/sdk-shared/hooks'`, `type` modifiers and aliases kept. What has no one answer is
59
+ said with why (a namespace import, an `import()` or mock, a name the folder does not export, a project with no
60
+ TypeScript). The report says which places `--write` writes (`writable` in `--json`) instead of calling every one
61
+ "yours to change"; a migration now gives each place its own `edit` in place of a whole-file `rewrite`
62
+ (`docs/en/releases.md`).
63
+ - **`plitzi doctor` says an import of a path the installed package does not export** (`@plitzi/cli`):
64
+ `import-not-exported`, an error, at the importing file — what Node otherwise reports at start as an
65
+ `ERR_MODULE_NOT_FOUND` into the package's `dist`, which reads as a broken install rather than a changed API. For a
66
+ `@plitzi` package the fix names `plitzi upgrade migrations --write`; for any other, its `exports`. Asked only of a
67
+ package that is installed.
68
+
69
+ - Updated dependencies [b3023c9]
70
+ - @plitzi/sdk-schema@0.38.18
71
+ - @plitzi/sdk-shared@0.38.18
72
+
73
+ ## 0.38.17
74
+
75
+ ### Patch Changes
76
+
77
+ - 4f8dc37: ## Packages
78
+
79
+ - **A library package is imported by its root and its folders, never by a file** (`@plitzi/sdk-shared`, `sdk-schema`,
80
+ `sdk-style`, `sdk-elements`, `sdk-interactions`, `sdk-auth`, `sdk-dev-tools`, `sdk-event-bridge`, `sdk-navigation`,
81
+ `sdk-plugins`, `sdk-variables`): each `exports` is now `"."` and `"./*"`, the latter a folder's `index`.
82
+ `@plitzi/sdk-shared/helpers/isRecord` becomes `import { isRecord } from '@plitzi/sdk-shared/helpers'`, and a default
83
+ export by the name its folder gives it — almost always its file's (`import usePlitzi from '…/hooks/usePlitzi'` →
84
+ `import { usePlitzi } from '@plitzi/sdk-shared/hooks'`). A file-level specifier now fails with `ERR_MODULE_NOT_FOUND`.
85
+ New entries where a folder barrel would have brought more than was asked for: `@plitzi/sdk-shared/project` and
86
+ `@plitzi/sdk-shared/plugins/bundle` (Node only), `@plitzi/sdk-interactions/declarations` (the global callbacks and
87
+ utility specs, without React), and `@plitzi/sdk-elements/elements/declarations`, which now also carries the
88
+ declarations' attribute types and the constants they are checked with. `RuleGroup` is exported by `@plitzi/sdk-shared`
89
+ with the document types that use it. `plitzi upgrade migrations` names every such import in a project, with the folder to
90
+ import it from instead.
91
+ - **`@plitzi/sdk-shared`'s root exports the document types, and only them** (`@plitzi/sdk-shared`): what the package
92
+ does is imported from its folder — `formatDate` from `@plitzi/sdk-shared/helpers`, `ThemeProvider` from
93
+ `@plitzi/sdk-shared/theme`, a GraphQL operation's types from `@plitzi/sdk-shared/network/graphql` — so a module that
94
+ imports a type from the root no longer loads every area of the package.
95
+ - **What one package alone used lives in that package** (`@plitzi/sdk-shared`, `@plitzi/sdk-elements`): the data
96
+ source hooks moved from `@plitzi/sdk-shared/dataSource/hooks` to `@plitzi/sdk-elements/dataSource`
97
+ (`useRegisterSource`, `useResolvedVariables`), and the Apollo links the builder's client is built with into the
98
+ builder.
99
+ - **The builder's panels are an entry of their own** (`@plitzi/sdk-style`, `@plitzi/sdk-variables`,
100
+ `@plitzi/sdk-elements`): the style inspector, the advanced style editor and `BuilderStyleContextProvider` are imported
101
+ from `@plitzi/sdk-style/builder`; the variables' lists and forms from `@plitzi/sdk-variables/builder`; the elements'
102
+ settings panels (`defaultElementsSettings`) from `@plitzi/sdk-elements/builder`. Each package's root keeps what a page
103
+ and a server use — `generateCache` no longer loads the inspector, on a server 227 modules down to 21.
104
+
105
+ ## CLI
106
+ - **`plitzi upgrade`'s `renames` part is now `migrations`** (`@plitzi/cli`): what a version changed that a project's
107
+ own source must follow, one file per change in the CLI's `src/migrations/changes/` with the version it shipped in —
108
+ rewritten with `--write` when it has one right answer, said otherwise. The `--json` report carries `migrations` (each
109
+ with its `migration`, `since`, `file`, `line`, `what` and whether it was `written`) in place of `renames` and
110
+ `changes`. The changes of 0.38.0 (`canTemplate` → `canSnippet`, the `*Template` authoring names), 0.38.9 (a
111
+ `formControl` without `required` is optional) and 0.38.12 (`usePlitziServiceContext` → `usePlitzi`) are no longer
112
+ looked for: a project still on one of those versions makes them by hand.
113
+
114
+ - Updated dependencies [4f8dc37]
115
+ - @plitzi/sdk-schema@0.38.17
116
+ - @plitzi/sdk-shared@0.38.17
117
+
3
118
  ## 0.38.16
4
119
 
5
120
  ### Patch Changes
@@ -10,8 +10,8 @@ import c from "@plitzi/plitzi-ui/hooks/useStorage";
10
10
  import l from "clsx";
11
11
  import { Suspense as u, lazy as d, useCallback as f, useRef as p, useState as m } from "react";
12
12
  import { DevStoreScopeContext as h } from "@plitzi/nexus/react";
13
- import { DEV_TOOLS_ATTRIBUTE as g } from "@plitzi/sdk-shared/devTools/chrome";
14
- import _ from "@plitzi/sdk-shared/theme/useTheme";
13
+ import { DEV_TOOLS_ATTRIBUTE as g } from "@plitzi/sdk-shared/devTools";
14
+ import { useTheme as _ } from "@plitzi/sdk-shared/theme";
15
15
  import { jsx as v, jsxs as y } from "react/jsx-runtime";
16
16
  //#region src/DevToolsContainer.tsx
17
17
  var b = d(() => import("./components/DevToolsOverlay/index.mjs")), x = "horizontal", S = 0, C = ({ children: d, className: C, innerClassName: w, enabled: T = !1, instanceId: E, renderMode: D = "default", scroll: O = "container", qa: k = !1, devToolsStyle: ee = "", devToolsStyleLink: A = "", devToolsIconsLink: j = "" }) => {
@@ -1,7 +1,7 @@
1
1
  import { useCallback as e, useEffect as t, useMemo as n, useRef as r, useState as i } from "react";
2
- import { omit as a } from "@plitzi/plitzi-ui/helpers";
3
- import o from "@plitzi/sdk-shared/devTools/DevToolsContext";
4
- import { pConsole as s } from "@plitzi/sdk-shared/devTools/utils/PlitziConsole";
2
+ import { pConsole as a } from "@plitzi/sdk-shared/devTools";
3
+ import { omit as o } from "@plitzi/plitzi-ui/helpers";
4
+ import { DevToolsContext as s } from "@plitzi/sdk-shared/devTools/react";
5
5
  import { jsx as c } from "react/jsx-runtime";
6
6
  //#region src/DevToolsContextProvider.tsx
7
7
  var l = ({ children: l }) => {
@@ -16,11 +16,11 @@ var l = ({ children: l }) => {
16
16
  }, [d]), g = e((e, t) => p((n) => ({
17
17
  ...n,
18
18
  [e]: t
19
- })), []), _ = e((e) => p((t) => a(t, [e])), []), v = e((e, ...t) => {
19
+ })), []), _ = e((e) => p((t) => o(t, [e])), []), v = e((e, ...t) => {
20
20
  if (e && typeof f[e] == "function") return f[e](...t);
21
21
  }, [f]), y = e(() => d([]), []);
22
- m.current ||= (s.setCallback(h), s.setCallbackAddProvider(g), s.setCallbackRemoveProvider(_), !0), t(() => (s.setCallback(h), s.setCallbackAddProvider(g), s.setCallbackRemoveProvider(_), s.processPendingLogs(), () => {
23
- s.setCallback(void 0), s.setCallbackAddProvider(void 0), s.setCallbackRemoveProvider(void 0), s.flush();
22
+ m.current ||= (a.setCallback(h), a.setCallbackAddProvider(g), a.setCallbackRemoveProvider(_), !0), t(() => (a.setCallback(h), a.setCallbackAddProvider(g), a.setCallbackRemoveProvider(_), a.processPendingLogs(), () => {
23
+ a.setCallback(void 0), a.setCallbackAddProvider(void 0), a.setCallbackRemoveProvider(void 0), a.flush();
24
24
  }), [
25
25
  h,
26
26
  g,
@@ -39,7 +39,7 @@ var l = ({ children: l }) => {
39
39
  y,
40
40
  v
41
41
  ]);
42
- return /* @__PURE__ */ c(o, {
42
+ return /* @__PURE__ */ c(s, {
43
43
  value: b,
44
44
  children: l
45
45
  });
@@ -1,32 +1,32 @@
1
1
  import { use as e, useContext as t, useLayoutEffect as n, useRef as r } from "react";
2
2
  import { StoreContext as i } from "@plitzi/nexus/react";
3
- import { jsx as a } from "react/jsx-runtime";
4
- import { ThemeContext as o } from "@plitzi/plitzi-ui/Provider";
5
- import { createRoot as s } from "react-dom/client";
6
- import c from "@plitzi/sdk-shared/elements/ComponentContext";
7
- import l from "@plitzi/sdk-shared/plugins/PluginsContext";
8
- import u from "@plitzi/sdk-shared/theme/ThemeScope";
3
+ import { ThemeScopeContext as a } from "@plitzi/sdk-shared/theme";
4
+ import { jsx as o } from "react/jsx-runtime";
5
+ import { ThemeContext as s } from "@plitzi/plitzi-ui/Provider";
6
+ import { createRoot as c } from "react-dom/client";
7
+ import { ComponentContext as l } from "@plitzi/sdk-shared/elements";
8
+ import { PluginsContext as u } from "@plitzi/sdk-shared/plugins/react";
9
9
  //#region src/DevToolsRoot.tsx
10
10
  var d = { display: "contents" }, f = ({ children: f }) => {
11
- let p = r(null), m = r(void 0), h = r(void 0), g = t(i), _ = e(u), v = e(l), y = e(c), b = e(o);
11
+ let p = r(null), m = r(void 0), h = r(void 0), g = t(i), _ = e(a), v = e(u), y = e(l), b = e(s);
12
12
  return n(() => {
13
13
  let e = p.current;
14
- if (e) return clearTimeout(h.current), m.current ??= s(e), () => {
14
+ if (e) return clearTimeout(h.current), m.current ??= c(e), () => {
15
15
  let e = m.current;
16
16
  h.current = setTimeout(() => {
17
17
  e?.unmount(), m.current === e && (m.current = void 0);
18
18
  }, 0);
19
19
  };
20
20
  }, []), n(() => {
21
- m.current?.render(/* @__PURE__ */ a(i, {
21
+ m.current?.render(/* @__PURE__ */ o(i, {
22
22
  value: g,
23
- children: /* @__PURE__ */ a(o, {
23
+ children: /* @__PURE__ */ o(s, {
24
24
  value: b,
25
- children: /* @__PURE__ */ a(u, {
25
+ children: /* @__PURE__ */ o(a, {
26
26
  value: _,
27
- children: /* @__PURE__ */ a(l, {
27
+ children: /* @__PURE__ */ o(u, {
28
28
  value: v,
29
- children: /* @__PURE__ */ a(c, {
29
+ children: /* @__PURE__ */ o(l, {
30
30
  value: y,
31
31
  children: f
32
32
  })
@@ -34,7 +34,7 @@ var d = { display: "contents" }, f = ({ children: f }) => {
34
34
  })
35
35
  })
36
36
  }));
37
- }), /* @__PURE__ */ a("div", {
37
+ }), /* @__PURE__ */ o("div", {
38
38
  ref: p,
39
39
  style: d
40
40
  });
@@ -1,5 +1,5 @@
1
1
  import { elementReport as e, plain as t, recordAt as n } from "./report.mjs";
2
- import { isRecord as r } from "@plitzi/sdk-shared/helpers/isRecord";
2
+ import { isRecord as r } from "@plitzi/sdk-shared/helpers";
3
3
  //#region src/agentInspector/inspector.ts
4
4
  var i = "window.__plitzi — this page, in text (debug mode only):\n state(key?) runtime.state, or one key of it\n setState(key, value) writes runtime.state.<key>, as a setState step would\n sources(name?) every source's current value by name (apiContainer_site, list_products…), or one\n element(id) an element by its id, in a page or a component: type, attributes, what it reads, its own state,\n the component it places, copies, on screen, box\n flows(limit = 20) the last flows that ran: trigger, element, status, every step with its time and error\n watch(on = true) one console line per flow as it ends", a = (e, t) => r(e) && r(t) && Object.keys(t).some((t) => !Object.hasOwn(e, t)), o = ({ root: r, writeState: o, stores: s, runs: c, setWatching: l, document: u }) => ({
5
5
  help: () => i,
@@ -1,4 +1,4 @@
1
- import { isRecord as e } from "@plitzi/sdk-shared/helpers/isRecord";
1
+ import { isRecord as e } from "@plitzi/sdk-shared/helpers";
2
2
  //#region src/agentInspector/report.ts
3
3
  var t = (e, n = 0, r = /* @__PURE__ */ new WeakSet()) => {
4
4
  if (typeof e == "function") return;
@@ -2,21 +2,21 @@ import { flowRunLine as e, flowRunOf as t } from "./flowRuns.mjs";
2
2
  import { createAgentInspector as n } from "./inspector.mjs";
3
3
  import { useContext as r, useEffect as i } from "react";
4
4
  import { StoreContext as a } from "@plitzi/nexus/react";
5
- import { getDevStoresSnapshot as o } from "@plitzi/nexus";
6
- import { pConsole as s } from "@plitzi/sdk-shared/devTools";
5
+ import { pConsole as o } from "@plitzi/sdk-shared/devTools";
6
+ import { getDevStoresSnapshot as s } from "@plitzi/nexus";
7
7
  import { useCommonStoreSetter as c } from "@plitzi/sdk-shared/store";
8
8
  //#region src/agentInspector/useAgentInspector.ts
9
9
  var l = 100, u = (u) => {
10
10
  let d = r(a), f = c();
11
11
  i(() => {
12
12
  if (!u || !d) return;
13
- let r = [], i = !1, a = s.addListener((n) => {
13
+ let r = [], i = !1, a = o.addListener((n) => {
14
14
  let a = t(n);
15
15
  a && (r.push(a), r.length > l && r.shift(), i && console.info(e(a)));
16
16
  }, { replay: !0 }), c = n({
17
17
  root: d,
18
18
  writeState: (e, t) => f(`runtime.state.${e}`, t),
19
- stores: () => o().map((e) => e.store),
19
+ stores: () => s().map((e) => e.store),
20
20
  runs: () => r,
21
21
  setWatching: (e) => {
22
22
  i = e;
@@ -1,7 +1,7 @@
1
1
  import e from "clsx";
2
2
  import { use as t, useCallback as n, useMemo as r } from "react";
3
- import { DEV_TOOLS_ATTRIBUTE as i } from "@plitzi/sdk-shared/devTools/chrome";
4
- import a from "@plitzi/sdk-shared/devTools/DevToolsContext";
3
+ import { DEV_TOOLS_ATTRIBUTE as i } from "@plitzi/sdk-shared/devTools";
4
+ import { DevToolsContext as a } from "@plitzi/sdk-shared/devTools/react";
5
5
  import { jsx as o, jsxs as s } from "react/jsx-runtime";
6
6
  //#region src/components/DevToolsIndicator/DevToolsIndicator.tsx
7
7
  var c = ({ className: c, onOpen: l }) => {
@@ -12,15 +12,7 @@ var c = ({ className: c, onOpen: l }) => {
12
12
  errors: 0,
13
13
  warnings: 0
14
14
  }), [u]), p = n(() => {
15
- if (d > 0) {
16
- l("danger");
17
- return;
18
- }
19
- if (f > 0) {
20
- l("warning");
21
- return;
22
- }
23
- l();
15
+ d > 0 ? l("danger") : f > 0 ? l("warning") : l();
24
16
  }, [
25
17
  d,
26
18
  f,
@@ -11,7 +11,7 @@ import l from "./tabs/TracingViewer/TracingViewer.mjs";
11
11
  import u from "./tabs/VariablesViewer/index.mjs";
12
12
  import d from "clsx";
13
13
  import { use as f } from "react";
14
- import p from "@plitzi/sdk-shared/devTools/DevToolsContext";
14
+ import { DevToolsContext as p } from "@plitzi/sdk-shared/devTools/react";
15
15
  import { jsx as m, jsxs as h } from "react/jsx-runtime";
16
16
  //#region src/components/DevToolsPanel/DevToolsBody.tsx
17
17
  var g = ({ className: g, tabSelected: _, orientation: v, logTypeFilter: y, elementSelected: b, onSelectElement: x, qa: S = !1 }) => {
@@ -4,7 +4,7 @@ import n from "./DevToolsSubHeader.mjs";
4
4
  import r from "@plitzi/plitzi-ui/hooks/useStorage";
5
5
  import i from "clsx";
6
6
  import { useCallback as a, useMemo as o, useRef as s, useState as c } from "react";
7
- import { DEV_TOOLS_ATTRIBUTE as l } from "@plitzi/sdk-shared/devTools/chrome";
7
+ import { DEV_TOOLS_ATTRIBUTE as l } from "@plitzi/sdk-shared/devTools";
8
8
  import { useCommonStore as u } from "@plitzi/sdk-shared/store";
9
9
  import { jsx as d, jsxs as f } from "react/jsx-runtime";
10
10
  import p from "@plitzi/plitzi-ui/ContainerResizable";
@@ -2,18 +2,18 @@ import e from "../../highlight/index.mjs";
2
2
  import t from "./DevToolsButton.mjs";
3
3
  import n from "clsx";
4
4
  import { useCallback as r, useEffect as i, useMemo as a, useState as o } from "react";
5
- import { throttle as s } from "@plitzi/plitzi-ui/helpers";
6
- import { jsx as c, jsxs as l } from "react/jsx-runtime";
7
- import { elementOf as u } from "@plitzi/sdk-shared/helpers/eventTarget";
5
+ import { elementOf as s } from "@plitzi/sdk-shared/helpers";
6
+ import { throttle as c } from "@plitzi/plitzi-ui/helpers";
7
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
8
8
  //#region src/components/DevToolsPanel/DevToolsSubHeader.tsx
9
9
  var d = ({ className: d, elementSelected: f, currentPageId: p, onSelectElement: m }) => {
10
10
  let [h, g] = o(!1), _ = r((e) => {
11
11
  let { id: t } = e?.dataset ?? {};
12
12
  m(t);
13
- }, [m]), v = a(() => s(_, 100), [_]), y = r((e) => {
14
- u(e.target)?.closest(".plitzi-sdk") && v(u(e.target)?.closest("[data-id]") ?? void 0);
13
+ }, [m]), v = a(() => c(_, 100), [_]), y = r((e) => {
14
+ s(e.target)?.closest(".plitzi-sdk") && v(s(e.target)?.closest("[data-id]") ?? void 0);
15
15
  }, [v]), b = r((e) => {
16
- u(e.target)?.closest(".plitzi-sdk") && (e.stopPropagation(), e.preventDefault(), g(!1));
16
+ s(e.target)?.closest(".plitzi-sdk") && (e.stopPropagation(), e.preventDefault(), g(!1));
17
17
  }, []), x = r((e) => {
18
18
  e.stopPropagation(), e.preventDefault(), g(!0);
19
19
  }, [g]), S = r(() => {
@@ -31,22 +31,22 @@ var d = ({ className: d, elementSelected: f, currentPageId: p, onSelectElement:
31
31
  b,
32
32
  y,
33
33
  h
34
- ]), /* @__PURE__ */ l("div", {
34
+ ]), /* @__PURE__ */ u("div", {
35
35
  className: n("flex shrink-0 items-center justify-between gap-2 border-b border-zinc-200 bg-zinc-50 px-2 py-1 dark:border-zinc-700 dark:bg-zinc-800", d),
36
- children: [/* @__PURE__ */ l("div", {
36
+ children: [/* @__PURE__ */ u("div", {
37
37
  className: "flex gap-1",
38
- children: [/* @__PURE__ */ c(t, {
38
+ children: [/* @__PURE__ */ l(t, {
39
39
  iconClassName: "fa-regular fa-hand-pointer",
40
40
  title: "Select an element in the page to inspect it",
41
41
  onClick: x,
42
42
  isSelected: h
43
- }), /* @__PURE__ */ c(t, {
43
+ }), /* @__PURE__ */ l(t, {
44
44
  iconClassName: "fa-regular fa-file",
45
45
  title: "Current Page",
46
46
  onClick: S,
47
47
  isSelected: f === p
48
48
  })]
49
- }), /* @__PURE__ */ c(t, {
49
+ }), /* @__PURE__ */ l(t, {
50
50
  iconClassName: "fa-solid fa-ban",
51
51
  onClick: C,
52
52
  title: "Clear",
@@ -1,6 +1,6 @@
1
1
  import e from "./DevToolsButton.mjs";
2
2
  import { useCallback as t } from "react";
3
- import n from "@plitzi/sdk-shared/theme/useTheme";
3
+ import { useTheme as n } from "@plitzi/sdk-shared/theme";
4
4
  import { jsx as r } from "react/jsx-runtime";
5
5
  //#region src/components/DevToolsPanel/ThemeControl.tsx
6
6
  var i = {
@@ -4,7 +4,7 @@ import n from "../DetailsRuntime/index.mjs";
4
4
  import { useMemo as r } from "react";
5
5
  import { useCommonStore as i } from "@plitzi/sdk-shared/store";
6
6
  import { jsx as a, jsxs as o } from "react/jsx-runtime";
7
- import { treeOf as s } from "@plitzi/sdk-schema/helpers/components";
7
+ import { treeOf as s } from "@plitzi/sdk-schema";
8
8
  import c from "@plitzi/plitzi-ui/ContainerTabs";
9
9
  //#region src/components/DevToolsPanel/tabs/ElementsViewer/components/ElementDetails/ElementDetails.tsx
10
10
  var l = [
@@ -1,5 +1,5 @@
1
- import { componentNamed as e, isInstance as t } from "@plitzi/sdk-schema/helpers/components";
2
- import { resolveLayoutChain as n } from "@plitzi/sdk-shared/schema/layoutChain";
1
+ import { componentNamed as e, isInstance as t } from "@plitzi/sdk-schema";
2
+ import { resolveLayoutChain as n } from "@plitzi/sdk-shared/schema";
3
3
  //#region src/components/DevToolsPanel/tabs/ElementsViewer/helpers/renderTree.ts
4
4
  var r = (e) => typeof e == "string" ? e : "", i = (e, n) => {
5
5
  let i = [], a = /* @__PURE__ */ new Set(), o = (n, s) => {
@@ -1,4 +1,4 @@
1
- import { FlagResolution } from '@plitzi/sdk-shared';
1
+ import { FlagResolution } from '@plitzi/sdk-shared/flags';
2
2
  export type FlagSourceProps = {
3
3
  resolution?: FlagResolution;
4
4
  };
@@ -1,4 +1,5 @@
1
- import { FlagResolution, SchemaFlag } from '@plitzi/sdk-shared';
1
+ import { SchemaFlag } from '@plitzi/sdk-shared';
2
+ import { FlagResolution } from '@plitzi/sdk-shared/flags';
2
3
  export type FlagsListItemProps = {
3
4
  name: string;
4
5
  flag: SchemaFlag;
@@ -1,2 +1 @@
1
- import e from "./HistoryEntryItem.mjs";
2
- export { e as default };
1
+ export { default } from "./HistoryEntryItem.mjs";
@@ -1,2 +1 @@
1
- import e from "./HistoryToolbar.mjs";
2
- export { e as default };
1
+ export { default } from "./HistoryToolbar.mjs";
@@ -3,7 +3,7 @@ import { useCallback as t, useMemo as n, useState as r } from "react";
3
3
  import { useCommonStore as i } from "@plitzi/sdk-shared/store";
4
4
  import { get as a } from "@plitzi/plitzi-ui/helpers";
5
5
  import { jsx as o, jsxs as s } from "react/jsx-runtime";
6
- import { formatDate as c } from "@plitzi/sdk-shared/helpers";
6
+ import { formatDate as c } from "@plitzi/sdk-shared/dates";
7
7
  //#region src/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/BodyHeader.tsx
8
8
  var l = ({ triggerName: l, startTime: u, endTime: d, duration: f, elementId: p, hostElementId: m }) => {
9
9
  let [h] = i("schema.flat"), g = n(() => p ? a(h, p) : void 0, [p, h]), _ = n(() => c(u, "HH:mm:ss.SSS"), [u]), v = n(() => c(d, "HH:mm:ss.SSS"), [d]), y = n(() => {
@@ -3,7 +3,7 @@ import t from "clsx";
3
3
  import { useCallback as n, useMemo as r } from "react";
4
4
  import { get as i } from "@plitzi/plitzi-ui/helpers";
5
5
  import { jsx as a, jsxs as o } from "react/jsx-runtime";
6
- import { getDurationMs as s } from "@plitzi/sdk-shared";
6
+ import { getDurationMs as s } from "@plitzi/sdk-shared/dates";
7
7
  //#region src/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/ExecutionTree/ExecutionTree.tsx
8
8
  var c = ({ className: c, nodeId: l, nodes: u, selected: d, onSelect: f }) => {
9
9
  let p = r(() => {
@@ -3,7 +3,7 @@ import t from "./NodeMetadata.mjs";
3
3
  import n from "./NodeWhen.mjs";
4
4
  import { useMemo as r } from "react";
5
5
  import { jsx as i, jsxs as a } from "react/jsx-runtime";
6
- import { getDurationMs as o } from "@plitzi/sdk-shared";
6
+ import { getDurationMs as o } from "@plitzi/sdk-shared/dates";
7
7
  //#region src/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/InteractionNode/InteractionNode.tsx
8
8
  var s = ({ whenParams: s, name: c = "Node Title", startTime: l = 0, endTime: u = 0, status: d = "notStarted", when: f, type: p, action: m }) => {
9
9
  let h = r(() => `${o(l, u)}ms`, [l, u]);
@@ -1,16 +1,16 @@
1
1
  import { useMemo as e } from "react";
2
- import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
- import { getValuesRequired as r } from "@plitzi/plitzi-ui/QueryBuilder";
4
- import i from "@plitzi/sdk-shared/helpers/syntaxHighlight";
2
+ import { syntaxHighlight as t } from "@plitzi/sdk-shared/helpers";
3
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
+ import { getValuesRequired as i } from "@plitzi/plitzi-ui/QueryBuilder";
5
5
  //#region src/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/InteractionNode/NodeMetadata.tsx
6
6
  var a = ({ when: a, whenParams: o }) => {
7
- let s = e(() => !a || Object.keys(a).length === 0 ? "" : i(JSON.stringify(r(a, o), null, 2)), [o, a]);
8
- return s ? /* @__PURE__ */ n("div", {
7
+ let s = e(() => !a || Object.keys(a).length === 0 ? "" : t(JSON.stringify(i(a, o), null, 2)), [o, a]);
8
+ return s ? /* @__PURE__ */ r("div", {
9
9
  className: "flex flex-col gap-0.5",
10
- children: [/* @__PURE__ */ t("span", {
10
+ children: [/* @__PURE__ */ n("span", {
11
11
  className: "text-[10px] font-semibold tracking-wider text-zinc-400 uppercase dark:text-zinc-500",
12
12
  children: "Params"
13
- }), /* @__PURE__ */ t("pre", {
13
+ }), /* @__PURE__ */ n("pre", {
14
14
  className: "overflow-auto rounded bg-zinc-50 p-2 font-mono text-xs leading-5 dark:bg-zinc-800",
15
15
  dangerouslySetInnerHTML: { __html: s }
16
16
  })]
@@ -7,7 +7,7 @@ import { useMemo as a } from "react";
7
7
  import { isInteractionFlow as o } from "@plitzi/sdk-shared/devTools";
8
8
  import { jsx as s, jsxs as c } from "react/jsx-runtime";
9
9
  import l from "@plitzi/plitzi-ui/ContainerCollapsable";
10
- import { getDurationMs as u } from "@plitzi/sdk-shared";
10
+ import { getDurationMs as u } from "@plitzi/sdk-shared/dates";
11
11
  //#region src/components/DevToolsPanel/tabs/Logs/categories/LogInteraction/LogInteraction.tsx
12
12
  var d = /* @__PURE__ */ s("i", { className: "fa-solid fa-angle-right text-[10px]" }), f = /* @__PURE__ */ s("i", { className: "fa-solid fa-angle-down text-[10px]" }), p = ({ time: r, message: o, params: { elementId: p, hostElementId: m, status: h, node: g, nodes: _, startTime: v = 0, endTime: y = 0 } }) => {
13
13
  let b = a(() => `${u(v, y)}ms`, [v, y]), { failed: x, skipped: S, disabled: C } = a(() => {
@@ -2,7 +2,7 @@ import { useMemo as e } from "react";
2
2
  import { useCommonStore as t } from "@plitzi/sdk-shared/store";
3
3
  import { get as n } from "@plitzi/plitzi-ui/helpers";
4
4
  import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
- import { formatDate as a } from "@plitzi/sdk-shared/helpers";
5
+ import { formatDate as a } from "@plitzi/sdk-shared/dates";
6
6
  //#region src/components/DevToolsPanel/tabs/Logs/categories/LogNavigation/LogNavigationBody.tsx
7
7
  var o = ({ elementId: o, startTime: s, endTime: c, duration: l }) => {
8
8
  let [u] = t("schema.flat"), d = e(() => o ? n(u, o) : void 0, [o, u]);
@@ -1,7 +1,7 @@
1
1
  import e from "../../LogStatus.mjs";
2
2
  import { useMemo as t } from "react";
3
3
  import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
- import { formatDate as i } from "@plitzi/sdk-shared";
4
+ import { formatDate as i } from "@plitzi/sdk-shared/dates";
5
5
  //#region src/components/DevToolsPanel/tabs/Logs/categories/LogNavigation/LogNavigationHeader.tsx
6
6
  var a = ({ status: a, message: o, time: s }) => {
7
7
  let { logType: c, statusMessage: l } = t(() => a === "normal" ? {
@@ -1,6 +1,6 @@
1
1
  import e from "../../LogStatus.mjs";
2
2
  import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
- import { formatDate as r } from "@plitzi/sdk-shared";
3
+ import { formatDate as r } from "@plitzi/sdk-shared/dates";
4
4
  //#region src/components/DevToolsPanel/tabs/Logs/categories/LogStore/LogStoreHeader.tsx
5
5
  var i = ({ storeName: i, path: a, message: o, time: s }) => /* @__PURE__ */ n("div", {
6
6
  className: "flex w-full items-center gap-2 overflow-hidden",
@@ -1,2 +1 @@
1
- import e from "./LogStore.mjs";
2
- export { e as default };
1
+ export { default } from "./LogStore.mjs";
@@ -1,6 +1,6 @@
1
1
  import { useMemo as e } from "react";
2
- import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
- import r from "@plitzi/sdk-shared/helpers/syntaxHighlight";
2
+ import { syntaxHighlight as t } from "@plitzi/sdk-shared/helpers";
3
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
4
  //#region src/components/DevToolsPanel/tabs/PluginsViewer/PluginDetails.tsx
5
5
  var i = {
6
6
  "local-custom": {
@@ -12,60 +12,60 @@ var i = {
12
12
  hint: "A published bundle, described by the manifest it was published with."
13
13
  }
14
14
  }, a = ({ entry: a }) => {
15
- let { type: o, origin: s, version: c, author: l, settings: u } = a, d = e(() => !u || Object.keys(u).length === 0 ? null : r(JSON.stringify(u, null, 2)), [u]);
16
- return /* @__PURE__ */ n("div", {
15
+ let { type: o, origin: s, version: c, author: l, settings: u } = a, d = e(() => !u || Object.keys(u).length === 0 ? null : t(JSON.stringify(u, null, 2)), [u]);
16
+ return /* @__PURE__ */ r("div", {
17
17
  className: "flex h-full grow basis-0 flex-col overflow-y-auto p-4",
18
- children: [/* @__PURE__ */ n("div", {
18
+ children: [/* @__PURE__ */ r("div", {
19
19
  className: "mb-4 border-b border-zinc-200 pb-3 dark:border-zinc-700",
20
- children: [/* @__PURE__ */ t("div", {
20
+ children: [/* @__PURE__ */ n("div", {
21
21
  className: "text-base font-semibold text-zinc-800 dark:text-zinc-200",
22
22
  children: o
23
- }), /* @__PURE__ */ t("div", {
23
+ }), /* @__PURE__ */ n("div", {
24
24
  className: "text-xs text-zinc-400 dark:text-zinc-500",
25
25
  children: i[s].label
26
26
  })]
27
- }), /* @__PURE__ */ n("div", {
27
+ }), /* @__PURE__ */ r("div", {
28
28
  className: "flex flex-col gap-3",
29
29
  children: [
30
- /* @__PURE__ */ n("div", {
30
+ /* @__PURE__ */ r("div", {
31
31
  className: "flex flex-col gap-0.5",
32
- children: [/* @__PURE__ */ t("span", {
32
+ children: [/* @__PURE__ */ n("span", {
33
33
  className: "text-xs font-medium tracking-wider text-zinc-400 uppercase dark:text-zinc-500",
34
34
  children: "Where it comes from"
35
- }), /* @__PURE__ */ t("span", {
35
+ }), /* @__PURE__ */ n("span", {
36
36
  className: "text-xs text-zinc-800 dark:text-zinc-200",
37
37
  children: i[s].hint
38
38
  })]
39
39
  }),
40
- /* @__PURE__ */ n("div", {
40
+ /* @__PURE__ */ r("div", {
41
41
  className: "flex flex-col gap-0.5",
42
- children: [/* @__PURE__ */ t("span", {
42
+ children: [/* @__PURE__ */ n("span", {
43
43
  className: "text-xs font-medium tracking-wider text-zinc-400 uppercase dark:text-zinc-500",
44
44
  children: "Version"
45
- }), /* @__PURE__ */ t("span", {
45
+ }), /* @__PURE__ */ n("span", {
46
46
  className: "font-mono text-xs text-zinc-800 dark:text-zinc-200",
47
47
  children: c ?? "—"
48
48
  })]
49
49
  }),
50
- /* @__PURE__ */ n("div", {
50
+ /* @__PURE__ */ r("div", {
51
51
  className: "flex flex-col gap-0.5",
52
- children: [/* @__PURE__ */ t("span", {
52
+ children: [/* @__PURE__ */ n("span", {
53
53
  className: "text-xs font-medium tracking-wider text-zinc-400 uppercase dark:text-zinc-500",
54
54
  children: "Author"
55
- }), /* @__PURE__ */ t("span", {
55
+ }), /* @__PURE__ */ n("span", {
56
56
  className: "text-xs text-zinc-800 dark:text-zinc-200",
57
57
  children: l ?? "—"
58
58
  })]
59
59
  }),
60
- /* @__PURE__ */ n("div", {
60
+ /* @__PURE__ */ r("div", {
61
61
  className: "flex flex-col gap-1",
62
- children: [/* @__PURE__ */ t("span", {
62
+ children: [/* @__PURE__ */ n("span", {
63
63
  className: "text-xs font-medium tracking-wider text-zinc-400 uppercase dark:text-zinc-500",
64
64
  children: "Settings"
65
- }), d ? /* @__PURE__ */ t("pre", {
65
+ }), d ? /* @__PURE__ */ n("pre", {
66
66
  className: "overflow-auto rounded bg-zinc-50 p-2 font-mono text-xs leading-5 dark:bg-zinc-800",
67
67
  dangerouslySetInnerHTML: { __html: d }
68
- }) : /* @__PURE__ */ t("span", {
68
+ }) : /* @__PURE__ */ n("span", {
69
69
  className: "text-xs text-zinc-400 italic dark:text-zinc-500",
70
70
  children: "No settings"
71
71
  })]