You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@salesforcedevs/docs-components

Package Overview
Dependencies
Maintainers
17
Versions
795
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@salesforcedevs/docs-components - npm Package Compare versions

Comparing version

to
0.0.10-edit

2

package.json
{
"name": "@salesforcedevs/docs-components",
"version": "0.0.9-edit",
"version": "0.0.10-edit",
"description": "Docs Lightning web components for DSC",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -40,3 +40,4 @@ import { LightningElement, api, track } from "lwc";

// API Configuration
private static readonly FETCH_ENDPOINT = "https://1208ddd77328.ngrok-free.app/api/file-retrieval/retrieve";
private static readonly FETCH_ENDPOINT =
"https://1208ddd77328.ngrok-free.app/api/file-retrieval/retrieve";
private static readonly SAVE_ENDPOINT = "/api/file/save";

@@ -62,3 +63,4 @@

"edit-file-button_primary",
(this.isSaving || this.isContentUnchanged) && "edit-file-button_disabled"
(this.isSaving || this.isContentUnchanged) &&
"edit-file-button_disabled"
);

@@ -73,3 +75,5 @@ }

async handleEditClick() {
if (this.disabled) return;
if (this.disabled) {
return;
}

@@ -94,3 +98,3 @@ this.isPopoverOpen = true;

headers: {
"Content-Type": "application/json",
"Content-Type": "application/json"
},

@@ -113,11 +117,15 @@ body: JSON.stringify({

this.errorMessage = "";
// Set textarea value directly using ref
this.updateTextareaValue();
} else {
this.errorMessage = data.error || data.message || "Failed to load file content";
this.errorMessage =
data.error || data.message || "Failed to load file content";
}
} catch (error) {
console.error("Error fetching file content:", error);
this.errorMessage = error instanceof Error ? error.message : "Failed to connect to server";
this.errorMessage =
error instanceof Error
? error.message
: "Failed to connect to server";
} finally {

@@ -153,3 +161,5 @@ this.isLoading = false;

async handleSave() {
if (this.isSaving || this.isContentUnchanged || this.disabled) return;
if (this.isSaving || this.isContentUnchanged || this.disabled) {
return;
}

@@ -163,3 +173,3 @@ this.isSaving = true;

headers: {
"Content-Type": "application/json",
"Content-Type": "application/json"
},

@@ -182,7 +192,7 @@ body: JSON.stringify({

this.isPopoverOpen = false;
// Dispatch success event
this.dispatchEvent(
new CustomEvent("editsuccess", {
detail: {
detail: {
fileName: this.fileName,

@@ -195,7 +205,11 @@ content: this.fileContent,

} else {
this.errorMessage = data.error || data.message || "Failed to save file";
this.errorMessage =
data.error || data.message || "Failed to save file";
}
} catch (error) {
console.error("Error saving file:", error);
this.errorMessage = error instanceof Error ? error.message : "Failed to connect to server";
this.errorMessage =
error instanceof Error
? error.message
: "Failed to connect to server";
} finally {

@@ -224,3 +238,5 @@ this.isSaving = false;

setTimeout(() => {
const textarea = this.template.querySelector('#file-content') as HTMLTextAreaElement;
const textarea = this.template.querySelector(
"#file-content"
) as HTMLTextAreaElement;
if (textarea && this.fileContent !== undefined) {

@@ -248,2 +264,2 @@ textarea.value = this.fileContent;

}
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet