@plitzi/sdk-elements 0.38.9 → 0.38.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +271 -0
- package/dist/Element/hooks/useElementInternal.mjs +67 -59
- package/dist/elements/advanced/BlockHtml/index.mjs +3 -3
- package/dist/elements/advanced/BlockJsx/index.mjs +3 -3
- package/dist/elements/advanced/Custom/index.mjs +3 -3
- package/dist/elements/basic/Button/index.mjs +3 -3
- package/dist/elements/basic/ThemeToggle/ThemeToggle.mjs +13 -13
- package/dist/elements/declarations/index.d.ts +28 -16
- package/dist/elements/declarations/index.mjs +6 -6
- package/dist/elements/form/Form/Form.mjs +19 -19
- package/dist/elements/form/FormControl/FormControl.mjs +10 -10
- package/dist/elements/form/FormControl/declaration.mjs +1 -1
- package/dist/elements/internal/NotFound/index.mjs +3 -3
- package/dist/elements/internal/Page/Page.d.ts +5 -0
- package/dist/elements/internal/Page/Page.mjs +26 -25
- package/dist/elements/internal/Page/PageHead.d.ts +12 -0
- package/dist/elements/internal/Page/PageHead.mjs +29 -0
- package/dist/elements/internal/Page/declaration.d.ts +2 -0
- package/dist/elements/internal/Page/declaration.mjs +5 -0
- package/dist/elements/internal/Page/index.d.ts +2 -0
- package/dist/elements/provider/ApiContainer/ApiContainer.mjs +187 -187
- package/dist/elements/provider/ApiContainer/declaration.d.ts +10 -9
- package/dist/elements/provider/ApiContainer/declaration.mjs +1 -0
- package/dist/elements/provider/ApiContainer/index.d.ts +10 -9
- package/dist/elements/provider/Channel/Channel.mjs +58 -57
- package/dist/elements/provider/Channel/declaration.d.ts +7 -1
- package/dist/elements/provider/Channel/declaration.mjs +8 -2
- package/dist/elements/provider/Channel/index.d.ts +7 -1
- package/dist/elements/structure/Carousel/Carousel.mjs +72 -72
- package/dist/elements/structure/Carousel/CarouselTrack/index.mjs +3 -3
- package/dist/elements/structure/Carousel/declaration.d.ts +1 -1
- package/dist/elements/structure/Carousel/index.d.ts +1 -1
- package/dist/elements/structure/Container/Container.mjs +8 -8
- package/dist/elements/structure/DialogContainer/DialogContainer.mjs +14 -14
- package/dist/elements/structure/DialogContainer/declaration.d.ts +1 -2
- package/dist/elements/structure/DialogContainer/declaration.mjs +1 -2
- package/dist/elements/structure/DialogContainer/index.d.ts +1 -2
- package/dist/elements/structure/List/modes/ListControlled/ListControlled.mjs +8 -8
- package/dist/elements/structure/ModalContainer/ModalContainer.mjs +16 -16
- package/dist/elements/structure/ModalContainer/declaration.d.ts +2 -3
- package/dist/elements/structure/ModalContainer/declaration.mjs +2 -3
- package/dist/elements/structure/ModalContainer/index.d.ts +2 -3
- package/dist/elements/structure/Pagination/Pagination.mjs +10 -10
- package/dist/index.d.ts +23 -16
- package/dist/realtime/useChannel.d.ts +4 -3
- package/dist/realtime/useChannel.mjs +36 -36
- package/package.json +12 -8
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import t from "../../../Element/
|
|
3
|
-
import
|
|
4
|
-
import r from "../../../
|
|
5
|
-
import i from "
|
|
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";
|
|
@@ -12,81 +12,82 @@ import { jsx as p } from "react/jsx-runtime";
|
|
|
12
12
|
import m from "clsx";
|
|
13
13
|
import h from "@plitzi/sdk-shared/dataSource/helpers/getSourceName";
|
|
14
14
|
import g from "@plitzi/sdk-shared/dataSource/hooks/useRegisterSource";
|
|
15
|
-
import {
|
|
15
|
+
import { isTrue as _ } from "@plitzi/sdk-shared/dataSource/utility/truthiness";
|
|
16
|
+
import { JOIN_TYPE as v, LEAVE_TYPE as y, PRESENCE_TYPE as b } from "@plitzi/sdk-shared/realtime";
|
|
16
17
|
//#region src/elements/provider/Channel/Channel.tsx
|
|
17
|
-
var
|
|
18
|
+
var x = (e) => {
|
|
18
19
|
if (typeof e != "string") return e;
|
|
19
20
|
try {
|
|
20
21
|
return JSON.parse(e);
|
|
21
22
|
} catch {
|
|
22
23
|
return e;
|
|
23
24
|
}
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
]),
|
|
29
|
-
let { id:
|
|
30
|
-
|
|
25
|
+
}, S = /* @__PURE__ */ new Set([
|
|
26
|
+
b,
|
|
27
|
+
v,
|
|
28
|
+
y
|
|
29
|
+
]), C = ({ ref: t, className: v, children: y, topic: b = "", grant: C = "", presence: w, keep: T = 20, subType: E = "" }) => {
|
|
30
|
+
let { id: D, definition: { label: O = "Channel" } } = n(), { settings: { previewMode: k }, contexts: { InteractionsContext: A } } = u(), { interactionsManager: j } = o(A), M = Math.max(0, Number(T) || 0), [N, P] = l([]), F = s((e) => {
|
|
31
|
+
S.has(e.type) || (M > 0 && P((t) => [...t, e].slice(-M)), j.interactionTrigger(D, "onMessage", { ...e }));
|
|
31
32
|
}, [
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
]),
|
|
33
|
+
D,
|
|
34
|
+
j,
|
|
35
|
+
M
|
|
36
|
+
]), I = s(({ from: e, user: t, state: n }) => void j.interactionTrigger(D, "onJoin", {
|
|
36
37
|
from: e,
|
|
37
38
|
user: t ?? "",
|
|
38
39
|
state: n
|
|
39
|
-
}), [
|
|
40
|
+
}), [D, j]), L = s(({ from: e, user: t, state: n }) => void j.interactionTrigger(D, "onLeave", {
|
|
40
41
|
from: e,
|
|
41
42
|
user: t ?? "",
|
|
42
43
|
state: n
|
|
43
|
-
}), [
|
|
44
|
-
grant:
|
|
45
|
-
presence:
|
|
46
|
-
onMessage:
|
|
47
|
-
onJoin:
|
|
48
|
-
onLeave:
|
|
49
|
-
}),
|
|
44
|
+
}), [D, j]), R = a(k && b ? b : void 0, {
|
|
45
|
+
grant: C || void 0,
|
|
46
|
+
presence: w === void 0 || w === "" ? void 0 : x(w),
|
|
47
|
+
onMessage: F,
|
|
48
|
+
onJoin: I,
|
|
49
|
+
onLeave: L
|
|
50
|
+
}), z = c(() => ({
|
|
50
51
|
publish: {
|
|
51
|
-
...
|
|
52
|
-
callback: ({ type: e, data: t }) => typeof e == "string" && e ?
|
|
52
|
+
...e.callbacks.publish,
|
|
53
|
+
callback: ({ type: e, data: t, echo: n }) => typeof e == "string" && e ? R.publish(e, x(t), { echo: _(n) }) : Promise.resolve(!1)
|
|
53
54
|
},
|
|
54
55
|
setPresence: {
|
|
55
|
-
...
|
|
56
|
-
callback: ({ data: e }) =>
|
|
56
|
+
...e.callbacks.setPresence,
|
|
57
|
+
callback: ({ data: e }) => R.setPresence(x(e))
|
|
57
58
|
}
|
|
58
|
-
}), [
|
|
59
|
-
connected:
|
|
60
|
-
me:
|
|
61
|
-
members:
|
|
62
|
-
messages:
|
|
63
|
-
last:
|
|
59
|
+
}), [R]), B = h(e.sourceType, D), V = c(() => ({
|
|
60
|
+
connected: R.connected,
|
|
61
|
+
me: R.me ?? "",
|
|
62
|
+
members: R.members,
|
|
63
|
+
messages: N,
|
|
64
|
+
last: N.at(-1) ?? null
|
|
64
65
|
}), [
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
]),
|
|
66
|
+
R.connected,
|
|
67
|
+
R.me,
|
|
68
|
+
R.members,
|
|
69
|
+
N
|
|
70
|
+
]), H = s(() => i(V), [V]);
|
|
70
71
|
g({
|
|
71
|
-
id:
|
|
72
|
-
source:
|
|
73
|
-
name:
|
|
74
|
-
fields:
|
|
72
|
+
id: D,
|
|
73
|
+
source: B,
|
|
74
|
+
name: O || `Channel - ${D}`,
|
|
75
|
+
fields: H
|
|
75
76
|
});
|
|
76
|
-
let
|
|
77
|
-
return /* @__PURE__ */ p(
|
|
78
|
-
ref:
|
|
79
|
-
tag:
|
|
80
|
-
className: m("plitzi-component__channel",
|
|
81
|
-
interactionTriggers:
|
|
82
|
-
interactionCallbacks:
|
|
77
|
+
let U = c(() => B ? { runtime: { sources: { [B]: V } } } : f, [V, B]);
|
|
78
|
+
return /* @__PURE__ */ p(r, {
|
|
79
|
+
ref: t,
|
|
80
|
+
tag: E,
|
|
81
|
+
className: m("plitzi-component__channel", v),
|
|
82
|
+
interactionTriggers: e.triggers,
|
|
83
|
+
interactionCallbacks: z,
|
|
83
84
|
children: /* @__PURE__ */ p(d, {
|
|
84
85
|
inherit: "live",
|
|
85
|
-
name: `Channel:${
|
|
86
|
-
value:
|
|
87
|
-
children:
|
|
86
|
+
name: `Channel:${D}`,
|
|
87
|
+
value: U,
|
|
88
|
+
children: y
|
|
88
89
|
})
|
|
89
90
|
});
|
|
90
|
-
},
|
|
91
|
+
}, w = t(C);
|
|
91
92
|
//#endregion
|
|
92
|
-
export {
|
|
93
|
+
export { C as Channel, w as default };
|
|
@@ -20,6 +20,7 @@ declare const declaration: {
|
|
|
20
20
|
readonly from: "";
|
|
21
21
|
readonly user: "";
|
|
22
22
|
readonly at: "";
|
|
23
|
+
readonly echo: false;
|
|
23
24
|
};
|
|
24
25
|
};
|
|
25
26
|
readonly onJoin: {
|
|
@@ -62,6 +63,11 @@ declare const declaration: {
|
|
|
62
63
|
readonly defaultValue: "";
|
|
63
64
|
readonly type: "text";
|
|
64
65
|
};
|
|
66
|
+
readonly echo: {
|
|
67
|
+
readonly label: "Heard on this page too";
|
|
68
|
+
readonly defaultValue: false;
|
|
69
|
+
readonly type: "boolean";
|
|
70
|
+
};
|
|
65
71
|
};
|
|
66
72
|
};
|
|
67
73
|
readonly setPresence: {
|
|
@@ -130,9 +136,9 @@ declare const declaration: {
|
|
|
130
136
|
};
|
|
131
137
|
} & import('@plitzi/sdk-shared/authoring/declare').ElementAttributesBrand<Partial<{
|
|
132
138
|
subType?: "" | "div" | "section" | "aside" | "main" | undefined;
|
|
133
|
-
topic?: string | undefined;
|
|
134
139
|
grant?: string | undefined;
|
|
135
140
|
presence?: unknown;
|
|
141
|
+
topic?: string | undefined;
|
|
136
142
|
keep?: number | string | undefined;
|
|
137
143
|
}>>;
|
|
138
144
|
export default declaration;
|
|
@@ -21,7 +21,8 @@ var n = e()({
|
|
|
21
21
|
data: "",
|
|
22
22
|
from: "",
|
|
23
23
|
user: "",
|
|
24
|
-
at: ""
|
|
24
|
+
at: "",
|
|
25
|
+
echo: !1
|
|
25
26
|
}
|
|
26
27
|
},
|
|
27
28
|
onJoin: {
|
|
@@ -63,6 +64,11 @@ var n = e()({
|
|
|
63
64
|
label: "Data (JSON or a template)",
|
|
64
65
|
defaultValue: "",
|
|
65
66
|
type: "text"
|
|
67
|
+
},
|
|
68
|
+
echo: {
|
|
69
|
+
label: "Heard on this page too",
|
|
70
|
+
defaultValue: !1,
|
|
71
|
+
type: "boolean"
|
|
66
72
|
}
|
|
67
73
|
}
|
|
68
74
|
},
|
|
@@ -88,7 +94,7 @@ var n = e()({
|
|
|
88
94
|
definition: {
|
|
89
95
|
label: "Channel",
|
|
90
96
|
type: "channel",
|
|
91
|
-
description: "A realtime channel: every page on the same `topic` hears what
|
|
97
|
+
description: "A realtime channel: every OTHER page on the same `topic` hears what one publishes, within milliseconds — the page that sent it too with `echo` (its `from` is then the channel's `me`). The topic must match a channel the space declares in its settings (`channels`), e.g. `board:{{ id }}` under `board:{id}`. A topic of a private channel (`grant: true`) opens only with `grant`, bound to the grant the action that let this visitor in returned (its `realtime.grant` step). ITS DESCENDANTS bind to its source `channel_<id>`: `connected`, `members` (with the state each announced), `messages` (the last `keep`) and `last`. It fires `onMessage`; `onJoin` when somebody who came after this page has announced who they are, and `onLeave` when somebody goes — each with `from`, `user` and the `state` they announced; and answers `publish({ type, data, echo })` and `setPresence({ data })`; `presence` is the state this page announces (a name, a colour). Closed in the builder and anywhere without a server.",
|
|
92
98
|
items: [],
|
|
93
99
|
bindings: {},
|
|
94
100
|
styleSelectors: { base: "" },
|
|
@@ -19,6 +19,7 @@ declare const Channel: {
|
|
|
19
19
|
readonly from: "";
|
|
20
20
|
readonly user: "";
|
|
21
21
|
readonly at: "";
|
|
22
|
+
readonly echo: false;
|
|
22
23
|
};
|
|
23
24
|
};
|
|
24
25
|
readonly onJoin: {
|
|
@@ -61,6 +62,11 @@ declare const Channel: {
|
|
|
61
62
|
readonly defaultValue: "";
|
|
62
63
|
readonly type: "text";
|
|
63
64
|
};
|
|
65
|
+
readonly echo: {
|
|
66
|
+
readonly label: "Heard on this page too";
|
|
67
|
+
readonly defaultValue: false;
|
|
68
|
+
readonly type: "boolean";
|
|
69
|
+
};
|
|
64
70
|
};
|
|
65
71
|
};
|
|
66
72
|
readonly setPresence: {
|
|
@@ -129,9 +135,9 @@ declare const Channel: {
|
|
|
129
135
|
};
|
|
130
136
|
} & import('@plitzi/sdk-shared/authoring/declare').ElementAttributesBrand<Partial<{
|
|
131
137
|
subType?: "" | "div" | "section" | "aside" | "main" | undefined;
|
|
132
|
-
topic?: string | undefined;
|
|
133
138
|
grant?: string | undefined;
|
|
134
139
|
presence?: unknown;
|
|
140
|
+
topic?: string | undefined;
|
|
135
141
|
keep?: number | string | undefined;
|
|
136
142
|
}>>;
|
|
137
143
|
export default Channel;
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import t from "../../../Element/
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { rowKeys as
|
|
10
|
-
import { use as
|
|
11
|
-
import
|
|
12
|
-
import { StoreProvider as
|
|
13
|
-
import { emptyObject as
|
|
14
|
-
import { jsx as
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
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 ee } from "../../../Element/RootElement.mjs";
|
|
5
|
+
import te from "../../../dataSource/pathFields.mjs";
|
|
6
|
+
import ne from "./CarouselContext.mjs";
|
|
7
|
+
import { clampIndex as r, directionOf as i, slideStep as a, stepIndex as o } from "./carouselIndex.mjs";
|
|
8
|
+
import re from "./useAutoplay.mjs";
|
|
9
|
+
import { rowKeys as s } from "../List/modes/ListControlled/rowKeys.mjs";
|
|
10
|
+
import { use as ie, useCallback as c, useEffect as l, useMemo as u, useRef as d, useState as f } from "react";
|
|
11
|
+
import p from "@plitzi/sdk-shared/hooks/usePlitziServiceContext";
|
|
12
|
+
import { StoreProvider as m } from "@plitzi/nexus/react";
|
|
13
|
+
import { emptyObject as h } from "@plitzi/sdk-shared/helpers/utils";
|
|
14
|
+
import { jsx as g } from "react/jsx-runtime";
|
|
15
|
+
import ae from "clsx";
|
|
16
|
+
import oe from "@plitzi/sdk-shared/dataSource/helpers/getSourceName";
|
|
17
|
+
import se from "@plitzi/sdk-shared/dataSource/hooks/useRegisterSource";
|
|
18
18
|
//#region src/elements/structure/Carousel/Carousel.tsx
|
|
19
|
-
var
|
|
20
|
-
let { id: O, definition: { label: k = "Carousel" } } =
|
|
21
|
-
|
|
19
|
+
var _ = ({ ref: t, className: _ = "", children: v, items: y = [], mode: b = "slide", autoplay: x = 0, pauseOnHover: S = !0, loop: C = !0, transition: w = "slide", speed: T = 30, itemKey: E, label: D = "" }) => {
|
|
20
|
+
let { id: O, definition: { label: k = "Carousel" } } = n(), A = oe(e.sourceType, O), { settings: { previewMode: ce }, contexts: { InteractionsContext: le } } = p(), { interactionsManager: j } = ie(le), M = u(() => Array.isArray(y) ? y : [], [y]), N = u(() => s(M, E), [M, E]), P = M.length, F = !!ce, [I, L] = f(0), [R, z] = f("next"), [B, V] = f(!1), [H, U] = f(x > 0), ue = d(null), W = t ?? ue, G = d(null), K = r(I, P);
|
|
21
|
+
l(() => {
|
|
22
22
|
I !== K && L(K);
|
|
23
23
|
}, [I, K]);
|
|
24
|
-
let q =
|
|
24
|
+
let q = c((e, t) => {
|
|
25
25
|
P !== 0 && e !== K && (z(t), V(!0), L(e), j.interactionTrigger(O, "onChange", {
|
|
26
26
|
index: e,
|
|
27
27
|
item: M[e]
|
|
@@ -32,117 +32,117 @@ var v = ({ ref: e, className: v = "", children: y, items: b = [], mode: x = "sli
|
|
|
32
32
|
O,
|
|
33
33
|
j,
|
|
34
34
|
M
|
|
35
|
-
]), J =
|
|
36
|
-
let t = G.current, n = t ?
|
|
35
|
+
]), J = c((e) => {
|
|
36
|
+
let t = G.current, n = t ? a(t) : 0;
|
|
37
37
|
t && n > 0 && t.scrollBy({
|
|
38
38
|
left: e * n,
|
|
39
39
|
behavior: "smooth"
|
|
40
40
|
});
|
|
41
|
-
}, []), Y =
|
|
42
|
-
if (
|
|
41
|
+
}, []), Y = c(() => {
|
|
42
|
+
if (b === "scroll") {
|
|
43
43
|
J(1);
|
|
44
44
|
return;
|
|
45
45
|
}
|
|
46
|
-
q(
|
|
46
|
+
q(o(K, P, 1, C), "next");
|
|
47
47
|
}, [
|
|
48
48
|
P,
|
|
49
49
|
K,
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
C,
|
|
51
|
+
b,
|
|
52
52
|
q,
|
|
53
53
|
J
|
|
54
|
-
]), X =
|
|
55
|
-
if (
|
|
54
|
+
]), X = c(() => {
|
|
55
|
+
if (b === "scroll") {
|
|
56
56
|
J(-1);
|
|
57
57
|
return;
|
|
58
58
|
}
|
|
59
|
-
q(
|
|
59
|
+
q(o(K, P, -1, C), "previous");
|
|
60
60
|
}, [
|
|
61
61
|
P,
|
|
62
62
|
K,
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
C,
|
|
64
|
+
b,
|
|
65
65
|
q,
|
|
66
66
|
J
|
|
67
|
-
]), Z =
|
|
68
|
-
let t =
|
|
69
|
-
if (
|
|
67
|
+
]), Z = c((e) => {
|
|
68
|
+
let t = r(e.index, P);
|
|
69
|
+
if (b === "scroll") {
|
|
70
70
|
J(t - K);
|
|
71
71
|
return;
|
|
72
72
|
}
|
|
73
|
-
q(t,
|
|
73
|
+
q(t, i(K, t));
|
|
74
74
|
}, [
|
|
75
75
|
P,
|
|
76
76
|
K,
|
|
77
|
-
|
|
77
|
+
b,
|
|
78
78
|
q,
|
|
79
79
|
J
|
|
80
|
-
]), Q =
|
|
81
|
-
e !== K && q(e,
|
|
80
|
+
]), Q = c((e) => {
|
|
81
|
+
e !== K && q(e, i(K, e));
|
|
82
82
|
}, [K, q]);
|
|
83
|
-
|
|
84
|
-
delay:
|
|
83
|
+
re({
|
|
84
|
+
delay: b === "slide" ? x : 0,
|
|
85
85
|
active: F && H && P > 1,
|
|
86
86
|
rootRef: W,
|
|
87
|
-
pauseOnHover:
|
|
87
|
+
pauseOnHover: S,
|
|
88
88
|
position: K,
|
|
89
89
|
onTick: Y
|
|
90
90
|
});
|
|
91
|
-
let de =
|
|
91
|
+
let de = u(() => ({
|
|
92
92
|
next: {
|
|
93
|
-
...
|
|
93
|
+
...e.callbacks.next,
|
|
94
94
|
callback: Y
|
|
95
95
|
},
|
|
96
96
|
previous: {
|
|
97
|
-
...
|
|
97
|
+
...e.callbacks.previous,
|
|
98
98
|
callback: X
|
|
99
99
|
},
|
|
100
100
|
goTo: {
|
|
101
|
-
...
|
|
101
|
+
...e.callbacks.goTo,
|
|
102
102
|
callback: Z
|
|
103
103
|
},
|
|
104
104
|
play: {
|
|
105
|
-
...
|
|
105
|
+
...e.callbacks.play,
|
|
106
106
|
callback: () => U(!0)
|
|
107
107
|
},
|
|
108
108
|
pause: {
|
|
109
|
-
...
|
|
109
|
+
...e.callbacks.pause,
|
|
110
110
|
callback: () => U(!1)
|
|
111
111
|
}
|
|
112
112
|
}), [
|
|
113
113
|
Z,
|
|
114
114
|
Y,
|
|
115
115
|
X
|
|
116
|
-
]), $ =
|
|
116
|
+
]), $ = u(() => ({
|
|
117
117
|
items: M,
|
|
118
118
|
count: P,
|
|
119
119
|
index: K,
|
|
120
120
|
item: M[K],
|
|
121
|
-
playing: H &&
|
|
121
|
+
playing: H && x > 0
|
|
122
122
|
}), [
|
|
123
|
-
|
|
123
|
+
x,
|
|
124
124
|
P,
|
|
125
125
|
K,
|
|
126
126
|
M,
|
|
127
127
|
H
|
|
128
|
-
]), fe =
|
|
129
|
-
|
|
128
|
+
]), fe = c(() => te($), [$]);
|
|
129
|
+
se({
|
|
130
130
|
id: O,
|
|
131
131
|
source: A,
|
|
132
132
|
name: k || `Carousel - ${O}`,
|
|
133
133
|
fields: fe
|
|
134
134
|
});
|
|
135
|
-
let pe =
|
|
135
|
+
let pe = u(() => A ? { runtime: { sources: { [A]: $ } } } : h, [A, $]), me = u(() => ({
|
|
136
136
|
source: A,
|
|
137
137
|
items: M,
|
|
138
138
|
keys: N,
|
|
139
139
|
index: K,
|
|
140
140
|
direction: R,
|
|
141
141
|
moved: B,
|
|
142
|
-
mode:
|
|
143
|
-
transition:
|
|
144
|
-
speed:
|
|
145
|
-
pauseOnHover:
|
|
142
|
+
mode: b,
|
|
143
|
+
transition: w,
|
|
144
|
+
speed: T,
|
|
145
|
+
pauseOnHover: S,
|
|
146
146
|
live: F,
|
|
147
147
|
scrollerRef: G,
|
|
148
148
|
onScrolledTo: Q
|
|
@@ -152,32 +152,32 @@ var v = ({ ref: e, className: v = "", children: y, items: b = [], mode: x = "sli
|
|
|
152
152
|
N,
|
|
153
153
|
M,
|
|
154
154
|
F,
|
|
155
|
-
|
|
155
|
+
b,
|
|
156
156
|
B,
|
|
157
157
|
Q,
|
|
158
|
-
|
|
158
|
+
S,
|
|
159
159
|
A,
|
|
160
|
-
|
|
161
|
-
|
|
160
|
+
T,
|
|
161
|
+
w
|
|
162
162
|
]);
|
|
163
|
-
return /* @__PURE__ */
|
|
163
|
+
return /* @__PURE__ */ g(ee, {
|
|
164
164
|
ref: W,
|
|
165
|
-
className:
|
|
165
|
+
className: ae("plitzi-component__carousel", `carousel--${b}`, _),
|
|
166
166
|
role: "region",
|
|
167
167
|
"aria-roledescription": "carousel",
|
|
168
|
-
"aria-label":
|
|
169
|
-
interactionTriggers:
|
|
168
|
+
"aria-label": D || void 0,
|
|
169
|
+
interactionTriggers: e.triggers,
|
|
170
170
|
interactionCallbacks: de,
|
|
171
|
-
children: /* @__PURE__ */
|
|
171
|
+
children: /* @__PURE__ */ g(m, {
|
|
172
172
|
inherit: "live",
|
|
173
173
|
name: `Carousel:${O}`,
|
|
174
174
|
value: pe,
|
|
175
|
-
children: /* @__PURE__ */
|
|
175
|
+
children: /* @__PURE__ */ g(ne, {
|
|
176
176
|
value: me,
|
|
177
|
-
children:
|
|
177
|
+
children: v
|
|
178
178
|
})
|
|
179
179
|
})
|
|
180
180
|
});
|
|
181
|
-
},
|
|
181
|
+
}, v = t(_);
|
|
182
182
|
//#endregion
|
|
183
|
-
export {
|
|
183
|
+
export { _ as Carousel, v as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import e from "./
|
|
2
|
-
import t from "./
|
|
1
|
+
import e from "./declaration.mjs";
|
|
2
|
+
import t from "./CarouselTrack.mjs";
|
|
3
3
|
//#region src/elements/structure/Carousel/CarouselTrack/index.ts
|
|
4
|
-
var n = Object.assign(
|
|
4
|
+
var n = Object.assign(t, e);
|
|
5
5
|
//#endregion
|
|
6
6
|
export { n as default };
|
|
@@ -123,8 +123,8 @@ declare const declaration: {
|
|
|
123
123
|
items?: unknown[] | undefined;
|
|
124
124
|
speed?: number | undefined;
|
|
125
125
|
loop?: boolean | undefined;
|
|
126
|
-
autoplay?: number | undefined;
|
|
127
126
|
pauseOnHover?: boolean | undefined;
|
|
127
|
+
autoplay?: number | undefined;
|
|
128
128
|
transition?: import('./CarouselContext').CarouselTransition | undefined;
|
|
129
129
|
itemKey?: string | undefined;
|
|
130
130
|
}>>;
|
|
@@ -178,8 +178,8 @@ declare const Carousel: {
|
|
|
178
178
|
items?: unknown[] | undefined;
|
|
179
179
|
speed?: number | undefined;
|
|
180
180
|
loop?: boolean | undefined;
|
|
181
|
-
autoplay?: number | undefined;
|
|
182
181
|
pauseOnHover?: boolean | undefined;
|
|
182
|
+
autoplay?: number | undefined;
|
|
183
183
|
transition?: import('./CarouselContext').CarouselTransition | undefined;
|
|
184
184
|
itemKey?: string | undefined;
|
|
185
185
|
}>;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
1
|
+
import { NAMEABLE_CONTAINER_TAGS as e } from "./declaration.mjs";
|
|
2
|
+
import t from "../../../Element/hocs/withElement.mjs";
|
|
3
|
+
import { RootElement as n } from "../../../Element/RootElement.mjs";
|
|
4
4
|
import { jsx as r } from "react/jsx-runtime";
|
|
5
5
|
import i from "clsx";
|
|
6
6
|
//#region src/elements/structure/Container/Container.tsx
|
|
7
|
-
var a = ({ ref:
|
|
8
|
-
let f = !c && s &&
|
|
7
|
+
var a = ({ ref: t, className: a = "", subType: o = "div", label: s = "", decorative: c = !1, live: l = "", title: u = "", children: d }) => {
|
|
8
|
+
let f = !c && s && e.includes(o) ? {
|
|
9
9
|
"aria-label": s,
|
|
10
10
|
...o === "div" ? { role: "group" } : {}
|
|
11
11
|
} : {}, p = c ? { "aria-hidden": !0 } : {}, m = l ? { "aria-live": l } : {};
|
|
12
|
-
return /* @__PURE__ */ r(
|
|
13
|
-
ref:
|
|
12
|
+
return /* @__PURE__ */ r(n, {
|
|
13
|
+
ref: t,
|
|
14
14
|
tag: o,
|
|
15
15
|
className: i(`plitzi-component__container plitzi-component__container-${o}`, a),
|
|
16
16
|
title: u || void 0,
|
|
@@ -19,6 +19,6 @@ var a = ({ ref: e, className: a = "", subType: o = "div", label: s = "", decorat
|
|
|
19
19
|
...m,
|
|
20
20
|
children: d
|
|
21
21
|
});
|
|
22
|
-
}, o =
|
|
22
|
+
}, o = t(a);
|
|
23
23
|
//#endregion
|
|
24
24
|
export { a as Container, o as default };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import t from "../../../Element/
|
|
3
|
-
import
|
|
4
|
-
import r from "../../../
|
|
5
|
-
import i from "
|
|
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 "../ModalContainer/useModalDialog.mjs";
|
|
7
7
|
import { use as o, useCallback as s, useEffect as c, useMemo as l, useRef as u, useState as d } from "react";
|
|
8
8
|
import f from "@plitzi/sdk-shared/hooks/usePlitziServiceContext";
|
|
@@ -13,8 +13,8 @@ import _ from "clsx";
|
|
|
13
13
|
import v from "@plitzi/sdk-shared/dataSource/helpers/getSourceName";
|
|
14
14
|
import y from "@plitzi/sdk-shared/dataSource/hooks/useRegisterSource";
|
|
15
15
|
//#region src/elements/structure/DialogContainer/DialogContainer.tsx
|
|
16
|
-
var b = ({ ref:
|
|
17
|
-
let { id: D, rootId: O, visible: k, setElementState: A, definition: { styleSelectors: j, label: M = "Dialog" }, elementState: N } =
|
|
16
|
+
var b = ({ ref: t, className: b = "", children: x, headerLabel: S = "Dialog Header", acceptButtonLabel: C = "Accept", acceptButtonLabelLoading: w = "Loading...", rejectButtonLabel: T = "Cancel", autoHideAfterClick: E = !0 }) => {
|
|
17
|
+
let { id: D, rootId: O, visible: k, setElementState: A, definition: { styleSelectors: j, label: M = "Dialog" }, elementState: N } = n(), P = v(e.sourceType, D), { settings: { previewMode: F }, contexts: { InteractionsContext: I } } = f(), { interactionsManager: L } = o(I), [R, z] = d({}), [B, V] = d(!1), H = u(null), U = `${O}_${D}_title`, W = s((e) => {
|
|
18
18
|
let { metadata: t } = e;
|
|
19
19
|
if (t && typeof t == "object") z(t);
|
|
20
20
|
else if (typeof t == "string") try {
|
|
@@ -72,12 +72,12 @@ var b = ({ ref: e, className: b = "", children: x, headerLabel: S = "Dialog Head
|
|
|
72
72
|
A
|
|
73
73
|
]), Y = l(() => ({
|
|
74
74
|
openDialog: {
|
|
75
|
-
...
|
|
75
|
+
...e.callbacks.openDialog,
|
|
76
76
|
title: `Open ${M}`,
|
|
77
77
|
callback: W
|
|
78
78
|
},
|
|
79
79
|
closeDialog: {
|
|
80
|
-
...
|
|
80
|
+
...e.callbacks.closeDialog,
|
|
81
81
|
title: `Close ${M}`,
|
|
82
82
|
callback: G
|
|
83
83
|
}
|
|
@@ -98,7 +98,7 @@ var b = ({ ref: e, className: b = "", children: x, headerLabel: S = "Dialog Head
|
|
|
98
98
|
R,
|
|
99
99
|
N.visibility
|
|
100
100
|
]);
|
|
101
|
-
let X = s(() =>
|
|
101
|
+
let X = s(() => i(R), [R]);
|
|
102
102
|
y({
|
|
103
103
|
id: D,
|
|
104
104
|
source: P,
|
|
@@ -106,10 +106,10 @@ var b = ({ ref: e, className: b = "", children: x, headerLabel: S = "Dialog Head
|
|
|
106
106
|
fields: X
|
|
107
107
|
});
|
|
108
108
|
let Z = l(() => P ? { runtime: { sources: { [P]: R } } } : m, [P, R]);
|
|
109
|
-
return /* @__PURE__ */ g(
|
|
110
|
-
ref:
|
|
109
|
+
return /* @__PURE__ */ g(r, {
|
|
110
|
+
ref: t,
|
|
111
111
|
className: _("plitzi-component__dialog-container", b),
|
|
112
|
-
interactionTriggers:
|
|
112
|
+
interactionTriggers: e.triggers,
|
|
113
113
|
interactionCallbacks: Y,
|
|
114
114
|
children: [/* @__PURE__ */ h("div", {
|
|
115
115
|
className: _("dialog-container__background", j.backgroundContainer),
|
|
@@ -175,6 +175,6 @@ var b = ({ ref: e, className: b = "", children: x, headerLabel: S = "Dialog Head
|
|
|
175
175
|
]
|
|
176
176
|
})]
|
|
177
177
|
});
|
|
178
|
-
}, x =
|
|
178
|
+
}, x = t(b);
|
|
179
179
|
//#endregion
|
|
180
180
|
export { b as DialogContainer, x as default };
|
|
@@ -156,8 +156,7 @@ declare const declaration: {
|
|
|
156
156
|
readonly top: "0";
|
|
157
157
|
readonly position: "absolute";
|
|
158
158
|
readonly 'z-index': "210";
|
|
159
|
-
readonly 'background-color': "
|
|
160
|
-
readonly opacity: "0.5";
|
|
159
|
+
readonly 'background-color': "rgb(0 0 0 / 50%)";
|
|
161
160
|
};
|
|
162
161
|
};
|
|
163
162
|
readonly rootContainer: {
|