@aastrika/ai-elements 0.4.1 → 0.5.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.
package/CHANGELOG.md CHANGED
@@ -6,6 +6,107 @@ see at a glance what to expect when they upgrade.
6
6
  Versions follow semver: a **minor** adds something, a **patch** fixes something,
7
7
  and neither removes anything a host was using.
8
8
 
9
+ ## 0.5.0
10
+
11
+ A visual pass over all three elements. Nothing a host calls has changed — same
12
+ tags, same attributes, same events — but the elements look different, so this is
13
+ a minor rather than a patch.
14
+
15
+ **Changed**
16
+ - The accent is blue (`#0EA5E9`), not gold. A host that sets `--aastrika-primary`
17
+ already overrides it and sees no change; a host that took our default gets the
18
+ new one
19
+ - Neutrals are cool rather than warm, so the elements sit on a white or pale
20
+ page without a cream cast
21
+ - A type scale replaces ad-hoc sizes, and one easing curve replaces four
22
+ durations written out by hand
23
+ - Cards, fields and buttons share one raised treatment: a hairline inside the
24
+ edge, a layered shadow, a 12-18px radius
25
+ - Tables in Reports lay out to a fixed width, so a long content title wraps in
26
+ its own column instead of pushing the action buttons off the row. The actions
27
+ column is sized to hold its buttons, and they sit on the row's centre line
28
+ like every other cell
29
+ - Assessment takes its material on one surface. Pasting links and choosing
30
+ files are two ways of saying the same thing, so they share a control, and
31
+ *Read sources* — which consumes both — sits on its toolbar. The picker and
32
+ the button used to stand side by side at the same size, which read as a
33
+ choice between them
34
+ - The file dropzone's label sits with its icon at the start of the zone rather
35
+ than centred in it, so a wide card no longer shows a small label marooned in
36
+ a lot of empty space
37
+ - Each step's number is joined to the next by a hairline, and step titles are
38
+ set as headings rather than at body size, so the card stack reads as a
39
+ sequence rather than as separate panels
40
+ - The heading scale: a 12px eyebrow and a 16px lead paragraph around the title.
41
+ At 11 and 14 the step from the title to the sentence under it was large
42
+ enough that the sentence read as small print
43
+
44
+ **Fixed**
45
+ - A step that is not your turn yet is readable. It was faded with `opacity`,
46
+ which multiplies through every child and took the headings to roughly 2:1
47
+ contrast — that reads as broken rather than as pending. The surface recedes
48
+ now; the words do not
49
+ - A disabled button, input or select keeps legible text. Browsers grey a
50
+ disabled control's own text with a colour that is not ours, so on a form that
51
+ starts disabled the labels were harder to read than the placeholder beside
52
+ them
53
+ - The main action of a step is readable while it waits. It was white text on a
54
+ 38% tint — about 1.9:1 — so the one button the card is asking you to press
55
+ was the least visible thing on it
56
+ - Cards show the depth they were given. A second rule later in the stylesheet
57
+ replaced the layered shadow with a 1px one, so every card rendered flat
58
+
59
+ **Added**
60
+ - `heading="off"` hides an element's own eyebrow and title, for a host that
61
+ already names the screen in its own chrome. The description is kept either
62
+ way. Defaults to `"on"`, so a host that says nothing sees no change
63
+ - `<aa-icon>` draws the 16 glyphs the elements use as inline SVG, stroked in
64
+ `currentColor`. No icon font, no sprite sheet, no network request
65
+ - Content Studio names the stage of a plan while it runs, with elapsed seconds
66
+ and a bar. A plan takes about a minute; with no feedback the page read as hung
67
+ - `--aastrika-danger`, `--aastrika-danger-line`, `--aastrika-danger-bg` and
68
+ `--aastrika-console-bg` / `--aastrika-console-fg` make the error and log
69
+ colours themeable. They were hardcoded, so a host on a dark page could not
70
+ reach them
71
+ - Every animation is behind `prefers-reduced-motion`
72
+
73
+ **Unchanged**
74
+ - `--aastrika-gold`, `--aastrika-gold-soft` and `--aastrika-gold-deep` still
75
+ work. They now alias the primary set and are removed at 1.0
76
+
77
+ ## 0.4.2
78
+
79
+ **Fixed**
80
+ - The elements now bring their own typeface, text colour and block layout. They
81
+ read `--aastrika-font`, which was documented as the way to set the typeface
82
+ but was never actually applied, so on a host with no font of its own the whole
83
+ feature rendered in the browser's serif default
84
+ - Buttons, inputs and selects inherit that typeface too. Browsers give form
85
+ controls a font of their own, so they stayed in the browser's face even where
86
+ the surrounding text was right
87
+ - The style picker fits as many cards as the width allows instead of always two,
88
+ so a card no longer stretches to hold one very long line on a wide screen
89
+ - The file dropzone keeps the shape of a target rather than stretching into a
90
+ letterbox with its label marooned in the middle
91
+ - Content Studio locks its form while a plan or a production is running. The
92
+ fields stayed editable, so a change made mid-run looked accepted but went
93
+ nowhere — the request had already left
94
+ - A `creator-filter` of only spaces is treated as no filter, rather than
95
+ filtering the report to a creator who cannot exist
96
+ - "Create **an** assessment", not "a"
97
+
98
+ **Added**
99
+ - `--aastrika-max-width` sets how wide a feature runs. It replaces a fixed
100
+ 860px, which a host could only override by reaching into our class names
101
+ - `--aastrika-primary`, `--aastrika-primary-soft`, `--aastrika-primary-deep` and
102
+ `--aastrika-on-primary` name the accent by its role. `--aastrika-gold*` still
103
+ work and now point at these, so nothing needs changing until 1.0
104
+
105
+ **Unchanged**
106
+ - The default palette resolves to exactly the same colours as 0.4.1. The two
107
+ accent variants stay literal rather than mixed from the primary, because no
108
+ mix reproduces them — deriving would have quietly restyled every consumer
109
+
9
110
  ## 0.4.1
10
111
 
11
112
  **Fixed**
package/README.md CHANGED
@@ -274,6 +274,23 @@ Three values. That is the whole contract.
274
274
  | `creator` | **required** | Who is signed into *your* app. A name or email, shown as-is in the usage report |
275
275
  | `onError` | optional | Called whenever a request fails, so your monitoring hears about it |
276
276
 
277
+ **Pick the `creator` value with some care.** It is stamped on the content when
278
+ it is made and never changes afterwards, it is what the usage report groups by,
279
+ and it is shown to whoever reads that report. So it wants to be a person's name
280
+ — "Asha Kumari" reads well, and a login handle or an id does not.
281
+
282
+ Two traps worth knowing, both met in the wild:
283
+
284
+ - **A login handle is not a name.** `creatoruser_if0d` is unreadable, and if you
285
+ switch to it later, the report treats it as a different person from the name
286
+ the same user's earlier content was filed under.
287
+ - **Check your email field is not masked.** Some portals return
288
+ `cr********@yopmail.com` from their profile API. Every user then files content
289
+ under a near-identical string, and the report cannot tell them apart.
290
+
291
+ Returning `null` is a fair answer when you have no good name: the service
292
+ applies its own default rather than recording something meaningless.
293
+
277
294
  ### Why two of them are functions
278
295
 
279
296
  Tokens expire. A string handed over at startup stops working mid-session, and
@@ -388,6 +405,19 @@ All are **starting values** the user can still change.
388
405
  | | `default-difficulty` | `mixed`, `easy`, `medium`, `hard` |
389
406
  | | `default-translate-into` | Also produce the same questions in these languages, comma-separated: `"ta,or,bn"` |
390
407
  | `reports` | `creator-filter` | Opens filtered to one creator |
408
+ | *all three* | `heading` | `off` hides the element's own eyebrow and title. Defaults to `on` |
409
+
410
+ **`heading="off"`** is for a host whose own chrome already names the screen — a
411
+ breadcrumb or a tab bar — where the element's title would say it a second time.
412
+ The description under the title is kept either way: it says what the feature
413
+ does, which a breadcrumb does not. Use it instead of hiding the title with CSS;
414
+ our class names are ours to rename, and a stylesheet reaching in breaks silently
415
+ when they change.
416
+
417
+ ```html
418
+ <!-- your page already shows "AI Studio › Assessment Creation" -->
419
+ <aastrika-assessment heading="off"></aastrika-assessment>
420
+ ```
391
421
 
392
422
  ```html
393
423
  <aastrika-content-studio default-language="kn" default-aspect-ratio="9:16">
@@ -74,6 +74,15 @@ export declare const ready: Promise<unknown>;
74
74
 
75
75
  /** `<aastrika-content-studio>` — a document becomes a narrated training video. */
76
76
  interface AastrikaContentStudioElement extends HTMLElement {
77
+ /**
78
+ * `'off'` hides the element's own eyebrow and title. Defaults to `'on'`.
79
+ *
80
+ * For a host that already names the screen in its own chrome — a breadcrumb,
81
+ * a tab bar — where the element's heading would say it a second time. The
82
+ * description below the title is kept either way: it says what the feature
83
+ * does, which a breadcrumb does not.
84
+ */
85
+ heading?: 'on' | 'off';
77
86
  /**
78
87
  * `'on'` shows the segment editor for an uploaded video. Defaults to `'off'`.
79
88
  *
@@ -117,6 +126,15 @@ interface AastrikaContentStudioElement extends HTMLElement {
117
126
 
118
127
  /** `<aastrika-assessment>` — source material becomes a validated MCQ set. */
119
128
  interface AastrikaAssessmentElement extends HTMLElement {
129
+ /**
130
+ * `'off'` hides the element's own eyebrow and title. Defaults to `'on'`.
131
+ *
132
+ * For a host that already names the screen in its own chrome — a breadcrumb,
133
+ * a tab bar — where the element's heading would say it a second time. The
134
+ * description below the title is kept either way: it says what the feature
135
+ * does, which a breadcrumb does not.
136
+ */
137
+ heading?: 'on' | 'off';
120
138
  /** Language the form opens on. */
121
139
  defaultLanguage?: string;
122
140
  /** How many questions to ask for. */
@@ -157,6 +175,15 @@ interface AastrikaAssessmentElement extends HTMLElement {
157
175
 
158
176
  /** `<aastrika-reports>` — usage and spend. Needs `contentAdmin` at the gateway. */
159
177
  interface AastrikaReportsElement extends HTMLElement {
178
+ /**
179
+ * `'off'` hides the element's own eyebrow and title. Defaults to `'on'`.
180
+ *
181
+ * For a host that already names the screen in its own chrome — a breadcrumb,
182
+ * a tab bar — where the element's heading would say it a second time. The
183
+ * description below the title is kept either way: it says what the feature
184
+ * does, which a breadcrumb does not.
185
+ */
186
+ heading?: 'on' | 'off';
160
187
  /** Opens filtered to one creator. The user can still clear it. */
161
188
  creatorFilter?: string;
162
189