@plitzi/sdk-interactions 0.38.16 → 0.38.17

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 (34) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/dist/InteractionsContext.mjs +1 -1
  3. package/dist/InteractionsHelper.mjs +2 -6
  4. package/dist/InteractionsManager.mjs +29 -30
  5. package/dist/declarations/index.d.ts +15 -0
  6. package/dist/declarations/index.mjs +9 -0
  7. package/dist/index.mjs +10 -9
  8. package/dist/sources/ActionsSource/ActionInteractions.mjs +21 -34
  9. package/dist/sources/ActionsSource/ServerActionContext.mjs +1 -1
  10. package/dist/sources/ActionsSource/callbacks.d.ts +1 -1
  11. package/dist/sources/ActionsSource/index.d.ts +1 -0
  12. package/dist/sources/ActionsSource/index.mjs +3 -2
  13. package/dist/sources/AuthSource/AuthInteractions.mjs +1 -1
  14. package/dist/sources/AuthSource/callbacks.d.ts +1 -1
  15. package/dist/sources/AuthSource/index.mjs +1 -2
  16. package/dist/sources/HostSource/HostInteractions.mjs +1 -1
  17. package/dist/sources/HostSource/callbacks.d.ts +1 -1
  18. package/dist/sources/NavigationSource/NavigationInteractions.mjs +1 -1
  19. package/dist/sources/NavigationSource/callbacks.d.ts +1 -1
  20. package/dist/sources/NavigationSource/index.mjs +1 -2
  21. package/dist/sources/QueriesSource/QueriesInteractions.mjs +1 -1
  22. package/dist/sources/QueriesSource/callbacks.d.ts +1 -1
  23. package/dist/sources/QueriesSource/index.mjs +1 -2
  24. package/dist/sources/QueriesSource/writeParams.d.ts +1 -1
  25. package/dist/sources/StateSource/StateInteractions.mjs +1 -1
  26. package/dist/sources/StateSource/callbacks.d.ts +1 -1
  27. package/dist/sources/StateSource/index.mjs +1 -2
  28. package/dist/sources/index.mjs +9 -8
  29. package/dist/utility/copyToClipboard.mjs +6 -6
  30. package/dist/utility/copyToClipboardSpec.d.ts +1 -1
  31. package/dist/utility/twigTemplate.mjs +7 -7
  32. package/dist/utility/webHook.mjs +1 -1
  33. package/dist/utility/webHookSpec.d.ts +1 -1
  34. package/package.json +14 -184
package/CHANGELOG.md CHANGED
@@ -1,5 +1,51 @@
1
1
  # @plitzi/sdk-interactions
2
2
 
3
+ ## 0.38.17
4
+
5
+ ### Patch Changes
6
+
7
+ - 4f8dc37: ## Packages
8
+
9
+ - **A library package is imported by its root and its folders, never by a file** (`@plitzi/sdk-shared`, `sdk-schema`,
10
+ `sdk-style`, `sdk-elements`, `sdk-interactions`, `sdk-auth`, `sdk-dev-tools`, `sdk-event-bridge`, `sdk-navigation`,
11
+ `sdk-plugins`, `sdk-variables`): each `exports` is now `"."` and `"./*"`, the latter a folder's `index`.
12
+ `@plitzi/sdk-shared/helpers/isRecord` becomes `import { isRecord } from '@plitzi/sdk-shared/helpers'`, and a default
13
+ export by the name its folder gives it — almost always its file's (`import usePlitzi from '…/hooks/usePlitzi'` →
14
+ `import { usePlitzi } from '@plitzi/sdk-shared/hooks'`). A file-level specifier now fails with `ERR_MODULE_NOT_FOUND`.
15
+ New entries where a folder barrel would have brought more than was asked for: `@plitzi/sdk-shared/project` and
16
+ `@plitzi/sdk-shared/plugins/bundle` (Node only), `@plitzi/sdk-interactions/declarations` (the global callbacks and
17
+ utility specs, without React), and `@plitzi/sdk-elements/elements/declarations`, which now also carries the
18
+ declarations' attribute types and the constants they are checked with. `RuleGroup` is exported by `@plitzi/sdk-shared`
19
+ with the document types that use it. `plitzi upgrade migrations` names every such import in a project, with the folder to
20
+ import it from instead.
21
+ - **`@plitzi/sdk-shared`'s root exports the document types, and only them** (`@plitzi/sdk-shared`): what the package
22
+ does is imported from its folder — `formatDate` from `@plitzi/sdk-shared/helpers`, `ThemeProvider` from
23
+ `@plitzi/sdk-shared/theme`, a GraphQL operation's types from `@plitzi/sdk-shared/network/graphql` — so a module that
24
+ imports a type from the root no longer loads every area of the package.
25
+ - **What one package alone used lives in that package** (`@plitzi/sdk-shared`, `@plitzi/sdk-elements`): the data
26
+ source hooks moved from `@plitzi/sdk-shared/dataSource/hooks` to `@plitzi/sdk-elements/dataSource`
27
+ (`useRegisterSource`, `useResolvedVariables`), and the Apollo links the builder's client is built with into the
28
+ builder.
29
+ - **The builder's panels are an entry of their own** (`@plitzi/sdk-style`, `@plitzi/sdk-variables`,
30
+ `@plitzi/sdk-elements`): the style inspector, the advanced style editor and `BuilderStyleContextProvider` are imported
31
+ from `@plitzi/sdk-style/builder`; the variables' lists and forms from `@plitzi/sdk-variables/builder`; the elements'
32
+ settings panels (`defaultElementsSettings`) from `@plitzi/sdk-elements/builder`. Each package's root keeps what a page
33
+ and a server use — `generateCache` no longer loads the inspector, on a server 227 modules down to 21.
34
+
35
+ ## CLI
36
+ - **`plitzi upgrade`'s `renames` part is now `migrations`** (`@plitzi/cli`): what a version changed that a project's
37
+ own source must follow, one file per change in the CLI's `src/migrations/changes/` with the version it shipped in —
38
+ rewritten with `--write` when it has one right answer, said otherwise. The `--json` report carries `migrations` (each
39
+ with its `migration`, `since`, `file`, `line`, `what` and whether it was `written`) in place of `renames` and
40
+ `changes`. The changes of 0.38.0 (`canTemplate` → `canSnippet`, the `*Template` authoring names), 0.38.9 (a
41
+ `formControl` without `required` is optional) and 0.38.12 (`usePlitziServiceContext` → `usePlitzi`) are no longer
42
+ looked for: a project still on one of those versions makes them by hand.
43
+
44
+ - Updated dependencies [4f8dc37]
45
+ - @plitzi/sdk-auth@0.38.17
46
+ - @plitzi/sdk-event-bridge@0.38.17
47
+ - @plitzi/sdk-shared@0.38.17
48
+
3
49
  ## 0.38.16
4
50
 
5
51
  ### Patch Changes
@@ -1,4 +1,4 @@
1
- import { sharedContext as e } from "@plitzi/sdk-shared/helpers/sharedContext";
1
+ import { sharedContext as e } from "@plitzi/sdk-shared/helpers";
2
2
  var t = e("InteractionsContext", {});
3
3
  //#endregion
4
4
  export { t as default };
@@ -2,7 +2,7 @@ import { coerceDeclaredParams as e } from "./helpers/coerceDeclaredParams.mjs";
2
2
  import t from "./utility/index.mjs";
3
3
  import { get as n, omit as r } from "@plitzi/plitzi-ui/helpers";
4
4
  import { QueryBuilderEvaluator as i } from "@plitzi/plitzi-ui/QueryBuilder";
5
- import { pConsole as a } from "@plitzi/sdk-shared/devTools/utils/PlitziConsole";
5
+ import { pConsole as a } from "@plitzi/sdk-shared/devTools";
6
6
  import { MAX_PARAM_PASSES as o, resolveStepParam as s } from "@plitzi/sdk-shared/helpers/twigWrapper";
7
7
  import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
8
8
  //#region src/InteractionsHelper.tsx
@@ -170,11 +170,7 @@ var d = 5, f = (e, t, n, r, i) => {
170
170
  startTime: t,
171
171
  endTime: o
172
172
  };
173
- if (r === "failed") {
174
- a.danger("interactions", d, f);
175
- return;
176
- }
177
- a.info("interactions", d, f);
173
+ r === "failed" ? a.danger("interactions", d, f) : a.info("interactions", d, f);
178
174
  }, x = (e) => Object.values(e).some(({ status: e }) => e === "failed") ? "failed" : "completed", S = async (e, t = {}, n = {}, r = {}, o = v, s, c, l = []) => {
179
175
  let u = a.getTime().valueOf(), { action: d, enabled: f, when: p } = e;
180
176
  if (!d || !f || p && !i(p, m({
@@ -1,16 +1,15 @@
1
1
  import { flowTrigger as e } from "./InteractionsHelper.mjs";
2
- import { get as t, set as n } from "@plitzi/plitzi-ui/helpers";
3
- import r from "@plitzi/sdk-event-bridge";
4
- import { INTERVAL_TRIGGER as i, intervalOf as a } from "@plitzi/sdk-shared/helpers/interval";
5
- import { KEY_TRIGGER as o } from "@plitzi/sdk-shared/helpers/keys";
2
+ import { INTERVAL_TRIGGER as t, KEY_TRIGGER as n, intervalOf as r } from "@plitzi/sdk-shared/helpers";
3
+ import { get as i, set as a } from "@plitzi/plitzi-ui/helpers";
4
+ import o from "@plitzi/sdk-event-bridge";
6
5
  //#region src/InteractionsManager.ts
7
- var s = (e, t) => {
8
- if (e.action === o) {
9
- let { shortcuts: n } = t;
10
- return Array.isArray(n) && n.includes(e.params.keys);
6
+ var s = (e, i) => {
7
+ if (e.action === n) {
8
+ let { shortcuts: t } = i;
9
+ return Array.isArray(t) && t.includes(e.params.keys);
11
10
  }
12
- return e.action !== i || a(e.params.interval) === t.interval;
13
- }, c = class i {
11
+ return e.action !== t || r(e.params.interval) === i.interval;
12
+ }, c = class t {
14
13
  eventBridge;
15
14
  parentManager;
16
15
  childManagers;
@@ -22,21 +21,21 @@ var s = (e, t) => {
22
21
  lastUpdate;
23
22
  listeners = /* @__PURE__ */ new Set();
24
23
  constructor(e = "", t = {}, n = {}) {
25
- this.eventBridge = new r(), this.parentManager = void 0, this.childManagers = [], this.subscriptors = {}, this.callbacksAvailables = {}, this.interactionsData = {
24
+ this.eventBridge = new o(), this.parentManager = void 0, this.childManagers = [], this.subscriptors = {}, this.callbacksAvailables = {}, this.interactionsData = {
26
25
  currentPageId: e,
27
26
  ...t,
28
27
  ...n
29
28
  }, this.lastUpdate = Date.now();
30
29
  }
31
- eventBridgeCallback = (n) => async (r, i, a) => {
32
- if (!n || !i || !r) return;
33
- let o = this.subscriptors[r];
34
- if (await Promise.resolve(), !o || this.subscriptors[r] !== o) return;
35
- let c = t(this.subscriptors, `${r}.getAdditionalParams`, void 0), l = () => ({
30
+ eventBridgeCallback = (t) => async (n, r, a) => {
31
+ if (!t || !r || !n) return;
32
+ let o = this.subscriptors[n];
33
+ if (await Promise.resolve(), !o || this.subscriptors[n] !== o) return;
34
+ let c = i(this.subscriptors, `${n}.getAdditionalParams`, void 0), l = () => ({
36
35
  ...this.interactionsData,
37
36
  ...typeof c == "function" ? c().dataSource : void 0
38
- }), u = Object.values(n).filter((e) => e.type === "trigger" && e.action === i && e.enabled && s(e, a));
39
- await Promise.all(u.map((t) => this.runFlow(`${r}.${t.id}`, t.whileRunning ?? "skip", (i) => e(t, n, this.getCallbacksAvailables(), { [t.id]: a }, l, r, i))));
37
+ }), u = Object.values(t).filter((e) => e.type === "trigger" && e.action === r && e.enabled && s(e, a));
38
+ await Promise.all(u.map((r) => this.runFlow(`${n}.${r.id}`, r.whileRunning ?? "skip", (i) => e(r, t, this.getCallbacksAvailables(), { [r.id]: a }, l, n, i))));
40
39
  };
41
40
  runFlow(e, t, n) {
42
41
  if (t === "latest") {
@@ -54,12 +53,12 @@ var s = (e, t) => {
54
53
  });
55
54
  return this.flowsRunning.set(e, i), i;
56
55
  }
57
- subscribe(e, t = {}, r = {}, i = {}, a) {
58
- return !e || this.subscriptors[e] ? !1 : (n(this.subscriptors, e, {
56
+ subscribe(e, t = {}, n = {}, r = {}, i) {
57
+ return !e || this.subscriptors[e] ? !1 : (a(this.subscriptors, e, {
59
58
  id: e,
60
- triggers: r,
61
- getAdditionalParams: a
62
- }), this.wire(e, t, r, i), this.touch(), !0);
59
+ triggers: n,
60
+ getAdditionalParams: i
61
+ }), this.wire(e, t, n, r), this.touch(), !0);
63
62
  }
64
63
  update(e, t = {}, n = {}, r = {}, i) {
65
64
  let a = this.subscriptors[e];
@@ -91,11 +90,11 @@ var s = (e, t) => {
91
90
  return this.parentManager ? this.parentManager.getRootManager() : this;
92
91
  }
93
92
  getSubscriptorInternal(e) {
94
- let n = t(this.subscriptors, e);
95
- if (!n && this.childManagers.length > 0) {
96
- for (let t of this.childManagers) if (n = t.getSubscriptorInternal(e), n) break;
93
+ let t = i(this.subscriptors, e);
94
+ if (!t && this.childManagers.length > 0) {
95
+ for (let n of this.childManagers) if (t = n.getSubscriptorInternal(e), t) break;
97
96
  }
98
- return n;
97
+ return t;
99
98
  }
100
99
  getSubscriptor(e) {
101
100
  return this.parentManager ? this.getRootManager()?.getSubscriptorInternal(e) : this.getSubscriptorInternal(e);
@@ -128,9 +127,9 @@ var s = (e, t) => {
128
127
  interactionTrigger(e, t, n = {}) {
129
128
  if (e) return this.eventBridge.emit("interaction", e, e, t, n);
130
129
  }
131
- createChildManager = (e = {}, t = {}) => {
132
- let n = new i(this.interactionsData.currentPageId, e, t);
133
- return n.parentManager = this, this.childManagers.push(n), n;
130
+ createChildManager = (e = {}, n = {}) => {
131
+ let r = new t(this.interactionsData.currentPageId, e, n);
132
+ return r.parentManager = this, this.childManagers.push(r), r;
134
133
  };
135
134
  removeChildManager = (e) => {
136
135
  this.childManagers = this.childManagers.filter((t) => t !== e);
@@ -0,0 +1,15 @@
1
+ /**
2
+ * What an interaction is checked against, without the React that runs it: the global callbacks each source declares and
3
+ * the utilities' parameter specs.
4
+ *
5
+ * They live beside their sources and are gathered here so they can be read outside a browser — the authoring linter, a
6
+ * seed, a script — where a source's barrel would bring its component along.
7
+ */
8
+ export { actionsCallbacks } from '../sources/ActionsSource/callbacks';
9
+ export { authCallbacks } from '../sources/AuthSource/callbacks';
10
+ export { hostCallbacks } from '../sources/HostSource/callbacks';
11
+ export { navigationCallbacks } from '../sources/NavigationSource/callbacks';
12
+ export { queriesCallbacks } from '../sources/QueriesSource/callbacks';
13
+ export { stateCallbacks } from '../sources/StateSource/callbacks';
14
+ export { copyToClipboardSpec } from '../utility/copyToClipboardSpec';
15
+ export { webHookSpec } from '../utility/webHookSpec';
@@ -0,0 +1,9 @@
1
+ import { copyToClipboardSpec as e } from "../utility/copyToClipboardSpec.mjs";
2
+ import { webHookSpec as t } from "../utility/webHookSpec.mjs";
3
+ import { actionsCallbacks as n } from "../sources/ActionsSource/callbacks.mjs";
4
+ import { authCallbacks as r } from "../sources/AuthSource/callbacks.mjs";
5
+ import i from "../sources/HostSource/callbacks.mjs";
6
+ import { navigationCallbacks as a } from "../sources/NavigationSource/callbacks.mjs";
7
+ import { queriesCallbacks as o } from "../sources/QueriesSource/callbacks.mjs";
8
+ import { stateCallbacks as s } from "../sources/StateSource/callbacks.mjs";
9
+ export { n as actionsCallbacks, r as authCallbacks, e as copyToClipboardSpec, i as hostCallbacks, a as navigationCallbacks, o as queriesCallbacks, s as stateCallbacks, t as webHookSpec };
package/dist/index.mjs CHANGED
@@ -4,12 +4,13 @@ import n from "./utility/index.mjs";
4
4
  import r, { flowTrigger as i } from "./InteractionsHelper.mjs";
5
5
  import a from "./InteractionsManager.mjs";
6
6
  import o from "./InteractionsContextProvider.mjs";
7
- import s from "./sources/ActionsSource/ActionInteractions.mjs";
8
- import c from "./sources/AuthSource/AuthInteractions.mjs";
9
- import l from "./sources/HostSource/callbacks.mjs";
10
- import u from "./sources/HostSource/HostInteractions.mjs";
11
- import d from "./sources/NavigationSource/NavigationInteractions.mjs";
12
- import f from "./sources/QueriesSource/QueriesInteractions.mjs";
13
- import p from "./sources/StateSource/StateInteractions.mjs";
14
- import m from "./InteractionsSourcesProvider.mjs";
15
- export { s as ActionInteractions, c as AuthInteractions, u as HostInteractions, e as InteractionsContext, o as InteractionsContextProvider, r as InteractionsHelper, a as InteractionsManager, m as InteractionsSourcesProvider, d as NavigationInteractions, f as QueriesInteractions, p as StateInteractions, i as flowTrigger, l as hostCallbacks, t as useInteractions, n as utility };
7
+ import { ServerActionContext as s } from "./sources/ActionsSource/ServerActionContext.mjs";
8
+ import c from "./sources/ActionsSource/ActionInteractions.mjs";
9
+ import l from "./sources/AuthSource/AuthInteractions.mjs";
10
+ import u from "./sources/HostSource/callbacks.mjs";
11
+ import d from "./sources/HostSource/HostInteractions.mjs";
12
+ import f from "./sources/NavigationSource/NavigationInteractions.mjs";
13
+ import p from "./sources/QueriesSource/QueriesInteractions.mjs";
14
+ import m from "./sources/StateSource/StateInteractions.mjs";
15
+ import h from "./InteractionsSourcesProvider.mjs";
16
+ export { c as ActionInteractions, l as AuthInteractions, d as HostInteractions, e as InteractionsContext, o as InteractionsContextProvider, r as InteractionsHelper, a as InteractionsManager, h as InteractionsSourcesProvider, f as NavigationInteractions, p as QueriesInteractions, s as ServerActionContext, m as StateInteractions, i as flowTrigger, u as hostCallbacks, t as useInteractions, n as utility };
@@ -2,8 +2,8 @@ import e from "../../InteractionsContext.mjs";
2
2
  import { actionsCallbacks as t } from "./callbacks.mjs";
3
3
  import { ServerActionContext as n, endedStatusOf as r } from "./ServerActionContext.mjs";
4
4
  import { use as i, useCallback as a, useMemo as o } from "react";
5
- import { pConsole as s } from "@plitzi/sdk-shared/devTools/utils/PlitziConsole";
6
- import { toBuilderParams as c, toInteractionCallbacks as l } from "@plitzi/sdk-shared/authoring/builder";
5
+ import { pConsole as s } from "@plitzi/sdk-shared/devTools";
6
+ import { toBuilderParams as c, toInteractionCallbacks as l } from "@plitzi/sdk-shared/authoring";
7
7
  import { invalidateAfterWrite as u } from "@plitzi/sdk-shared/queries";
8
8
  import { jsx as d, jsxs as f } from "react/jsx-runtime";
9
9
  import { recordActionProgress as p, recordActionRun as m, registerActionCanceller as h, releaseActionCanceller as g, updateActionRun as _, useCommonStore as v } from "@plitzi/sdk-shared/store";
@@ -139,25 +139,17 @@ var x = (e) => Array.isArray(e) ? e : void 0, S = async (e, t) => {
139
139
  body: c
140
140
  }).then(async (e) => {
141
141
  let r = await e.json().catch(() => ({}));
142
- if (!e.ok) {
143
- E(e.status, r, A), j(D(r)), N(t?.hostElementId, "onFlowError", O(n, r));
144
- return;
145
- }
146
- if (r.status === "failed") {
147
- j(D(r)), s.warning("actions", /* @__PURE__ */ f("span", { children: [
148
- "Server action ",
149
- /* @__PURE__ */ d("b", { children: n }),
150
- " failed"
151
- ] }), {
152
- actionId: n,
153
- mode: i,
154
- runId: r.runId,
155
- reason: r.reason,
156
- error: r.error
157
- }), N(t?.hostElementId, "onFlowError", O(n, r));
158
- return;
159
- }
160
- j({
142
+ e.ok ? r.status === "failed" ? (j(D(r)), s.warning("actions", /* @__PURE__ */ f("span", { children: [
143
+ "Server action ",
144
+ /* @__PURE__ */ d("b", { children: n }),
145
+ " failed"
146
+ ] }), {
147
+ actionId: n,
148
+ mode: i,
149
+ runId: r.runId,
150
+ reason: r.reason,
151
+ error: r.error
152
+ }), N(t?.hostElementId, "onFlowError", O(n, r))) : (j({
161
153
  status: r.status === "completed" ? "completed" : "accepted",
162
154
  ...r.runId ? { runId: r.runId } : {},
163
155
  ...r.output ? { output: r.output } : {},
@@ -178,7 +170,7 @@ var x = (e) => Array.isArray(e) ? e : void 0, S = async (e, t) => {
178
170
  runId: r.runId ?? "",
179
171
  status: r.status ?? "completed",
180
172
  output: r.output ?? {}
181
- });
173
+ })) : (E(e.status, r, A), j(D(r)), N(t?.hostElementId, "onFlowError", O(n, r)));
182
174
  }).catch((e) => {
183
175
  j(T(v, e)), s.warning("actions", /* @__PURE__ */ f("span", { children: [
184
176
  "Server action ",
@@ -253,15 +245,12 @@ var x = (e) => Array.isArray(e) ? e : void 0, S = async (e, t) => {
253
245
  status: "streaming",
254
246
  ...r ? { runId: r } : {}
255
247
  }), S(e.body, (e) => {
256
- if (e.event === "data") {
257
- p(l, e.data.chunk ?? e.data), N(t?.hostElementId, "onFlowProgress", {
258
- actionId: n,
259
- runId: r,
260
- ...e.data
261
- });
262
- return;
263
- }
264
- if (e.event === "error") {
248
+ if (e.event === "data") p(l, e.data.chunk ?? e.data), N(t?.hostElementId, "onFlowProgress", {
249
+ actionId: n,
250
+ runId: r,
251
+ ...e.data
252
+ });
253
+ else if (e.event === "error") {
265
254
  let i = x(e.data.steps);
266
255
  j({
267
256
  status: "failed",
@@ -273,9 +262,7 @@ var x = (e) => Array.isArray(e) ? e : void 0, S = async (e, t) => {
273
262
  runId: r,
274
263
  ...e.data
275
264
  });
276
- return;
277
- }
278
- if (e.event === "done") {
265
+ } else if (e.event === "done") {
279
266
  let i = x(e.data.steps);
280
267
  j({
281
268
  status: e.data.status === "completed" ? "completed" : "failed",
@@ -1,4 +1,4 @@
1
- import { sharedContext as e } from "@plitzi/sdk-shared/helpers/sharedContext";
1
+ import { sharedContext as e } from "@plitzi/sdk-shared/helpers";
2
2
  //#region src/sources/ActionsSource/ServerActionContext.ts
3
3
  var t = [
4
4
  "completed",
@@ -1,4 +1,4 @@
1
- import { BuiltinGlobalCallback } from '@plitzi/sdk-shared/authoring/builder';
1
+ import { BuiltinGlobalCallback } from '@plitzi/sdk-shared/authoring';
2
2
  /**
3
3
  * Running a server action from a flow, and cancelling one.
4
4
  *
@@ -1,3 +1,4 @@
1
1
  import { default as ActionInteractions } from './ActionInteractions';
2
2
  export * from './ActionInteractions';
3
3
  export { ActionInteractions };
4
+ export { ServerActionContext } from './ServerActionContext';
@@ -1,2 +1,3 @@
1
- import e from "./ActionInteractions.mjs";
2
- export { e as ActionInteractions };
1
+ import { ServerActionContext as e } from "./ServerActionContext.mjs";
2
+ import t from "./ActionInteractions.mjs";
3
+ export { t as ActionInteractions, e as ServerActionContext };
@@ -1,7 +1,7 @@
1
1
  import e from "../../InteractionsContext.mjs";
2
2
  import { authCallbacks as t } from "./callbacks.mjs";
3
3
  import { use as n, useMemo as r } from "react";
4
- import { toInteractionCallbacks as i } from "@plitzi/sdk-shared/authoring/builder";
4
+ import { toInteractionCallbacks as i } from "@plitzi/sdk-shared/authoring";
5
5
  import { AuthContext as a } from "@plitzi/sdk-auth";
6
6
  //#region src/sources/AuthSource/AuthInteractions.tsx
7
7
  var o = ({ children: o }) => {
@@ -1,4 +1,4 @@
1
- import { BuiltinGlobalCallback } from '@plitzi/sdk-shared/authoring/builder';
1
+ import { BuiltinGlobalCallback } from '@plitzi/sdk-shared/authoring';
2
2
  /**
3
3
  * The auth source's three actions.
4
4
  *
@@ -1,2 +1 @@
1
- import e from "./AuthInteractions.mjs";
2
- export { e as AuthInteractions };
1
+ export { default as AuthInteractions } from "./AuthInteractions.mjs";
@@ -1,7 +1,7 @@
1
1
  import e from "../../InteractionsContext.mjs";
2
2
  import t from "./callbacks.mjs";
3
3
  import { use as n, useCallback as r, useMemo as i } from "react";
4
- import { toInteractionCallbacks as a } from "@plitzi/sdk-shared/authoring/builder";
4
+ import { toInteractionCallbacks as a } from "@plitzi/sdk-shared/authoring";
5
5
  //#region src/sources/HostSource/HostInteractions.tsx
6
6
  var o = ({ children: o, actions: s }) => {
7
7
  let { useInteractions: c } = n(e), l = r((e) => {
@@ -1,4 +1,4 @@
1
- import { BuiltinGlobalCallback } from '@plitzi/sdk-shared/authoring/builder';
1
+ import { BuiltinGlobalCallback } from '@plitzi/sdk-shared/authoring';
2
2
  /**
3
3
  * The one way a rendered space can ask the application AROUND it to do something.
4
4
  *
@@ -2,7 +2,7 @@ import e from "../../InteractionsContext.mjs";
2
2
  import { navigationCallbacks as t } from "./callbacks.mjs";
3
3
  import { use as n, useCallback as r, useMemo as i } from "react";
4
4
  import { get as a, pick as o } from "@plitzi/plitzi-ui/helpers";
5
- import { toBuilderParams as s, toInteractionCallbacks as c } from "@plitzi/sdk-shared/authoring/builder";
5
+ import { toBuilderParams as s, toInteractionCallbacks as c } from "@plitzi/sdk-shared/authoring";
6
6
  import { useSdkStore as l } from "@plitzi/sdk-shared/store";
7
7
  //#region src/sources/NavigationSource/NavigationInteractions.tsx
8
8
  var u = ({ children: u, previewMode: d = !1 }) => {
@@ -1,4 +1,4 @@
1
- import { BuiltinGlobalCallback } from '@plitzi/sdk-shared/authoring/builder';
1
+ import { BuiltinGlobalCallback } from '@plitzi/sdk-shared/authoring';
2
2
  /**
3
3
  * Navigation's one action.
4
4
  *
@@ -1,2 +1 @@
1
- import e from "./NavigationInteractions.mjs";
2
- export { e as NavigationInteractions };
1
+ export { default as NavigationInteractions } from "./NavigationInteractions.mjs";
@@ -1,7 +1,7 @@
1
1
  import e from "../../InteractionsContext.mjs";
2
2
  import { queriesCallbacks as t } from "./callbacks.mjs";
3
3
  import { use as n, useCallback as r, useMemo as i } from "react";
4
- import { toInteractionCallbacks as a } from "@plitzi/sdk-shared/authoring/builder";
4
+ import { toInteractionCallbacks as a } from "@plitzi/sdk-shared/authoring";
5
5
  import { invalidateQueries as o, parseIds as s } from "@plitzi/sdk-shared/queries";
6
6
  //#region src/sources/QueriesSource/QueriesInteractions.tsx
7
7
  var c = ({ children: c }) => {
@@ -1,4 +1,4 @@
1
- import { BuiltinGlobalCallback } from '@plitzi/sdk-shared/authoring/builder';
1
+ import { BuiltinGlobalCallback } from '@plitzi/sdk-shared/authoring';
2
2
  /**
3
3
  * The step that tells the page's cached requests the data behind them changed.
4
4
  *
@@ -1,2 +1 @@
1
- import e from "./QueriesInteractions.mjs";
2
- export { e as QueriesInteractions };
1
+ export { default as QueriesInteractions } from "./QueriesInteractions.mjs";
@@ -1,4 +1,4 @@
1
- import { ParamSpec } from '@plitzi/sdk-shared/authoring/paramSpec';
1
+ import { ParamSpec } from '@plitzi/sdk-shared/authoring';
2
2
  import { WriteInvalidation } from '@plitzi/sdk-shared/queries';
3
3
  /**
4
4
  * The two params a step that writes carries: what to refresh once it succeeded, and — when it is a list — which
@@ -1,7 +1,7 @@
1
1
  import e from "../../InteractionsContext.mjs";
2
2
  import { stateCallbacks as t } from "./callbacks.mjs";
3
3
  import { use as n, useCallback as r, useMemo as i } from "react";
4
- import { toInteractionCallbacks as a } from "@plitzi/sdk-shared/authoring/builder";
4
+ import { toInteractionCallbacks as a } from "@plitzi/sdk-shared/authoring";
5
5
  import { useCommonStoreSetter as o } from "@plitzi/sdk-shared/store";
6
6
  //#region src/sources/StateSource/StateInteractions.tsx
7
7
  var s = 0, c = () => typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `e${++s}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`, l = (e, t) => {
@@ -1,3 +1,3 @@
1
- import { BuiltinGlobalCallback } from '@plitzi/sdk-shared/authoring/builder';
1
+ import { BuiltinGlobalCallback } from '@plitzi/sdk-shared/authoring';
2
2
  /** What this source's actions are, for the editor that fills them in and for anything authoring one offline. */
3
3
  export declare const stateCallbacks: Record<string, BuiltinGlobalCallback>;
@@ -1,2 +1 @@
1
- import e from "./StateInteractions.mjs";
2
- export { e as StateInteractions };
1
+ export { default as StateInteractions } from "./StateInteractions.mjs";
@@ -1,8 +1,9 @@
1
- import e from "./ActionsSource/ActionInteractions.mjs";
2
- import t from "./AuthSource/AuthInteractions.mjs";
3
- import n from "./HostSource/callbacks.mjs";
4
- import r from "./HostSource/HostInteractions.mjs";
5
- import i from "./NavigationSource/NavigationInteractions.mjs";
6
- import a from "./QueriesSource/QueriesInteractions.mjs";
7
- import o from "./StateSource/StateInteractions.mjs";
8
- export { e as ActionInteractions, t as AuthInteractions, r as HostInteractions, i as NavigationInteractions, a as QueriesInteractions, o as StateInteractions, n as hostCallbacks };
1
+ import { ServerActionContext as e } from "./ActionsSource/ServerActionContext.mjs";
2
+ import t from "./ActionsSource/ActionInteractions.mjs";
3
+ import n from "./AuthSource/AuthInteractions.mjs";
4
+ import r from "./HostSource/callbacks.mjs";
5
+ import i from "./HostSource/HostInteractions.mjs";
6
+ import a from "./NavigationSource/NavigationInteractions.mjs";
7
+ import o from "./QueriesSource/QueriesInteractions.mjs";
8
+ import s from "./StateSource/StateInteractions.mjs";
9
+ export { t as ActionInteractions, n as AuthInteractions, i as HostInteractions, a as NavigationInteractions, o as QueriesInteractions, e as ServerActionContext, s as StateInteractions, r as hostCallbacks };
@@ -1,11 +1,11 @@
1
1
  import { copyToClipboardSpec as e } from "./copyToClipboardSpec.mjs";
2
- import { toInteractionCallback as t } from "@plitzi/sdk-shared/authoring/builder";
3
- import { clipboardWriter as n } from "@plitzi/sdk-shared/helpers/clipboard";
2
+ import { clipboardWriter as t } from "@plitzi/sdk-shared/helpers";
3
+ import { toInteractionCallback as n } from "@plitzi/sdk-shared/authoring";
4
4
  //#region src/utility/copyToClipboard.ts
5
- var r = t("copyToClipboard", e, async ({ text: e }) => {
6
- let t = n();
7
- if (!t) throw Error("This page has no clipboard to write to: the browser offers none here (a page not on https?)");
8
- await t(e);
5
+ var r = n("copyToClipboard", e, async ({ text: e }) => {
6
+ let n = t();
7
+ if (!n) throw Error("This page has no clipboard to write to: the browser offers none here (a page not on https?)");
8
+ await n(e);
9
9
  });
10
10
  //#endregion
11
11
  export { r as default };
@@ -1,4 +1,4 @@
1
- import { BuiltinActionSpec } from '@plitzi/sdk-shared/authoring/builder';
1
+ import { BuiltinActionSpec } from '@plitzi/sdk-shared/authoring';
2
2
  /**
3
3
  * The copy-to-clipboard step, as the editor and anything authoring one offline read it: the words to copy — a template
4
4
  * like any step's param, so `{{ navigation.href }}` copies the page's address and `{{ snippet.code }}` what a source
@@ -1,5 +1,5 @@
1
- import { processTwig as e } from "@plitzi/sdk-shared/helpers/twigWrapper";
2
- import { getPathsFromObject as t } from "@plitzi/sdk-shared/helpers/utils";
1
+ import { getPathsFromObject as e } from "@plitzi/sdk-shared/helpers";
2
+ import { processTwig as t } from "@plitzi/sdk-shared/helpers/twigWrapper";
3
3
  //#region src/utility/twigTemplate.ts
4
4
  var n = {
5
5
  action: "twigTemplate",
@@ -39,10 +39,10 @@ var n = {
39
39
  preview: (n) => {
40
40
  let { template: r, returnMode: i } = n;
41
41
  if (i === "jsonObject") try {
42
- let i = JSON.parse(e(r, n));
42
+ let i = JSON.parse(t(r, n));
43
43
  if (i && typeof i == "object") return {
44
44
  template: "",
45
- content: t(i).reduce((e, t) => ({
45
+ content: e(i).reduce((e, t) => ({
46
46
  ...e,
47
47
  [t]: ""
48
48
  }), {})
@@ -53,10 +53,10 @@ var n = {
53
53
  content: ""
54
54
  };
55
55
  },
56
- callback: (t) => {
57
- let { template: n, returnMode: r } = t, i = "";
56
+ callback: (e) => {
57
+ let { template: n, returnMode: r } = e, i = "";
58
58
  try {
59
- i = e(n, t);
59
+ i = t(n, e);
60
60
  } catch (e) {
61
61
  console.error(e);
62
62
  }
@@ -1,5 +1,5 @@
1
1
  import { webHookSpec as e } from "./webHookSpec.mjs";
2
- import { toInteractionCallback as t } from "@plitzi/sdk-shared/authoring/builder";
2
+ import { toInteractionCallback as t } from "@plitzi/sdk-shared/authoring";
3
3
  import { invalidateAfterWrite as n, queryCache as r, requestKey as i } from "@plitzi/sdk-shared/queries";
4
4
  //#region src/utility/webHook.ts
5
5
  var a = /* @__PURE__ */ new Set(["GET", "HEAD"]), o = /* @__PURE__ */ new Set([
@@ -1,4 +1,4 @@
1
- import { BuiltinActionSpec } from '@plitzi/sdk-shared/authoring/builder';
1
+ import { BuiltinActionSpec } from '@plitzi/sdk-shared/authoring';
2
2
  /**
3
3
  * The webhook step, as the editor and anything authoring one offline read it.
4
4
  *
package/package.json CHANGED
@@ -1,190 +1,20 @@
1
1
  {
2
2
  "name": "@plitzi/sdk-interactions",
3
- "version": "0.38.16",
3
+ "version": "0.38.17",
4
4
  "license": "AGPL-3.0",
5
5
  "files": [
6
6
  "dist"
7
7
  ],
8
8
  "exports": {
9
9
  ".": {
10
+ "@plitzi/source": "./src/index.ts",
10
11
  "types": "./dist/index.d.ts",
11
12
  "import": "./dist/index.mjs"
12
13
  },
13
- "./InteractionsContext": {
14
- "types": "./dist/InteractionsContext.d.ts",
15
- "import": "./dist/InteractionsContext.mjs"
16
- },
17
- "./InteractionsContextProvider": {
18
- "types": "./dist/InteractionsContextProvider.d.ts",
19
- "import": "./dist/InteractionsContextProvider.mjs"
20
- },
21
- "./InteractionsHelper": {
22
- "types": "./dist/InteractionsHelper.d.ts",
23
- "import": "./dist/InteractionsHelper.mjs"
24
- },
25
- "./InteractionsManager": {
26
- "types": "./dist/InteractionsManager.d.ts",
27
- "import": "./dist/InteractionsManager.mjs"
28
- },
29
- "./InteractionsSourcesProvider": {
30
- "types": "./dist/InteractionsSourcesProvider.d.ts",
31
- "import": "./dist/InteractionsSourcesProvider.mjs"
32
- },
33
- "./helpers/coerceDeclaredParams": {
34
- "types": "./dist/helpers/coerceDeclaredParams.d.ts",
35
- "import": "./dist/helpers/coerceDeclaredParams.mjs"
36
- },
37
- "./hooks/useInteractions": {
38
- "types": "./dist/hooks/useInteractions.d.ts",
39
- "import": "./dist/hooks/useInteractions.mjs"
40
- },
41
- "./index": {
42
- "types": "./dist/index.d.ts",
43
- "import": "./dist/index.mjs"
44
- },
45
- "./sources": {
46
- "types": "./dist/sources/index.d.ts",
47
- "import": "./dist/sources/index.mjs"
48
- },
49
- "./sources/ActionsSource": {
50
- "types": "./dist/sources/ActionsSource/index.d.ts",
51
- "import": "./dist/sources/ActionsSource/index.mjs"
52
- },
53
- "./sources/ActionsSource/ActionInteractions": {
54
- "types": "./dist/sources/ActionsSource/ActionInteractions.d.ts",
55
- "import": "./dist/sources/ActionsSource/ActionInteractions.mjs"
56
- },
57
- "./sources/ActionsSource/ServerActionContext": {
58
- "types": "./dist/sources/ActionsSource/ServerActionContext.d.ts",
59
- "import": "./dist/sources/ActionsSource/ServerActionContext.mjs"
60
- },
61
- "./sources/ActionsSource/callbacks": {
62
- "types": "./dist/sources/ActionsSource/callbacks.d.ts",
63
- "import": "./dist/sources/ActionsSource/callbacks.mjs"
64
- },
65
- "./sources/ActionsSource/index": {
66
- "types": "./dist/sources/ActionsSource/index.d.ts",
67
- "import": "./dist/sources/ActionsSource/index.mjs"
68
- },
69
- "./sources/AuthSource": {
70
- "types": "./dist/sources/AuthSource/index.d.ts",
71
- "import": "./dist/sources/AuthSource/index.mjs"
72
- },
73
- "./sources/AuthSource/AuthInteractions": {
74
- "types": "./dist/sources/AuthSource/AuthInteractions.d.ts",
75
- "import": "./dist/sources/AuthSource/AuthInteractions.mjs"
76
- },
77
- "./sources/AuthSource/callbacks": {
78
- "types": "./dist/sources/AuthSource/callbacks.d.ts",
79
- "import": "./dist/sources/AuthSource/callbacks.mjs"
80
- },
81
- "./sources/AuthSource/index": {
82
- "types": "./dist/sources/AuthSource/index.d.ts",
83
- "import": "./dist/sources/AuthSource/index.mjs"
84
- },
85
- "./sources/HostSource": {
86
- "types": "./dist/sources/HostSource/index.d.ts",
87
- "import": "./dist/sources/HostSource/index.mjs"
88
- },
89
- "./sources/HostSource/HostInteractions": {
90
- "types": "./dist/sources/HostSource/HostInteractions.d.ts",
91
- "import": "./dist/sources/HostSource/HostInteractions.mjs"
92
- },
93
- "./sources/HostSource/callbacks": {
94
- "types": "./dist/sources/HostSource/callbacks.d.ts",
95
- "import": "./dist/sources/HostSource/callbacks.mjs"
96
- },
97
- "./sources/HostSource/index": {
98
- "types": "./dist/sources/HostSource/index.d.ts",
99
- "import": "./dist/sources/HostSource/index.mjs"
100
- },
101
- "./sources/NavigationSource": {
102
- "types": "./dist/sources/NavigationSource/index.d.ts",
103
- "import": "./dist/sources/NavigationSource/index.mjs"
104
- },
105
- "./sources/NavigationSource/NavigationInteractions": {
106
- "types": "./dist/sources/NavigationSource/NavigationInteractions.d.ts",
107
- "import": "./dist/sources/NavigationSource/NavigationInteractions.mjs"
108
- },
109
- "./sources/NavigationSource/callbacks": {
110
- "types": "./dist/sources/NavigationSource/callbacks.d.ts",
111
- "import": "./dist/sources/NavigationSource/callbacks.mjs"
112
- },
113
- "./sources/NavigationSource/index": {
114
- "types": "./dist/sources/NavigationSource/index.d.ts",
115
- "import": "./dist/sources/NavigationSource/index.mjs"
116
- },
117
- "./sources/QueriesSource": {
118
- "types": "./dist/sources/QueriesSource/index.d.ts",
119
- "import": "./dist/sources/QueriesSource/index.mjs"
120
- },
121
- "./sources/QueriesSource/QueriesInteractions": {
122
- "types": "./dist/sources/QueriesSource/QueriesInteractions.d.ts",
123
- "import": "./dist/sources/QueriesSource/QueriesInteractions.mjs"
124
- },
125
- "./sources/QueriesSource/callbacks": {
126
- "types": "./dist/sources/QueriesSource/callbacks.d.ts",
127
- "import": "./dist/sources/QueriesSource/callbacks.mjs"
128
- },
129
- "./sources/QueriesSource/index": {
130
- "types": "./dist/sources/QueriesSource/index.d.ts",
131
- "import": "./dist/sources/QueriesSource/index.mjs"
132
- },
133
- "./sources/QueriesSource/writeParams": {
134
- "types": "./dist/sources/QueriesSource/writeParams.d.ts",
135
- "import": "./dist/sources/QueriesSource/writeParams.mjs"
136
- },
137
- "./sources/StateSource": {
138
- "types": "./dist/sources/StateSource/index.d.ts",
139
- "import": "./dist/sources/StateSource/index.mjs"
140
- },
141
- "./sources/StateSource/StateInteractions": {
142
- "types": "./dist/sources/StateSource/StateInteractions.d.ts",
143
- "import": "./dist/sources/StateSource/StateInteractions.mjs"
144
- },
145
- "./sources/StateSource/callbacks": {
146
- "types": "./dist/sources/StateSource/callbacks.d.ts",
147
- "import": "./dist/sources/StateSource/callbacks.mjs"
148
- },
149
- "./sources/StateSource/index": {
150
- "types": "./dist/sources/StateSource/index.d.ts",
151
- "import": "./dist/sources/StateSource/index.mjs"
152
- },
153
- "./sources/index": {
154
- "types": "./dist/sources/index.d.ts",
155
- "import": "./dist/sources/index.mjs"
156
- },
157
- "./utility": {
158
- "types": "./dist/utility/index.d.ts",
159
- "import": "./dist/utility/index.mjs"
160
- },
161
- "./utility/copyToClipboard": {
162
- "types": "./dist/utility/copyToClipboard.d.ts",
163
- "import": "./dist/utility/copyToClipboard.mjs"
164
- },
165
- "./utility/copyToClipboardSpec": {
166
- "types": "./dist/utility/copyToClipboardSpec.d.ts",
167
- "import": "./dist/utility/copyToClipboardSpec.mjs"
168
- },
169
- "./utility/delayTime": {
170
- "types": "./dist/utility/delayTime.d.ts",
171
- "import": "./dist/utility/delayTime.mjs"
172
- },
173
- "./utility/index": {
174
- "types": "./dist/utility/index.d.ts",
175
- "import": "./dist/utility/index.mjs"
176
- },
177
- "./utility/twigTemplate": {
178
- "types": "./dist/utility/twigTemplate.d.ts",
179
- "import": "./dist/utility/twigTemplate.mjs"
180
- },
181
- "./utility/webHook": {
182
- "types": "./dist/utility/webHook.d.ts",
183
- "import": "./dist/utility/webHook.mjs"
184
- },
185
- "./utility/webHookSpec": {
186
- "types": "./dist/utility/webHookSpec.d.ts",
187
- "import": "./dist/utility/webHookSpec.mjs"
14
+ "./*": {
15
+ "@plitzi/source": "./src/*/index.ts",
16
+ "types": "./dist/*/index.d.ts",
17
+ "import": "./dist/*/index.mjs"
188
18
  }
189
19
  },
190
20
  "scripts": {
@@ -192,24 +22,24 @@
192
22
  "typecheck": "tsc -p tsconfig.app.json --noEmit",
193
23
  "test": "vitest run",
194
24
  "test:watch": "vitest",
195
- "build:dev": "vite build --mode development --minify false && node ../sdk-shared/scripts/generate-exports.mjs",
25
+ "build:dev": "vite build --mode development --minify false",
196
26
  "build:dev-watch": "vite build --mode development --watch --minify false",
197
- "build:prod": "vite build && node ../sdk-shared/scripts/generate-exports.mjs"
27
+ "build:prod": "vite build"
198
28
  },
199
29
  "type": "module",
200
30
  "sideEffects": false,
201
31
  "devDependencies": {
202
32
  "eslint": "^9.39.5",
203
- "react": "^19.3.0",
33
+ "react": "^19.3.1",
204
34
  "typescript": "^6.0.3",
205
- "vite": "^8.3.2",
206
- "vitest": "^5.0.3"
35
+ "vite": "^8.3.4",
36
+ "vitest": "^5.0.5"
207
37
  },
208
38
  "dependencies": {
209
39
  "@plitzi/plitzi-ui": "^1.6.33",
210
- "@plitzi/sdk-auth": "0.38.16",
211
- "@plitzi/sdk-event-bridge": "0.38.16",
212
- "@plitzi/sdk-shared": "0.38.16"
40
+ "@plitzi/sdk-auth": "0.38.17",
41
+ "@plitzi/sdk-event-bridge": "0.38.17",
42
+ "@plitzi/sdk-shared": "0.38.17"
213
43
  },
214
44
  "peerDependencies": {
215
45
  "react": "^19"