@plitzi/sdk-elements 0.38.13 → 0.38.15
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 +263 -0
- package/dist/components/MarkdownDocument/components/CodeBlock/CodeBlock.mjs +23 -17
- package/dist/elements/advanced/PlitziSdk/Settings.mjs +42 -27
- package/dist/elements/advanced/PlitziSdk/declaration.d.ts +39 -0
- package/dist/elements/advanced/PlitziSdk/declaration.mjs +22 -0
- package/dist/elements/basic/Dropdown/Dropdown.d.ts +1 -1
- package/dist/elements/basic/Dropdown/Dropdown.mjs +65 -51
- package/dist/elements/basic/Dropdown/DropdownContext.d.ts +2 -0
- package/dist/elements/basic/Dropdown/DropdownPopup/DropdownPopup.mjs +13 -10
- package/dist/elements/basic/Dropdown/useDropdownTrigger.d.ts +3 -1
- package/dist/elements/basic/Dropdown/useDropdownTrigger.mjs +12 -14
- package/dist/elements/declarations/index.d.ts +30 -1
- package/dist/elements/declarations/index.mjs +77 -75
- package/dist/elements/internal/Page/Page.d.ts +12 -1
- package/dist/elements/internal/Page/Page.mjs +29 -22
- package/dist/elements/internal/Page/Settings.d.ts +3 -1
- package/dist/elements/internal/Page/Settings.mjs +65 -33
- package/dist/elements/internal/Page/declaration.d.ts +11 -0
- package/dist/elements/internal/Page/declaration.mjs +3 -2
- package/dist/elements/internal/Page/index.d.ts +4 -0
- package/dist/elements/provider/Channel/Channel.mjs +3 -1
- package/dist/elements/provider/Channel/declaration.mjs +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/realtime/useChannel.d.ts +7 -1
- package/dist/realtime/useChannel.mjs +43 -35
- package/package.json +11 -7
|
@@ -4,16 +4,19 @@ import n from "../DropdownContext.mjs";
|
|
|
4
4
|
import { use as r, useImperativeHandle as i } from "react";
|
|
5
5
|
import { jsx as a } from "react/jsx-runtime";
|
|
6
6
|
import o from "clsx";
|
|
7
|
+
import { createPortal as s } from "react-dom";
|
|
7
8
|
//#region src/elements/basic/Dropdown/DropdownPopup/DropdownPopup.tsx
|
|
8
|
-
var
|
|
9
|
-
let { popupRef:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
var c = ({ ref: e, className: c = "", children: l }) => {
|
|
10
|
+
let { popupRef: u, openPopup: d, parameters: f, onClick: p, layer: m } = r(n);
|
|
11
|
+
i(e, () => u.current ?? null, [u]);
|
|
12
|
+
let h = /* @__PURE__ */ a(t, {
|
|
13
|
+
ref: u,
|
|
14
|
+
className: o("plitzi-component__dropdown-popup", c, { "popup-container--no-visible": !d || !f }),
|
|
15
|
+
style: f,
|
|
16
|
+
onClick: p,
|
|
17
|
+
children: l
|
|
16
18
|
});
|
|
17
|
-
|
|
19
|
+
return m ? s(h, m) : h;
|
|
20
|
+
}, l = e(c);
|
|
18
21
|
//#endregion
|
|
19
|
-
export {
|
|
22
|
+
export { c as DropdownPopup, l as default };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { MouseEvent, RefObject } from 'react';
|
|
2
2
|
export type UseDropdownTriggerProps = {
|
|
3
|
+
/** The dropdown's own element, where its trigger is. */
|
|
4
|
+
rootRef?: RefObject<HTMLElement | null>;
|
|
3
5
|
popupRef: RefObject<HTMLElement | null>;
|
|
4
6
|
open: boolean;
|
|
5
7
|
/** Where the popup is drawn; until it is known the popup is hidden, and nothing in it can take the focus. */
|
|
@@ -22,5 +24,5 @@ export type UseDropdownTriggerProps = {
|
|
|
22
24
|
*
|
|
23
25
|
* @returns what the dropdown's own click handler calls first, to learn whether a keyboard pressed the trigger.
|
|
24
26
|
*/
|
|
25
|
-
declare const useDropdownTrigger: ({ popupRef, open, positioned, enabled }: UseDropdownTriggerProps) => ((event: MouseEvent) => void);
|
|
27
|
+
declare const useDropdownTrigger: ({ rootRef, popupRef, open, positioned, enabled }: UseDropdownTriggerProps) => ((event: MouseEvent) => void);
|
|
26
28
|
export default useDropdownTrigger;
|
|
@@ -1,30 +1,28 @@
|
|
|
1
1
|
import { useCallback as e, useEffect as t, useRef as n } from "react";
|
|
2
2
|
//#region src/elements/basic/Dropdown/useDropdownTrigger.ts
|
|
3
|
-
var r = "button, a[href], input, select, textarea, [role=\"button\"]", i = (e) => {
|
|
4
|
-
let
|
|
5
|
-
|
|
6
|
-
}, a = ({ popupRef: a, open: o, positioned: s, enabled: c }) => {
|
|
7
|
-
let l = n(!1), u = n(o), d = e((e) => {
|
|
8
|
-
l.current = e.detail === 0;
|
|
3
|
+
var r = "button, a[href], input, select, textarea, [role=\"button\"]", i = (e, t) => e ? [...e.querySelectorAll(r)].find((e) => !t?.contains(e)) : void 0, a = ({ rootRef: a, popupRef: o, open: s, positioned: c, enabled: l }) => {
|
|
4
|
+
let u = n(!1), d = n(s), f = e((e) => {
|
|
5
|
+
u.current = e.detail === 0;
|
|
9
6
|
}, []);
|
|
10
7
|
return t(() => {
|
|
11
|
-
let e =
|
|
12
|
-
e && (e.setAttribute("aria-haspopup", "true"), e.setAttribute("aria-expanded", String(
|
|
8
|
+
let e = l ? i(a?.current, o.current) : void 0;
|
|
9
|
+
e && (e.setAttribute("aria-haspopup", "true"), e.setAttribute("aria-expanded", String(s)));
|
|
13
10
|
}), t(() => {
|
|
14
|
-
let e =
|
|
15
|
-
if (
|
|
11
|
+
let e = o.current, t = d.current && !s;
|
|
12
|
+
if (d.current = s, l && e) {
|
|
16
13
|
if (t && e.contains(e.ownerDocument.activeElement)) {
|
|
17
|
-
i(e)?.focus({ preventScroll: !0 });
|
|
14
|
+
i(a?.current, e)?.focus({ preventScroll: !0 });
|
|
18
15
|
return;
|
|
19
16
|
}
|
|
20
|
-
|
|
17
|
+
s && c && u.current && !e.contains(e.ownerDocument.activeElement) && (u.current = !1, e.querySelector(r)?.focus({ preventScroll: !0 }));
|
|
21
18
|
}
|
|
22
19
|
}, [
|
|
20
|
+
l,
|
|
21
|
+
s,
|
|
23
22
|
c,
|
|
24
23
|
o,
|
|
25
|
-
s,
|
|
26
24
|
a
|
|
27
|
-
]),
|
|
25
|
+
]), f;
|
|
28
26
|
};
|
|
29
27
|
//#endregion
|
|
30
28
|
export { a as default };
|
|
@@ -2,6 +2,7 @@ import { default as BlockHtmlDeclaration } from '../advanced/BlockHtml/declarati
|
|
|
2
2
|
import { default as BlockJsxDeclaration } from '../advanced/BlockJsx/declaration';
|
|
3
3
|
import { default as CustomDeclaration } from '../advanced/Custom/declaration';
|
|
4
4
|
import { default as NodeHtmlDeclaration } from '../advanced/NodeHtml/declaration';
|
|
5
|
+
import { default as PlitziSdkDeclaration } from '../advanced/PlitziSdk/declaration';
|
|
5
6
|
import { default as ReferenceDeclaration } from '../advanced/Reference/declaration';
|
|
6
7
|
import { default as ButtonDeclaration } from '../basic/Button/declaration';
|
|
7
8
|
import { default as DropdownDeclaration } from '../basic/Dropdown/declaration';
|
|
@@ -2955,6 +2956,9 @@ export declare const elementDeclarations: {
|
|
|
2955
2956
|
readonly Page: import('@plitzi/sdk-shared/authoring/declare').DeclaredElement<{
|
|
2956
2957
|
readonly type: "page";
|
|
2957
2958
|
readonly serverTemplates: readonly ["seoPageTitle", "seoPageDescription", "notFound"];
|
|
2959
|
+
readonly attributeValues: {
|
|
2960
|
+
readonly documentScroll: readonly ["locked", "noBounce"];
|
|
2961
|
+
};
|
|
2958
2962
|
readonly triggers: {
|
|
2959
2963
|
readonly onPageLoad: {
|
|
2960
2964
|
readonly action: "onPageLoad";
|
|
@@ -3020,6 +3024,7 @@ export declare const elementDeclarations: {
|
|
|
3020
3024
|
seoEnabled?: boolean | undefined;
|
|
3021
3025
|
seoPageTitle?: string | undefined;
|
|
3022
3026
|
seoPageDescription?: string | undefined;
|
|
3027
|
+
documentScroll?: (import('../internal/Page/declaration').DocumentScroll | "") | undefined;
|
|
3023
3028
|
}>>;
|
|
3024
3029
|
readonly Pagination: import('@plitzi/sdk-shared/authoring/declare').DeclaredElement<{
|
|
3025
3030
|
readonly type: "pagination";
|
|
@@ -3117,6 +3122,30 @@ export declare const elementDeclarations: {
|
|
|
3117
3122
|
}, Partial<{
|
|
3118
3123
|
content?: string | number | undefined;
|
|
3119
3124
|
}>>;
|
|
3125
|
+
readonly PlitziSdk: import('@plitzi/sdk-shared/authoring/declare').DeclaredElement<{
|
|
3126
|
+
readonly type: "plitziSdk";
|
|
3127
|
+
readonly content: {
|
|
3128
|
+
readonly attributes: {
|
|
3129
|
+
readonly spaceKey: "";
|
|
3130
|
+
readonly environment: "main";
|
|
3131
|
+
};
|
|
3132
|
+
readonly definition: {
|
|
3133
|
+
readonly label: "Plitzi Sdk";
|
|
3134
|
+
readonly description: "Another space drawn inside this one, as a widget — its home page, no router of its own: by its key, or from its documents (`offlineData`), bound to UI generated on the fly.";
|
|
3135
|
+
};
|
|
3136
|
+
readonly market: {
|
|
3137
|
+
readonly category: "advanced";
|
|
3138
|
+
readonly icon: "https://cdn.plitzi.com/resources/img/favicon.svg";
|
|
3139
|
+
};
|
|
3140
|
+
readonly defaultStyle: {
|
|
3141
|
+
readonly style: {
|
|
3142
|
+
readonly base: {
|
|
3143
|
+
readonly default: {};
|
|
3144
|
+
};
|
|
3145
|
+
};
|
|
3146
|
+
};
|
|
3147
|
+
};
|
|
3148
|
+
}, import('../advanced/PlitziSdk/declaration').PlitziSdkAttributes>;
|
|
3120
3149
|
readonly Reference: import('@plitzi/sdk-shared/authoring/declare').DeclaredElement<{
|
|
3121
3150
|
readonly type: "reference";
|
|
3122
3151
|
readonly content: {
|
|
@@ -3527,7 +3556,7 @@ export declare const elementDeclarations: {
|
|
|
3527
3556
|
}>>;
|
|
3528
3557
|
};
|
|
3529
3558
|
export type ElementDeclarationName = keyof typeof elementDeclarations;
|
|
3530
|
-
export { ApiContainerDeclaration, BlockHtmlDeclaration, BlockJsxDeclaration, ButtonDeclaration, CarouselDeclaration, CarouselTrackDeclaration, ChannelDeclaration, ContainerDeclaration, CustomDeclaration, DialogContainerDeclaration, DropdownDeclaration, DropdownPopupDeclaration, EmbedDeclaration, FontAwesomeDeclaration, FormControlDeclaration, FormDeclaration, HeadingDeclaration, ImageDeclaration, LayoutContainerDeclaration, LinkDeclaration, ListDeclaration, ListItemDeclaration, LoadingDeclaration, MarkdownDeclaration, ModalContainerDeclaration, NodeHtmlDeclaration, NotFoundDeclaration, PageDeclaration, PaginationDeclaration, ParagraphDeclaration, ReferenceDeclaration, RichTextDeclaration, SvgDeclaration, TabContainerBodyDeclaration, TabContainerDeclaration, TabContainerHeaderDeclaration, TabContainerItemDeclaration, TextDeclaration, ThemeToggleDeclaration, VideoDeclaration };
|
|
3559
|
+
export { ApiContainerDeclaration, BlockHtmlDeclaration, BlockJsxDeclaration, ButtonDeclaration, CarouselDeclaration, CarouselTrackDeclaration, ChannelDeclaration, ContainerDeclaration, CustomDeclaration, DialogContainerDeclaration, DropdownDeclaration, DropdownPopupDeclaration, EmbedDeclaration, FontAwesomeDeclaration, FormControlDeclaration, FormDeclaration, HeadingDeclaration, ImageDeclaration, LayoutContainerDeclaration, LinkDeclaration, ListDeclaration, ListItemDeclaration, LoadingDeclaration, MarkdownDeclaration, ModalContainerDeclaration, NodeHtmlDeclaration, NotFoundDeclaration, PageDeclaration, PaginationDeclaration, ParagraphDeclaration, PlitziSdkDeclaration, ReferenceDeclaration, RichTextDeclaration, SvgDeclaration, TabContainerBodyDeclaration, TabContainerDeclaration, TabContainerHeaderDeclaration, TabContainerItemDeclaration, TextDeclaration, ThemeToggleDeclaration, VideoDeclaration };
|
|
3531
3560
|
/**
|
|
3532
3561
|
* Each type's `serverTemplates`, by the type a document names: the attributes the page server evaluates against a
|
|
3533
3562
|
* context of its own, which the element runtime leaves as written and the authoring lint holds to that context.
|
|
@@ -2,84 +2,86 @@ import e from "../advanced/BlockHtml/declaration.mjs";
|
|
|
2
2
|
import t from "../advanced/BlockJsx/declaration.mjs";
|
|
3
3
|
import n from "../advanced/Custom/declaration.mjs";
|
|
4
4
|
import r from "../advanced/NodeHtml/declaration.mjs";
|
|
5
|
-
import i from "../advanced/
|
|
6
|
-
import a from "../
|
|
7
|
-
import o from "../basic/
|
|
8
|
-
import s from "../basic/Dropdown/
|
|
9
|
-
import c from "../basic/
|
|
10
|
-
import l from "../basic/
|
|
11
|
-
import u from "../basic/
|
|
12
|
-
import d from "../basic/
|
|
13
|
-
import f from "../basic/
|
|
14
|
-
import p from "../basic/
|
|
15
|
-
import m from "../basic/
|
|
16
|
-
import h from "../
|
|
17
|
-
import g from "../form/
|
|
18
|
-
import _ from "../
|
|
19
|
-
import v from "../internal/
|
|
20
|
-
import y from "../internal/
|
|
21
|
-
import b from "../internal/
|
|
22
|
-
import x from "../
|
|
23
|
-
import S from "../media/
|
|
24
|
-
import C from "../media/
|
|
25
|
-
import w from "../media/
|
|
26
|
-
import T from "../media/
|
|
27
|
-
import E from "../
|
|
28
|
-
import D from "../provider/
|
|
29
|
-
import O from "../
|
|
30
|
-
import k from "../structure/Carousel/declaration.mjs";
|
|
31
|
-
import A from "../structure/
|
|
32
|
-
import j from "../structure/
|
|
33
|
-
import M from "../structure/
|
|
34
|
-
import N from "../structure/List/
|
|
35
|
-
import P from "../structure/
|
|
36
|
-
import F from "../structure/
|
|
37
|
-
import I from "../structure/
|
|
38
|
-
import L from "../structure/TabContainer/
|
|
39
|
-
import R from "../structure/TabContainer/
|
|
40
|
-
import z from "../structure/TabContainer/
|
|
5
|
+
import i from "../advanced/PlitziSdk/declaration.mjs";
|
|
6
|
+
import a from "../advanced/Reference/declaration.mjs";
|
|
7
|
+
import o from "../basic/Button/declaration.mjs";
|
|
8
|
+
import s from "../basic/Dropdown/declaration.mjs";
|
|
9
|
+
import c from "../basic/Dropdown/DropdownPopup/declaration.mjs";
|
|
10
|
+
import l from "../basic/Heading/declaration.mjs";
|
|
11
|
+
import u from "../basic/Link/declaration.mjs";
|
|
12
|
+
import d from "../basic/Markdown/declaration.mjs";
|
|
13
|
+
import f from "../basic/Paragraph/declaration.mjs";
|
|
14
|
+
import p from "../basic/RichText/declaration.mjs";
|
|
15
|
+
import m from "../basic/Text/declaration.mjs";
|
|
16
|
+
import h from "../basic/ThemeToggle/declaration.mjs";
|
|
17
|
+
import g from "../form/Form/declaration.mjs";
|
|
18
|
+
import _ from "../form/FormControl/declaration.mjs";
|
|
19
|
+
import v from "../internal/LayoutContainer/declaration.mjs";
|
|
20
|
+
import y from "../internal/Loading/declaration.mjs";
|
|
21
|
+
import b from "../internal/NotFound/declaration.mjs";
|
|
22
|
+
import x from "../internal/Page/declaration.mjs";
|
|
23
|
+
import S from "../media/Embed/declaration.mjs";
|
|
24
|
+
import C from "../media/FontAwesome/declaration.mjs";
|
|
25
|
+
import w from "../media/Image/declaration.mjs";
|
|
26
|
+
import T from "../media/Svg/declaration.mjs";
|
|
27
|
+
import E from "../media/Video/declaration.mjs";
|
|
28
|
+
import D from "../provider/ApiContainer/declaration.mjs";
|
|
29
|
+
import O from "../provider/Channel/declaration.mjs";
|
|
30
|
+
import k from "../structure/Carousel/CarouselTrack/declaration.mjs";
|
|
31
|
+
import A from "../structure/Carousel/declaration.mjs";
|
|
32
|
+
import j from "../structure/Container/declaration.mjs";
|
|
33
|
+
import M from "../structure/DialogContainer/declaration.mjs";
|
|
34
|
+
import N from "../structure/List/declaration.mjs";
|
|
35
|
+
import P from "../structure/List/ListItem/declaration.mjs";
|
|
36
|
+
import F from "../structure/ModalContainer/declaration.mjs";
|
|
37
|
+
import I from "../structure/Pagination/declaration.mjs";
|
|
38
|
+
import L from "../structure/TabContainer/declaration.mjs";
|
|
39
|
+
import R from "../structure/TabContainer/TabContainerBody/declaration.mjs";
|
|
40
|
+
import z from "../structure/TabContainer/TabContainerHeader/declaration.mjs";
|
|
41
|
+
import B from "../structure/TabContainer/TabContainerItem/declaration.mjs";
|
|
41
42
|
//#region src/elements/declarations/index.ts
|
|
42
|
-
var
|
|
43
|
-
ApiContainer:
|
|
43
|
+
var V = {
|
|
44
|
+
ApiContainer: D,
|
|
44
45
|
BlockHtml: e,
|
|
45
46
|
BlockJsx: t,
|
|
46
|
-
Button:
|
|
47
|
-
Carousel:
|
|
48
|
-
CarouselTrack:
|
|
49
|
-
Channel:
|
|
50
|
-
Container:
|
|
47
|
+
Button: o,
|
|
48
|
+
Carousel: A,
|
|
49
|
+
CarouselTrack: k,
|
|
50
|
+
Channel: O,
|
|
51
|
+
Container: j,
|
|
51
52
|
Custom: n,
|
|
52
|
-
DialogContainer:
|
|
53
|
-
Dropdown:
|
|
54
|
-
DropdownPopup:
|
|
55
|
-
Embed:
|
|
56
|
-
FontAwesome:
|
|
57
|
-
Form:
|
|
58
|
-
FormControl:
|
|
59
|
-
Heading:
|
|
60
|
-
Image:
|
|
61
|
-
LayoutContainer:
|
|
62
|
-
Link:
|
|
63
|
-
List:
|
|
64
|
-
ListItem:
|
|
65
|
-
Loading:
|
|
66
|
-
Markdown:
|
|
67
|
-
ModalContainer:
|
|
53
|
+
DialogContainer: M,
|
|
54
|
+
Dropdown: s,
|
|
55
|
+
DropdownPopup: c,
|
|
56
|
+
Embed: S,
|
|
57
|
+
FontAwesome: C,
|
|
58
|
+
Form: g,
|
|
59
|
+
FormControl: _,
|
|
60
|
+
Heading: l,
|
|
61
|
+
Image: w,
|
|
62
|
+
LayoutContainer: v,
|
|
63
|
+
Link: u,
|
|
64
|
+
List: N,
|
|
65
|
+
ListItem: P,
|
|
66
|
+
Loading: y,
|
|
67
|
+
Markdown: d,
|
|
68
|
+
ModalContainer: F,
|
|
68
69
|
NodeHtml: r,
|
|
69
|
-
NotFound:
|
|
70
|
-
Page:
|
|
71
|
-
Pagination:
|
|
72
|
-
Paragraph:
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
70
|
+
NotFound: b,
|
|
71
|
+
Page: x,
|
|
72
|
+
Pagination: I,
|
|
73
|
+
Paragraph: f,
|
|
74
|
+
PlitziSdk: i,
|
|
75
|
+
Reference: a,
|
|
76
|
+
RichText: p,
|
|
77
|
+
Svg: T,
|
|
78
|
+
TabContainer: L,
|
|
79
|
+
TabContainerBody: R,
|
|
80
|
+
TabContainerHeader: z,
|
|
81
|
+
TabContainerItem: B,
|
|
82
|
+
Text: m,
|
|
83
|
+
ThemeToggle: h,
|
|
84
|
+
Video: E
|
|
85
|
+
}, H = Object.fromEntries(Object.values(V).flatMap((e) => "serverTemplates" in e ? [[e.type, e.serverTemplates]] : []));
|
|
84
86
|
//#endregion
|
|
85
|
-
export {
|
|
87
|
+
export { D as ApiContainerDeclaration, e as BlockHtmlDeclaration, t as BlockJsxDeclaration, o as ButtonDeclaration, A as CarouselDeclaration, k as CarouselTrackDeclaration, O as ChannelDeclaration, j as ContainerDeclaration, n as CustomDeclaration, M as DialogContainerDeclaration, s as DropdownDeclaration, c as DropdownPopupDeclaration, S as EmbedDeclaration, C as FontAwesomeDeclaration, _ as FormControlDeclaration, g as FormDeclaration, l as HeadingDeclaration, w as ImageDeclaration, v as LayoutContainerDeclaration, u as LinkDeclaration, N as ListDeclaration, P as ListItemDeclaration, y as LoadingDeclaration, d as MarkdownDeclaration, F as ModalContainerDeclaration, r as NodeHtmlDeclaration, b as NotFoundDeclaration, x as PageDeclaration, I as PaginationDeclaration, f as ParagraphDeclaration, i as PlitziSdkDeclaration, a as ReferenceDeclaration, p as RichTextDeclaration, T as SvgDeclaration, R as TabContainerBodyDeclaration, L as TabContainerDeclaration, z as TabContainerHeaderDeclaration, B as TabContainerItemDeclaration, m as TextDeclaration, h as ThemeToggleDeclaration, E as VideoDeclaration, V as elementDeclarations, H as serverTemplatesByType };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DocumentScroll } from './declaration';
|
|
1
2
|
import { ReactNode, RefObject } from 'react';
|
|
2
3
|
export type PageProps = {
|
|
3
4
|
ref?: RefObject<HTMLElement>;
|
|
@@ -9,12 +10,22 @@ export type PageProps = {
|
|
|
9
10
|
* is not there: the page server sends it with status 404, rendered as written. Read there only (`serverTemplates`).
|
|
10
11
|
*/
|
|
11
12
|
notFound?: string;
|
|
13
|
+
/**
|
|
14
|
+
* How the document this page is drawn in moves. Unset, it scrolls as any page does. `noBounce` keeps the scroll and
|
|
15
|
+
* takes away what a finger pulls past either end — iOS's rubber band, the browser's pull-to-refresh. `locked` holds the
|
|
16
|
+
* document still: a dashboard, a board, a screen that fills the window and scrolls only inside the panels that say so
|
|
17
|
+
* (`overflow: auto` on their own) — on a tablet a finger dragged anywhere else otherwise pulled the whole page.
|
|
18
|
+
*
|
|
19
|
+
* Written onto the document only when the document is the page's own — never onto the one a widget or a space drawn
|
|
20
|
+
* inside another space is embedded in, nor the builder's.
|
|
21
|
+
*/
|
|
22
|
+
documentScroll?: DocumentScroll | '';
|
|
12
23
|
className?: string;
|
|
13
24
|
layout?: string;
|
|
14
25
|
layoutContainer?: string;
|
|
15
26
|
children?: ReactNode;
|
|
16
27
|
};
|
|
17
|
-
declare const Page: ({ ref, seoEnabled, seoPageTitle, seoPageDescription, className, layout, layoutContainer, children }: PageProps) => import('react').JSX.Element;
|
|
28
|
+
declare const Page: ({ ref, seoEnabled, seoPageTitle, seoPageDescription, documentScroll, className, layout, layoutContainer, children }: PageProps) => import('react').JSX.Element;
|
|
18
29
|
declare const _default: {
|
|
19
30
|
(props: import('../../../Element/hocs/withElement').WithElementProps<PageProps>): import('react').JSX.Element;
|
|
20
31
|
displayName: string;
|
|
@@ -13,52 +13,59 @@ import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
|
13
13
|
import g from "clsx";
|
|
14
14
|
import _ from "@plitzi/sdk-interactions/InteractionsContext";
|
|
15
15
|
//#region src/elements/internal/Page/Page.tsx
|
|
16
|
-
var v =
|
|
16
|
+
var v = {
|
|
17
|
+
locked: "html,body{height:100%;overflow:hidden;overscroll-behavior:none}",
|
|
18
|
+
noBounce: "html,body{overscroll-behavior:none}"
|
|
19
|
+
}, y = (e) => e.map((e) => ({
|
|
17
20
|
...e,
|
|
18
21
|
plitziElementLayout: {
|
|
19
22
|
slots: [e.slot],
|
|
20
23
|
rootId: e.slot,
|
|
21
24
|
type: "layout"
|
|
22
25
|
}
|
|
23
|
-
})),
|
|
26
|
+
})), b = (t, n, r) => t.reduce((t, { layout: r, slot: i, plitziElementLayout: o }) => /* @__PURE__ */ m(e, {
|
|
24
27
|
bodies: { [i]: t },
|
|
25
28
|
children: /* @__PURE__ */ m(a, { internalProps: {
|
|
26
29
|
id: r,
|
|
27
30
|
rootId: n,
|
|
28
31
|
plitziElementLayout: o
|
|
29
32
|
} })
|
|
30
|
-
}, i), r),
|
|
31
|
-
let { id:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
}, i), r), x = ({ ref: e, seoEnabled: n = !1, seoPageTitle: a = "Title", seoPageDescription: x = "Description", documentScroll: S = "", className: C = "", layout: w = "", layoutContainer: T = "", children: E }) => {
|
|
34
|
+
let { id: D } = r(), { settings: { previewMode: O } } = d(), { interactionsManager: k } = c(_), { ownsHead: A, renderMode: j } = f(), M = A && j !== "widget", [[N, P]] = p(["navigation.routeParams", "navigation.queryParams"]), F = o(w, T), I = u(() => y(F), [F]), L = u(() => b(I, D, E), [
|
|
35
|
+
I,
|
|
36
|
+
D,
|
|
37
|
+
E
|
|
35
38
|
]);
|
|
36
39
|
return l(() => {
|
|
37
40
|
let e = !1;
|
|
38
41
|
return queueMicrotask(() => {
|
|
39
|
-
e ||
|
|
40
|
-
pageId:
|
|
41
|
-
routeParams:
|
|
42
|
-
queryParams:
|
|
42
|
+
e || k.interactionTrigger(D, "onPageLoad", {
|
|
43
|
+
pageId: D,
|
|
44
|
+
routeParams: N,
|
|
45
|
+
queryParams: P
|
|
43
46
|
});
|
|
44
47
|
}), () => {
|
|
45
48
|
e = !0;
|
|
46
49
|
};
|
|
47
50
|
}, [
|
|
48
|
-
T,
|
|
49
51
|
D,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
+
k,
|
|
53
|
+
P,
|
|
54
|
+
N
|
|
52
55
|
]), /* @__PURE__ */ h(i, {
|
|
53
56
|
ref: e,
|
|
54
|
-
className: g("plitzi-component__page",
|
|
57
|
+
className: g("plitzi-component__page", C),
|
|
55
58
|
interactionTriggers: t.triggers,
|
|
56
|
-
children: [
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
children: [
|
|
60
|
+
n && O && A && /* @__PURE__ */ m(s, {
|
|
61
|
+
pageId: D,
|
|
62
|
+
title: a,
|
|
63
|
+
description: x
|
|
64
|
+
}),
|
|
65
|
+
S && M && /* @__PURE__ */ m("style", { children: v[S] }),
|
|
66
|
+
L
|
|
67
|
+
]
|
|
61
68
|
});
|
|
62
|
-
},
|
|
69
|
+
}, S = n(x);
|
|
63
70
|
//#endregion
|
|
64
|
-
export {
|
|
71
|
+
export { x as Page, S as default };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DocumentScroll } from './declaration';
|
|
1
2
|
type SettingsProps = {
|
|
2
3
|
id?: string;
|
|
3
4
|
seoEnabled?: boolean;
|
|
@@ -12,7 +13,8 @@ type SettingsProps = {
|
|
|
12
13
|
accessLevel?: 'public' | 'authenticated' | '';
|
|
13
14
|
unauthorizedBehaviour?: '' | 'redirect';
|
|
14
15
|
unauthorizedPageRedirect?: string;
|
|
16
|
+
documentScroll?: DocumentScroll | '';
|
|
15
17
|
onUpdate?: (key: string, value: string | boolean | number) => void;
|
|
16
18
|
};
|
|
17
|
-
declare const Settings: ({ id, seoEnabled, enabled, name, folder, seoPageTitle, seoPageDescription, slug, layout, layoutContainer, accessLevel, unauthorizedBehaviour, unauthorizedPageRedirect, onUpdate }: SettingsProps) => import('react').JSX.Element;
|
|
19
|
+
declare const Settings: ({ id, seoEnabled, enabled, name, folder, seoPageTitle, seoPageDescription, slug, layout, layoutContainer, accessLevel, unauthorizedBehaviour, unauthorizedPageRedirect, documentScroll, onUpdate }: SettingsProps) => import('react').JSX.Element;
|
|
18
20
|
export default Settings;
|