@plitzi/sdk-elements 0.38.3 → 0.38.5
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 +539 -0
- package/dist/Element/helpers/elementChildren.d.ts +29 -0
- package/dist/Element/helpers/elementChildren.mjs +16 -0
- package/dist/Element/hooks/useElementVisible.d.ts +11 -0
- package/dist/Element/hooks/useElementVisible.mjs +25 -0
- package/dist/Element/hooks/useRscData.d.ts +4 -0
- package/dist/Element/hooks/useRscData.mjs +23 -19
- package/dist/dataSource/GlobalSources.mjs +68 -57
- package/dist/elements/basic/Button/Button.d.ts +6 -1
- package/dist/elements/basic/Button/Button.mjs +9 -8
- package/dist/elements/basic/Button/declaration.d.ts +2 -1
- package/dist/elements/basic/Button/declaration.mjs +1 -1
- package/dist/elements/basic/Button/index.d.ts +2 -1
- package/dist/elements/basic/Dropdown/DropdownPopup/declaration.d.ts +1 -1
- package/dist/elements/basic/Dropdown/DropdownPopup/declaration.mjs +1 -1
- package/dist/elements/basic/Dropdown/DropdownPopup/index.d.ts +1 -1
- package/dist/elements/basic/Dropdown/index.d.ts +1 -1
- package/dist/elements/basic/Markdown/Markdown.d.ts +3 -3
- package/dist/elements/basic/Markdown/Markdown.mjs +10 -6
- package/dist/elements/basic/Markdown/declaration.d.ts +1 -1
- package/dist/elements/basic/Markdown/index.d.ts +1 -1
- package/dist/elements/basic/RichText/declaration.d.ts +1 -1
- package/dist/elements/basic/RichText/declaration.mjs +1 -1
- package/dist/elements/basic/RichText/index.d.ts +1 -1
- package/dist/elements/basic/Text/Text.d.ts +6 -1
- package/dist/elements/basic/Text/Text.mjs +6 -5
- package/dist/elements/basic/Text/declaration.d.ts +1 -0
- package/dist/elements/basic/Text/index.d.ts +1 -0
- package/dist/elements/declarations/index.d.ts +55 -11
- package/dist/elements/form/Form/declaration.d.ts +1 -0
- package/dist/elements/form/Form/declaration.mjs +2 -1
- package/dist/elements/form/FormControl/FormControl.d.ts +5 -1
- package/dist/elements/form/FormControl/FormControl.mjs +3 -0
- package/dist/elements/form/FormControl/Settings.d.ts +1 -1
- package/dist/elements/form/FormControl/Settings.mjs +16 -1
- package/dist/elements/form/FormControl/declaration.d.ts +1 -0
- package/dist/elements/form/FormControl/declaration.mjs +6 -2
- package/dist/elements/internal/LayoutContainer/LayoutContainer.mjs +37 -29
- package/dist/elements/internal/LayoutContainer/mask.d.ts +11 -0
- package/dist/elements/internal/LayoutContainer/mask.mjs +14 -0
- package/dist/elements/media/Image/Image.d.ts +7 -1
- package/dist/elements/media/Image/Image.mjs +10 -10
- package/dist/elements/media/Image/declaration.d.ts +2 -1
- package/dist/elements/media/Image/declaration.mjs +1 -1
- package/dist/elements/media/Image/index.d.ts +2 -1
- package/dist/elements/provider/ApiContainer/ApiContainer.d.ts +9 -1
- package/dist/elements/provider/ApiContainer/ApiContainer.mjs +172 -155
- package/dist/elements/provider/ApiContainer/declaration.d.ts +38 -10
- package/dist/elements/provider/ApiContainer/declaration.mjs +7 -0
- package/dist/elements/provider/ApiContainer/helpers/serverMock.d.ts +10 -0
- package/dist/elements/provider/ApiContainer/helpers/serverMock.mjs +17 -0
- package/dist/elements/provider/ApiContainer/hooks/useApi.d.ts +2 -0
- package/dist/elements/provider/ApiContainer/hooks/useApi.mjs +1 -0
- package/dist/elements/provider/ApiContainer/hooks/useInputRefresh.d.ts +20 -0
- package/dist/elements/provider/ApiContainer/hooks/useInputRefresh.mjs +16 -0
- package/dist/elements/provider/ApiContainer/index.d.ts +37 -1
- package/dist/elements/structure/Container/Container.d.ts +13 -2
- package/dist/elements/structure/Container/Container.mjs +8 -6
- package/dist/elements/structure/Container/declaration.d.ts +5 -2
- package/dist/elements/structure/Container/declaration.mjs +32 -24
- package/dist/elements/structure/Container/index.d.ts +5 -2
- package/dist/elements/structure/DialogContainer/declaration.d.ts +1 -1
- package/dist/elements/structure/DialogContainer/declaration.mjs +1 -1
- package/dist/elements/structure/DialogContainer/index.d.ts +1 -1
- package/dist/elements/structure/List/ListItem/declaration.d.ts +1 -1
- package/dist/elements/structure/List/ListItem/declaration.mjs +1 -1
- package/dist/elements/structure/List/ListItem/index.d.ts +1 -1
- package/dist/elements/structure/List/index.d.ts +1 -1
- package/dist/elements/structure/TabContainer/TabContainerItem/declaration.d.ts +1 -1
- package/dist/elements/structure/TabContainer/TabContainerItem/declaration.mjs +1 -1
- package/dist/elements/structure/TabContainer/TabContainerItem/index.d.ts +1 -1
- package/dist/elements/structure/TabContainer/index.d.ts +1 -1
- package/dist/index.d.ts +53 -11
- package/package.json +25 -9
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useEffect as e, useState as t } from "react";
|
|
2
|
+
import n from "@plitzi/sdk-shared/hooks/usePlitziServiceContext";
|
|
3
|
+
//#region src/Element/hooks/useElementVisible.ts
|
|
4
|
+
var r = (e) => typeof e.checkVisibility == "function" ? e.checkVisibility() : e.getClientRects().length > 0, i = (i) => {
|
|
5
|
+
let { utils: { rootRef: a } } = n(), [o, s] = t(void 0);
|
|
6
|
+
return e(() => {
|
|
7
|
+
let e = a.current, t = e?.ownerDocument.defaultView;
|
|
8
|
+
if (!e || !t || !i) return;
|
|
9
|
+
let n = `[data-plitzi-el="${t.CSS.escape(i)}"]`, o = () => s([...e.querySelectorAll(n)].some(r)), c = 0, l = new t.MutationObserver(() => {
|
|
10
|
+
c ||= t.requestAnimationFrame(() => {
|
|
11
|
+
c = 0, o();
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
return l.observe(e, {
|
|
15
|
+
subtree: !0,
|
|
16
|
+
childList: !0,
|
|
17
|
+
attributes: !0,
|
|
18
|
+
attributeFilter: ["class", "style"]
|
|
19
|
+
}), t.addEventListener("resize", o), o(), () => {
|
|
20
|
+
l.disconnect(), t.removeEventListener("resize", o), t.cancelAnimationFrame(c);
|
|
21
|
+
};
|
|
22
|
+
}, [i, a]), o;
|
|
23
|
+
};
|
|
24
|
+
//#endregion
|
|
25
|
+
export { i as default };
|
|
@@ -14,6 +14,10 @@ declare const useRscData: <T>() => {
|
|
|
14
14
|
location: string | undefined;
|
|
15
15
|
elementData: NonNullable<T> | null;
|
|
16
16
|
isServerElement: boolean;
|
|
17
|
+
/** A refresh asking about this element — or about the whole payload of this page — is in flight. */
|
|
18
|
+
refreshing: boolean;
|
|
17
19
|
refresh: (ids?: string[], params?: Record<string, string>) => Promise<void>;
|
|
20
|
+
/** Stops this element's refresh in flight, here and on the server; what it shows stays. */
|
|
21
|
+
cancel: () => void;
|
|
18
22
|
};
|
|
19
23
|
export default useRscData;
|
|
@@ -1,30 +1,34 @@
|
|
|
1
1
|
import e from "./useElement.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { useCommonStore as
|
|
4
|
-
import {
|
|
5
|
-
import a from "@plitzi/sdk-shared/server/rsc/
|
|
2
|
+
import { useCallback as t, useRef as n } from "react";
|
|
3
|
+
import { useCommonStore as r } from "@plitzi/sdk-shared/store";
|
|
4
|
+
import { useStoreById as i } from "@plitzi/nexus/react";
|
|
5
|
+
import { cancelRsc as a, currentRscLocation as o, rscDataPath as s } from "@plitzi/sdk-shared/server/rsc/refreshRsc";
|
|
6
|
+
import c from "@plitzi/sdk-shared/server/rsc/useRscRefresh";
|
|
6
7
|
//#region src/Element/hooks/useRscData.ts
|
|
7
|
-
var
|
|
8
|
-
let { id:
|
|
8
|
+
var l = () => {
|
|
9
|
+
let { id: l, rootId: u } = e(), [[d = !1, f = !1, p = !1, m, h, g, _, v]] = r([
|
|
9
10
|
"rsc.enabled",
|
|
10
11
|
"rsc.loaded",
|
|
11
12
|
"rsc.stale",
|
|
12
13
|
"rsc.location",
|
|
13
|
-
|
|
14
|
+
s(l),
|
|
14
15
|
"navigation.currentPageId",
|
|
15
|
-
"schema.pages"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
"schema.pages",
|
|
17
|
+
"rsc.refreshing"
|
|
18
|
+
]), y = c(), b = i(), x = t(() => a(b, [l]), [b, l]), S = m !== void 0 && m !== o() || u !== void 0 && u !== g && Array.isArray(_) && _.includes(u), C = n(void 0);
|
|
19
|
+
!S && h !== void 0 && (C.current = h);
|
|
20
|
+
let w = S && C.current !== void 0 ? C.current : h;
|
|
19
21
|
return {
|
|
20
|
-
enabled:
|
|
21
|
-
loaded:
|
|
22
|
-
stale:
|
|
23
|
-
location:
|
|
24
|
-
elementData:
|
|
25
|
-
isServerElement:
|
|
26
|
-
|
|
22
|
+
enabled: d,
|
|
23
|
+
loaded: f,
|
|
24
|
+
stale: p,
|
|
25
|
+
location: m,
|
|
26
|
+
elementData: w ?? null,
|
|
27
|
+
isServerElement: w !== void 0,
|
|
28
|
+
refreshing: v?.[l] === !0 || v?.["*"] === !0,
|
|
29
|
+
refresh: y,
|
|
30
|
+
cancel: x
|
|
27
31
|
};
|
|
28
32
|
};
|
|
29
33
|
//#endregion
|
|
30
|
-
export {
|
|
34
|
+
export { l as default };
|
|
@@ -1,64 +1,68 @@
|
|
|
1
1
|
import { use as e, useCallback as t, useEffect as n, useMemo as r, useRef as i } from "react";
|
|
2
2
|
import { useCommonStore as a, useCommonStoreSync as o, useRenderSettings as s } from "@plitzi/sdk-shared/store";
|
|
3
|
-
import { get as
|
|
4
|
-
import { flagValues as
|
|
5
|
-
import { getPathsFromObeject as
|
|
6
|
-
import { evaluateComputed as
|
|
7
|
-
import ne, { SPACE_THEME_AREA as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
3
|
+
import { get as c } from "@plitzi/plitzi-ui/helpers";
|
|
4
|
+
import { flagValues as l, undeclaredFlagOverrides as u } from "@plitzi/sdk-shared/flags";
|
|
5
|
+
import { getPathsFromObeject as d } from "@plitzi/sdk-shared/helpers/utils";
|
|
6
|
+
import { evaluateComputed as ee, resolveVariables as te } from "@plitzi/sdk-shared/dataSource";
|
|
7
|
+
import ne, { SPACE_THEME_AREA as re } from "@plitzi/sdk-shared/theme/useTheme";
|
|
8
|
+
import f from "@plitzi/sdk-shared/dataSource/hooks/useRegisterSource";
|
|
9
|
+
import p from "@plitzi/sdk-auth/AuthContext";
|
|
10
|
+
import m from "@plitzi/sdk-shared/flags/useFlagResolution";
|
|
11
|
+
import h from "@plitzi/sdk-shared/hooks/useStableValue";
|
|
12
12
|
//#region src/dataSource/GlobalSources.tsx
|
|
13
|
-
var
|
|
14
|
-
let { environment:
|
|
13
|
+
var g = ({ children: g }) => {
|
|
14
|
+
let { environment: _ } = s(), [[v, y, b, x, S, C, w, T = ""]] = a([
|
|
15
15
|
"schema.variables",
|
|
16
16
|
"navigation.routeParams",
|
|
17
17
|
"navigation.queryParams",
|
|
18
18
|
"navigation.hostname",
|
|
19
19
|
"navigation.origin",
|
|
20
20
|
"navigation.href",
|
|
21
|
-
"navigation.currentPageId"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
"navigation.currentPageId",
|
|
22
|
+
"navigation.pendingLocation"
|
|
23
|
+
]), E = h(r(() => te(v, {
|
|
24
|
+
routeParams: y,
|
|
25
|
+
queryParams: b,
|
|
26
|
+
hostname: x,
|
|
27
|
+
environment: _
|
|
27
28
|
}), [
|
|
28
|
-
|
|
29
|
-
S,
|
|
29
|
+
_,
|
|
30
30
|
x,
|
|
31
31
|
b,
|
|
32
|
-
y
|
|
33
|
-
|
|
32
|
+
y,
|
|
33
|
+
v
|
|
34
|
+
])), ie = t(() => d(E).map((e) => ({
|
|
34
35
|
path: e,
|
|
35
36
|
name: `variables.${e}`
|
|
36
37
|
})), [E]);
|
|
37
|
-
|
|
38
|
+
f({
|
|
38
39
|
id: "global",
|
|
39
40
|
source: "variables",
|
|
40
41
|
name: "Variables",
|
|
41
|
-
fields:
|
|
42
|
+
fields: ie
|
|
42
43
|
}), o("runtime.sources.variables", E);
|
|
43
44
|
let [D = {}] = a("pageDefinitions"), O = r(() => Object.values(D).map((e) => ({
|
|
44
45
|
value: e.id,
|
|
45
|
-
label:
|
|
46
|
+
label: c(e, "attributes.name", e.id)
|
|
46
47
|
})), [D]), k = r(() => ({
|
|
47
|
-
routeParams:
|
|
48
|
-
queryParams:
|
|
49
|
-
origin:
|
|
50
|
-
href:
|
|
51
|
-
currentPageId:
|
|
48
|
+
routeParams: y,
|
|
49
|
+
queryParams: b,
|
|
50
|
+
origin: S,
|
|
51
|
+
href: C,
|
|
52
|
+
currentPageId: w,
|
|
53
|
+
pending: T !== "",
|
|
54
|
+
pendingLocation: T
|
|
52
55
|
}), [
|
|
56
|
+
y,
|
|
53
57
|
b,
|
|
54
|
-
|
|
58
|
+
S,
|
|
55
59
|
C,
|
|
56
60
|
w,
|
|
57
61
|
T
|
|
58
62
|
]), A = t(() => {
|
|
59
|
-
let e =
|
|
60
|
-
routeParams:
|
|
61
|
-
queryParams:
|
|
63
|
+
let e = d({
|
|
64
|
+
routeParams: y,
|
|
65
|
+
queryParams: b
|
|
62
66
|
}).map((e) => ({
|
|
63
67
|
path: e,
|
|
64
68
|
name: `navigation.${e}`
|
|
@@ -68,7 +72,13 @@ var _ = ({ children: _ }) => {
|
|
|
68
72
|
}, n = {
|
|
69
73
|
path: "href",
|
|
70
74
|
name: "This page’s address"
|
|
71
|
-
}, r =
|
|
75
|
+
}, r = [{
|
|
76
|
+
path: "pending",
|
|
77
|
+
name: "A navigation is on its way"
|
|
78
|
+
}, {
|
|
79
|
+
path: "pendingLocation",
|
|
80
|
+
name: "Where a navigation is going"
|
|
81
|
+
}], i = O.length > 0 ? {
|
|
72
82
|
path: "currentPageId",
|
|
73
83
|
name: "Current Page",
|
|
74
84
|
inputType: "select",
|
|
@@ -81,20 +91,21 @@ var _ = ({ children: _ }) => {
|
|
|
81
91
|
...e,
|
|
82
92
|
t,
|
|
83
93
|
n,
|
|
84
|
-
r
|
|
94
|
+
...r,
|
|
95
|
+
i
|
|
85
96
|
];
|
|
86
97
|
}, [
|
|
98
|
+
y,
|
|
87
99
|
b,
|
|
88
|
-
x,
|
|
89
100
|
O
|
|
90
101
|
]);
|
|
91
|
-
|
|
102
|
+
f({
|
|
92
103
|
id: "global",
|
|
93
104
|
source: "navigation",
|
|
94
105
|
name: "Navigation",
|
|
95
106
|
fields: A
|
|
96
107
|
}), o("runtime.sources.navigation", k);
|
|
97
|
-
let j = e(
|
|
108
|
+
let j = e(p), { user: M, authenticated: N, state: P } = j, [F = "basic"] = a("schema.settings.userProvider"), I = r(() => F === "" ? {} : {
|
|
98
109
|
isAuthenticated: N,
|
|
99
110
|
...P === void 0 ? {} : { status: P },
|
|
100
111
|
accessToken: M?.accessToken ?? "",
|
|
@@ -111,65 +122,65 @@ var _ = ({ children: _ }) => {
|
|
|
111
122
|
M,
|
|
112
123
|
N,
|
|
113
124
|
P
|
|
114
|
-
]), L = t(() =>
|
|
125
|
+
]), L = t(() => d(I).map((e) => ({
|
|
115
126
|
path: e,
|
|
116
127
|
name: `user.${e}`
|
|
117
128
|
})), [I]);
|
|
118
|
-
|
|
129
|
+
f({
|
|
119
130
|
id: "global",
|
|
120
131
|
source: "auth",
|
|
121
132
|
name: "Auth State",
|
|
122
133
|
fields: L
|
|
123
134
|
}), o("runtime.sources.auth", I);
|
|
124
|
-
let R =
|
|
135
|
+
let R = m(j), z = r(() => l(R), [R]), B = t(() => Object.keys(z).map((e) => ({
|
|
125
136
|
path: e,
|
|
126
137
|
name: `flags.${e}`,
|
|
127
138
|
inputType: "checkbox"
|
|
128
139
|
})), [z]);
|
|
129
|
-
|
|
140
|
+
f({
|
|
130
141
|
id: "global",
|
|
131
142
|
source: "flags",
|
|
132
143
|
name: "Feature Flags",
|
|
133
144
|
fields: B
|
|
134
145
|
}), o("runtime.sources.flags", z), o("flags.resolved", R);
|
|
135
|
-
let [V, H] = a(["schema.flags", "flags.overrides"])[0], U =
|
|
146
|
+
let [V, H] = a(["schema.flags", "flags.overrides"])[0], U = h(u(V, H ?? {}));
|
|
136
147
|
n(() => {
|
|
137
148
|
U.forEach(({ layer: e, name: t }) => console.warn(`[plitzi] The ${e} sets the feature flag "${t}", which this space does not declare: the override is ignored. Declare the flag in the space, or remove the override.`));
|
|
138
149
|
}, [U]);
|
|
139
|
-
let [W] = a("runtime.state"), G = t(() =>
|
|
150
|
+
let [W] = a("runtime.state"), G = t(() => d(W).map((e) => ({
|
|
140
151
|
path: e,
|
|
141
152
|
name: `state.${e}`
|
|
142
153
|
})), [W]);
|
|
143
|
-
|
|
154
|
+
f({
|
|
144
155
|
id: "global",
|
|
145
156
|
source: "state",
|
|
146
157
|
name: "State",
|
|
147
158
|
fields: G
|
|
148
159
|
}), o("runtime.sources.state", W);
|
|
149
|
-
let [K] = a("runtime.host"), q = t(() =>
|
|
160
|
+
let [K] = a("runtime.host"), q = t(() => d(K).map((e) => ({
|
|
150
161
|
path: e,
|
|
151
162
|
name: `host.${e}`
|
|
152
163
|
})), [K]);
|
|
153
|
-
|
|
164
|
+
f({
|
|
154
165
|
id: "global",
|
|
155
166
|
source: "host",
|
|
156
167
|
name: "Host",
|
|
157
168
|
fields: q
|
|
158
169
|
}), o("runtime.sources.host", K);
|
|
159
|
-
let { theme: J, resolvedTheme: Y } = ne(
|
|
170
|
+
let { theme: J, resolvedTheme: Y } = ne(re), X = r(() => ({
|
|
160
171
|
mode: J,
|
|
161
172
|
resolved: Y
|
|
162
|
-
}), [J, Y]),
|
|
173
|
+
}), [J, Y]), ae = t(() => d(X).map((e) => ({
|
|
163
174
|
path: e,
|
|
164
175
|
name: `theme.${e}`
|
|
165
176
|
})), [X]);
|
|
166
|
-
|
|
177
|
+
f({
|
|
167
178
|
id: "global",
|
|
168
179
|
source: "theme",
|
|
169
180
|
name: "Theme",
|
|
170
|
-
fields:
|
|
181
|
+
fields: ae
|
|
171
182
|
}), o("runtime.sources.theme", X);
|
|
172
|
-
let [Z] = a("schema.settings.computed"), Q = i(void 0), $ = r(() =>
|
|
183
|
+
let [Z] = a("schema.settings.computed"), Q = i(void 0), $ = r(() => ee(Z ?? {}, {
|
|
173
184
|
variables: E,
|
|
174
185
|
navigation: k,
|
|
175
186
|
auth: I,
|
|
@@ -188,16 +199,16 @@ var _ = ({ children: _ }) => {
|
|
|
188
199
|
z
|
|
189
200
|
]);
|
|
190
201
|
Q.current = $;
|
|
191
|
-
let
|
|
202
|
+
let oe = t(() => d($).map((e) => ({
|
|
192
203
|
path: e,
|
|
193
204
|
name: `computed.${e}`
|
|
194
205
|
})), [$]);
|
|
195
|
-
return
|
|
206
|
+
return f({
|
|
196
207
|
id: "global",
|
|
197
208
|
source: "computed",
|
|
198
209
|
name: "Computed",
|
|
199
|
-
fields:
|
|
200
|
-
}), o("runtime.sources.computed", $),
|
|
210
|
+
fields: oe
|
|
211
|
+
}), o("runtime.sources.computed", $), g;
|
|
201
212
|
};
|
|
202
213
|
//#endregion
|
|
203
|
-
export {
|
|
214
|
+
export { g as default };
|
|
@@ -24,6 +24,11 @@ export type ButtonProps = {
|
|
|
24
24
|
ariaExpanded?: boolean;
|
|
25
25
|
/** For a button that stays on or off — a filter, a mode: `true` while it is on. Left out, it is a plain button. */
|
|
26
26
|
ariaPressed?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* What the button shows and hides — an accordion's panel, a menu — by its anchor (`aria-controls`), so a screen
|
|
29
|
+
* reader can go from one to the other. Authoring takes the element's id and gives that element the anchor.
|
|
30
|
+
*/
|
|
31
|
+
controls?: string;
|
|
27
32
|
/**
|
|
28
33
|
* What the button does, in words — shown as a tooltip on hover, and the button's accessible name when it has no text
|
|
29
34
|
* of its own. An icon-only button without one is announced as nothing at all.
|
|
@@ -40,7 +45,7 @@ export type ButtonProps = {
|
|
|
40
45
|
*/
|
|
41
46
|
label?: string;
|
|
42
47
|
};
|
|
43
|
-
declare const Button: ({ ref, className, children, contentPlacement, content, icon, iconPlacement, subType, disabled, ariaExpanded, ariaPressed, title, label }: ButtonProps) => import('react').JSX.Element;
|
|
48
|
+
declare const Button: ({ ref, className, children, contentPlacement, content, icon, iconPlacement, subType, disabled, ariaExpanded, ariaPressed, controls, title, label }: ButtonProps) => import('react').JSX.Element;
|
|
44
49
|
declare const _default: {
|
|
45
50
|
(props: import('../../../Element/hocs/withElement').WithElementProps<ButtonProps>): import('react').JSX.Element;
|
|
46
51
|
displayName: string;
|
|
@@ -6,31 +6,32 @@ import i from "@plitzi/sdk-shared/hooks/usePlitziServiceContext";
|
|
|
6
6
|
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
7
|
import s from "clsx";
|
|
8
8
|
//#region src/elements/basic/Button/Button.tsx
|
|
9
|
-
var c = ({ ref: e, className: c = "", children: l, contentPlacement: u = "after", content: d = "Button", icon: f = "", iconPlacement: p = "before", subType: m = "button", disabled: h = !1, ariaExpanded: g, ariaPressed: _,
|
|
10
|
-
let { settings: { previewMode:
|
|
9
|
+
var c = ({ ref: e, className: c = "", children: l, contentPlacement: u = "after", content: d = "Button", icon: f = "", iconPlacement: p = "before", subType: m = "button", disabled: h = !1, ariaExpanded: g, ariaPressed: _, controls: v, title: y, label: b }) => {
|
|
10
|
+
let { settings: { previewMode: x } } = i(), { definition: { styleSelectors: S } } = t();
|
|
11
11
|
return /* @__PURE__ */ o(n, {
|
|
12
12
|
ref: e,
|
|
13
13
|
tag: "button",
|
|
14
|
-
type:
|
|
15
|
-
className: s("plitzi-component__button", c, { "container--empty--skip": !
|
|
14
|
+
type: x ? m : "button",
|
|
15
|
+
className: s("plitzi-component__button", c, { "container--empty--skip": !x && !l && (d || f) }),
|
|
16
16
|
disabled: h,
|
|
17
|
-
title:
|
|
18
|
-
"aria-label":
|
|
17
|
+
title: y || void 0,
|
|
18
|
+
"aria-label": b || void 0,
|
|
19
19
|
"aria-expanded": g,
|
|
20
20
|
"aria-pressed": _,
|
|
21
|
+
"aria-controls": v || void 0,
|
|
21
22
|
children: [
|
|
22
23
|
u === "before" && /* @__PURE__ */ a(r, {
|
|
23
24
|
content: d,
|
|
24
25
|
icon: f,
|
|
25
26
|
iconPlacement: p,
|
|
26
|
-
iconClassName:
|
|
27
|
+
iconClassName: S.icon
|
|
27
28
|
}),
|
|
28
29
|
l,
|
|
29
30
|
u === "after" && /* @__PURE__ */ a(r, {
|
|
30
31
|
content: d,
|
|
31
32
|
icon: f,
|
|
32
33
|
iconPlacement: p,
|
|
33
|
-
iconClassName:
|
|
34
|
+
iconClassName: S.icon
|
|
34
35
|
})
|
|
35
36
|
]
|
|
36
37
|
});
|
|
@@ -48,7 +48,7 @@ declare const declaration: {
|
|
|
48
48
|
readonly license: "MIT";
|
|
49
49
|
readonly website: "https://plitzi.com";
|
|
50
50
|
readonly backgroundColor: "#4422ee";
|
|
51
|
-
readonly icon: "fa-solid fa-
|
|
51
|
+
readonly icon: "fa-solid fa-hand-pointer";
|
|
52
52
|
};
|
|
53
53
|
readonly defaultStyle: {
|
|
54
54
|
readonly name: "Button";
|
|
@@ -131,6 +131,7 @@ declare const declaration: {
|
|
|
131
131
|
title?: string | undefined;
|
|
132
132
|
content?: string | undefined;
|
|
133
133
|
disabled?: boolean | undefined;
|
|
134
|
+
controls?: string | undefined;
|
|
134
135
|
icon?: string | undefined;
|
|
135
136
|
subType?: "button" | "submit" | "reset" | undefined;
|
|
136
137
|
iconPlacement?: import('../../../Element/ElementWords').IconPlacement | undefined;
|
|
@@ -47,7 +47,7 @@ declare const Button: {
|
|
|
47
47
|
readonly license: "MIT";
|
|
48
48
|
readonly website: "https://plitzi.com";
|
|
49
49
|
readonly backgroundColor: "#4422ee";
|
|
50
|
-
readonly icon: "fa-solid fa-
|
|
50
|
+
readonly icon: "fa-solid fa-hand-pointer";
|
|
51
51
|
};
|
|
52
52
|
readonly defaultStyle: {
|
|
53
53
|
readonly name: "Button";
|
|
@@ -130,6 +130,7 @@ declare const Button: {
|
|
|
130
130
|
title?: string | undefined;
|
|
131
131
|
content?: string | undefined;
|
|
132
132
|
disabled?: boolean | undefined;
|
|
133
|
+
controls?: string | undefined;
|
|
133
134
|
icon?: string | undefined;
|
|
134
135
|
subType?: "button" | "submit" | "reset" | undefined;
|
|
135
136
|
iconPlacement?: import('../../../Element/ElementWords').IconPlacement | undefined;
|
|
@@ -34,7 +34,7 @@ declare const declaration: {
|
|
|
34
34
|
readonly license: "MIT";
|
|
35
35
|
readonly website: "https://plitzi.com";
|
|
36
36
|
readonly backgroundColor: "#4422ee";
|
|
37
|
-
readonly icon: "";
|
|
37
|
+
readonly icon: "fa-regular fa-window-restore";
|
|
38
38
|
};
|
|
39
39
|
readonly defaultStyle: {
|
|
40
40
|
readonly name: "Dropdown Popup";
|
|
@@ -33,7 +33,7 @@ declare const DropdownPopup: {
|
|
|
33
33
|
readonly license: "MIT";
|
|
34
34
|
readonly website: "https://plitzi.com";
|
|
35
35
|
readonly backgroundColor: "#4422ee";
|
|
36
|
-
readonly icon: "";
|
|
36
|
+
readonly icon: "fa-regular fa-window-restore";
|
|
37
37
|
};
|
|
38
38
|
readonly defaultStyle: {
|
|
39
39
|
readonly name: "Dropdown Popup";
|
|
@@ -38,7 +38,7 @@ declare const Dropdown: {
|
|
|
38
38
|
readonly license: "MIT";
|
|
39
39
|
readonly website: "https://plitzi.com";
|
|
40
40
|
readonly backgroundColor: "#4422ee";
|
|
41
|
-
readonly icon: "";
|
|
41
|
+
readonly icon: "fa-regular fa-window-restore";
|
|
42
42
|
};
|
|
43
43
|
readonly defaultStyle: {
|
|
44
44
|
readonly name: "Dropdown Popup";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { RefObject } from 'react';
|
|
2
2
|
export type MarkdownProps = {
|
|
3
|
-
ref
|
|
4
|
-
className
|
|
5
|
-
content
|
|
3
|
+
ref?: RefObject<HTMLElement>;
|
|
4
|
+
className?: string;
|
|
5
|
+
content?: string;
|
|
6
6
|
};
|
|
7
7
|
declare const Markdown: ({ ref, content, className }: MarkdownProps) => import('react').JSX.Element;
|
|
8
8
|
declare const _default: {
|
|
@@ -4,14 +4,18 @@ import n from "@plitzi/sdk-shared/hooks/usePlitziServiceContext";
|
|
|
4
4
|
import { jsx as r } from "react/jsx-runtime";
|
|
5
5
|
import i from "clsx";
|
|
6
6
|
import a from "@plitzi/plitzi-ui/Markdown";
|
|
7
|
+
import { uniqueAnchor as o } from "@plitzi/sdk-shared/schema/anchor";
|
|
7
8
|
//#region src/elements/basic/Markdown/Markdown.tsx
|
|
8
|
-
var
|
|
9
|
-
let { settings: { previewMode:
|
|
9
|
+
var s = ({ ref: e, content: s = "Markdown", className: c = "" }) => {
|
|
10
|
+
let { settings: { previewMode: l } } = n();
|
|
10
11
|
return /* @__PURE__ */ r(t, {
|
|
11
12
|
ref: e,
|
|
12
|
-
className: i("plitzi-component__markdown", { "plitzi-component__markdown--edit-mode": !
|
|
13
|
-
children: /* @__PURE__ */ r(a, {
|
|
13
|
+
className: i("plitzi-component__markdown", { "plitzi-component__markdown--edit-mode": !l }, c),
|
|
14
|
+
children: /* @__PURE__ */ r(a, {
|
|
15
|
+
headingAnchor: o,
|
|
16
|
+
children: s
|
|
17
|
+
})
|
|
14
18
|
});
|
|
15
|
-
},
|
|
19
|
+
}, c = e(s);
|
|
16
20
|
//#endregion
|
|
17
|
-
export {
|
|
21
|
+
export { s as Markdown, c as default };
|
|
@@ -42,7 +42,7 @@ declare const declaration: {
|
|
|
42
42
|
readonly license: "MIT";
|
|
43
43
|
readonly website: "https://plitzi.com";
|
|
44
44
|
readonly backgroundColor: "#4422ee";
|
|
45
|
-
readonly icon: "fa-solid fa-
|
|
45
|
+
readonly icon: "fa-solid fa-file-lines";
|
|
46
46
|
};
|
|
47
47
|
readonly defaultStyle: {
|
|
48
48
|
readonly name: "Rich Text";
|
|
@@ -41,7 +41,7 @@ declare const RichText: {
|
|
|
41
41
|
readonly license: "MIT";
|
|
42
42
|
readonly website: "https://plitzi.com";
|
|
43
43
|
readonly backgroundColor: "#4422ee";
|
|
44
|
-
readonly icon: "fa-solid fa-
|
|
44
|
+
readonly icon: "fa-solid fa-file-lines";
|
|
45
45
|
};
|
|
46
46
|
readonly defaultStyle: {
|
|
47
47
|
readonly name: "Rich Text";
|
|
@@ -3,8 +3,13 @@ export type TextProps = {
|
|
|
3
3
|
ref?: RefObject<HTMLElement>;
|
|
4
4
|
className?: string;
|
|
5
5
|
content?: string | number;
|
|
6
|
+
/**
|
|
7
|
+
* What a pointer resting on it shows — the whole of a text cut short, what an abbreviation stands for. A screen reader
|
|
8
|
+
* may not say it, so nothing only it says should matter.
|
|
9
|
+
*/
|
|
10
|
+
title?: string;
|
|
6
11
|
};
|
|
7
|
-
declare const Text: ({ ref, content, className }: TextProps) => import('react').JSX.Element;
|
|
12
|
+
declare const Text: ({ ref, content, className, title }: TextProps) => import('react').JSX.Element;
|
|
8
13
|
declare const _default: {
|
|
9
14
|
(props: import('../../../Element/hocs/withElement').WithElementProps<TextProps>): import('react').JSX.Element;
|
|
10
15
|
displayName: string;
|
|
@@ -7,15 +7,16 @@ import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
|
7
7
|
import l from "clsx";
|
|
8
8
|
import u from "@plitzi/plitzi-ui/ContentEditable";
|
|
9
9
|
//#region src/elements/basic/Text/Text.tsx
|
|
10
|
-
var d = ({ ref: e, content: d = "Text", className: f = "" }) => {
|
|
11
|
-
let { id:
|
|
10
|
+
var d = ({ ref: e, content: d = "Text", className: f = "", title: p = "" }) => {
|
|
11
|
+
let { id: m } = t(), { settings: { previewMode: h }, contexts: { BuilderContext: g } } = o(), _ = g ? r(g) : void 0, v = a(() => typeof d != "string" && typeof d != "number" ? JSON.stringify(d) : !d && d !== "" && !h ? "Text" : typeof d == "number" ? `${d}` : d, [d, h]), y = i((e) => _?.updateElement(m, "content", e), [_, m]);
|
|
12
12
|
return /* @__PURE__ */ c(n, {
|
|
13
13
|
ref: e,
|
|
14
14
|
className: l("plitzi-component__text", f),
|
|
15
|
-
|
|
15
|
+
title: p || void 0,
|
|
16
|
+
children: [h && v, !h && /* @__PURE__ */ s(u, {
|
|
16
17
|
className: "focus-visible:outline-hidden",
|
|
17
|
-
value:
|
|
18
|
-
onChange:
|
|
18
|
+
value: v,
|
|
19
|
+
onChange: y,
|
|
19
20
|
openMode: "doubleClick"
|
|
20
21
|
})]
|
|
21
22
|
});
|