@myrmidon/gve-snapshot-rendition 2.0.3 → 2.0.4

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/dist/index.js CHANGED
@@ -25917,7 +25917,7 @@ class GveSnapshotRendition extends HTMLElement {
25917
25917
  * of the web component is loaded.
25918
25918
  */
25919
25919
  static get version() {
25920
- return "2.0.3";
25920
+ return "2.0.4";
25921
25921
  }
25922
25922
  constructor() {
25923
25923
  super();
@@ -40847,7 +40847,7 @@ function requireD () {
40847
40847
  + 'pragma private protected public pure ref return scope shared static struct '
40848
40848
  + 'super switch synchronized template this throw try typedef typeid typeof union '
40849
40849
  + 'unittest version void volatile while with __FILE__ __LINE__ __gshared|10 '
40850
- + '__thread __traits __DATE__ __EOF__ __TIME__ __TIMESTAMP__ __VENDOR__ 2.0.3',
40850
+ + '__thread __traits __DATE__ __EOF__ __TIME__ __TIMESTAMP__ __VENDOR__ 2.0.4',
40851
40851
  built_in:
40852
40852
  'bool cdouble cent cfloat char creal dchar delegate double dstring float function '
40853
40853
  + 'idouble ifloat ireal long real short string ubyte ucent uint ulong ushort wchar '
@@ -91112,6 +91112,21 @@ class GveHintDesigner extends HTMLElement {
91112
91112
  // Word wrap toggles
91113
91113
  this.addClickListener("toggle-svg-wrap", () => this.toggleSvgWordWrap());
91114
91114
  this.addClickListener("toggle-js-wrap", () => this.toggleJsWordWrap());
91115
+ // Form field highlighting (non-default values)
91116
+ [
91117
+ this._positionSelect,
91118
+ this._offsetXInput,
91119
+ this._offsetYInput,
91120
+ this._scaleXInput,
91121
+ this._scaleYInput,
91122
+ this._rotationInput,
91123
+ this._displacedRefSpanInput,
91124
+ ].forEach((el) => {
91125
+ if (el) {
91126
+ el.addEventListener("input", () => this.updateFormFieldHighlights());
91127
+ el.addEventListener("change", () => this.updateFormFieldHighlights());
91128
+ }
91129
+ });
91115
91130
  // Syntax highlighting on textareas
91116
91131
  if (this._svgTextarea) {
91117
91132
  this._svgTextarea.addEventListener("input", () => this.highlightSvg());
@@ -91346,6 +91361,7 @@ class GveHintDesigner extends HTMLElement {
91346
91361
  }
91347
91362
  // Auto-refresh SVG display when hint is loaded
91348
91363
  this.refreshSvgDisplay();
91364
+ this.updateFormFieldHighlights();
91349
91365
  this._logger.debug("Component", "Loaded hint for editing", hintId);
91350
91366
  }
91351
91367
  /**
@@ -91372,6 +91388,7 @@ class GveHintDesigner extends HTMLElement {
91372
91388
  this._jsTextarea.value = "";
91373
91389
  if (this._embeddedJsCheckbox)
91374
91390
  this._embeddedJsCheckbox.checked = false;
91391
+ this.updateFormFieldHighlights();
91375
91392
  }
91376
91393
  /**
91377
91394
  * Validate SVG code for well-formedness and structure.
@@ -92604,6 +92621,30 @@ class GveHintDesigner extends HTMLElement {
92604
92621
  this.validateSvgVariables(svgCode);
92605
92622
  }
92606
92623
  }
92624
+ /**
92625
+ * Update the highlighted state of all Hint Properties form rows.
92626
+ * Rows whose value differs from the default get the form-row--modified class.
92627
+ */
92628
+ updateFormFieldHighlights() {
92629
+ this.setFormRowModified(this._positionSelect, this._positionSelect?.value !== "o");
92630
+ this.setFormRowModified(this._offsetXInput, this.isOffsetModified(this._offsetXInput?.value));
92631
+ this.setFormRowModified(this._offsetYInput, this.isOffsetModified(this._offsetYInput?.value));
92632
+ this.setFormRowModified(this._scaleXInput, parseFloat(this._scaleXInput?.value ?? "1") !== 1);
92633
+ this.setFormRowModified(this._scaleYInput, parseFloat(this._scaleYInput?.value ?? "1") !== 1);
92634
+ this.setFormRowModified(this._rotationInput, parseFloat(this._rotationInput?.value ?? "0") !== 0);
92635
+ this.setFormRowModified(this._displacedRefSpanInput, (this._displacedRefSpanInput?.value ?? "").trim() !== "");
92636
+ }
92637
+ isOffsetModified(value) {
92638
+ if (!value)
92639
+ return false;
92640
+ const parsed = this.parseOffset(value);
92641
+ return typeof parsed === "string" || parsed !== 0;
92642
+ }
92643
+ setFormRowModified(input, modified) {
92644
+ if (!input?.parentElement)
92645
+ return;
92646
+ input.parentElement.classList.toggle("form-row--modified", modified);
92647
+ }
92607
92648
  /**
92608
92649
  * Show a message in the message panel.
92609
92650
  */
@@ -93044,6 +93085,17 @@ class GveHintDesigner extends HTMLElement {
93044
93085
  min-width: auto;
93045
93086
  }
93046
93087
 
93088
+ .form-row--modified label {
93089
+ color: var(--hint-designer-primary, #1565c0);
93090
+ font-weight: 700;
93091
+ }
93092
+
93093
+ .form-row--modified input,
93094
+ .form-row--modified select {
93095
+ border-color: var(--hint-designer-primary-border, #2196f3);
93096
+ background-color: #e3f2fd;
93097
+ }
93098
+
93047
93099
  .textarea-header {
93048
93100
  display: flex;
93049
93101
  justify-content: space-between;