@plitzi/sdk-elements 0.37.1 → 0.37.2
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 +151 -0
- package/dist/Component/ComponentProvider.d.ts +1 -1
- package/dist/Element/JsxManager.d.ts +1 -1
- package/dist/Element/LayoutBody.d.ts +1 -1
- package/dist/Element/PluginManager.d.ts +1 -1
- package/dist/Element/PluginRemote.d.ts +1 -1
- package/dist/Element/ReplicaProvider.d.ts +1 -1
- package/dist/Element/helpers/pluginSelector.d.ts +1 -1
- package/dist/Element/hocs/withElement.d.ts +1 -1
- package/dist/Element/hooks/useRootElementInteractions.mjs +7 -1
- package/dist/components/ElementAdvancedEditor.d.ts +1 -1
- package/dist/dataSource/GlobalSources.mjs +24 -22
- package/dist/elements/advanced/BlockHtml/BlockHtml.d.ts +2 -2
- package/dist/elements/advanced/BlockHtml/Settings.d.ts +1 -1
- package/dist/elements/advanced/BlockHtml/index.d.ts +1 -1
- package/dist/elements/advanced/BlockJsx/BlockJsx.d.ts +2 -2
- package/dist/elements/advanced/BlockJsx/Settings.d.ts +1 -1
- package/dist/elements/advanced/BlockJsx/index.d.ts +1 -1
- package/dist/elements/advanced/Custom/Custom.d.ts +2 -2
- package/dist/elements/advanced/Custom/Settings.d.ts +1 -1
- package/dist/elements/advanced/Custom/index.d.ts +1 -1
- package/dist/elements/advanced/NodeHtml/index.d.ts +1 -1
- package/dist/elements/advanced/PlitziSdk/Settings.d.ts +1 -1
- package/dist/elements/advanced/Reference/Reference.d.ts +2 -2
- package/dist/elements/advanced/Reference/Settings.d.ts +1 -1
- package/dist/elements/advanced/Reference/index.d.ts +1 -1
- package/dist/elements/basic/Button/Button.d.ts +2 -2
- package/dist/elements/basic/Button/Settings.d.ts +1 -1
- package/dist/elements/basic/Button/index.d.ts +1 -1
- package/dist/elements/basic/Dropdown/Dropdown.d.ts +2 -2
- package/dist/elements/basic/Dropdown/DropdownPopup/DropdownPopup.d.ts +2 -2
- package/dist/elements/basic/Dropdown/DropdownPopup/Settings.d.ts +1 -1
- package/dist/elements/basic/Dropdown/DropdownPopup/declaration.d.ts +2 -1
- package/dist/elements/basic/Dropdown/DropdownPopup/declaration.mjs +2 -1
- package/dist/elements/basic/Dropdown/DropdownPopup/index.d.ts +3 -2
- package/dist/elements/basic/Dropdown/Settings.d.ts +1 -1
- package/dist/elements/basic/Dropdown/index.d.ts +4 -3
- package/dist/elements/basic/Heading/Heading.d.ts +2 -2
- package/dist/elements/basic/Heading/Settings.d.ts +1 -1
- package/dist/elements/basic/Heading/index.d.ts +1 -1
- package/dist/elements/basic/Link/Link.d.ts +2 -2
- package/dist/elements/basic/Link/Link.mjs +1 -1
- package/dist/elements/basic/Link/Settings.d.ts +1 -1
- package/dist/elements/basic/Link/index.d.ts +1 -1
- package/dist/elements/basic/Markdown/Markdown.d.ts +2 -2
- package/dist/elements/basic/Markdown/Settings.d.ts +1 -1
- package/dist/elements/basic/Markdown/index.d.ts +1 -1
- package/dist/elements/basic/Paragraph/Paragraph.d.ts +2 -2
- package/dist/elements/basic/Paragraph/Settings.d.ts +1 -1
- package/dist/elements/basic/Paragraph/index.d.ts +1 -1
- package/dist/elements/basic/RichText/RichText.d.ts +2 -2
- package/dist/elements/basic/RichText/Settings.d.ts +1 -1
- package/dist/elements/basic/RichText/index.d.ts +1 -1
- package/dist/elements/basic/Text/Settings.d.ts +1 -1
- package/dist/elements/basic/Text/Text.d.ts +2 -2
- package/dist/elements/basic/Text/index.d.ts +1 -1
- package/dist/elements/basic/ThemeToggle/ThemeToggle.d.ts +2 -2
- package/dist/elements/basic/ThemeToggle/ThemeToggle.mjs +55 -62
- package/dist/elements/basic/ThemeToggle/declaration.d.ts +12 -1
- package/dist/elements/basic/ThemeToggle/declaration.mjs +8 -1
- package/dist/elements/basic/ThemeToggle/index.d.ts +13 -2
- package/dist/elements/declarations/index.d.ts +314 -5
- package/dist/elements/form/Form/Form.d.ts +2 -2
- package/dist/elements/form/Form/Form.mjs +37 -57
- package/dist/elements/form/Form/Settings.d.ts +1 -1
- package/dist/elements/form/Form/declaration.d.ts +57 -0
- package/dist/elements/form/Form/declaration.mjs +55 -0
- package/dist/elements/form/Form/index.d.ts +59 -2
- package/dist/elements/form/FormControl/FormControl.d.ts +2 -2
- package/dist/elements/form/FormControl/FormControl.mjs +33 -41
- package/dist/elements/form/FormControl/Settings.d.ts +1 -1
- package/dist/elements/form/FormControl/components/Label.d.ts +1 -1
- package/dist/elements/form/FormControl/declaration.d.ts +12 -0
- package/dist/elements/form/FormControl/declaration.mjs +10 -0
- package/dist/elements/form/FormControl/hocs/withFieldValue.d.ts +1 -1
- package/dist/elements/form/FormControl/index.d.ts +14 -2
- package/dist/elements/form/FormControl/inputs/Checkbox.d.ts +1 -1
- package/dist/elements/form/FormControl/inputs/Hidden.d.ts +1 -1
- package/dist/elements/form/FormControl/inputs/Input.d.ts +1 -1
- package/dist/elements/form/FormControl/inputs/Select.d.ts +1 -1
- package/dist/elements/form/FormControl/inputs/Textarea.d.ts +1 -1
- package/dist/elements/internal/LayoutContainer/LayoutContainer.d.ts +2 -2
- package/dist/elements/internal/LayoutContainer/Settings.d.ts +1 -1
- package/dist/elements/internal/LayoutContainer/index.d.ts +1 -1
- package/dist/elements/internal/LayoutPicker/LayoutPicker.d.ts +1 -1
- package/dist/elements/internal/Loading/Loading.d.ts +2 -2
- package/dist/elements/internal/Loading/index.d.ts +1 -1
- package/dist/elements/internal/NotFound/NotFound.d.ts +2 -2
- package/dist/elements/internal/NotFound/index.d.ts +1 -1
- package/dist/elements/internal/Page/Page.d.ts +2 -2
- package/dist/elements/internal/Page/Page.mjs +34 -43
- package/dist/elements/internal/Page/Settings.d.ts +1 -1
- package/dist/elements/internal/Page/declaration.d.ts +13 -0
- package/dist/elements/internal/Page/declaration.mjs +11 -0
- package/dist/elements/internal/Page/index.d.ts +14 -1
- package/dist/elements/media/FontAwesome/FontAwesome.d.ts +2 -2
- package/dist/elements/media/FontAwesome/Settings.d.ts +1 -1
- package/dist/elements/media/FontAwesome/index.d.ts +1 -1
- package/dist/elements/media/Image/Image.d.ts +2 -2
- package/dist/elements/media/Image/Settings.d.ts +1 -1
- package/dist/elements/media/Image/index.d.ts +1 -1
- package/dist/elements/media/Video/Settings.d.ts +1 -1
- package/dist/elements/media/Video/Video.d.ts +2 -2
- package/dist/elements/media/Video/index.d.ts +1 -1
- package/dist/elements/provider/ApiContainer/ApiContainer.d.ts +11 -2
- package/dist/elements/provider/ApiContainer/ApiContainer.mjs +119 -161
- package/dist/elements/provider/ApiContainer/Settings.d.ts +2 -1
- package/dist/elements/provider/ApiContainer/Settings.mjs +129 -122
- package/dist/elements/provider/ApiContainer/components/FiltersInput/FiltersInput.d.ts +1 -1
- package/dist/elements/provider/ApiContainer/declaration.d.ts +75 -0
- package/dist/elements/provider/ApiContainer/declaration.mjs +72 -1
- package/dist/elements/provider/ApiContainer/helpers/providerOutcome.d.ts +25 -0
- package/dist/elements/provider/ApiContainer/helpers/providerOutcome.mjs +7 -0
- package/dist/elements/provider/ApiContainer/hooks/useAutoRefresh.d.ts +21 -0
- package/dist/elements/provider/ApiContainer/hooks/useAutoRefresh.mjs +18 -0
- package/dist/elements/provider/ApiContainer/index.d.ts +76 -1
- package/dist/elements/structure/Container/Container.d.ts +2 -2
- package/dist/elements/structure/Container/Settings.d.ts +1 -1
- package/dist/elements/structure/Container/index.d.ts +1 -1
- package/dist/elements/structure/DialogContainer/DialogContainer.d.ts +2 -2
- package/dist/elements/structure/DialogContainer/DialogContainer.mjs +10 -60
- package/dist/elements/structure/DialogContainer/Settings.d.ts +1 -1
- package/dist/elements/structure/DialogContainer/declaration.d.ts +82 -1
- package/dist/elements/structure/DialogContainer/declaration.mjs +62 -1
- package/dist/elements/structure/DialogContainer/index.d.ts +83 -2
- package/dist/elements/structure/List/List.d.ts +2 -2
- package/dist/elements/structure/List/ListItem/ListItem.d.ts +2 -2
- package/dist/elements/structure/List/ListItem/Settings.d.ts +1 -1
- package/dist/elements/structure/List/ListItem/index.d.ts +1 -1
- package/dist/elements/structure/List/Settings.d.ts +1 -1
- package/dist/elements/structure/List/index.d.ts +2 -2
- package/dist/elements/structure/List/modes/ListBasic.d.ts +1 -1
- package/dist/elements/structure/List/modes/ListControlled/ListControlled.d.ts +1 -1
- package/dist/elements/structure/List/modes/ListControlled/ListControlledItem.d.ts +1 -1
- package/dist/elements/structure/ModalContainer/ModalContainer.d.ts +2 -2
- package/dist/elements/structure/ModalContainer/ModalContainer.mjs +10 -37
- package/dist/elements/structure/ModalContainer/Settings.d.ts +1 -1
- package/dist/elements/structure/ModalContainer/declaration.d.ts +48 -2
- package/dist/elements/structure/ModalContainer/declaration.mjs +40 -2
- package/dist/elements/structure/ModalContainer/index.d.ts +49 -3
- package/dist/elements/structure/Pagination/Pagination.d.ts +2 -2
- package/dist/elements/structure/Pagination/Pagination.mjs +45 -50
- package/dist/elements/structure/Pagination/Settings.d.ts +1 -1
- package/dist/elements/structure/Pagination/declaration.d.ts +11 -0
- package/dist/elements/structure/Pagination/declaration.mjs +7 -0
- package/dist/elements/structure/Pagination/index.d.ts +12 -1
- package/dist/elements/structure/TabContainer/Settings.d.ts +1 -1
- package/dist/elements/structure/TabContainer/TabContainer.d.ts +2 -2
- package/dist/elements/structure/TabContainer/TabContainerBody/Settings.d.ts +1 -1
- package/dist/elements/structure/TabContainer/TabContainerBody/TabContainerBody.d.ts +2 -2
- package/dist/elements/structure/TabContainer/TabContainerBody/declaration.d.ts +1 -0
- package/dist/elements/structure/TabContainer/TabContainerBody/declaration.mjs +1 -0
- package/dist/elements/structure/TabContainer/TabContainerBody/index.d.ts +2 -1
- package/dist/elements/structure/TabContainer/TabContainerHeader/Settings.d.ts +1 -1
- package/dist/elements/structure/TabContainer/TabContainerHeader/TabContainerHeader.d.ts +2 -2
- package/dist/elements/structure/TabContainer/TabContainerHeader/declaration.d.ts +1 -0
- package/dist/elements/structure/TabContainer/TabContainerHeader/declaration.mjs +1 -0
- package/dist/elements/structure/TabContainer/TabContainerHeader/index.d.ts +2 -1
- package/dist/elements/structure/TabContainer/TabContainerItem/Settings.d.ts +1 -1
- package/dist/elements/structure/TabContainer/TabContainerItem/TabContainerItem.d.ts +2 -2
- package/dist/elements/structure/TabContainer/TabContainerItem/index.d.ts +1 -1
- package/dist/elements/structure/TabContainer/index.d.ts +6 -4
- package/dist/index.d.ts +351 -42
- package/package.json +17 -9
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
declare const Dropdown: {
|
|
2
|
-
(props: import('../../../Element/hocs/withElement').WithElementProps<import('./Dropdown').DropdownProps>): import(
|
|
2
|
+
(props: import('../../../Element/hocs/withElement').WithElementProps<import('./Dropdown').DropdownProps>): import('react').JSX.Element;
|
|
3
3
|
displayName: string;
|
|
4
4
|
} & {
|
|
5
5
|
plugins: {
|
|
6
6
|
dropdownPopup: {
|
|
7
|
-
(props: import('../../../Element/hocs/withElement').WithElementProps<import('./DropdownPopup/DropdownPopup').DropdownPopupProps>): import(
|
|
7
|
+
(props: import('../../../Element/hocs/withElement').WithElementProps<import('./DropdownPopup/DropdownPopup').DropdownPopupProps>): import('react').JSX.Element;
|
|
8
8
|
displayName: string;
|
|
9
9
|
} & {
|
|
10
10
|
readonly type: "dropdownPopup";
|
|
11
|
+
readonly ancestorType: "dropdown";
|
|
11
12
|
readonly content: {
|
|
12
13
|
readonly attributes: {};
|
|
13
14
|
readonly definition: {
|
|
@@ -45,7 +46,7 @@ declare const Dropdown: {
|
|
|
45
46
|
readonly style: {
|
|
46
47
|
readonly base: {
|
|
47
48
|
readonly default: {
|
|
48
|
-
readonly 'background-color': "white";
|
|
49
|
+
readonly 'background-color': "light-dark(white, oklch(0.21 0.006 285.885))";
|
|
49
50
|
readonly 'padding-right': "4px";
|
|
50
51
|
readonly 'padding-bottom': "4px";
|
|
51
52
|
readonly 'padding-left': "4px";
|
|
@@ -5,9 +5,9 @@ export type HeadingProps = {
|
|
|
5
5
|
content?: string;
|
|
6
6
|
subType?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
7
7
|
};
|
|
8
|
-
declare const Heading: ({ ref, className, content, subType }: HeadingProps) => import(
|
|
8
|
+
declare const Heading: ({ ref, className, content, subType }: HeadingProps) => import('react').JSX.Element;
|
|
9
9
|
declare const _default: {
|
|
10
|
-
(props: import('../../../Element/hocs/withElement').WithElementProps<HeadingProps>): import(
|
|
10
|
+
(props: import('../../../Element/hocs/withElement').WithElementProps<HeadingProps>): import('react').JSX.Element;
|
|
11
11
|
displayName: string;
|
|
12
12
|
};
|
|
13
13
|
export default _default;
|
|
@@ -3,5 +3,5 @@ type SettingsProps = {
|
|
|
3
3
|
content?: string;
|
|
4
4
|
onUpdate?: (key: string, value: string | boolean | number) => void;
|
|
5
5
|
};
|
|
6
|
-
declare const Settings: ({ subType, content, onUpdate }: SettingsProps) => import(
|
|
6
|
+
declare const Settings: ({ subType, content, onUpdate }: SettingsProps) => import('react').JSX.Element;
|
|
7
7
|
export default Settings;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare const Heading: {
|
|
2
|
-
(props: import('../../../Element/hocs/withElement').WithElementProps<import('./Heading').HeadingProps>): import(
|
|
2
|
+
(props: import('../../../Element/hocs/withElement').WithElementProps<import('./Heading').HeadingProps>): import('react').JSX.Element;
|
|
3
3
|
displayName: string;
|
|
4
4
|
} & {
|
|
5
5
|
readonly type: "heading";
|
|
@@ -14,9 +14,9 @@ export type LinkProps = {
|
|
|
14
14
|
*/
|
|
15
15
|
label?: string;
|
|
16
16
|
};
|
|
17
|
-
declare const Link: ({ ref, children, className, href, target, mode, label }: LinkProps) => import(
|
|
17
|
+
declare const Link: ({ ref, children, className, href, target, mode, label }: LinkProps) => import('react').JSX.Element;
|
|
18
18
|
declare const _default: {
|
|
19
|
-
(props: import('../../../Element/hocs/withElement').WithElementProps<LinkProps>): import(
|
|
19
|
+
(props: import('../../../Element/hocs/withElement').WithElementProps<LinkProps>): import('react').JSX.Element;
|
|
20
20
|
displayName: string;
|
|
21
21
|
};
|
|
22
22
|
export default _default;
|
|
@@ -18,8 +18,8 @@ var u = ({ ref: e, children: u, className: d = "", href: f = "#", target: p = "s
|
|
|
18
18
|
"navigation.navigate"
|
|
19
19
|
]), C = r(() => {
|
|
20
20
|
if (m === "external") return f;
|
|
21
|
-
let e = `/${f}`.replaceAll(/[/]+/gim, "/");
|
|
22
21
|
if (m === "internal") {
|
|
22
|
+
let e = `/${f}`.replaceAll(/[/]+/gim, "/");
|
|
23
23
|
try {
|
|
24
24
|
let t = o(e, {
|
|
25
25
|
...x,
|
|
@@ -4,5 +4,5 @@ type SettingsProps = {
|
|
|
4
4
|
target?: 'blank' | 'self' | 'parent' | 'top';
|
|
5
5
|
onUpdate?: (key: string, value: string | boolean | number) => void;
|
|
6
6
|
};
|
|
7
|
-
declare const Settings: ({ mode, href, target, onUpdate }: SettingsProps) => import(
|
|
7
|
+
declare const Settings: ({ mode, href, target, onUpdate }: SettingsProps) => import('react').JSX.Element;
|
|
8
8
|
export default Settings;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare const Link: {
|
|
2
|
-
(props: import('../../../Element/hocs/withElement').WithElementProps<import('./Link').LinkProps>): import(
|
|
2
|
+
(props: import('../../../Element/hocs/withElement').WithElementProps<import('./Link').LinkProps>): import('react').JSX.Element;
|
|
3
3
|
displayName: string;
|
|
4
4
|
} & {
|
|
5
5
|
readonly type: "link";
|
|
@@ -4,9 +4,9 @@ export type MarkdownProps = {
|
|
|
4
4
|
className: string;
|
|
5
5
|
content: string;
|
|
6
6
|
};
|
|
7
|
-
declare const Markdown: ({ ref, content, className }: MarkdownProps) => import(
|
|
7
|
+
declare const Markdown: ({ ref, content, className }: MarkdownProps) => import('react').JSX.Element;
|
|
8
8
|
declare const _default: {
|
|
9
|
-
(props: import('../../../Element/hocs/withElement').WithElementProps<MarkdownProps>): import(
|
|
9
|
+
(props: import('../../../Element/hocs/withElement').WithElementProps<MarkdownProps>): import('react').JSX.Element;
|
|
10
10
|
displayName: string;
|
|
11
11
|
};
|
|
12
12
|
export default _default;
|
|
@@ -2,5 +2,5 @@ type SettingsProps = {
|
|
|
2
2
|
content?: string;
|
|
3
3
|
onUpdate?: (key: string, value: string | boolean | number) => void;
|
|
4
4
|
};
|
|
5
|
-
declare const Settings: ({ content, onUpdate }: SettingsProps) => import(
|
|
5
|
+
declare const Settings: ({ content, onUpdate }: SettingsProps) => import('react').JSX.Element;
|
|
6
6
|
export default Settings;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare const Markdown: {
|
|
2
|
-
(props: import('../../../Element/hocs/withElement').WithElementProps<import('./Markdown').MarkdownProps>): import(
|
|
2
|
+
(props: import('../../../Element/hocs/withElement').WithElementProps<import('./Markdown').MarkdownProps>): import('react').JSX.Element;
|
|
3
3
|
displayName: string;
|
|
4
4
|
} & {
|
|
5
5
|
readonly type: "markdown";
|
|
@@ -4,9 +4,9 @@ export type ParagraphProps = {
|
|
|
4
4
|
content?: string | number;
|
|
5
5
|
className?: string;
|
|
6
6
|
};
|
|
7
|
-
declare const Paragraph: ({ ref, content, className }: ParagraphProps) => import(
|
|
7
|
+
declare const Paragraph: ({ ref, content, className }: ParagraphProps) => import('react').JSX.Element;
|
|
8
8
|
declare const _default: {
|
|
9
|
-
(props: import('../../../Element/hocs/withElement').WithElementProps<ParagraphProps>): import(
|
|
9
|
+
(props: import('../../../Element/hocs/withElement').WithElementProps<ParagraphProps>): import('react').JSX.Element;
|
|
10
10
|
displayName: string;
|
|
11
11
|
};
|
|
12
12
|
export default _default;
|
|
@@ -2,5 +2,5 @@ type SettingsProps = {
|
|
|
2
2
|
content?: string;
|
|
3
3
|
onUpdate?: (key: string, value: string | boolean | number) => void;
|
|
4
4
|
};
|
|
5
|
-
declare const Settings: ({ content, onUpdate }: SettingsProps) => import(
|
|
5
|
+
declare const Settings: ({ content, onUpdate }: SettingsProps) => import('react').JSX.Element;
|
|
6
6
|
export default Settings;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare const Paragraph: {
|
|
2
|
-
(props: import('../../../Element/hocs/withElement').WithElementProps<import('./Paragraph').ParagraphProps>): import(
|
|
2
|
+
(props: import('../../../Element/hocs/withElement').WithElementProps<import('./Paragraph').ParagraphProps>): import('react').JSX.Element;
|
|
3
3
|
displayName: string;
|
|
4
4
|
} & {
|
|
5
5
|
readonly type: "paragraph";
|
|
@@ -11,9 +11,9 @@ export type RichTextProps = {
|
|
|
11
11
|
* body field is opaque to it. */
|
|
12
12
|
mediaBaseUrl?: string;
|
|
13
13
|
};
|
|
14
|
-
declare const RichText: ({ ref, className, content, format, mediaBaseUrl }: RichTextProps) => import(
|
|
14
|
+
declare const RichText: ({ ref, className, content, format, mediaBaseUrl }: RichTextProps) => import('react').JSX.Element;
|
|
15
15
|
declare const _default: {
|
|
16
|
-
(props: import('../../../Element/hocs/withElement').WithElementProps<RichTextProps>): import(
|
|
16
|
+
(props: import('../../../Element/hocs/withElement').WithElementProps<RichTextProps>): import('react').JSX.Element;
|
|
17
17
|
displayName: string;
|
|
18
18
|
};
|
|
19
19
|
export default _default;
|
|
@@ -3,5 +3,5 @@ type SettingsProps = {
|
|
|
3
3
|
mediaBaseUrl?: string;
|
|
4
4
|
onUpdate?: (key: string, value: string | boolean | number | object) => void;
|
|
5
5
|
};
|
|
6
|
-
declare const Settings: ({ format, mediaBaseUrl, onUpdate }: SettingsProps) => import(
|
|
6
|
+
declare const Settings: ({ format, mediaBaseUrl, onUpdate }: SettingsProps) => import('react').JSX.Element;
|
|
7
7
|
export default Settings;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare const RichText: {
|
|
2
|
-
(props: import('../../../Element/hocs/withElement').WithElementProps<import('./RichText').RichTextProps>): import(
|
|
2
|
+
(props: import('../../../Element/hocs/withElement').WithElementProps<import('./RichText').RichTextProps>): import('react').JSX.Element;
|
|
3
3
|
displayName: string;
|
|
4
4
|
} & {
|
|
5
5
|
readonly type: "richText";
|
|
@@ -2,5 +2,5 @@ type SettingsProps = {
|
|
|
2
2
|
content?: string;
|
|
3
3
|
onUpdate?: (key: string, value: string | boolean | number) => void;
|
|
4
4
|
};
|
|
5
|
-
declare const Settings: ({ content, onUpdate }: SettingsProps) => import(
|
|
5
|
+
declare const Settings: ({ content, onUpdate }: SettingsProps) => import('react').JSX.Element;
|
|
6
6
|
export default Settings;
|
|
@@ -4,9 +4,9 @@ export type TextProps = {
|
|
|
4
4
|
className?: string;
|
|
5
5
|
content?: string | number;
|
|
6
6
|
};
|
|
7
|
-
declare const Text: ({ ref, content, className }: TextProps) => import(
|
|
7
|
+
declare const Text: ({ ref, content, className }: TextProps) => import('react').JSX.Element;
|
|
8
8
|
declare const _default: {
|
|
9
|
-
(props: import('../../../Element/hocs/withElement').WithElementProps<TextProps>): import(
|
|
9
|
+
(props: import('../../../Element/hocs/withElement').WithElementProps<TextProps>): import('react').JSX.Element;
|
|
10
10
|
displayName: string;
|
|
11
11
|
};
|
|
12
12
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare const Text: {
|
|
2
|
-
(props: import('../../../Element/hocs/withElement').WithElementProps<import('./Text').TextProps>): import(
|
|
2
|
+
(props: import('../../../Element/hocs/withElement').WithElementProps<import('./Text').TextProps>): import('react').JSX.Element;
|
|
3
3
|
displayName: string;
|
|
4
4
|
} & {
|
|
5
5
|
readonly type: "text";
|
|
@@ -22,9 +22,9 @@ export type ThemeToggleProps = {
|
|
|
22
22
|
* shows, so the server and the browser agree byte for byte: a control whose markup changed with the stored theme
|
|
23
23
|
* would either flash the wrong icon on every load or force the page to wait for storage before painting.
|
|
24
24
|
*/
|
|
25
|
-
declare const ThemeToggle: ({ ref, className, subType, lightLabel, darkLabel, systemLabel, showSystem }: ThemeToggleProps) => import(
|
|
25
|
+
declare const ThemeToggle: ({ ref, className, subType, lightLabel, darkLabel, systemLabel, showSystem }: ThemeToggleProps) => import('react').JSX.Element;
|
|
26
26
|
declare const _default: {
|
|
27
|
-
(props: import('../../../Element/hocs/withElement').WithElementProps<ThemeToggleProps>): import(
|
|
27
|
+
(props: import('../../../Element/hocs/withElement').WithElementProps<ThemeToggleProps>): import('react').JSX.Element;
|
|
28
28
|
displayName: string;
|
|
29
29
|
};
|
|
30
30
|
export default _default;
|
|
@@ -1,13 +1,14 @@
|
|
|
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 l from "
|
|
6
|
-
import
|
|
7
|
-
import f from "
|
|
8
|
-
import p from "
|
|
4
|
+
import r from "./declaration.mjs";
|
|
5
|
+
import { use as i, useCallback as a, useEffect as o, useMemo as s, useRef as c, useSyncExternalStore as l } from "react";
|
|
6
|
+
import u from "@plitzi/sdk-shared/hooks/usePlitziServiceContext";
|
|
7
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
8
|
+
import p from "clsx";
|
|
9
|
+
import m from "@plitzi/sdk-shared/theme/useTheme";
|
|
9
10
|
//#region src/elements/basic/ThemeToggle/ThemeToggle.tsx
|
|
10
|
-
var
|
|
11
|
+
var h = () => () => {}, g = () => !0, _ = () => !1, v = () => /* @__PURE__ */ f("svg", {
|
|
11
12
|
viewBox: "0 0 24 24",
|
|
12
13
|
width: "1em",
|
|
13
14
|
height: "1em",
|
|
@@ -15,15 +16,15 @@ var m = () => () => {}, h = () => !0, g = () => !1, _ = () => /* @__PURE__ */ d(
|
|
|
15
16
|
stroke: "currentColor",
|
|
16
17
|
strokeWidth: "2",
|
|
17
18
|
"aria-hidden": !0,
|
|
18
|
-
children: [/* @__PURE__ */
|
|
19
|
+
children: [/* @__PURE__ */ d("circle", {
|
|
19
20
|
cx: "12",
|
|
20
21
|
cy: "12",
|
|
21
22
|
r: "4.2"
|
|
22
|
-
}), /* @__PURE__ */
|
|
23
|
+
}), /* @__PURE__ */ d("path", {
|
|
23
24
|
strokeLinecap: "round",
|
|
24
25
|
d: "M12 2.6v2.2M12 19.2v2.2M4.2 12H2M22 12h-2.2M6.3 6.3 4.8 4.8M19.2 19.2l-1.5-1.5M17.7 6.3l1.5-1.5M4.8 19.2l1.5-1.5"
|
|
25
26
|
})]
|
|
26
|
-
}),
|
|
27
|
+
}), y = () => /* @__PURE__ */ d("svg", {
|
|
27
28
|
viewBox: "0 0 24 24",
|
|
28
29
|
width: "1em",
|
|
29
30
|
height: "1em",
|
|
@@ -31,84 +32,76 @@ var m = () => () => {}, h = () => !0, g = () => !1, _ = () => /* @__PURE__ */ d(
|
|
|
31
32
|
stroke: "currentColor",
|
|
32
33
|
strokeWidth: "2",
|
|
33
34
|
"aria-hidden": !0,
|
|
34
|
-
children: /* @__PURE__ */
|
|
35
|
+
children: /* @__PURE__ */ d("path", {
|
|
35
36
|
strokeLinejoin: "round",
|
|
36
37
|
d: "M20.5 14.3A8.6 8.6 0 0 1 9.7 3.5a8.6 8.6 0 1 0 10.8 10.8Z"
|
|
37
38
|
})
|
|
38
|
-
}),
|
|
39
|
-
let { theme:
|
|
40
|
-
t.preventDefault(),
|
|
41
|
-
}, [
|
|
42
|
-
e.preventDefault(),
|
|
43
|
-
}, [
|
|
44
|
-
...
|
|
39
|
+
}), b = ({ ref: e, className: b = "", subType: x = "switch", lightLabel: S = "Light", darkLabel: C = "Dark", systemLabel: w = "System", showSystem: T = !1 }) => {
|
|
40
|
+
let { theme: E, setTheme: D, toggleTheme: O } = m(), { id: k, definition: { styleSelectors: A } } = t(), { settings: { previewMode: j }, contexts: { InteractionsContext: M } } = u(), { interactionsManager: N } = i(M), P = l(h, g, _), F = a((e) => (t) => {
|
|
41
|
+
t.preventDefault(), j && D(e);
|
|
42
|
+
}, [j, D]), I = a((e) => {
|
|
43
|
+
e.preventDefault(), j && O();
|
|
44
|
+
}, [j, O]), L = s(() => [
|
|
45
|
+
...T ? [{
|
|
45
46
|
value: "system",
|
|
46
|
-
label:
|
|
47
|
+
label: w,
|
|
47
48
|
icon: null
|
|
48
49
|
}] : [],
|
|
49
50
|
{
|
|
50
51
|
value: "light",
|
|
51
|
-
label:
|
|
52
|
-
icon: /* @__PURE__ */
|
|
52
|
+
label: S,
|
|
53
|
+
icon: /* @__PURE__ */ d(v, {})
|
|
53
54
|
},
|
|
54
55
|
{
|
|
55
56
|
value: "dark",
|
|
56
|
-
label:
|
|
57
|
-
icon: /* @__PURE__ */
|
|
57
|
+
label: C,
|
|
58
|
+
icon: /* @__PURE__ */ d(y, {})
|
|
58
59
|
}
|
|
59
60
|
], [
|
|
61
|
+
T,
|
|
60
62
|
w,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
L.current = T, e !== null && e !== T && M.interactionTrigger(O, "onThemeChange", { theme: T });
|
|
63
|
+
S,
|
|
64
|
+
C
|
|
65
|
+
]), R = c(null);
|
|
66
|
+
return o(() => {
|
|
67
|
+
let e = R.current;
|
|
68
|
+
R.current = E, e !== null && e !== E && N.interactionTrigger(k, "onThemeChange", { theme: E });
|
|
68
69
|
}, [
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
])
|
|
73
|
-
let R = o(() => ({ onThemeChange: {
|
|
74
|
-
action: "onThemeChange",
|
|
75
|
-
title: "On Theme Change",
|
|
76
|
-
type: "trigger",
|
|
77
|
-
params: {},
|
|
78
|
-
preview: { theme: "dark" }
|
|
79
|
-
} }), []);
|
|
80
|
-
return b === "segmented" ? /* @__PURE__ */ u(n, {
|
|
70
|
+
E,
|
|
71
|
+
N,
|
|
72
|
+
k
|
|
73
|
+
]), x === "segmented" ? /* @__PURE__ */ d(n, {
|
|
81
74
|
ref: e,
|
|
82
75
|
tag: "div",
|
|
83
|
-
className:
|
|
84
|
-
interactionTriggers:
|
|
85
|
-
children:
|
|
76
|
+
className: p("plitzi-component__theme-toggle plitzi-component__theme-toggle--segmented", b),
|
|
77
|
+
interactionTriggers: r.triggers,
|
|
78
|
+
children: L.map((e) => /* @__PURE__ */ f("button", {
|
|
86
79
|
type: "button",
|
|
87
|
-
className:
|
|
88
|
-
"data-active":
|
|
80
|
+
className: p("plitzi-component__theme-toggle-option", A.option),
|
|
81
|
+
"data-active": P && E === e.value ? "true" : void 0,
|
|
89
82
|
"data-theme-option": e.value,
|
|
90
|
-
onClick:
|
|
91
|
-
children: [e.icon, /* @__PURE__ */
|
|
83
|
+
onClick: F(e.value),
|
|
84
|
+
children: [e.icon, /* @__PURE__ */ d("span", { children: e.label })]
|
|
92
85
|
}, e.value))
|
|
93
|
-
}) : /* @__PURE__ */
|
|
86
|
+
}) : /* @__PURE__ */ f(n, {
|
|
94
87
|
ref: e,
|
|
95
88
|
tag: "button",
|
|
96
|
-
className:
|
|
97
|
-
interactionTriggers:
|
|
89
|
+
className: p("plitzi-component__theme-toggle plitzi-component__theme-toggle--switch", b),
|
|
90
|
+
interactionTriggers: r.triggers,
|
|
98
91
|
type: "button",
|
|
99
|
-
onClick:
|
|
100
|
-
"aria-label": `${
|
|
101
|
-
title: `${
|
|
102
|
-
children: [/* @__PURE__ */
|
|
103
|
-
className:
|
|
92
|
+
onClick: I,
|
|
93
|
+
"aria-label": `${S} / ${C}`,
|
|
94
|
+
title: `${S} / ${C}`,
|
|
95
|
+
children: [/* @__PURE__ */ d("span", {
|
|
96
|
+
className: p("plitzi-component__theme-toggle-icon", A.icon),
|
|
104
97
|
"data-theme-icon": "light",
|
|
105
|
-
children: /* @__PURE__ */
|
|
106
|
-
}), /* @__PURE__ */
|
|
107
|
-
className:
|
|
98
|
+
children: /* @__PURE__ */ d(v, {})
|
|
99
|
+
}), /* @__PURE__ */ d("span", {
|
|
100
|
+
className: p("plitzi-component__theme-toggle-icon", A.icon),
|
|
108
101
|
"data-theme-icon": "dark",
|
|
109
|
-
children: /* @__PURE__ */
|
|
102
|
+
children: /* @__PURE__ */ d(y, {})
|
|
110
103
|
})]
|
|
111
104
|
});
|
|
112
|
-
},
|
|
105
|
+
}, x = e(b);
|
|
113
106
|
//#endregion
|
|
114
|
-
export {
|
|
107
|
+
export { b as ThemeToggle, x as default };
|
|
@@ -4,6 +4,17 @@ import { AuthorableAttributes } from '@plitzi/sdk-shared/authoring/declare';
|
|
|
4
4
|
export type ThemeToggleAttributes = AuthorableAttributes<ThemeToggleProps>;
|
|
5
5
|
declare const declaration: {
|
|
6
6
|
readonly type: "themeToggle";
|
|
7
|
+
readonly triggers: {
|
|
8
|
+
readonly onThemeChange: {
|
|
9
|
+
readonly action: "onThemeChange";
|
|
10
|
+
readonly title: "On Theme Change";
|
|
11
|
+
readonly type: "trigger";
|
|
12
|
+
readonly params: {};
|
|
13
|
+
readonly preview: {
|
|
14
|
+
readonly theme: "dark";
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
};
|
|
7
18
|
readonly content: {
|
|
8
19
|
readonly attributes: {
|
|
9
20
|
readonly subType: "switch";
|
|
@@ -15,7 +26,7 @@ declare const declaration: {
|
|
|
15
26
|
readonly definition: {
|
|
16
27
|
readonly label: "Theme Toggle";
|
|
17
28
|
readonly type: "themeToggle";
|
|
18
|
-
readonly description: "Lets a visitor choose light or dark. It writes the choice on the document root, where a space stylesheet is already looking for it, and remembers it — so the machine decides until somebody says otherwise. It ships no colours of its own: style it with the space own classes
|
|
29
|
+
readonly description: "Lets a visitor choose light or dark. It writes the choice on the document root, where a space stylesheet is already looking for it, and remembers it — so the machine decides until somebody says otherwise. It ships no colours of its own: style it with the space own classes. It shows the icon of the scheme in use by default; key a rule off `data-theme-icon` to change that.";
|
|
19
30
|
readonly items: readonly [];
|
|
20
31
|
readonly bindings: {};
|
|
21
32
|
readonly styleSelectors: {
|
|
@@ -2,6 +2,13 @@ import { elementDeclaration as e } from "@plitzi/sdk-shared/authoring/declare";
|
|
|
2
2
|
//#region src/elements/basic/ThemeToggle/declaration.ts
|
|
3
3
|
var t = e()({
|
|
4
4
|
type: "themeToggle",
|
|
5
|
+
triggers: { onThemeChange: {
|
|
6
|
+
action: "onThemeChange",
|
|
7
|
+
title: "On Theme Change",
|
|
8
|
+
type: "trigger",
|
|
9
|
+
params: {},
|
|
10
|
+
preview: { theme: "dark" }
|
|
11
|
+
} },
|
|
5
12
|
content: {
|
|
6
13
|
attributes: {
|
|
7
14
|
subType: "switch",
|
|
@@ -13,7 +20,7 @@ var t = e()({
|
|
|
13
20
|
definition: {
|
|
14
21
|
label: "Theme Toggle",
|
|
15
22
|
type: "themeToggle",
|
|
16
|
-
description: "Lets a visitor choose light or dark. It writes the choice on the document root, where a space stylesheet is already looking for it, and remembers it — so the machine decides until somebody says otherwise. It ships no colours of its own: style it with the space own classes
|
|
23
|
+
description: "Lets a visitor choose light or dark. It writes the choice on the document root, where a space stylesheet is already looking for it, and remembers it — so the machine decides until somebody says otherwise. It ships no colours of its own: style it with the space own classes. It shows the icon of the scheme in use by default; key a rule off `data-theme-icon` to change that.",
|
|
17
24
|
items: [],
|
|
18
25
|
bindings: {},
|
|
19
26
|
styleSelectors: {
|
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
declare const ThemeToggle: {
|
|
2
|
-
(props: import('../../../Element/hocs/withElement').WithElementProps<import('./ThemeToggle').ThemeToggleProps>): import(
|
|
2
|
+
(props: import('../../../Element/hocs/withElement').WithElementProps<import('./ThemeToggle').ThemeToggleProps>): import('react').JSX.Element;
|
|
3
3
|
displayName: string;
|
|
4
4
|
} & {
|
|
5
5
|
readonly type: "themeToggle";
|
|
6
|
+
readonly triggers: {
|
|
7
|
+
readonly onThemeChange: {
|
|
8
|
+
readonly action: "onThemeChange";
|
|
9
|
+
readonly title: "On Theme Change";
|
|
10
|
+
readonly type: "trigger";
|
|
11
|
+
readonly params: {};
|
|
12
|
+
readonly preview: {
|
|
13
|
+
readonly theme: "dark";
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
};
|
|
6
17
|
readonly content: {
|
|
7
18
|
readonly attributes: {
|
|
8
19
|
readonly subType: "switch";
|
|
@@ -14,7 +25,7 @@ declare const ThemeToggle: {
|
|
|
14
25
|
readonly definition: {
|
|
15
26
|
readonly label: "Theme Toggle";
|
|
16
27
|
readonly type: "themeToggle";
|
|
17
|
-
readonly description: "Lets a visitor choose light or dark. It writes the choice on the document root, where a space stylesheet is already looking for it, and remembers it — so the machine decides until somebody says otherwise. It ships no colours of its own: style it with the space own classes
|
|
28
|
+
readonly description: "Lets a visitor choose light or dark. It writes the choice on the document root, where a space stylesheet is already looking for it, and remembers it — so the machine decides until somebody says otherwise. It ships no colours of its own: style it with the space own classes. It shows the icon of the scheme in use by default; key a rule off `data-theme-icon` to change that.";
|
|
18
29
|
readonly items: readonly [];
|
|
19
30
|
readonly bindings: {};
|
|
20
31
|
readonly styleSelectors: {
|