@plitzi/sdk-elements 0.38.3 → 0.38.5

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 (74) hide show
  1. package/CHANGELOG.md +539 -0
  2. package/dist/Element/helpers/elementChildren.d.ts +29 -0
  3. package/dist/Element/helpers/elementChildren.mjs +16 -0
  4. package/dist/Element/hooks/useElementVisible.d.ts +11 -0
  5. package/dist/Element/hooks/useElementVisible.mjs +25 -0
  6. package/dist/Element/hooks/useRscData.d.ts +4 -0
  7. package/dist/Element/hooks/useRscData.mjs +23 -19
  8. package/dist/dataSource/GlobalSources.mjs +68 -57
  9. package/dist/elements/basic/Button/Button.d.ts +6 -1
  10. package/dist/elements/basic/Button/Button.mjs +9 -8
  11. package/dist/elements/basic/Button/declaration.d.ts +2 -1
  12. package/dist/elements/basic/Button/declaration.mjs +1 -1
  13. package/dist/elements/basic/Button/index.d.ts +2 -1
  14. package/dist/elements/basic/Dropdown/DropdownPopup/declaration.d.ts +1 -1
  15. package/dist/elements/basic/Dropdown/DropdownPopup/declaration.mjs +1 -1
  16. package/dist/elements/basic/Dropdown/DropdownPopup/index.d.ts +1 -1
  17. package/dist/elements/basic/Dropdown/index.d.ts +1 -1
  18. package/dist/elements/basic/Markdown/Markdown.d.ts +3 -3
  19. package/dist/elements/basic/Markdown/Markdown.mjs +10 -6
  20. package/dist/elements/basic/Markdown/declaration.d.ts +1 -1
  21. package/dist/elements/basic/Markdown/index.d.ts +1 -1
  22. package/dist/elements/basic/RichText/declaration.d.ts +1 -1
  23. package/dist/elements/basic/RichText/declaration.mjs +1 -1
  24. package/dist/elements/basic/RichText/index.d.ts +1 -1
  25. package/dist/elements/basic/Text/Text.d.ts +6 -1
  26. package/dist/elements/basic/Text/Text.mjs +6 -5
  27. package/dist/elements/basic/Text/declaration.d.ts +1 -0
  28. package/dist/elements/basic/Text/index.d.ts +1 -0
  29. package/dist/elements/declarations/index.d.ts +55 -11
  30. package/dist/elements/form/Form/declaration.d.ts +1 -0
  31. package/dist/elements/form/Form/declaration.mjs +2 -1
  32. package/dist/elements/form/FormControl/FormControl.d.ts +5 -1
  33. package/dist/elements/form/FormControl/FormControl.mjs +3 -0
  34. package/dist/elements/form/FormControl/Settings.d.ts +1 -1
  35. package/dist/elements/form/FormControl/Settings.mjs +16 -1
  36. package/dist/elements/form/FormControl/declaration.d.ts +1 -0
  37. package/dist/elements/form/FormControl/declaration.mjs +6 -2
  38. package/dist/elements/internal/LayoutContainer/LayoutContainer.mjs +37 -29
  39. package/dist/elements/internal/LayoutContainer/mask.d.ts +11 -0
  40. package/dist/elements/internal/LayoutContainer/mask.mjs +14 -0
  41. package/dist/elements/media/Image/Image.d.ts +7 -1
  42. package/dist/elements/media/Image/Image.mjs +10 -10
  43. package/dist/elements/media/Image/declaration.d.ts +2 -1
  44. package/dist/elements/media/Image/declaration.mjs +1 -1
  45. package/dist/elements/media/Image/index.d.ts +2 -1
  46. package/dist/elements/provider/ApiContainer/ApiContainer.d.ts +9 -1
  47. package/dist/elements/provider/ApiContainer/ApiContainer.mjs +172 -155
  48. package/dist/elements/provider/ApiContainer/declaration.d.ts +38 -10
  49. package/dist/elements/provider/ApiContainer/declaration.mjs +7 -0
  50. package/dist/elements/provider/ApiContainer/helpers/serverMock.d.ts +10 -0
  51. package/dist/elements/provider/ApiContainer/helpers/serverMock.mjs +17 -0
  52. package/dist/elements/provider/ApiContainer/hooks/useApi.d.ts +2 -0
  53. package/dist/elements/provider/ApiContainer/hooks/useApi.mjs +1 -0
  54. package/dist/elements/provider/ApiContainer/hooks/useInputRefresh.d.ts +20 -0
  55. package/dist/elements/provider/ApiContainer/hooks/useInputRefresh.mjs +16 -0
  56. package/dist/elements/provider/ApiContainer/index.d.ts +37 -1
  57. package/dist/elements/structure/Container/Container.d.ts +13 -2
  58. package/dist/elements/structure/Container/Container.mjs +8 -6
  59. package/dist/elements/structure/Container/declaration.d.ts +5 -2
  60. package/dist/elements/structure/Container/declaration.mjs +32 -24
  61. package/dist/elements/structure/Container/index.d.ts +5 -2
  62. package/dist/elements/structure/DialogContainer/declaration.d.ts +1 -1
  63. package/dist/elements/structure/DialogContainer/declaration.mjs +1 -1
  64. package/dist/elements/structure/DialogContainer/index.d.ts +1 -1
  65. package/dist/elements/structure/List/ListItem/declaration.d.ts +1 -1
  66. package/dist/elements/structure/List/ListItem/declaration.mjs +1 -1
  67. package/dist/elements/structure/List/ListItem/index.d.ts +1 -1
  68. package/dist/elements/structure/List/index.d.ts +1 -1
  69. package/dist/elements/structure/TabContainer/TabContainerItem/declaration.d.ts +1 -1
  70. package/dist/elements/structure/TabContainer/TabContainerItem/declaration.mjs +1 -1
  71. package/dist/elements/structure/TabContainer/TabContainerItem/index.d.ts +1 -1
  72. package/dist/elements/structure/TabContainer/index.d.ts +1 -1
  73. package/dist/index.d.ts +53 -11
  74. package/package.json +25 -9
@@ -0,0 +1,25 @@
1
+ import { useEffect as e, useState as t } from "react";
2
+ import n from "@plitzi/sdk-shared/hooks/usePlitziServiceContext";
3
+ //#region src/Element/hooks/useElementVisible.ts
4
+ var r = (e) => typeof e.checkVisibility == "function" ? e.checkVisibility() : e.getClientRects().length > 0, i = (i) => {
5
+ let { utils: { rootRef: a } } = n(), [o, s] = t(void 0);
6
+ return e(() => {
7
+ let e = a.current, t = e?.ownerDocument.defaultView;
8
+ if (!e || !t || !i) return;
9
+ let n = `[data-plitzi-el="${t.CSS.escape(i)}"]`, o = () => s([...e.querySelectorAll(n)].some(r)), c = 0, l = new t.MutationObserver(() => {
10
+ c ||= t.requestAnimationFrame(() => {
11
+ c = 0, o();
12
+ });
13
+ });
14
+ return l.observe(e, {
15
+ subtree: !0,
16
+ childList: !0,
17
+ attributes: !0,
18
+ attributeFilter: ["class", "style"]
19
+ }), t.addEventListener("resize", o), o(), () => {
20
+ l.disconnect(), t.removeEventListener("resize", o), t.cancelAnimationFrame(c);
21
+ };
22
+ }, [i, a]), o;
23
+ };
24
+ //#endregion
25
+ export { i as default };
@@ -14,6 +14,10 @@ declare const useRscData: <T>() => {
14
14
  location: string | undefined;
15
15
  elementData: NonNullable<T> | null;
16
16
  isServerElement: boolean;
17
+ /** A refresh asking about this element — or about the whole payload of this page — is in flight. */
18
+ refreshing: boolean;
17
19
  refresh: (ids?: string[], params?: Record<string, string>) => Promise<void>;
20
+ /** Stops this element's refresh in flight, here and on the server; what it shows stays. */
21
+ cancel: () => void;
18
22
  };
19
23
  export default useRscData;
@@ -1,30 +1,34 @@
1
1
  import e from "./useElement.mjs";
2
- import { useRef as t } from "react";
3
- import { useCommonStore as n } from "@plitzi/sdk-shared/store";
4
- import { currentRscLocation as r, rscDataPath as i } from "@plitzi/sdk-shared/server/rsc/refreshRsc";
5
- import a from "@plitzi/sdk-shared/server/rsc/useRscRefresh";
2
+ import { useCallback as t, useRef as n } from "react";
3
+ import { useCommonStore as r } from "@plitzi/sdk-shared/store";
4
+ import { useStoreById as i } from "@plitzi/nexus/react";
5
+ import { cancelRsc as a, currentRscLocation as o, rscDataPath as s } from "@plitzi/sdk-shared/server/rsc/refreshRsc";
6
+ import c from "@plitzi/sdk-shared/server/rsc/useRscRefresh";
6
7
  //#region src/Element/hooks/useRscData.ts
7
- var o = () => {
8
- let { id: o, rootId: s } = e(), [[c = !1, l = !1, u = !1, d, f, p, m]] = n([
8
+ var l = () => {
9
+ let { id: l, rootId: u } = e(), [[d = !1, f = !1, p = !1, m, h, g, _, v]] = r([
9
10
  "rsc.enabled",
10
11
  "rsc.loaded",
11
12
  "rsc.stale",
12
13
  "rsc.location",
13
- i(o),
14
+ s(l),
14
15
  "navigation.currentPageId",
15
- "schema.pages"
16
- ]), h = a(), g = d !== void 0 && d !== r() || s !== void 0 && s !== p && Array.isArray(m) && m.includes(s), _ = t(void 0);
17
- !g && f !== void 0 && (_.current = f);
18
- let v = g && _.current !== void 0 ? _.current : f;
16
+ "schema.pages",
17
+ "rsc.refreshing"
18
+ ]), y = c(), b = i(), x = t(() => a(b, [l]), [b, l]), S = m !== void 0 && m !== o() || u !== void 0 && u !== g && Array.isArray(_) && _.includes(u), C = n(void 0);
19
+ !S && h !== void 0 && (C.current = h);
20
+ let w = S && C.current !== void 0 ? C.current : h;
19
21
  return {
20
- enabled: c,
21
- loaded: l,
22
- stale: u,
23
- location: d,
24
- elementData: v ?? null,
25
- isServerElement: v !== void 0,
26
- refresh: h
22
+ enabled: d,
23
+ loaded: f,
24
+ stale: p,
25
+ location: m,
26
+ elementData: w ?? null,
27
+ isServerElement: w !== void 0,
28
+ refreshing: v?.[l] === !0 || v?.["*"] === !0,
29
+ refresh: y,
30
+ cancel: x
27
31
  };
28
32
  };
29
33
  //#endregion
30
- export { o as default };
34
+ export { l as default };
@@ -1,64 +1,68 @@
1
1
  import { use as e, useCallback as t, useEffect as n, useMemo as r, useRef as i } from "react";
2
2
  import { useCommonStore as a, useCommonStoreSync as o, useRenderSettings as s } from "@plitzi/sdk-shared/store";
3
- import { get as ee } from "@plitzi/plitzi-ui/helpers";
4
- import { flagValues as c, undeclaredFlagOverrides as l } from "@plitzi/sdk-shared/flags";
5
- import { getPathsFromObeject as u } from "@plitzi/sdk-shared/helpers/utils";
6
- import { evaluateComputed as d, resolveVariables as te } from "@plitzi/sdk-shared/dataSource";
7
- import ne, { SPACE_THEME_AREA as f } from "@plitzi/sdk-shared/theme/useTheme";
8
- import p from "@plitzi/sdk-shared/dataSource/hooks/useRegisterSource";
9
- import m from "@plitzi/sdk-auth/AuthContext";
10
- import h from "@plitzi/sdk-shared/flags/useFlagResolution";
11
- import g from "@plitzi/sdk-shared/hooks/useStableValue";
3
+ import { get as c } from "@plitzi/plitzi-ui/helpers";
4
+ import { flagValues as l, undeclaredFlagOverrides as u } from "@plitzi/sdk-shared/flags";
5
+ import { getPathsFromObeject as d } from "@plitzi/sdk-shared/helpers/utils";
6
+ import { evaluateComputed as ee, resolveVariables as te } from "@plitzi/sdk-shared/dataSource";
7
+ import ne, { SPACE_THEME_AREA as re } from "@plitzi/sdk-shared/theme/useTheme";
8
+ import f from "@plitzi/sdk-shared/dataSource/hooks/useRegisterSource";
9
+ import p from "@plitzi/sdk-auth/AuthContext";
10
+ import m from "@plitzi/sdk-shared/flags/useFlagResolution";
11
+ import h from "@plitzi/sdk-shared/hooks/useStableValue";
12
12
  //#region src/dataSource/GlobalSources.tsx
13
- var _ = ({ children: _ }) => {
14
- let { environment: v } = s(), [[y, b, x, S, C, w, T]] = a([
13
+ var g = ({ children: g }) => {
14
+ let { environment: _ } = s(), [[v, y, b, x, S, C, w, T = ""]] = a([
15
15
  "schema.variables",
16
16
  "navigation.routeParams",
17
17
  "navigation.queryParams",
18
18
  "navigation.hostname",
19
19
  "navigation.origin",
20
20
  "navigation.href",
21
- "navigation.currentPageId"
22
- ]), E = g(r(() => te(y, {
23
- routeParams: b,
24
- queryParams: x,
25
- hostname: S,
26
- environment: v
21
+ "navigation.currentPageId",
22
+ "navigation.pendingLocation"
23
+ ]), E = h(r(() => te(v, {
24
+ routeParams: y,
25
+ queryParams: b,
26
+ hostname: x,
27
+ environment: _
27
28
  }), [
28
- v,
29
- S,
29
+ _,
30
30
  x,
31
31
  b,
32
- y
33
- ])), re = t(() => u(E).map((e) => ({
32
+ y,
33
+ v
34
+ ])), ie = t(() => d(E).map((e) => ({
34
35
  path: e,
35
36
  name: `variables.${e}`
36
37
  })), [E]);
37
- p({
38
+ f({
38
39
  id: "global",
39
40
  source: "variables",
40
41
  name: "Variables",
41
- fields: re
42
+ fields: ie
42
43
  }), o("runtime.sources.variables", E);
43
44
  let [D = {}] = a("pageDefinitions"), O = r(() => Object.values(D).map((e) => ({
44
45
  value: e.id,
45
- label: ee(e, "attributes.name", e.id)
46
+ label: c(e, "attributes.name", e.id)
46
47
  })), [D]), k = r(() => ({
47
- routeParams: b,
48
- queryParams: x,
49
- origin: C,
50
- href: w,
51
- currentPageId: T
48
+ routeParams: y,
49
+ queryParams: b,
50
+ origin: S,
51
+ href: C,
52
+ currentPageId: w,
53
+ pending: T !== "",
54
+ pendingLocation: T
52
55
  }), [
56
+ y,
53
57
  b,
54
- x,
58
+ S,
55
59
  C,
56
60
  w,
57
61
  T
58
62
  ]), A = t(() => {
59
- let e = u({
60
- routeParams: b,
61
- queryParams: x
63
+ let e = d({
64
+ routeParams: y,
65
+ queryParams: b
62
66
  }).map((e) => ({
63
67
  path: e,
64
68
  name: `navigation.${e}`
@@ -68,7 +72,13 @@ var _ = ({ children: _ }) => {
68
72
  }, n = {
69
73
  path: "href",
70
74
  name: "This page’s address"
71
- }, r = O.length > 0 ? {
75
+ }, r = [{
76
+ path: "pending",
77
+ name: "A navigation is on its way"
78
+ }, {
79
+ path: "pendingLocation",
80
+ name: "Where a navigation is going"
81
+ }], i = O.length > 0 ? {
72
82
  path: "currentPageId",
73
83
  name: "Current Page",
74
84
  inputType: "select",
@@ -81,20 +91,21 @@ var _ = ({ children: _ }) => {
81
91
  ...e,
82
92
  t,
83
93
  n,
84
- r
94
+ ...r,
95
+ i
85
96
  ];
86
97
  }, [
98
+ y,
87
99
  b,
88
- x,
89
100
  O
90
101
  ]);
91
- p({
102
+ f({
92
103
  id: "global",
93
104
  source: "navigation",
94
105
  name: "Navigation",
95
106
  fields: A
96
107
  }), o("runtime.sources.navigation", k);
97
- let j = e(m), { user: M, authenticated: N, state: P } = j, [F = "basic"] = a("schema.settings.userProvider"), I = r(() => F === "" ? {} : {
108
+ let j = e(p), { user: M, authenticated: N, state: P } = j, [F = "basic"] = a("schema.settings.userProvider"), I = r(() => F === "" ? {} : {
98
109
  isAuthenticated: N,
99
110
  ...P === void 0 ? {} : { status: P },
100
111
  accessToken: M?.accessToken ?? "",
@@ -111,65 +122,65 @@ var _ = ({ children: _ }) => {
111
122
  M,
112
123
  N,
113
124
  P
114
- ]), L = t(() => u(I).map((e) => ({
125
+ ]), L = t(() => d(I).map((e) => ({
115
126
  path: e,
116
127
  name: `user.${e}`
117
128
  })), [I]);
118
- p({
129
+ f({
119
130
  id: "global",
120
131
  source: "auth",
121
132
  name: "Auth State",
122
133
  fields: L
123
134
  }), o("runtime.sources.auth", I);
124
- let R = h(j), z = r(() => c(R), [R]), B = t(() => Object.keys(z).map((e) => ({
135
+ let R = m(j), z = r(() => l(R), [R]), B = t(() => Object.keys(z).map((e) => ({
125
136
  path: e,
126
137
  name: `flags.${e}`,
127
138
  inputType: "checkbox"
128
139
  })), [z]);
129
- p({
140
+ f({
130
141
  id: "global",
131
142
  source: "flags",
132
143
  name: "Feature Flags",
133
144
  fields: B
134
145
  }), o("runtime.sources.flags", z), o("flags.resolved", R);
135
- let [V, H] = a(["schema.flags", "flags.overrides"])[0], U = g(l(V, H ?? {}));
146
+ let [V, H] = a(["schema.flags", "flags.overrides"])[0], U = h(u(V, H ?? {}));
136
147
  n(() => {
137
148
  U.forEach(({ layer: e, name: t }) => console.warn(`[plitzi] The ${e} sets the feature flag "${t}", which this space does not declare: the override is ignored. Declare the flag in the space, or remove the override.`));
138
149
  }, [U]);
139
- let [W] = a("runtime.state"), G = t(() => u(W).map((e) => ({
150
+ let [W] = a("runtime.state"), G = t(() => d(W).map((e) => ({
140
151
  path: e,
141
152
  name: `state.${e}`
142
153
  })), [W]);
143
- p({
154
+ f({
144
155
  id: "global",
145
156
  source: "state",
146
157
  name: "State",
147
158
  fields: G
148
159
  }), o("runtime.sources.state", W);
149
- let [K] = a("runtime.host"), q = t(() => u(K).map((e) => ({
160
+ let [K] = a("runtime.host"), q = t(() => d(K).map((e) => ({
150
161
  path: e,
151
162
  name: `host.${e}`
152
163
  })), [K]);
153
- p({
164
+ f({
154
165
  id: "global",
155
166
  source: "host",
156
167
  name: "Host",
157
168
  fields: q
158
169
  }), o("runtime.sources.host", K);
159
- let { theme: J, resolvedTheme: Y } = ne(f), X = r(() => ({
170
+ let { theme: J, resolvedTheme: Y } = ne(re), X = r(() => ({
160
171
  mode: J,
161
172
  resolved: Y
162
- }), [J, Y]), ie = t(() => u(X).map((e) => ({
173
+ }), [J, Y]), ae = t(() => d(X).map((e) => ({
163
174
  path: e,
164
175
  name: `theme.${e}`
165
176
  })), [X]);
166
- p({
177
+ f({
167
178
  id: "global",
168
179
  source: "theme",
169
180
  name: "Theme",
170
- fields: ie
181
+ fields: ae
171
182
  }), o("runtime.sources.theme", X);
172
- let [Z] = a("schema.settings.computed"), Q = i(void 0), $ = r(() => d(Z ?? {}, {
183
+ let [Z] = a("schema.settings.computed"), Q = i(void 0), $ = r(() => ee(Z ?? {}, {
173
184
  variables: E,
174
185
  navigation: k,
175
186
  auth: I,
@@ -188,16 +199,16 @@ var _ = ({ children: _ }) => {
188
199
  z
189
200
  ]);
190
201
  Q.current = $;
191
- let ae = t(() => u($).map((e) => ({
202
+ let oe = t(() => d($).map((e) => ({
192
203
  path: e,
193
204
  name: `computed.${e}`
194
205
  })), [$]);
195
- return p({
206
+ return f({
196
207
  id: "global",
197
208
  source: "computed",
198
209
  name: "Computed",
199
- fields: ae
200
- }), o("runtime.sources.computed", $), _;
210
+ fields: oe
211
+ }), o("runtime.sources.computed", $), g;
201
212
  };
202
213
  //#endregion
203
- export { _ as default };
214
+ export { g as default };
@@ -24,6 +24,11 @@ export type ButtonProps = {
24
24
  ariaExpanded?: boolean;
25
25
  /** For a button that stays on or off — a filter, a mode: `true` while it is on. Left out, it is a plain button. */
26
26
  ariaPressed?: boolean;
27
+ /**
28
+ * What the button shows and hides — an accordion's panel, a menu — by its anchor (`aria-controls`), so a screen
29
+ * reader can go from one to the other. Authoring takes the element's id and gives that element the anchor.
30
+ */
31
+ controls?: string;
27
32
  /**
28
33
  * What the button does, in words — shown as a tooltip on hover, and the button's accessible name when it has no text
29
34
  * of its own. An icon-only button without one is announced as nothing at all.
@@ -40,7 +45,7 @@ export type ButtonProps = {
40
45
  */
41
46
  label?: string;
42
47
  };
43
- declare const Button: ({ ref, className, children, contentPlacement, content, icon, iconPlacement, subType, disabled, ariaExpanded, ariaPressed, title, label }: ButtonProps) => import('react').JSX.Element;
48
+ declare const Button: ({ ref, className, children, contentPlacement, content, icon, iconPlacement, subType, disabled, ariaExpanded, ariaPressed, controls, title, label }: ButtonProps) => import('react').JSX.Element;
44
49
  declare const _default: {
45
50
  (props: import('../../../Element/hocs/withElement').WithElementProps<ButtonProps>): import('react').JSX.Element;
46
51
  displayName: string;
@@ -6,31 +6,32 @@ import i from "@plitzi/sdk-shared/hooks/usePlitziServiceContext";
6
6
  import { jsx as a, jsxs as o } from "react/jsx-runtime";
7
7
  import s from "clsx";
8
8
  //#region src/elements/basic/Button/Button.tsx
9
- var c = ({ ref: e, className: c = "", children: l, contentPlacement: u = "after", content: d = "Button", icon: f = "", iconPlacement: p = "before", subType: m = "button", disabled: h = !1, ariaExpanded: g, ariaPressed: _, title: v, label: y }) => {
10
- let { settings: { previewMode: b } } = i(), { definition: { styleSelectors: x } } = t();
9
+ var c = ({ ref: e, className: c = "", children: l, contentPlacement: u = "after", content: d = "Button", icon: f = "", iconPlacement: p = "before", subType: m = "button", disabled: h = !1, ariaExpanded: g, ariaPressed: _, controls: v, title: y, label: b }) => {
10
+ let { settings: { previewMode: x } } = i(), { definition: { styleSelectors: S } } = t();
11
11
  return /* @__PURE__ */ o(n, {
12
12
  ref: e,
13
13
  tag: "button",
14
- type: b ? m : "button",
15
- className: s("plitzi-component__button", c, { "container--empty--skip": !b && !l && (d || f) }),
14
+ type: x ? m : "button",
15
+ className: s("plitzi-component__button", c, { "container--empty--skip": !x && !l && (d || f) }),
16
16
  disabled: h,
17
- title: v || void 0,
18
- "aria-label": y || void 0,
17
+ title: y || void 0,
18
+ "aria-label": b || void 0,
19
19
  "aria-expanded": g,
20
20
  "aria-pressed": _,
21
+ "aria-controls": v || void 0,
21
22
  children: [
22
23
  u === "before" && /* @__PURE__ */ a(r, {
23
24
  content: d,
24
25
  icon: f,
25
26
  iconPlacement: p,
26
- iconClassName: x.icon
27
+ iconClassName: S.icon
27
28
  }),
28
29
  l,
29
30
  u === "after" && /* @__PURE__ */ a(r, {
30
31
  content: d,
31
32
  icon: f,
32
33
  iconPlacement: p,
33
- iconClassName: x.icon
34
+ iconClassName: S.icon
34
35
  })
35
36
  ]
36
37
  });
@@ -48,7 +48,7 @@ declare const declaration: {
48
48
  readonly license: "MIT";
49
49
  readonly website: "https://plitzi.com";
50
50
  readonly backgroundColor: "#4422ee";
51
- readonly icon: "fa-solid fa-stop";
51
+ readonly icon: "fa-solid fa-hand-pointer";
52
52
  };
53
53
  readonly defaultStyle: {
54
54
  readonly name: "Button";
@@ -131,6 +131,7 @@ declare const declaration: {
131
131
  title?: string | undefined;
132
132
  content?: string | undefined;
133
133
  disabled?: boolean | undefined;
134
+ controls?: string | undefined;
134
135
  icon?: string | undefined;
135
136
  subType?: "button" | "submit" | "reset" | undefined;
136
137
  iconPlacement?: import('../../../Element/ElementWords').IconPlacement | undefined;
@@ -48,7 +48,7 @@ var n = e()({
48
48
  license: "MIT",
49
49
  website: "https://plitzi.com",
50
50
  backgroundColor: "#4422ee",
51
- icon: "fa-solid fa-stop"
51
+ icon: "fa-solid fa-hand-pointer"
52
52
  },
53
53
  defaultStyle: {
54
54
  name: "Button",
@@ -47,7 +47,7 @@ declare const Button: {
47
47
  readonly license: "MIT";
48
48
  readonly website: "https://plitzi.com";
49
49
  readonly backgroundColor: "#4422ee";
50
- readonly icon: "fa-solid fa-stop";
50
+ readonly icon: "fa-solid fa-hand-pointer";
51
51
  };
52
52
  readonly defaultStyle: {
53
53
  readonly name: "Button";
@@ -130,6 +130,7 @@ declare const Button: {
130
130
  title?: string | undefined;
131
131
  content?: string | undefined;
132
132
  disabled?: boolean | undefined;
133
+ controls?: string | undefined;
133
134
  icon?: string | undefined;
134
135
  subType?: "button" | "submit" | "reset" | undefined;
135
136
  iconPlacement?: import('../../../Element/ElementWords').IconPlacement | undefined;
@@ -34,7 +34,7 @@ declare const declaration: {
34
34
  readonly license: "MIT";
35
35
  readonly website: "https://plitzi.com";
36
36
  readonly backgroundColor: "#4422ee";
37
- readonly icon: "";
37
+ readonly icon: "fa-regular fa-window-restore";
38
38
  };
39
39
  readonly defaultStyle: {
40
40
  readonly name: "Dropdown Popup";
@@ -30,7 +30,7 @@ var t = e()({
30
30
  license: "MIT",
31
31
  website: "https://plitzi.com",
32
32
  backgroundColor: "#4422ee",
33
- icon: ""
33
+ icon: "fa-regular fa-window-restore"
34
34
  },
35
35
  defaultStyle: {
36
36
  name: "Dropdown Popup",
@@ -33,7 +33,7 @@ declare const DropdownPopup: {
33
33
  readonly license: "MIT";
34
34
  readonly website: "https://plitzi.com";
35
35
  readonly backgroundColor: "#4422ee";
36
- readonly icon: "";
36
+ readonly icon: "fa-regular fa-window-restore";
37
37
  };
38
38
  readonly defaultStyle: {
39
39
  readonly name: "Dropdown Popup";
@@ -38,7 +38,7 @@ declare const Dropdown: {
38
38
  readonly license: "MIT";
39
39
  readonly website: "https://plitzi.com";
40
40
  readonly backgroundColor: "#4422ee";
41
- readonly icon: "";
41
+ readonly icon: "fa-regular fa-window-restore";
42
42
  };
43
43
  readonly defaultStyle: {
44
44
  readonly name: "Dropdown Popup";
@@ -1,8 +1,8 @@
1
1
  import { RefObject } from 'react';
2
2
  export type MarkdownProps = {
3
- ref: RefObject<HTMLElement>;
4
- className: string;
5
- content: string;
3
+ ref?: RefObject<HTMLElement>;
4
+ className?: string;
5
+ content?: string;
6
6
  };
7
7
  declare const Markdown: ({ ref, content, className }: MarkdownProps) => import('react').JSX.Element;
8
8
  declare const _default: {
@@ -4,14 +4,18 @@ import n from "@plitzi/sdk-shared/hooks/usePlitziServiceContext";
4
4
  import { jsx as r } from "react/jsx-runtime";
5
5
  import i from "clsx";
6
6
  import a from "@plitzi/plitzi-ui/Markdown";
7
+ import { uniqueAnchor as o } from "@plitzi/sdk-shared/schema/anchor";
7
8
  //#region src/elements/basic/Markdown/Markdown.tsx
8
- var o = ({ ref: e, content: o = "Markdown", className: s = "" }) => {
9
- let { settings: { previewMode: c } } = n();
9
+ var s = ({ ref: e, content: s = "Markdown", className: c = "" }) => {
10
+ let { settings: { previewMode: l } } = n();
10
11
  return /* @__PURE__ */ r(t, {
11
12
  ref: e,
12
- className: i("plitzi-component__markdown", { "plitzi-component__markdown--edit-mode": !c }, s),
13
- children: /* @__PURE__ */ r(a, { children: o })
13
+ className: i("plitzi-component__markdown", { "plitzi-component__markdown--edit-mode": !l }, c),
14
+ children: /* @__PURE__ */ r(a, {
15
+ headingAnchor: o,
16
+ children: s
17
+ })
14
18
  });
15
- }, s = e(o);
19
+ }, c = e(s);
16
20
  //#endregion
17
- export { o as Markdown, s as default };
21
+ export { s as Markdown, c as default };
@@ -53,6 +53,6 @@ declare const declaration: {
53
53
  readonly settings: {};
54
54
  };
55
55
  } & import('@plitzi/sdk-shared/authoring/declare').ElementAttributesBrand<Partial<{
56
- content: string;
56
+ content?: string | undefined;
57
57
  }>>;
58
58
  export default declaration;
@@ -52,6 +52,6 @@ declare const Markdown: {
52
52
  readonly settings: {};
53
53
  };
54
54
  } & import('@plitzi/sdk-shared/authoring/declare').ElementAttributesBrand<Partial<{
55
- content: string;
55
+ content?: string | undefined;
56
56
  }>>;
57
57
  export default Markdown;
@@ -42,7 +42,7 @@ declare const declaration: {
42
42
  readonly license: "MIT";
43
43
  readonly website: "https://plitzi.com";
44
44
  readonly backgroundColor: "#4422ee";
45
- readonly icon: "fa-solid fa-align-left";
45
+ readonly icon: "fa-solid fa-file-lines";
46
46
  };
47
47
  readonly defaultStyle: {
48
48
  readonly name: "Rich Text";
@@ -38,7 +38,7 @@ var n = e()({
38
38
  license: "MIT",
39
39
  website: "https://plitzi.com",
40
40
  backgroundColor: "#4422ee",
41
- icon: "fa-solid fa-align-left"
41
+ icon: "fa-solid fa-file-lines"
42
42
  },
43
43
  defaultStyle: {
44
44
  name: "Rich Text",
@@ -41,7 +41,7 @@ declare const RichText: {
41
41
  readonly license: "MIT";
42
42
  readonly website: "https://plitzi.com";
43
43
  readonly backgroundColor: "#4422ee";
44
- readonly icon: "fa-solid fa-align-left";
44
+ readonly icon: "fa-solid fa-file-lines";
45
45
  };
46
46
  readonly defaultStyle: {
47
47
  readonly name: "Rich Text";
@@ -3,8 +3,13 @@ export type TextProps = {
3
3
  ref?: RefObject<HTMLElement>;
4
4
  className?: string;
5
5
  content?: string | number;
6
+ /**
7
+ * What a pointer resting on it shows — the whole of a text cut short, what an abbreviation stands for. A screen reader
8
+ * may not say it, so nothing only it says should matter.
9
+ */
10
+ title?: string;
6
11
  };
7
- declare const Text: ({ ref, content, className }: TextProps) => import('react').JSX.Element;
12
+ declare const Text: ({ ref, content, className, title }: TextProps) => import('react').JSX.Element;
8
13
  declare const _default: {
9
14
  (props: import('../../../Element/hocs/withElement').WithElementProps<TextProps>): import('react').JSX.Element;
10
15
  displayName: string;
@@ -7,15 +7,16 @@ import { jsx as s, jsxs as c } from "react/jsx-runtime";
7
7
  import l from "clsx";
8
8
  import u from "@plitzi/plitzi-ui/ContentEditable";
9
9
  //#region src/elements/basic/Text/Text.tsx
10
- var d = ({ ref: e, content: d = "Text", className: f = "" }) => {
11
- let { id: p } = t(), { settings: { previewMode: m }, contexts: { BuilderContext: h } } = o(), g = h ? r(h) : void 0, _ = a(() => typeof d != "string" && typeof d != "number" ? JSON.stringify(d) : !d && d !== "" && !m ? "Text" : typeof d == "number" ? `${d}` : d, [d, m]), v = i((e) => g?.updateElement(p, "content", e), [g, p]);
10
+ var d = ({ ref: e, content: d = "Text", className: f = "", title: p = "" }) => {
11
+ let { id: m } = t(), { settings: { previewMode: h }, contexts: { BuilderContext: g } } = o(), _ = g ? r(g) : void 0, v = a(() => typeof d != "string" && typeof d != "number" ? JSON.stringify(d) : !d && d !== "" && !h ? "Text" : typeof d == "number" ? `${d}` : d, [d, h]), y = i((e) => _?.updateElement(m, "content", e), [_, m]);
12
12
  return /* @__PURE__ */ c(n, {
13
13
  ref: e,
14
14
  className: l("plitzi-component__text", f),
15
- children: [m && _, !m && /* @__PURE__ */ s(u, {
15
+ title: p || void 0,
16
+ children: [h && v, !h && /* @__PURE__ */ s(u, {
16
17
  className: "focus-visible:outline-hidden",
17
- value: _,
18
- onChange: v,
18
+ value: v,
19
+ onChange: y,
19
20
  openMode: "doubleClick"
20
21
  })]
21
22
  });
@@ -54,6 +54,7 @@ declare const declaration: {
54
54
  readonly settings: {};
55
55
  };
56
56
  } & import('@plitzi/sdk-shared/authoring/declare').ElementAttributesBrand<Partial<{
57
+ title?: string | undefined;
57
58
  content?: string | number | undefined;
58
59
  }>>;
59
60
  export default declaration;
@@ -53,6 +53,7 @@ declare const Text: {
53
53
  readonly settings: {};
54
54
  };
55
55
  } & import('@plitzi/sdk-shared/authoring/declare').ElementAttributesBrand<Partial<{
56
+ title?: string | undefined;
56
57
  content?: string | number | undefined;
57
58
  }>>;
58
59
  export default Text;