@plitzi/sdk-elements 0.38.16 → 0.38.18
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 +123 -0
- package/dist/Component/ComponentProvider.mjs +3 -3
- package/dist/Element/ElementContext.mjs +1 -1
- package/dist/Element/ElementParentContext.mjs +1 -1
- package/dist/Element/JsxManager.mjs +2 -2
- package/dist/Element/LayoutBody.mjs +1 -1
- package/dist/Element/PluginManager.mjs +2 -2
- package/dist/Element/PluginRemote.mjs +4 -4
- package/dist/Element/ReplicaProvider.mjs +1 -1
- package/dist/Element/RootElement.mjs +4 -4
- package/dist/Element/helpers/declaredAttributes.mjs +1 -1
- package/dist/Element/helpers/getInteractions.mjs +4 -5
- package/dist/Element/hocs/withElement.mjs +2 -2
- package/dist/Element/hooks/useEditableContent.mjs +2 -2
- package/dist/Element/hooks/useElementDataSource.mjs +1 -1
- package/dist/Element/hooks/useElementInternal.mjs +2 -2
- package/dist/Element/hooks/useElementVisible.mjs +1 -1
- package/dist/Element/hooks/useInternalClassName.mjs +1 -1
- package/dist/Element/hooks/useInternalItems.mjs +2 -2
- package/dist/Element/hooks/useIntervalTriggers.mjs +1 -1
- package/dist/Element/hooks/useKeyTriggers.mjs +1 -1
- package/dist/Element/hooks/useLayoutChain.d.ts +1 -1
- package/dist/Element/hooks/useLayoutChain.mjs +4 -4
- package/dist/Element/hooks/usePluginTrigger.mjs +2 -2
- package/dist/Element/hooks/useRootElementInteractions.mjs +26 -27
- package/dist/Element/hooks/useRscData.d.ts +1 -1
- package/dist/Element/hooks/useRscData.mjs +1 -2
- package/dist/Element/hooks/useScrollInteractions.mjs +20 -21
- package/dist/builder/index.d.ts +5 -0
- package/dist/builder/index.mjs +1 -0
- package/dist/canvas/useAnimationFrame.mjs +1 -1
- package/dist/components/ElementAdvancedEditor.mjs +30 -30
- package/dist/components/IconField/index.mjs +1 -2
- package/dist/components/IconPicker/index.mjs +1 -2
- package/dist/components/MarkdownDocument/components/CodeBlock/CodeBlock.mjs +13 -13
- package/dist/dataSource/GlobalSources.mjs +45 -45
- package/dist/dataSource/getSourcesByElementId.mjs +1 -1
- package/dist/dataSource/index.d.ts +3 -0
- package/dist/dataSource/index.mjs +6 -3
- package/dist/dataSource/pathFields.mjs +1 -1
- package/dist/dataSource/sourceStore.mjs +1 -1
- package/dist/dataSource/useRegisterSource.d.ts +9 -0
- package/dist/dataSource/useRegisterSource.mjs +40 -0
- package/dist/dataSource/useResolvedVariables.d.ts +12 -0
- package/dist/dataSource/useResolvedVariables.mjs +27 -0
- package/dist/elements/advanced/BlockHtml/BlockHtml.d.ts +1 -1
- package/dist/elements/advanced/BlockHtml/BlockHtml.mjs +1 -1
- package/dist/elements/advanced/BlockHtml/declaration.d.ts +2 -2
- package/dist/elements/advanced/BlockHtml/declaration.mjs +1 -1
- package/dist/elements/advanced/BlockHtml/index.d.ts +3 -3
- package/dist/elements/advanced/BlockJsx/BlockJsx.d.ts +1 -1
- package/dist/elements/advanced/BlockJsx/Settings.mjs +25 -29
- package/dist/elements/advanced/BlockJsx/declaration.d.ts +2 -2
- package/dist/elements/advanced/BlockJsx/declaration.mjs +1 -1
- package/dist/elements/advanced/BlockJsx/index.d.ts +3 -3
- package/dist/elements/advanced/Custom/Custom.d.ts +1 -1
- package/dist/elements/advanced/Custom/Custom.mjs +2 -2
- package/dist/elements/advanced/Custom/Settings.mjs +3 -6
- package/dist/elements/advanced/Custom/declaration.d.ts +2 -2
- package/dist/elements/advanced/Custom/declaration.mjs +1 -1
- package/dist/elements/advanced/Custom/index.d.ts +3 -3
- package/dist/elements/advanced/NodeHtml/NodeHtml.d.ts +1 -1
- package/dist/elements/advanced/NodeHtml/declaration.d.ts +2 -2
- package/dist/elements/advanced/NodeHtml/declaration.mjs +1 -1
- package/dist/elements/advanced/NodeHtml/index.d.ts +3 -3
- package/dist/elements/advanced/PlitziSdk/declaration.d.ts +1 -1
- package/dist/elements/advanced/PlitziSdk/declaration.mjs +1 -1
- package/dist/elements/advanced/Reference/Reference.d.ts +1 -1
- package/dist/elements/advanced/Reference/Reference.mjs +3 -3
- package/dist/elements/advanced/Reference/declaration.d.ts +2 -2
- package/dist/elements/advanced/Reference/declaration.mjs +1 -1
- package/dist/elements/advanced/Reference/index.d.ts +3 -3
- package/dist/elements/basic/Button/Button.d.ts +1 -1
- package/dist/elements/basic/Button/Button.mjs +1 -1
- package/dist/elements/basic/Button/declaration.d.ts +3 -3
- package/dist/elements/basic/Button/declaration.mjs +1 -1
- package/dist/elements/basic/Button/index.d.ts +4 -4
- package/dist/elements/basic/Dropdown/Dropdown.d.ts +1 -1
- package/dist/elements/basic/Dropdown/Dropdown.mjs +12 -12
- package/dist/elements/basic/Dropdown/DropdownPopup/DropdownPopup.d.ts +1 -1
- package/dist/elements/basic/Dropdown/DropdownPopup/declaration.d.ts +2 -2
- package/dist/elements/basic/Dropdown/DropdownPopup/declaration.mjs +1 -1
- package/dist/elements/basic/Dropdown/DropdownPopup/index.d.ts +3 -3
- package/dist/elements/basic/Dropdown/declaration.d.ts +2 -2
- package/dist/elements/basic/Dropdown/declaration.mjs +1 -1
- package/dist/elements/basic/Dropdown/index.d.ts +5 -5
- package/dist/elements/basic/Dropdown/useDropdown.mjs +1 -5
- package/dist/elements/basic/Dropdown/useDropdownTrigger.mjs +1 -7
- package/dist/elements/basic/Heading/Heading.d.ts +1 -1
- package/dist/elements/basic/Heading/declaration.d.ts +2 -2
- package/dist/elements/basic/Heading/declaration.mjs +1 -1
- package/dist/elements/basic/Heading/index.d.ts +3 -3
- package/dist/elements/basic/Link/Link.d.ts +1 -1
- package/dist/elements/basic/Link/Link.mjs +2 -2
- package/dist/elements/basic/Link/Settings.mjs +2 -2
- package/dist/elements/basic/Link/declaration.d.ts +3 -3
- package/dist/elements/basic/Link/declaration.mjs +1 -1
- package/dist/elements/basic/Link/index.d.ts +4 -4
- package/dist/elements/basic/Markdown/Markdown.d.ts +1 -1
- package/dist/elements/basic/Markdown/Markdown.mjs +8 -8
- package/dist/elements/basic/Markdown/declaration.d.ts +2 -2
- package/dist/elements/basic/Markdown/declaration.mjs +1 -1
- package/dist/elements/basic/Markdown/hooks/useMarkdownClassNames.mjs +1 -1
- package/dist/elements/basic/Markdown/index.d.ts +3 -3
- package/dist/elements/basic/Paragraph/Paragraph.d.ts +1 -1
- package/dist/elements/basic/Paragraph/declaration.d.ts +2 -2
- package/dist/elements/basic/Paragraph/declaration.mjs +1 -1
- package/dist/elements/basic/Paragraph/index.d.ts +3 -3
- package/dist/elements/basic/RichText/RichText.d.ts +1 -1
- package/dist/elements/basic/RichText/RichText.mjs +14 -14
- package/dist/elements/basic/RichText/declaration.d.ts +2 -2
- package/dist/elements/basic/RichText/declaration.mjs +1 -1
- package/dist/elements/basic/RichText/index.d.ts +3 -3
- package/dist/elements/basic/Text/Text.d.ts +1 -1
- package/dist/elements/basic/Text/declaration.d.ts +2 -2
- package/dist/elements/basic/Text/declaration.mjs +1 -1
- package/dist/elements/basic/Text/index.d.ts +3 -3
- package/dist/elements/basic/ThemeToggle/ThemeToggle.d.ts +1 -1
- package/dist/elements/basic/ThemeToggle/ThemeToggle.mjs +3 -3
- package/dist/elements/basic/ThemeToggle/declaration.d.ts +2 -2
- package/dist/elements/basic/ThemeToggle/declaration.mjs +1 -1
- package/dist/elements/basic/ThemeToggle/index.d.ts +3 -3
- package/dist/elements/declarations/index.d.ts +66 -52
- package/dist/elements/declarations/index.mjs +45 -42
- package/dist/elements/form/Form/Form.d.ts +1 -1
- package/dist/elements/form/Form/Form.mjs +37 -37
- package/dist/elements/form/Form/declaration.d.ts +2 -2
- package/dist/elements/form/Form/declaration.mjs +1 -1
- package/dist/elements/form/Form/index.d.ts +1 -1
- package/dist/elements/form/FormControl/FormControl.d.ts +1 -1
- package/dist/elements/form/FormControl/FormControl.mjs +2 -2
- package/dist/elements/form/FormControl/Settings.mjs +1 -5
- package/dist/elements/form/FormControl/declaration.d.ts +2 -2
- package/dist/elements/form/FormControl/declaration.mjs +1 -1
- package/dist/elements/form/FormControl/hocs/withFieldValue.mjs +12 -16
- package/dist/elements/form/FormControl/index.d.ts +1 -1
- package/dist/elements/internal/LayoutContainer/LayoutContainer.d.ts +1 -1
- package/dist/elements/internal/LayoutContainer/LayoutContainer.mjs +1 -1
- package/dist/elements/internal/LayoutContainer/declaration.d.ts +2 -2
- package/dist/elements/internal/LayoutContainer/declaration.mjs +1 -1
- package/dist/elements/internal/LayoutContainer/index.d.ts +3 -3
- package/dist/elements/internal/LayoutPicker/LayoutPicker.mjs +7 -7
- package/dist/elements/internal/Loading/Loading.d.ts +1 -1
- package/dist/elements/internal/Loading/declaration.d.ts +2 -2
- package/dist/elements/internal/Loading/declaration.mjs +1 -1
- package/dist/elements/internal/Loading/index.d.ts +3 -3
- package/dist/elements/internal/NotFound/NotFound.d.ts +1 -1
- package/dist/elements/internal/NotFound/NotFound.mjs +1 -1
- package/dist/elements/internal/NotFound/declaration.d.ts +2 -2
- package/dist/elements/internal/NotFound/declaration.mjs +1 -1
- package/dist/elements/internal/NotFound/index.d.ts +3 -3
- package/dist/elements/internal/Page/Page.d.ts +1 -1
- package/dist/elements/internal/Page/Page.mjs +2 -2
- package/dist/elements/internal/Page/PageHead.mjs +7 -7
- package/dist/elements/internal/Page/Settings.mjs +1 -1
- package/dist/elements/internal/Page/declaration.d.ts +2 -2
- package/dist/elements/internal/Page/declaration.mjs +1 -1
- package/dist/elements/internal/Page/index.d.ts +3 -3
- package/dist/elements/media/Embed/Embed.d.ts +1 -1
- package/dist/elements/media/Embed/Embed.mjs +1 -1
- package/dist/elements/media/Embed/declaration.d.ts +2 -2
- package/dist/elements/media/Embed/declaration.mjs +1 -1
- package/dist/elements/media/Embed/index.d.ts +3 -3
- package/dist/elements/media/FontAwesome/FontAwesome.d.ts +1 -1
- package/dist/elements/media/FontAwesome/declaration.d.ts +2 -2
- package/dist/elements/media/FontAwesome/declaration.mjs +1 -1
- package/dist/elements/media/FontAwesome/index.d.ts +3 -3
- package/dist/elements/media/Image/Image.d.ts +1 -1
- package/dist/elements/media/Image/Image.mjs +12 -12
- package/dist/elements/media/Image/declaration.d.ts +2 -2
- package/dist/elements/media/Image/declaration.mjs +1 -1
- package/dist/elements/media/Image/index.d.ts +3 -3
- package/dist/elements/media/Svg/Svg.d.ts +1 -1
- package/dist/elements/media/Svg/Svg.mjs +11 -11
- package/dist/elements/media/Svg/declaration.d.ts +2 -2
- package/dist/elements/media/Svg/declaration.mjs +1 -1
- package/dist/elements/media/Svg/index.d.ts +3 -3
- package/dist/elements/media/Video/Video.d.ts +1 -1
- package/dist/elements/media/Video/Video.mjs +1 -1
- package/dist/elements/media/Video/declaration.d.ts +2 -2
- package/dist/elements/media/Video/declaration.mjs +1 -1
- package/dist/elements/media/Video/index.d.ts +3 -3
- package/dist/elements/provider/ApiContainer/ApiContainer.d.ts +1 -1
- package/dist/elements/provider/ApiContainer/ApiContainer.mjs +40 -48
- package/dist/elements/provider/ApiContainer/Settings.mjs +6 -10
- package/dist/elements/provider/ApiContainer/declaration.d.ts +2 -2
- package/dist/elements/provider/ApiContainer/declaration.mjs +1 -1
- package/dist/elements/provider/ApiContainer/helpers/serverMock.mjs +1 -1
- package/dist/elements/provider/ApiContainer/hooks/useApi.mjs +5 -5
- package/dist/elements/provider/ApiContainer/hooks/useProviderPagination.mjs +3 -12
- package/dist/elements/provider/ApiContainer/index.d.ts +3 -3
- package/dist/elements/provider/Channel/Channel.d.ts +1 -1
- package/dist/elements/provider/Channel/Channel.mjs +24 -24
- package/dist/elements/provider/Channel/declaration.d.ts +2 -2
- package/dist/elements/provider/Channel/declaration.mjs +1 -1
- package/dist/elements/provider/Channel/index.d.ts +3 -3
- package/dist/elements/settings.mjs +84 -85
- package/dist/elements/structure/Carousel/Carousel.d.ts +1 -1
- package/dist/elements/structure/Carousel/Carousel.mjs +27 -39
- package/dist/elements/structure/Carousel/CarouselTrack/CarouselTrack.d.ts +1 -1
- package/dist/elements/structure/Carousel/CarouselTrack/components/CarouselSlide/index.mjs +1 -2
- package/dist/elements/structure/Carousel/CarouselTrack/components/MarqueeTrack/index.mjs +1 -2
- package/dist/elements/structure/Carousel/CarouselTrack/components/ScrollTrack/index.mjs +1 -2
- package/dist/elements/structure/Carousel/CarouselTrack/declaration.d.ts +2 -2
- package/dist/elements/structure/Carousel/CarouselTrack/declaration.mjs +1 -1
- package/dist/elements/structure/Carousel/CarouselTrack/index.d.ts +3 -3
- package/dist/elements/structure/Carousel/declaration.d.ts +2 -2
- package/dist/elements/structure/Carousel/declaration.mjs +1 -1
- package/dist/elements/structure/Carousel/index.d.ts +5 -5
- package/dist/elements/structure/Container/Container.d.ts +1 -1
- package/dist/elements/structure/Container/declaration.d.ts +2 -2
- package/dist/elements/structure/Container/declaration.mjs +1 -1
- package/dist/elements/structure/Container/index.d.ts +3 -3
- package/dist/elements/structure/DialogContainer/DialogContainer.d.ts +1 -1
- package/dist/elements/structure/DialogContainer/declaration.d.ts +2 -2
- package/dist/elements/structure/DialogContainer/declaration.mjs +1 -1
- package/dist/elements/structure/DialogContainer/index.d.ts +3 -3
- package/dist/elements/structure/List/List.d.ts +1 -1
- package/dist/elements/structure/List/ListItem/ListItem.d.ts +1 -1
- package/dist/elements/structure/List/ListItem/declaration.d.ts +2 -2
- package/dist/elements/structure/List/ListItem/declaration.mjs +1 -1
- package/dist/elements/structure/List/ListItem/index.d.ts +3 -3
- package/dist/elements/structure/List/declaration.d.ts +2 -2
- package/dist/elements/structure/List/declaration.mjs +1 -1
- package/dist/elements/structure/List/index.d.ts +5 -5
- package/dist/elements/structure/List/modes/ListControlled/ListControlled.mjs +23 -23
- package/dist/elements/structure/ModalContainer/ModalContainer.d.ts +1 -1
- package/dist/elements/structure/ModalContainer/declaration.d.ts +2 -2
- package/dist/elements/structure/ModalContainer/declaration.mjs +1 -1
- package/dist/elements/structure/ModalContainer/index.d.ts +3 -3
- package/dist/elements/structure/Overlay/metadataOf.mjs +1 -1
- package/dist/elements/structure/Overlay/useOverlay.mjs +19 -19
- package/dist/elements/structure/Pagination/Pagination.d.ts +1 -1
- package/dist/elements/structure/Pagination/Pagination.mjs +3 -3
- package/dist/elements/structure/Pagination/declaration.d.ts +2 -2
- package/dist/elements/structure/Pagination/declaration.mjs +1 -1
- package/dist/elements/structure/Pagination/index.d.ts +3 -3
- package/dist/elements/structure/TabContainer/TabContainer.d.ts +1 -1
- package/dist/elements/structure/TabContainer/TabContainerBody/TabContainerBody.d.ts +1 -1
- package/dist/elements/structure/TabContainer/TabContainerBody/declaration.d.ts +2 -2
- package/dist/elements/structure/TabContainer/TabContainerBody/declaration.mjs +1 -1
- package/dist/elements/structure/TabContainer/TabContainerBody/index.d.ts +3 -3
- package/dist/elements/structure/TabContainer/TabContainerHeader/TabContainerHeader.d.ts +1 -1
- package/dist/elements/structure/TabContainer/TabContainerHeader/declaration.d.ts +2 -2
- package/dist/elements/structure/TabContainer/TabContainerHeader/declaration.mjs +1 -1
- package/dist/elements/structure/TabContainer/TabContainerHeader/index.d.ts +3 -3
- package/dist/elements/structure/TabContainer/TabContainerItem/TabContainerItem.d.ts +1 -1
- package/dist/elements/structure/TabContainer/TabContainerItem/declaration.d.ts +2 -2
- package/dist/elements/structure/TabContainer/TabContainerItem/declaration.mjs +1 -1
- package/dist/elements/structure/TabContainer/TabContainerItem/index.d.ts +3 -3
- package/dist/elements/structure/TabContainer/declaration.d.ts +2 -2
- package/dist/elements/structure/TabContainer/declaration.mjs +1 -1
- package/dist/elements/structure/TabContainer/index.d.ts +11 -11
- package/dist/index.d.ts +133 -121
- package/dist/index.mjs +85 -76
- package/package.json +18 -1408
|
@@ -2,10 +2,10 @@ import e from "../../useSettingsUpdate.mjs";
|
|
|
2
2
|
import t from "./components/FiltersInput/index.mjs";
|
|
3
3
|
import { useCallback as n, useMemo as r, useState as i } from "react";
|
|
4
4
|
import { useBuilderStore as a, useCommonStore as o, useSdkStore as s } from "@plitzi/sdk-shared/store";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { emptyObject as ee } from "@plitzi/sdk-shared/helpers";
|
|
6
|
+
import { get as c } from "@plitzi/plitzi-ui/helpers";
|
|
7
7
|
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
8
|
-
import te from "@plitzi/sdk-shared/theme
|
|
8
|
+
import { useTheme as te } from "@plitzi/sdk-shared/theme";
|
|
9
9
|
import ne from "@plitzi/plitzi-ui/QueryBuilder";
|
|
10
10
|
import f from "@plitzi/plitzi-ui/CodeMirror";
|
|
11
11
|
import p from "@plitzi/plitzi-ui/Input";
|
|
@@ -13,18 +13,14 @@ import m from "@plitzi/plitzi-ui/Select";
|
|
|
13
13
|
import h from "@plitzi/plitzi-ui/KVInput";
|
|
14
14
|
import g from "@plitzi/plitzi-ui/Switch";
|
|
15
15
|
//#region src/elements/provider/ApiContainer/Settings.tsx
|
|
16
|
-
var _ = [], v = ({ query: v = "", method: y = "get", accessToken: b = "", headers: x =
|
|
16
|
+
var _ = [], v = ({ query: v = "", method: y = "get", accessToken: b = "", headers: x = ee, when: S, subType: C = "", mockData: re = "{}", credentials: ie = "same-origin", runtime: ae = "client", connector: w = "", action: T = "", endpoint: oe = "", resource: se = "", limit: ce = "10", singleRecord: E = !1, filters: D = _, pagination: O = "none", pageParam: k = "page", renderWhileLoading: A = !1, loadingSlot: j = "", cache: M = !1, staleTime: N = 30, gcTime: P = 300, refreshSeconds: F = 0, onUpdate: I }) => {
|
|
17
17
|
let { resolvedTheme: L } = te(), [R] = a("pageDefinitions"), [z] = a("connectors"), [B] = o("actions.catalog"), [V] = a("hasServerRendering"), [H, U] = i(!1), W = ae === "server", G = W ? T && !w ? "action" : "connector" : "client", [[K, q, J]] = s([
|
|
18
18
|
"navigation.routeParams",
|
|
19
19
|
"navigation.queryParams",
|
|
20
20
|
"navigation.currentPageId"
|
|
21
21
|
]), Y = e(I), le = n((e) => I?.("query", e), [I]), ue = n((e) => I?.("when", e), [I]), de = n((e) => I?.("subType", e), [I]), fe = n((e) => I?.("mockData", e), [I]), pe = n((e) => U(e.target.checked), []), me = n((e, t) => I?.("headers", t), [I]), he = n((e) => {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
I?.("runtime", "server", !0), I?.(e === "action" ? "connector" : "action", "");
|
|
27
|
-
}, [I]), ge = n((e) => I?.("singleRecord", e.target.checked), [I]), _e = n((e) => I?.("loadingSlot", e), [I]), ve = n((e) => I?.("renderWhileLoading", e.target.checked), [I]), ye = n((e) => I?.("cache", e.target.checked), [I]), be = n((e) => I?.("filters", e), [I]), X = r(() => Object.values(z), [z]), Z = r(() => X.find((e) => e.identifier === w)?.manifest, [X, w]), xe = r(() => Object.keys(Z?.operators ?? {}), [Z]), Q = r(() => Object.keys(Z?.endpoints.read ?? {}), [Z]), $ = r(() => [...ee(R, `${J}.attributes.slug`, "").matchAll(/:[a-z0-9_-]+/gim)].map((e) => e[0].slice(1)), [R, J]), Se = r(() => [
|
|
22
|
+
e === "client" ? I?.("runtime", "client", !0) : (I?.("runtime", "server", !0), I?.(e === "action" ? "connector" : "action", ""));
|
|
23
|
+
}, [I]), ge = n((e) => I?.("singleRecord", e.target.checked), [I]), _e = n((e) => I?.("loadingSlot", e), [I]), ve = n((e) => I?.("renderWhileLoading", e.target.checked), [I]), ye = n((e) => I?.("cache", e.target.checked), [I]), be = n((e) => I?.("filters", e), [I]), X = r(() => Object.values(z), [z]), Z = r(() => X.find((e) => e.identifier === w)?.manifest, [X, w]), xe = r(() => Object.keys(Z?.operators ?? {}), [Z]), Q = r(() => Object.keys(Z?.endpoints.read ?? {}), [Z]), $ = r(() => [...c(R, `${J}.attributes.slug`, "").matchAll(/:[a-z0-9_-]+/gim)].map((e) => e[0].slice(1)), [R, J]), Se = r(() => [
|
|
28
24
|
...Object.keys(K),
|
|
29
25
|
...Object.keys(q),
|
|
30
26
|
...$
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ApiContainerProps } from './ApiContainer';
|
|
2
|
-
import { AuthorableAttributes } from '@plitzi/sdk-shared/authoring
|
|
2
|
+
import { AuthorableAttributes } from '@plitzi/sdk-shared/authoring';
|
|
3
3
|
/** What this element can be authored with — its component's own props, minus what the runtime supplies. */
|
|
4
4
|
export type ApiContainerAttributes = AuthorableAttributes<ApiContainerProps>;
|
|
5
|
-
declare const declaration: import('@plitzi/sdk-shared/authoring
|
|
5
|
+
declare const declaration: import('@plitzi/sdk-shared/authoring').DeclaredElement<{
|
|
6
6
|
readonly type: "apiContainer";
|
|
7
7
|
readonly attributeValues: {
|
|
8
8
|
readonly subType: readonly string[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { elementDeclaration as e, valuesOf as t } from "@plitzi/sdk-shared/authoring
|
|
1
|
+
import { elementDeclaration as e, valuesOf as t } from "@plitzi/sdk-shared/authoring";
|
|
2
2
|
//#region src/elements/provider/ApiContainer/declaration.ts
|
|
3
3
|
var n = e()({
|
|
4
4
|
type: "apiContainer",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { useCallback as e, useId as t, useMemo as n } from "react";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { emptyObject as r } from "@plitzi/sdk-shared/helpers";
|
|
3
|
+
import { hasValidToken as i } from "@plitzi/sdk-shared/helpers/twigWrapper";
|
|
4
4
|
import { requestKey as a, useQuery as o } from "@plitzi/sdk-shared/queries";
|
|
5
5
|
import { authFailureFromResponse as s, reportAuthFailure as c } from "@plitzi/sdk-shared/auth";
|
|
6
6
|
//#region src/elements/provider/ApiContainer/hooks/useApi.ts
|
|
7
|
-
var l = 30, u = 300, d = (e) => !!e && e !== "{}" && e !==
|
|
7
|
+
var l = 30, u = 300, d = (e) => !!e && e !== "{}" && e !== r, f = (e) => {
|
|
8
8
|
if (typeof e != "string") return {
|
|
9
9
|
status: 200,
|
|
10
10
|
data: e
|
|
@@ -53,8 +53,8 @@ var l = 30, u = 300, d = (e) => !!e && e !== "{}" && e !== i, f = (e) => {
|
|
|
53
53
|
}, m = (e) => e.status < 400, h = (e, t) => {
|
|
54
54
|
let n = typeof e == "number" ? e : Number(e);
|
|
55
55
|
return (Number.isFinite(n) && n >= 0 ? n : t) * 1e3;
|
|
56
|
-
}, g = ({ url: s = "", method: c = "get", mock: l, customHeaders: u =
|
|
57
|
-
let S = d(l), C = t(), w = !S && (!s ||
|
|
56
|
+
}, g = ({ url: s = "", method: c = "get", mock: l, customHeaders: u = r, enabled: g = !0, credentials: _ = "same-origin", cache: v = !1, staleTime: y = 30, gcTime: b = 300, tags: x }) => {
|
|
57
|
+
let S = d(l), C = t(), w = !S && (!s || i(s)), T = n(() => {
|
|
58
58
|
if (S || w) return;
|
|
59
59
|
let e = a({
|
|
60
60
|
method: c,
|
|
@@ -7,13 +7,7 @@ var i = (e, t) => {
|
|
|
7
7
|
}, a = ({ elementId: a, mode: o, pageParam: s, records: c, page: l, refresh: u, navigate: d }) => {
|
|
8
8
|
let [f, p] = r(c), [m, h] = r(!1), g = n(0);
|
|
9
9
|
t(() => {
|
|
10
|
-
|
|
11
|
-
if (l <= 1) {
|
|
12
|
-
g.current = 1, p(c);
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
g.current !== l && (g.current = l, p((e) => [...e, ...c]));
|
|
16
|
-
}
|
|
10
|
+
o === "append" && (l <= 1 ? (g.current = 1, p(c)) : g.current !== l && (g.current = l, p((e) => [...e, ...c])));
|
|
17
11
|
}, [
|
|
18
12
|
o,
|
|
19
13
|
l,
|
|
@@ -21,11 +15,8 @@ var i = (e, t) => {
|
|
|
21
15
|
]);
|
|
22
16
|
let _ = e(async (e) => {
|
|
23
17
|
let t = Math.max(e, 1);
|
|
24
|
-
if (o === "url")
|
|
25
|
-
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
if (u) {
|
|
18
|
+
if (o === "url") d?.(i(s, t));
|
|
19
|
+
else if (u) {
|
|
29
20
|
h(!0);
|
|
30
21
|
try {
|
|
31
22
|
await u([a], { [s]: String(t) });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare const ApiContainer: {
|
|
2
|
-
(props: import('
|
|
2
|
+
(props: import('../../..').WithElementProps<import('./ApiContainer').ApiContainerProps>): import('react').JSX.Element;
|
|
3
3
|
displayName: string;
|
|
4
4
|
} & {
|
|
5
5
|
readonly type: "apiContainer";
|
|
@@ -139,8 +139,8 @@ declare const ApiContainer: {
|
|
|
139
139
|
};
|
|
140
140
|
};
|
|
141
141
|
} & {
|
|
142
|
-
content: import('@plitzi/sdk-shared/authoring
|
|
143
|
-
} & import('@plitzi/sdk-shared/authoring
|
|
142
|
+
content: import('@plitzi/sdk-shared/authoring').ElementContentDefaults;
|
|
143
|
+
} & import('@plitzi/sdk-shared/authoring').ElementAttributesBrand<Partial<{
|
|
144
144
|
when?: import('@plitzi/sdk-shared').RuleGroup | undefined;
|
|
145
145
|
action?: string | undefined;
|
|
146
146
|
cache?: boolean | undefined;
|
|
@@ -19,7 +19,7 @@ export type ChannelProps = {
|
|
|
19
19
|
};
|
|
20
20
|
declare const Channel: ({ ref, className, children, topic, grant, presence, keep, subType }: ChannelProps) => import('react').JSX.Element;
|
|
21
21
|
declare const _default: {
|
|
22
|
-
(props: import('
|
|
22
|
+
(props: import('../../..').WithElementProps<ChannelProps>): import('react').JSX.Element;
|
|
23
23
|
displayName: string;
|
|
24
24
|
};
|
|
25
25
|
export default _default;
|
|
@@ -2,18 +2,18 @@ import e from "./declaration.mjs";
|
|
|
2
2
|
import t from "../../../Element/hocs/withElement.mjs";
|
|
3
3
|
import n from "../../../Element/hooks/useElement.mjs";
|
|
4
4
|
import { RootElement as r } from "../../../Element/RootElement.mjs";
|
|
5
|
-
import i from "../../../dataSource/
|
|
6
|
-
import a from "../../../dataSource/
|
|
7
|
-
import o from "../../../
|
|
8
|
-
import
|
|
9
|
-
import d from "
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import m from "
|
|
13
|
-
import h from "
|
|
14
|
-
import g from "@plitzi/sdk-
|
|
15
|
-
import _ from "@plitzi/sdk-shared/dataSource/
|
|
16
|
-
import { isTrue as v } from "@plitzi/sdk-shared/dataSource/utility
|
|
5
|
+
import i from "../../../dataSource/useRegisterSource.mjs";
|
|
6
|
+
import a from "../../../dataSource/pathFields.mjs";
|
|
7
|
+
import o from "../../../dataSource/sourceStore.mjs";
|
|
8
|
+
import s from "../../../realtime/useChannel.mjs";
|
|
9
|
+
import { use as c, useCallback as l, useMemo as u, useState as d } from "react";
|
|
10
|
+
import { usePlitzi as f } from "@plitzi/sdk-shared/hooks";
|
|
11
|
+
import { StoreProvider as p } from "@plitzi/nexus/react";
|
|
12
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
13
|
+
import h from "clsx";
|
|
14
|
+
import { InteractionsContext as g } from "@plitzi/sdk-interactions";
|
|
15
|
+
import { getSourceName as _ } from "@plitzi/sdk-shared/dataSource/helpers";
|
|
16
|
+
import { isTrue as v } from "@plitzi/sdk-shared/dataSource/utility";
|
|
17
17
|
import { JOIN_TYPE as y, LEAVE_TYPE as b, PRESENCE_TYPE as x } from "@plitzi/sdk-shared/realtime";
|
|
18
18
|
//#region src/elements/provider/Channel/Channel.tsx
|
|
19
19
|
var S = (e) => {
|
|
@@ -28,27 +28,27 @@ var S = (e) => {
|
|
|
28
28
|
y,
|
|
29
29
|
b
|
|
30
30
|
]), w = ({ ref: t, className: y, children: b, topic: x = "", grant: w = "", presence: T, keep: E = 20, subType: D = "" }) => {
|
|
31
|
-
let { id: O, definition: { label: k = "Channel" } } = n(), { settings: { previewMode: A } } =
|
|
31
|
+
let { id: O, definition: { label: k = "Channel" } } = n(), { settings: { previewMode: A } } = f(), { interactionsManager: j } = c(g), M = Math.max(0, Number(E) || 0), [N, P] = d([]), F = l((e) => {
|
|
32
32
|
C.has(e.type) || (M > 0 && P((t) => [...t, e].slice(-M)), j.interactionTrigger(O, "onMessage", { ...e }));
|
|
33
33
|
}, [
|
|
34
34
|
O,
|
|
35
35
|
j,
|
|
36
36
|
M
|
|
37
|
-
]), I =
|
|
37
|
+
]), I = l(({ from: e, user: t, state: n }) => void j.interactionTrigger(O, "onJoin", {
|
|
38
38
|
from: e,
|
|
39
39
|
user: t ?? "",
|
|
40
40
|
state: n
|
|
41
|
-
}), [O, j]), L =
|
|
41
|
+
}), [O, j]), L = l(({ from: e, user: t, state: n }) => void j.interactionTrigger(O, "onLeave", {
|
|
42
42
|
from: e,
|
|
43
43
|
user: t ?? "",
|
|
44
44
|
state: n
|
|
45
|
-
}), [O, j]), R =
|
|
45
|
+
}), [O, j]), R = s(A && x ? x : void 0, {
|
|
46
46
|
grant: w || void 0,
|
|
47
47
|
presence: T === void 0 || T === "" ? void 0 : S(T),
|
|
48
48
|
onMessage: F,
|
|
49
49
|
onJoin: I,
|
|
50
50
|
onLeave: L
|
|
51
|
-
}), z =
|
|
51
|
+
}), z = u(() => ({
|
|
52
52
|
publish: {
|
|
53
53
|
...e.callbacks.publish,
|
|
54
54
|
callback: ({ type: e, data: t, echo: n }) => typeof e == "string" && e ? R.publish(e, S(t), { echo: v(n) }) : Promise.resolve(!1)
|
|
@@ -57,7 +57,7 @@ var S = (e) => {
|
|
|
57
57
|
...e.callbacks.setPresence,
|
|
58
58
|
callback: ({ data: e }) => R.setPresence(S(e))
|
|
59
59
|
}
|
|
60
|
-
}), [R]), B =
|
|
60
|
+
}), [R]), B = _(e.sourceType, O), V = u(() => ({
|
|
61
61
|
connected: R.connected,
|
|
62
62
|
me: R.me ?? "",
|
|
63
63
|
members: R.members,
|
|
@@ -70,21 +70,21 @@ var S = (e) => {
|
|
|
70
70
|
R.members,
|
|
71
71
|
R.retained,
|
|
72
72
|
N
|
|
73
|
-
]), H =
|
|
74
|
-
|
|
73
|
+
]), H = l(() => a(V), [V]);
|
|
74
|
+
i({
|
|
75
75
|
id: O,
|
|
76
76
|
source: B,
|
|
77
77
|
name: k || `Channel - ${O}`,
|
|
78
78
|
fields: H
|
|
79
79
|
});
|
|
80
|
-
let U =
|
|
81
|
-
return /* @__PURE__ */
|
|
80
|
+
let U = u(() => o(B, V), [V, B]);
|
|
81
|
+
return /* @__PURE__ */ m(r, {
|
|
82
82
|
ref: t,
|
|
83
83
|
tag: D,
|
|
84
|
-
className:
|
|
84
|
+
className: h("plitzi-component__channel", y),
|
|
85
85
|
interactionTriggers: e.triggers,
|
|
86
86
|
interactionCallbacks: z,
|
|
87
|
-
children: /* @__PURE__ */ p
|
|
87
|
+
children: /* @__PURE__ */ m(p, {
|
|
88
88
|
inherit: "live",
|
|
89
89
|
name: `Channel:${O}`,
|
|
90
90
|
value: U,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ChannelProps } from './Channel';
|
|
2
|
-
import { AuthorableAttributes } from '@plitzi/sdk-shared/authoring
|
|
2
|
+
import { AuthorableAttributes } from '@plitzi/sdk-shared/authoring';
|
|
3
3
|
/** What this element can be authored with — its component's own props, minus what the runtime supplies. */
|
|
4
4
|
export type ChannelAttributes = AuthorableAttributes<ChannelProps>;
|
|
5
|
-
declare const declaration: import('@plitzi/sdk-shared/authoring
|
|
5
|
+
declare const declaration: import('@plitzi/sdk-shared/authoring').DeclaredElement<{
|
|
6
6
|
readonly type: "channel";
|
|
7
7
|
readonly attributeValues: {
|
|
8
8
|
readonly subType: readonly string[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { elementDeclaration as e, valuesOf as t } from "@plitzi/sdk-shared/authoring
|
|
1
|
+
import { elementDeclaration as e, valuesOf as t } from "@plitzi/sdk-shared/authoring";
|
|
2
2
|
//#region src/elements/provider/Channel/declaration.ts
|
|
3
3
|
var n = e()({
|
|
4
4
|
type: "channel",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare const Channel: {
|
|
2
|
-
(props: import('
|
|
2
|
+
(props: import('../../..').WithElementProps<import('./Channel').ChannelProps>): import('react').JSX.Element;
|
|
3
3
|
displayName: string;
|
|
4
4
|
} & {
|
|
5
5
|
readonly type: "channel";
|
|
@@ -109,8 +109,8 @@ declare const Channel: {
|
|
|
109
109
|
};
|
|
110
110
|
};
|
|
111
111
|
} & {
|
|
112
|
-
content: import('@plitzi/sdk-shared/authoring
|
|
113
|
-
} & import('@plitzi/sdk-shared/authoring
|
|
112
|
+
content: import('@plitzi/sdk-shared/authoring').ElementContentDefaults;
|
|
113
|
+
} & import('@plitzi/sdk-shared/authoring').ElementAttributesBrand<Partial<{
|
|
114
114
|
subType?: "" | "div" | "section" | "aside" | "main" | undefined;
|
|
115
115
|
grant?: string | undefined;
|
|
116
116
|
presence?: unknown;
|
|
@@ -1,88 +1,87 @@
|
|
|
1
|
-
import
|
|
2
|
-
import t from "./advanced/
|
|
3
|
-
import n from "./advanced/
|
|
4
|
-
import r from "./advanced/
|
|
5
|
-
import i from "./advanced/
|
|
6
|
-
import a from "./advanced/
|
|
7
|
-
import o from "./
|
|
8
|
-
import s from "./basic/
|
|
9
|
-
import c from "./basic/Dropdown/
|
|
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 "./basic/
|
|
17
|
-
import g from "./
|
|
18
|
-
import _ from "./form/
|
|
19
|
-
import v from "./
|
|
20
|
-
import y from "./internal/
|
|
21
|
-
import b from "./internal/
|
|
22
|
-
import x from "./internal/
|
|
23
|
-
import S from "./
|
|
24
|
-
import C from "./media/
|
|
25
|
-
import w from "./media/
|
|
26
|
-
import T from "./media/
|
|
27
|
-
import E from "./media/
|
|
28
|
-
import D from "./
|
|
29
|
-
import O from "./provider/
|
|
30
|
-
import k from "./
|
|
31
|
-
import A from "./structure/Carousel/
|
|
32
|
-
import j from "./structure/
|
|
33
|
-
import M from "./structure/
|
|
34
|
-
import N from "./structure/
|
|
35
|
-
import P from "./structure/List/
|
|
36
|
-
import F from "./structure/
|
|
37
|
-
import I from "./structure/
|
|
38
|
-
import L from "./structure/
|
|
39
|
-
import R from "./structure/TabContainer/Settings.mjs";
|
|
40
|
-
import z from "./structure/TabContainer/
|
|
41
|
-
import B from "./structure/TabContainer/
|
|
42
|
-
import V from "./structure/TabContainer/TabContainerItem/Settings.mjs";
|
|
1
|
+
import e from "./advanced/BlockHtml/Settings.mjs";
|
|
2
|
+
import t from "./advanced/BlockJsx/Settings.mjs";
|
|
3
|
+
import n from "./advanced/Custom/Settings.mjs";
|
|
4
|
+
import r from "./advanced/NodeHtml/Settings.mjs";
|
|
5
|
+
import i from "./advanced/PlitziSdk/Settings.mjs";
|
|
6
|
+
import a from "./advanced/Reference/Settings.mjs";
|
|
7
|
+
import o from "./basic/Button/Settings.mjs";
|
|
8
|
+
import s from "./basic/Dropdown/DropdownPopup/Settings.mjs";
|
|
9
|
+
import c from "./basic/Dropdown/Settings.mjs";
|
|
10
|
+
import l from "./basic/Heading/Settings.mjs";
|
|
11
|
+
import u from "./basic/Link/Settings.mjs";
|
|
12
|
+
import d from "./basic/Markdown/Settings.mjs";
|
|
13
|
+
import f from "./basic/Paragraph/Settings.mjs";
|
|
14
|
+
import p from "./basic/RichText/Settings.mjs";
|
|
15
|
+
import m from "./basic/Text/Settings.mjs";
|
|
16
|
+
import h from "./basic/ThemeToggle/Settings.mjs";
|
|
17
|
+
import g from "./form/Form/Settings.mjs";
|
|
18
|
+
import _ from "./form/FormControl/Settings.mjs";
|
|
19
|
+
import v from "./internal/LayoutContainer/Settings.mjs";
|
|
20
|
+
import y from "./internal/Loading/Settings.mjs";
|
|
21
|
+
import b from "./internal/NotFound/Settings.mjs";
|
|
22
|
+
import x from "./internal/Page/Settings.mjs";
|
|
23
|
+
import S from "./media/Embed/Settings.mjs";
|
|
24
|
+
import C from "./media/FontAwesome/Settings.mjs";
|
|
25
|
+
import w from "./media/Image/Settings.mjs";
|
|
26
|
+
import T from "./media/Svg/Settings.mjs";
|
|
27
|
+
import E from "./media/Video/Settings.mjs";
|
|
28
|
+
import D from "./provider/ApiContainer/Settings.mjs";
|
|
29
|
+
import O from "./provider/Channel/Settings.mjs";
|
|
30
|
+
import k from "./structure/Carousel/CarouselTrack/Settings.mjs";
|
|
31
|
+
import A from "./structure/Carousel/Settings.mjs";
|
|
32
|
+
import j from "./structure/Container/Settings.mjs";
|
|
33
|
+
import M from "./structure/DialogContainer/Settings.mjs";
|
|
34
|
+
import N from "./structure/List/ListItem/Settings.mjs";
|
|
35
|
+
import P from "./structure/List/Settings.mjs";
|
|
36
|
+
import F from "./structure/ModalContainer/Settings.mjs";
|
|
37
|
+
import I from "./structure/Pagination/Settings.mjs";
|
|
38
|
+
import L from "./structure/TabContainer/Settings.mjs";
|
|
39
|
+
import R from "./structure/TabContainer/TabContainerBody/Settings.mjs";
|
|
40
|
+
import z from "./structure/TabContainer/TabContainerHeader/Settings.mjs";
|
|
41
|
+
import B from "./structure/TabContainer/TabContainerItem/Settings.mjs";
|
|
43
42
|
//#region src/elements/settings.ts
|
|
44
|
-
var
|
|
45
|
-
dropdown:
|
|
46
|
-
dropdownPopup:
|
|
47
|
-
plitziSdk:
|
|
48
|
-
custom:
|
|
49
|
-
reference:
|
|
50
|
-
blockHtml:
|
|
51
|
-
blockJsx:
|
|
52
|
-
page:
|
|
53
|
-
loading:
|
|
54
|
-
notFound:
|
|
55
|
-
container:
|
|
56
|
-
layoutContainer:
|
|
57
|
-
dialogContainer:
|
|
58
|
-
modalContainer:
|
|
59
|
-
carousel:
|
|
60
|
-
carouselTrack:
|
|
61
|
-
tabContainer:
|
|
62
|
-
tabContainerBody:
|
|
63
|
-
tabContainerHeader:
|
|
64
|
-
tabContainerItem:
|
|
65
|
-
heading:
|
|
66
|
-
image:
|
|
67
|
-
video:
|
|
68
|
-
embed:
|
|
69
|
-
svg:
|
|
70
|
-
fontAwesome:
|
|
71
|
-
button:
|
|
72
|
-
paragraph:
|
|
73
|
-
text:
|
|
74
|
-
themeToggle:
|
|
75
|
-
markdown:
|
|
76
|
-
richText:
|
|
77
|
-
pagination:
|
|
78
|
-
nodeHtml:
|
|
79
|
-
list:
|
|
80
|
-
listItem:
|
|
81
|
-
link:
|
|
82
|
-
form:
|
|
83
|
-
formControl:
|
|
84
|
-
apiContainer:
|
|
85
|
-
channel:
|
|
43
|
+
var V = {
|
|
44
|
+
dropdown: c,
|
|
45
|
+
dropdownPopup: s,
|
|
46
|
+
plitziSdk: i,
|
|
47
|
+
custom: n,
|
|
48
|
+
reference: a,
|
|
49
|
+
blockHtml: e,
|
|
50
|
+
blockJsx: t,
|
|
51
|
+
page: x,
|
|
52
|
+
loading: y,
|
|
53
|
+
notFound: b,
|
|
54
|
+
container: j,
|
|
55
|
+
layoutContainer: v,
|
|
56
|
+
dialogContainer: M,
|
|
57
|
+
modalContainer: F,
|
|
58
|
+
carousel: A,
|
|
59
|
+
carouselTrack: k,
|
|
60
|
+
tabContainer: L,
|
|
61
|
+
tabContainerBody: R,
|
|
62
|
+
tabContainerHeader: z,
|
|
63
|
+
tabContainerItem: B,
|
|
64
|
+
heading: l,
|
|
65
|
+
image: w,
|
|
66
|
+
video: E,
|
|
67
|
+
embed: S,
|
|
68
|
+
svg: T,
|
|
69
|
+
fontAwesome: C,
|
|
70
|
+
button: o,
|
|
71
|
+
paragraph: f,
|
|
72
|
+
text: m,
|
|
73
|
+
themeToggle: h,
|
|
74
|
+
markdown: d,
|
|
75
|
+
richText: p,
|
|
76
|
+
pagination: I,
|
|
77
|
+
nodeHtml: r,
|
|
78
|
+
list: P,
|
|
79
|
+
listItem: N,
|
|
80
|
+
link: u,
|
|
81
|
+
form: g,
|
|
82
|
+
formControl: _,
|
|
83
|
+
apiContainer: D,
|
|
84
|
+
channel: O
|
|
86
85
|
};
|
|
87
86
|
//#endregion
|
|
88
|
-
export {
|
|
87
|
+
export { V as defaultElementsSettings };
|
|
@@ -25,7 +25,7 @@ export type CarouselProps = {
|
|
|
25
25
|
};
|
|
26
26
|
declare const Carousel: ({ ref, className, children, items, mode, autoplay, pauseOnHover, loop, transition, speed, itemKey, label }: CarouselProps) => import('react').JSX.Element;
|
|
27
27
|
declare const _default: {
|
|
28
|
-
(props: import('
|
|
28
|
+
(props: import('../../..').WithElementProps<CarouselProps>): import('react').JSX.Element;
|
|
29
29
|
displayName: string;
|
|
30
30
|
};
|
|
31
31
|
export default _default;
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import e from "./declaration.mjs";
|
|
2
2
|
import t from "../../../Element/hocs/withElement.mjs";
|
|
3
3
|
import n from "../../../Element/hooks/useElement.mjs";
|
|
4
|
-
import { RootElement as
|
|
4
|
+
import { RootElement as ee } from "../../../Element/RootElement.mjs";
|
|
5
|
+
import r from "../../../dataSource/useRegisterSource.mjs";
|
|
5
6
|
import i from "../../../dataSource/pathFields.mjs";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { clampIndex as o, directionOf as s, slideStep as
|
|
9
|
-
import
|
|
7
|
+
import te from "../../../dataSource/sourceStore.mjs";
|
|
8
|
+
import a from "./CarouselContext.mjs";
|
|
9
|
+
import { clampIndex as o, directionOf as s, slideStep as ne, stepIndex as c } from "./carouselIndex.mjs";
|
|
10
|
+
import re from "./useAutoplay.mjs";
|
|
10
11
|
import { rowKeys as l } from "../List/modes/ListControlled/rowKeys.mjs";
|
|
11
|
-
import { use as u, useCallback as d, useEffect as
|
|
12
|
-
import
|
|
13
|
-
import { StoreProvider as
|
|
12
|
+
import { use as u, useCallback as d, useEffect as f, useMemo as p, useRef as m, useState as h } from "react";
|
|
13
|
+
import { usePlitzi as ie } from "@plitzi/sdk-shared/hooks";
|
|
14
|
+
import { StoreProvider as ae } from "@plitzi/nexus/react";
|
|
14
15
|
import { jsx as g } from "react/jsx-runtime";
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import ce from "@plitzi/sdk-shared/dataSource/hooks/useRegisterSource";
|
|
16
|
+
import oe from "clsx";
|
|
17
|
+
import { InteractionsContext as se } from "@plitzi/sdk-interactions";
|
|
18
|
+
import { getSourceName as ce } from "@plitzi/sdk-shared/dataSource/helpers";
|
|
19
19
|
//#region src/elements/structure/Carousel/Carousel.tsx
|
|
20
20
|
var _ = ({ ref: t, className: _ = "", children: v, items: y = [], mode: b = "slide", autoplay: x = 0, pauseOnHover: S = !0, loop: C = !0, transition: w = "slide", speed: T = 30, itemKey: E, label: D = "" }) => {
|
|
21
|
-
let { id: O, definition: { label: k = "Carousel" } } = n(), A =
|
|
22
|
-
|
|
21
|
+
let { id: O, definition: { label: k = "Carousel" } } = n(), A = ce(e.sourceType, O), { settings: { previewMode: le } } = ie(), { interactionsManager: j } = u(se), M = p(() => Array.isArray(y) ? y : [], [y]), N = p(() => l(M, E), [M, E]), P = M.length, F = !!le, [I, L] = h(0), [R, z] = h("next"), [B, V] = h(!1), [H, U] = h(x > 0), ue = m(null), W = t ?? ue, G = m(null), K = o(I, P);
|
|
22
|
+
f(() => {
|
|
23
23
|
I !== K && L(K);
|
|
24
24
|
}, [I, K]);
|
|
25
25
|
let q = d((e, t) => {
|
|
@@ -34,17 +34,13 @@ var _ = ({ ref: t, className: _ = "", children: v, items: y = [], mode: b = "sli
|
|
|
34
34
|
j,
|
|
35
35
|
M
|
|
36
36
|
]), J = d((e) => {
|
|
37
|
-
let t = G.current, n = t ?
|
|
37
|
+
let t = G.current, n = t ? ne(t) : 0;
|
|
38
38
|
t && n > 0 && t.scrollBy({
|
|
39
39
|
left: e * n,
|
|
40
40
|
behavior: "smooth"
|
|
41
41
|
});
|
|
42
42
|
}, []), Y = d(() => {
|
|
43
|
-
|
|
44
|
-
J(1);
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
q(c(K, P, 1, C), "next");
|
|
43
|
+
b === "scroll" ? J(1) : q(c(K, P, 1, C), "next");
|
|
48
44
|
}, [
|
|
49
45
|
P,
|
|
50
46
|
K,
|
|
@@ -53,11 +49,7 @@ var _ = ({ ref: t, className: _ = "", children: v, items: y = [], mode: b = "sli
|
|
|
53
49
|
q,
|
|
54
50
|
J
|
|
55
51
|
]), X = d(() => {
|
|
56
|
-
|
|
57
|
-
J(-1);
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
q(c(K, P, -1, C), "previous");
|
|
52
|
+
b === "scroll" ? J(-1) : q(c(K, P, -1, C), "previous");
|
|
61
53
|
}, [
|
|
62
54
|
P,
|
|
63
55
|
K,
|
|
@@ -67,11 +59,7 @@ var _ = ({ ref: t, className: _ = "", children: v, items: y = [], mode: b = "sli
|
|
|
67
59
|
J
|
|
68
60
|
]), Z = d((e) => {
|
|
69
61
|
let t = o(e.index, P);
|
|
70
|
-
|
|
71
|
-
J(t - K);
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
q(t, s(K, t));
|
|
62
|
+
b === "scroll" ? J(t - K) : q(t, s(K, t));
|
|
75
63
|
}, [
|
|
76
64
|
P,
|
|
77
65
|
K,
|
|
@@ -81,7 +69,7 @@ var _ = ({ ref: t, className: _ = "", children: v, items: y = [], mode: b = "sli
|
|
|
81
69
|
]), Q = d((e) => {
|
|
82
70
|
e !== K && q(e, s(K, e));
|
|
83
71
|
}, [K, q]);
|
|
84
|
-
|
|
72
|
+
re({
|
|
85
73
|
delay: b === "slide" ? x : 0,
|
|
86
74
|
active: F && H && P > 1,
|
|
87
75
|
rootRef: W,
|
|
@@ -89,7 +77,7 @@ var _ = ({ ref: t, className: _ = "", children: v, items: y = [], mode: b = "sli
|
|
|
89
77
|
position: K,
|
|
90
78
|
onTick: Y
|
|
91
79
|
});
|
|
92
|
-
let de =
|
|
80
|
+
let de = p(() => ({
|
|
93
81
|
next: {
|
|
94
82
|
...e.callbacks.next,
|
|
95
83
|
callback: Y
|
|
@@ -114,7 +102,7 @@ var _ = ({ ref: t, className: _ = "", children: v, items: y = [], mode: b = "sli
|
|
|
114
102
|
Z,
|
|
115
103
|
Y,
|
|
116
104
|
X
|
|
117
|
-
]), $ =
|
|
105
|
+
]), $ = p(() => ({
|
|
118
106
|
items: M,
|
|
119
107
|
count: P,
|
|
120
108
|
index: K,
|
|
@@ -127,13 +115,13 @@ var _ = ({ ref: t, className: _ = "", children: v, items: y = [], mode: b = "sli
|
|
|
127
115
|
M,
|
|
128
116
|
H
|
|
129
117
|
]), fe = d(() => i($), [$]);
|
|
130
|
-
|
|
118
|
+
r({
|
|
131
119
|
id: O,
|
|
132
120
|
source: A,
|
|
133
121
|
name: k || `Carousel - ${O}`,
|
|
134
122
|
fields: fe
|
|
135
123
|
});
|
|
136
|
-
let pe =
|
|
124
|
+
let pe = p(() => te(A, $), [A, $]), me = p(() => ({
|
|
137
125
|
source: A,
|
|
138
126
|
items: M,
|
|
139
127
|
keys: N,
|
|
@@ -161,19 +149,19 @@ var _ = ({ ref: t, className: _ = "", children: v, items: y = [], mode: b = "sli
|
|
|
161
149
|
T,
|
|
162
150
|
w
|
|
163
151
|
]);
|
|
164
|
-
return /* @__PURE__ */ g(
|
|
152
|
+
return /* @__PURE__ */ g(ee, {
|
|
165
153
|
ref: W,
|
|
166
|
-
className:
|
|
154
|
+
className: oe("plitzi-component__carousel", `carousel--${b}`, _),
|
|
167
155
|
role: "region",
|
|
168
156
|
"aria-roledescription": "carousel",
|
|
169
157
|
"aria-label": D || void 0,
|
|
170
158
|
interactionTriggers: e.triggers,
|
|
171
159
|
interactionCallbacks: de,
|
|
172
|
-
children: /* @__PURE__ */ g(
|
|
160
|
+
children: /* @__PURE__ */ g(ae, {
|
|
173
161
|
inherit: "live",
|
|
174
162
|
name: `Carousel:${O}`,
|
|
175
163
|
value: pe,
|
|
176
|
-
children: /* @__PURE__ */ g(
|
|
164
|
+
children: /* @__PURE__ */ g(a, {
|
|
177
165
|
value: me,
|
|
178
166
|
children: v
|
|
179
167
|
})
|