@plitzi/sdk-elements 0.36.1 → 0.37.0

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.
Files changed (53) hide show
  1. package/CHANGELOG.md +80 -0
  2. package/dist/Element/ElementParentContext.d.ts +13 -0
  3. package/dist/Element/ElementParentContext.mjs +6 -0
  4. package/dist/Element/LayoutBody.d.ts +21 -0
  5. package/dist/Element/LayoutBody.mjs +24 -0
  6. package/dist/Element/hocs/withElement.mjs +104 -87
  7. package/dist/Element/hooks/useElementDataSource.mjs +1 -1
  8. package/dist/Element/hooks/useElementInternal.mjs +24 -24
  9. package/dist/Element/hooks/useInternalItems.mjs +42 -39
  10. package/dist/Element/hooks/useLayoutChain.d.ts +10 -0
  11. package/dist/Element/hooks/useLayoutChain.mjs +20 -0
  12. package/dist/Element/hooks/useRootElementInteractions.mjs +45 -44
  13. package/dist/dataSource/GlobalSources.mjs +60 -59
  14. package/dist/dataSource/pathFields.d.ts +7 -0
  15. package/dist/dataSource/pathFields.mjs +8 -0
  16. package/dist/elements/advanced/Custom/declaration.d.ts +7 -9
  17. package/dist/elements/advanced/Custom/index.d.ts +1 -7
  18. package/dist/elements/advanced/Reference/Reference.mjs +93 -89
  19. package/dist/elements/advanced/Reference/declaration.d.ts +1 -1
  20. package/dist/elements/advanced/Reference/index.d.ts +1 -1
  21. package/dist/elements/basic/Button/Button.d.ts +9 -1
  22. package/dist/elements/basic/Button/Button.mjs +19 -20
  23. package/dist/elements/basic/Button/Settings.d.ts +2 -1
  24. package/dist/elements/basic/Button/Settings.mjs +13 -6
  25. package/dist/elements/basic/Button/declaration.d.ts +1 -0
  26. package/dist/elements/basic/Button/index.d.ts +1 -0
  27. package/dist/elements/declarations/index.d.ts +6 -9
  28. package/dist/elements/form/FormControl/declaration.d.ts +2 -0
  29. package/dist/elements/internal/LayoutContainer/LayoutContainer.d.ts +6 -0
  30. package/dist/elements/internal/LayoutContainer/LayoutContainer.mjs +31 -23
  31. package/dist/elements/internal/LayoutContainer/Settings.d.ts +4 -1
  32. package/dist/elements/internal/LayoutContainer/Settings.mjs +78 -64
  33. package/dist/elements/internal/LayoutContainer/declaration.d.ts +2 -0
  34. package/dist/elements/internal/LayoutContainer/index.d.ts +2 -0
  35. package/dist/elements/internal/LayoutPicker/LayoutPicker.d.ts +10 -0
  36. package/dist/elements/internal/LayoutPicker/LayoutPicker.mjs +35 -0
  37. package/dist/elements/internal/LayoutPicker/index.d.ts +3 -0
  38. package/dist/elements/internal/LayoutPicker/index.mjs +5 -0
  39. package/dist/elements/internal/Page/Page.mjs +49 -48
  40. package/dist/elements/internal/Page/Settings.mjs +101 -119
  41. package/dist/elements/provider/ApiContainer/ApiContainer.mjs +58 -66
  42. package/dist/elements/provider/ApiContainer/declaration.mjs +1 -1
  43. package/dist/elements/provider/ApiContainer/hooks/useApi.d.ts +8 -0
  44. package/dist/elements/provider/ApiContainer/hooks/useApi.mjs +52 -48
  45. package/dist/elements/structure/Container/Container.d.ts +1 -1
  46. package/dist/elements/structure/Container/Settings.d.ts +1 -1
  47. package/dist/elements/structure/Container/Settings.mjs +4 -0
  48. package/dist/elements/structure/Container/declaration.d.ts +1 -1
  49. package/dist/elements/structure/Container/index.d.ts +1 -1
  50. package/dist/elements/structure/DialogContainer/DialogContainer.mjs +17 -25
  51. package/dist/elements/structure/ModalContainer/ModalContainer.mjs +15 -23
  52. package/dist/index.d.ts +6 -9
  53. package/package.json +38 -10
@@ -1,71 +1,72 @@
1
1
  import e from "./useElementInteractions.mjs";
2
2
  import t from "./useInternalClassName.mjs";
3
3
  import { interactionBasicTriggers as n, nativeEventsList as r } from "../helpers/elementConstants.mjs";
4
- import { use as i, useCallback as a, useEffect as o, useMemo as s, useRef as c } from "react";
5
- import { useCommonStore as l } from "@plitzi/sdk-shared/store";
6
- import { get as u } from "@plitzi/plitzi-ui/helpers";
4
+ import { use as i, useCallback as a, useContext as o, useEffect as s, useMemo as c } from "react";
5
+ import { get as l } from "@plitzi/plitzi-ui/helpers";
6
+ import { StoreContext as u } from "@plitzi/nexus/react";
7
7
  import { emptyObject as d } from "@plitzi/sdk-shared/helpers/utils";
8
8
  import f from "clsx";
9
9
  import { pConsole as p } from "@plitzi/sdk-shared/devTools/utils/PlitziConsole";
10
10
  //#region src/Element/hooks/useRootElementInteractions.ts
11
- var m = ({ elementContext: m, InteractionsContext: h, previewMode: g, debugMode: _, baseElementId: v, className: y, interactionTriggers: b, interactionCallbacks: x, otherProps: S }) => {
12
- let { id: C, className: w, attributes: T, definition: E, definition: { interactions: D }, plitziElementLayout: O, elementState: k, setElementState: A } = m, { interactionsManager: j, useInteractions: M } = i(h), N = a((e, t, n, r, i = !1) => {
13
- i || e.preventDefault(), r && r(e), j.interactionTrigger(t, n, { event: e });
14
- }, [j]), P = s(() => !g || !D ? {} : Object.values(D).filter((e) => e.type === "trigger" && e.action && r.includes(e.action) && e.enabled).reduce((e, t) => {
15
- let n = u(t, "params.propagateEvent", !1);
11
+ var m = (e) => typeof e == "object" && !!e, h = ({ elementContext: h, InteractionsContext: g, previewMode: _, debugMode: v, baseElementId: y, className: b, interactionTriggers: x, interactionCallbacks: S, otherProps: C }) => {
12
+ let { id: w, className: T, attributes: E, definition: D, definition: { interactions: O }, plitziElementLayout: k, elementState: A, setElementState: j } = h, { interactionsManager: M, useInteractions: N } = i(g), P = a((e, t, n, r, i = !1) => {
13
+ i || e.preventDefault(), r && r(e), M.interactionTrigger(t, n, { event: e });
14
+ }, [M]), F = c(() => !_ || !O ? {} : Object.values(O).filter((e) => e.type === "trigger" && e.action && r.includes(e.action) && e.enabled).reduce((e, t) => {
15
+ let n = l(t, "params.propagateEvent", !1);
16
16
  return {
17
17
  ...e,
18
- [t.action]: (e) => N(e, C, t.action, S[t.action], n)
18
+ [t.action]: (e) => P(e, w, t.action, C[t.action], n)
19
19
  };
20
20
  }, {}), [
21
+ w,
22
+ O,
21
23
  C,
22
- D,
23
- S,
24
- g,
25
- N
26
- ]), F = _ || !!(D && Object.keys(D).length), [I = d] = l("runtime.sources", { enabled: F }), L = c({});
27
- L.current = I;
28
- let R = a(() => ({ dataSource: L.current }), [L]), z = s(() => ({
24
+ _,
25
+ P
26
+ ]), I = o(u), L = a(() => {
27
+ let e = I?.getPath("runtime.sources");
28
+ return m(e) ? e : d;
29
+ }, [I]), R = a(() => ({ dataSource: L() }), [L]), z = c(() => ({
29
30
  ...n,
30
- ...b
31
- }), [b]), B = e({
32
- attributes: T,
33
- definition: E,
34
- setElementState: A
31
+ ...x
32
+ }), [x]), B = e({
33
+ attributes: E,
34
+ definition: D,
35
+ setElementState: j
35
36
  });
36
- M({
37
- id: C,
38
- interactions: D,
37
+ N({
38
+ id: w,
39
+ interactions: O,
39
40
  triggers: z,
40
- callbacks: s(() => ({
41
- ...x,
41
+ callbacks: c(() => ({
42
+ ...S,
42
43
  ...B
43
- }), [x, B]),
44
+ }), [S, B]),
44
45
  getAdditionalParams: R
45
- }), o(() => {
46
- g && D && Object.keys(D).length && j.interactionTrigger(C, "onLoad", {});
47
- }, []), o(() => {
48
- if (_) return p.addProviderMethod(`getElementDataSource-${C}`, () => L.current), () => {
49
- p.removeProviderMethod(`getElementDataSource-${C}`);
46
+ }), s(() => {
47
+ _ && O && Object.keys(O).length && M.interactionTrigger(w, "onLoad", {});
48
+ }, []), s(() => {
49
+ if (v) return p.addProviderMethod(`getElementDataSource-${w}`, L), () => {
50
+ p.removeProviderMethod(`getElementDataSource-${w}`);
50
51
  };
51
52
  }, [
52
- _,
53
+ v,
53
54
  L,
54
- C
55
+ w
55
56
  ]);
56
57
  let V = t({
57
- id: C,
58
- className: y,
59
- previewMode: g,
60
- baseElementId: v,
61
- definition: E,
62
- elementState: k,
63
- plitziElementLayout: O
58
+ id: w,
59
+ className: b,
60
+ previewMode: _,
61
+ baseElementId: y,
62
+ definition: D,
63
+ elementState: A,
64
+ plitziElementLayout: k
64
65
  });
65
66
  return {
66
- className: f(w, V),
67
- events: P
67
+ className: f(T, V),
68
+ events: F
68
69
  };
69
70
  };
70
71
  //#endregion
71
- export { m as default };
72
+ export { h as default };
@@ -6,64 +6,65 @@ import c, { SPACE_THEME_AREA as l } from "@plitzi/sdk-shared/theme/useTheme";
6
6
  import u from "@plitzi/sdk-shared/dataSource/hooks/useRegisterSource";
7
7
  import d from "@plitzi/sdk-auth/AuthContext";
8
8
  import { resolveVariables as f } from "@plitzi/sdk-shared/dataSource";
9
+ import p from "@plitzi/sdk-shared/hooks/useStableValue";
9
10
  //#region src/dataSource/GlobalSources.tsx
10
- var p = ({ children: p }) => {
11
- let { environment: m } = a(), [[h, g, _, v, y, b]] = r([
11
+ var m = ({ children: m }) => {
12
+ let { environment: h } = a(), [[g, _, v, y, b, x]] = r([
12
13
  "schema.variables",
13
14
  "navigation.routeParams",
14
15
  "navigation.queryParams",
15
16
  "navigation.hostname",
16
17
  "navigation.origin",
17
18
  "navigation.currentPageId"
18
- ]), x = n(() => f(h, {
19
- routeParams: g,
20
- queryParams: _,
21
- hostname: v,
22
- environment: m
19
+ ]), S = p(n(() => f(g, {
20
+ routeParams: _,
21
+ queryParams: v,
22
+ hostname: y,
23
+ environment: h
23
24
  }), [
24
- m,
25
+ h,
26
+ y,
25
27
  v,
26
28
  _,
27
- g,
28
- h
29
- ]), S = t(() => s(x).map((e) => ({
29
+ g
30
+ ])), C = t(() => s(S).map((e) => ({
30
31
  path: e,
31
32
  name: `variables.${e}`
32
- })), [x]);
33
+ })), [S]);
33
34
  u({
34
35
  id: "global",
35
36
  source: "variables",
36
37
  name: "Variables",
37
- fields: S
38
- }), i("runtime.sources.variables", x);
39
- let [C = {}] = r("pageDefinitions"), w = n(() => Object.values(C).map((e) => ({
38
+ fields: C
39
+ }), i("runtime.sources.variables", S);
40
+ let [w = {}] = r("pageDefinitions"), T = n(() => Object.values(w).map((e) => ({
40
41
  value: e.id,
41
42
  label: o(e, "attributes.name", e.id)
42
- })), [C]), T = n(() => ({
43
- routeParams: g,
44
- queryParams: _,
45
- origin: y,
46
- currentPageId: b
43
+ })), [w]), E = n(() => ({
44
+ routeParams: _,
45
+ queryParams: v,
46
+ origin: b,
47
+ currentPageId: x
47
48
  }), [
48
- g,
49
49
  _,
50
- y,
51
- b
52
- ]), E = t(() => {
50
+ v,
51
+ b,
52
+ x
53
+ ]), D = t(() => {
53
54
  let e = s({
54
- routeParams: g,
55
- queryParams: _
55
+ routeParams: _,
56
+ queryParams: v
56
57
  }).map((e) => ({
57
58
  path: e,
58
59
  name: `navigation.${e}`
59
60
  })), t = {
60
61
  path: "origin",
61
62
  name: "Origin"
62
- }, n = w.length > 0 ? {
63
+ }, n = T.length > 0 ? {
63
64
  path: "currentPageId",
64
65
  name: "Current Page",
65
66
  inputType: "select",
66
- values: w
67
+ values: T
67
68
  } : {
68
69
  path: "currentPageId",
69
70
  name: "Current Page"
@@ -74,74 +75,74 @@ var p = ({ children: p }) => {
74
75
  n
75
76
  ];
76
77
  }, [
77
- g,
78
78
  _,
79
- w
79
+ v,
80
+ T
80
81
  ]);
81
82
  u({
82
83
  id: "global",
83
84
  source: "navigation",
84
85
  name: "Navigation",
85
- fields: E
86
- }), i("runtime.sources.navigation", T);
87
- let { user: D, authenticated: O } = e(d), [k = "basic"] = r("schema.settings.userProvider"), A = n(() => k === "" ? {} : {
88
- isAuthenticated: O,
89
- accessToken: D?.accessToken ?? "",
86
+ fields: D
87
+ }), i("runtime.sources.navigation", E);
88
+ let { user: O, authenticated: k } = e(d), [A = "basic"] = r("schema.settings.userProvider"), j = n(() => A === "" ? {} : {
89
+ isAuthenticated: k,
90
+ accessToken: O?.accessToken ?? "",
90
91
  details: {
91
92
  username: "",
92
93
  email: "",
93
94
  roles: "",
94
95
  permissions: "",
95
96
  verified: "",
96
- ...D?.details ?? {}
97
+ ...O?.details ?? {}
97
98
  }
98
99
  }, [
99
- k,
100
- D,
101
- O
102
- ]), j = t(() => s(A).map((e) => ({
100
+ A,
101
+ O,
102
+ k
103
+ ]), M = t(() => s(j).map((e) => ({
103
104
  path: e,
104
105
  name: `user.${e}`
105
- })), [A]);
106
+ })), [j]);
106
107
  u({
107
108
  id: "global",
108
109
  source: "auth",
109
110
  name: "Auth State",
110
- fields: j
111
- }), i("runtime.sources.auth", A);
112
- let [M] = r("runtime.state"), N = t(() => s(M).map((e) => ({
111
+ fields: M
112
+ }), i("runtime.sources.auth", j);
113
+ let [N] = r("runtime.state"), P = t(() => s(N).map((e) => ({
113
114
  path: e,
114
115
  name: `state.${e}`
115
- })), [M]);
116
+ })), [N]);
116
117
  u({
117
118
  id: "global",
118
119
  source: "state",
119
120
  name: "State",
120
- fields: N
121
- }), i("runtime.sources.state", M);
122
- let [P] = r("runtime.host"), F = t(() => s(P).map((e) => ({
121
+ fields: P
122
+ }), i("runtime.sources.state", N);
123
+ let [F] = r("runtime.host"), I = t(() => s(F).map((e) => ({
123
124
  path: e,
124
125
  name: `host.${e}`
125
- })), [P]);
126
+ })), [F]);
126
127
  u({
127
128
  id: "global",
128
129
  source: "host",
129
130
  name: "Host",
130
- fields: F
131
- }), i("runtime.sources.host", P);
132
- let { theme: I, resolvedTheme: L } = c(l), R = n(() => ({
133
- mode: I,
134
- resolved: L
135
- }), [I, L]), z = t(() => s(R).map((e) => ({
131
+ fields: I
132
+ }), i("runtime.sources.host", F);
133
+ let { theme: L, resolvedTheme: R } = c(l), z = n(() => ({
134
+ mode: L,
135
+ resolved: R
136
+ }), [L, R]), B = t(() => s(z).map((e) => ({
136
137
  path: e,
137
138
  name: `theme.${e}`
138
- })), [R]);
139
+ })), [z]);
139
140
  return u({
140
141
  id: "global",
141
142
  source: "theme",
142
143
  name: "Theme",
143
- fields: z
144
- }), i("runtime.sources.theme", R), p;
144
+ fields: B
145
+ }), i("runtime.sources.theme", z), m;
145
146
  };
146
147
  //#endregion
147
- export { p as default };
148
+ export { m as default };
@@ -0,0 +1,7 @@
1
+ import { SourceField } from '@plitzi/sdk-shared';
2
+ /**
3
+ * Every path of a source's data, named by its last two segments — what the binding picker lists for a provider, a
4
+ * modal or a dialog. Only ever run when the picker asks: see `useRegisterSource`.
5
+ */
6
+ declare const pathFields: (data: Record<string, unknown>) => SourceField[];
7
+ export default pathFields;
@@ -0,0 +1,8 @@
1
+ import { getPathsFromObeject as e } from "@plitzi/sdk-shared/helpers/utils";
2
+ //#region src/dataSource/pathFields.ts
3
+ var t = (t) => e(t).map((e) => ({
4
+ path: e,
5
+ name: e.split(".").slice(-2).join(" ")
6
+ }));
7
+ //#endregion
8
+ export { t as default };
@@ -1,7 +1,11 @@
1
1
  import { CustomProps } from './Custom';
2
2
  import { AuthorableAttributes } from '@plitzi/sdk-shared/authoring/declare';
3
- /** What this element can be authored with — its component's own props, minus what the runtime supplies. */
4
- export type CustomAttributes = AuthorableAttributes<CustomProps>;
3
+ /**
4
+ * What this element can be authored with — its component's own props, minus what the runtime supplies — and
5
+ * anything else: the component its `renderType` names reads its own attributes off this element (a chart's
6
+ * `series`, a map's `height`), so the element carries whatever that component declares.
7
+ */
8
+ export type CustomAttributes = AuthorableAttributes<CustomProps> & Record<string, unknown>;
5
9
  declare const declaration: {
6
10
  readonly type: "custom";
7
11
  readonly content: {
@@ -53,11 +57,5 @@ declare const declaration: {
53
57
  };
54
58
  readonly settings: {};
55
59
  };
56
- } & import('@plitzi/sdk-shared/authoring/declare').ElementAttributesBrand<Partial<{
57
- settings?: string | undefined;
58
- assets?: string | undefined;
59
- renderType?: string | undefined;
60
- isPlugin?: boolean | undefined;
61
- scriptUrl?: string | undefined;
62
- }>>;
60
+ } & import('@plitzi/sdk-shared/authoring/declare').ElementAttributesBrand<CustomAttributes>;
63
61
  export default declaration;
@@ -52,11 +52,5 @@ declare const Custom: {
52
52
  };
53
53
  readonly settings: {};
54
54
  };
55
- } & import('@plitzi/sdk-shared/authoring/declare').ElementAttributesBrand<Partial<{
56
- settings?: string | undefined;
57
- assets?: string | undefined;
58
- renderType?: string | undefined;
59
- isPlugin?: boolean | undefined;
60
- scriptUrl?: string | undefined;
61
- }>>;
55
+ } & import('@plitzi/sdk-shared/authoring/declare').ElementAttributesBrand<import('./declaration').CustomAttributes>;
62
56
  export default Custom;
@@ -1,143 +1,147 @@
1
- import e from "../../../Element/hocs/withElement.mjs";
2
- import t from "../../../Element/hooks/useElement.mjs";
3
- import { RootElement as n } from "../../../Element/RootElement.mjs";
4
- import r from "../../../Element/PluginManager.mjs";
5
- import { use as i, useCallback as a, useEffect as o, useMemo as s, useRef as c, useState as l } from "react";
6
- import u from "@plitzi/sdk-shared/hooks/usePlitziServiceContext";
7
- import { useCommonStore as d } from "@plitzi/sdk-shared/store";
8
- import { get as f } from "@plitzi/plitzi-ui/helpers";
9
- import { StoreProvider as p } from "@plitzi/nexus/react";
10
- import { jsx as m, jsxs as h } from "react/jsx-runtime";
11
- import g from "clsx";
1
+ import e from "../../../Element/LayoutBody.mjs";
2
+ import t from "../../../Element/hocs/withElement.mjs";
3
+ import n from "../../../Element/hooks/useElement.mjs";
4
+ import { RootElement as r } from "../../../Element/RootElement.mjs";
5
+ import i from "../../../Element/PluginManager.mjs";
6
+ import { use as a, useCallback as o, useEffect as s, useMemo as c, useRef as l, useState as u } from "react";
7
+ import d from "@plitzi/sdk-shared/hooks/usePlitziServiceContext";
8
+ import { useCommonStore as f } from "@plitzi/sdk-shared/store";
9
+ import { get as p } from "@plitzi/plitzi-ui/helpers";
10
+ import { StoreProvider as m } from "@plitzi/nexus/react";
11
+ import { jsx as h, jsxs as g } from "react/jsx-runtime";
12
+ import _ from "clsx";
12
13
  //#region src/elements/advanced/Reference/Reference.tsx
13
- var _ = ({ ref: e, children: _, className: v = "", referenceType: y = "element", referenceId: b = "", referenceContainer: x = "" }) => {
14
- let { id: S, definition: { rootId: C, styleSelectors: w } } = t(), { settings: { previewMode: T, environment: E }, contexts: { SegmentsContext: D } } = u(), [[O, k]] = d(["schema", "segments"]), { segmentGet: A } = i(D), j = c(O);
15
- j.current = O;
16
- let M = c(k);
14
+ var v = ({ ref: t, children: v, className: y = "", referenceType: b = "element", referenceId: x = "", referenceContainer: S = "" }) => {
15
+ let { id: C, definition: { rootId: w, styleSelectors: T } } = n(), { settings: { previewMode: E, environment: D }, contexts: { SegmentsContext: O } } = d(), [[k, A]] = f(["schema", "segments"]), { segmentGet: j } = a(O), M = l(k);
17
16
  M.current = k;
18
- let N = a((e, t) => {
17
+ let N = l(A);
18
+ N.current = A;
19
+ let P = o((e, t) => {
19
20
  let n, r;
20
21
  switch (t) {
21
22
  case "segment": {
22
- let t = f(M.current, e);
23
+ let t = p(N.current, e);
23
24
  if (!t) return;
24
- let i = f(t, "definition.baseElementId");
25
- r = f(t, "schema"), n = f(t, `schema.flat.${i}`);
25
+ let i = p(t, "definition.baseElementId");
26
+ r = p(t, "schema"), n = p(t, `schema.flat.${i}`);
26
27
  break;
27
28
  }
28
- default: n = f(j.current, `flat.${e}`), r = j.current;
29
+ default: n = p(M.current, `flat.${e}`), r = M.current;
29
30
  }
30
31
  if (n) return {
31
32
  element: n,
32
- elementType: f(n, "definition.type"),
33
+ elementType: p(n, "definition.type"),
33
34
  referenceContextData: {
34
35
  schema: r,
35
- prevSchema: j.current
36
+ prevSchema: M.current
36
37
  }
37
38
  };
38
- }, []), [P, F] = l(N(b, y)), I = a(async (e, t) => {
39
- let n = N(e, t);
39
+ }, []), [F, I] = u(P(x, b)), L = o(async (e, t) => {
40
+ let n = P(e, t);
40
41
  if (n) {
41
- F(n);
42
+ I(n);
42
43
  return;
43
44
  }
44
45
  let r, i;
45
46
  switch (t) {
46
47
  case "segment": {
47
48
  let t;
48
- if (e && (t = await A(e)), !t) return;
49
- let n = f(t, "definition.baseElementId");
50
- i = f(t, "schema"), r = f(t, `schema.flat.${n}`);
49
+ if (e && (t = await j(e)), !t) return;
50
+ let n = p(t, "definition.baseElementId");
51
+ i = p(t, "schema"), r = p(t, `schema.flat.${n}`);
51
52
  break;
52
53
  }
53
- default: r = f(j.current, `flat.${e}`), i = j.current;
54
+ default: r = p(M.current, `flat.${e}`), i = M.current;
54
55
  }
55
56
  if (!r) {
56
- F(void 0);
57
+ I(void 0);
57
58
  return;
58
59
  }
59
- F({
60
+ I({
60
61
  element: r,
61
- elementType: f(r, "definition.type"),
62
+ elementType: p(r, "definition.type"),
62
63
  referenceContextData: {
63
64
  schema: i,
64
- prevSchema: j.current
65
+ prevSchema: M.current
65
66
  }
66
67
  });
67
- }, [N, A]);
68
- o(() => {
69
- I(b, y);
68
+ }, [P, j]);
69
+ s(() => {
70
+ L(x, b);
70
71
  }, [
71
- I,
72
- b,
73
- y
72
+ L,
73
+ x,
74
+ b
74
75
  ]);
75
- let L = s(() => ({
76
- bodyChildren: _,
77
- containerId: x,
78
- type: y,
79
- referenceId: S,
80
- rootId: S
76
+ let R = c(() => ({
77
+ containerId: S,
78
+ type: b,
79
+ rootId: C
81
80
  }), [
82
- x,
83
- _,
84
- y,
85
- S
86
- ]), R = s(() => ({
87
- id: P?.element?.id ?? "",
88
- rootId: C,
89
- className: w.base
81
+ S,
82
+ b,
83
+ C
84
+ ]), z = c(() => ({
85
+ id: F?.element?.id ?? "",
86
+ rootId: w,
87
+ className: T.base
90
88
  }), [
91
- P?.element?.id,
92
- C,
93
- w.base
89
+ F?.element?.id,
90
+ w,
91
+ T.base
94
92
  ]);
95
- if (!P) return /* @__PURE__ */ m(n, {
96
- ref: e,
97
- className: g("plitzi-component__reference", v, { "reference--build-mode": !T }),
98
- children: !T && /* @__PURE__ */ h("div", {
93
+ if (!F) return /* @__PURE__ */ h(r, {
94
+ ref: t,
95
+ className: _("plitzi-component__reference", y, { "reference--build-mode": !E }),
96
+ children: !E && /* @__PURE__ */ g("div", {
99
97
  className: "reference__label",
100
- children: ["Element Reference ", /* @__PURE__ */ m("b", {
98
+ children: ["Element Reference ", /* @__PURE__ */ h("b", {
101
99
  className: "capitalize",
102
- children: y
100
+ children: b
103
101
  })]
104
102
  })
105
103
  });
106
- let { element: z, elementType: B, referenceContextData: V } = P;
107
- return T && z && y === "element" ? /* @__PURE__ */ m(p, {
108
- name: `Reference:${S}`,
109
- value: V,
110
- children: /* @__PURE__ */ m(r, {
111
- type: B,
112
- internalProps: R,
113
- plitziElementLayout: L
114
- }, `${S}_${b}`)
115
- }) : /* @__PURE__ */ h(n, {
116
- ref: e,
117
- className: g("plitzi-component__reference", v, { "reference--build-mode": !T }),
104
+ let { element: B, elementType: V, referenceContextData: H } = F;
105
+ return E && B && b === "element" ? /* @__PURE__ */ h(m, {
106
+ name: `Reference:${C}`,
107
+ value: H,
108
+ children: /* @__PURE__ */ h(e, {
109
+ body: v,
110
+ children: /* @__PURE__ */ h(i, {
111
+ type: V,
112
+ internalProps: z,
113
+ plitziElementLayout: R
114
+ }, `${C}_${x}`)
115
+ })
116
+ }) : /* @__PURE__ */ g(r, {
117
+ ref: t,
118
+ className: _("plitzi-component__reference", y, { "reference--build-mode": !E }),
118
119
  children: [
119
- /* @__PURE__ */ m(p, {
120
- name: `Reference:${S}`,
121
- value: V,
122
- children: z && /* @__PURE__ */ m(r, {
123
- type: B,
124
- internalProps: R,
125
- plitziElementLayout: L
126
- }, `${S}_${b}`)
120
+ /* @__PURE__ */ h(m, {
121
+ name: `Reference:${C}`,
122
+ value: H,
123
+ children: B && /* @__PURE__ */ h(e, {
124
+ body: v,
125
+ children: /* @__PURE__ */ h(i, {
126
+ type: V,
127
+ internalProps: z,
128
+ plitziElementLayout: R
129
+ }, `${C}_${x}`)
130
+ })
127
131
  }),
128
- !T && !z && /* @__PURE__ */ h("div", {
132
+ !E && !B && /* @__PURE__ */ g("div", {
129
133
  className: "reference__label",
130
- children: ["Element Reference ", y]
134
+ children: ["Element Reference ", b]
131
135
  }),
132
- T && !z && y === "segment" && /* @__PURE__ */ h("div", { children: [
136
+ E && !B && b === "segment" && /* @__PURE__ */ g("div", { children: [
133
137
  "Segment ",
134
- /* @__PURE__ */ m("b", { children: b }),
138
+ /* @__PURE__ */ h("b", { children: x }),
135
139
  " not found, publish to ",
136
- /* @__PURE__ */ m("b", { children: E }),
140
+ /* @__PURE__ */ h("b", { children: D }),
137
141
  " environment"
138
142
  ] })
139
143
  ]
140
144
  });
141
- }, v = e(_);
145
+ }, y = t(v);
142
146
  //#endregion
143
- export { _ as Reference, v as default };
147
+ export { v as Reference, y as default };
@@ -53,8 +53,8 @@ declare const declaration: {
53
53
  readonly settings: {};
54
54
  };
55
55
  } & import('@plitzi/sdk-shared/authoring/declare').ElementAttributesBrand<Partial<{
56
- referenceId: string;
57
56
  referenceType: import('@plitzi/sdk-shared').ElementLayoutType;
57
+ referenceId: string;
58
58
  referenceContainer: string;
59
59
  }>>;
60
60
  export default declaration;
@@ -52,8 +52,8 @@ declare const Reference: {
52
52
  readonly settings: {};
53
53
  };
54
54
  } & import('@plitzi/sdk-shared/authoring/declare').ElementAttributesBrand<Partial<{
55
- referenceId: string;
56
55
  referenceType: import('@plitzi/sdk-shared').ElementLayoutType;
56
+ referenceId: string;
57
57
  referenceContainer: string;
58
58
  }>>;
59
59
  export default Reference;
@@ -16,8 +16,16 @@ export type ButtonProps = {
16
16
  ariaExpanded?: boolean;
17
17
  /** For a button that stays on or off — a filter, a mode: `true` while it is on. Left out, it is a plain button. */
18
18
  ariaPressed?: boolean;
19
+ /**
20
+ * What the button does, in words — shown as a tooltip on hover, and the button's accessible name when it has no text
21
+ * of its own. An icon-only button without one is announced as nothing at all.
22
+ *
23
+ * The browser falls back to it by itself, so it is never copied into `aria-label`: an `aria-label` would win over a
24
+ * visually-hidden label among the children, which is how a button with an empty `content` names itself.
25
+ */
26
+ title?: string;
19
27
  };
20
- declare const Button: ({ ref, className, children, contentPlacement, content, subType, disabled, ariaExpanded, ariaPressed }: ButtonProps) => import("react").JSX.Element;
28
+ declare const Button: ({ ref, className, children, contentPlacement, content, subType, disabled, ariaExpanded, ariaPressed, title }: ButtonProps) => import("react").JSX.Element;
21
29
  declare const _default: {
22
30
  (props: import('../../../Element/hocs/withElement').WithElementProps<ButtonProps>): import("react").JSX.Element;
23
31
  displayName: string;