@plitzi/sdk-elements 0.38.9 → 0.38.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/CHANGELOG.md +88 -0
  2. package/dist/Element/hooks/useElementInternal.mjs +67 -59
  3. package/dist/elements/advanced/BlockHtml/index.mjs +3 -3
  4. package/dist/elements/advanced/BlockJsx/index.mjs +3 -3
  5. package/dist/elements/advanced/Custom/index.mjs +3 -3
  6. package/dist/elements/basic/Button/index.mjs +3 -3
  7. package/dist/elements/basic/ThemeToggle/ThemeToggle.mjs +13 -13
  8. package/dist/elements/declarations/index.d.ts +22 -16
  9. package/dist/elements/declarations/index.mjs +6 -6
  10. package/dist/elements/form/Form/Form.mjs +19 -19
  11. package/dist/elements/form/FormControl/FormControl.mjs +10 -10
  12. package/dist/elements/form/FormControl/declaration.mjs +1 -1
  13. package/dist/elements/internal/NotFound/index.mjs +3 -3
  14. package/dist/elements/internal/Page/Page.d.ts +5 -0
  15. package/dist/elements/internal/Page/Page.mjs +26 -25
  16. package/dist/elements/internal/Page/PageHead.d.ts +12 -0
  17. package/dist/elements/internal/Page/PageHead.mjs +29 -0
  18. package/dist/elements/internal/Page/declaration.d.ts +2 -0
  19. package/dist/elements/internal/Page/declaration.mjs +5 -0
  20. package/dist/elements/internal/Page/index.d.ts +2 -0
  21. package/dist/elements/provider/ApiContainer/ApiContainer.mjs +187 -187
  22. package/dist/elements/provider/ApiContainer/declaration.d.ts +10 -9
  23. package/dist/elements/provider/ApiContainer/declaration.mjs +1 -0
  24. package/dist/elements/provider/ApiContainer/index.d.ts +10 -9
  25. package/dist/elements/provider/Channel/Channel.mjs +15 -15
  26. package/dist/elements/provider/Channel/declaration.d.ts +1 -1
  27. package/dist/elements/provider/Channel/index.d.ts +1 -1
  28. package/dist/elements/structure/Carousel/Carousel.mjs +72 -72
  29. package/dist/elements/structure/Carousel/CarouselTrack/index.mjs +3 -3
  30. package/dist/elements/structure/Carousel/declaration.d.ts +1 -1
  31. package/dist/elements/structure/Carousel/index.d.ts +1 -1
  32. package/dist/elements/structure/Container/Container.mjs +8 -8
  33. package/dist/elements/structure/DialogContainer/DialogContainer.mjs +14 -14
  34. package/dist/elements/structure/DialogContainer/declaration.d.ts +1 -2
  35. package/dist/elements/structure/DialogContainer/declaration.mjs +1 -2
  36. package/dist/elements/structure/DialogContainer/index.d.ts +1 -2
  37. package/dist/elements/structure/List/modes/ListControlled/ListControlled.mjs +8 -8
  38. package/dist/elements/structure/ModalContainer/ModalContainer.mjs +16 -16
  39. package/dist/elements/structure/ModalContainer/declaration.d.ts +2 -3
  40. package/dist/elements/structure/ModalContainer/declaration.mjs +2 -3
  41. package/dist/elements/structure/ModalContainer/index.d.ts +2 -3
  42. package/dist/elements/structure/Pagination/Pagination.mjs +10 -10
  43. package/dist/index.d.ts +17 -16
  44. package/package.json +11 -7
@@ -1,235 +1,235 @@
1
- import e from "../../../Element/hocs/withElement.mjs";
2
- import t from "../../../Element/hooks/useElement.mjs";
3
- import ee from "../../../Element/hooks/useRscData.mjs";
4
- import { RootElement as te } from "../../../Element/RootElement.mjs";
5
- import n from "./declaration.mjs";
6
- import { isEmptyAnswer as ne } from "./helpers/isEmptyAnswer.mjs";
7
- import { childrenWhile as re } from "./helpers/loadingSlot.mjs";
8
- import ie from "./helpers/providerOutcome.mjs";
9
- import { queryInputOf as ae } from "./helpers/queryInput.mjs";
10
- import { serverMock as oe } from "./helpers/serverMock.mjs";
11
- import se from "./hooks/useApi.mjs";
12
- import ce from "./hooks/useAutoRefresh.mjs";
13
- import le from "./hooks/useInputRefresh.mjs";
14
- import ue from "./hooks/useProviderPagination.mjs";
15
- import de from "./hooks/useProviderWrite.mjs";
16
- import fe from "../../../dataSource/pathFields.mjs";
17
- import { use as pe, useCallback as r, useEffect as me, useMemo as i, useRef as a } from "react";
18
- import he from "@plitzi/sdk-shared/hooks/usePlitziServiceContext";
19
- import { useCommonStore as ge, useSdkStore as _e } from "@plitzi/sdk-shared/store";
20
- import { StoreProvider as ve } from "@plitzi/nexus/react";
21
- import { emptyObject as o } from "@plitzi/sdk-shared/helpers/utils";
22
- import { jsx as s } from "react/jsx-runtime";
23
- import { currentRscLocation as ye } from "@plitzi/sdk-shared/server/rsc/refreshRsc";
24
- import be from "clsx";
25
- import xe from "@plitzi/sdk-shared/dataSource/helpers/getSourceName";
26
- import Se from "@plitzi/sdk-shared/dataSource/hooks/useRegisterSource";
27
- import { QueryBuilderEvaluator as Ce } from "@plitzi/plitzi-ui/QueryBuilder";
28
- import { useServerQuery as we } from "@plitzi/sdk-shared/queries";
1
+ import e from "./declaration.mjs";
2
+ import t from "../../../Element/hocs/withElement.mjs";
3
+ import ee from "../../../Element/hooks/useElement.mjs";
4
+ import te from "../../../Element/hooks/useRscData.mjs";
5
+ import { RootElement as ne } from "../../../Element/RootElement.mjs";
6
+ import { isEmptyAnswer as re } from "./helpers/isEmptyAnswer.mjs";
7
+ import { childrenWhile as ie } from "./helpers/loadingSlot.mjs";
8
+ import ae from "./helpers/providerOutcome.mjs";
9
+ import { queryInputOf as oe } from "./helpers/queryInput.mjs";
10
+ import { serverMock as se } from "./helpers/serverMock.mjs";
11
+ import ce from "./hooks/useApi.mjs";
12
+ import le from "./hooks/useAutoRefresh.mjs";
13
+ import ue from "./hooks/useInputRefresh.mjs";
14
+ import de from "./hooks/useProviderPagination.mjs";
15
+ import fe from "./hooks/useProviderWrite.mjs";
16
+ import pe from "../../../dataSource/pathFields.mjs";
17
+ import { use as me, useCallback as n, useEffect as he, useMemo as r, useRef as i } from "react";
18
+ import ge from "@plitzi/sdk-shared/hooks/usePlitziServiceContext";
19
+ import { useCommonStore as _e, useSdkStore as ve } from "@plitzi/sdk-shared/store";
20
+ import { StoreProvider as ye } from "@plitzi/nexus/react";
21
+ import { emptyObject as a } from "@plitzi/sdk-shared/helpers/utils";
22
+ import { jsx as o } from "react/jsx-runtime";
23
+ import { currentRscLocation as be } from "@plitzi/sdk-shared/server/rsc/refreshRsc";
24
+ import xe from "clsx";
25
+ import Se from "@plitzi/sdk-shared/dataSource/helpers/getSourceName";
26
+ import Ce from "@plitzi/sdk-shared/dataSource/hooks/useRegisterSource";
27
+ import { QueryBuilderEvaluator as we } from "@plitzi/plitzi-ui/QueryBuilder";
28
+ import { useServerQuery as Te } from "@plitzi/sdk-shared/queries";
29
29
  //#region src/elements/provider/ApiContainer/ApiContainer.tsx
30
- var c = ({ ref: e, className: c = "", children: l, query: u = "", method: d = "get", accessToken: f = "", when: p = o, headers: m = o, mockData: h = "{}", subType: Te = "", credentials: Ee = "same-origin", singleRecord: g = !1, pagination: De = "none", pageParam: Oe = "page", renderWhileLoading: ke = !1, loadingSlot: _ = "", cache: Ae = !1, staleTime: je = 30, gcTime: Me = 300, refreshSeconds: Ne = 0, connector: Pe = "", action: Fe = "", input: Ie }) => {
31
- let { id: v, visible: y, definition: { label: b = "Api Container", runtime: Le, items: Re } } = t(), x = Le === "server", { loaded: S, stale: C, location: w, elementData: T, refreshing: ze, refresh: E, cancel: D } = ee(), O = xe(n.sourceType, v), { settings: { previewMode: k }, contexts: { InteractionsContext: Be } } = he(), { interactionsManager: A } = pe(Be), [[j, M, Ve]] = _e([
30
+ var s = ({ ref: t, className: s = "", children: c, query: l = "", method: u = "get", accessToken: d = "", when: f = a, headers: p = a, mockData: m = "{}", subType: Ee = "", credentials: De = "same-origin", singleRecord: h = !1, pagination: Oe = "none", pageParam: ke = "page", renderWhileLoading: Ae = !1, loadingSlot: g = "", cache: je = !1, staleTime: Me = 30, gcTime: Ne = 300, refreshSeconds: Pe = 0, connector: Fe = "", action: Ie = "", input: Le }) => {
31
+ let { id: _, visible: v, definition: { label: y = "Api Container", runtime: Re, items: ze } } = ee(), b = Re === "server", { loaded: x, stale: S, location: C, elementData: w, refreshing: Be, refresh: T, cancel: E } = te(), D = Se(e.sourceType, _), { settings: { previewMode: O }, contexts: { InteractionsContext: Ve } } = ge(), { interactionsManager: k } = me(Ve), [[A, j, He]] = ve([
32
32
  "navigation.routeParams",
33
33
  "navigation.queryParams",
34
34
  "navigation.navigate"
35
- ]), He = i(() => f ? {
36
- ...m,
37
- Authorization: `Bearer ${f}`
38
- } : m, [m, f]), N = i(() => x || !y ? !1 : !!(k && u && (p === o || Ce(p, {
39
- ...j,
40
- ...M
41
- })) || !k && (u || h && h !== "{}" && h !== o)), [
42
- x,
43
- y,
44
- k,
45
- u,
46
- p,
35
+ ]), Ue = r(() => d ? {
36
+ ...p,
37
+ Authorization: `Bearer ${d}`
38
+ } : p, [p, d]), M = r(() => b || !v ? !1 : !!(O && l && (f === a || we(f, {
39
+ ...A,
40
+ ...j
41
+ })) || !O && (l || m && m !== "{}" && m !== a)), [
42
+ b,
43
+ v,
44
+ O,
45
+ l,
46
+ f,
47
+ A,
47
48
  j,
48
- M,
49
- h
50
- ]), Ue = i(() => [v], [v]), { isLoading: We, isFetching: Ge, data: Ke, refetch: qe, cancel: P, isSuccess: Je, isError: Ye } = se({
51
- url: u,
52
- method: d,
53
- credentials: Ee,
54
- mock: k ? void 0 : h,
55
- customHeaders: He,
56
- enabled: N,
57
- cache: Ae,
58
- staleTime: je,
59
- gcTime: Me,
60
- tags: Ue
61
- }), F = x && !!w && w !== ye(), I = x && S && !F && T === null, L = x && !Pe && !Fe, R = i(() => x ? T || (S ? o : oe(h, L)) : Ke ?? o, [
49
+ m
50
+ ]), We = r(() => [_], [_]), { isLoading: Ge, isFetching: Ke, data: N, refetch: P, cancel: F, isSuccess: qe, isError: Je } = ce({
51
+ url: l,
52
+ method: u,
53
+ credentials: De,
54
+ mock: O ? void 0 : m,
55
+ customHeaders: Ue,
56
+ enabled: M,
57
+ cache: je,
58
+ staleTime: Me,
59
+ gcTime: Ne,
60
+ tags: We
61
+ }), I = b && !!C && C !== be(), L = b && x && !I && w === null, R = b && !Fe && !Ie, z = r(() => b ? w || (x ? a : se(m, R)) : N ?? a, [
62
+ b,
63
+ N,
64
+ w,
62
65
  x,
63
- Ke,
64
- T,
65
- S,
66
- h,
67
- L
68
- ]), z = x ? F || ze : Ge, B = x ? F : We, V = a({}), Xe = r((e, t) => E(e, {
69
- ...V.current,
66
+ m,
67
+ R
68
+ ]), B = b ? I || Be : Ke, V = b ? I : Ge, H = i({}), Ye = n((e, t) => T(e, {
69
+ ...H.current,
70
70
  ...t
71
- }), [E]), H = r(async (e) => {
72
- if (!x) {
73
- qe();
71
+ }), [T]), U = n(async (e) => {
72
+ if (!b) {
73
+ P();
74
74
  return;
75
75
  }
76
- await E([v], V.current, { fresh: e });
76
+ await T([_], H.current, { fresh: e });
77
77
  }, [
78
- x,
79
- qe,
80
- E,
81
- v
82
- ]), U = r(() => H(!0), [H]), Ze = r(() => H(!1), [H]);
83
- we({
84
- id: v,
85
- url: L && u ? u : void 0,
86
- enabled: x && S,
87
- active: y,
88
- refresh: U
78
+ b,
79
+ P,
80
+ T,
81
+ _
82
+ ]), W = n(() => U(!0), [U]), Xe = n(() => U(!1), [U]);
83
+ Te({
84
+ id: _,
85
+ url: R && l ? l : void 0,
86
+ enabled: b && x,
87
+ active: v,
88
+ refresh: W
89
89
  });
90
- let W = r(async ({ input: e } = {}) => {
91
- let t = ae(e);
92
- t && (V.current = t), await U();
93
- }, [U]), G = r(() => {
94
- if (x) {
95
- D();
90
+ let G = n(async ({ input: e } = {}) => {
91
+ let t = oe(e);
92
+ t && (H.current = t), await W();
93
+ }, [W]), K = n(() => {
94
+ if (b) {
95
+ E();
96
96
  return;
97
97
  }
98
- P();
98
+ F();
99
99
  }, [
100
- x,
101
- D,
102
- P
103
- ]), [Qe] = ge(`schema.flat.${v}.attributes.input`, { mode: "mount" });
104
- le({
105
- enabled: x && S,
106
- input: Ie,
107
- savedInput: Qe,
108
- performQuery: W
109
- }), ce({
110
- seconds: Ne,
111
- enabled: y && (x ? S && !F : N),
112
- refresh: Ze
100
+ b,
101
+ E,
102
+ F
103
+ ]), [Ze] = _e(`schema.flat.${_}.attributes.input`, { mode: "mount" });
104
+ ue({
105
+ enabled: b && x,
106
+ input: Le,
107
+ savedInput: Ze,
108
+ performQuery: G
109
+ }), le({
110
+ seconds: Pe,
111
+ enabled: v && (b ? x && !I : M),
112
+ refresh: Xe
113
113
  });
114
- let K = R, $e = i(() => Array.isArray(K.records) ? K.records : [], [K.records]), { records: q, isLoadingMore: J, goToPage: Y, loadMore: et } = ue({
115
- elementId: v,
116
- mode: De,
117
- pageParam: Oe,
118
- records: $e,
119
- page: K.pageInfo?.page ?? 1,
120
- refresh: Xe,
121
- navigate: Ve
122
- }), X = ie({
123
- serverMode: x,
124
- isSuccess: Je,
125
- isError: Ye,
126
- rscResolved: S,
127
- rscPending: F,
128
- elementData: T
129
- }), Z = a(void 0);
130
- me(() => {
131
- !z && v && X && (Z.current?.data !== R || Z.current.outcome !== X) && (Z.current = {
132
- data: R,
114
+ let q = z, Qe = r(() => Array.isArray(q.records) ? q.records : [], [q.records]), { records: J, isLoadingMore: Y, goToPage: $e, loadMore: et } = de({
115
+ elementId: _,
116
+ mode: Oe,
117
+ pageParam: ke,
118
+ records: Qe,
119
+ page: q.pageInfo?.page ?? 1,
120
+ refresh: Ye,
121
+ navigate: He
122
+ }), X = ae({
123
+ serverMode: b,
124
+ isSuccess: qe,
125
+ isError: Je,
126
+ rscResolved: x,
127
+ rscPending: I,
128
+ elementData: w
129
+ }), Z = i(void 0);
130
+ he(() => {
131
+ !B && _ && X && (Z.current?.data !== z || Z.current.outcome !== X) && (Z.current = {
132
+ data: z,
133
133
  outcome: X
134
- }, A.interactionTrigger(v, X === "success" ? "onApiSuccess" : "onApiError", {
135
- url: u,
136
- method: d,
137
- ...R
134
+ }, k.interactionTrigger(_, X === "success" ? "onApiSuccess" : "onApiError", {
135
+ url: l,
136
+ method: u,
137
+ ...z
138
138
  }));
139
139
  }, [
140
- R,
141
- v,
142
- A,
143
140
  z,
144
- d,
141
+ _,
142
+ k,
143
+ B,
144
+ u,
145
145
  X,
146
- u
146
+ l
147
147
  ]);
148
- let Q = i(() => ({
149
- ...R,
150
- ...Array.isArray(K.records) ? { records: q } : o,
151
- isLoading: z || J,
152
- isEmpty: ne(K, q, g),
153
- hasError: I,
154
- errorMessage: I ? "The data provider could not be reached" : "",
155
- isStale: x && C
148
+ let Q = r(() => ({
149
+ ...z,
150
+ ...Array.isArray(q.records) ? { records: J } : a,
151
+ isLoading: B || Y,
152
+ isEmpty: re(q, J, h),
153
+ hasError: L,
154
+ errorMessage: L ? "The data provider could not be reached" : "",
155
+ isStale: b && S
156
156
  }), [
157
- R,
158
- K.records,
159
- K.record,
160
- q,
161
157
  z,
158
+ q.records,
159
+ q.record,
162
160
  J,
163
- g,
164
- I,
165
- x,
166
- C
167
- ]), tt = r(() => fe(Q), [Q]);
168
- Se({
169
- id: v,
170
- source: O,
171
- name: b || `API - ${v}`,
161
+ B,
162
+ Y,
163
+ h,
164
+ L,
165
+ b,
166
+ S
167
+ ]), tt = n(() => pe(Q), [Q]);
168
+ Ce({
169
+ id: _,
170
+ source: D,
171
+ name: y || `API - ${_}`,
172
172
  fields: tt
173
173
  });
174
- let { writeRecord: $ } = de({
175
- elementId: v,
176
- enabled: x,
177
- onDone: U
178
- }), nt = i(() => {
179
- let e = {
174
+ let { writeRecord: $ } = fe({
175
+ elementId: _,
176
+ enabled: b,
177
+ onDone: W
178
+ }), nt = r(() => {
179
+ let t = {
180
180
  performQuery: {
181
- ...n.callbacks.performQuery,
182
- title: `Perform Query ${b}`,
183
- callback: W
181
+ ...e.callbacks.performQuery,
182
+ title: `Perform Query ${y}`,
183
+ callback: G
184
184
  },
185
185
  cancelQuery: {
186
- ...n.callbacks.cancelQuery,
187
- title: `Cancel Query ${b}`,
188
- callback: G
186
+ ...e.callbacks.cancelQuery,
187
+ title: `Cancel Query ${y}`,
188
+ callback: K
189
189
  },
190
190
  loadMore: {
191
- ...n.callbacks.loadMore,
192
- title: `Load More ${b}`,
191
+ ...e.callbacks.loadMore,
192
+ title: `Load More ${y}`,
193
193
  callback: et
194
194
  },
195
195
  goToPage: {
196
- ...n.callbacks.goToPage,
197
- title: `Go To Page ${b}`,
198
- callback: ({ page: e }) => Y(Number(e) || 1)
196
+ ...e.callbacks.goToPage,
197
+ title: `Go To Page ${y}`,
198
+ callback: ({ page: e }) => $e(Number(e) || 1)
199
199
  }
200
200
  };
201
- return x && (e.writeRecord = {
202
- ...n.callbacks.writeRecord,
203
- title: `Write Record ${b}`,
201
+ return b && (t.writeRecord = {
202
+ ...e.callbacks.writeRecord,
203
+ title: `Write Record ${y}`,
204
204
  callback: $
205
- }), e;
205
+ }), t;
206
206
  }, [
207
- b,
208
- W,
207
+ y,
209
208
  G,
209
+ K,
210
210
  et,
211
- Y,
212
- x,
211
+ $e,
212
+ b,
213
213
  $
214
- ]), rt = i(() => _ && k ? re(l, _, B) : l, [
215
- l,
216
- B,
217
- _,
218
- k
219
- ]), it = i(() => O ? { runtime: { sources: { [O]: Q } } } : o, [Q, O]);
220
- return /* @__PURE__ */ s(te, {
221
- ref: e,
222
- tag: !k && !Re?.length ? "div" : Te,
223
- className: be("plitzi-component__api-container", c),
224
- interactionTriggers: n.triggers,
214
+ ]), rt = r(() => g && O ? ie(c, g, V) : c, [
215
+ c,
216
+ V,
217
+ g,
218
+ O
219
+ ]), it = r(() => D ? { runtime: { sources: { [D]: Q } } } : a, [Q, D]);
220
+ return /* @__PURE__ */ o(ne, {
221
+ ref: t,
222
+ tag: !O && !ze?.length ? "div" : Ee,
223
+ className: xe("plitzi-component__api-container", s),
224
+ interactionTriggers: e.triggers,
225
225
  interactionCallbacks: nt,
226
- children: (!B || ke || _) && /* @__PURE__ */ s(ve, {
226
+ children: (!V || Ae || g) && /* @__PURE__ */ o(ye, {
227
227
  inherit: "live",
228
- name: `Api:${v}`,
228
+ name: `Api:${_}`,
229
229
  value: it,
230
230
  children: rt
231
231
  })
232
232
  });
233
- }, l = e(c);
233
+ }, c = t(s);
234
234
  //#endregion
235
- export { c as ApiContainer, l as default };
235
+ export { s as ApiContainer, c as default };
@@ -11,6 +11,7 @@ declare const declaration: {
11
11
  readonly pagination: readonly string[];
12
12
  };
13
13
  readonly sourceType: "apiContainer";
14
+ readonly serverTemplates: readonly ["notFound"];
14
15
  readonly triggers: {
15
16
  readonly onApiError: {
16
17
  readonly action: "onApiError";
@@ -174,24 +175,24 @@ declare const declaration: {
174
175
  headers?: Record<string, string> | undefined;
175
176
  notFound?: string | undefined;
176
177
  subType?: "div" | "header" | "footer" | "nav" | "main" | "section" | "article" | "aside" | "address" | "figure" | "" | undefined;
178
+ credentials?: RequestCredentials | undefined;
179
+ staleTime?: number | string | undefined;
180
+ gcTime?: number | string | undefined;
181
+ pageParam?: string | undefined;
177
182
  query?: string | undefined;
178
183
  accessToken?: string | undefined;
179
184
  mockData?: (Record<string, unknown> | string) | undefined;
180
- credentials?: RequestCredentials | undefined;
185
+ singleRecord?: boolean | undefined;
186
+ pagination?: import('./hooks/useProviderPagination').ProviderPagination | undefined;
187
+ renderWhileLoading?: boolean | undefined;
188
+ loadingSlot?: string | undefined;
189
+ refreshSeconds?: number | string | undefined;
181
190
  connector?: string | undefined;
182
191
  limit?: string | undefined;
183
- singleRecord?: boolean | undefined;
184
192
  filters?: {
185
193
  field: string;
186
194
  operator: string;
187
195
  value: string;
188
196
  }[] | undefined;
189
- pagination?: import('./hooks/useProviderPagination').ProviderPagination | undefined;
190
- pageParam?: string | undefined;
191
- renderWhileLoading?: boolean | undefined;
192
- loadingSlot?: string | undefined;
193
- staleTime?: number | string | undefined;
194
- gcTime?: number | string | undefined;
195
- refreshSeconds?: number | string | undefined;
196
197
  }>>;
197
198
  export default declaration;
@@ -35,6 +35,7 @@ var n = e()({
35
35
  ])
36
36
  },
37
37
  sourceType: "apiContainer",
38
+ serverTemplates: ["notFound"],
38
39
  triggers: {
39
40
  onApiError: {
40
41
  action: "onApiError",
@@ -10,6 +10,7 @@ declare const ApiContainer: {
10
10
  readonly pagination: readonly string[];
11
11
  };
12
12
  readonly sourceType: "apiContainer";
13
+ readonly serverTemplates: readonly ["notFound"];
13
14
  readonly triggers: {
14
15
  readonly onApiError: {
15
16
  readonly action: "onApiError";
@@ -173,24 +174,24 @@ declare const ApiContainer: {
173
174
  headers?: Record<string, string> | undefined;
174
175
  notFound?: string | undefined;
175
176
  subType?: "div" | "header" | "footer" | "nav" | "main" | "section" | "article" | "aside" | "address" | "figure" | "" | undefined;
177
+ credentials?: RequestCredentials | undefined;
178
+ staleTime?: number | string | undefined;
179
+ gcTime?: number | string | undefined;
180
+ pageParam?: string | undefined;
176
181
  query?: string | undefined;
177
182
  accessToken?: string | undefined;
178
183
  mockData?: (Record<string, unknown> | string) | undefined;
179
- credentials?: RequestCredentials | undefined;
184
+ singleRecord?: boolean | undefined;
185
+ pagination?: import('./hooks/useProviderPagination').ProviderPagination | undefined;
186
+ renderWhileLoading?: boolean | undefined;
187
+ loadingSlot?: string | undefined;
188
+ refreshSeconds?: number | string | undefined;
180
189
  connector?: string | undefined;
181
190
  limit?: string | undefined;
182
- singleRecord?: boolean | undefined;
183
191
  filters?: {
184
192
  field: string;
185
193
  operator: string;
186
194
  value: string;
187
195
  }[] | undefined;
188
- pagination?: import('./hooks/useProviderPagination').ProviderPagination | undefined;
189
- pageParam?: string | undefined;
190
- renderWhileLoading?: boolean | undefined;
191
- loadingSlot?: string | undefined;
192
- staleTime?: number | string | undefined;
193
- gcTime?: number | string | undefined;
194
- refreshSeconds?: number | string | undefined;
195
196
  }>>;
196
197
  export default ApiContainer;
@@ -1,8 +1,8 @@
1
- import e from "../../../Element/hocs/withElement.mjs";
2
- import t from "../../../Element/hooks/useElement.mjs";
3
- import { RootElement as n } from "../../../Element/RootElement.mjs";
4
- import r from "../../../dataSource/pathFields.mjs";
5
- import i from "./declaration.mjs";
1
+ import e from "./declaration.mjs";
2
+ import t from "../../../Element/hocs/withElement.mjs";
3
+ import n from "../../../Element/hooks/useElement.mjs";
4
+ import { RootElement as r } from "../../../Element/RootElement.mjs";
5
+ import i from "../../../dataSource/pathFields.mjs";
6
6
  import a from "../../../realtime/useChannel.mjs";
7
7
  import { use as o, useCallback as s, useMemo as c, useState as l } from "react";
8
8
  import u from "@plitzi/sdk-shared/hooks/usePlitziServiceContext";
@@ -25,8 +25,8 @@ var b = (e) => {
25
25
  y,
26
26
  _,
27
27
  v
28
- ]), S = ({ ref: e, className: _, children: v, topic: y = "", grant: S = "", presence: C, keep: w = 20, subType: T = "" }) => {
29
- let { id: E, definition: { label: D = "Channel" } } = t(), { settings: { previewMode: O }, contexts: { InteractionsContext: k } } = u(), { interactionsManager: A } = o(k), j = Math.max(0, Number(w) || 0), [M, N] = l([]), P = s((e) => {
28
+ ]), S = ({ ref: t, className: _, children: v, topic: y = "", grant: S = "", presence: C, keep: w = 20, subType: T = "" }) => {
29
+ let { id: E, definition: { label: D = "Channel" } } = n(), { settings: { previewMode: O }, contexts: { InteractionsContext: k } } = u(), { interactionsManager: A } = o(k), j = Math.max(0, Number(w) || 0), [M, N] = l([]), P = s((e) => {
30
30
  x.has(e.type) || (j > 0 && N((t) => [...t, e].slice(-j)), A.interactionTrigger(E, "onMessage", { ...e }));
31
31
  }, [
32
32
  E,
@@ -48,14 +48,14 @@ var b = (e) => {
48
48
  onLeave: I
49
49
  }), R = c(() => ({
50
50
  publish: {
51
- ...i.callbacks.publish,
51
+ ...e.callbacks.publish,
52
52
  callback: ({ type: e, data: t }) => typeof e == "string" && e ? L.publish(e, b(t)) : Promise.resolve(!1)
53
53
  },
54
54
  setPresence: {
55
- ...i.callbacks.setPresence,
55
+ ...e.callbacks.setPresence,
56
56
  callback: ({ data: e }) => L.setPresence(b(e))
57
57
  }
58
- }), [L]), z = h(i.sourceType, E), B = c(() => ({
58
+ }), [L]), z = h(e.sourceType, E), B = c(() => ({
59
59
  connected: L.connected,
60
60
  me: L.me ?? "",
61
61
  members: L.members,
@@ -66,7 +66,7 @@ var b = (e) => {
66
66
  L.me,
67
67
  L.members,
68
68
  M
69
- ]), V = s(() => r(B), [B]);
69
+ ]), V = s(() => i(B), [B]);
70
70
  g({
71
71
  id: E,
72
72
  source: z,
@@ -74,11 +74,11 @@ var b = (e) => {
74
74
  fields: V
75
75
  });
76
76
  let H = c(() => z ? { runtime: { sources: { [z]: B } } } : f, [B, z]);
77
- return /* @__PURE__ */ p(n, {
78
- ref: e,
77
+ return /* @__PURE__ */ p(r, {
78
+ ref: t,
79
79
  tag: T,
80
80
  className: m("plitzi-component__channel", _),
81
- interactionTriggers: i.triggers,
81
+ interactionTriggers: e.triggers,
82
82
  interactionCallbacks: R,
83
83
  children: /* @__PURE__ */ p(d, {
84
84
  inherit: "live",
@@ -87,6 +87,6 @@ var b = (e) => {
87
87
  children: v
88
88
  })
89
89
  });
90
- }, C = e(S);
90
+ }, C = t(S);
91
91
  //#endregion
92
92
  export { S as Channel, C as default };
@@ -130,9 +130,9 @@ declare const declaration: {
130
130
  };
131
131
  } & import('@plitzi/sdk-shared/authoring/declare').ElementAttributesBrand<Partial<{
132
132
  subType?: "" | "div" | "section" | "aside" | "main" | undefined;
133
- topic?: string | undefined;
134
133
  grant?: string | undefined;
135
134
  presence?: unknown;
135
+ topic?: string | undefined;
136
136
  keep?: number | string | undefined;
137
137
  }>>;
138
138
  export default declaration;
@@ -129,9 +129,9 @@ declare const Channel: {
129
129
  };
130
130
  } & import('@plitzi/sdk-shared/authoring/declare').ElementAttributesBrand<Partial<{
131
131
  subType?: "" | "div" | "section" | "aside" | "main" | undefined;
132
- topic?: string | undefined;
133
132
  grant?: string | undefined;
134
133
  presence?: unknown;
134
+ topic?: string | undefined;
135
135
  keep?: number | string | undefined;
136
136
  }>>;
137
137
  export default Channel;