@industry-theme/principal-view-panels 0.12.115 → 0.12.116

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 +1 @@
1
- {"version":3,"file":"CanvasEditorPanel.d.ts","sourceRoot":"","sources":["../../src/panels/CanvasEditorPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AACjF,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAI5D,OAAO,KAAK,EAAqD,gBAAgB,EAA+C,MAAM,mCAAmC,CAAC;AAE1K,OAAO,EAAqB,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAKxE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAoDrE;;GAEG;AACH,MAAM,WAAW,sBAAuB,SAAQ,2BAA2B;IACzE;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,cAAc,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;IAEjC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAE3C;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEnC;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE7B;;OAEG;IACH,gBAAgB,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;IAEnC;;;OAGG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC;QACrB,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;QAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B,CAAC,CAAC;IAEH;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEnC;;;;OAIG;I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AAU,EAAE,MAAM,CAAC;QACnB,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;QAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B,CAAC,CAAC;IAEH;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEnC;;;;OAIG;IACH,aAAa,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;IAEvC;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAE1B;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEhC;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACrC;AAED;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAs9D9D,CAAC"}
@@ -30,6 +30,20 @@ export declare class ConfigLoader {
30
30
  relativePath?: string;
31
31
  name?: string;
32
32
  }>): string | null;
33
+ /**
34
+ * Find the first .scopes.canvas file in the .principal-views/ folder
35
+ * Returns the relative path if found, null otherwise
36
+ *
37
+ * Looks for files like:
38
+ * - .principal-views/scopes.canvas
39
+ * - .principal-views/architecture.scopes.canvas
40
+ * - packages/foo/.principal-views/architecture.scopes.canvas
41
+ */
42
+ static findScopesCanvasPath(files: Array<{
43
+ path?: string;
44
+ relativePath?: string;
45
+ name?: string;
46
+ }>): string | null;
33
47
  /**
34
48
  * Find all .canvas files in any .principal-views/ folder (root or packages)
35
49
  * Returns array of config files with metadata
@@ -1 +1 @@
1
- {"version":3,"file":"ConfigLoader.d.ts","sourceRoot":"","sources":["../../../src/panels/principal-view/ConfigLoader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAG1F,MAAM,WAAW,UAAU;IACzB,gEAAgE;IAChE,EAAE,EAAE,MAAM,CAAC;IACX,mCAAmC;IACnC,IAAI,E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EG;IACH,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB;IAQtD;;;OAGG;IACH,MAAM,CAAC,eAAe,CAAC,KAAK,EAAE,KAAK,CAAC;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG,MAAM,GAAG,IAAI;IAgB5G;;;;;;;;OAQG;IACH,MAAM,CAAC,oBAAoB,CAAC,KAAK,EAAE,KAAK,CAAC;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG,MAAM,GAAG,IAAI;IAkBjH;;;OAGG;IACH,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,KAAK,CAAC;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG,UAAU,EAAE;CA6CxG"}
@@ -186435,6 +186435,27 @@ class ConfigLoader {
186435
186435
  }
186436
186436
  return null;
186437
186437
  }
186438
+ /**
186439
+ * Find the first .scopes.canvas file in the .principal-views/ folder
186440
+ * Returns the relative path if found, null otherwise
186441
+ *
186442
+ * Looks for files like:
186443
+ * - .principal-views/scopes.canvas
186444
+ * - .principal-views/architecture.scopes.canvas
186445
+ * - packages/foo/.principal-views/architecture.scopes.canvas
186446
+ */
186447
+ static findScopesCanvasPath(files) {
186448
+ const VGC_FOLDER = ".principal-views";
186449
+ for (const file of files) {
186450
+ const filePath = file.relativePath || file.path || "";
186451
+ const fileName = file.name || "";
186452
+ const isInPrincipalViews = filePath.startsWith(`${VGC_FOLDER}/`) || filePath.includes(`/${VGC_FOLDER}/`);
186453
+ if (isInPrincipalViews && fileName.endsWith(".scopes.canvas")) {
186454
+ return filePath;
186455
+ }
186456
+ }
186457
+ return null;
186458
+ }
186438
186459
  /**
186439
186460
  * Find all .canvas files in any .principal-views/ folder (root or packages)
186440
186461
  * Returns array of config files with metadata
@@ -190910,6 +190931,7 @@ const CanvasEditorPanel = ({
190910
190931
  const canvasContainerRef = useRef(null);
190911
190932
  const [containerDimensions, setContainerDimensions] = useState(null);
190912
190933
  const libraryPathRef = useRef(null);
190934
+ const scopesCanvasPathRef = useRef(null);
190913
190935
  const [state, setState] = useState({
190914
190936
  canvas: null,
190915
190937
  library: DEFAULT_LIBRARY,
@@ -191066,14 +191088,23 @@ const CanvasEditorPanel = ({
191066
191088
  }
191067
191089
  }
191068
191090
  let scopesCanvas = null;
191069
- try {
191070
- const scopesFullPath = `${repositoryPath}/.principal-views/scopes.canvas`;
191071
- const scopesContent = await readFile(scopesFullPath);
191072
- if (scopesContent && typeof scopesContent === "string") {
191073
- scopesCanvas = ConfigLoader.parseCanvas(scopesContent);
191091
+ if (fileTreeSlice && !fileTreeSlice.loading) {
191092
+ const fileTreeData = fileTreeSlice.data;
191093
+ if (fileTreeData == null ? void 0 : fileTreeData.allFiles) {
191094
+ const scopesCanvasPath = ConfigLoader.findScopesCanvasPath(fileTreeData.allFiles);
191095
+ if (scopesCanvasPath) {
191096
+ scopesCanvasPathRef.current = `${repositoryPath}/${scopesCanvasPath}`;
191097
+ try {
191098
+ const scopesFullPath = `${repositoryPath}/${scopesCanvasPath}`;
191099
+ const scopesContent = await readFile(scopesFullPath);
191100
+ if (scopesContent && typeof scopesContent === "string") {
191101
+ scopesCanvas = ConfigLoader.parseCanvas(scopesContent);
191102
+ }
191103
+ } catch (scopesError) {
191104
+ console.warn("[PrincipalView] Failed to load scopes canvas:", scopesError);
191105
+ }
191106
+ }
191074
191107
  }
191075
- } catch (scopesError) {
191076
- console.warn("[PrincipalView] Failed to load scopes canvas:", scopesError);
191077
191108
  }
191078
191109
  const finalLibrary = library || DEFAULT_LIBRARY;
191079
191110
  setState((prev) => ({
@@ -191147,7 +191178,7 @@ const CanvasEditorPanel = ({
191147
191178
  setState((prev) => ({ ...prev, colorPickerScope: null, colorPickerPosition: null }));
191148
191179
  }, []);
191149
191180
  const handleScopeColorChange = useCallback(async (scopeName, newColor) => {
191150
- if (!state.scopesCanvas || !state.scopesCanvas.nodes || !actions.writeFile) {
191181
+ if (!state.scopesCanvas || !state.scopesCanvas.nodes || !actions.writeFile || !scopesCanvasPathRef.current) {
191151
191182
  return;
191152
191183
  }
191153
191184
  const updatedScopesCanvas = {
@@ -191160,14 +191191,12 @@ const CanvasEditorPanel = ({
191160
191191
  })
191161
191192
  };
191162
191193
  try {
191163
- const repositoryPath = context2.repositoryPath || "";
191164
- const scopesPath = `${repositoryPath}/.principal-views/scopes.canvas`;
191165
- await actions.writeFile(scopesPath, JSON.stringify(updatedScopesCanvas, null, 2));
191194
+ await actions.writeFile(scopesCanvasPathRef.current, JSON.stringify(updatedScopesCanvas, null, 2));
191166
191195
  setState((prev) => ({ ...prev, scopesCanvas: updatedScopesCanvas }));
191167
191196
  } catch (error) {
191168
191197
  console.error("[PrincipalView] Error saving scopes canvas:", error);
191169
191198
  }
191170
- }, [state.scopesCanvas, actions, context2]);
191199
+ }, [state.scopesCanvas, actions]);
191171
191200
  const searchMatchedNodeIds = useMemo(() => {
191172
191201
  var _a3, _b3;
191173
191202
  if (!state.isSearchOpen || !state.searchQuery.trim() || !((_a3 = state.canvas) == null ? void 0 : _a3.nodes)) {