@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
|
@@ -89,6 +89,13 @@ export declare const elementDeclarations: {
|
|
|
89
89
|
};
|
|
90
90
|
};
|
|
91
91
|
};
|
|
92
|
+
readonly cancelQuery: {
|
|
93
|
+
readonly action: "cancelQuery";
|
|
94
|
+
readonly title: "Cancel Query";
|
|
95
|
+
readonly type: "callback";
|
|
96
|
+
readonly preview: {};
|
|
97
|
+
readonly params: {};
|
|
98
|
+
};
|
|
92
99
|
readonly loadMore: {
|
|
93
100
|
readonly action: "loadMore";
|
|
94
101
|
readonly title: "Load More";
|
|
@@ -193,7 +200,36 @@ export declare const elementDeclarations: {
|
|
|
193
200
|
};
|
|
194
201
|
readonly settings: {};
|
|
195
202
|
};
|
|
196
|
-
} & import('@plitzi/sdk-shared/authoring/declare').ElementAttributesBrand<
|
|
203
|
+
} & import('@plitzi/sdk-shared/authoring/declare').ElementAttributesBrand<Partial<{
|
|
204
|
+
when?: import('@plitzi/sdk-shared').RuleGroup | undefined;
|
|
205
|
+
action?: string | undefined;
|
|
206
|
+
cache?: boolean | undefined;
|
|
207
|
+
endpoint?: string | undefined;
|
|
208
|
+
input?: (Record<string, unknown> | string) | undefined;
|
|
209
|
+
method?: "get" | "post" | "put" | "delete" | "patch" | undefined;
|
|
210
|
+
resource?: string | undefined;
|
|
211
|
+
headers?: Record<string, string> | undefined;
|
|
212
|
+
subType?: "div" | "header" | "footer" | "nav" | "main" | "section" | "article" | "aside" | "address" | "figure" | "" | undefined;
|
|
213
|
+
query?: string | undefined;
|
|
214
|
+
accessToken?: string | undefined;
|
|
215
|
+
mockData?: (Record<string, unknown> | string) | undefined;
|
|
216
|
+
credentials?: RequestCredentials | undefined;
|
|
217
|
+
connector?: string | undefined;
|
|
218
|
+
limit?: string | undefined;
|
|
219
|
+
singleRecord?: boolean | undefined;
|
|
220
|
+
filters?: {
|
|
221
|
+
field: string;
|
|
222
|
+
operator: string;
|
|
223
|
+
value: string;
|
|
224
|
+
}[] | undefined;
|
|
225
|
+
pagination?: import('../provider/ApiContainer/hooks/useProviderPagination').ProviderPagination | undefined;
|
|
226
|
+
pageParam?: string | undefined;
|
|
227
|
+
renderWhileLoading?: boolean | undefined;
|
|
228
|
+
loadingSlot?: string | undefined;
|
|
229
|
+
staleTime?: number | string | undefined;
|
|
230
|
+
gcTime?: number | string | undefined;
|
|
231
|
+
refreshSeconds?: number | string | undefined;
|
|
232
|
+
}>>;
|
|
197
233
|
readonly BlockHtml: {
|
|
198
234
|
readonly type: "blockHtml";
|
|
199
235
|
readonly content: {
|
|
@@ -341,7 +377,7 @@ export declare const elementDeclarations: {
|
|
|
341
377
|
readonly license: "MIT";
|
|
342
378
|
readonly website: "https://plitzi.com";
|
|
343
379
|
readonly backgroundColor: "#4422ee";
|
|
344
|
-
readonly icon: "fa-solid fa-
|
|
380
|
+
readonly icon: "fa-solid fa-hand-pointer";
|
|
345
381
|
};
|
|
346
382
|
readonly defaultStyle: {
|
|
347
383
|
readonly name: "Button";
|
|
@@ -424,6 +460,7 @@ export declare const elementDeclarations: {
|
|
|
424
460
|
title?: string | undefined;
|
|
425
461
|
content?: string | undefined;
|
|
426
462
|
disabled?: boolean | undefined;
|
|
463
|
+
controls?: string | undefined;
|
|
427
464
|
icon?: string | undefined;
|
|
428
465
|
subType?: "button" | "submit" | "reset" | undefined;
|
|
429
466
|
iconPlacement?: import('../../Element/ElementWords').IconPlacement | undefined;
|
|
@@ -742,6 +779,7 @@ export declare const elementDeclarations: {
|
|
|
742
779
|
readonly type: "container";
|
|
743
780
|
readonly attributeValues: {
|
|
744
781
|
readonly subType: readonly string[];
|
|
782
|
+
readonly live: readonly string[];
|
|
745
783
|
};
|
|
746
784
|
readonly content: {
|
|
747
785
|
readonly attributes: {
|
|
@@ -776,7 +814,7 @@ export declare const elementDeclarations: {
|
|
|
776
814
|
readonly license: "MIT";
|
|
777
815
|
readonly website: "https://plitzi.com";
|
|
778
816
|
readonly backgroundColor: "#4422ee";
|
|
779
|
-
readonly icon: "fa-
|
|
817
|
+
readonly icon: "fa-solid fa-crop-simple";
|
|
780
818
|
};
|
|
781
819
|
readonly defaultStyle: {
|
|
782
820
|
readonly name: "Container";
|
|
@@ -792,7 +830,9 @@ export declare const elementDeclarations: {
|
|
|
792
830
|
};
|
|
793
831
|
} & import('@plitzi/sdk-shared/authoring/declare').ElementAttributesBrand<Partial<{
|
|
794
832
|
label?: string | undefined;
|
|
795
|
-
|
|
833
|
+
title?: string | undefined;
|
|
834
|
+
subType?: "div" | "header" | "footer" | "nav" | "main" | "section" | "article" | "aside" | "address" | "figure" | "dl" | "dt" | "dd" | "li" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p" | "span" | undefined;
|
|
835
|
+
live?: "polite" | "assertive" | "" | undefined;
|
|
796
836
|
decorative?: boolean | undefined;
|
|
797
837
|
}>>;
|
|
798
838
|
readonly Custom: {
|
|
@@ -977,7 +1017,7 @@ export declare const elementDeclarations: {
|
|
|
977
1017
|
readonly license: "MIT";
|
|
978
1018
|
readonly website: "https://plitzi.com";
|
|
979
1019
|
readonly backgroundColor: "#4422ee";
|
|
980
|
-
readonly icon: "fa-regular fa-
|
|
1020
|
+
readonly icon: "fa-regular fa-message";
|
|
981
1021
|
};
|
|
982
1022
|
readonly defaultStyle: {
|
|
983
1023
|
readonly name: "Dialog Container";
|
|
@@ -1194,7 +1234,7 @@ export declare const elementDeclarations: {
|
|
|
1194
1234
|
readonly license: "MIT";
|
|
1195
1235
|
readonly website: "https://plitzi.com";
|
|
1196
1236
|
readonly backgroundColor: "#4422ee";
|
|
1197
|
-
readonly icon: "";
|
|
1237
|
+
readonly icon: "fa-regular fa-window-restore";
|
|
1198
1238
|
};
|
|
1199
1239
|
readonly defaultStyle: {
|
|
1200
1240
|
readonly name: "Dropdown Popup";
|
|
@@ -1449,6 +1489,7 @@ export declare const elementDeclarations: {
|
|
|
1449
1489
|
readonly license: "MIT";
|
|
1450
1490
|
readonly website: "https://plitzi.com";
|
|
1451
1491
|
readonly backgroundColor: "#4422ee";
|
|
1492
|
+
readonly icon: "fa-solid fa-rectangle-list";
|
|
1452
1493
|
};
|
|
1453
1494
|
readonly defaultStyle: {
|
|
1454
1495
|
readonly name: "Form";
|
|
@@ -1542,6 +1583,7 @@ export declare const elementDeclarations: {
|
|
|
1542
1583
|
readonly license: "MIT";
|
|
1543
1584
|
readonly website: "https://plitzi.com";
|
|
1544
1585
|
readonly backgroundColor: "#4422ee";
|
|
1586
|
+
readonly icon: "fa-solid fa-i-cursor";
|
|
1545
1587
|
};
|
|
1546
1588
|
readonly defaultStyle: {
|
|
1547
1589
|
readonly name: "Form Control";
|
|
@@ -2135,7 +2177,7 @@ export declare const elementDeclarations: {
|
|
|
2135
2177
|
};
|
|
2136
2178
|
readonly content: {
|
|
2137
2179
|
readonly attributes: {
|
|
2138
|
-
readonly src: "
|
|
2180
|
+
readonly src: "";
|
|
2139
2181
|
readonly alt: "";
|
|
2140
2182
|
readonly decorative: false;
|
|
2141
2183
|
readonly fetchPriority: "auto";
|
|
@@ -2187,6 +2229,7 @@ export declare const elementDeclarations: {
|
|
|
2187
2229
|
readonly settings: {};
|
|
2188
2230
|
};
|
|
2189
2231
|
} & import('@plitzi/sdk-shared/authoring/declare').ElementAttributesBrand<Partial<{
|
|
2232
|
+
resize?: boolean | undefined;
|
|
2190
2233
|
height?: number | undefined;
|
|
2191
2234
|
width?: number | undefined;
|
|
2192
2235
|
fetchPriority?: "high" | "low" | "auto" | undefined;
|
|
@@ -2454,7 +2497,7 @@ export declare const elementDeclarations: {
|
|
|
2454
2497
|
readonly license: "MIT";
|
|
2455
2498
|
readonly website: "https://plitzi.com";
|
|
2456
2499
|
readonly backgroundColor: "#4422ee";
|
|
2457
|
-
readonly icon: "fa-solid fa-
|
|
2500
|
+
readonly icon: "fa-solid fa-grip-lines";
|
|
2458
2501
|
};
|
|
2459
2502
|
readonly defaultStyle: {
|
|
2460
2503
|
readonly name: "List Item";
|
|
@@ -2565,7 +2608,7 @@ export declare const elementDeclarations: {
|
|
|
2565
2608
|
readonly settings: {};
|
|
2566
2609
|
};
|
|
2567
2610
|
} & import('@plitzi/sdk-shared/authoring/declare').ElementAttributesBrand<Partial<{
|
|
2568
|
-
content
|
|
2611
|
+
content?: string | undefined;
|
|
2569
2612
|
}>>;
|
|
2570
2613
|
readonly ModalContainer: {
|
|
2571
2614
|
readonly type: "modalContainer";
|
|
@@ -3462,7 +3505,7 @@ export declare const elementDeclarations: {
|
|
|
3462
3505
|
readonly license: "MIT";
|
|
3463
3506
|
readonly website: "https://plitzi.com";
|
|
3464
3507
|
readonly backgroundColor: "#4422ee";
|
|
3465
|
-
readonly icon: "fa-solid fa-
|
|
3508
|
+
readonly icon: "fa-solid fa-file-lines";
|
|
3466
3509
|
};
|
|
3467
3510
|
readonly defaultStyle: {
|
|
3468
3511
|
readonly name: "Rich Text";
|
|
@@ -3719,7 +3762,7 @@ export declare const elementDeclarations: {
|
|
|
3719
3762
|
readonly license: "MIT";
|
|
3720
3763
|
readonly website: "https://plitzi.com";
|
|
3721
3764
|
readonly backgroundColor: "#4422ee";
|
|
3722
|
-
readonly icon: "fa-
|
|
3765
|
+
readonly icon: "fa-regular fa-folder";
|
|
3723
3766
|
};
|
|
3724
3767
|
readonly defaultStyle: {
|
|
3725
3768
|
readonly name: "Tab Container Item";
|
|
@@ -3786,6 +3829,7 @@ export declare const elementDeclarations: {
|
|
|
3786
3829
|
readonly settings: {};
|
|
3787
3830
|
};
|
|
3788
3831
|
} & import('@plitzi/sdk-shared/authoring/declare').ElementAttributesBrand<Partial<{
|
|
3832
|
+
title?: string | undefined;
|
|
3789
3833
|
content?: string | number | undefined;
|
|
3790
3834
|
}>>;
|
|
3791
3835
|
readonly ThemeToggle: {
|
|
@@ -103,6 +103,7 @@ declare const declaration: {
|
|
|
103
103
|
readonly license: "MIT";
|
|
104
104
|
readonly website: "https://plitzi.com";
|
|
105
105
|
readonly backgroundColor: "#4422ee";
|
|
106
|
+
readonly icon: "fa-solid fa-rectangle-list";
|
|
106
107
|
};
|
|
107
108
|
readonly defaultStyle: {
|
|
108
109
|
readonly name: "Form";
|
|
@@ -2,7 +2,11 @@ import { ChangeEvent, RefObject } from 'react';
|
|
|
2
2
|
export type FormControlProps = {
|
|
3
3
|
ref: RefObject<HTMLElement>;
|
|
4
4
|
className: string;
|
|
5
|
-
subType: 'text' | 'number' | 'email' | 'password'
|
|
5
|
+
subType: 'text' | 'number' | 'email' | 'password'
|
|
6
|
+
/** A search box: the browser draws its clear button, and a phone shows its search key. */
|
|
7
|
+
| 'search' | 'url'
|
|
8
|
+
/** A phone number: a phone shows its dial pad. */
|
|
9
|
+
| 'tel' | 'date' | 'time' | 'checkbox' | 'switch' | 'select' | 'textarea' | 'hidden'
|
|
6
10
|
/** The browser's own colour picker: its value is `#rrggbb`. */
|
|
7
11
|
| 'color';
|
|
8
12
|
name: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
type SettingsProps = {
|
|
2
|
-
subType?: 'text' | 'number' | 'date' | 'time' | 'email' | 'password' | 'select' | 'checkbox' | 'textarea' | 'hidden' | 'color' | 'switch';
|
|
2
|
+
subType?: 'text' | 'number' | 'date' | 'time' | 'email' | 'password' | 'search' | 'url' | 'tel' | 'select' | 'checkbox' | 'textarea' | 'hidden' | 'color' | 'switch';
|
|
3
3
|
name?: string;
|
|
4
4
|
label?: string;
|
|
5
5
|
hideLabel?: boolean;
|
|
@@ -15,7 +15,10 @@ var l = (e) => {
|
|
|
15
15
|
"textarea",
|
|
16
16
|
"number",
|
|
17
17
|
"email",
|
|
18
|
-
"password"
|
|
18
|
+
"password",
|
|
19
|
+
"search",
|
|
20
|
+
"url",
|
|
21
|
+
"tel"
|
|
19
22
|
].includes(u), F = t((e) => N?.("name", e), [N]), I = t((e) => N?.("label", e), [N]), L = t((e) => N?.("hideLabel", e.target.checked), [N]), ee = t((e) => N?.("placeholder", e), [N]), R = t((e) => {
|
|
20
23
|
N?.("subType", e), N?.("defaultValue", "");
|
|
21
24
|
}, [N]), z = t((e) => N?.("defaultValue", e), [N]), B = t((e) => N?.("autoFocus", e.target.checked), [N]), V = t((e) => N?.("autoComplete", e.target.checked), [N]), H = t((e) => N?.("required", e.target.checked), [N]), U = t((e) => N?.("requiredMessage", e), [N]), W = t((e) => N?.("minLength", l(e)), [N]), G = t((e) => N?.("minLengthMessage", e), [N]), K = t((e) => N?.("maxLength", l(e)), [N]), q = t((e) => N?.("maxLengthMessage", e), [N]), J = t((e) => N?.("formatMessage", e), [N]), Y = t((e) => N?.("pattern", e), [N]), X = t((e) => N?.("patternMessage", e), [N]), Z = t((e) => N?.("matches", e), [N]), Q = t((e) => N?.("matchesMessage", e), [N]), $ = t((e) => N?.("readOnly", e.target.checked), [N]), te = t((e) => N?.("disabled", e.target.checked), [N]), ne = t((e) => N?.("previewError", e.target.checked), [N]), re = t((e) => {
|
|
@@ -78,6 +81,18 @@ var l = (e) => {
|
|
|
78
81
|
value: "email",
|
|
79
82
|
children: "Email"
|
|
80
83
|
}),
|
|
84
|
+
/* @__PURE__ */ r("option", {
|
|
85
|
+
value: "search",
|
|
86
|
+
children: "Search"
|
|
87
|
+
}),
|
|
88
|
+
/* @__PURE__ */ r("option", {
|
|
89
|
+
value: "url",
|
|
90
|
+
children: "URL"
|
|
91
|
+
}),
|
|
92
|
+
/* @__PURE__ */ r("option", {
|
|
93
|
+
value: "tel",
|
|
94
|
+
children: "Phone"
|
|
95
|
+
}),
|
|
81
96
|
/* @__PURE__ */ r("option", {
|
|
82
97
|
value: "password",
|
|
83
98
|
children: "Password"
|
|
@@ -51,6 +51,9 @@ var n = {
|
|
|
51
51
|
"number",
|
|
52
52
|
"email",
|
|
53
53
|
"password",
|
|
54
|
+
"search",
|
|
55
|
+
"url",
|
|
56
|
+
"tel",
|
|
54
57
|
"date",
|
|
55
58
|
"time",
|
|
56
59
|
"checkbox",
|
|
@@ -98,7 +101,7 @@ var n = {
|
|
|
98
101
|
definition: {
|
|
99
102
|
label: "Form Control",
|
|
100
103
|
type: "formControl",
|
|
101
|
-
description: "A single labelled input (text/select/checkbox/… per its subType) inside a form; captures one field of user input.",
|
|
104
|
+
description: "A single labelled input (text/select/checkbox/… per its subType) inside a form; captures one field of user input. A select offers its `options`: `[{ label, value }, …]` — the text shown, and what the field takes.",
|
|
102
105
|
bindings: {},
|
|
103
106
|
styleSelectors: {
|
|
104
107
|
base: "",
|
|
@@ -123,7 +126,8 @@ var n = {
|
|
|
123
126
|
verified: !0,
|
|
124
127
|
license: "MIT",
|
|
125
128
|
website: "https://plitzi.com",
|
|
126
|
-
backgroundColor: "#4422ee"
|
|
129
|
+
backgroundColor: "#4422ee",
|
|
130
|
+
icon: "fa-solid fa-i-cursor"
|
|
127
131
|
},
|
|
128
132
|
defaultStyle: {
|
|
129
133
|
name: "Form Control",
|
|
@@ -1,55 +1,63 @@
|
|
|
1
1
|
import e from "../../../Element/hocs/withElement.mjs";
|
|
2
2
|
import t from "../../../Element/hooks/useElement.mjs";
|
|
3
3
|
import { RootElement as n } from "../../../Element/RootElement.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import a from "
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
4
|
+
import { boxOf as r, maskFrameOf as i } from "./mask.mjs";
|
|
5
|
+
import { useCallback as a, useEffect as o } from "react";
|
|
6
|
+
import s from "@plitzi/sdk-shared/hooks/usePlitziServiceContext";
|
|
7
|
+
import { throttle as c } from "@plitzi/plitzi-ui/helpers";
|
|
8
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
9
|
+
import u from "clsx";
|
|
9
10
|
//#region src/elements/internal/LayoutContainer/LayoutContainer.tsx
|
|
10
|
-
var
|
|
11
|
-
let { plitziElementLayout:
|
|
11
|
+
var d = ".plitzi-component__layout-container", f = ".plitzi-component--layout-body", p = (e) => [...e.querySelectorAll(f)].find((e) => !e.querySelector(f)) ?? null, m = ({ ref: e, className: f = "", children: m, subType: h = "div" }) => {
|
|
12
|
+
let { plitziElementLayout: g } = t(), { settings: { previewMode: _ } } = s(), v = a((e, t) => {
|
|
12
13
|
if (!e) return;
|
|
13
14
|
if (!t) {
|
|
14
15
|
e.style.removeProperty("--child-clip");
|
|
15
16
|
return;
|
|
16
17
|
}
|
|
17
|
-
let n =
|
|
18
|
+
let n = r(t);
|
|
19
|
+
if (!n) {
|
|
20
|
+
e.style.removeProperty("--child-clip");
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
let a = i(e), o = a.getBoundingClientRect(), s = a.offsetWidth > 0 ? o.width / a.offsetWidth : 1, c = (n.top - o.top) / s - a.clientTop, l = (n.left - o.left) / s - a.clientLeft, u = l + n.width / s, d = c + n.height / s, f = `
|
|
18
24
|
polygon(
|
|
19
25
|
evenodd,
|
|
20
26
|
/* outer rect */
|
|
21
27
|
0 0, 100% 0, 100% 100%, 0% 100%, 0 0,
|
|
22
28
|
/* inner rect */
|
|
23
|
-
${
|
|
29
|
+
${l}px ${c}px, ${u}px ${c}px, ${u}px ${d}px, ${l}px ${d}px, ${l}px ${c}px
|
|
24
30
|
)`;
|
|
25
|
-
e.style.setProperty("--child-clip",
|
|
31
|
+
e.style.setProperty("--child-clip", f);
|
|
26
32
|
}, []);
|
|
27
|
-
return
|
|
33
|
+
return o(() => {
|
|
28
34
|
let t = e?.current;
|
|
29
|
-
if (!
|
|
30
|
-
let n = null, r =
|
|
31
|
-
let e =
|
|
32
|
-
e !== n && (n &&
|
|
33
|
-
}, 50),
|
|
34
|
-
|
|
35
|
-
let
|
|
36
|
-
|
|
35
|
+
if (!g || !t || _ || t.parentElement?.closest(d)) return;
|
|
36
|
+
let n = null, r = c(() => {
|
|
37
|
+
let e = p(t);
|
|
38
|
+
e !== n && (n && a.unobserve(n), e && a.observe(e), n = e), v(t, e);
|
|
39
|
+
}, 50), a = new ResizeObserver(r);
|
|
40
|
+
a.observe(t);
|
|
41
|
+
let o = i(t);
|
|
42
|
+
o !== t && a.observe(o);
|
|
43
|
+
let s = new MutationObserver(r);
|
|
44
|
+
return s.observe(t, {
|
|
37
45
|
childList: !0,
|
|
38
46
|
subtree: !0
|
|
39
47
|
}), t.addEventListener("scroll", r, !0), r(), () => {
|
|
40
|
-
r.cancel(),
|
|
48
|
+
r.cancel(), a.disconnect(), s.disconnect(), t.removeEventListener("scroll", r, !0);
|
|
41
49
|
};
|
|
42
50
|
}, [
|
|
43
|
-
|
|
44
|
-
|
|
51
|
+
g,
|
|
52
|
+
_,
|
|
45
53
|
e,
|
|
46
|
-
|
|
47
|
-
]), /* @__PURE__ */
|
|
54
|
+
v
|
|
55
|
+
]), /* @__PURE__ */ l(n, {
|
|
48
56
|
ref: e,
|
|
49
|
-
tag:
|
|
50
|
-
className:
|
|
51
|
-
children:
|
|
57
|
+
tag: h,
|
|
58
|
+
className: u("plitzi-component__layout-container", f),
|
|
59
|
+
children: m
|
|
52
60
|
});
|
|
53
|
-
},
|
|
61
|
+
}, h = e(m);
|
|
54
62
|
//#endregion
|
|
55
|
-
export {
|
|
63
|
+
export { m as LayoutContainer, h as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The box an element draws on screen: its own — or, for one with `display: contents`, which draws none, the box around
|
|
3
|
+
* what it holds. A shell or a slot that only marks where something goes is written that way, and measured as itself it
|
|
4
|
+
* is a rect of zeros: the hole closes and the whole page is dimmed.
|
|
5
|
+
*/
|
|
6
|
+
export declare const boxOf: (element: Element) => DOMRect | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* The box the mask is drawn in. The mask is the layout's `::before`, placed over its containing block: the layout's own
|
|
9
|
+
* box — or, when the layout draws none, the nearest ancestor that positions what it holds.
|
|
10
|
+
*/
|
|
11
|
+
export declare const maskFrameOf: (layout: HTMLElement) => HTMLElement;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region src/elements/internal/LayoutContainer/mask.ts
|
|
2
|
+
var e = (e) => getComputedStyle(e).display === "contents", t = (n) => {
|
|
3
|
+
if (!e(n)) return n.getBoundingClientRect();
|
|
4
|
+
let r = [...n.children].map(t).filter((e) => e !== void 0 && (e.width > 0 || e.height > 0));
|
|
5
|
+
if (r.length === 0) return;
|
|
6
|
+
let i = Math.min(...r.map((e) => e.left)), a = Math.min(...r.map((e) => e.top));
|
|
7
|
+
return new DOMRect(i, a, Math.max(...r.map((e) => e.right)) - i, Math.max(...r.map((e) => e.bottom)) - a);
|
|
8
|
+
}, n = (t) => {
|
|
9
|
+
if (!e(t)) return t;
|
|
10
|
+
for (let e = t.parentElement; e; e = e.parentElement) if (getComputedStyle(e).position !== "static") return e;
|
|
11
|
+
return t.ownerDocument.documentElement;
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { t as boxOf, n as maskFrameOf };
|
|
@@ -27,8 +27,14 @@ export type ImageProps = {
|
|
|
27
27
|
* so nothing jumps. */
|
|
28
28
|
width?: number;
|
|
29
29
|
height?: number;
|
|
30
|
+
/**
|
|
31
|
+
* Whether the page server may make sizes of the picture, when it does (`images` in its configuration). `false` keeps
|
|
32
|
+
* this one as it is — a picture already sized for where it sits, or one its host must serve itself. A vector (SVG) is
|
|
33
|
+
* never resized.
|
|
34
|
+
*/
|
|
35
|
+
resize?: boolean;
|
|
30
36
|
};
|
|
31
|
-
declare const Image: ({ ref, className, src: srcProp, alt: altProp, decorative, fetchPriority, loadMode, sizes, width, height }: ImageProps) => import('react').JSX.Element;
|
|
37
|
+
declare const Image: ({ ref, className, src: srcProp, alt: altProp, decorative, fetchPriority, loadMode, sizes, width, height, resize }: ImageProps) => import('react').JSX.Element;
|
|
32
38
|
declare const _default: {
|
|
33
39
|
(props: import('../../../Element/hocs/withElement').WithElementProps<ImageProps>): import('react').JSX.Element;
|
|
34
40
|
displayName: string;
|
|
@@ -6,16 +6,16 @@ import a from "@plitzi/sdk-shared/hooks/usePlitziServiceContext";
|
|
|
6
6
|
import { useCommonStore as o } from "@plitzi/sdk-shared/store";
|
|
7
7
|
import { jsx as s } from "react/jsx-runtime";
|
|
8
8
|
import c from "clsx";
|
|
9
|
-
import { imageSrcSet as l, imageUrl as u,
|
|
9
|
+
import { imageSrcSet as l, imageUrl as u, isResizableImage as d } from "@plitzi/sdk-shared/helpers/images";
|
|
10
10
|
//#region src/elements/media/Image/Image.tsx
|
|
11
|
-
var f = 1280, p = n(), m =
|
|
12
|
-
let { settings: { previewMode: C } } = a(), w =
|
|
11
|
+
var f = 1280, p = n(), m = ({ ref: e, className: n = "", src: m, alt: h = "", decorative: g = !1, fetchPriority: _ = "auto", loadMode: v, sizes: y = "100vw", width: b, height: x, resize: S = !0 }) => {
|
|
12
|
+
let { settings: { previewMode: C } } = a(), w = m || p, T = g ? "" : h, [E, D] = i(void 0), O = E === w, k = r(() => D(w), [w]), A = O ? p : w, j = O ? { "data-plitzi-failed": w } : {}, M = v === "auto" ? void 0 : v, [N] = o("images.endpoint"), P = C && N && S && !O && d(w) ? {
|
|
13
13
|
src: u(N, w, f),
|
|
14
14
|
srcSet: l(N, w),
|
|
15
|
-
sizes:
|
|
15
|
+
sizes: y
|
|
16
16
|
} : { src: A }, F = {
|
|
17
|
-
...
|
|
18
|
-
...
|
|
17
|
+
...b ? { width: b } : {},
|
|
18
|
+
...x ? { height: x } : {}
|
|
19
19
|
};
|
|
20
20
|
return C ? /* @__PURE__ */ s(t, {
|
|
21
21
|
tag: "img",
|
|
@@ -26,7 +26,7 @@ var f = 1280, p = n(), m = "https://cdn.plitzi.com/resources/img/placeholder-img
|
|
|
26
26
|
...F,
|
|
27
27
|
alt: T,
|
|
28
28
|
loading: M,
|
|
29
|
-
fetchPriority:
|
|
29
|
+
fetchPriority: _,
|
|
30
30
|
onError: O ? void 0 : k,
|
|
31
31
|
...j
|
|
32
32
|
}) : /* @__PURE__ */ s(t, {
|
|
@@ -37,11 +37,11 @@ var f = 1280, p = n(), m = "https://cdn.plitzi.com/resources/img/placeholder-img
|
|
|
37
37
|
src: A,
|
|
38
38
|
alt: T,
|
|
39
39
|
loading: M,
|
|
40
|
-
fetchPriority:
|
|
40
|
+
fetchPriority: _,
|
|
41
41
|
onError: O ? void 0 : k,
|
|
42
42
|
...j
|
|
43
43
|
})
|
|
44
44
|
});
|
|
45
|
-
},
|
|
45
|
+
}, h = e(m);
|
|
46
46
|
//#endregion
|
|
47
|
-
export {
|
|
47
|
+
export { m as Image, h as default };
|
|
@@ -10,7 +10,7 @@ declare const declaration: {
|
|
|
10
10
|
};
|
|
11
11
|
readonly content: {
|
|
12
12
|
readonly attributes: {
|
|
13
|
-
readonly src: "
|
|
13
|
+
readonly src: "";
|
|
14
14
|
readonly alt: "";
|
|
15
15
|
readonly decorative: false;
|
|
16
16
|
readonly fetchPriority: "auto";
|
|
@@ -62,6 +62,7 @@ declare const declaration: {
|
|
|
62
62
|
readonly settings: {};
|
|
63
63
|
};
|
|
64
64
|
} & import('@plitzi/sdk-shared/authoring/declare').ElementAttributesBrand<Partial<{
|
|
65
|
+
resize?: boolean | undefined;
|
|
65
66
|
height?: number | undefined;
|
|
66
67
|
width?: number | undefined;
|
|
67
68
|
fetchPriority?: "high" | "low" | "auto" | undefined;
|
|
@@ -9,7 +9,7 @@ declare const Image: {
|
|
|
9
9
|
};
|
|
10
10
|
readonly content: {
|
|
11
11
|
readonly attributes: {
|
|
12
|
-
readonly src: "
|
|
12
|
+
readonly src: "";
|
|
13
13
|
readonly alt: "";
|
|
14
14
|
readonly decorative: false;
|
|
15
15
|
readonly fetchPriority: "auto";
|
|
@@ -61,6 +61,7 @@ declare const Image: {
|
|
|
61
61
|
readonly settings: {};
|
|
62
62
|
};
|
|
63
63
|
} & import('@plitzi/sdk-shared/authoring/declare').ElementAttributesBrand<Partial<{
|
|
64
|
+
resize?: boolean | undefined;
|
|
64
65
|
height?: number | undefined;
|
|
65
66
|
width?: number | undefined;
|
|
66
67
|
fetchPriority?: "high" | "low" | "auto" | undefined;
|
|
@@ -27,6 +27,14 @@ export type ApiContainerProps = {
|
|
|
27
27
|
* route and query params, and answers whatever its output step returns.
|
|
28
28
|
*/
|
|
29
29
|
action?: string;
|
|
30
|
+
/**
|
|
31
|
+
* What a server provider asks its action with, on top of the page's own route and query params — a search, a filter.
|
|
32
|
+
*
|
|
33
|
+
* Saved, it is what the page server resolves the first paint with. Bound — to a state the visitor changes — every
|
|
34
|
+
* change asks again with the new value, the way a bound `query` does for a browser provider; `reloadApi` with an
|
|
35
|
+
* input asks once.
|
|
36
|
+
*/
|
|
37
|
+
input?: Record<string, unknown> | string;
|
|
30
38
|
/** Which of the connector's read endpoints to execute. Defaults to `list`. */
|
|
31
39
|
endpoint?: string;
|
|
32
40
|
/** Content type / collection read through the connector. */
|
|
@@ -75,7 +83,7 @@ export type ApiContainerProps = {
|
|
|
75
83
|
*/
|
|
76
84
|
refreshSeconds?: number | string;
|
|
77
85
|
};
|
|
78
|
-
declare const ApiContainer: ({ ref, className, children, query, method, accessToken, when, headers, mockData, subType, credentials, singleRecord, pagination, pageParam, renderWhileLoading, loadingSlot, cache, staleTime, gcTime, refreshSeconds }: ApiContainerProps) => import('react').JSX.Element;
|
|
86
|
+
declare const ApiContainer: ({ ref, className, children, query, method, accessToken, when, headers, mockData, subType, credentials, singleRecord, pagination, pageParam, renderWhileLoading, loadingSlot, cache, staleTime, gcTime, refreshSeconds, connector, action, input }: ApiContainerProps) => import('react').JSX.Element;
|
|
79
87
|
declare const _default: {
|
|
80
88
|
(props: import('../../../Element/hocs/withElement').WithElementProps<ApiContainerProps>): import('react').JSX.Element;
|
|
81
89
|
displayName: string;
|