cedar-embeddable-designer 0.0.0-stage → 0.1.1
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 +400 -0
- package/README.md +232 -2
- package/bundle-manifest.host-fonts.json +12 -0
- package/bundle-manifest.json +12 -0
- package/cedar-embeddable-designer.d.ts +349 -0
- package/cedar-embeddable-designer.host-fonts.js +425 -0
- package/cedar-embeddable-designer.js +425 -0
- package/integration-licenses.txt +33 -0
- package/integration-manifest.json +47 -0
- package/integration.mjs +7919 -0
- package/license.txt +26 -0
- package/package.json +35 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,400 @@
|
|
|
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.1] - 2026-11-12
|
|
9
|
+
|
|
10
|
+
Aligns with `cedar-model-typescript-library@1.0.28`.
|
|
11
|
+
|
|
12
|
+
- Adds Move up and Move down buttons for reordering, keyboard routes through the field list and the child picker, and captions that stay once a box holds text.
|
|
13
|
+
- Opens the Overview over the canvas below 768px, fits the Preferences and Define Presets dialogs to a narrow host, and closes the designer's recorded WCAG 2.2 failures.
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- A Name caption before a field's name box, a number before each option box and a magnifier in
|
|
18
|
+
the field picker's library search, which also gains an accessible name. Each stays once its box
|
|
19
|
+
holds text, as a placeholder does not. No card grows taller.
|
|
20
|
+
- Move up and Move down buttons on each Overview row and each chosen row in the child picker,
|
|
21
|
+
beside the Reorder handle, so reordering needs single clicks alone. Each says where the item went.
|
|
22
|
+
- A click on the Overview's divider or the library sidebar's divider steps it through its smallest,
|
|
23
|
+
default and largest sizes. It replaces the Overview divider's double-click reset.
|
|
24
|
+
- Keyboard routes through two lists. The library sidebar's field list is a listbox and one Tab stop:
|
|
25
|
+
the arrow keys, Home and End move within it, and Enter chooses a field as a click does and gives
|
|
26
|
+
focus to its card. The child picker's results are a grid and one Tab stop, and Enter or Space
|
|
27
|
+
chooses a row.
|
|
28
|
+
- Below 768px the Overview's toggle stays in the header and opens the Overview over the canvas,
|
|
29
|
+
closed by default. Escape closes it and returns focus to the toggle.
|
|
30
|
+
|
|
31
|
+
### Changed
|
|
32
|
+
|
|
33
|
+
- A field's header is at least 24px tall, the minimum target size, so it serves as the settings
|
|
34
|
+
toggle's equivalent target. Every field card is 1px taller.
|
|
35
|
+
|
|
36
|
+
### Fixed
|
|
37
|
+
|
|
38
|
+
- The library sidebar's libraries section takes the space left under the field list, so it ends at
|
|
39
|
+
the sidebar's edge and its last button can be reached with a pointer.
|
|
40
|
+
- On a narrow host the Preferences field types take one column, each Define Presets table scrolls
|
|
41
|
+
sideways in a box of its own, and a Types row puts its buttons beneath the list, each only where
|
|
42
|
+
its row would otherwise overflow.
|
|
43
|
+
- Escape no longer leaves keyboard focus on the insertion actions it hides between two cards.
|
|
44
|
+
Focus moves to the card below them, the one they insert before. An action used from the
|
|
45
|
+
keyboard keeps the actions shown, so closing the palette it opens returns focus to a control
|
|
46
|
+
that can be seen. A pointer click still hides them.
|
|
47
|
+
|
|
48
|
+
## [0.1.0] - 2026-11-09
|
|
49
|
+
|
|
50
|
+
Aligns with `cedar-model-typescript-library@1.0.27`.
|
|
51
|
+
|
|
52
|
+
- 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`.
|
|
53
|
+
- 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.
|
|
54
|
+
- `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.
|
|
55
|
+
- 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.
|
|
56
|
+
|
|
57
|
+
### Added
|
|
58
|
+
|
|
59
|
+
- `cedar-embeddable-designer.host-fonts.js`, with `bundle-manifest.host-fonts.json`: the same
|
|
60
|
+
elements without the embedded CEDAR Roboto faces, for a host that registers them for its whole
|
|
61
|
+
page. The CEDAR Template Designer page loads CEE, the term picker and CED together, and each
|
|
62
|
+
embedded the same faces. The standalone bundle is unchanged.
|
|
63
|
+
- `validateArtifact(artifact, kind?)` on both elements: the CEDAR meta-schema's verdict on any
|
|
64
|
+
schema artifact. A host can check the exact payload it saves with the validator CED already
|
|
65
|
+
carries, rather than loading its own copy.
|
|
66
|
+
- `validationReport.superseded`: the stored shapes CED's projection replaced when an artifact
|
|
67
|
+
was loaded and the CEDAR validator refuses, each with its location and the value the projection
|
|
68
|
+
holds, so that a host merging the projection into the stored artifact stops retaining them.
|
|
69
|
+
Tests cover every shape in every placement, in standalone fields and across the production corpus.
|
|
70
|
+
- CEFD (`cedar-embeddable-field-designer`) in the CED bundle: a standalone field
|
|
71
|
+
definition editor sharing CED's controls, with JSON/YAML loading, all field
|
|
72
|
+
types, validation and dirty events, isolated instances and host read-only mode,
|
|
73
|
+
which the host explains, as it does for CED. Container placement controls remain
|
|
74
|
+
in CED. The host owns repository saves.
|
|
75
|
+
- CEFD contract, field-type round-trip, metadata preservation and browser tests;
|
|
76
|
+
split Designer coverage for standalone field creation, updates and stale saves.
|
|
77
|
+
- English and Hungarian. Both elements take a `language` property and attribute
|
|
78
|
+
(`'en'` or `'hu'`; anything else selects English), which may change at runtime.
|
|
79
|
+
Each element owns its own `@ngx-translate/core` service, so designers on one page
|
|
80
|
+
can differ. The language is passed to the embedded term picker and to CEE, and
|
|
81
|
+
dates use the matching locale. English text is unchanged.
|
|
82
|
+
- Tests that hold the two language maps to the same keys and that fail when a
|
|
83
|
+
template or message states user-visible text outside them.
|
|
84
|
+
- One polite live region in each element, present from the first render. It announces
|
|
85
|
+
an applied constraint set ("Disease now has 2 constraints."), a cleared default, a
|
|
86
|
+
chosen default term, a new or cleared set of host findings, and a move in the
|
|
87
|
+
Overview, in English or Hungarian. Errors keep their alerts.
|
|
88
|
+
- Browser specs that run axe-core for WCAG 2.2 levels A and AA over every reachable
|
|
89
|
+
state, pin each surface's Tab order, check where focus lands after each action, and
|
|
90
|
+
read the live region after each announced event.
|
|
91
|
+
|
|
92
|
+
### Changed
|
|
93
|
+
|
|
94
|
+
- Drag handles draw the shared `drag` grip instead of the `list` icon, in the canvas, the
|
|
95
|
+
Overview, the field library and the child picker. On a field or element card the handle
|
|
96
|
+
sits in the bottom-right corner, under the delete button and level with the settings
|
|
97
|
+
chevron. A field's type moves to the centre of its header, over the chevron, where the
|
|
98
|
+
handle was. An element keeps its centred Element label, and its children toggle moves one
|
|
99
|
+
icon left to leave the corner to the handle. The template header shows Template in the
|
|
100
|
+
same place.
|
|
101
|
+
- A child's settings open on a new Configuration tab, which holds how its parent places
|
|
102
|
+
it. The display name and a wider display description share its first row. The
|
|
103
|
+
requirement select follows with Hidden and Continue previous line, each where the
|
|
104
|
+
child can carry it. Allow multiple sits above the minimum and maximum, which share a
|
|
105
|
+
row with the key, and the property IRI comes last. The display name and description
|
|
106
|
+
are the parent's `_ui.propertyLabels` and `_ui.propertyDescriptions` entries, and the
|
|
107
|
+
card header shows and edits the display name. A nested element's header gives its name
|
|
108
|
+
input the accessible name Element display name. The requirement select and the Allow
|
|
109
|
+
multiple checkbox leave the card header, the key and the property IRI leave the
|
|
110
|
+
metadata tabs, and the Occurrences tab is retired. The bounds stay visible and
|
|
111
|
+
disabled until Allow multiple is on.
|
|
112
|
+
- The Presentation tab, formerly Display, edits the child's own name and description,
|
|
113
|
+
its `schema:name` and `schema:description`, under the labels Field name and Field
|
|
114
|
+
description or Element name and Element description. While the author first names a
|
|
115
|
+
new child, its display name and its name are one value, and an edit on either side
|
|
116
|
+
writes both. Once the name first loses focus, an edit to the display name changes only
|
|
117
|
+
the display name, and the child's name and key stay as they are. Its two descriptions
|
|
118
|
+
are one value in the same way, until the description first loses focus. An imported or
|
|
119
|
+
library child takes its display name and display description from its own once and
|
|
120
|
+
keeps each pair apart from the start. An edit from Presentation still changes what a
|
|
121
|
+
parent that shows the child as itself displays. A named child's display name cannot be
|
|
122
|
+
cleared. While its input is blank, the header reports that a display name is required,
|
|
123
|
+
and the template keeps the previous display name. A parent that shows the child
|
|
124
|
+
differently keeps doing so. The designer no longer writes `skos:prefLabel`, except to
|
|
125
|
+
keep one that only repeated the name moving with it. Every profile shows that
|
|
126
|
+
description, so the Show Help text preference, which hid the separate help text input
|
|
127
|
+
it replaces, is retired.
|
|
128
|
+
- The metadata tab of a field, an element and a template is labelled Metadata.
|
|
129
|
+
- A new child's key is its name as written, and follows the name until the name first
|
|
130
|
+
loses focus. An imported or library child takes its name as its key. A key that
|
|
131
|
+
clashes or is reserved is reported at once instead of being renamed with a suffix, and
|
|
132
|
+
the child keeps a usable key until the author chooses one. The fields a new template
|
|
133
|
+
starts with are keyed by their names.
|
|
134
|
+
- A published field or element keeps its own definition while its parent configures,
|
|
135
|
+
renames, reorders and removes it. Everything inside a published element is locked, its
|
|
136
|
+
children's placement included, and nothing can be added to it.
|
|
137
|
+
- `CedValidationIssue.tab` reports `Configuration` for the key, the display name and
|
|
138
|
+
description, the property IRI, a field's `occurrences` and an element's `placement`.
|
|
139
|
+
Hidden and Continue previous line are reported as the `layout` setting rather than
|
|
140
|
+
`display`. The Presentation and Metadata tabs keep the identifiers `Display`,
|
|
141
|
+
`Field metadata`, `Element metadata` and `Template Metadata`.
|
|
142
|
+
- An attribute-value field takes no minimum above 0, because whoever fills in the form
|
|
143
|
+
names its attributes. A higher minimum is reported on the field's `occurrences`
|
|
144
|
+
setting, as an inverted range is, and the template cannot be saved until the
|
|
145
|
+
minimum is cleared or set to 0. The minimum control is disabled at 0, except on a
|
|
146
|
+
template that already states a higher minimum, where it stays open to be cleared.
|
|
147
|
+
- An unnamed template, element or field draws the line under its name in the warning
|
|
148
|
+
colour, and in the error colour once the name is reported missing. Focus and a selected
|
|
149
|
+
field card still draw it in the primary colour, and a locked name keeps the rule. Each
|
|
150
|
+
name's placeholder takes the regular weight rather than the name's medium weight.
|
|
151
|
+
- Focus no longer drops to the top of the page after an action. A deleted field or
|
|
152
|
+
element gives focus to the next card, else the previous one, else its container's
|
|
153
|
+
Add field. An import gives focus to the first imported card, and a chosen default
|
|
154
|
+
term returns focus to Edit default term.
|
|
155
|
+
- Escape closes the Add field palette, the constraint and default-term dialogs, the
|
|
156
|
+
user menu, Preferences and Define Presets, and focus returns to the control that
|
|
157
|
+
opened each. Tabbing out of the user menu closes it.
|
|
158
|
+
- Preferences and Define Presets are modal dialogs. Each takes focus when it opens,
|
|
159
|
+
keeps Tab inside it, and is announced by its title. The default-term dialog takes
|
|
160
|
+
focus and keeps Tab inside it, as the constraint dialog does.
|
|
161
|
+
- The template description box is at least 24px tall, WCAG 2.2's minimum target, which
|
|
162
|
+
moves everything below it down a pixel.
|
|
163
|
+
- Card drag handles are hidden from assistive technology, since the Overview's handles
|
|
164
|
+
reorder from the keyboard. An unnamed template's collapse button reads "Collapse
|
|
165
|
+
template", and each choice option's delete button names its option's number.
|
|
166
|
+
|
|
167
|
+
### Fixed
|
|
168
|
+
|
|
169
|
+
- The divider between the library sidebar's field list and the panel below it can be moved from
|
|
170
|
+
the keyboard. It is a separator named "Resize field list" that takes a Tab stop. The arrow keys
|
|
171
|
+
move it by 5 points of the sidebar's height, or 10 with Shift, and Home and End set the 10% and
|
|
172
|
+
75% limits a drag keeps. Before, only a pointer could move it.
|
|
173
|
+
- A template or element with a language of its own saves. The model library wrote that language
|
|
174
|
+
where the meta-schema refuses it, so the artifact server refused the save, and the designer
|
|
175
|
+
read it back from there itself. The library now writes it in the template's own context.
|
|
176
|
+
- A published field or element no longer says that only its configuration can change
|
|
177
|
+
where nothing can configure it. Designed on its own, it has no parent, and a
|
|
178
|
+
read-only document configures nothing.
|
|
179
|
+
- A renamed template, element or field is written with the title its name gives. The
|
|
180
|
+
model library reads a title that way, so the stored title used to change between a
|
|
181
|
+
save and the next reopening.
|
|
182
|
+
- Tabbing into Preferences' field-type checkboxes no longer loses focus. The list was
|
|
183
|
+
rebuilt on every key press, which removed the checkbox that had just taken focus.
|
|
184
|
+
- Define Presets names each checkbox by its row and preset, and its close button has
|
|
185
|
+
a name.
|
|
186
|
+
- An attribute-value field's stand-in input is named by its type, the annotations
|
|
187
|
+
table can be scrolled from the keyboard on a narrow host, and the template
|
|
188
|
+
description box takes its accessible name from its label.
|
|
189
|
+
- Both elements mark their text with the language it is shown in, so a screen reader
|
|
190
|
+
reads Hungarian as Hungarian inside an English page. The `lang` attribute sits on
|
|
191
|
+
the root inside the shadow tree, and the host element keeps the page's.
|
|
192
|
+
- A field card's name box is named Enter field name, the placeholder it shows, so
|
|
193
|
+
speech input reaches it by the only text it displays. It was named Field display
|
|
194
|
+
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
|
|
195
|
+
the button shows.
|
|
196
|
+
- Name and description errors are alerts, as the designer's other errors are, so a
|
|
197
|
+
screen reader announces them without focus moving. The validation summary is
|
|
198
|
+
announced through the live region only when it lists an issue no alert and no host
|
|
199
|
+
announcement has already said, such as a defect in a document the host loaded.
|
|
200
|
+
- Collapsing or expanding the library sidebar gives focus to the button that reverses
|
|
201
|
+
it, and removing a type gives focus to the next type's Remove button, else the
|
|
202
|
+
previous one's, else the control that adds a type. Focus used to fall to the page.
|
|
203
|
+
The sidebar's library toggles report whether they are expanded, and their arrow is
|
|
204
|
+
no longer read as part of their names.
|
|
205
|
+
- The child picker's type icons are read as Field or Element, and a selected result's
|
|
206
|
+
check is read as Selected. Preferences groups its field selection radios, and each
|
|
207
|
+
set of its checkboxes, under the heading that names them, and reports which preset
|
|
208
|
+
button is pressed. Define Presets heads each row
|
|
209
|
+
with its setting and names each table by its group. The Add field palette's library
|
|
210
|
+
menu reports whether it is open, and its arrow is no longer read.
|
|
211
|
+
- A field that declares a language marks its text default, its choice options and its
|
|
212
|
+
rich text with it, so a screen reader reads them in that language. A number default,
|
|
213
|
+
and the names and descriptions the author writes, keep the designer's language.
|
|
214
|
+
- On a 320px host the annotations table no longer makes the whole canvas scroll sideways.
|
|
215
|
+
Its Actions column is named for a screen reader without visually hidden text, which had
|
|
216
|
+
reached past the table's own scroller.
|
|
217
|
+
|
|
218
|
+
## [0.1.0-dev.20260916.2593d382] - 2026-09-16 (Nexus)
|
|
219
|
+
|
|
220
|
+
First Nexus development snapshot, including explicit host document loading,
|
|
221
|
+
empty-document creation and dirty-state reporting. This entry records the reconstruction
|
|
222
|
+
of the repository on `develop`: what arrived as a Figma Make export is now a
|
|
223
|
+
Web Component with a declared contract, a distribution, and a test suite that
|
|
224
|
+
drives it in a browser.
|
|
225
|
+
|
|
226
|
+
### Added
|
|
227
|
+
|
|
228
|
+
- A profile picker in the header. Three profiles — Basic, Semantic, Modular —
|
|
229
|
+
decide which field types and which per-field controls an author is offered, and
|
|
230
|
+
the only way to one was the user menu and then the preferences modal, two clicks
|
|
231
|
+
behind an unlabelled avatar with nothing on screen saying which was in force. An
|
|
232
|
+
author who wanted controlled terms had to know that Basic hides them and that a
|
|
233
|
+
profile existed to change. It reads `Custom` once the settings no longer match
|
|
234
|
+
any profile, which is a state one switch reaches.
|
|
235
|
+
- Every field type is checked through both serializations and for settling: 26
|
|
236
|
+
types, each written and read back as JSON and as YAML, and each proved to reach
|
|
237
|
+
a state a second write does not change. Two defects came out of it, below.
|
|
238
|
+
|
|
239
|
+
- `<cedar-embeddable-designer>`, registered as a custom element that bootstraps
|
|
240
|
+
nothing onto the page. A host decides where and when one appears.
|
|
241
|
+
- Shadow DOM. Neither the designer's styles nor a host page's cross the boundary.
|
|
242
|
+
- A host contract: `config` carrying `terminologyBaseUrl`, a `template` input
|
|
243
|
+
taking CEDAR JSON or CEDAR YAML, a `currentTemplate` property, and a
|
|
244
|
+
`templateChange` event carrying the template as CEDAR JSON-LD. Declared in
|
|
245
|
+
`src/app/ced-public-api.ts`, which is written without imports so one
|
|
246
|
+
`tsc --emitDeclarationOnly` produces the declaration the package ships.
|
|
247
|
+
- `npm run dist`: the element flattened into one classic script with esbuild,
|
|
248
|
+
held to a recorded size ceiling raw and gzipped, and staged as an npm package
|
|
249
|
+
from those exact bytes, verified afterwards byte for byte. Which registry a
|
|
250
|
+
package belongs to is derived from its version, so a development snapshot
|
|
251
|
+
cannot reach npmjs by forgetting a flag.
|
|
252
|
+
- Term search through
|
|
253
|
+
[`<cedar-embeddable-term-picker>`](https://github.com/metadatacenter/cedar-embeddable-term-picker),
|
|
254
|
+
a sibling web component the embedding page loads alongside the designer. A
|
|
255
|
+
field's constraint is chosen from what the terminology server holds instead of
|
|
256
|
+
typed from memory. Where the picker is absent the panel says so.
|
|
257
|
+
- Tests: 207 unit tests through the Angular CLI's Vitest builder, 5 covering the
|
|
258
|
+
publish-channel rule, and 38 browser tests driving the built bundle in a host
|
|
259
|
+
page whose own CSS is chosen to be as intrusive as possible. The browser suite
|
|
260
|
+
is hermetic — no test reaches a terminology server, and the picker is stubbed.
|
|
261
|
+
- A CI workflow running lint, typecheck, unit tests, source-boundary tests,
|
|
262
|
+
packaging tests, both builds, the distribution and the browser suite, with the
|
|
263
|
+
production audit as its own step.
|
|
264
|
+
- A freshness guard on the browser suite. It serves `dist-bundle/`, and a bundle
|
|
265
|
+
older than the build beside it would run, pass, and report green against code
|
|
266
|
+
nobody was testing. `check:fresh` compares the two by timestamp, by the files
|
|
267
|
+
the bundle was made from, and by hash. A checkout that never built is not what
|
|
268
|
+
it refuses — testing a distribution someone handed you is legitimate — only a
|
|
269
|
+
bundle a build contradicts.
|
|
270
|
+
- Two source-boundary tests, for properties no type can express: the published
|
|
271
|
+
contract stays import-free, or the declaration the package ships names paths
|
|
272
|
+
that are not in it, and the CEDAR model library is reached through one file,
|
|
273
|
+
which is what keeps its vocabulary out of the components. A third holds the
|
|
274
|
+
sibling components out of the bundle.
|
|
275
|
+
- `check:readme`, which compiles the README's TypeScript examples against the
|
|
276
|
+
staged declaration and checks that every `npm run` a reader is told to type is
|
|
277
|
+
a script this project has. Documentation here had already named one that did
|
|
278
|
+
not exist.
|
|
279
|
+
- `test:browser:flake-hunt`, which runs the browser suite twenty times, or
|
|
280
|
+
`RUNS=n`.
|
|
281
|
+
- `license.txt` (BSD 2-Clause), a README describing the component rather than the
|
|
282
|
+
Angular CLI, and `.nvmrc` pinning Node 24.19.0.
|
|
283
|
+
|
|
284
|
+
### Changed
|
|
285
|
+
|
|
286
|
+
- Angular 19.2 to 22.1, TypeScript 5.7 to 6.0.3, and Node to 24.19.0, matching
|
|
287
|
+
the CEDAR Embeddable Editor and the term picker.
|
|
288
|
+
- Karma and Jasmine replaced by Vitest, through `@angular/build:unit-test` rather
|
|
289
|
+
than a standalone config, because this codebase wants `TestBed`.
|
|
290
|
+
- Serialization is the
|
|
291
|
+
[CEDAR model library's](https://github.com/metadatacenter/cedar-model-typescript-library).
|
|
292
|
+
The designer builds a `Template` and the library writes it as CEDAR JSON-LD or
|
|
293
|
+
CEDAR YAML and reads either back, so a template written in one form and
|
|
294
|
+
reopened from the other is the same artifact.
|
|
295
|
+
- Controlled-term search asks a terminology server the host names. There is no
|
|
296
|
+
default endpoint: unset, search is off and the panel says which key is missing.
|
|
297
|
+
- The file menu offers Download as JSON and Download as YAML, in place of a Save
|
|
298
|
+
and a Save As that meant the same thing without a native dialog behind them.
|
|
299
|
+
- Every component uses `ChangeDetectionStrategy.OnPush`; state is held in signals.
|
|
300
|
+
- The compiler settings match CEE and the term picker: `strict`,
|
|
301
|
+
`noUnusedLocals`, `noUnusedParameters`, `useDefineForClassFields: false`, and
|
|
302
|
+
no `skipLibCheck`, so the model library's declarations are checked rather than
|
|
303
|
+
trusted. `no-explicit-any` is on.
|
|
304
|
+
- The component is the CEDAR Embeddable Designer throughout — the window title,
|
|
305
|
+
the package, the Angular project, the build output and the element's tag.
|
|
306
|
+
- Preview renders the template with
|
|
307
|
+
[`<cedar-embeddable-editor>`](https://github.com/metadatacenter/cedar-embeddable-editor),
|
|
308
|
+
a third sibling web component the host loads. It is the renderer that will show
|
|
309
|
+
the form to whoever fills it in, read-only and with no instance behind it,
|
|
310
|
+
which is how CEE reads a template as a statement of what each field accepts.
|
|
311
|
+
The preview keeps one editor and hands it each new template. CEE fixes a
|
|
312
|
+
template only once an instance is loaded against it, and a preview supplies
|
|
313
|
+
none — a rule it gained for this. Replacing the element per edit cost about a
|
|
314
|
+
second of Angular bootstrapping, flat in the size of the template, and took the
|
|
315
|
+
reader's scroll position and page with it.
|
|
316
|
+
|
|
317
|
+
### Fixed
|
|
318
|
+
|
|
319
|
+
- The designer grew to whatever it held instead of keeping to the box its host
|
|
320
|
+
gave it. Its shell asked for `min-h-screen` — the viewport, which an embedded
|
|
321
|
+
component has no business measuring — and being a minimum it grew with its
|
|
322
|
+
content, so a forty-field template made the element eleven thousand pixels tall
|
|
323
|
+
and the embedding page scrolled. Neither the fields nor the preview could scroll
|
|
324
|
+
within it, though both had said `overflow-y: auto` all along. `app-root` was the
|
|
325
|
+
break in the chain: a component element is inline by default, so the height
|
|
326
|
+
declared on the element never reached the shell.
|
|
327
|
+
|
|
328
|
+
- A controlled-term field with no vocabulary chosen was written as one anyway: it
|
|
329
|
+
went out IRI-shaped with four empty constraint lists and came back a text field,
|
|
330
|
+
so opening a saved template and saving it again turned the field's values from
|
|
331
|
+
`@id` to `@value` without anyone touching it. A field constrained to nothing is
|
|
332
|
+
written as the text field it is until a vocabulary is chosen — a stopgap that
|
|
333
|
+
stops the decay, not a statement that controlled terms are a switch on a text
|
|
334
|
+
field. In this designer they are a type of their own.
|
|
335
|
+
- An ontology constraint named its ontology by acronym where a URI belongs. JSON
|
|
336
|
+
said `"uri": "DOID"`; the YAML path derives the URI from the acronym and said
|
|
337
|
+
`https://data.bioontology.org/ontologies/DOID`, so one template written in the
|
|
338
|
+
two formats was two different artifacts and only one named an ontology. Reading
|
|
339
|
+
one back put the URI where the next write expected an acronym, so a template
|
|
340
|
+
grew a URI segment on every open-and-save.
|
|
341
|
+
- Controlled-term search substituted hard-coded results carrying real-looking
|
|
342
|
+
SNOMEDCT and DOID identifiers when a request failed, and invented a term at
|
|
343
|
+
`http://example.org/term/<query>` for anything it had no canned answer to. They
|
|
344
|
+
were selectable, and a selected term went into the template.
|
|
345
|
+
- The element was registered from the `.then` of `bootstrapApplication`, so a page
|
|
346
|
+
without `<app-root>` failed the bootstrap and never defined it, while a page
|
|
347
|
+
with one got a whole application it had not asked for.
|
|
348
|
+
- `public/demo.html` named the element and loaded no script at all. It has since
|
|
349
|
+
been replaced by the browser suite's host fixture, which loads the distribution.
|
|
350
|
+
- Exported templates dropped the recommended status, the multiple-values flag,
|
|
351
|
+
default values and every controlled-term constraint.
|
|
352
|
+
- A time field was written as `xsd:dateTime`, so it read back as a date and
|
|
353
|
+
degraded on every open-and-save cycle.
|
|
354
|
+
- A field with no help text was given the literal description `"Help Text"`.
|
|
355
|
+
- Two fields of the same name collapsed to one key.
|
|
356
|
+
- Neither the template nor its fields carried the JSON-schema `title` the CEDAR
|
|
357
|
+
meta-schema requires, so the output was not valid.
|
|
358
|
+
- The template and its fields were given fresh identifiers on every read, so the
|
|
359
|
+
two export panels disagreed and a host was told the artifact was new on every
|
|
360
|
+
keystroke.
|
|
361
|
+
- The unsaved-changes guard was raised by field reordering and nothing else.
|
|
362
|
+
- Under shadow DOM: field cards were looked up with `document.getElementById`,
|
|
363
|
+
three click-outside handlers read `event.target` after it had been retargeted
|
|
364
|
+
at the host, and the sidebar's resize handle searched the whole document.
|
|
365
|
+
- `templateChange` was a view effect on a component whose template is one static
|
|
366
|
+
tag, so under OnPush the host received exactly one event however much the
|
|
367
|
+
author edited.
|
|
368
|
+
- The packaged element requested `cedar-logo.png` from the embedder's server,
|
|
369
|
+
which the package does not carry.
|
|
370
|
+
- Restricting a search to an ontology sent `ontologies`, which the terminology
|
|
371
|
+
server ignores; the parameter is `sources`.
|
|
372
|
+
- Search results were read as BioPortal's shape rather than the terminology
|
|
373
|
+
server's, so the ontology column was empty for every genuine result.
|
|
374
|
+
- The YAML highlighter put two spaces after every key.
|
|
375
|
+
- Three `@for` blocks tracked `undefined`, which Angular reported as 57 duplicate
|
|
376
|
+
keys per render.
|
|
377
|
+
|
|
378
|
+
### Removed
|
|
379
|
+
|
|
380
|
+
- Every rendering of the artifact as code. The preview panel drew its own form
|
|
381
|
+
from the field list, with JSON and YAML tabs above it, a second copy of the
|
|
382
|
+
export panel behind those, and a term-search modal for filling the preview in;
|
|
383
|
+
under the editor sat two accordions showing the same two serializations again,
|
|
384
|
+
and a syntax highlighter served both. An author was shown this component's idea
|
|
385
|
+
of CEDAR rather than the renderer that will show the form, three times over.
|
|
386
|
+
Preview is CEE now, and the File menu writes both serializations as files.
|
|
387
|
+
- The Electron shell, its IPC bridge — which accepted any filesystem path the
|
|
388
|
+
renderer offered — the service behind it, the menu wiring and five
|
|
389
|
+
devDependencies. Open and save are a file input and a download.
|
|
390
|
+
- The BioPortal API key, its modal, its `localStorage` entry, the menu item and a
|
|
391
|
+
debug strip that had shipped reporting whether the key was set. The search
|
|
392
|
+
endpoint builds an anonymous request context, so the key was never read: the
|
|
393
|
+
gate turned a working search off in exchange for nothing.
|
|
394
|
+
- `src/app/core/cedar-shim/`: a hand-written CEDAR serializer, a YAML emitter and
|
|
395
|
+
a YAML parser, replaced by the model library.
|
|
396
|
+
- The Figma Make scaffolding: an abandoned React application under
|
|
397
|
+
`react-src-backup/`, the tool's guidelines template, a copy of shadcn's
|
|
398
|
+
`globals.css` that nothing imported, and 120 lines of type declarations
|
|
399
|
+
describing a format this code does not produce.
|
|
400
|
+
- A search box in the constraint panel that was `disabled` and had no handler.
|
package/README.md
CHANGED
|
@@ -1,3 +1,233 @@
|
|
|
1
|
-
#
|
|
1
|
+
# CEDAR Embeddable Designer (CED)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://github.com/metadatacenter/cedar-embeddable-designer/actions/workflows/test.yml)
|
|
4
|
+
|
|
5
|
+
The CEDAR Embeddable Designer (CED) puts metadata template authoring inside a web
|
|
6
|
+
application. Authors assemble fields and reusable groups, define their allowed
|
|
7
|
+
values and defaults, and preview the form that will collect the metadata. The
|
|
8
|
+
host application receives a CEDAR template that it can store and use in its own
|
|
9
|
+
workflow.
|
|
10
|
+
|
|
11
|
+
A template describes what metadata to collect: field names, value types,
|
|
12
|
+
requirements, repeated groups, and controlled vocabularies. CED lets the people
|
|
13
|
+
responsible for those requirements maintain them through a visual interface,
|
|
14
|
+
without writing schemas by hand or building a template authoring tool.
|
|
15
|
+
|
|
16
|
+
The same CED bundle also includes the CEDAR Embeddable Field Designer (CEFD),
|
|
17
|
+
for creating or editing an individual field definition.
|
|
18
|
+
|
|
19
|
+
CED ships as a standard Web Component. It can be embedded in plain HTML or an
|
|
20
|
+
Angular, React, or other web application without requiring the host to install
|
|
21
|
+
Angular. Basic template authoring needs neither a CEDAR account nor a running
|
|
22
|
+
CEDAR installation. Lookup and repository features use services supplied by
|
|
23
|
+
the host.
|
|
24
|
+
|
|
25
|
+
## How the Components Fit Together
|
|
26
|
+
|
|
27
|
+
CEDAR provides three components for designing templates, choosing vocabularies,
|
|
28
|
+
and collecting metadata:
|
|
29
|
+
|
|
30
|
+
| Component | Role |
|
|
31
|
+
|---|---|
|
|
32
|
+
| [CEDAR Embeddable Designer (CED)](https://metadatacenter.readthedocs.io/en/latest/cedar-embeddable-designer/) | Authors templates and reusable elements, including their fields, structure, constraints, and defaults. The included Field Designer authors standalone fields. |
|
|
33
|
+
| [CEDAR Embeddable Term Picker (CETP)](https://metadatacenter.readthedocs.io/en/latest/cedar-embeddable-term-picker/) | Searches vocabularies and selects field constraints and default terms during authoring. It also supports ontology-property selection. |
|
|
34
|
+
| [CEDAR Embeddable Editor (CEE)](https://metadatacenter.readthedocs.io/en/latest/cedar-embeddable-editor/) | Renders a template for metadata entry or read-only display and returns the resulting metadata instance. |
|
|
35
|
+
|
|
36
|
+
An author designs a template in CED and uses its embedded Term Picker to define
|
|
37
|
+
the vocabularies a field draws from. The host stores the template and supplies
|
|
38
|
+
a selected version to CEE. A researcher completes the form, and the host stores
|
|
39
|
+
the resulting metadata instance.
|
|
40
|
+
|
|
41
|
+
CEE also supplies CED's form preview, and the CEF widget included in CEE's
|
|
42
|
+
bundle supplies individual field controls. Each component is a separate package:
|
|
43
|
+
the host loads the sibling bundles and configures their services, then CED
|
|
44
|
+
manages its embedded preview and pickers. Authentication, template version
|
|
45
|
+
choices, and saving remain the host's responsibility.
|
|
46
|
+
|
|
47
|
+
Applications can use CETP independently for vocabulary selection. A host filling
|
|
48
|
+
an existing template needs only CEE, whose controlled-term fields perform their
|
|
49
|
+
own lookup through the configured terminology service. See
|
|
50
|
+
[Your First Embedded Term Picker](https://metadatacenter.readthedocs.io/en/latest/cedar-embeddable-term-picker/first-picker/)
|
|
51
|
+
for standalone vocabulary selection and
|
|
52
|
+
[Your First Embedded Editor](https://metadatacenter.readthedocs.io/en/latest/cedar-embeddable-editor/first-editor/)
|
|
53
|
+
for collecting metadata from a finished template.
|
|
54
|
+
|
|
55
|
+
## Documentation
|
|
56
|
+
|
|
57
|
+
The [CEDAR Embeddable Designer documentation](https://metadatacenter.readthedocs.io/en/latest/cedar-embeddable-designer/)
|
|
58
|
+
covers installation, templates and elements, validation, reusable content,
|
|
59
|
+
standalone fields, service configuration, and appearance.
|
|
60
|
+
|
|
61
|
+
[Your First Embedded Designer](https://metadatacenter.readthedocs.io/en/latest/cedar-embeddable-designer/first-designer/)
|
|
62
|
+
builds a working page from the published packages.
|
|
63
|
+
[Artifacts and Validation](https://metadatacenter.readthedocs.io/en/latest/cedar-embeddable-designer/artifacts-and-validation/)
|
|
64
|
+
explains what a host supplies, what it reads back, and how to save safely.
|
|
65
|
+
|
|
66
|
+
## Installing
|
|
67
|
+
|
|
68
|
+
Stable releases are published on npm as
|
|
69
|
+
[`cedar-embeddable-designer`](https://www.npmjs.com/package/cedar-embeddable-designer):
|
|
70
|
+
|
|
71
|
+
```shell
|
|
72
|
+
npm install cedar-embeddable-designer
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
To check the current stable release:
|
|
76
|
+
|
|
77
|
+
```shell
|
|
78
|
+
npm view cedar-embeddable-designer version
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
The package contains `cedar-embeddable-designer.js`, the self-contained bundle,
|
|
82
|
+
and `cedar-embeddable-designer.d.ts`, declarations for both designer elements
|
|
83
|
+
and their public APIs. Copy the bundle to the application's static assets and
|
|
84
|
+
load it with a regular `<script>` tag. It is a classic script, not an ES module.
|
|
85
|
+
|
|
86
|
+
### Preview, Field Controls, and Terminology
|
|
87
|
+
|
|
88
|
+
Install the sibling components for form preview, default-value controls, and
|
|
89
|
+
vocabulary selection:
|
|
90
|
+
|
|
91
|
+
```shell
|
|
92
|
+
npm install cedar-embeddable-editor cedar-embeddable-term-picker
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Copy their `cedar-embeddable-editor.js` and `cedar-embeddable-term-picker.js`
|
|
96
|
+
bundles to the same asset directory. CEE also registers CEF, which supplies
|
|
97
|
+
individual field controls. These components are loaded separately and are not
|
|
98
|
+
included in the CED bundle.
|
|
99
|
+
|
|
100
|
+
### Hosts That Already Supply CEDAR Fonts
|
|
101
|
+
|
|
102
|
+
The default bundle includes CEDAR Roboto 400 and 500. Hosts that register those
|
|
103
|
+
fonts in a global stylesheet can instead load
|
|
104
|
+
`cedar-embeddable-designer.host-fonts.js`. Both variants register CED and CEFD
|
|
105
|
+
with the same API; load only one. Without the host's font faces, the host-font
|
|
106
|
+
variant uses the shared system fallback stack.
|
|
107
|
+
|
|
108
|
+
## Embedding
|
|
109
|
+
|
|
110
|
+
Load the bundles, wait for registration, and start a template:
|
|
111
|
+
|
|
112
|
+
```html
|
|
113
|
+
<cedar-embeddable-designer></cedar-embeddable-designer>
|
|
114
|
+
|
|
115
|
+
<script src="/assets/cedar-embeddable-term-picker.js"></script>
|
|
116
|
+
<script src="/assets/cedar-embeddable-editor.js"></script>
|
|
117
|
+
<script src="/assets/cedar-embeddable-designer.js"></script>
|
|
118
|
+
<script type="module">
|
|
119
|
+
await customElements.whenDefined('cedar-embeddable-designer');
|
|
120
|
+
const designer = document.querySelector('cedar-embeddable-designer');
|
|
121
|
+
|
|
122
|
+
designer.config = {};
|
|
123
|
+
designer.addEventListener('artifactChange', (event) => {
|
|
124
|
+
console.log('Current template:', event.detail);
|
|
125
|
+
});
|
|
126
|
+
designer.addEventListener('validationChange', (event) => {
|
|
127
|
+
console.log('Ready to save:', event.detail.canSave);
|
|
128
|
+
});
|
|
129
|
+
designer.newArtifact('template');
|
|
130
|
+
</script>
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Set configuration before opening or creating a document. The empty configuration
|
|
134
|
+
supports basic authoring. Supply `terminologyBaseUrl` for vocabulary constraints
|
|
135
|
+
and controlled-term defaults, and `bridgeBaseUrl` for external-authority defaults.
|
|
136
|
+
Use your deployment's service bases; neither endpoint has a default. The
|
|
137
|
+
terminology service must support the Term Picker's version-aware search API.
|
|
138
|
+
|
|
139
|
+
Call `loadArtifact(source)` to open an existing template or element. It accepts
|
|
140
|
+
a JSON object, JSON text, or CEDAR YAML text and throws on invalid input without
|
|
141
|
+
replacing the current document. The `artifact` property accepts the same inputs
|
|
142
|
+
but reports unreadable input to the console. Use JavaScript properties for
|
|
143
|
+
objects, rather than HTML attributes.
|
|
144
|
+
|
|
145
|
+
`currentArtifact` and `artifactChange` contain the complete root artifact,
|
|
146
|
+
including edits to nested elements. The output is CEDAR JSON Schema with JSON-LD
|
|
147
|
+
annotations. CED does not submit or store it; the host controls persistence.
|
|
148
|
+
|
|
149
|
+
## Validation and Saving
|
|
150
|
+
|
|
151
|
+
Check `designer.validate().canSave` immediately before reading `currentArtifact`
|
|
152
|
+
for a save. An unfinished setting may be invalid while the last accepted
|
|
153
|
+
artifact is still valid, so the last change event is not a save-readiness check.
|
|
154
|
+
Listen for `validationChange` to update a host Save button and for `dirtyChange`
|
|
155
|
+
to track unsaved work, including incomplete edits.
|
|
156
|
+
|
|
157
|
+
Numeric constraints and defaults can contain exact values beyond JavaScript's
|
|
158
|
+
number precision. Use the model library's `JsonSourcePolicy.stringify` for a
|
|
159
|
+
JSON request body; ordinary `JSON.stringify` is not the exact-number serializer.
|
|
160
|
+
[Artifacts and Validation](https://metadatacenter.readthedocs.io/en/latest/cedar-embeddable-designer/artifacts-and-validation/)
|
|
161
|
+
includes a serialization example, server findings, merged-payload validation,
|
|
162
|
+
save-response handling, and recovery through `captureDraft()` and `restoreDraft()`.
|
|
163
|
+
|
|
164
|
+
Set `readOnly = true` for inspection without edits. Published definitions remain
|
|
165
|
+
locked independently of the host flag. Local validation complements server
|
|
166
|
+
validation, permissions, and publication rules.
|
|
167
|
+
|
|
168
|
+
## Reusable Elements and Standalone Fields
|
|
169
|
+
|
|
170
|
+
Use `newArtifact('element')` to author a standalone element. Supply a
|
|
171
|
+
`childSource` adapter to search and load existing fields and elements from a
|
|
172
|
+
repository. The host controls authentication and permissions; CED has no default
|
|
173
|
+
repository. See [Reusable Fields and Elements](https://metadatacenter.readthedocs.io/en/latest/cedar-embeddable-designer/reusable-content/).
|
|
174
|
+
|
|
175
|
+
The same bundle registers `<cedar-embeddable-field-designer>` for a field-only
|
|
176
|
+
workflow:
|
|
177
|
+
|
|
178
|
+
```typescript
|
|
179
|
+
import type { CedarEmbeddableFieldDesignerElement } from 'cedar-embeddable-designer';
|
|
180
|
+
|
|
181
|
+
await customElements.whenDefined('cedar-embeddable-field-designer');
|
|
182
|
+
const fieldDesigner = document.createElement('cedar-embeddable-field-designer') as CedarEmbeddableFieldDesignerElement;
|
|
183
|
+
document.body.append(fieldDesigner);
|
|
184
|
+
fieldDesigner.config = {};
|
|
185
|
+
fieldDesigner.newArtifact('text');
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
Omit the type to show the field-type chooser. CEFD shares the loading, validation,
|
|
189
|
+
change, recovery, and read-only APIs. It edits the field definition; its placement
|
|
190
|
+
inside a parent, including requirement and repetition, is configured in CED.
|
|
191
|
+
[Designing a Single Field](https://metadatacenter.readthedocs.io/en/latest/cedar-embeddable-designer/field-designer/)
|
|
192
|
+
covers the complete workflow.
|
|
193
|
+
|
|
194
|
+
## Appearance and Language
|
|
195
|
+
|
|
196
|
+
Both elements support English (`en`) and Hungarian (`hu`) through the `language`
|
|
197
|
+
property or attribute. English is the default. Language can change at runtime
|
|
198
|
+
and applies independently to each instance. Author-written content is never
|
|
199
|
+
translated.
|
|
200
|
+
|
|
201
|
+
The components use Shadow DOM and CEDAR's shared design tokens. See
|
|
202
|
+
[Configuration and Appearance](https://metadatacenter.readthedocs.io/en/latest/cedar-embeddable-designer/configuration/)
|
|
203
|
+
for framework integration, service requirements, fonts, and host security, and
|
|
204
|
+
the [shared styling guide](https://github.com/metadatacenter/cedar-embeddable-editor/blob/develop/STYLING.md)
|
|
205
|
+
for the common CEDAR control contract.
|
|
206
|
+
|
|
207
|
+
## Developing the Component
|
|
208
|
+
|
|
209
|
+
For source builds, use the Node version in `.nvmrc`:
|
|
210
|
+
|
|
211
|
+
```shell
|
|
212
|
+
nvm use
|
|
213
|
+
npm ci
|
|
214
|
+
npm run dist
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
`npm start` runs the development host. `npm run test:ci` runs the complete gate,
|
|
218
|
+
including browser and visual checks. These are contributor commands; embedding
|
|
219
|
+
the published package requires no component build.
|
|
220
|
+
|
|
221
|
+
[Development notes](https://github.com/metadatacenter/cedar-embeddable-designer/blob/develop/docs/development.md)
|
|
222
|
+
cover sibling integration, demos, testing, packaging, and styling ownership.
|
|
223
|
+
Within a CEDAR checkout, use `cedarcli build frontends` for a local source build
|
|
224
|
+
and deployment, or `cedarcli test frontends` for the source build and checks.
|
|
225
|
+
The reactor supplies current local dependencies automatically.
|
|
226
|
+
|
|
227
|
+
The package also includes `integration.mjs` for coordinated Angular host builds.
|
|
228
|
+
Its manifest records exact runtime requirements; ordinary embeds use the
|
|
229
|
+
self-contained script above.
|
|
230
|
+
|
|
231
|
+
## License
|
|
232
|
+
|
|
233
|
+
[BSD 2-Clause](https://github.com/metadatacenter/cedar-embeddable-designer/blob/develop/license.txt).
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"bytes": 1874033,
|
|
3
|
+
"sha256": "814a7693acc87f9f931d5acff5a5fe84d658066ba4cbbdd898fe0079170d5c6d",
|
|
4
|
+
"inputs": [
|
|
5
|
+
"dist/cedar-embeddable-designer-host-fonts/browser/polyfills.js",
|
|
6
|
+
"dist/cedar-embeddable-designer-host-fonts/browser/main.js"
|
|
7
|
+
],
|
|
8
|
+
"provenance": {
|
|
9
|
+
"source": "0577b5d7af4344ef4dda92769b322117096489975874b41660994350c4cf942a",
|
|
10
|
+
"output": "129d1729bc58e5b198096dbf46996ed811b8e646b05228d95022eb30338f4d9d"
|
|
11
|
+
}
|
|
12
|
+
}
|