@plitzi/sdk-elements 0.38.12 → 0.38.14
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 +166 -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/index.d.ts +4 -0
- package/package.json +11 -7
|
@@ -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;
|
|
@@ -12,39 +12,39 @@ import m from "@plitzi/plitzi-ui/TextArea";
|
|
|
12
12
|
import h from "@plitzi/plitzi-ui/Select";
|
|
13
13
|
import g from "@plitzi/plitzi-ui/Select2";
|
|
14
14
|
//#region src/elements/internal/Page/Settings.tsx
|
|
15
|
-
var _ = ({ id: _ = "", seoEnabled: v = !1, enabled: y = !0, name: b = "", folder: x = "", seoPageTitle: S = "Title", seoPageDescription: C = "Description", slug: w = "", layout: T = "", layoutContainer: E = "", accessLevel: D = "", unauthorizedBehaviour: O = "", unauthorizedPageRedirect: k = "",
|
|
16
|
-
let [[
|
|
15
|
+
var _ = ({ id: _ = "", seoEnabled: v = !1, enabled: y = !0, name: b = "", folder: x = "", seoPageTitle: S = "Title", seoPageDescription: C = "Description", slug: w = "", layout: T = "", layoutContainer: E = "", accessLevel: D = "", unauthorizedBehaviour: O = "", unauthorizedPageRedirect: k = "", documentScroll: A = "", onUpdate: j }) => {
|
|
16
|
+
let [[M, N, P]] = i([
|
|
17
17
|
"schema.flat",
|
|
18
18
|
"schema.pages",
|
|
19
19
|
"schema.pageFolders"
|
|
20
|
-
]),
|
|
21
|
-
|
|
20
|
+
]), F = r(() => Object.values(o(M, N.filter((e) => e !== _))), [
|
|
21
|
+
M,
|
|
22
22
|
_,
|
|
23
|
-
|
|
24
|
-
]),
|
|
25
|
-
|
|
23
|
+
N
|
|
24
|
+
]), I = e(j), L = n((e) => {
|
|
25
|
+
j?.("name", e);
|
|
26
26
|
let t = b.replaceAll(" ", "-").toLowerCase().replaceAll(/([^a-z0-9]+)/gi, "");
|
|
27
|
-
(!w || w === t) &&
|
|
27
|
+
(!w || w === t) && j?.("slug", e.replaceAll(" ", "-").toLowerCase().replaceAll(/([^a-z0-9-]+)/gi, ""));
|
|
28
28
|
}, [
|
|
29
|
-
|
|
29
|
+
j,
|
|
30
30
|
w,
|
|
31
31
|
b
|
|
32
|
-
]),
|
|
32
|
+
]), R = n((e) => {
|
|
33
33
|
if (/^[a-zA-Z0-9:*/_-]+$/gim.test(e) || !e) {
|
|
34
34
|
let t = e.replaceAll("//", "/");
|
|
35
|
-
|
|
35
|
+
j?.("slug", t);
|
|
36
36
|
}
|
|
37
|
-
}, [
|
|
38
|
-
|
|
39
|
-
}, [
|
|
37
|
+
}, [j]), z = n((e) => {
|
|
38
|
+
j?.("accessLevel", e), j?.("unauthorizedBehaviour", ""), j?.("unauthorizedPageRedirect", "");
|
|
39
|
+
}, [j]), B = n((e) => j?.("seoEnabled", e.target.checked), [j]), V = n((e) => j?.("enabled", e.target.checked), [j]), H = n((e) => j?.("folder", e?.value ?? ""), [j]), U = r(() => [{
|
|
40
40
|
value: "",
|
|
41
41
|
label: "None"
|
|
42
|
-
}, ...
|
|
42
|
+
}, ...P.map(({ id: e, name: t }) => ({
|
|
43
43
|
value: e,
|
|
44
44
|
label: t
|
|
45
|
-
}))], [
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
}))], [P]), W = r(() => u(M, P, _, !0), [
|
|
46
|
+
M,
|
|
47
|
+
P,
|
|
48
48
|
_
|
|
49
49
|
]);
|
|
50
50
|
return /* @__PURE__ */ l("div", {
|
|
@@ -62,13 +62,13 @@ var _ = ({ id: _ = "", seoEnabled: v = !1, enabled: y = !0, name: b = "", folder
|
|
|
62
62
|
/* @__PURE__ */ c(f, {
|
|
63
63
|
label: " Page Enabled",
|
|
64
64
|
checked: y,
|
|
65
|
-
onChange:
|
|
65
|
+
onChange: V,
|
|
66
66
|
size: "xs"
|
|
67
67
|
}),
|
|
68
68
|
/* @__PURE__ */ c(p, {
|
|
69
69
|
value: b,
|
|
70
70
|
label: "Page Name",
|
|
71
|
-
onChange:
|
|
71
|
+
onChange: L,
|
|
72
72
|
size: "xs"
|
|
73
73
|
}),
|
|
74
74
|
/* @__PURE__ */ c(d, {
|
|
@@ -84,36 +84,36 @@ var _ = ({ id: _ = "", seoEnabled: v = !1, enabled: y = !0, name: b = "", folder
|
|
|
84
84
|
className: "flex flex-col",
|
|
85
85
|
children: [/* @__PURE__ */ c(p, {
|
|
86
86
|
value: w,
|
|
87
|
-
onChange:
|
|
87
|
+
onChange: R,
|
|
88
88
|
label: "Slug / Path",
|
|
89
89
|
className: { inputContainer: "rounded-none rounded-tl rounded-tr" },
|
|
90
90
|
size: "xs"
|
|
91
91
|
}), /* @__PURE__ */ l("div", {
|
|
92
92
|
className: "truncate rounded-b border-x border-b border-gray-200 px-1 py-0.5 text-xs",
|
|
93
|
-
title:
|
|
93
|
+
title: W,
|
|
94
94
|
children: ["Full Path: ", /* @__PURE__ */ c("span", {
|
|
95
95
|
className: "font-bold",
|
|
96
|
-
children:
|
|
96
|
+
children: W
|
|
97
97
|
})]
|
|
98
98
|
})]
|
|
99
99
|
}),
|
|
100
100
|
/* @__PURE__ */ c(g, {
|
|
101
101
|
label: "Folder",
|
|
102
102
|
value: x,
|
|
103
|
-
options:
|
|
103
|
+
options: U,
|
|
104
104
|
placeholder: "None",
|
|
105
|
-
onChange:
|
|
105
|
+
onChange: H,
|
|
106
106
|
size: "xs"
|
|
107
107
|
}),
|
|
108
108
|
/* @__PURE__ */ c(t, {
|
|
109
109
|
layout: T,
|
|
110
110
|
layoutContainer: E,
|
|
111
|
-
onUpdate:
|
|
111
|
+
onUpdate: j
|
|
112
112
|
}),
|
|
113
113
|
/* @__PURE__ */ l(h, {
|
|
114
114
|
value: D,
|
|
115
115
|
label: "Restrict Access",
|
|
116
|
-
onChange:
|
|
116
|
+
onChange: z,
|
|
117
117
|
placeholder: "None",
|
|
118
118
|
size: "xs",
|
|
119
119
|
children: [/* @__PURE__ */ c("option", {
|
|
@@ -145,7 +145,7 @@ var _ = ({ id: _ = "", seoEnabled: v = !1, enabled: y = !0, name: b = "", folder
|
|
|
145
145
|
D !== "" && /* @__PURE__ */ c(h, {
|
|
146
146
|
label: "Unauthorized Behaviour",
|
|
147
147
|
value: O,
|
|
148
|
-
onChange:
|
|
148
|
+
onChange: I.text("unauthorizedBehaviour"),
|
|
149
149
|
placeholder: "None",
|
|
150
150
|
size: "xs",
|
|
151
151
|
children: /* @__PURE__ */ c("option", {
|
|
@@ -156,31 +156,63 @@ var _ = ({ id: _ = "", seoEnabled: v = !1, enabled: y = !0, name: b = "", folder
|
|
|
156
156
|
O === "redirect" && /* @__PURE__ */ c(h, {
|
|
157
157
|
value: k,
|
|
158
158
|
label: "Redirect Page",
|
|
159
|
-
onChange:
|
|
159
|
+
onChange: I.text("unauthorizedPageRedirect"),
|
|
160
160
|
placeholder: "None",
|
|
161
161
|
size: "xs",
|
|
162
|
-
children:
|
|
162
|
+
children: F.map((e) => /* @__PURE__ */ c("option", {
|
|
163
163
|
value: e.id,
|
|
164
164
|
children: a(e, "attributes.name")
|
|
165
165
|
}, e.id))
|
|
166
166
|
}),
|
|
167
|
+
/* @__PURE__ */ l(h, {
|
|
168
|
+
value: A,
|
|
169
|
+
label: "Document Scroll",
|
|
170
|
+
onChange: I.text("documentScroll"),
|
|
171
|
+
placeholder: "Scrolls",
|
|
172
|
+
size: "xs",
|
|
173
|
+
children: [/* @__PURE__ */ c("option", {
|
|
174
|
+
value: "noBounce",
|
|
175
|
+
children: "No bounce"
|
|
176
|
+
}), /* @__PURE__ */ c("option", {
|
|
177
|
+
value: "locked",
|
|
178
|
+
children: "Locked"
|
|
179
|
+
})]
|
|
180
|
+
}),
|
|
181
|
+
A === "noBounce" && /* @__PURE__ */ c(d, {
|
|
182
|
+
intent: "info",
|
|
183
|
+
solid: !1,
|
|
184
|
+
size: "xs",
|
|
185
|
+
children: /* @__PURE__ */ c("span", {
|
|
186
|
+
className: "text-xs",
|
|
187
|
+
children: "The page scrolls, but a finger pulled past either end no longer bounces it or reloads it"
|
|
188
|
+
})
|
|
189
|
+
}),
|
|
190
|
+
A === "locked" && /* @__PURE__ */ c(d, {
|
|
191
|
+
intent: "info",
|
|
192
|
+
solid: !1,
|
|
193
|
+
size: "xs",
|
|
194
|
+
children: /* @__PURE__ */ c("span", {
|
|
195
|
+
className: "text-xs",
|
|
196
|
+
children: "The page holds still: only the parts set to scroll on their own (overflow auto) move. For a screen that fills the window — a dashboard, a board"
|
|
197
|
+
})
|
|
198
|
+
}),
|
|
167
199
|
/* @__PURE__ */ c(f, {
|
|
168
200
|
label: " SEO Enabled",
|
|
169
201
|
checked: v,
|
|
170
|
-
onChange:
|
|
202
|
+
onChange: B,
|
|
171
203
|
size: "xs"
|
|
172
204
|
}),
|
|
173
205
|
v && /* @__PURE__ */ l(s, { children: [
|
|
174
206
|
/* @__PURE__ */ c(p, {
|
|
175
207
|
value: S,
|
|
176
208
|
label: "SEO Title",
|
|
177
|
-
onChange:
|
|
209
|
+
onChange: I.text("seoPageTitle"),
|
|
178
210
|
size: "xs"
|
|
179
211
|
}),
|
|
180
212
|
/* @__PURE__ */ c(m, {
|
|
181
213
|
label: "SEO Description",
|
|
182
214
|
value: C,
|
|
183
|
-
onChange:
|
|
215
|
+
onChange: I.text("seoPageDescription"),
|
|
184
216
|
rows: 3,
|
|
185
217
|
size: "xs"
|
|
186
218
|
}),
|
|
@@ -2,9 +2,19 @@ import { PageProps } from './Page';
|
|
|
2
2
|
import { AuthorableAttributes } from '@plitzi/sdk-shared/authoring/declare';
|
|
3
3
|
/** What this element can be authored with — its component's own props, minus what the runtime supplies. */
|
|
4
4
|
export type PageAttributes = AuthorableAttributes<PageProps>;
|
|
5
|
+
/**
|
|
6
|
+
* How the document holding a page moves under a finger or a wheel, when the page says so — see
|
|
7
|
+
* `PageProps.documentScroll`. Read by the authoring surface to refuse anything else.
|
|
8
|
+
*/
|
|
9
|
+
export declare const DOCUMENT_SCROLLS: readonly ["locked", "noBounce"];
|
|
10
|
+
export type DocumentScroll = (typeof DOCUMENT_SCROLLS)[number];
|
|
11
|
+
export declare const isDocumentScroll: (value: unknown) => value is DocumentScroll;
|
|
5
12
|
declare const declaration: import('@plitzi/sdk-shared/authoring/declare').DeclaredElement<{
|
|
6
13
|
readonly type: "page";
|
|
7
14
|
readonly serverTemplates: readonly ["seoPageTitle", "seoPageDescription", "notFound"];
|
|
15
|
+
readonly attributeValues: {
|
|
16
|
+
readonly documentScroll: readonly ["locked", "noBounce"];
|
|
17
|
+
};
|
|
8
18
|
readonly triggers: {
|
|
9
19
|
readonly onPageLoad: {
|
|
10
20
|
readonly action: "onPageLoad";
|
|
@@ -70,5 +80,6 @@ declare const declaration: import('@plitzi/sdk-shared/authoring/declare').Declar
|
|
|
70
80
|
seoEnabled?: boolean | undefined;
|
|
71
81
|
seoPageTitle?: string | undefined;
|
|
72
82
|
seoPageDescription?: string | undefined;
|
|
83
|
+
documentScroll?: (DocumentScroll | "") | undefined;
|
|
73
84
|
}>>;
|
|
74
85
|
export default declaration;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { elementDeclaration as e } from "@plitzi/sdk-shared/authoring/declare";
|
|
2
2
|
//#region src/elements/internal/Page/declaration.ts
|
|
3
|
-
var t = e()({
|
|
3
|
+
var t = ["locked", "noBounce"], n = (e) => t.some((t) => t === e), r = e()({
|
|
4
4
|
type: "page",
|
|
5
5
|
serverTemplates: [
|
|
6
6
|
"seoPageTitle",
|
|
7
7
|
"seoPageDescription",
|
|
8
8
|
"notFound"
|
|
9
9
|
],
|
|
10
|
+
attributeValues: { documentScroll: t },
|
|
10
11
|
triggers: { onPageLoad: {
|
|
11
12
|
action: "onPageLoad",
|
|
12
13
|
title: "On Page Load",
|
|
@@ -59,4 +60,4 @@ var t = e()({
|
|
|
59
60
|
}
|
|
60
61
|
});
|
|
61
62
|
//#endregion
|
|
62
|
-
export { t as default };
|
|
63
|
+
export { t as DOCUMENT_SCROLLS, r as default, n as isDocumentScroll };
|
|
@@ -4,6 +4,9 @@ declare const Page: {
|
|
|
4
4
|
} & {
|
|
5
5
|
readonly type: "page";
|
|
6
6
|
readonly serverTemplates: readonly ["seoPageTitle", "seoPageDescription", "notFound"];
|
|
7
|
+
readonly attributeValues: {
|
|
8
|
+
readonly documentScroll: readonly ["locked", "noBounce"];
|
|
9
|
+
};
|
|
7
10
|
readonly triggers: {
|
|
8
11
|
readonly onPageLoad: {
|
|
9
12
|
readonly action: "onPageLoad";
|
|
@@ -71,5 +74,6 @@ declare const Page: {
|
|
|
71
74
|
seoEnabled?: boolean | undefined;
|
|
72
75
|
seoPageTitle?: string | undefined;
|
|
73
76
|
seoPageDescription?: string | undefined;
|
|
77
|
+
documentScroll?: (import('./declaration').DocumentScroll | "") | undefined;
|
|
74
78
|
}>>;
|
|
75
79
|
export default Page;
|
package/dist/index.d.ts
CHANGED
|
@@ -647,6 +647,9 @@ export declare const defaultElements: {
|
|
|
647
647
|
} & {
|
|
648
648
|
readonly type: "page";
|
|
649
649
|
readonly serverTemplates: readonly ["seoPageTitle", "seoPageDescription", "notFound"];
|
|
650
|
+
readonly attributeValues: {
|
|
651
|
+
readonly documentScroll: readonly ["locked", "noBounce"];
|
|
652
|
+
};
|
|
650
653
|
readonly triggers: {
|
|
651
654
|
readonly onPageLoad: {
|
|
652
655
|
readonly action: "onPageLoad";
|
|
@@ -714,6 +717,7 @@ export declare const defaultElements: {
|
|
|
714
717
|
seoEnabled?: boolean | undefined;
|
|
715
718
|
seoPageTitle?: string | undefined;
|
|
716
719
|
seoPageDescription?: string | undefined;
|
|
720
|
+
documentScroll?: (import('./elements/internal/Page/declaration').DocumentScroll | "") | undefined;
|
|
717
721
|
}>>;
|
|
718
722
|
container: {
|
|
719
723
|
(props: import('./Element/hocs/withElement').WithElementProps<import('./elements/structure/Container/Container').ContainerProps>): import('react').JSX.Element;
|