@plitzi/sdk-elements 0.32.5 → 0.32.7

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.
@@ -1,30 +1,32 @@
1
1
  import e from "../../../../../Element/ReplicaProvider.mjs";
2
2
  import { useId as t, useMemo as n } from "react";
3
3
  import { StoreProvider as r } from "@plitzi/nexus/react";
4
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
5
- import o from "clsx";
4
+ import { emptyObject as i } from "@plitzi/sdk-shared/helpers/utils";
5
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
6
+ import s from "clsx";
6
7
  //#region src/elements/structure/List/modes/ListControlled/ListControlledItem.tsx
7
- var s = ({ children: s, className: c = "", isTemplate: l = !1, itemCount: u = 0, record: d, source: f = "" }) => {
8
- let p = /* @__PURE__ */ i(e, { children: /* @__PURE__ */ i(r, {
8
+ var c = ({ children: c, className: l = "", isTemplate: u = !1, itemCount: d = 0, record: f, source: p = "" }) => {
9
+ let m = t(), h = n(() => p ? { runtime: { sources: { [p]: {
10
+ item: f,
11
+ index: `${d}`
12
+ } } } } : i, [
13
+ p,
14
+ f,
15
+ d
16
+ ]), g = /* @__PURE__ */ a(e, { children: /* @__PURE__ */ a(r, {
9
17
  inherit: "live",
10
- segment: t(),
11
- value: n(() => ({ runtime: { sources: { [f]: {
12
- item: d,
13
- index: `${u}`
14
- } } } }), [
15
- f,
16
- d,
17
- u
18
- ]),
19
- children: s
18
+ name: `Row:${p}`,
19
+ segment: m,
20
+ value: h,
21
+ children: c
20
22
  }) });
21
- return l ? /* @__PURE__ */ a("div", {
22
- className: o("plitzi-component__controlled-list-item", c),
23
- children: [/* @__PURE__ */ i("div", {
23
+ return u ? /* @__PURE__ */ o("div", {
24
+ className: s("plitzi-component__controlled-list-item", l),
25
+ children: [/* @__PURE__ */ a("div", {
24
26
  className: "controlled-list-item__counter",
25
- children: `List Item - ${u}`
26
- }), p]
27
- }) : p;
27
+ children: `List Item - ${d}`
28
+ }), g]
29
+ }) : g;
28
30
  };
29
31
  //#endregion
30
- export { s as default };
32
+ export { c as default };
@@ -4,49 +4,50 @@ import n from "../../../Element/hocs/withElement.mjs";
4
4
  import { use as r, useCallback as i, useEffect as a, useMemo as o, useState as s } from "react";
5
5
  import c from "@plitzi/sdk-shared/hooks/usePlitziServiceContext";
6
6
  import { StoreProvider as l } from "@plitzi/nexus/react";
7
- import { getPathsFromObeject as u } from "@plitzi/sdk-shared/helpers/utils";
8
- import { jsx as d, jsxs as f } from "react/jsx-runtime";
9
- import p from "clsx";
10
- import m from "@plitzi/sdk-shared/dataSource/hooks/useRegisterSource";
7
+ import { emptyObject as u, getPathsFromObeject as d } from "@plitzi/sdk-shared/helpers/utils";
8
+ import { jsx as f, jsxs as p } from "react/jsx-runtime";
9
+ import m from "clsx";
10
+ import h from "@plitzi/sdk-shared/dataSource/helpers/getSourceName";
11
+ import g from "@plitzi/sdk-shared/dataSource/hooks/useRegisterSource";
11
12
  //#region src/elements/structure/ModalContainer/ModalContainer.tsx
12
- var h = ({ ref: n, className: h = "", children: g, title: _ = "Modal Header", autoHideAfterClick: v = !0 }) => {
13
- let { id: y, definition: { styleSelectors: b, label: x = "Modal" }, elementState: S, setElementState: C } = e(), { contexts: { InteractionsContext: w } } = c(), { interactionsManager: T } = r(w), [E, D] = s({}), O = i((e) => {
13
+ var _ = ({ ref: n, className: _ = "", children: v, title: y = "Modal Header", autoHideAfterClick: b = !0 }) => {
14
+ let { id: x, idRef: S, definition: { styleSelectors: C, label: w = "Modal" }, elementState: T, setElementState: E } = e(), D = h("modalContainer", { idRef: S }), { contexts: { InteractionsContext: O } } = c(), { interactionsManager: k } = r(O), [A, j] = s({}), M = i((e) => {
14
15
  let { metadata: t } = e;
15
- if (t && typeof t == "object") D(t);
16
+ if (t && typeof t == "object") j(t);
16
17
  else if (typeof t == "string") try {
17
- D(JSON.parse(t));
18
+ j(JSON.parse(t));
18
19
  } catch {
19
- D({ content: t });
20
+ j({ content: t });
20
21
  }
21
- else D(typeof t == "boolean" || typeof t == "number" ? { content: t } : {});
22
- C((e) => ({
22
+ else j(typeof t == "boolean" || typeof t == "number" ? { content: t } : {});
23
+ E((e) => ({
23
24
  ...e,
24
25
  visibility: !0
25
26
  }));
26
- }, [C, D]), k = i(() => {
27
- T.interactionTrigger(y, "onModalClose", { metadata: E }), D({}), C((e) => ({
27
+ }, [E, j]), N = i(() => {
28
+ k.interactionTrigger(S, "onModalClose", { metadata: A }), j({}), E((e) => ({
28
29
  ...e,
29
30
  visibility: !1
30
31
  }));
31
32
  }, [
32
- T,
33
- C,
34
- D,
33
+ k,
35
34
  E,
36
- y
37
- ]), A = i(() => {
38
- v && (T.interactionTrigger(y, "onModalClose", { metadata: E }), D({}), C((e) => ({
35
+ j,
36
+ A,
37
+ S
38
+ ]), P = i(() => {
39
+ b && (k.interactionTrigger(S, "onModalClose", { metadata: A }), j({}), E((e) => ({
39
40
  ...e,
40
41
  visibility: !1
41
42
  })));
42
43
  }, [
43
- T,
44
- v,
45
- C,
46
- D,
44
+ k,
45
+ b,
47
46
  E,
48
- y
49
- ]), j = o(() => ({
47
+ j,
48
+ A,
49
+ S
50
+ ]), F = o(() => ({
50
51
  onModalOpen: {
51
52
  action: "onModalOpen",
52
53
  title: "On Modal Open",
@@ -64,12 +65,12 @@ var h = ({ ref: n, className: h = "", children: g, title: _ = "Modal Header", au
64
65
  preview: {},
65
66
  params: {}
66
67
  }
67
- }), []), M = o(() => ({
68
+ }), []), I = o(() => ({
68
69
  openModal: {
69
70
  action: "openModal",
70
- title: `Open ${x}`,
71
+ title: `Open ${w}`,
71
72
  type: "callback",
72
- callback: O,
73
+ callback: M,
73
74
  params: { metadata: {
74
75
  type: "text",
75
76
  defaultValue: ""
@@ -78,26 +79,26 @@ var h = ({ ref: n, className: h = "", children: g, title: _ = "Modal Header", au
78
79
  },
79
80
  closeModal: {
80
81
  action: "closeModal",
81
- title: `Close ${x}`,
82
+ title: `Close ${w}`,
82
83
  type: "callback",
83
- callback: k,
84
+ callback: N,
84
85
  params: {},
85
86
  preview: {}
86
87
  }
87
88
  }), [
88
- k,
89
- O,
90
- x
89
+ N,
90
+ M,
91
+ w
91
92
  ]);
92
93
  a(() => {
93
- S.visibility !== !1 && T.interactionTrigger(y, "onModalOpen", { metadata: E });
94
+ T.visibility !== !1 && k.interactionTrigger(S, "onModalOpen", { metadata: A });
94
95
  }, [
95
- y,
96
- T,
97
- E,
98
- S.visibility
96
+ S,
97
+ k,
98
+ A,
99
+ T.visibility
99
100
  ]);
100
- let N = i(() => u(E).reduce((e, t) => {
101
+ let L = i(() => d(A).reduce((e, t) => {
101
102
  let n = t.split(".");
102
103
  return n.length > 1 ? [...e, {
103
104
  path: t,
@@ -106,44 +107,45 @@ var h = ({ ref: n, className: h = "", children: g, title: _ = "Modal Header", au
106
107
  path: t,
107
108
  name: n[n.length - 1]
108
109
  }];
109
- }, []), [E]);
110
- m({
111
- id: y,
112
- source: `modalContainer_${y}`,
113
- name: x || `Modal - ${y}`,
114
- fields: N
110
+ }, []), [A]);
111
+ g({
112
+ id: x,
113
+ source: D,
114
+ name: w || `Modal - ${x}`,
115
+ fields: L
115
116
  });
116
- let P = o(() => ({ runtime: { sources: { [`modalContainer_${y}`]: E } } }), [y, E]);
117
- return /* @__PURE__ */ f(t, {
117
+ let R = o(() => D ? { runtime: { sources: { [D]: A } } } : u, [D, A]);
118
+ return /* @__PURE__ */ p(t, {
118
119
  ref: n,
119
- className: p("plitzi-component__modal-container", h),
120
- interactionTriggers: j,
121
- interactionCallbacks: M,
122
- children: [/* @__PURE__ */ d("div", {
123
- className: p("modal-container__background", b.backgroundContainer),
124
- onClick: A
125
- }), /* @__PURE__ */ f("div", {
126
- className: p("modal-container__root", b.rootContainer),
127
- children: [/* @__PURE__ */ f("div", {
128
- className: p("modal-container__header", b.headerContainer),
129
- children: [/* @__PURE__ */ d("div", {
130
- className: p("modal-container__header__title", b.headerTitle),
131
- children: _ || "Modal Header"
132
- }), /* @__PURE__ */ d("i", {
133
- className: p("fa-solid fa-xmark", b.headerCloseButton),
120
+ className: m("plitzi-component__modal-container", _),
121
+ interactionTriggers: F,
122
+ interactionCallbacks: I,
123
+ children: [/* @__PURE__ */ f("div", {
124
+ className: m("modal-container__background", C.backgroundContainer),
125
+ onClick: P
126
+ }), /* @__PURE__ */ p("div", {
127
+ className: m("modal-container__root", C.rootContainer),
128
+ children: [/* @__PURE__ */ p("div", {
129
+ className: m("modal-container__header", C.headerContainer),
130
+ children: [/* @__PURE__ */ f("div", {
131
+ className: m("modal-container__header__title", C.headerTitle),
132
+ children: y || "Modal Header"
133
+ }), /* @__PURE__ */ f("i", {
134
+ className: m("fa-solid fa-xmark", C.headerCloseButton),
134
135
  title: "Close",
135
- onClick: k
136
+ onClick: N
136
137
  })]
137
- }), /* @__PURE__ */ d("div", {
138
- className: p("modal-container__body", b.bodyContainer),
139
- children: /* @__PURE__ */ d(l, {
138
+ }), /* @__PURE__ */ f("div", {
139
+ className: m("modal-container__body", C.bodyContainer),
140
+ children: /* @__PURE__ */ f(l, {
140
141
  inherit: "live",
141
- value: P,
142
- children: g
142
+ name: `Modal:${x}`,
143
+ value: R,
144
+ children: v
143
145
  })
144
146
  })]
145
147
  })]
146
148
  });
147
- }, g = n(h);
149
+ }, v = n(_);
148
150
  //#endregion
149
- export { h as ModalContainer, g as default };
151
+ export { _ as ModalContainer, v as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plitzi/sdk-elements",
3
- "version": "0.32.5",
3
+ "version": "0.32.7",
4
4
  "license": "AGPL-3.0",
5
5
  "files": [
6
6
  "dist"
@@ -772,27 +772,27 @@
772
772
  "type": "module",
773
773
  "sideEffects": false,
774
774
  "dependencies": {
775
- "@plitzi/nexus": "0.32.5",
776
- "@plitzi/plitzi-ui": "^1.6.13",
777
- "@plitzi/sdk-auth": "0.32.5",
778
- "@plitzi/sdk-dev-tools": "0.32.5",
779
- "@plitzi/sdk-event-bridge": "0.32.5",
780
- "@plitzi/sdk-interactions": "0.32.5",
781
- "@plitzi/sdk-navigation": "0.32.5",
782
- "@plitzi/sdk-schema": "0.32.5",
783
- "@plitzi/sdk-shared": "0.32.5",
775
+ "@plitzi/nexus": "0.32.7",
776
+ "@plitzi/plitzi-ui": "^1.6.17",
777
+ "@plitzi/sdk-auth": "0.32.7",
778
+ "@plitzi/sdk-dev-tools": "0.32.7",
779
+ "@plitzi/sdk-event-bridge": "0.32.7",
780
+ "@plitzi/sdk-interactions": "0.32.7",
781
+ "@plitzi/sdk-navigation": "0.32.7",
782
+ "@plitzi/sdk-schema": "0.32.7",
783
+ "@plitzi/sdk-shared": "0.32.7",
784
784
  "clsx": "^2.1.1",
785
- "immer": "^11.1.11"
785
+ "immer": "^11.1.15"
786
786
  },
787
787
  "peerDependencies": {
788
788
  "react": "^19",
789
789
  "react-dom": "^19"
790
790
  },
791
791
  "devDependencies": {
792
- "eslint": "^9.39.4",
793
- "react": "^19.2.7",
792
+ "eslint": "^9.39.5",
793
+ "react": "^19.2.8",
794
794
  "typescript": "^6.0.3",
795
- "vite": "^8.1.4",
795
+ "vite": "^8.1.5",
796
796
  "vitest": "^4.1.10"
797
797
  }
798
798
  }