@magicx-eng/ai-autocomplete-angular 0.5.8 → 0.6.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.
@@ -1,9 +1,10 @@
1
+ import { buildAttributionUrl, getFooterHint, AIAutocomplete, getCursorOffset, extractPlainText, renderEditableContent, plainTextLength, setCursorOffset, ModeController, buildSubmitResult } from '@magicx-eng/ai-autocomplete-vanilla';
2
+ export { buildSubmitResult, withSkippedParams } from '@magicx-eng/ai-autocomplete-vanilla';
1
3
  import * as i1 from '@angular/common';
2
4
  import { CommonModule, isPlatformBrowser } from '@angular/common';
3
5
  import * as i0 from '@angular/core';
4
6
  import { Component, ChangeDetectionStrategy, ViewEncapsulation, Input, EventEmitter, Output, ViewChild, inject, ChangeDetectorRef, ElementRef, Renderer2, NgZone, Directive, PLATFORM_ID, forwardRef, NgModule } from '@angular/core';
5
7
  import { NG_VALUE_ACCESSOR } from '@angular/forms';
6
- import { buildAttributionUrl, getFooterHint, AIAutocomplete, getCursorOffset, extractPlainText, renderEditableContent, plainTextLength, setCursorOffset, ModeController, buildQuery } from '@magicx-eng/ai-autocomplete-vanilla';
7
8
  import { BehaviorSubject, combineLatest, map as map$1, distinctUntilChanged, shareReplay, Subject, takeUntil } from 'rxjs';
8
9
  import { map } from 'rxjs/operators';
9
10
 
@@ -607,6 +608,7 @@ class AIAutocompleteController {
607
608
  // works fine.
608
609
  this.text$ = deriveField(this.rawState$, (s) => s.text);
609
610
  this.completedParams$ = deriveField(this.rawState$, (s) => s.completedParams, arrEq);
611
+ this.skippedParams$ = deriveField(this.rawState$, (s) => s.skippedParams, arrEq);
610
612
  this.suggestionPills$ = deriveField(this.rawState$, (s) => s.actionableSuggestions, arrEq);
611
613
  this.segments$ = deriveField(this.rawState$, (s) => s.segments, arrEq);
612
614
  this.newParamId$ = deriveField(this.rawState$, (s) => s.newParamId);
@@ -814,6 +816,7 @@ function computeState(s) {
814
816
  return {
815
817
  text: s.text,
816
818
  completedParams: s.completedParams,
819
+ skippedParams: s.skippedParams,
817
820
  suggestionPills: s.actionableSuggestions,
818
821
  segments: s.segments,
819
822
  newParamId: s.newParamId,
@@ -1393,13 +1396,9 @@ class AIAutocompleteComponent {
1393
1396
  if (!editor)
1394
1397
  return;
1395
1398
  const text = extractPlainText(editor);
1396
- const params = this.completedParams ?? this.controller.getState().completedParams;
1397
- const built = buildQuery(text, params);
1398
- this.submitted.emit({
1399
- query: text.trim(),
1400
- raw_query: built.rawQuery,
1401
- completed_params: built.completedParams,
1402
- });
1399
+ const state = this.controller.getState();
1400
+ const params = this.completedParams ?? state.completedParams;
1401
+ this.submitted.emit(buildSubmitResult(text, params, state.skippedParams));
1403
1402
  this.controller.reset();
1404
1403
  }
1405
1404
  handleSubmitFromUserAction() {
@@ -1816,7 +1815,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
1816
1815
  * planned export list. Only symbols re-exported here are considered part of
1817
1816
  * the package's public contract (TDB §19.2).
1818
1817
  */
1819
- // === Tier 1: Full component ===
1818
+ // === Submit-result builder (folds skipped params into completed_params) ===
1820
1819
 
1821
1820
  /**
1822
1821
  * Generated bundle index. Do not edit.