cedar-embeddable-designer 0.0.0-stage → 0.1.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 ADDED
@@ -0,0 +1,360 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.1.0] - 2026-11-09
9
+
10
+ Aligns with `cedar-model-typescript-library@1.0.27`.
11
+
12
+ - First public release of `<cedar-embeddable-designer>`, a Web Component for authoring CEDAR templates and elements. It takes a document as `artifact` and endpoints as `config`, and reports each edit as `artifactChange`.
13
+ - Includes `<cedar-embeddable-field-designer>` (CEFD), a standalone field definition editor that shares CED's controls, for a host that edits one field at a time.
14
+ - `validateArtifact` gives the CEDAR meta-schema's verdict on any schema artifact, and `validationReport.superseded` lists the stored shapes a loaded artifact's projection replaced.
15
+ - Offers English and Hungarian through a `language` property, a host-fonts bundle for pages that register CEDAR Roboto themselves, and keyboard, focus and screen-reader behaviour checked with axe-core against WCAG 2.2 A and AA.
16
+
17
+ ### Added
18
+
19
+ - `cedar-embeddable-designer.host-fonts.js`, with `bundle-manifest.host-fonts.json`: the same
20
+ elements without the embedded CEDAR Roboto faces, for a host that registers them for its whole
21
+ page. The CEDAR Template Designer page loads CEE, the term picker and CED together, and each
22
+ embedded the same faces. The standalone bundle is unchanged.
23
+ - `validateArtifact(artifact, kind?)` on both elements: the CEDAR meta-schema's verdict on any
24
+ schema artifact. A host can check the exact payload it saves with the validator CED already
25
+ carries, rather than loading its own copy.
26
+ - `validationReport.superseded`: the stored shapes CED's projection replaced when an artifact
27
+ was loaded and the CEDAR validator refuses, each with its location and the value the projection
28
+ holds, so that a host merging the projection into the stored artifact stops retaining them.
29
+ Tests cover every shape in every placement, in standalone fields and across the production corpus.
30
+ - CEFD (`cedar-embeddable-field-designer`) in the CED bundle: a standalone field
31
+ definition editor sharing CED's controls, with JSON/YAML loading, all field
32
+ types, validation and dirty events, isolated instances and host read-only mode,
33
+ which the host explains, as it does for CED. Container placement controls remain
34
+ in CED. The host owns repository saves.
35
+ - CEFD contract, field-type round-trip, metadata preservation and browser tests;
36
+ split Designer coverage for standalone field creation, updates and stale saves.
37
+ - English and Hungarian. Both elements take a `language` property and attribute
38
+ (`'en'` or `'hu'`; anything else selects English), which may change at runtime.
39
+ Each element owns its own `@ngx-translate/core` service, so designers on one page
40
+ can differ. The language is passed to the embedded term picker and to CEE, and
41
+ dates use the matching locale. English text is unchanged.
42
+ - Tests that hold the two language maps to the same keys and that fail when a
43
+ template or message states user-visible text outside them.
44
+ - One polite live region in each element, present from the first render. It announces
45
+ an applied constraint set ("Disease now has 2 constraints."), a cleared default, a
46
+ chosen default term, a new or cleared set of host findings, and a move in the
47
+ Overview, in English or Hungarian. Errors keep their alerts.
48
+ - Browser specs that run axe-core for WCAG 2.2 levels A and AA over every reachable
49
+ state, pin each surface's Tab order, check where focus lands after each action, and
50
+ read the live region after each announced event.
51
+
52
+ ### Changed
53
+
54
+ - Drag handles draw the shared `drag` grip instead of the `list` icon, in the canvas, the
55
+ Overview, the field library and the child picker. On a field or element card the handle
56
+ sits in the bottom-right corner, under the delete button and level with the settings
57
+ chevron. A field's type moves to the centre of its header, over the chevron, where the
58
+ handle was. An element keeps its centred Element label, and its children toggle moves one
59
+ icon left to leave the corner to the handle. The template header shows Template in the
60
+ same place.
61
+ - A child's settings open on a new Configuration tab, which holds how its parent places
62
+ it. The display name and a wider display description share its first row. The
63
+ requirement select follows with Hidden and Continue previous line, each where the
64
+ child can carry it. Allow multiple sits above the minimum and maximum, which share a
65
+ row with the key, and the property IRI comes last. The display name and description
66
+ are the parent's `_ui.propertyLabels` and `_ui.propertyDescriptions` entries, and the
67
+ card header shows and edits the display name. A nested element's header gives its name
68
+ input the accessible name Element display name. The requirement select and the Allow
69
+ multiple checkbox leave the card header, the key and the property IRI leave the
70
+ metadata tabs, and the Occurrences tab is retired. The bounds stay visible and
71
+ disabled until Allow multiple is on.
72
+ - The Presentation tab, formerly Display, edits the child's own name and description,
73
+ its `schema:name` and `schema:description`, under the labels Field name and Field
74
+ description or Element name and Element description. While the author first names a
75
+ new child, its display name and its name are one value, and an edit on either side
76
+ writes both. Once the name first loses focus, an edit to the display name changes only
77
+ the display name, and the child's name and key stay as they are. Its two descriptions
78
+ are one value in the same way, until the description first loses focus. An imported or
79
+ library child takes its display name and display description from its own once and
80
+ keeps each pair apart from the start. An edit from Presentation still changes what a
81
+ parent that shows the child as itself displays. A named child's display name cannot be
82
+ cleared. While its input is blank, the header reports that a display name is required,
83
+ and the template keeps the previous display name. A parent that shows the child
84
+ differently keeps doing so. The designer no longer writes `skos:prefLabel`, except to
85
+ keep one that only repeated the name moving with it. Every profile shows that
86
+ description, so the Show Help text preference, which hid the separate help text input
87
+ it replaces, is retired.
88
+ - The metadata tab of a field, an element and a template is labelled Metadata.
89
+ - A new child's key is its name as written, and follows the name until the name first
90
+ loses focus. An imported or library child takes its name as its key. A key that
91
+ clashes or is reserved is reported at once instead of being renamed with a suffix, and
92
+ the child keeps a usable key until the author chooses one. The fields a new template
93
+ starts with are keyed by their names.
94
+ - A published field or element keeps its own definition while its parent configures,
95
+ renames, reorders and removes it. Everything inside a published element is locked, its
96
+ children's placement included, and nothing can be added to it.
97
+ - `CedValidationIssue.tab` reports `Configuration` for the key, the display name and
98
+ description, the property IRI, a field's `occurrences` and an element's `placement`.
99
+ Hidden and Continue previous line are reported as the `layout` setting rather than
100
+ `display`. The Presentation and Metadata tabs keep the identifiers `Display`,
101
+ `Field metadata`, `Element metadata` and `Template Metadata`.
102
+ - An attribute-value field takes no minimum above 0, because whoever fills in the form
103
+ names its attributes. A higher minimum is reported on the field's `occurrences`
104
+ setting, as an inverted range is, and the template cannot be saved until the
105
+ minimum is cleared or set to 0. The minimum control is disabled at 0, except on a
106
+ template that already states a higher minimum, where it stays open to be cleared.
107
+ - An unnamed template, element or field draws the line under its name in the warning
108
+ colour, and in the error colour once the name is reported missing. Focus and a selected
109
+ field card still draw it in the primary colour, and a locked name keeps the rule. Each
110
+ name's placeholder takes the regular weight rather than the name's medium weight.
111
+ - Focus no longer drops to the top of the page after an action. A deleted field or
112
+ element gives focus to the next card, else the previous one, else its container's
113
+ Add field. An import gives focus to the first imported card, and a chosen default
114
+ term returns focus to Edit default term.
115
+ - Escape closes the Add field palette, the constraint and default-term dialogs, the
116
+ user menu, Preferences and Define Presets, and focus returns to the control that
117
+ opened each. Tabbing out of the user menu closes it.
118
+ - Preferences and Define Presets are modal dialogs. Each takes focus when it opens,
119
+ keeps Tab inside it, and is announced by its title. The default-term dialog takes
120
+ focus and keeps Tab inside it, as the constraint dialog does.
121
+ - The template description box is at least 24px tall, WCAG 2.2's minimum target, which
122
+ moves everything below it down a pixel.
123
+ - Card drag handles are hidden from assistive technology, since the Overview's handles
124
+ reorder from the keyboard. An unnamed template's collapse button reads "Collapse
125
+ template", and each choice option's delete button names its option's number.
126
+
127
+ ### Fixed
128
+
129
+ - The divider between the library sidebar's field list and the panel below it can be moved from
130
+ the keyboard. It is a separator named "Resize field list" that takes a Tab stop. The arrow keys
131
+ move it by 5 points of the sidebar's height, or 10 with Shift, and Home and End set the 10% and
132
+ 75% limits a drag keeps. Before, only a pointer could move it.
133
+ - A template or element with a language of its own saves. The model library wrote that language
134
+ where the meta-schema refuses it, so the artifact server refused the save, and the designer
135
+ read it back from there itself. The library now writes it in the template's own context.
136
+ - A published field or element no longer says that only its configuration can change
137
+ where nothing can configure it. Designed on its own, it has no parent, and a
138
+ read-only document configures nothing.
139
+ - A renamed template, element or field is written with the title its name gives. The
140
+ model library reads a title that way, so the stored title used to change between a
141
+ save and the next reopening.
142
+ - Tabbing into Preferences' field-type checkboxes no longer loses focus. The list was
143
+ rebuilt on every key press, which removed the checkbox that had just taken focus.
144
+ - Define Presets names each checkbox by its row and preset, and its close button has
145
+ a name.
146
+ - An attribute-value field's stand-in input is named by its type, the annotations
147
+ table can be scrolled from the keyboard on a narrow host, and the template
148
+ description box takes its accessible name from its label.
149
+ - Both elements mark their text with the language it is shown in, so a screen reader
150
+ reads Hungarian as Hungarian inside an English page. The `lang` attribute sits on
151
+ the root inside the shadow tree, and the host element keeps the page's.
152
+ - A field card's name box is named Enter field name, the placeholder it shows, so
153
+ speech input reaches it by the only text it displays. It was named Field display
154
+ name, and its description now says it edits the display name. The Hungarian name of the property IRI's Replace button now holds the word
155
+ the button shows.
156
+ - Name and description errors are alerts, as the designer's other errors are, so a
157
+ screen reader announces them without focus moving. The validation summary is
158
+ announced through the live region only when it lists an issue no alert and no host
159
+ announcement has already said, such as a defect in a document the host loaded.
160
+ - Collapsing or expanding the library sidebar gives focus to the button that reverses
161
+ it, and removing a type gives focus to the next type's Remove button, else the
162
+ previous one's, else the control that adds a type. Focus used to fall to the page.
163
+ The sidebar's library toggles report whether they are expanded, and their arrow is
164
+ no longer read as part of their names.
165
+ - The child picker's type icons are read as Field or Element, and a selected result's
166
+ check is read as Selected. Preferences groups its field selection radios, and each
167
+ set of its checkboxes, under the heading that names them, and reports which preset
168
+ button is pressed. Define Presets heads each row
169
+ with its setting and names each table by its group. The Add field palette's library
170
+ menu reports whether it is open, and its arrow is no longer read.
171
+ - A field that declares a language marks its text default, its choice options and its
172
+ rich text with it, so a screen reader reads them in that language. A number default,
173
+ and the names and descriptions the author writes, keep the designer's language.
174
+ - On a 320px host the annotations table no longer makes the whole canvas scroll sideways.
175
+ Its Actions column is named for a screen reader without visually hidden text, which had
176
+ reached past the table's own scroller.
177
+
178
+ ## [0.1.0-dev.20260916.2593d382] - 2026-09-16 (Nexus)
179
+
180
+ First Nexus development snapshot, including explicit host document loading,
181
+ empty-document creation and dirty-state reporting. This entry records the reconstruction
182
+ of the repository on `develop`: what arrived as a Figma Make export is now a
183
+ Web Component with a declared contract, a distribution, and a test suite that
184
+ drives it in a browser.
185
+
186
+ ### Added
187
+
188
+ - A profile picker in the header. Three profiles — Basic, Semantic, Modular —
189
+ decide which field types and which per-field controls an author is offered, and
190
+ the only way to one was the user menu and then the preferences modal, two clicks
191
+ behind an unlabelled avatar with nothing on screen saying which was in force. An
192
+ author who wanted controlled terms had to know that Basic hides them and that a
193
+ profile existed to change. It reads `Custom` once the settings no longer match
194
+ any profile, which is a state one switch reaches.
195
+ - Every field type is checked through both serializations and for settling: 26
196
+ types, each written and read back as JSON and as YAML, and each proved to reach
197
+ a state a second write does not change. Two defects came out of it, below.
198
+
199
+ - `<cedar-embeddable-designer>`, registered as a custom element that bootstraps
200
+ nothing onto the page. A host decides where and when one appears.
201
+ - Shadow DOM. Neither the designer's styles nor a host page's cross the boundary.
202
+ - A host contract: `config` carrying `terminologyBaseUrl`, a `template` input
203
+ taking CEDAR JSON or CEDAR YAML, a `currentTemplate` property, and a
204
+ `templateChange` event carrying the template as CEDAR JSON-LD. Declared in
205
+ `src/app/ced-public-api.ts`, which is written without imports so one
206
+ `tsc --emitDeclarationOnly` produces the declaration the package ships.
207
+ - `npm run dist`: the element flattened into one classic script with esbuild,
208
+ held to a recorded size ceiling raw and gzipped, and staged as an npm package
209
+ from those exact bytes, verified afterwards byte for byte. Which registry a
210
+ package belongs to is derived from its version, so a development snapshot
211
+ cannot reach npmjs by forgetting a flag.
212
+ - Term search through
213
+ [`<cedar-embeddable-term-picker>`](https://github.com/metadatacenter/cedar-embeddable-term-picker),
214
+ a sibling web component the embedding page loads alongside the designer. A
215
+ field's constraint is chosen from what the terminology server holds instead of
216
+ typed from memory. Where the picker is absent the panel says so.
217
+ - Tests: 207 unit tests through the Angular CLI's Vitest builder, 5 covering the
218
+ publish-channel rule, and 38 browser tests driving the built bundle in a host
219
+ page whose own CSS is chosen to be as intrusive as possible. The browser suite
220
+ is hermetic — no test reaches a terminology server, and the picker is stubbed.
221
+ - A CI workflow running lint, typecheck, unit tests, source-boundary tests,
222
+ packaging tests, both builds, the distribution and the browser suite, with the
223
+ production audit as its own step.
224
+ - A freshness guard on the browser suite. It serves `dist-bundle/`, and a bundle
225
+ older than the build beside it would run, pass, and report green against code
226
+ nobody was testing. `check:fresh` compares the two by timestamp, by the files
227
+ the bundle was made from, and by hash. A checkout that never built is not what
228
+ it refuses — testing a distribution someone handed you is legitimate — only a
229
+ bundle a build contradicts.
230
+ - Two source-boundary tests, for properties no type can express: the published
231
+ contract stays import-free, or the declaration the package ships names paths
232
+ that are not in it, and the CEDAR model library is reached through one file,
233
+ which is what keeps its vocabulary out of the components. A third holds the
234
+ sibling components out of the bundle.
235
+ - `check:readme`, which compiles the README's TypeScript examples against the
236
+ staged declaration and checks that every `npm run` a reader is told to type is
237
+ a script this project has. Documentation here had already named one that did
238
+ not exist.
239
+ - `test:browser:flake-hunt`, which runs the browser suite twenty times, or
240
+ `RUNS=n`.
241
+ - `license.txt` (BSD 2-Clause), a README describing the component rather than the
242
+ Angular CLI, and `.nvmrc` pinning Node 24.19.0.
243
+
244
+ ### Changed
245
+
246
+ - Angular 19.2 to 22.1, TypeScript 5.7 to 6.0.3, and Node to 24.19.0, matching
247
+ the CEDAR Embeddable Editor and the term picker.
248
+ - Karma and Jasmine replaced by Vitest, through `@angular/build:unit-test` rather
249
+ than a standalone config, because this codebase wants `TestBed`.
250
+ - Serialization is the
251
+ [CEDAR model library's](https://github.com/metadatacenter/cedar-model-typescript-library).
252
+ The designer builds a `Template` and the library writes it as CEDAR JSON-LD or
253
+ CEDAR YAML and reads either back, so a template written in one form and
254
+ reopened from the other is the same artifact.
255
+ - Controlled-term search asks a terminology server the host names. There is no
256
+ default endpoint: unset, search is off and the panel says which key is missing.
257
+ - The file menu offers Download as JSON and Download as YAML, in place of a Save
258
+ and a Save As that meant the same thing without a native dialog behind them.
259
+ - Every component uses `ChangeDetectionStrategy.OnPush`; state is held in signals.
260
+ - The compiler settings match CEE and the term picker: `strict`,
261
+ `noUnusedLocals`, `noUnusedParameters`, `useDefineForClassFields: false`, and
262
+ no `skipLibCheck`, so the model library's declarations are checked rather than
263
+ trusted. `no-explicit-any` is on.
264
+ - The component is the CEDAR Embeddable Designer throughout — the window title,
265
+ the package, the Angular project, the build output and the element's tag.
266
+ - Preview renders the template with
267
+ [`<cedar-embeddable-editor>`](https://github.com/metadatacenter/cedar-embeddable-editor),
268
+ a third sibling web component the host loads. It is the renderer that will show
269
+ the form to whoever fills it in, read-only and with no instance behind it,
270
+ which is how CEE reads a template as a statement of what each field accepts.
271
+ The preview keeps one editor and hands it each new template. CEE fixes a
272
+ template only once an instance is loaded against it, and a preview supplies
273
+ none — a rule it gained for this. Replacing the element per edit cost about a
274
+ second of Angular bootstrapping, flat in the size of the template, and took the
275
+ reader's scroll position and page with it.
276
+
277
+ ### Fixed
278
+
279
+ - The designer grew to whatever it held instead of keeping to the box its host
280
+ gave it. Its shell asked for `min-h-screen` — the viewport, which an embedded
281
+ component has no business measuring — and being a minimum it grew with its
282
+ content, so a forty-field template made the element eleven thousand pixels tall
283
+ and the embedding page scrolled. Neither the fields nor the preview could scroll
284
+ within it, though both had said `overflow-y: auto` all along. `app-root` was the
285
+ break in the chain: a component element is inline by default, so the height
286
+ declared on the element never reached the shell.
287
+
288
+ - A controlled-term field with no vocabulary chosen was written as one anyway: it
289
+ went out IRI-shaped with four empty constraint lists and came back a text field,
290
+ so opening a saved template and saving it again turned the field's values from
291
+ `@id` to `@value` without anyone touching it. A field constrained to nothing is
292
+ written as the text field it is until a vocabulary is chosen — a stopgap that
293
+ stops the decay, not a statement that controlled terms are a switch on a text
294
+ field. In this designer they are a type of their own.
295
+ - An ontology constraint named its ontology by acronym where a URI belongs. JSON
296
+ said `"uri": "DOID"`; the YAML path derives the URI from the acronym and said
297
+ `https://data.bioontology.org/ontologies/DOID`, so one template written in the
298
+ two formats was two different artifacts and only one named an ontology. Reading
299
+ one back put the URI where the next write expected an acronym, so a template
300
+ grew a URI segment on every open-and-save.
301
+ - Controlled-term search substituted hard-coded results carrying real-looking
302
+ SNOMEDCT and DOID identifiers when a request failed, and invented a term at
303
+ `http://example.org/term/<query>` for anything it had no canned answer to. They
304
+ were selectable, and a selected term went into the template.
305
+ - The element was registered from the `.then` of `bootstrapApplication`, so a page
306
+ without `<app-root>` failed the bootstrap and never defined it, while a page
307
+ with one got a whole application it had not asked for.
308
+ - `public/demo.html` named the element and loaded no script at all. It has since
309
+ been replaced by the browser suite's host fixture, which loads the distribution.
310
+ - Exported templates dropped the recommended status, the multiple-values flag,
311
+ default values and every controlled-term constraint.
312
+ - A time field was written as `xsd:dateTime`, so it read back as a date and
313
+ degraded on every open-and-save cycle.
314
+ - A field with no help text was given the literal description `"Help Text"`.
315
+ - Two fields of the same name collapsed to one key.
316
+ - Neither the template nor its fields carried the JSON-schema `title` the CEDAR
317
+ meta-schema requires, so the output was not valid.
318
+ - The template and its fields were given fresh identifiers on every read, so the
319
+ two export panels disagreed and a host was told the artifact was new on every
320
+ keystroke.
321
+ - The unsaved-changes guard was raised by field reordering and nothing else.
322
+ - Under shadow DOM: field cards were looked up with `document.getElementById`,
323
+ three click-outside handlers read `event.target` after it had been retargeted
324
+ at the host, and the sidebar's resize handle searched the whole document.
325
+ - `templateChange` was a view effect on a component whose template is one static
326
+ tag, so under OnPush the host received exactly one event however much the
327
+ author edited.
328
+ - The packaged element requested `cedar-logo.png` from the embedder's server,
329
+ which the package does not carry.
330
+ - Restricting a search to an ontology sent `ontologies`, which the terminology
331
+ server ignores; the parameter is `sources`.
332
+ - Search results were read as BioPortal's shape rather than the terminology
333
+ server's, so the ontology column was empty for every genuine result.
334
+ - The YAML highlighter put two spaces after every key.
335
+ - Three `@for` blocks tracked `undefined`, which Angular reported as 57 duplicate
336
+ keys per render.
337
+
338
+ ### Removed
339
+
340
+ - Every rendering of the artifact as code. The preview panel drew its own form
341
+ from the field list, with JSON and YAML tabs above it, a second copy of the
342
+ export panel behind those, and a term-search modal for filling the preview in;
343
+ under the editor sat two accordions showing the same two serializations again,
344
+ and a syntax highlighter served both. An author was shown this component's idea
345
+ of CEDAR rather than the renderer that will show the form, three times over.
346
+ Preview is CEE now, and the File menu writes both serializations as files.
347
+ - The Electron shell, its IPC bridge — which accepted any filesystem path the
348
+ renderer offered — the service behind it, the menu wiring and five
349
+ devDependencies. Open and save are a file input and a download.
350
+ - The BioPortal API key, its modal, its `localStorage` entry, the menu item and a
351
+ debug strip that had shipped reporting whether the key was set. The search
352
+ endpoint builds an anonymous request context, so the key was never read: the
353
+ gate turned a working search off in exchange for nothing.
354
+ - `src/app/core/cedar-shim/`: a hand-written CEDAR serializer, a YAML emitter and
355
+ a YAML parser, replaced by the model library.
356
+ - The Figma Make scaffolding: an abandoned React application under
357
+ `react-src-backup/`, the tool's guidelines template, a copy of shadcn's
358
+ `globals.css` that nothing imported, and 120 lines of type declarations
359
+ describing a format this code does not produce.
360
+ - A search box in the constraint panel that was `disabled` and had no handler.