cedar-embeddable-editor 2.0.19 → 2.0.20

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
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [2.0.20] - 2026-10-05
9
+
10
+ Aligns with `cedar-model-typescript-library@1.0.16`.
11
+
12
+ - Includes paragraph character limits, every stored constraint problem stated at its field in each language, checked host value shapes, read-only guards and immediate lookup cancellation.
13
+
8
14
  ## [2.0.19] - 2026-10-02
9
15
 
10
16
  Aligns with `cedar-model-typescript-library@1.0.15`.
@@ -112,6 +118,15 @@ Aligns with `cedar-model-typescript-library@1.0.13`.
112
118
  - Compact YAML downloads retain the template's root ID but omit the IDs of nested fields and
113
119
  elements. Full YAML downloads continue to carry the complete identity tree.
114
120
 
121
+ - The form's header sets CEE's name and version stamp beside the mark rather than beneath it, so
122
+ the identity is no taller than the mark. Beside a title with a description, the identity and the
123
+ template's version and status keep to the top of the row, level with the title. At 520px or
124
+ narrower they take a row of their own above the title, which then has the full width.
125
+
126
+ - Every text box carries `autocomplete="off"`. A browser otherwise listed beneath a field what had
127
+ been typed into any box with the same name or id, and Angular Material gives each input an id
128
+ such as `mat-input-3`, so the list could hold values from an unrelated form.
129
+
115
130
  ### Fixed
116
131
 
117
132
  - `minItems` and `maxItems` on a repeating field inside a repeating element are checked in
package/README.md CHANGED
@@ -39,9 +39,9 @@ gives the input properties, the output properties, and the change event a host
39
39
  reads.
40
40
 
41
41
  For the design rationale, the architecture, and deployments in research
42
- platforms, see [*Author Once, Publish Everywhere: Portable Metadata Authoring
43
- with the CEDAR Embeddable Editor*](https://doi.org/10.5334/dsj-2026-002),
44
- published in the *Data Science Journal* (2026).
42
+ platforms, see [_Author Once, Publish Everywhere: Portable Metadata Authoring
43
+ with the CEDAR Embeddable Editor_](https://doi.org/10.5334/dsj-2026-002),
44
+ published in the _Data Science Journal_ (2026).
45
45
 
46
46
  ## Installing
47
47
 
@@ -135,6 +135,23 @@ messages even after blur. Nonempty invalid values and incomplete temporal values
135
135
  show errors. This affects presentation only: required fields remain invalid in the quality
136
136
  report. Ordinary metadata editing leaves the option off.
137
137
 
138
+ ## Validation
139
+
140
+ Read `dataQualityReport` for the whole instance, including nested and off-screen
141
+ occurrences. Each problem has a code, `severity` (`warning` or `error`), a field
142
+ `path` and occurrence indices. Pass a field problem to `reveal(problem)` to reach it.
143
+
144
+ Missing required answers, insufficient occurrences and unnamed attribute rows are
145
+ warnings. Invalid values, malformed incoming data and unfinished edits are errors.
146
+ Either makes `isValid` false; the host decides whether saving is allowed. A required
147
+ field must be answered in every existing containing element. A repeating field
148
+ needs at least one answer within each such element.
149
+
150
+ The report includes unfinished date/time and attribute-name edits, and `change`
151
+ fires when metadata **or the report** changes. Invalid imported field IRIs and
152
+ well-shaped numeric, temporal and IRI defaults remain available for correction.
153
+ Terminology membership and server-side validation remain the host's responsibility.
154
+
138
155
  ## Embedding a Single Field
139
156
 
140
157
  The bundle registers a second element. `<cedar-embeddable-field>` renders one field
@@ -219,6 +236,20 @@ field?.addEventListener('valueChange', (event: CustomEvent<CedarEmbeddableFieldC
219
236
  the control afresh — the field being designed changes type under its author's hand.
220
237
  `config` takes one assignment, as the editor's does. A value of a kind the field
221
238
  cannot hold is reported through `eventHandler` and ignored rather than coerced.
239
+ Malformed runtime payloads are also rejected, including assignments made before the
240
+ field arrives. Accepted values and artifacts are copied; host mutation after an
241
+ assignment does not change the editor. Getters and events return detached values.
242
+
243
+ A numeric value has the shape `{ kind: 'number', value: number | string }`.
244
+ Ordinary numbers remain numbers. When converting to a JavaScript number would lose
245
+ significant digits or exceed its range, CEF returns the exact numeric string instead:
246
+ `9007199254740993` and `0.1234567890123456789` retain every digit. Both forms may be
247
+ assigned back through `value`. Constraint validity remains a separate result.
248
+
249
+ Read-only mode guards user mutations in the controller, including late callbacks
250
+ and structural edits. Explicit host `value` assignments still work. Controlled-term
251
+ and external-authority searches cancel on a new query, a read-only transition, or
252
+ widget destruction; an old response cannot overwrite a newer query.
222
253
 
223
254
  Requiredness and cardinality belong to a field's deployment inside a template, and
224
255
  this element deploys nothing, so the value it acquires is single and is allowed to be
@@ -412,3 +443,12 @@ for all available settings.
412
443
 
413
444
  3. In your browser, navigate to `http://localhost:4400/`. The app will
414
445
  automatically reload if you change any of the source files.
446
+
447
+ The host lifecycle matrix in
448
+ `src/app/modules/shared/components/wrapper-lifecycle-matrix.spec.ts` crosses three input
449
+ arrival orders, host mutation, one or two simultaneous numeric/lookup wrapper pairs,
450
+ ordinary/large-integer/precise-decimal values, initial/late/no read-only state,
451
+ and superseded lookup success/error/completion (324 cases). It runs in `npm test`
452
+ with real wrappers, artifact coordination, controllers and lookup streams; rendering
453
+ and HTTP are substituted. The Angular coordinator suite separately verifies rendered
454
+ controls, simultaneous wrappers, host events and malformed assignments.
@@ -4,6 +4,6 @@
4
4
  "main.js",
5
5
  "polyfills.js"
6
6
  ],
7
- "bytes": 2207976,
8
- "sha256": "3420439a5f96c136ee9fe2552891041c826e76496f5663416633c56d1e14082b"
7
+ "bytes": 2228152,
8
+ "sha256": "7fdb1fbd1a59b2cdc77e6c6d54716398809d6f3438ebe2c99272fde0e5a38647"
9
9
  }
@@ -4,6 +4,6 @@
4
4
  "main.js",
5
5
  "polyfills.js"
6
6
  ],
7
- "bytes": 2391786,
8
- "sha256": "daa2df903e9bfb833dd69fa7827d79b22f7148eacf283979452cbfaa9a842535"
7
+ "bytes": 2350430,
8
+ "sha256": "9cc4c9cb9e669d79bba195fdaaa3df9ea11228d54896783bc00ccd21e542d619"
9
9
  }
@@ -157,6 +157,8 @@ export interface CeeTemplateAndInstance {
157
157
  * TypeScript host could not read either without a cast.
158
158
  */
159
159
  export interface CeeValidationProblem {
160
+ /** Missing answers are warnings; invalid values and unfinished edits are errors. Both affect isValid. */
161
+ severity: 'warning' | 'error';
160
162
  /** Machine-readable code, e.g. `numberType` or `temporalGranularity`. */
161
163
  code: string;
162
164
  /** Path to the offending value, outermost first. */
@@ -167,7 +169,7 @@ export interface CeeValidationProblem {
167
169
  * A path names one place per entry of everything above it that repeats, and this
168
170
  * says which entry holds the problem. A problem about a whole list, such as
169
171
  * `minItems`, names the entries above the list and none of its own; a `required`
170
- * problem names none, because any entry would satisfy it. Pass the problem to
172
+ * problem names the containing elements whose requirement is unfilled. Pass the problem to
171
173
  * `reveal` to take the user to it.
172
174
  */
173
175
  occurrences: number[];
@@ -224,15 +226,15 @@ export interface CeeDataQualityReport {
224
226
  /**
225
227
  * How many of those the instance fills.
226
228
  *
227
- * A requirement is met when any occurrence carries a value, so this is
228
- * unaffected by which page the form is showing.
229
+ * A required field needs at least one value in every existing containing element.
230
+ * This is unaffected by which occurrence the form is showing.
229
231
  */
230
232
  nonNullRequiredFieldValueCount: number;
231
233
  /**
232
234
  * Validation problems.
233
235
  *
234
- * Includes one `required` problem for each unsatisfied required field
235
- * declaration, while the two counters retain their existing aggregate view.
236
+ * Includes a located `required` warning for each containing element with an
237
+ * unanswered requirement. The two counters count declarations, not occurrences.
236
238
  */
237
239
  problems: CeeValidationProblem[];
238
240
  /** True when every required field is filled and no constraint is violated. */
@@ -358,7 +360,16 @@ export interface CedarEmbeddableEditorElement extends HTMLElement {
358
360
  * Replacing one is traced, so a page whose messages stop arriving can see why.
359
361
  */
360
362
  eventHandler: CeeEventHandler;
361
- /** The instance as CEDAR JSON. Read-only. */
363
+ /**
364
+ * The instance as CEDAR JSON. Read-only.
365
+ *
366
+ * An empty object while the editor holds no artifact. An input it refuses because it is not a
367
+ * readable CEDAR artifact leaves it holding none, so a host that assigns a template on its own, or a
368
+ * template and instance together through `templateAndInstanceObject`, reads an empty object straight
369
+ * after the assignment as a refusal. An instance assigned on its own is held while it waits for a
370
+ * template, so a template refused after it leaves this holding the instance. The refusal's reason
371
+ * goes to the event handler's `error`.
372
+ */
362
373
  readonly currentMetadata: CeeJsonObject;
363
374
  /** The instance as CEDAR YAML. Read-only. */
364
375
  readonly currentMetadataYaml: string;
@@ -390,7 +401,7 @@ export interface CedarEmbeddableEditorElement extends HTMLElement {
390
401
  * Embeddable Designer's single `defaultValue: string` has.
391
402
  *
392
403
  * `none` is an unfilled field. It is also what a numeric field reports while it holds
393
- * something that is not yet a number, `3.` on the way to `3.5`; `valid` on the change
404
+ * something that is not yet a number, `-` on the way to `-3.5`; `valid` on the change
394
405
  * detail separates that from empty.
395
406
  */
396
407
  export type CedarEmbeddableFieldValue = {
@@ -401,10 +412,10 @@ export type CedarEmbeddableFieldValue = {
401
412
  kind: 'literal';
402
413
  value: string;
403
414
  }
404
- /** A numeric field, once what it holds is a finite number. */
415
+ /** A numeric field. Exact decimal strings preserve values a JavaScript number would round. */
405
416
  | {
406
417
  kind: 'number';
407
- value: number;
418
+ value: number | string;
408
419
  }
409
420
  /** A date or time, as the ISO literal its granularity calls for. */
410
421
  | {
@@ -454,10 +465,11 @@ export type CedarEmbeddableFieldConfig = Pick<CeeConfig, 'readOnlyMode' | 'previ
454
465
  * value remains visible and cannot be edited. Static content is also described;
455
466
  * a standalone page break has a label and type but does not create pagination.
456
467
  *
457
- * A field artifact carries no requiredness and no cardinality — both belong to a
458
- * field's deployment in a template, and this element deploys nothing — so the value
459
- * it acquires is single and is allowed to be absent. That is what makes it usable for
460
- * a default value, which is optional by definition.
468
+ * Cardinality belongs to a field's deployment in a template, and this element deploys
469
+ * nothing, so the value it acquires is single. Requiredness is the field's own: an
470
+ * artifact that states `requiredValue: true` has an empty value reported as missing,
471
+ * unless the host sets `suppressEmptyFieldErrors`. CED writes a field on its own with
472
+ * `requiredValue: false`, which is what leaves a default value free to be empty.
461
473
  */
462
474
  export interface CedarEmbeddableFieldElement extends HTMLElement {
463
475
  /** Typed value event; the inherited overloads still handle every other DOM event. */