@automattic/agenttic-ui 0.1.75 → 0.1.76

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.
@@ -22,17 +22,17 @@ export declare function createChartBlock(config?: ChartConfig): (props: CodeProp
22
22
  accessKey?: string | undefined;
23
23
  autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {});
24
24
  autoFocus?: boolean | undefined;
25
- contentEditable?: (boolean | "false" | "true") | "inherit" | "plaintext-only" | undefined;
25
+ contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
26
26
  contextMenu?: string | undefined;
27
27
  dir?: string | undefined;
28
- draggable?: (boolean | "false" | "true") | undefined;
28
+ draggable?: (boolean | "true" | "false") | undefined;
29
29
  enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined;
30
30
  hidden?: boolean | undefined;
31
31
  id?: string | undefined;
32
32
  lang?: string | undefined;
33
33
  nonce?: string | undefined;
34
34
  slot?: string | undefined;
35
- spellCheck?: (boolean | "false" | "true") | undefined;
35
+ spellCheck?: (boolean | "true" | "false") | undefined;
36
36
  style?: React.CSSProperties | undefined;
37
37
  tabIndex?: number | undefined;
38
38
  title?: string | undefined;
@@ -66,11 +66,11 @@ export declare function createChartBlock(config?: ChartConfig): (props: CodeProp
66
66
  exportparts?: string | undefined;
67
67
  part?: string | undefined;
68
68
  "aria-activedescendant"?: string | undefined;
69
- "aria-atomic"?: (boolean | "false" | "true") | undefined;
69
+ "aria-atomic"?: (boolean | "true" | "false") | undefined;
70
70
  "aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined;
71
71
  "aria-braillelabel"?: string | undefined;
72
72
  "aria-brailleroledescription"?: string | undefined;
73
- "aria-busy"?: (boolean | "false" | "true") | undefined;
73
+ "aria-busy"?: (boolean | "true" | "false") | undefined;
74
74
  "aria-checked"?: boolean | "false" | "mixed" | "true" | undefined;
75
75
  "aria-colcount"?: number | undefined;
76
76
  "aria-colindex"?: number | undefined;
@@ -81,37 +81,37 @@ export declare function createChartBlock(config?: ChartConfig): (props: CodeProp
81
81
  "aria-describedby"?: string | undefined;
82
82
  "aria-description"?: string | undefined;
83
83
  "aria-details"?: string | undefined;
84
- "aria-disabled"?: (boolean | "false" | "true") | undefined;
84
+ "aria-disabled"?: (boolean | "true" | "false") | undefined;
85
85
  "aria-dropeffect"?: "none" | "copy" | "execute" | "link" | "move" | "popup" | undefined;
86
86
  "aria-errormessage"?: string | undefined;
87
- "aria-expanded"?: (boolean | "false" | "true") | undefined;
87
+ "aria-expanded"?: (boolean | "true" | "false") | undefined;
88
88
  "aria-flowto"?: string | undefined;
89
- "aria-grabbed"?: (boolean | "false" | "true") | undefined;
89
+ "aria-grabbed"?: (boolean | "true" | "false") | undefined;
90
90
  "aria-haspopup"?: boolean | "false" | "true" | "menu" | "listbox" | "tree" | "grid" | "dialog" | undefined;
91
- "aria-hidden"?: (boolean | "false" | "true") | undefined;
91
+ "aria-hidden"?: (boolean | "true" | "false") | undefined;
92
92
  "aria-invalid"?: boolean | "false" | "true" | "grammar" | "spelling" | undefined;
93
93
  "aria-keyshortcuts"?: string | undefined;
94
94
  "aria-label"?: string | undefined;
95
95
  "aria-labelledby"?: string | undefined;
96
96
  "aria-level"?: number | undefined;
97
97
  "aria-live"?: "off" | "assertive" | "polite" | undefined;
98
- "aria-modal"?: (boolean | "false" | "true") | undefined;
99
- "aria-multiline"?: (boolean | "false" | "true") | undefined;
100
- "aria-multiselectable"?: (boolean | "false" | "true") | undefined;
98
+ "aria-modal"?: (boolean | "true" | "false") | undefined;
99
+ "aria-multiline"?: (boolean | "true" | "false") | undefined;
100
+ "aria-multiselectable"?: (boolean | "true" | "false") | undefined;
101
101
  "aria-orientation"?: "horizontal" | "vertical" | undefined;
102
102
  "aria-owns"?: string | undefined;
103
103
  "aria-placeholder"?: string | undefined;
104
104
  "aria-posinset"?: number | undefined;
105
105
  "aria-pressed"?: boolean | "false" | "mixed" | "true" | undefined;
106
- "aria-readonly"?: (boolean | "false" | "true") | undefined;
106
+ "aria-readonly"?: (boolean | "true" | "false") | undefined;
107
107
  "aria-relevant"?: "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text" | "text additions" | "text removals" | undefined;
108
- "aria-required"?: (boolean | "false" | "true") | undefined;
108
+ "aria-required"?: (boolean | "true" | "false") | undefined;
109
109
  "aria-roledescription"?: string | undefined;
110
110
  "aria-rowcount"?: number | undefined;
111
111
  "aria-rowindex"?: number | undefined;
112
112
  "aria-rowindextext"?: string | undefined;
113
113
  "aria-rowspan"?: number | undefined;
114
- "aria-selected"?: (boolean | "false" | "true") | undefined;
114
+ "aria-selected"?: (boolean | "true" | "false") | undefined;
115
115
  "aria-setsize"?: number | undefined;
116
116
  "aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined;
117
117
  "aria-valuemax"?: number | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/utils/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe;;;;;;;;CAQlB,CAAC;AAKX,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBjB,CAAC;AAKX,wBAAgB,uBAAuB,CACtC,SAAS,EAAE,OAAO,GAAG,YAAY,GAAG,UAAU,GAC5C,CAAE,OAAO,cAAc,CAAE,CAAE,MAAM,CAAE,EAAE,CAcvC;AAED,eAAO,MAAM,cAAc;;;;;;;;CAcjB,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/utils/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe;;;;;;;;CAQlB,CAAC;AAKX,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBjB,CAAC;AAKX,wBAAgB,uBAAuB,CACtC,SAAS,EAAE,OAAO,GAAG,YAAY,GAAG,UAAU,GAC5C,CAAE,OAAO,cAAc,CAAE,CAAE,MAAM,CAAE,EAAE,CAcvC;AAED,eAAO,MAAM,cAAc;;;;;;;;CAejB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automattic/agenttic-ui",
3
- "version": "0.1.75",
3
+ "version": "0.1.76",
4
4
  "type": "module",
5
5
  "description": "UI components for the Agenttic framework",
6
6
  "main": "dist/index.js",
@@ -1,242 +0,0 @@
1
- import { jsxs as u, jsx as t } from "react/jsx-runtime";
2
- import { __ as f } from "@wordpress/i18n";
3
- import "react";
4
- import './DiffCard.css';function d(...e) {
5
- return e.flat().filter(Boolean).map((s) => typeof s == "string" ? s : typeof s == "object" && !Array.isArray(s) && s !== null ? Object.entries(s).filter(([a, o]) => o).map(([a]) => a).join(" ") : "").join(" ").trim();
6
- }
7
- const N = "SourcesCard-module_card", D = "SourcesCard-module_heading", v = "SourcesCard-module_list", j = "SourcesCard-module_item", Q = "SourcesCard-module_title", $ = "SourcesCard-module_label", r = {
8
- card: N,
9
- heading: D,
10
- list: v,
11
- item: j,
12
- title: Q,
13
- label: $
14
- };
15
- function ae({ sources: e, className: s }) {
16
- return e != null && e.length ? /* @__PURE__ */ u(
17
- "section",
18
- {
19
- className: d(r.card, s),
20
- "data-agenttic-sources-card": !0,
21
- "data-slot": "sources",
22
- children: [
23
- /* @__PURE__ */ t("p", { className: r.heading, "data-slot": "heading", children: f("Sources", "a8c-agenttic") }),
24
- /* @__PURE__ */ t("ul", { className: r.list, "data-slot": "list", children: e.map((a, o) => {
25
- const n = a.title || a.url || a.label || f("Untitled source", "a8c-agenttic"), m = a.id || a.url || `${n}-${o}`;
26
- return /* @__PURE__ */ u(
27
- "li",
28
- {
29
- className: r.item,
30
- "data-slot": "source",
31
- children: [
32
- a.url ? /* @__PURE__ */ t(
33
- "a",
34
- {
35
- className: r.title,
36
- "data-slot": "title",
37
- href: a.url,
38
- target: "_blank",
39
- rel: "noopener noreferrer",
40
- children: n
41
- }
42
- ) : /* @__PURE__ */ t(
43
- "span",
44
- {
45
- className: r.title,
46
- "data-slot": "title",
47
- children: n
48
- }
49
- ),
50
- a.label ? /* @__PURE__ */ t(
51
- "span",
52
- {
53
- className: r.label,
54
- "data-slot": "label",
55
- children: a.label
56
- }
57
- ) : null
58
- ]
59
- },
60
- m
61
- );
62
- }) })
63
- ]
64
- }
65
- ) : null;
66
- }
67
- const S = "QuestionCard-module_card", q = "QuestionCard-module_question", A = "QuestionCard-module_choices", R = "QuestionCard-module_choicesGrid", w = "QuestionCard-module_choice", k = "QuestionCard-module_answered", G = "QuestionCard-module_label", L = "QuestionCard-module_description", i = {
68
- card: S,
69
- question: q,
70
- choices: A,
71
- choicesGrid: R,
72
- choice: w,
73
- answered: k,
74
- label: G,
75
- description: L
76
- };
77
- function te({
78
- prompt: e,
79
- onAnswer: s,
80
- disabled: a = !1,
81
- answered: o = !1,
82
- answeredChoice: n,
83
- className: m,
84
- renderChoiceContent: h
85
- }) {
86
- const y = a || o, g = e.choices.slice(0, 4);
87
- return /* @__PURE__ */ u(
88
- "section",
89
- {
90
- className: d(i.card, m),
91
- "data-agenttic-question-card": !0,
92
- "data-slot": "card",
93
- children: [
94
- /* @__PURE__ */ t("p", { className: i.question, "data-slot": "question", children: e.question }),
95
- /* @__PURE__ */ t(
96
- "div",
97
- {
98
- className: d(
99
- i.choices,
100
- g.length === 4 ? i.choicesGrid : void 0
101
- ),
102
- "data-slot": "choices",
103
- children: g.map((c, p) => {
104
- const b = c.message ?? c.label, _ = n === b;
105
- return /* @__PURE__ */ u(
106
- "button",
107
- {
108
- type: "button",
109
- "data-slot": "choice",
110
- className: d(
111
- i.choice,
112
- _ ? i.answered : void 0
113
- ),
114
- disabled: y,
115
- "aria-pressed": _ || void 0,
116
- onClick: () => s(b, c),
117
- children: [
118
- /* @__PURE__ */ t("span", { className: i.label, "data-slot": "label", children: c.label }),
119
- c.description ? /* @__PURE__ */ t(
120
- "span",
121
- {
122
- className: i.description,
123
- "data-slot": "description",
124
- children: c.description
125
- }
126
- ) : null,
127
- h == null ? void 0 : h(c)
128
- ]
129
- },
130
- `${c.label}-${p}`
131
- );
132
- })
133
- }
134
- )
135
- ]
136
- }
137
- );
138
- }
139
- const x = "DiffCard-module_card", O = "DiffCard-module_isResolved", B = "DiffCard-module_title", U = "DiffCard-module_summary", z = "DiffCard-module_body", E = "DiffCard-module_change", F = "DiffCard-module_changeLabel", H = "DiffCard-module_diff", I = "DiffCard-module_removed", J = "DiffCard-module_added", K = "DiffCard-module_resolution", M = "DiffCard-module_actions", P = "DiffCard-module_action", T = "DiffCard-module_accept", V = "DiffCard-module_reject", l = {
140
- card: x,
141
- isResolved: O,
142
- title: B,
143
- summary: U,
144
- body: z,
145
- change: E,
146
- changeLabel: F,
147
- diff: H,
148
- removed: I,
149
- added: J,
150
- resolution: K,
151
- actions: M,
152
- action: P,
153
- accept: T,
154
- reject: V
155
- };
156
- function W(e) {
157
- return typeof e == "string" ? [] : Array.isArray(e) ? e : [e];
158
- }
159
- function X(e, s) {
160
- const a = typeof e.original == "string" && e.original.length > 0, o = typeof e.replacement == "string" && e.replacement.length > 0;
161
- return /* @__PURE__ */ u("div", { className: l.change, "data-slot": "change", children: [
162
- e.label ? /* @__PURE__ */ t("span", { className: l.changeLabel, "data-slot": "change-label", children: e.label }) : null,
163
- a ? /* @__PURE__ */ t(
164
- "pre",
165
- {
166
- className: d(l.diff, l.removed),
167
- "data-slot": "original",
168
- children: e.original
169
- }
170
- ) : null,
171
- o ? /* @__PURE__ */ t(
172
- "pre",
173
- {
174
- className: d(l.diff, l.added),
175
- "data-slot": "replacement",
176
- children: e.replacement
177
- }
178
- ) : null
179
- ] }, s);
180
- }
181
- function le({
182
- diff: e,
183
- title: s,
184
- summary: a,
185
- onResolve: o,
186
- disabled: n = !1,
187
- resolved: m,
188
- acceptLabel: h,
189
- rejectLabel: y,
190
- className: g,
191
- renderDiff: c
192
- }) {
193
- const p = !!m, b = n || p, _ = W(e);
194
- let C;
195
- return c ? C = c(e) : typeof e == "string" ? C = /* @__PURE__ */ t("pre", { className: l.diff, "data-slot": "diff", children: e }) : C = _.map(X), /* @__PURE__ */ u(
196
- "section",
197
- {
198
- className: d(
199
- l.card,
200
- p ? l.isResolved : void 0,
201
- g
202
- ),
203
- "data-agenttic-diff-card": !0,
204
- "data-slot": "card",
205
- children: [
206
- s ? /* @__PURE__ */ t("p", { className: l.title, "data-slot": "title", children: s }) : null,
207
- a ? /* @__PURE__ */ t("p", { className: l.summary, "data-slot": "summary", children: a }) : null,
208
- /* @__PURE__ */ t("div", { className: l.body, "data-slot": "body", children: C }),
209
- p ? /* @__PURE__ */ t("p", { className: l.resolution, "data-slot": "resolution", children: m === "accepted" ? f("Accepted", "a8c-agenttic") : f("Rejected", "a8c-agenttic") }) : /* @__PURE__ */ u("div", { className: l.actions, "data-slot": "actions", children: [
210
- /* @__PURE__ */ t(
211
- "button",
212
- {
213
- type: "button",
214
- "data-slot": "accept",
215
- className: d(l.action, l.accept),
216
- disabled: b,
217
- onClick: () => o("accepted"),
218
- children: h ?? f("Accept", "a8c-agenttic")
219
- }
220
- ),
221
- /* @__PURE__ */ t(
222
- "button",
223
- {
224
- type: "button",
225
- "data-slot": "reject",
226
- className: d(l.action, l.reject),
227
- disabled: b,
228
- onClick: () => o("rejected"),
229
- children: y ?? f("Reject", "a8c-agenttic")
230
- }
231
- )
232
- ] })
233
- ]
234
- }
235
- );
236
- }
237
- export {
238
- le as D,
239
- te as Q,
240
- ae as S,
241
- d as c
242
- };