cedar-embeddable-editor 2.0.28 → 2.0.30

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,20 @@ 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.30] - 2026-10-27
9
+
10
+ Aligns with `cedar-model-typescript-library@1.0.25`.
11
+
12
+ - Adds a `required` setting to the field element's configuration. The aligned model library no longer lets a field written on its own state a requirement, so a host that places the field as required now says so in this setting.
13
+ - Keeps a host page's Material theme from restyling the editor, by binding every Material token CEE reads on its own shadow host.
14
+ - Registers the embedded fonts once in the document head rather than in every shadow root, and compiles the shadow-root stylesheet once rather than into both elements. The production bundle no longer carries the developer app, lodash or the whole `package.json`, and its manifest records the version the bundle reports as `reportedVersion`.
15
+
16
+ ## [2.0.29] - 2026-10-26
17
+
18
+ Aligns with `cedar-model-typescript-library@1.0.24`.
19
+
20
+ - Allows Save exactly when the CEDAR server would store the instance, judging it against the stored template as the export writes it, and keeps an instance's `@type` through a save.
21
+
8
22
  ## [2.0.28] - 2026-10-21
9
23
 
10
24
  Aligns with `cedar-model-typescript-library@1.0.23`.
package/README.md CHANGED
@@ -117,7 +117,14 @@ service URLs are needed only for controlled-term and external-authority lookups.
117
117
 
118
118
  Read the record back from `currentMetadata` as CEDAR JSON-LD, or from
119
119
  `currentMetadataYaml` as YAML. The CEE neither submits nor stores it. The host
120
- decides when and where a record is saved.
120
+ decides when and where a record is saved. `currentMetadataYaml` is the empty
121
+ string when no YAML can be written: while the instance input is rejected, or
122
+ while the instance names no template or has no name, as one from an unsaved
123
+ template does. `currentMetadata` is likewise the empty object while the instance
124
+ input is rejected or the instance names no template. The form from an unsaved
125
+ template is shown all the same, so a host that reads an empty `currentMetadata`
126
+ as a refusal assigns only a template that has an identifier. For an instance
127
+ that names no template, `captureDraft()` and `captureSave()` return `null`.
121
128
 
122
129
  For recovery across reloads, `captureDraft()` returns a JSON-serializable recovery document
123
130
  containing the template, accepted metadata and unfinished field input. This is **not** a
@@ -213,6 +220,14 @@ CEF then states the type above the description, with the icon its header would h
213
220
  drawn (for example, `Paragraph`). A host whose header already shows the type, as CED's
214
221
  field cards do, leaves it unset.
215
222
 
223
+ A field written on its own is not required, because only a template or an element
224
+ requires the field it places. A host that places the field as required sets
225
+ `required: true`. CEF then marks the field as CEE marks a required one, and reports an
226
+ empty value as missing unless `suppressEmptyFieldErrors` is set. Like every key, it
227
+ takes one assignment, so a change of requirement takes a new element. CEF refuses an
228
+ artifact that states a requirement or a recommendation itself, as both CEDAR model
229
+ libraries do.
230
+
216
231
  Read-only controls have no placeholder text, and fields without constraints draw empty
217
232
  boxes. Static fields show their content. A standalone page break is described without
218
233
  creating pagination.
@@ -317,7 +332,7 @@ npm run build:production
317
332
  npm run test:visual:prebuilt
318
333
  ```
319
334
 
320
- Use Node 24.22.0, which `.nvmrc`, `package.json` and CI all specify. The build and
335
+ Use Node 24.22.1, which `.nvmrc`, `package.json` and CI all specify. The build and
321
336
  tests use that same version, so the distribution is produced by the toolchain
322
337
  that exercises it.
323
338
 
@@ -401,7 +416,7 @@ The visual suite installs nothing here. It runs inside Playwright's own containe
401
416
  which carries the browsers it drives, and installs its dependencies there against a
402
417
  named volume — so it needs Docker running and no `playwright install` of its own.
403
418
 
404
- The CEE uses Angular 22.2 and Node 24.22.0. `.nvmrc`, the package `engines` field and
419
+ The CEE uses Angular 22.2 and Node 24.22.1. `.nvmrc`, the package `engines` field and
405
420
  CI specify the Node version.
406
421
 
407
422
  The application bundle and the visual fixture generator each install the model
@@ -4,6 +4,7 @@
4
4
  "main.js",
5
5
  "polyfills.js"
6
6
  ],
7
- "bytes": 2322399,
8
- "sha256": "a4c97b0129740bdb8f8287828bdeab0b449c798f9cb0b5c60744b255414969a6"
7
+ "bytes": 2236112,
8
+ "sha256": "3595bcec8380948ece0f2b9d529f265e3be55363f629f9caf556fe63dfdb949e",
9
+ "reportedVersion": "2.0.30"
9
10
  }
@@ -4,6 +4,7 @@
4
4
  "main.js",
5
5
  "polyfills.js"
6
6
  ],
7
- "bytes": 2444705,
8
- "sha256": "1fdb867309bebd46ae4d7f34d0c741a5737db9f34c4290da1179dba7c83fd90d"
7
+ "bytes": 2358766,
8
+ "sha256": "87ec2da47f8efa70bd7d8b7fa8d05a8126ac807a21f878fd098607b0284ce3d6",
9
+ "reportedVersion": "2.0.30"
9
10
  }
@@ -55,6 +55,15 @@ export interface CeeConfig {
55
55
  showFieldType?: boolean;
56
56
  /** Keep empty trial fields quiet without changing validity or nonempty-value errors. */
57
57
  suppressEmptyFieldErrors?: boolean;
58
+ /**
59
+ * For CEF: whether the field is required where the host places it.
60
+ *
61
+ * A field written on its own is not required, because only a template or an element requires the
62
+ * field it places. A host placing the field in a form of its own says so here. CEF then marks the
63
+ * field as CEE marks a required one, and reports an empty value as missing unless
64
+ * `suppressEmptyFieldErrors` is set. CEE reads its fields' requirements from the template.
65
+ */
66
+ required?: boolean;
58
67
  /**
59
68
  * Renders the form without editing controls.
60
69
  *
@@ -429,15 +438,29 @@ export interface CedarEmbeddableEditorElement extends HTMLElement {
429
438
  * after the assignment as a refusal. An instance assigned on its own is held while it waits for a
430
439
  * template, so a template refused after it leaves this holding the instance. The refusal's reason
431
440
  * goes to the event handler's `error`.
441
+ *
442
+ * It is also an empty object while the instance names no template, as one from an unsaved template
443
+ * does, since no JSON can be written for it. The form is shown all the same, so a host that reads an
444
+ * empty object as a refusal assigns only a template that has an identifier.
432
445
  */
433
446
  readonly currentMetadata: CeeJsonObject;
434
- /** Capture immediately before saving. Null while no readable form is loaded. */
447
+ /**
448
+ * Capture immediately before saving. Null while no readable form is loaded, and while the instance
449
+ * names no template, as one from an unsaved template does, since no repository stores it.
450
+ */
435
451
  readonly captureSave: () => CeeSaveSnapshot | null;
436
- /** Captures accepted values and unfinished input, independently of validity. */
452
+ /**
453
+ * Captures accepted values and unfinished input, independently of validity. Null while no readable
454
+ * form is loaded, and while the instance names no template, since no metadata can be written for it.
455
+ */
437
456
  readonly captureDraft: () => CeeRecoveryDraft | null;
438
457
  /** Restore into a fresh element; rejects incompatible or malformed data atomically. */
439
458
  readonly restoreDraft: (draft: CeeRecoveryDraft) => boolean;
440
- /** The instance as CEDAR YAML. Read-only. */
459
+ /**
460
+ * The instance as CEDAR YAML. Read-only. The empty string when no YAML can be written: while the
461
+ * instance input is rejected, or while the instance names no template or has no name, as one from
462
+ * an unsaved template does.
463
+ */
441
464
  readonly currentMetadataYaml: string;
442
465
  /** What CEE thinks of the instance. Read-only. */
443
466
  readonly dataQualityReport: CeeDataQualityReport;
@@ -526,7 +549,7 @@ export interface CedarEmbeddableFieldChangeDetail {
526
549
  * description — settle what an editor draws around a whole form. Field labels and
527
550
  * descriptions belong to this element in read-only mode.
528
551
  */
529
- export type CedarEmbeddableFieldConfig = Pick<CeeConfig, 'readOnlyMode' | 'previewMode' | 'showFieldType' | 'suppressEmptyFieldErrors' | 'trustTemplateRichText' | 'terminologyBaseUrl' | 'bridgeBaseUrl' | 'defaultLanguage' | 'fallbackLanguage' | 'languageMapPathPrefix'>;
552
+ export type CedarEmbeddableFieldConfig = Pick<CeeConfig, 'readOnlyMode' | 'previewMode' | 'showFieldType' | 'suppressEmptyFieldErrors' | 'required' | 'trustTemplateRichText' | 'terminologyBaseUrl' | 'bridgeBaseUrl' | 'defaultLanguage' | 'fallbackLanguage' | 'languageMapPathPrefix'>;
530
553
  /**
531
554
  * One field's control, as a host sees it.
532
555
  *
@@ -538,11 +561,12 @@ export type CedarEmbeddableFieldConfig = Pick<CeeConfig, 'readOnlyMode' | 'previ
538
561
  * value remains visible and cannot be edited. Static content is also described;
539
562
  * a standalone page break has a label and type but does not create pagination.
540
563
  *
541
- * Cardinality belongs to a field's deployment in a template, and this element deploys
542
- * nothing, so the value it acquires is single. Requiredness is the field's own: an
543
- * artifact that states `requiredValue: true` has an empty value reported as missing,
544
- * unless the host sets `suppressEmptyFieldErrors`. CED writes a field on its own with
545
- * `requiredValue: false`, which is what leaves a default value free to be empty.
564
+ * Cardinality and requirement belong to a field's placement in a template, and a field
565
+ * written on its own states neither, so the value this element acquires is single. A
566
+ * host that places the field as required says so with the `required` configuration
567
+ * key. Like the rest of the configuration it takes one assignment, so a change of
568
+ * requirement takes a new element. An artifact that states a requirement or a
569
+ * recommendation itself is refused, as both CEDAR model libraries refuse one.
546
570
  */
547
571
  export interface CedarEmbeddableFieldElement extends HTMLElement {
548
572
  /** Typed value event; the inherited overloads still handle every other DOM event. */