@kmiyh/pi-skills-menu 1.0.2 → 1.0.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmiyh/pi-skills-menu",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Pi extension that moves skills into a dedicated /skills menu with browsing, preview, editing, and AI-assisted creation.",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -96,6 +96,7 @@ class SkillsSelectorComponent extends Container implements Focusable {
96
96
  name: "",
97
97
  description: "",
98
98
  };
99
+ private submittedDescriptionValue: string | undefined;
99
100
  private createError: string | undefined;
100
101
  private browseQuery: string;
101
102
 
@@ -128,7 +129,8 @@ class SkillsSelectorComponent extends Container implements Focusable {
128
129
  noMatch: (text: string) => this.theme.fg("warning", text),
129
130
  },
130
131
  });
131
- this.descriptionEditor.onSubmit = () => {
132
+ this.descriptionEditor.onSubmit = (text: string) => {
133
+ this.submittedDescriptionValue = text;
132
134
  this.goToNextCreateStep();
133
135
  };
134
136
  this.filteredSkills = skills;
@@ -232,6 +234,7 @@ class SkillsSelectorComponent extends Container implements Focusable {
232
234
  this.descriptionEditor.focused = false;
233
235
  return;
234
236
  }
237
+ this.submittedDescriptionValue = undefined;
235
238
  this.descriptionEditor.setText(this.createValues.description);
236
239
  this.input.focused = false;
237
240
  this.descriptionEditor.focused = this._focused;
@@ -243,6 +246,11 @@ class SkillsSelectorComponent extends Container implements Focusable {
243
246
  this.createValues.name = this.input.getValue();
244
247
  return;
245
248
  }
249
+ if (this.submittedDescriptionValue !== undefined) {
250
+ this.createValues.description = this.submittedDescriptionValue;
251
+ this.submittedDescriptionValue = undefined;
252
+ return;
253
+ }
246
254
  this.createValues.description = this.descriptionEditor.getText();
247
255
  }
248
256
 
@@ -276,7 +284,6 @@ class SkillsSelectorComponent extends Container implements Focusable {
276
284
  }
277
285
 
278
286
  private submitCreate(): void {
279
- this.persistCreateInput();
280
287
  const name = normalizeSkillName(this.createValues.name);
281
288
  if (!name) {
282
289
  this.createStepIndex = 0;
@@ -511,6 +518,9 @@ class SkillsSelectorComponent extends Container implements Focusable {
511
518
  return;
512
519
  }
513
520
  this.descriptionEditor.handleInput(data);
521
+ if (matchesKey(data, Key.enter)) {
522
+ return;
523
+ }
514
524
  this.createValues.description = this.descriptionEditor.getText();
515
525
  this.refreshCreate();
516
526
  }