@plitzi/sdk-elements 0.39.12 → 0.39.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 +28 -0
- package/dist/Element/PluginManager.mjs +13 -13
- package/dist/Element/hooks/useElementState.d.ts +1 -1
- package/dist/Element/hooks/useFullscreenInteractions.d.ts +11 -0
- package/dist/Element/hooks/useFullscreenInteractions.mjs +14 -0
- package/dist/Element/hooks/useRootElementInteractions.mjs +93 -87
- package/dist/builder/ruleFields.d.ts +1 -1
- package/dist/builder/ruleFields.mjs +5 -0
- package/dist/dataSource/GlobalSources.mjs +121 -104
- package/dist/dataSource/useAudienceScope.mjs +2 -1
- package/dist/dataSource/usePageClock.d.ts +12 -0
- package/dist/dataSource/usePageClock.mjs +19 -0
- package/dist/elements/basic/Countdown/Countdown.d.ts +23 -0
- package/dist/elements/basic/Countdown/Countdown.mjs +58 -0
- package/dist/elements/basic/Countdown/Settings.d.ts +12 -0
- package/dist/elements/basic/Countdown/Settings.mjs +94 -0
- package/dist/elements/basic/Countdown/declaration.d.ts +72 -0
- package/dist/elements/basic/Countdown/declaration.mjs +58 -0
- package/dist/elements/basic/Countdown/index.d.ts +69 -0
- package/dist/elements/basic/Countdown/index.mjs +5 -0
- package/dist/elements/declarations/index.d.ts +508 -7
- package/dist/elements/declarations/index.mjs +84 -72
- package/dist/elements/index.d.ts +13 -3
- package/dist/elements/index.mjs +76 -66
- package/dist/elements/media/Image/Image.d.ts +6 -1
- package/dist/elements/media/Image/Image.mjs +44 -35
- package/dist/elements/media/Image/Settings.d.ts +2 -1
- package/dist/elements/media/Image/Settings.mjs +26 -19
- package/dist/elements/media/Image/declaration.d.ts +2 -0
- package/dist/elements/media/Image/declaration.mjs +2 -1
- package/dist/elements/media/Image/index.d.ts +2 -0
- package/dist/elements/settings.mjs +92 -80
- package/dist/elements/structure/Container/Container.d.ts +2 -4
- package/dist/elements/structure/Container/Container.mjs +5 -6
- package/dist/elements/structure/Container/Settings.d.ts +1 -2
- package/dist/elements/structure/Container/Settings.mjs +5 -19
- package/dist/elements/structure/Container/declaration.d.ts +1 -2
- package/dist/elements/structure/Container/declaration.mjs +1 -3
- package/dist/elements/structure/Container/index.d.ts +1 -2
- package/dist/elements/structure/Disclosure/Disclosure.d.ts +26 -0
- package/dist/elements/structure/Disclosure/Disclosure.mjs +49 -0
- package/dist/elements/structure/Disclosure/DisclosureSummary/DisclosureSummary.d.ts +16 -0
- package/dist/elements/structure/Disclosure/DisclosureSummary/DisclosureSummary.mjs +19 -0
- package/dist/elements/structure/Disclosure/DisclosureSummary/Settings.d.ts +7 -0
- package/dist/elements/structure/Disclosure/DisclosureSummary/Settings.mjs +20 -0
- package/dist/elements/structure/Disclosure/DisclosureSummary/declaration.d.ts +59 -0
- package/dist/elements/structure/Disclosure/DisclosureSummary/declaration.mjs +47 -0
- package/dist/elements/structure/Disclosure/DisclosureSummary/index.d.ts +57 -0
- package/dist/elements/structure/Disclosure/DisclosureSummary/index.mjs +5 -0
- package/dist/elements/structure/Disclosure/Settings.d.ts +10 -0
- package/dist/elements/structure/Disclosure/Settings.mjs +47 -0
- package/dist/elements/structure/Disclosure/declaration.d.ts +66 -0
- package/dist/elements/structure/Disclosure/declaration.mjs +55 -0
- package/dist/elements/structure/Disclosure/index.d.ts +121 -0
- package/dist/elements/structure/Disclosure/index.mjs +9 -0
- package/dist/elements/structure/Disclosure/useDetails.d.ts +27 -0
- package/dist/elements/structure/Disclosure/useDetails.mjs +49 -0
- package/dist/elements/structure/TimeWindow/TimeWindow.mjs +29 -25
- package/dist/elements/structure/TimeWindow/TimeWindowContext.d.ts +6 -0
- package/dist/elements/structure/TimeWindow/TimeWindowContext.mjs +4 -0
- package/dist/elements/{testing → structure}/Variants/Settings.mjs +1 -1
- package/dist/elements/{testing → structure}/Variants/VariantItem/Settings.mjs +1 -1
- package/dist/elements/{testing → structure}/Variants/VariantItem/VariantItem.mjs +1 -1
- package/dist/elements/{testing → structure}/Variants/VariantItem/declaration.d.ts +1 -1
- package/dist/elements/{testing → structure}/Variants/VariantItem/declaration.mjs +2 -2
- package/dist/elements/{testing → structure}/Variants/VariantItem/index.d.ts +1 -1
- package/dist/elements/{testing → structure}/Variants/VariantItem/index.mjs +1 -1
- package/dist/elements/{testing → structure}/Variants/Variants.mjs +12 -12
- package/dist/elements/{testing → structure/Variants}/childOfItem.mjs +1 -1
- package/dist/elements/{testing → structure}/Variants/declaration.d.ts +1 -1
- package/dist/elements/{testing → structure}/Variants/declaration.mjs +3 -3
- package/dist/elements/{testing → structure}/Variants/index.d.ts +2 -2
- package/dist/elements/{testing → structure}/Variants/index.mjs +1 -1
- package/dist/elements/user/Account/Account.d.ts +25 -0
- package/dist/elements/user/Account/Account.mjs +104 -0
- package/dist/elements/user/Account/Settings.d.ts +10 -0
- package/dist/elements/user/Account/Settings.mjs +47 -0
- package/dist/elements/user/Account/declaration.d.ts +143 -0
- package/dist/elements/user/Account/declaration.mjs +123 -0
- package/dist/elements/user/Account/index.d.ts +141 -0
- package/dist/elements/user/Account/index.mjs +5 -0
- package/dist/elements/user/Avatar/Avatar.d.ts +19 -0
- package/dist/elements/user/Avatar/Avatar.mjs +26 -0
- package/dist/elements/user/Avatar/AvatarFace.d.ts +15 -0
- package/dist/elements/user/Avatar/AvatarFace.mjs +28 -0
- package/dist/elements/user/Avatar/Settings.d.ts +9 -0
- package/dist/elements/user/Avatar/Settings.mjs +38 -0
- package/dist/elements/user/Avatar/declaration.d.ts +65 -0
- package/dist/elements/user/Avatar/declaration.mjs +53 -0
- package/dist/elements/user/Avatar/faces.d.ts +10 -0
- package/dist/elements/user/Avatar/faces.mjs +10 -0
- package/dist/elements/user/Avatar/index.d.ts +63 -0
- package/dist/elements/user/Avatar/index.mjs +5 -0
- package/dist/elements/user/SignInForm/Settings.d.ts +16 -0
- package/dist/elements/user/SignInForm/Settings.mjs +64 -0
- package/dist/elements/user/SignInForm/SignInForm.d.ts +34 -0
- package/dist/elements/user/SignInForm/SignInForm.mjs +112 -0
- package/dist/elements/user/SignInForm/declaration.d.ts +120 -0
- package/dist/elements/user/SignInForm/declaration.mjs +99 -0
- package/dist/elements/user/SignInForm/index.d.ts +118 -0
- package/dist/elements/user/SignInForm/index.mjs +5 -0
- package/dist/index.d.ts +514 -6
- package/dist/index.mjs +84 -74
- package/package.json +7 -7
- /package/dist/elements/{testing → structure}/Variants/Settings.d.ts +0 -0
- /package/dist/elements/{testing → structure}/Variants/VariantItem/Settings.d.ts +0 -0
- /package/dist/elements/{testing → structure}/Variants/VariantItem/VariantItem.d.ts +0 -0
- /package/dist/elements/{testing → structure}/Variants/Variants.d.ts +0 -0
- /package/dist/elements/{testing → structure/Variants}/childOfItem.d.ts +0 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { DisclosureSummaryProps } from './DisclosureSummary';
|
|
2
|
+
import { AuthorableAttributes } from '@plitzi/sdk-shared/authoring';
|
|
3
|
+
/** What this element can be authored with — its component's own props, minus what the runtime supplies. */
|
|
4
|
+
export type DisclosureSummaryAttributes = AuthorableAttributes<DisclosureSummaryProps>;
|
|
5
|
+
declare const declaration: import('@plitzi/sdk-shared/authoring').DeclaredElement<{
|
|
6
|
+
readonly type: "disclosureSummary";
|
|
7
|
+
readonly ancestorType: "disclosure";
|
|
8
|
+
readonly content: {
|
|
9
|
+
readonly attributes: {
|
|
10
|
+
readonly marker: true;
|
|
11
|
+
};
|
|
12
|
+
readonly definition: {
|
|
13
|
+
readonly label: "Disclosure Summary";
|
|
14
|
+
readonly description: string;
|
|
15
|
+
readonly items: [];
|
|
16
|
+
readonly styleSelectors: {
|
|
17
|
+
readonly marker: "";
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
readonly builder: {
|
|
21
|
+
readonly canDelete: false;
|
|
22
|
+
readonly canDragDrop: false;
|
|
23
|
+
readonly canMove: false;
|
|
24
|
+
readonly canSnippet: false;
|
|
25
|
+
};
|
|
26
|
+
readonly market: {
|
|
27
|
+
readonly category: "structure";
|
|
28
|
+
readonly icon: "fa-solid fa-heading";
|
|
29
|
+
};
|
|
30
|
+
readonly defaultStyle: {
|
|
31
|
+
readonly style: {
|
|
32
|
+
readonly base: {
|
|
33
|
+
readonly default: {
|
|
34
|
+
readonly display: "flex";
|
|
35
|
+
readonly 'align-items': "center";
|
|
36
|
+
readonly gap: "8px";
|
|
37
|
+
readonly cursor: "pointer";
|
|
38
|
+
readonly 'list-style': "none";
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
readonly marker: {
|
|
42
|
+
readonly default: {
|
|
43
|
+
readonly 'flex-shrink': 0;
|
|
44
|
+
readonly 'margin-left': "auto";
|
|
45
|
+
readonly width: "0.45em";
|
|
46
|
+
readonly height: "0.45em";
|
|
47
|
+
readonly 'border-right': "2px solid currentColor";
|
|
48
|
+
readonly 'border-bottom': "2px solid currentColor";
|
|
49
|
+
readonly transform: "rotate(45deg)";
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
readonly subTypes: {};
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
}, Partial<{
|
|
57
|
+
marker?: boolean | undefined;
|
|
58
|
+
}>>;
|
|
59
|
+
export default declaration;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { elementDeclaration as e } from "@plitzi/sdk-shared/authoring";
|
|
2
|
+
// src/elements/structure/Disclosure/DisclosureSummary/declaration.ts
|
|
3
|
+
var t = e()({
|
|
4
|
+
type: "disclosureSummary",
|
|
5
|
+
ancestorType: "disclosure",
|
|
6
|
+
content: {
|
|
7
|
+
attributes: { marker: !0 },
|
|
8
|
+
definition: {
|
|
9
|
+
label: "Disclosure Summary",
|
|
10
|
+
description: "What is pressed to open and close a disclosure — its first child, and its name for a screen reader: a text or a heading in it, never a button or a link (it is the control itself). Its `marker` is the sign at its end that turns as the disclosure opens (the `marker` slot styles it); off, for a sign of its own.",
|
|
11
|
+
items: [],
|
|
12
|
+
styleSelectors: { marker: "" }
|
|
13
|
+
},
|
|
14
|
+
builder: {
|
|
15
|
+
canDelete: !1,
|
|
16
|
+
canDragDrop: !1,
|
|
17
|
+
canMove: !1,
|
|
18
|
+
canSnippet: !1
|
|
19
|
+
},
|
|
20
|
+
market: {
|
|
21
|
+
category: "structure",
|
|
22
|
+
icon: "fa-solid fa-heading"
|
|
23
|
+
},
|
|
24
|
+
defaultStyle: {
|
|
25
|
+
style: {
|
|
26
|
+
base: { default: {
|
|
27
|
+
display: "flex",
|
|
28
|
+
"align-items": "center",
|
|
29
|
+
gap: "8px",
|
|
30
|
+
cursor: "pointer",
|
|
31
|
+
"list-style": "none"
|
|
32
|
+
} },
|
|
33
|
+
marker: { default: {
|
|
34
|
+
"flex-shrink": 0,
|
|
35
|
+
"margin-left": "auto",
|
|
36
|
+
width: "0.45em",
|
|
37
|
+
height: "0.45em",
|
|
38
|
+
"border-right": "2px solid currentColor",
|
|
39
|
+
"border-bottom": "2px solid currentColor",
|
|
40
|
+
transform: "rotate(45deg)"
|
|
41
|
+
} }
|
|
42
|
+
},
|
|
43
|
+
subTypes: {}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
export { t as default };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
declare const DisclosureSummary: import('react').FC<import('../../../..').WithElementProps<import('./DisclosureSummary').DisclosureSummaryProps>> & {
|
|
2
|
+
readonly type: "disclosureSummary";
|
|
3
|
+
readonly ancestorType: "disclosure";
|
|
4
|
+
readonly content: {
|
|
5
|
+
readonly attributes: {
|
|
6
|
+
readonly marker: true;
|
|
7
|
+
};
|
|
8
|
+
readonly definition: {
|
|
9
|
+
readonly label: "Disclosure Summary";
|
|
10
|
+
readonly description: string;
|
|
11
|
+
readonly items: [];
|
|
12
|
+
readonly styleSelectors: {
|
|
13
|
+
readonly marker: "";
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
readonly builder: {
|
|
17
|
+
readonly canDelete: false;
|
|
18
|
+
readonly canDragDrop: false;
|
|
19
|
+
readonly canMove: false;
|
|
20
|
+
readonly canSnippet: false;
|
|
21
|
+
};
|
|
22
|
+
readonly market: {
|
|
23
|
+
readonly category: "structure";
|
|
24
|
+
readonly icon: "fa-solid fa-heading";
|
|
25
|
+
};
|
|
26
|
+
readonly defaultStyle: {
|
|
27
|
+
readonly style: {
|
|
28
|
+
readonly base: {
|
|
29
|
+
readonly default: {
|
|
30
|
+
readonly display: "flex";
|
|
31
|
+
readonly 'align-items': "center";
|
|
32
|
+
readonly gap: "8px";
|
|
33
|
+
readonly cursor: "pointer";
|
|
34
|
+
readonly 'list-style': "none";
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
readonly marker: {
|
|
38
|
+
readonly default: {
|
|
39
|
+
readonly 'flex-shrink': 0;
|
|
40
|
+
readonly 'margin-left': "auto";
|
|
41
|
+
readonly width: "0.45em";
|
|
42
|
+
readonly height: "0.45em";
|
|
43
|
+
readonly 'border-right': "2px solid currentColor";
|
|
44
|
+
readonly 'border-bottom': "2px solid currentColor";
|
|
45
|
+
readonly transform: "rotate(45deg)";
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
readonly subTypes: {};
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
} & {
|
|
53
|
+
content: import('@plitzi/sdk-shared/authoring').ElementContentDefaults;
|
|
54
|
+
} & import('@plitzi/sdk-shared/authoring').ElementAttributesBrand<Partial<{
|
|
55
|
+
marker?: boolean | undefined;
|
|
56
|
+
}>>;
|
|
57
|
+
export default DisclosureSummary;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type SettingsProps = {
|
|
2
|
+
open?: boolean;
|
|
3
|
+
name?: string;
|
|
4
|
+
closeOnClickOutside?: boolean;
|
|
5
|
+
closeOnNavigate?: boolean;
|
|
6
|
+
onUpdate?: (key: string, value: string | boolean | number) => void;
|
|
7
|
+
};
|
|
8
|
+
/** A disclosure's settings: how it starts, its group, and what closes it. */
|
|
9
|
+
declare const Settings: ({ open, name, closeOnClickOutside, closeOnNavigate, onUpdate }: SettingsProps) => import('react').JSX.Element;
|
|
10
|
+
export default Settings;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import e from "../../useSettingsUpdate.mjs";
|
|
2
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
+
import r from "@plitzi/plitzi-ui/Checkbox";
|
|
4
|
+
import i from "@plitzi/plitzi-ui/Input";
|
|
5
|
+
// src/elements/structure/Disclosure/Settings.tsx
|
|
6
|
+
var a = ({ open: a = !1, name: o = "", closeOnClickOutside: s = !1, closeOnNavigate: c = !0, onUpdate: l }) => {
|
|
7
|
+
let u = e(l);
|
|
8
|
+
return /* @__PURE__ */ n("div", {
|
|
9
|
+
className: "flex flex-col gap-4 py-2",
|
|
10
|
+
children: [
|
|
11
|
+
/* @__PURE__ */ t(r, {
|
|
12
|
+
label: "Starts open",
|
|
13
|
+
size: "xs",
|
|
14
|
+
checked: a,
|
|
15
|
+
onChange: u.checked("open")
|
|
16
|
+
}),
|
|
17
|
+
/* @__PURE__ */ t(i, {
|
|
18
|
+
label: "Group",
|
|
19
|
+
size: "xs",
|
|
20
|
+
placeholder: "faq",
|
|
21
|
+
value: o,
|
|
22
|
+
onChange: u.text("name")
|
|
23
|
+
}),
|
|
24
|
+
/* @__PURE__ */ t("span", {
|
|
25
|
+
className: "text-ui-fg-subtle text-xs",
|
|
26
|
+
children: "Disclosures with the same group are an accordion: opening one closes the others. Empty, it opens on its own."
|
|
27
|
+
}),
|
|
28
|
+
/* @__PURE__ */ t(r, {
|
|
29
|
+
label: "Close on a press outside",
|
|
30
|
+
size: "xs",
|
|
31
|
+
checked: s,
|
|
32
|
+
onChange: u.checked("closeOnClickOutside")
|
|
33
|
+
}),
|
|
34
|
+
/* @__PURE__ */ t(r, {
|
|
35
|
+
label: "Close when the page changes",
|
|
36
|
+
size: "xs",
|
|
37
|
+
checked: c,
|
|
38
|
+
onChange: u.checked("closeOnNavigate")
|
|
39
|
+
}),
|
|
40
|
+
/* @__PURE__ */ t("span", {
|
|
41
|
+
className: "text-ui-fg-subtle text-xs",
|
|
42
|
+
children: "Escape always closes it. While editing the canvas shows it open; its preview opens and closes it."
|
|
43
|
+
})
|
|
44
|
+
]
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
export { a as default };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { DisclosureProps } from './Disclosure';
|
|
2
|
+
import { AuthorableAttributes } from '@plitzi/sdk-shared/authoring';
|
|
3
|
+
/** What this element can be authored with — its component's own props, minus what the runtime supplies. */
|
|
4
|
+
export type DisclosureAttributes = AuthorableAttributes<DisclosureProps>;
|
|
5
|
+
declare const declaration: import('@plitzi/sdk-shared/authoring').DeclaredElement<{
|
|
6
|
+
readonly type: "disclosure";
|
|
7
|
+
readonly callbacks: {
|
|
8
|
+
readonly openDisclosure: {
|
|
9
|
+
readonly action: "openDisclosure";
|
|
10
|
+
readonly title: "Open Disclosure";
|
|
11
|
+
readonly type: "callback";
|
|
12
|
+
readonly params: {};
|
|
13
|
+
readonly preview: {};
|
|
14
|
+
};
|
|
15
|
+
readonly closeDisclosure: {
|
|
16
|
+
readonly action: "closeDisclosure";
|
|
17
|
+
readonly title: "Close Disclosure";
|
|
18
|
+
readonly type: "callback";
|
|
19
|
+
readonly params: {};
|
|
20
|
+
readonly preview: {};
|
|
21
|
+
};
|
|
22
|
+
readonly toggleDisclosure: {
|
|
23
|
+
readonly action: "toggleDisclosure";
|
|
24
|
+
readonly title: "Toggle Disclosure";
|
|
25
|
+
readonly type: "callback";
|
|
26
|
+
readonly params: {};
|
|
27
|
+
readonly preview: {};
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
readonly marks: {
|
|
31
|
+
readonly '[open]': "on the disclosure while what it holds is shown";
|
|
32
|
+
readonly 'its summary': "lights a class’s `expanded` state while the disclosure is open — a sign inside it turns with the parent’s (`ancestors: { \">\": { states: { expanded: … } } }`)";
|
|
33
|
+
};
|
|
34
|
+
readonly content: {
|
|
35
|
+
readonly attributes: {
|
|
36
|
+
readonly open: false;
|
|
37
|
+
readonly name: "";
|
|
38
|
+
readonly closeOnClickOutside: false;
|
|
39
|
+
readonly closeOnNavigate: true;
|
|
40
|
+
};
|
|
41
|
+
readonly definition: {
|
|
42
|
+
readonly label: "Disclosure";
|
|
43
|
+
readonly description: string;
|
|
44
|
+
readonly items: [];
|
|
45
|
+
};
|
|
46
|
+
readonly market: {
|
|
47
|
+
readonly category: "structure";
|
|
48
|
+
readonly icon: "fa-solid fa-caret-down";
|
|
49
|
+
};
|
|
50
|
+
readonly defaultStyle: {
|
|
51
|
+
readonly style: {
|
|
52
|
+
readonly base: {
|
|
53
|
+
readonly default: {};
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
readonly subTypes: {};
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
readonly initialItems: readonly ["disclosureSummary"];
|
|
60
|
+
}, Partial<{
|
|
61
|
+
name?: string | undefined;
|
|
62
|
+
open?: boolean | undefined;
|
|
63
|
+
closeOnClickOutside?: boolean | undefined;
|
|
64
|
+
closeOnNavigate?: boolean | undefined;
|
|
65
|
+
}>>;
|
|
66
|
+
export default declaration;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { elementDeclaration as e } from "@plitzi/sdk-shared/authoring";
|
|
2
|
+
// src/elements/structure/Disclosure/declaration.ts
|
|
3
|
+
var t = e()({
|
|
4
|
+
type: "disclosure",
|
|
5
|
+
callbacks: {
|
|
6
|
+
openDisclosure: {
|
|
7
|
+
action: "openDisclosure",
|
|
8
|
+
title: "Open Disclosure",
|
|
9
|
+
type: "callback",
|
|
10
|
+
params: {},
|
|
11
|
+
preview: {}
|
|
12
|
+
},
|
|
13
|
+
closeDisclosure: {
|
|
14
|
+
action: "closeDisclosure",
|
|
15
|
+
title: "Close Disclosure",
|
|
16
|
+
type: "callback",
|
|
17
|
+
params: {},
|
|
18
|
+
preview: {}
|
|
19
|
+
},
|
|
20
|
+
toggleDisclosure: {
|
|
21
|
+
action: "toggleDisclosure",
|
|
22
|
+
title: "Toggle Disclosure",
|
|
23
|
+
type: "callback",
|
|
24
|
+
params: {},
|
|
25
|
+
preview: {}
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
marks: {
|
|
29
|
+
"[open]": "on the disclosure while what it holds is shown",
|
|
30
|
+
"its summary": "lights a class’s `expanded` state while the disclosure is open — a sign inside it turns with the parent’s (`ancestors: { \">\": { states: { expanded: … } } }`)"
|
|
31
|
+
},
|
|
32
|
+
content: {
|
|
33
|
+
attributes: {
|
|
34
|
+
open: !1,
|
|
35
|
+
name: "",
|
|
36
|
+
closeOnClickOutside: !1,
|
|
37
|
+
closeOnNavigate: !0
|
|
38
|
+
},
|
|
39
|
+
definition: {
|
|
40
|
+
label: "Disclosure",
|
|
41
|
+
description: "A summary that shows or hides what follows it: a question and its answer, a menu, \"show more\", a panel of filters. Its first child is its `disclosureSummary` — what is pressed — and the rest is what it shows. `open` starts it open; disclosures with the same `name` are an accordion, one open at a time. Escape closes it; `closeOnClickOutside` closes it on a press anywhere else (a menu), `closeOnNavigate` when the page changes (on by default — a menu in a layout). It is a `<details>`: it opens before the page’s script runs, the browser’s find-in-page opens the one holding what was found, and what is closed is still in the page for search engines.",
|
|
42
|
+
items: []
|
|
43
|
+
},
|
|
44
|
+
market: {
|
|
45
|
+
category: "structure",
|
|
46
|
+
icon: "fa-solid fa-caret-down"
|
|
47
|
+
},
|
|
48
|
+
defaultStyle: {
|
|
49
|
+
style: { base: { default: {} } },
|
|
50
|
+
subTypes: {}
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
initialItems: ["disclosureSummary"]
|
|
54
|
+
});
|
|
55
|
+
export { t as default };
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
declare const Disclosure: import('react').FC<import('../../..').WithElementProps<import('./Disclosure').DisclosureProps>> & {
|
|
2
|
+
plugins: {
|
|
3
|
+
disclosureSummary: import('react').FC<import('../../..').WithElementProps<import('./DisclosureSummary/DisclosureSummary').DisclosureSummaryProps>> & {
|
|
4
|
+
readonly type: "disclosureSummary";
|
|
5
|
+
readonly ancestorType: "disclosure";
|
|
6
|
+
readonly content: {
|
|
7
|
+
readonly attributes: {
|
|
8
|
+
readonly marker: true;
|
|
9
|
+
};
|
|
10
|
+
readonly definition: {
|
|
11
|
+
readonly label: "Disclosure Summary";
|
|
12
|
+
readonly description: string;
|
|
13
|
+
readonly items: [];
|
|
14
|
+
readonly styleSelectors: {
|
|
15
|
+
readonly marker: "";
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
readonly builder: {
|
|
19
|
+
readonly canDelete: false;
|
|
20
|
+
readonly canDragDrop: false;
|
|
21
|
+
readonly canMove: false;
|
|
22
|
+
readonly canSnippet: false;
|
|
23
|
+
};
|
|
24
|
+
readonly market: {
|
|
25
|
+
readonly category: "structure";
|
|
26
|
+
readonly icon: "fa-solid fa-heading";
|
|
27
|
+
};
|
|
28
|
+
readonly defaultStyle: {
|
|
29
|
+
readonly style: {
|
|
30
|
+
readonly base: {
|
|
31
|
+
readonly default: {
|
|
32
|
+
readonly display: "flex";
|
|
33
|
+
readonly 'align-items': "center";
|
|
34
|
+
readonly gap: "8px";
|
|
35
|
+
readonly cursor: "pointer";
|
|
36
|
+
readonly 'list-style': "none";
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
readonly marker: {
|
|
40
|
+
readonly default: {
|
|
41
|
+
readonly 'flex-shrink': 0;
|
|
42
|
+
readonly 'margin-left': "auto";
|
|
43
|
+
readonly width: "0.45em";
|
|
44
|
+
readonly height: "0.45em";
|
|
45
|
+
readonly 'border-right': "2px solid currentColor";
|
|
46
|
+
readonly 'border-bottom': "2px solid currentColor";
|
|
47
|
+
readonly transform: "rotate(45deg)";
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
readonly subTypes: {};
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
} & {
|
|
55
|
+
content: import('@plitzi/sdk-shared/authoring').ElementContentDefaults;
|
|
56
|
+
} & import('@plitzi/sdk-shared/authoring').ElementAttributesBrand<Partial<{
|
|
57
|
+
marker?: boolean | undefined;
|
|
58
|
+
}>>;
|
|
59
|
+
};
|
|
60
|
+
type: "disclosure";
|
|
61
|
+
callbacks: {
|
|
62
|
+
readonly openDisclosure: {
|
|
63
|
+
readonly action: "openDisclosure";
|
|
64
|
+
readonly title: "Open Disclosure";
|
|
65
|
+
readonly type: "callback";
|
|
66
|
+
readonly params: {};
|
|
67
|
+
readonly preview: {};
|
|
68
|
+
};
|
|
69
|
+
readonly closeDisclosure: {
|
|
70
|
+
readonly action: "closeDisclosure";
|
|
71
|
+
readonly title: "Close Disclosure";
|
|
72
|
+
readonly type: "callback";
|
|
73
|
+
readonly params: {};
|
|
74
|
+
readonly preview: {};
|
|
75
|
+
};
|
|
76
|
+
readonly toggleDisclosure: {
|
|
77
|
+
readonly action: "toggleDisclosure";
|
|
78
|
+
readonly title: "Toggle Disclosure";
|
|
79
|
+
readonly type: "callback";
|
|
80
|
+
readonly params: {};
|
|
81
|
+
readonly preview: {};
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
marks: {
|
|
85
|
+
readonly '[open]': "on the disclosure while what it holds is shown";
|
|
86
|
+
readonly 'its summary': "lights a class’s `expanded` state while the disclosure is open — a sign inside it turns with the parent’s (`ancestors: { \">\": { states: { expanded: … } } }`)";
|
|
87
|
+
};
|
|
88
|
+
content: {
|
|
89
|
+
readonly attributes: {
|
|
90
|
+
readonly open: false;
|
|
91
|
+
readonly name: "";
|
|
92
|
+
readonly closeOnClickOutside: false;
|
|
93
|
+
readonly closeOnNavigate: true;
|
|
94
|
+
};
|
|
95
|
+
readonly definition: {
|
|
96
|
+
readonly label: "Disclosure";
|
|
97
|
+
readonly description: string;
|
|
98
|
+
readonly items: [];
|
|
99
|
+
};
|
|
100
|
+
readonly market: {
|
|
101
|
+
readonly category: "structure";
|
|
102
|
+
readonly icon: "fa-solid fa-caret-down";
|
|
103
|
+
};
|
|
104
|
+
readonly defaultStyle: {
|
|
105
|
+
readonly style: {
|
|
106
|
+
readonly base: {
|
|
107
|
+
readonly default: {};
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
readonly subTypes: {};
|
|
111
|
+
};
|
|
112
|
+
} & import('@plitzi/sdk-shared/authoring').ElementContentDefaults;
|
|
113
|
+
initialItems: readonly ["disclosureSummary"];
|
|
114
|
+
__attributes: Partial<{
|
|
115
|
+
name?: string | undefined;
|
|
116
|
+
open?: boolean | undefined;
|
|
117
|
+
closeOnClickOutside?: boolean | undefined;
|
|
118
|
+
closeOnNavigate?: boolean | undefined;
|
|
119
|
+
}>;
|
|
120
|
+
};
|
|
121
|
+
export default Disclosure;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import e from "./declaration.mjs";
|
|
2
|
+
import t from "./Disclosure.mjs";
|
|
3
|
+
import n from "./DisclosureSummary/index.mjs";
|
|
4
|
+
// src/elements/structure/Disclosure/index.ts
|
|
5
|
+
var r = Object.assign(t, {
|
|
6
|
+
...e,
|
|
7
|
+
plugins: { disclosureSummary: n }
|
|
8
|
+
});
|
|
9
|
+
export { r as default };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { KeyboardEvent, MouseEvent, RefObject, SyntheticEvent } from 'react';
|
|
2
|
+
export type UseDetailsProps = {
|
|
3
|
+
/** The `<details>` itself. */
|
|
4
|
+
ref: RefObject<HTMLElement | null>;
|
|
5
|
+
open: boolean;
|
|
6
|
+
setOpen: (open: boolean) => void;
|
|
7
|
+
/** Edited in the builder: what it holds stays there to edit, and its summary selects rather than closes it. */
|
|
8
|
+
editing: boolean;
|
|
9
|
+
/** Closed by a press anywhere outside it — a menu. */
|
|
10
|
+
closeOnClickOutside: boolean;
|
|
11
|
+
/** Closed when the page changes — a menu in a layout, which stays on the screen from one page to the next. */
|
|
12
|
+
closeOnNavigate: boolean;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* What a `<details>` that opens and closes something needs besides the browser: its state kept as the browser opens and
|
|
16
|
+
* closes it (its summary, find-in-page, another of its group), Escape — a `<details>` has none — giving the focus back
|
|
17
|
+
* to the summary, a press outside and a new page closing it, and the summary inert while it is edited in the builder.
|
|
18
|
+
* Shared by the disclosure and the account menu, which is one.
|
|
19
|
+
*
|
|
20
|
+
* @returns the handlers the `<details>` takes.
|
|
21
|
+
*/
|
|
22
|
+
declare const useDetails: ({ ref, open, setOpen, editing, closeOnClickOutside, closeOnNavigate }: UseDetailsProps) => {
|
|
23
|
+
onToggle: (event: SyntheticEvent<HTMLElement>) => void;
|
|
24
|
+
onClickCapture: (event: MouseEvent<HTMLElement>) => void;
|
|
25
|
+
onKeyDown: (event: KeyboardEvent<HTMLElement>) => void;
|
|
26
|
+
};
|
|
27
|
+
export default useDetails;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { useCallback as e, useEffect as t, useRef as n } from "react";
|
|
2
|
+
import { useCommonStore as r } from "@plitzi/sdk-shared/store";
|
|
3
|
+
// src/elements/structure/Disclosure/useDetails.ts
|
|
4
|
+
var i = (e) => e?.querySelector(":scope > summary") ?? null, a = ({ ref: a, open: o, setOpen: s, editing: c, closeOnClickOutside: l, closeOnNavigate: u }) => {
|
|
5
|
+
let [d] = r("navigation.href"), f = e((e) => {
|
|
6
|
+
let t = e.currentTarget instanceof HTMLDetailsElement && e.currentTarget.open;
|
|
7
|
+
!c && t !== o && s(t);
|
|
8
|
+
}, [
|
|
9
|
+
c,
|
|
10
|
+
o,
|
|
11
|
+
s
|
|
12
|
+
]), p = e((e) => {
|
|
13
|
+
c && e.target instanceof Element && i(e.currentTarget)?.contains(e.target) && e.preventDefault();
|
|
14
|
+
}, [c]), m = e((e) => {
|
|
15
|
+
e.key === "Escape" && !c && o && (e.stopPropagation(), s(!1), i(e.currentTarget)?.focus({ preventScroll: !0 }));
|
|
16
|
+
}, [
|
|
17
|
+
c,
|
|
18
|
+
o,
|
|
19
|
+
s
|
|
20
|
+
]);
|
|
21
|
+
t(() => {
|
|
22
|
+
let e = a.current;
|
|
23
|
+
if (!e || c || !o || !l) return;
|
|
24
|
+
let t = (t) => {
|
|
25
|
+
t.target instanceof Node && !e.contains(t.target) && s(!1);
|
|
26
|
+
}, n = e.ownerDocument;
|
|
27
|
+
return n.addEventListener("pointerdown", t), () => n.removeEventListener("pointerdown", t);
|
|
28
|
+
}, [
|
|
29
|
+
a,
|
|
30
|
+
c,
|
|
31
|
+
o,
|
|
32
|
+
l,
|
|
33
|
+
s
|
|
34
|
+
]);
|
|
35
|
+
let h = n(d);
|
|
36
|
+
return t(() => {
|
|
37
|
+
h.current !== d && (h.current = d, u && o && s(!1));
|
|
38
|
+
}, [
|
|
39
|
+
d,
|
|
40
|
+
u,
|
|
41
|
+
o,
|
|
42
|
+
s
|
|
43
|
+
]), {
|
|
44
|
+
onToggle: f,
|
|
45
|
+
onClickCapture: p,
|
|
46
|
+
onKeyDown: m
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
export { a as default };
|
|
@@ -1,32 +1,36 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import l from "
|
|
8
|
-
import
|
|
1
|
+
import e from "./TimeWindowContext.mjs";
|
|
2
|
+
import t from "../../../Element/hocs/withElement.mjs";
|
|
3
|
+
import { RootElement as n } from "../../../Element/RootElement.mjs";
|
|
4
|
+
import { useEffect as r, useMemo as i, useState as a } from "react";
|
|
5
|
+
import { useCommonStore as o, useRenderSettings as s } from "@plitzi/sdk-shared/store";
|
|
6
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
7
|
+
import { isWindowOpen as l, nextWindowChange as u } from "@plitzi/sdk-shared/timeWindows";
|
|
8
|
+
import d from "clsx";
|
|
9
|
+
import { HIDDEN_CLASS as f } from "@plitzi/sdk-shared/style";
|
|
9
10
|
// src/elements/structure/TimeWindow/TimeWindow.tsx
|
|
10
|
-
var
|
|
11
|
-
let [
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}, [
|
|
15
|
-
let e =
|
|
11
|
+
var p = 2 ** 31 - 1, m = ({ ref: t, className: m = "", children: h, startsAt: g = "", endsAt: _ = "" }) => {
|
|
12
|
+
let [v] = o("clock"), { builder: y, previewMode: b } = s(), [x, S] = a(() => v?.at ?? Date.now());
|
|
13
|
+
r(() => {
|
|
14
|
+
S(v?.simulated ? v.at : Date.now());
|
|
15
|
+
}, [v]), r(() => {
|
|
16
|
+
let e = v?.simulated ? void 0 : u(x, g, _);
|
|
16
17
|
if (e === void 0) return;
|
|
17
|
-
let t = setTimeout(() =>
|
|
18
|
+
let t = setTimeout(() => S(Date.now()), Math.min(p, Math.max(0, e - Date.now())));
|
|
18
19
|
return () => clearTimeout(t);
|
|
19
20
|
}, [
|
|
21
|
+
v,
|
|
20
22
|
g,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
y
|
|
23
|
+
_,
|
|
24
|
+
x
|
|
24
25
|
]);
|
|
25
|
-
let
|
|
26
|
-
return /* @__PURE__ */
|
|
27
|
-
ref:
|
|
28
|
-
className:
|
|
29
|
-
children:
|
|
26
|
+
let C = y && !b || l(x, g, _), w = i(() => ({ endsAt: _ }), [_]);
|
|
27
|
+
return /* @__PURE__ */ c(n, {
|
|
28
|
+
ref: t,
|
|
29
|
+
className: d("plitzi-component__time-window", m, { [f]: !C }),
|
|
30
|
+
children: C && /* @__PURE__ */ c(e, {
|
|
31
|
+
value: w,
|
|
32
|
+
children: h
|
|
33
|
+
})
|
|
30
34
|
});
|
|
31
|
-
},
|
|
32
|
-
export {
|
|
35
|
+
}, h = t(m);
|
|
36
|
+
export { m as TimeWindow, h as default };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** The time window around an element, as what is inside reads it: a countdown counts to its end. */
|
|
2
|
+
export type TimeWindowContextValue = {
|
|
3
|
+
endsAt: string;
|
|
4
|
+
} | undefined;
|
|
5
|
+
declare const TimeWindowContext: import('react').Context<TimeWindowContextValue>;
|
|
6
|
+
export default TimeWindowContext;
|
|
@@ -13,7 +13,7 @@ import x from "clsx";
|
|
|
13
13
|
import { BuilderContext as S } from "@plitzi/sdk-shared/builder/contexts";
|
|
14
14
|
import C from "@plitzi/plitzi-ui/Button";
|
|
15
15
|
import w from "@plitzi/plitzi-ui/Input";
|
|
16
|
-
// src/elements/
|
|
16
|
+
// src/elements/structure/Variants/Settings.tsx
|
|
17
17
|
var T = [{
|
|
18
18
|
mode: "chance",
|
|
19
19
|
label: "By chance",
|
|
@@ -10,7 +10,7 @@ import { BuilderContext as h } from "@plitzi/sdk-shared/builder/contexts";
|
|
|
10
10
|
import g from "@plitzi/plitzi-ui/Button";
|
|
11
11
|
import _ from "@plitzi/plitzi-ui/Input";
|
|
12
12
|
import v from "@plitzi/plitzi-ui/QueryBuilder";
|
|
13
|
-
// src/elements/
|
|
13
|
+
// src/elements/structure/Variants/VariantItem/Settings.tsx
|
|
14
14
|
var y = {
|
|
15
15
|
combinator: "and",
|
|
16
16
|
rules: []
|