@industry-theme/file-editing-panels 0.2.2 → 0.2.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.
Files changed (47) hide show
  1. package/dist/{index-RAIU1e6Y.js → index-4EvhSd1p.js} +2 -2
  2. package/dist/{index-RAIU1e6Y.js.map → index-4EvhSd1p.js.map} +1 -1
  3. package/dist/{index-DD_kem6H.js → index-4TyGgD0I.js} +2 -2
  4. package/dist/{index-DD_kem6H.js.map → index-4TyGgD0I.js.map} +1 -1
  5. package/dist/{index-UJ416dxI.js → index-BC_8EZr_.js} +2 -2
  6. package/dist/{index-UJ416dxI.js.map → index-BC_8EZr_.js.map} +1 -1
  7. package/dist/{index-CR6Xoofu.js → index-BcDbE3pK.js} +2 -2
  8. package/dist/{index-CR6Xoofu.js.map → index-BcDbE3pK.js.map} +1 -1
  9. package/dist/{index-BlPaGZBk.js → index-BdhAHbED.js} +2 -2
  10. package/dist/{index-BlPaGZBk.js.map → index-BdhAHbED.js.map} +1 -1
  11. package/dist/{index-C3nS7Yiu.js → index-Bjy-tLvR.js} +2 -2
  12. package/dist/{index-C3nS7Yiu.js.map → index-Bjy-tLvR.js.map} +1 -1
  13. package/dist/{index-DuVYHq19.js → index-C2DyN0ld.js} +2 -2
  14. package/dist/{index-DuVYHq19.js.map → index-C2DyN0ld.js.map} +1 -1
  15. package/dist/{index-C6qWcx_6.js → index-CGn-nZHE.js} +2 -2
  16. package/dist/{index-C6qWcx_6.js.map → index-CGn-nZHE.js.map} +1 -1
  17. package/dist/{index-CGg_iuSE.js → index-CtsvnJ0d.js} +2 -2
  18. package/dist/{index-CGg_iuSE.js.map → index-CtsvnJ0d.js.map} +1 -1
  19. package/dist/{index-B8t5ZXru.js → index-CxnscdvW.js} +2 -2
  20. package/dist/{index-B8t5ZXru.js.map → index-CxnscdvW.js.map} +1 -1
  21. package/dist/{index-x8WsxVsf.js → index-DSfEQ2VM.js} +2 -2
  22. package/dist/{index-x8WsxVsf.js.map → index-DSfEQ2VM.js.map} +1 -1
  23. package/dist/{index-C-79HWPu.js → index-DUTlnZqf.js} +2 -2
  24. package/dist/{index-C-79HWPu.js.map → index-DUTlnZqf.js.map} +1 -1
  25. package/dist/{index-uuzekAfi.js → index-Du-iiGu7.js} +2 -2
  26. package/dist/{index-uuzekAfi.js.map → index-Du-iiGu7.js.map} +1 -1
  27. package/dist/{index-DAj-6bKc.js → index-Ea-_uB8N.js} +2 -2
  28. package/dist/{index-DAj-6bKc.js.map → index-Ea-_uB8N.js.map} +1 -1
  29. package/dist/{index-DbJYCA_w.js → index-MzM-swvv.js} +52 -28
  30. package/dist/index-MzM-swvv.js.map +1 -0
  31. package/dist/{index-DDHzET8H.js → index-oKBZ-u6O.js} +2 -2
  32. package/dist/{index-DDHzET8H.js.map → index-oKBZ-u6O.js.map} +1 -1
  33. package/dist/{index-BCmAXJzV.js → index-w2vW-u1q.js} +2 -2
  34. package/dist/{index-BCmAXJzV.js.map → index-w2vW-u1q.js.map} +1 -1
  35. package/dist/{index-DiH_VlCK.js → index-zoffa73C.js} +2 -2
  36. package/dist/{index-DiH_VlCK.js.map → index-zoffa73C.js.map} +1 -1
  37. package/dist/panels/FileEditorPanel/FileEditorPanel.d.ts +18 -1
  38. package/dist/panels/FileEditorPanel/FileEditorPanel.d.ts.map +1 -1
  39. package/dist/panels/FileEditorPanel/index.d.ts +1 -1
  40. package/dist/panels/FileEditorPanel/index.d.ts.map +1 -1
  41. package/dist/panels/GitDiffPanel/GitDiffPanel.d.ts +24 -2
  42. package/dist/panels/GitDiffPanel/GitDiffPanel.d.ts.map +1 -1
  43. package/dist/panels/GitDiffPanel/index.d.ts +1 -1
  44. package/dist/panels/GitDiffPanel/index.d.ts.map +1 -1
  45. package/dist/panels.bundle.js +1 -1
  46. package/package.json +1 -1
  47. package/dist/index-DbJYCA_w.js.map +0 -1
@@ -216,7 +216,9 @@ const getLanguage = (path) => {
216
216
  const FileEditorPanelContent = ({
217
217
  context,
218
218
  actions: _actions,
219
- events
219
+ events,
220
+ filePath: filePathProp,
221
+ showCloseButton = true
220
222
  }) => {
221
223
  var _a2, _b, _c;
222
224
  const { theme: theme2 } = useTheme();
@@ -246,13 +248,22 @@ const FileEditorPanelContent = ({
246
248
  isSavingRef.current = false;
247
249
  setSaveError(null);
248
250
  }, [filePath]);
251
+ useEffect(() => {
252
+ if (filePathProp) {
253
+ console.log("[FileEditorPanel] Using prop-controlled file path:", filePathProp);
254
+ setFilePath(filePathProp);
255
+ }
256
+ }, [filePathProp]);
249
257
  useEffect(() => {
250
258
  var _a3;
251
- if ((_a3 = activeFileSlice == null ? void 0 : activeFileSlice.data) == null ? void 0 : _a3.path) {
259
+ if (!filePathProp && ((_a3 = activeFileSlice == null ? void 0 : activeFileSlice.data) == null ? void 0 : _a3.path)) {
252
260
  setFilePath(activeFileSlice.data.path);
253
261
  }
254
- }, [(_c = activeFileSlice == null ? void 0 : activeFileSlice.data) == null ? void 0 : _c.path]);
262
+ }, [filePathProp, (_c = activeFileSlice == null ? void 0 : activeFileSlice.data) == null ? void 0 : _c.path]);
255
263
  useEffect(() => {
264
+ if (filePathProp) {
265
+ return void 0;
266
+ }
256
267
  const unsubscribe = events.on("file:open", (event) => {
257
268
  const payload = event.payload;
258
269
  if (payload == null ? void 0 : payload.path) {
@@ -260,7 +271,7 @@ const FileEditorPanelContent = ({
260
271
  }
261
272
  });
262
273
  return unsubscribe;
263
- }, [events]);
274
+ }, [events, filePathProp]);
264
275
  const loadFile = useCallback(async () => {
265
276
  if (!filePath || !(fileSystem == null ? void 0 : fileSystem.readFile)) {
266
277
  latestFilePathRef.current = null;
@@ -532,7 +543,7 @@ const FileEditorPanelContent = ({
532
543
  }
533
544
  )
534
545
  ] }),
535
- filePath && /* @__PURE__ */ jsx$1(
546
+ filePath && showCloseButton && /* @__PURE__ */ jsx$1(
536
547
  "button",
537
548
  {
538
549
  onClick: handleClose2,
@@ -733,7 +744,10 @@ const languageFromPath = (filePath) => {
733
744
  const GitDiffPanelContent = ({
734
745
  context,
735
746
  actions: _actions,
736
- events
747
+ events,
748
+ filePath: filePathProp,
749
+ gitStatus: gitStatusProp,
750
+ showCloseButton = true
737
751
  }) => {
738
752
  var _a2;
739
753
  const { theme: theme2 } = useTheme();
@@ -746,6 +760,16 @@ const GitDiffPanelContent = ({
746
760
  const language2 = useMemo(() => languageFromPath(filePath), [filePath]);
747
761
  const fileSystem = (_a2 = context.adapters) == null ? void 0 : _a2.fileSystem;
748
762
  useEffect(() => {
763
+ if (filePathProp) {
764
+ console.log("[GitDiffPanel] Using prop-controlled file path:", filePathProp);
765
+ setFilePath(filePathProp);
766
+ setStatus2(gitStatusProp || "unstaged");
767
+ }
768
+ }, [filePathProp, gitStatusProp]);
769
+ useEffect(() => {
770
+ if (filePathProp) {
771
+ return void 0;
772
+ }
749
773
  const unsubscribe = events.on("git:diff", (event) => {
750
774
  const payload = event.payload;
751
775
  if (payload == null ? void 0 : payload.path) {
@@ -760,7 +784,7 @@ const GitDiffPanelContent = ({
760
784
  }
761
785
  });
762
786
  return unsubscribe;
763
- }, [events]);
787
+ }, [events, filePathProp]);
764
788
  useEffect(() => {
765
789
  let isActive = true;
766
790
  const loadDiff = async () => {
@@ -924,7 +948,7 @@ const GitDiffPanelContent = ({
924
948
  ]
925
949
  }
926
950
  ),
927
- /* @__PURE__ */ jsx$1(
951
+ showCloseButton && /* @__PURE__ */ jsx$1(
928
952
  "button",
929
953
  {
930
954
  onClick: handleClose2,
@@ -62256,7 +62280,7 @@ function legacy(parser2) {
62256
62280
  return new LanguageSupport(StreamLanguage.define(parser2));
62257
62281
  }
62258
62282
  function sql(dialectName) {
62259
- return import("./index-x8WsxVsf.js").then((m3) => m3.sql({ dialect: m3[dialectName] }));
62283
+ return import("./index-DSfEQ2VM.js").then((m3) => m3.sql({ dialect: m3[dialectName] }));
62260
62284
  }
62261
62285
  const languages = [
62262
62286
  // New-style language modes
@@ -62264,7 +62288,7 @@ const languages = [
62264
62288
  name: "C",
62265
62289
  extensions: ["c", "h", "ino"],
62266
62290
  load() {
62267
- return import("./index-C3nS7Yiu.js").then((m3) => m3.cpp());
62291
+ return import("./index-Bjy-tLvR.js").then((m3) => m3.cpp());
62268
62292
  }
62269
62293
  }),
62270
62294
  /* @__PURE__ */ LanguageDescription.of({
@@ -62272,7 +62296,7 @@ const languages = [
62272
62296
  alias: ["cpp"],
62273
62297
  extensions: ["cpp", "c++", "cc", "cxx", "hpp", "h++", "hh", "hxx"],
62274
62298
  load() {
62275
- return import("./index-C3nS7Yiu.js").then((m3) => m3.cpp());
62299
+ return import("./index-Bjy-tLvR.js").then((m3) => m3.cpp());
62276
62300
  }
62277
62301
  }),
62278
62302
  /* @__PURE__ */ LanguageDescription.of({
@@ -62294,7 +62318,7 @@ const languages = [
62294
62318
  name: "Go",
62295
62319
  extensions: ["go"],
62296
62320
  load() {
62297
- return import("./index-uuzekAfi.js").then((m3) => m3.go());
62321
+ return import("./index-Du-iiGu7.js").then((m3) => m3.go());
62298
62322
  }
62299
62323
  }),
62300
62324
  /* @__PURE__ */ LanguageDescription.of({
@@ -62309,7 +62333,7 @@ const languages = [
62309
62333
  name: "Java",
62310
62334
  extensions: ["java"],
62311
62335
  load() {
62312
- return import("./index-DAj-6bKc.js").then((m3) => m3.java());
62336
+ return import("./index-Ea-_uB8N.js").then((m3) => m3.java());
62313
62337
  }
62314
62338
  }),
62315
62339
  /* @__PURE__ */ LanguageDescription.of({
@@ -62324,7 +62348,7 @@ const languages = [
62324
62348
  name: "Jinja",
62325
62349
  extensions: ["j2", "jinja", "jinja2"],
62326
62350
  load() {
62327
- return import("./index-C-79HWPu.js").then((m3) => m3.jinja());
62351
+ return import("./index-DUTlnZqf.js").then((m3) => m3.jinja());
62328
62352
  }
62329
62353
  }),
62330
62354
  /* @__PURE__ */ LanguageDescription.of({
@@ -62332,7 +62356,7 @@ const languages = [
62332
62356
  alias: ["json5"],
62333
62357
  extensions: ["json", "map"],
62334
62358
  load() {
62335
- return import("./index-C6qWcx_6.js").then((m3) => m3.json());
62359
+ return import("./index-CGn-nZHE.js").then((m3) => m3.json());
62336
62360
  }
62337
62361
  }),
62338
62362
  /* @__PURE__ */ LanguageDescription.of({
@@ -62346,14 +62370,14 @@ const languages = [
62346
62370
  name: "LESS",
62347
62371
  extensions: ["less"],
62348
62372
  load() {
62349
- return import("./index-B8t5ZXru.js").then((m3) => m3.less());
62373
+ return import("./index-CxnscdvW.js").then((m3) => m3.less());
62350
62374
  }
62351
62375
  }),
62352
62376
  /* @__PURE__ */ LanguageDescription.of({
62353
62377
  name: "Liquid",
62354
62378
  extensions: ["liquid"],
62355
62379
  load() {
62356
- return import("./index-UJ416dxI.js").then((m3) => m3.liquid());
62380
+ return import("./index-BC_8EZr_.js").then((m3) => m3.liquid());
62357
62381
  }
62358
62382
  }),
62359
62383
  /* @__PURE__ */ LanguageDescription.of({
@@ -62385,7 +62409,7 @@ const languages = [
62385
62409
  name: "PHP",
62386
62410
  extensions: ["php", "php3", "php4", "php5", "php7", "phtml"],
62387
62411
  load() {
62388
- return import("./index-DDHzET8H.js").then((m3) => m3.php());
62412
+ return import("./index-oKBZ-u6O.js").then((m3) => m3.php());
62389
62413
  }
62390
62414
  }),
62391
62415
  /* @__PURE__ */ LanguageDescription.of({
@@ -62406,28 +62430,28 @@ const languages = [
62406
62430
  extensions: ["BUILD", "bzl", "py", "pyw"],
62407
62431
  filename: /^(BUCK|BUILD)$/,
62408
62432
  load() {
62409
- return import("./index-DiH_VlCK.js").then((m3) => m3.python());
62433
+ return import("./index-zoffa73C.js").then((m3) => m3.python());
62410
62434
  }
62411
62435
  }),
62412
62436
  /* @__PURE__ */ LanguageDescription.of({
62413
62437
  name: "Rust",
62414
62438
  extensions: ["rs"],
62415
62439
  load() {
62416
- return import("./index-RAIU1e6Y.js").then((m3) => m3.rust());
62440
+ return import("./index-4EvhSd1p.js").then((m3) => m3.rust());
62417
62441
  }
62418
62442
  }),
62419
62443
  /* @__PURE__ */ LanguageDescription.of({
62420
62444
  name: "Sass",
62421
62445
  extensions: ["sass"],
62422
62446
  load() {
62423
- return import("./index-BlPaGZBk.js").then((m3) => m3.sass({ indented: true }));
62447
+ return import("./index-BdhAHbED.js").then((m3) => m3.sass({ indented: true }));
62424
62448
  }
62425
62449
  }),
62426
62450
  /* @__PURE__ */ LanguageDescription.of({
62427
62451
  name: "SCSS",
62428
62452
  extensions: ["scss"],
62429
62453
  load() {
62430
- return import("./index-BlPaGZBk.js").then((m3) => m3.sass());
62454
+ return import("./index-BdhAHbED.js").then((m3) => m3.sass());
62431
62455
  }
62432
62456
  }),
62433
62457
  /* @__PURE__ */ LanguageDescription.of({
@@ -62462,7 +62486,7 @@ const languages = [
62462
62486
  name: "WebAssembly",
62463
62487
  extensions: ["wat", "wast"],
62464
62488
  load() {
62465
- return import("./index-CR6Xoofu.js").then((m3) => m3.wast());
62489
+ return import("./index-BcDbE3pK.js").then((m3) => m3.wast());
62466
62490
  }
62467
62491
  }),
62468
62492
  /* @__PURE__ */ LanguageDescription.of({
@@ -62470,7 +62494,7 @@ const languages = [
62470
62494
  alias: ["rss", "wsdl", "xsd"],
62471
62495
  extensions: ["xml", "xsl", "xsd", "svg"],
62472
62496
  load() {
62473
- return import("./index-CGg_iuSE.js").then((m3) => m3.xml());
62497
+ return import("./index-CtsvnJ0d.js").then((m3) => m3.xml());
62474
62498
  }
62475
62499
  }),
62476
62500
  /* @__PURE__ */ LanguageDescription.of({
@@ -62478,7 +62502,7 @@ const languages = [
62478
62502
  alias: ["yml"],
62479
62503
  extensions: ["yaml", "yml"],
62480
62504
  load() {
62481
- return import("./index-BCmAXJzV.js").then((m3) => m3.yaml());
62505
+ return import("./index-w2vW-u1q.js").then((m3) => m3.yaml());
62482
62506
  }
62483
62507
  }),
62484
62508
  // Legacy modes ported from CodeMirror 5
@@ -63267,13 +63291,13 @@ const languages = [
63267
63291
  name: "Vue",
63268
63292
  extensions: ["vue"],
63269
63293
  load() {
63270
- return import("./index-DuVYHq19.js").then((m3) => m3.vue());
63294
+ return import("./index-C2DyN0ld.js").then((m3) => m3.vue());
63271
63295
  }
63272
63296
  }),
63273
63297
  /* @__PURE__ */ LanguageDescription.of({
63274
63298
  name: "Angular Template",
63275
63299
  load() {
63276
- return import("./index-DD_kem6H.js").then((m3) => m3.angular());
63300
+ return import("./index-4TyGgD0I.js").then((m3) => m3.angular());
63277
63301
  }
63278
63302
  })
63279
63303
  ];
@@ -76539,4 +76563,4 @@ export {
76539
76563
  onPackageUnload as y,
76540
76564
  fileEditingPanelTools as z
76541
76565
  };
76542
- //# sourceMappingURL=index-DbJYCA_w.js.map
76566
+ //# sourceMappingURL=index-MzM-swvv.js.map