@plitzi/sdk-elements 0.39.3 → 0.39.6

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 (58) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/dist/Element/PluginRemote.mjs +7 -3
  3. package/dist/Element/hooks/useElementState.d.ts +1 -1
  4. package/dist/Element/hooks/useRootElementInteractions.mjs +21 -18
  5. package/dist/components/ElementAdvancedEditor.mjs +4 -4
  6. package/dist/components/MarkdownDocument/MarkdownDocument.mjs +37 -36
  7. package/dist/components/MarkdownDocument/helpers/rehypeTableLabels.d.ts +7 -0
  8. package/dist/components/MarkdownDocument/helpers/rehypeTableLabels.mjs +19 -0
  9. package/dist/components/SettingsSection/SettingsSection.d.ts +19 -0
  10. package/dist/components/SettingsSection/SettingsSection.mjs +37 -0
  11. package/dist/components/SettingsSection/index.d.ts +2 -0
  12. package/dist/components/SettingsSection/index.mjs +1 -0
  13. package/dist/elements/advanced/BlockJsx/declaration.d.ts +1 -1
  14. package/dist/elements/advanced/BlockJsx/declaration.mjs +1 -1
  15. package/dist/elements/advanced/BlockJsx/index.d.ts +1 -1
  16. package/dist/elements/basic/Link/Link.mjs +68 -63
  17. package/dist/elements/basic/Link/Settings.mjs +1 -1
  18. package/dist/elements/basic/Link/usePrefetchInView.d.ts +3 -0
  19. package/dist/elements/basic/Link/usePrefetchInView.mjs +29 -0
  20. package/dist/elements/basic/RichText/Settings.mjs +1 -1
  21. package/dist/elements/declarations/index.d.ts +8 -3
  22. package/dist/elements/form/Form/Form.mjs +1 -1
  23. package/dist/elements/form/FormControl/FormControl.d.ts +7 -1
  24. package/dist/elements/form/FormControl/FormControl.mjs +78 -77
  25. package/dist/elements/form/FormControl/Settings.d.ts +2 -1
  26. package/dist/elements/form/FormControl/Settings.mjs +1 -1
  27. package/dist/elements/form/FormControl/declaration.d.ts +1 -0
  28. package/dist/elements/form/FormControl/declaration.mjs +55 -51
  29. package/dist/elements/form/FormControl/helpers/autofill.d.ts +13 -0
  30. package/dist/elements/form/FormControl/helpers/autofill.mjs +18 -0
  31. package/dist/elements/form/FormControl/index.d.ts +2 -0
  32. package/dist/elements/form/FormControl/inputs/Input.d.ts +2 -1
  33. package/dist/elements/form/FormControl/inputs/Input.mjs +2 -2
  34. package/dist/elements/internal/LayoutContainer/Settings.mjs +1 -1
  35. package/dist/elements/internal/Page/Settings.mjs +323 -285
  36. package/dist/elements/internal/Page/settingsSummary.d.ts +26 -0
  37. package/dist/elements/internal/Page/settingsSummary.mjs +22 -0
  38. package/dist/elements/media/Chart/Chart.mjs +1 -1
  39. package/dist/elements/media/Image/Settings.mjs +2 -2
  40. package/dist/elements/media/Video/Settings.mjs +2 -2
  41. package/dist/elements/provider/ApiContainer/Settings.mjs +6 -6
  42. package/dist/elements/provider/ApiContainer/components/FiltersInput/FiltersInput.mjs +1 -1
  43. package/dist/elements/provider/ApiContainer/hooks/useApi.mjs +20 -19
  44. package/dist/elements/provider/ApiContainer/hooks/useProviderWrite.mjs +20 -19
  45. package/dist/elements/structure/Pagination/Settings.mjs +1 -1
  46. package/dist/elements/structure/TabContainer/TabContainer.mjs +15 -11
  47. package/dist/elements/structure/TabContainer/TabContainerItem/Settings.d.ts +6 -1
  48. package/dist/elements/structure/TabContainer/TabContainerItem/Settings.mjs +24 -3
  49. package/dist/elements/structure/TabContainer/TabContainerItem/TabContainerItem.d.ts +7 -1
  50. package/dist/elements/structure/TabContainer/TabContainerItem/TabContainerItem.mjs +66 -38
  51. package/dist/elements/structure/TabContainer/TabContainerItem/declaration.d.ts +6 -2
  52. package/dist/elements/structure/TabContainer/TabContainerItem/declaration.mjs +1 -1
  53. package/dist/elements/structure/TabContainer/TabContainerItem/index.d.ts +6 -2
  54. package/dist/elements/structure/TabContainer/TabContainerItem/openTabFromHash.d.ts +10 -0
  55. package/dist/elements/structure/TabContainer/TabContainerItem/openTabFromHash.mjs +18 -0
  56. package/dist/elements/structure/TabContainer/index.d.ts +6 -2
  57. package/dist/index.d.ts +8 -3
  58. package/package.json +12 -12
@@ -1,7 +1,8 @@
1
- import { FORM_CONTROL_SUBTYPES as e } from "./subTypes.mjs";
2
- import { elementDeclaration as t } from "@plitzi/sdk-shared/authoring";
1
+ import { AUTOFILL_FIELDS as e } from "./helpers/autofill.mjs";
2
+ import { FORM_CONTROL_SUBTYPES as t } from "./subTypes.mjs";
3
+ import { elementDeclaration as n } from "@plitzi/sdk-shared/authoring";
3
4
  // src/elements/form/FormControl/declaration.ts
4
- var n = {
5
+ var r = {
5
6
  width: "100%",
6
7
  display: "flex",
7
8
  "align-items": "center",
@@ -29,10 +30,10 @@ var n = {
29
30
  "padding-bottom": "8px",
30
31
  outline: "none",
31
32
  position: "relative"
32
- }, r = {
33
- ...n,
34
- "line-height": "20px"
35
33
  }, i = {
34
+ ...r,
35
+ "line-height": "20px"
36
+ }, a = {
36
37
  display: "flex",
37
38
  cursor: "pointer",
38
39
  "font-weight": "600",
@@ -40,22 +41,22 @@ var n = {
40
41
  "line-height": "18px",
41
42
  color: "#6b7280",
42
43
  "user-select": "none"
43
- }, a = {
44
- ...i,
45
- "margin-bottom": "4px"
46
44
  }, o = {
45
+ ...a,
46
+ "margin-bottom": "4px"
47
+ }, s = {
47
48
  display: "block",
48
49
  color: "red",
49
50
  "margin-top": "4px"
50
- }, s = {
51
+ }, c = {
51
52
  color: "red",
52
53
  "margin-left": "4px"
53
- }, c = {
54
+ }, l = {
54
55
  "border-top-style": "none",
55
56
  "border-right-style": "none",
56
57
  "border-bottom-style": "none",
57
58
  "border-left-style": "none"
58
- }, l = {
59
+ }, u = {
59
60
  height: "100%",
60
61
  width: "100%",
61
62
  "padding-top": "0px",
@@ -63,19 +64,19 @@ var n = {
63
64
  "padding-bottom": "0px",
64
65
  "padding-left": "0px",
65
66
  display: "block",
66
- ...c,
67
+ ...l,
67
68
  "background-color": "transparent",
68
69
  color: "inherit",
69
70
  "line-height": "inherit",
70
71
  "font-family": "inherit",
71
72
  "font-size": "inherit",
72
73
  "box-shadow": "none"
73
- }, u = {
74
+ }, d = {
74
75
  height: "100%",
75
76
  width: "100%",
76
77
  "padding-right": "calc(1.15em + 8px)",
77
78
  display: "block",
78
- ...c,
79
+ ...l,
79
80
  "background-color": "transparent",
80
81
  color: "inherit",
81
82
  "line-height": "inherit",
@@ -84,7 +85,7 @@ var n = {
84
85
  appearance: "none",
85
86
  cursor: "inherit",
86
87
  "box-shadow": "none"
87
- }, d = {
88
+ }, f = {
88
89
  height: "100%",
89
90
  "margin-top": "0px",
90
91
  "margin-right": "0px",
@@ -95,7 +96,7 @@ var n = {
95
96
  display: "flex",
96
97
  "justify-content": "center",
97
98
  "align-items": "center",
98
- ...c,
99
+ ...l,
99
100
  "background-color": "transparent",
100
101
  color: "inherit",
101
102
  "line-height": "inherit",
@@ -103,10 +104,10 @@ var n = {
103
104
  "font-size": "inherit",
104
105
  "font-weight": "inherit",
105
106
  cursor: "pointer"
106
- }, f = {
107
- ...n,
108
- cursor: "pointer"
109
107
  }, p = {
108
+ ...r,
109
+ cursor: "pointer"
110
+ }, m = {
110
111
  height: "20px",
111
112
  width: "36px",
112
113
  "margin-top": "0px",
@@ -135,7 +136,7 @@ var n = {
135
136
  transition: "background-color 150ms ease",
136
137
  appearance: "none",
137
138
  cursor: "pointer"
138
- }, m = (e, t, { field: n, icon: r } = {}) => ({
139
+ }, h = (e, t, { field: n, icon: r } = {}) => ({
139
140
  name: e,
140
141
  displayMode: "desktop",
141
142
  style: {
@@ -143,11 +144,11 @@ var n = {
143
144
  input: { default: t },
144
145
  ...n ? { field: { default: n } } : {},
145
146
  ...r ? { icon: { default: r } } : {},
146
- label: { default: a },
147
- requiredMark: { default: s },
148
- error: { default: o }
147
+ label: { default: o },
148
+ requiredMark: { default: c },
149
+ error: { default: s }
149
150
  }
150
- }), h = { field: l }, g = t()({
151
+ }), g = { field: u }, _ = n()({
151
152
  type: "formControl",
152
153
  contentAttributes: [
153
154
  "label",
@@ -162,7 +163,10 @@ var n = {
162
163
  "patternMessage",
163
164
  "matchesMessage"
164
165
  ],
165
- attributeValues: { subType: e },
166
+ attributeValues: {
167
+ subType: t,
168
+ autoComplete: e
169
+ },
166
170
  triggers: { onChange: {
167
171
  action: "onChange",
168
172
  title: "On Change",
@@ -225,28 +229,28 @@ var n = {
225
229
  defaultStyle: {
226
230
  style: { base: { default: {} } },
227
231
  subTypes: {
228
- hidden: m("Form Control Hidden", {}),
229
- text: m("Form Control Text", r, h),
230
- number: m("Form Control Number", r, h),
231
- email: m("Form Control Email", r, h),
232
- password: m("Form Control Password", r, {
233
- ...h,
234
- icon: d
232
+ hidden: h("Form Control Hidden", {}),
233
+ text: h("Form Control Text", i, g),
234
+ number: h("Form Control Number", i, g),
235
+ email: h("Form Control Email", i, g),
236
+ password: h("Form Control Password", i, {
237
+ ...g,
238
+ icon: f
235
239
  }),
236
- search: m("Form Control Search", r, h),
237
- url: m("Form Control URL", r, h),
238
- tel: m("Form Control Phone", r, h),
239
- date: m("Form Control Date", r, h),
240
- time: m("Form Control Time", r, h),
241
- color: m("Form Control Color", r, h),
242
- file: m("Form Control File", r, h),
243
- textarea: m("Form Control Textarea", {
244
- ...r,
240
+ search: h("Form Control Search", i, g),
241
+ url: h("Form Control URL", i, g),
242
+ tel: h("Form Control Phone", i, g),
243
+ date: h("Form Control Date", i, g),
244
+ time: h("Form Control Time", i, g),
245
+ color: h("Form Control Color", i, g),
246
+ file: h("Form Control File", i, g),
247
+ textarea: h("Form Control Textarea", {
248
+ ...i,
245
249
  color: "inherit",
246
250
  "font-family": "inherit",
247
251
  resize: "vertical"
248
252
  }),
249
- select: m("Form Control Select", f, { field: u }),
253
+ select: h("Form Control Select", p, { field: d }),
250
254
  checkbox: {
251
255
  name: "Form Control Checkbox",
252
256
  displayMode: "desktop",
@@ -258,9 +262,9 @@ var n = {
258
262
  "margin-left": "0px",
259
263
  "margin-right": "4px"
260
264
  } },
261
- label: { default: i },
262
- requiredMark: { default: s },
263
- error: { default: o }
265
+ label: { default: a },
266
+ requiredMark: { default: c },
267
+ error: { default: s }
264
268
  }
265
269
  },
266
270
  switch: {
@@ -268,17 +272,17 @@ var n = {
268
272
  displayMode: "desktop",
269
273
  style: {
270
274
  base: { default: {} },
271
- input: { default: p },
275
+ input: { default: m },
272
276
  label: { default: {
273
- ...i,
277
+ ...a,
274
278
  "align-items": "center"
275
279
  } },
276
- requiredMark: { default: s },
277
- error: { default: o }
280
+ requiredMark: { default: c },
281
+ error: { default: s }
278
282
  }
279
283
  }
280
284
  }
281
285
  }
282
286
  }
283
287
  });
284
- export { g as default };
288
+ export { _ as default };
@@ -0,0 +1,13 @@
1
+ /**
2
+ * What a field holds, as a browser and a password manager read `autocomplete` (WHATWG autofill tokens) — the ones a
3
+ * sign-in, a sign-up and a contact form use. A password field said `off` for every space, so no password manager
4
+ * filled a sign-in or offered to save a new password.
5
+ */
6
+ export declare const AUTOFILL_FIELDS: readonly ["username", "current-password", "new-password", "one-time-code", "email", "name", "given-name", "family-name", "organization", "tel", "street-address", "postal-code", "country", "url"];
7
+ export type AutofillField = (typeof AUTOFILL_FIELDS)[number];
8
+ /**
9
+ * The `autocomplete` an input is drawn with: `true` leaves it to the browser — the account's current password, on a
10
+ * password field — `false` asks it not to fill, and a token names what the field holds. In the builder's canvas a field
11
+ * is never filled: what is being designed is not a sign-in.
12
+ */
13
+ export declare const autocompleteOf: (autoComplete: boolean | AutofillField, subType: string, live: boolean) => string;
@@ -0,0 +1,18 @@
1
+ // src/elements/form/FormControl/helpers/autofill.ts
2
+ var e = [
3
+ "username",
4
+ "current-password",
5
+ "new-password",
6
+ "one-time-code",
7
+ "email",
8
+ "name",
9
+ "given-name",
10
+ "family-name",
11
+ "organization",
12
+ "tel",
13
+ "street-address",
14
+ "postal-code",
15
+ "country",
16
+ "url"
17
+ ], t = (e, t, n) => !n || e === !1 ? "off" : e === !0 ? t === "password" ? "current-password" : "on" : e;
18
+ export { e as AUTOFILL_FIELDS, t as autocompleteOf };
@@ -789,6 +789,7 @@ declare const FormControl: import('react').FC<import('../../..').WithElementProp
789
789
  contentAttributes: readonly ["label", "placeholder", "options", "requiredMessage", "minLengthMessage", "maxLengthMessage", "minMessage", "maxMessage", "formatMessage", "patternMessage", "matchesMessage"];
790
790
  attributeValues: {
791
791
  readonly subType: readonly ["text", "number", "email", "password", "search", "url", "tel", "date", "time", "checkbox", "switch", "select", "textarea", "hidden", "color", "file"];
792
+ readonly autoComplete: readonly ["username", "current-password", "new-password", "one-time-code", "email", "name", "given-name", "family-name", "organization", "tel", "street-address", "postal-code", "country", "url"];
792
793
  };
793
794
  triggers: {
794
795
  readonly onChange: {
@@ -805,3 +806,4 @@ declare const FormControl: import('react').FC<import('../../..').WithElementProp
805
806
  __attributes: import('./declaration').FormControlAttributes;
806
807
  };
807
808
  export default FormControl;
809
+ export type { AutofillField } from './helpers/autofill';
@@ -10,7 +10,8 @@ export type InputProps = {
10
10
  placeholder?: string;
11
11
  value?: string;
12
12
  type?: string;
13
- autoComplete?: boolean;
13
+ /** The `autocomplete` attribute as it is written: `off`, `on` or a token (`autocompleteOf`). */
14
+ autoComplete?: string;
14
15
  /** Takes the focus while true: as it becomes true, whether on mount or as the field is shown again. */
15
16
  autoFocus?: boolean;
16
17
  required?: boolean;
@@ -4,7 +4,7 @@ import { useCallback as n, useRef as r, useState as i } from "react";
4
4
  import { jsx as a, jsxs as o } from "react/jsx-runtime";
5
5
  import s from "clsx";
6
6
  // src/elements/form/FormControl/inputs/Input.tsx
7
- var c = ({ className: c = "", fieldClassName: l, iconClassName: u, id: d = "", name: f = "", placeholder: p = "", value: m = "", type: h = "text", autoComplete: g = !1, autoFocus: _ = !1, required: v = !0, maxLength: y = 0, min: b = "", max: x = "", step: S = "", disabled: C = !1, readOnly: w = !1, onChange: T, onValidate: E, errorId: D }) => {
7
+ var c = ({ className: c = "", fieldClassName: l, iconClassName: u, id: d = "", name: f = "", placeholder: p = "", value: m = "", type: h = "text", autoComplete: g = "off", autoFocus: _ = !1, required: v = !0, maxLength: y = 0, min: b = "", max: x = "", step: S = "", disabled: C = !1, readOnly: w = !1, onChange: T, onValidate: E, errorId: D }) => {
8
8
  let [O, k] = i(!1), A = r(null);
9
9
  e(A, _);
10
10
  let j = n(() => k((e) => !e), [k]), M = n((e) => {
@@ -31,7 +31,7 @@ var c = ({ className: c = "", fieldClassName: l, iconClassName: u, id: d = "", n
31
31
  min: h === "number" && b !== "" ? b : void 0,
32
32
  max: h === "number" && x !== "" ? x : void 0,
33
33
  step: h === "number" && S !== "" ? S : void 0,
34
- autoComplete: g ? "on" : "off",
34
+ autoComplete: g,
35
35
  disabled: C,
36
36
  readOnly: w,
37
37
  onChange: T,
@@ -77,7 +77,7 @@ var c = ({ id: c, layout: l = "", layoutContainer: u = "", subType: d = "div", f
77
77
  onUpdate: p
78
78
  }),
79
79
  /* @__PURE__ */ i("span", {
80
- className: "text-xs text-gray-500 dark:text-zinc-400",
80
+ className: "text-ui-fg-subtle text-xs",
81
81
  children: "A layout can sit inside another one: pages using this layout are shown inside it, and it inside the one picked here — the outer shell stays mounted while moving between pages that share it."
82
82
  })
83
83
  ]