@principal-ade/dynamic-file-tree 0.2.41 → 0.2.43
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/dist/index.mjs +52 -11
- package/dist/src/components/CanvasListTree/CanvasListTree.stories.d.ts +23 -4
- package/dist/src/components/CanvasListTree/CanvasListTree.stories.d.ts.map +1 -1
- package/dist/src/components/CanvasListTree/CanvasListTreeCore.d.ts.map +1 -1
- package/dist/src/components/CanvasListTree/types.d.ts +1 -1
- package/dist/src/components/CanvasListTree/types.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -3156,18 +3156,31 @@ import { Package as Package3, Folder, LayoutDashboard as LayoutDashboard2, FileT
|
|
|
3156
3156
|
import React15, { useMemo as useMemo11, useRef as useRef6 } from "react";
|
|
3157
3157
|
import { Tree as Tree5 } from "react-arborist";
|
|
3158
3158
|
var buildTreeData = (canvases, dashboards, gitStatusMap) => {
|
|
3159
|
-
const
|
|
3159
|
+
const resourcesCanvases = [];
|
|
3160
|
+
const scopesEventsCanvases = [];
|
|
3160
3161
|
const spansCanvases = [];
|
|
3161
3162
|
const regularCanvases = [];
|
|
3162
3163
|
for (const canvas of canvases) {
|
|
3163
|
-
if (canvas.type === "resources"
|
|
3164
|
-
|
|
3164
|
+
if (canvas.type === "resources") {
|
|
3165
|
+
resourcesCanvases.push(canvas);
|
|
3166
|
+
} else if (canvas.type === "scopes" || canvas.type === "events") {
|
|
3167
|
+
scopesEventsCanvases.push(canvas);
|
|
3165
3168
|
} else if (canvas.type === "spans") {
|
|
3166
3169
|
spansCanvases.push(canvas);
|
|
3167
3170
|
} else {
|
|
3168
3171
|
regularCanvases.push(canvas);
|
|
3169
3172
|
}
|
|
3170
3173
|
}
|
|
3174
|
+
const buildFlatCanvasNode = (canvas) => {
|
|
3175
|
+
const canvasGitStatus = gitStatusMap ? lookupGitStatus(canvas.path, gitStatusMap) : null;
|
|
3176
|
+
return {
|
|
3177
|
+
id: `canvas:${canvas.id}`,
|
|
3178
|
+
name: canvas.name,
|
|
3179
|
+
type: "canvas",
|
|
3180
|
+
canvas,
|
|
3181
|
+
gitStatus: canvasGitStatus
|
|
3182
|
+
};
|
|
3183
|
+
};
|
|
3171
3184
|
const buildCanvasNode = (canvas) => {
|
|
3172
3185
|
const children = [];
|
|
3173
3186
|
const canvasGitStatus = gitStatusMap ? lookupGitStatus(canvas.path, gitStatusMap) : null;
|
|
@@ -3252,18 +3265,40 @@ var buildTreeData = (canvases, dashboards, gitStatusMap) => {
|
|
|
3252
3265
|
}
|
|
3253
3266
|
};
|
|
3254
3267
|
const result = [];
|
|
3255
|
-
if (
|
|
3256
|
-
const
|
|
3268
|
+
if (resourcesCanvases.length > 0) {
|
|
3269
|
+
const resourcesNodes = resourcesCanvases.map(buildFlatCanvasNode).sort((a, b) => a.name.localeCompare(b.name));
|
|
3257
3270
|
result.push({
|
|
3258
|
-
id: "architecture-group:resources
|
|
3259
|
-
name: "Resources
|
|
3271
|
+
id: "architecture-group:resources",
|
|
3272
|
+
name: "Resources",
|
|
3260
3273
|
type: "architecture-group",
|
|
3261
|
-
architectureGroupType: "resources
|
|
3262
|
-
children:
|
|
3274
|
+
architectureGroupType: "resources",
|
|
3275
|
+
children: resourcesNodes
|
|
3276
|
+
});
|
|
3277
|
+
}
|
|
3278
|
+
if (scopesEventsCanvases.length > 0) {
|
|
3279
|
+
const scopesEventsNodes = scopesEventsCanvases.map((canvas) => {
|
|
3280
|
+
return canvas.type === "scopes" ? buildFlatCanvasNode(canvas) : buildCanvasNode(canvas);
|
|
3281
|
+
}).sort((a, b) => {
|
|
3282
|
+
const typeOrder = { scopes: 0, events: 1 };
|
|
3283
|
+
const aType = a.canvas?.type || "events";
|
|
3284
|
+
const bType = b.canvas?.type || "events";
|
|
3285
|
+
const aOrder = typeOrder[aType] ?? 99;
|
|
3286
|
+
const bOrder = typeOrder[bType] ?? 99;
|
|
3287
|
+
if (aOrder !== bOrder) {
|
|
3288
|
+
return aOrder - bOrder;
|
|
3289
|
+
}
|
|
3290
|
+
return a.name.localeCompare(b.name);
|
|
3291
|
+
});
|
|
3292
|
+
result.push({
|
|
3293
|
+
id: "architecture-group:scopes-events",
|
|
3294
|
+
name: "Scope Events",
|
|
3295
|
+
type: "architecture-group",
|
|
3296
|
+
architectureGroupType: "scopes-events",
|
|
3297
|
+
children: scopesEventsNodes
|
|
3263
3298
|
});
|
|
3264
3299
|
}
|
|
3265
3300
|
if (spansCanvases.length > 0) {
|
|
3266
|
-
const spansNodes = spansCanvases.map(
|
|
3301
|
+
const spansNodes = spansCanvases.map(buildFlatCanvasNode).sort((a, b) => a.name.localeCompare(b.name));
|
|
3267
3302
|
result.push({
|
|
3268
3303
|
id: "architecture-group:spans",
|
|
3269
3304
|
name: "Spans",
|
|
@@ -3444,10 +3479,16 @@ var CanvasListTreeCore = ({
|
|
|
3444
3479
|
const { node } = props;
|
|
3445
3480
|
const data = node.data;
|
|
3446
3481
|
const isDashboard = !!data.dashboard;
|
|
3447
|
-
const icon = data.type === "architecture-group" ? data.architectureGroupType === "resources
|
|
3482
|
+
const icon = data.type === "architecture-group" ? data.architectureGroupType === "resources" ? /* @__PURE__ */ React15.createElement(Layers, {
|
|
3483
|
+
size: 16
|
|
3484
|
+
}) : data.architectureGroupType === "scopes-events" ? /* @__PURE__ */ React15.createElement(Layers, {
|
|
3485
|
+
size: 16
|
|
3486
|
+
}) : data.architectureGroupType === "resources-scopes" ? /* @__PURE__ */ React15.createElement(Layers, {
|
|
3448
3487
|
size: 16
|
|
3449
3488
|
}) : data.architectureGroupType === "spans" ? /* @__PURE__ */ React15.createElement(Network, {
|
|
3450
3489
|
size: 16
|
|
3490
|
+
}) : data.architectureGroupType === "events" ? /* @__PURE__ */ React15.createElement(Gauge, {
|
|
3491
|
+
size: 16
|
|
3451
3492
|
}) : data.architectureGroupType === "dashboards" ? /* @__PURE__ */ React15.createElement(BarChart3, {
|
|
3452
3493
|
size: 16
|
|
3453
3494
|
}) : /* @__PURE__ */ React15.createElement(Folder, {
|
|
@@ -11,12 +11,31 @@ export declare const TerminalTheme: Story;
|
|
|
11
11
|
export declare const MatrixTheme: Story;
|
|
12
12
|
/**
|
|
13
13
|
* Demonstrates all architecture groups including:
|
|
14
|
-
* - Resources
|
|
15
|
-
* -
|
|
16
|
-
* -
|
|
17
|
-
* -
|
|
14
|
+
* - Resources (Layers icon) - flat canvases, no folder wrapper
|
|
15
|
+
* - Scope Events (Layers icon) - scopes are flat, events have folder structure
|
|
16
|
+
* - Spans (Network icon) - flat canvases, no folder wrapper
|
|
17
|
+
* - Dashboards (BarChart3 icon) - flat items, no folder wrapper
|
|
18
|
+
* - Misc (Folder icon) - regular canvases with folder structure
|
|
18
19
|
*/
|
|
19
20
|
export declare const ArchitectureGroups: Story;
|
|
21
|
+
/**
|
|
22
|
+
* Demonstrates architecture groups with separate Resources and Scope Events
|
|
23
|
+
*
|
|
24
|
+
* **Resources group** - Documents OTEL resources (service instances):
|
|
25
|
+
* - .resources.canvas files (flat, no folder wrapper)
|
|
26
|
+
*
|
|
27
|
+
* **Scope Events group** - Documents scopes and their event vocabularies:
|
|
28
|
+
* - .scopes.canvas files (flat, no folder wrapper)
|
|
29
|
+
* - .events.canvas files (nested in folders with Canvas/Overview children)
|
|
30
|
+
*
|
|
31
|
+
* **Spans group** - Documents span conventions:
|
|
32
|
+
* - .spans.canvas files (flat, no folder wrapper)
|
|
33
|
+
*
|
|
34
|
+
* Within Scope Events, canvases are ordered:
|
|
35
|
+
* 1. Scopes (.scopes.canvas) - flat
|
|
36
|
+
* 2. Events (.events.canvas) - with folder structure, sorted alphabetically
|
|
37
|
+
*/
|
|
38
|
+
export declare const ScopeEventsWithEventsCanvases: Story;
|
|
20
39
|
/**
|
|
21
40
|
* Dashboards only - shows just the Dashboards architecture group
|
|
22
41
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CanvasListTree.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/CanvasListTree/CanvasListTree.stories.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"CanvasListTree.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/CanvasListTree/CanvasListTree.stories.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAsN1D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,kBAAkB,CAmCzC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAyBjD,eAAO,MAAM,YAAY,EAAE,KAU1B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAU3B,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAUtB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAUnB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAU3B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAUzB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAWhC,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,6BAA6B,EAAE,KAuB3C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,KAW5B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CanvasListTreeCore.d.ts","sourceRoot":"","sources":["../../../../src/components/CanvasListTree/CanvasListTreeCore.tsx"],"names":[],"mappings":"AACA,OAAO,KAA0B,MAAM,OAAO,CAAC;AAS/C,OAAO,KAAK,EAEV,mBAAmB,EAGpB,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"CanvasListTreeCore.d.ts","sourceRoot":"","sources":["../../../../src/components/CanvasListTree/CanvasListTreeCore.tsx"],"names":[],"mappings":"AACA,OAAO,KAA0B,MAAM,OAAO,CAAC;AAS/C,OAAO,KAAK,EAEV,mBAAmB,EAGpB,MAAM,SAAS,CAAC;AAyXjB,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA0O5D,CAAC"}
|
|
@@ -13,7 +13,7 @@ export interface CanvasListNodeData extends TreeNodeData {
|
|
|
13
13
|
scope?: 'package' | 'root';
|
|
14
14
|
markdownPath?: string;
|
|
15
15
|
/** Architecture group type for grouping special canvas types */
|
|
16
|
-
architectureGroupType?: 'resources-scopes' | 'spans' | 'dashboards' | 'misc';
|
|
16
|
+
architectureGroupType?: 'resources' | 'scopes-events' | 'resources-scopes' | 'spans' | 'events' | 'dashboards' | 'misc';
|
|
17
17
|
gitStatus?: GitStatus;
|
|
18
18
|
}
|
|
19
19
|
export interface CanvasListTreeProps {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/CanvasListTree/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAE/F,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAG5D,YAAY,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,CAAC;AAEtD,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,oBAAoB,GAAG,eAAe,GAAG,QAAQ,GAAG,UAAU,CAAC;AAE5G,MAAM,WAAW,kBAAmB,SAAQ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1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@principal-ade/dynamic-file-tree",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.43",
|
|
4
4
|
"description": "React component for selective directory filtering and file tree visualization",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.mjs",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@principal-ade/industry-theme": ">=0.1.0",
|
|
51
51
|
"@principal-ade/panel-framework-core": ">=0.5.0",
|
|
52
52
|
"@principal-ai/alexandria-core-library": ">=0.3.0",
|
|
53
|
-
"@principal-ai/principal-view-core": ">=0.
|
|
53
|
+
"@principal-ai/principal-view-core": ">=0.26.30",
|
|
54
54
|
"@principal-ai/repository-abstraction": "^0.5.7",
|
|
55
55
|
"lucide-react": ">=0.263.0",
|
|
56
56
|
"react": ">=19.0.0",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"@principal-ade/industry-theme": "^0.1.8",
|
|
82
82
|
"@principal-ade/panel-framework-core": "^0.5.1",
|
|
83
83
|
"@principal-ai/alexandria-core-library": "^0.3.3",
|
|
84
|
-
"@principal-ai/principal-view-core": "0.26.
|
|
84
|
+
"@principal-ai/principal-view-core": "0.26.30",
|
|
85
85
|
"@principal-ai/repository-abstraction": "^0.5.7",
|
|
86
86
|
"@storybook/addon-docs": "^10.2.14",
|
|
87
87
|
"@storybook/addon-onboarding": "^10.2.14",
|