@powerhousedao/common 6.0.0-dev.2 → 6.0.0-dev.200

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 (112) hide show
  1. package/dist/chunk-ZRW5x4aP.js +27 -0
  2. package/dist/drive-analytics.d.ts +52 -1
  3. package/dist/drive-analytics.d.ts.map +1 -1
  4. package/dist/drive-analytics.js +70 -1
  5. package/dist/drive-analytics.js.map +1 -1
  6. package/dist/index.d.ts +3 -4
  7. package/dist/index.js +2 -4
  8. package/dist/utils/index.d.ts +10 -1
  9. package/dist/utils/index.d.ts.map +1 -1
  10. package/dist/utils/index.js +57 -1
  11. package/dist/utils/index.js.map +1 -1
  12. package/package.json +17 -67
  13. package/dist/drive-analytics/index.d.ts +0 -4
  14. package/dist/drive-analytics/index.d.ts.map +0 -1
  15. package/dist/drive-analytics/index.js +0 -4
  16. package/dist/drive-analytics/index.js.map +0 -1
  17. package/dist/drive-analytics/processor/document-processor.d.ts +0 -11
  18. package/dist/drive-analytics/processor/document-processor.d.ts.map +0 -1
  19. package/dist/drive-analytics/processor/document-processor.js +0 -67
  20. package/dist/drive-analytics/processor/document-processor.js.map +0 -1
  21. package/dist/drive-analytics/processor/drive-processor.d.ts +0 -12
  22. package/dist/drive-analytics/processor/drive-processor.d.ts.map +0 -1
  23. package/dist/drive-analytics/processor/drive-processor.js +0 -107
  24. package/dist/drive-analytics/processor/drive-processor.js.map +0 -1
  25. package/dist/drive-analytics/processor/index.d.ts +0 -10
  26. package/dist/drive-analytics/processor/index.d.ts.map +0 -1
  27. package/dist/drive-analytics/processor/index.js +0 -28
  28. package/dist/drive-analytics/processor/index.js.map +0 -1
  29. package/dist/drive-analytics/processor/types.d.ts +0 -3
  30. package/dist/drive-analytics/processor/types.d.ts.map +0 -1
  31. package/dist/drive-analytics/processor/types.js +0 -2
  32. package/dist/drive-analytics/processor/types.js.map +0 -1
  33. package/dist/drive-analytics/useDocumentAnalytics.d.ts +0 -24
  34. package/dist/drive-analytics/useDocumentAnalytics.d.ts.map +0 -1
  35. package/dist/drive-analytics/useDocumentAnalytics.js +0 -61
  36. package/dist/drive-analytics/useDocumentAnalytics.js.map +0 -1
  37. package/dist/drive-analytics/useDriveAnalytics.d.ts +0 -21
  38. package/dist/drive-analytics/useDriveAnalytics.d.ts.map +0 -1
  39. package/dist/drive-analytics/useDriveAnalytics.js +0 -36
  40. package/dist/drive-analytics/useDriveAnalytics.js.map +0 -1
  41. package/dist/editors/generic-drive-explorer/components/create-document.d.ts +0 -2
  42. package/dist/editors/generic-drive-explorer/components/create-document.d.ts.map +0 -1
  43. package/dist/editors/generic-drive-explorer/components/create-document.js +0 -19
  44. package/dist/editors/generic-drive-explorer/components/create-document.js.map +0 -1
  45. package/dist/editors/generic-drive-explorer/components/file-content-view.d.ts +0 -2
  46. package/dist/editors/generic-drive-explorer/components/file-content-view.d.ts.map +0 -1
  47. package/dist/editors/generic-drive-explorer/components/file-content-view.js +0 -76
  48. package/dist/editors/generic-drive-explorer/components/file-content-view.js.map +0 -1
  49. package/dist/editors/generic-drive-explorer/components/folder-view.d.ts +0 -5
  50. package/dist/editors/generic-drive-explorer/components/folder-view.d.ts.map +0 -1
  51. package/dist/editors/generic-drive-explorer/components/folder-view.js +0 -19
  52. package/dist/editors/generic-drive-explorer/components/folder-view.js.map +0 -1
  53. package/dist/editors/generic-drive-explorer/components/index.d.ts +0 -6
  54. package/dist/editors/generic-drive-explorer/components/index.d.ts.map +0 -1
  55. package/dist/editors/generic-drive-explorer/components/index.js +0 -6
  56. package/dist/editors/generic-drive-explorer/components/index.js.map +0 -1
  57. package/dist/editors/generic-drive-explorer/components/layout.d.ts +0 -12
  58. package/dist/editors/generic-drive-explorer/components/layout.d.ts.map +0 -1
  59. package/dist/editors/generic-drive-explorer/components/layout.js +0 -21
  60. package/dist/editors/generic-drive-explorer/components/layout.js.map +0 -1
  61. package/dist/editors/generic-drive-explorer/components/search-bar.d.ts +0 -2
  62. package/dist/editors/generic-drive-explorer/components/search-bar.d.ts.map +0 -1
  63. package/dist/editors/generic-drive-explorer/components/search-bar.js +0 -38
  64. package/dist/editors/generic-drive-explorer/components/search-bar.js.map +0 -1
  65. package/dist/editors/generic-drive-explorer/config.d.ts +0 -3
  66. package/dist/editors/generic-drive-explorer/config.d.ts.map +0 -1
  67. package/dist/editors/generic-drive-explorer/config.js +0 -5
  68. package/dist/editors/generic-drive-explorer/config.js.map +0 -1
  69. package/dist/editors/generic-drive-explorer/editor.d.ts +0 -3
  70. package/dist/editors/generic-drive-explorer/editor.d.ts.map +0 -1
  71. package/dist/editors/generic-drive-explorer/editor.js +0 -16
  72. package/dist/editors/generic-drive-explorer/editor.js.map +0 -1
  73. package/dist/editors/generic-drive-explorer/generic-drive-explorer.stories.d.ts +0 -6
  74. package/dist/editors/generic-drive-explorer/generic-drive-explorer.stories.d.ts.map +0 -1
  75. package/dist/editors/generic-drive-explorer/generic-drive-explorer.stories.js +0 -26
  76. package/dist/editors/generic-drive-explorer/generic-drive-explorer.stories.js.map +0 -1
  77. package/dist/editors/generic-drive-explorer/index.d.ts +0 -3
  78. package/dist/editors/generic-drive-explorer/index.d.ts.map +0 -1
  79. package/dist/editors/generic-drive-explorer/index.js +0 -3
  80. package/dist/editors/generic-drive-explorer/index.js.map +0 -1
  81. package/dist/editors/generic-drive-explorer/module.d.ts +0 -3
  82. package/dist/editors/generic-drive-explorer/module.d.ts.map +0 -1
  83. package/dist/editors/generic-drive-explorer/module.js +0 -10
  84. package/dist/editors/generic-drive-explorer/module.js.map +0 -1
  85. package/dist/editors/index.d.ts +0 -3
  86. package/dist/editors/index.d.ts.map +0 -1
  87. package/dist/editors/index.js +0 -4
  88. package/dist/editors/index.js.map +0 -1
  89. package/dist/editors/styles.css +0 -450
  90. package/dist/editors/utils/cn.d.ts +0 -3
  91. package/dist/editors/utils/cn.d.ts.map +0 -1
  92. package/dist/editors/utils/cn.js +0 -6
  93. package/dist/editors/utils/cn.js.map +0 -1
  94. package/dist/editors/utils/index.d.ts +0 -3
  95. package/dist/editors/utils/index.d.ts.map +0 -1
  96. package/dist/editors/utils/index.js +0 -3
  97. package/dist/editors/utils/index.js.map +0 -1
  98. package/dist/editors/utils/types.d.ts +0 -8
  99. package/dist/editors/utils/types.d.ts.map +0 -1
  100. package/dist/editors/utils/types.js +0 -2
  101. package/dist/editors/utils/types.js.map +0 -1
  102. package/dist/hooks/index.d.ts +0 -2
  103. package/dist/hooks/index.d.ts.map +0 -1
  104. package/dist/hooks/index.js +0 -2
  105. package/dist/hooks/index.js.map +0 -1
  106. package/dist/index.d.ts.map +0 -1
  107. package/dist/index.js.map +0 -1
  108. package/dist/tsconfig.tsbuildinfo +0 -1
  109. package/dist/utils/vetra-gql.d.ts +0 -8
  110. package/dist/utils/vetra-gql.d.ts.map +0 -1
  111. package/dist/utils/vetra-gql.js +0 -67
  112. package/dist/utils/vetra-gql.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"drive-processor.js","sourceRoot":"","sources":["../../../drive-analytics/processor/drive-processor.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAErE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGjC,MAAM,mBAAmB,GAAG,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;AACvD,MAAM,sBAAsB,GAAG,CAAC,WAAW,CAAC,CAAC;AAC7C,MAAM,mBAAmB,GAAG,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;AAC3D,MAAM,iBAAiB,GAAG,CAAC,WAAW,CAAC,CAAC;AACxC,MAAM,mBAAmB,GAAG,CAAC,aAAa,CAAC,CAAC;AAE5C,MAAM,YAAY,GAAG;IACnB,GAAG,mBAAmB;IACtB,GAAG,sBAAsB;IACzB,GAAG,mBAAmB;IACtB,GAAG,iBAAiB;IACpB,GAAG,mBAAmB;CACvB,CAAC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UAAU,EAAE,CAAC;wBACnC,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;wBAC3C,MAAM,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;oBACnD,CAAC;gBACH,CAAC;gBAED,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBACtB,MAAM,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;gBACpD,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,KAAK,CAAC,YAAY,KAAI,CAAC;IAEf,aAAa,CAAC,MAAc;QAClC,IAAI,mBAAmB,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;YACzC,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,IAAI,sBAAsB,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;YAC5C,OAAO,YAAY,CAAC;QACtB,CAAC;QACD,IAAI,mBAAmB,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;YACzC,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,IAAI,iBAAiB,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;YACvC,OAAO,OAAO,CAAC;QACjB,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAEO,KAAK,CAAC,WAAW,CAAC,MAAqB;QAC7C,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,cAAc,CAAC,mBAAmB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAC9D,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,wBAAwB,EAAE,CAAC,CAAC,CAAC;QACjD,CAAC;IACH,CAAC;CACF"}
@@ -1,10 +0,0 @@
1
- import type { IAnalyticsStore } from "@powerhousedao/analytics-engine-core";
2
- import type { ProcessorRecord } from "document-drive";
3
- import type { PHDocumentHeader } from "document-model";
4
- export declare const processorFactory: (module: {
5
- analyticsStore: IAnalyticsStore;
6
- }) => (driveHeader: PHDocumentHeader) => ProcessorRecord[];
7
- export * from "./document-processor.js";
8
- export * from "./drive-processor.js";
9
- export * from "./types.js";
10
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../drive-analytics/processor/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAIvD,eAAO,MAAM,gBAAgB,GAC1B,QAAQ;IAAE,cAAc,EAAE,eAAe,CAAA;CAAE,MAC3C,aAAa,gBAAgB,KAAG,eAAe,EAqB/C,CAAC;AAEJ,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC"}
@@ -1,28 +0,0 @@
1
- import { DocumentAnalyticsProcessor } from "./document-processor.js";
2
- import { DriveAnalyticsProcessor } from "./drive-processor.js";
3
- export const processorFactory = (module) => (driveHeader) => {
4
- return [
5
- {
6
- processor: new DriveAnalyticsProcessor(module.analyticsStore),
7
- filter: {
8
- branch: ["main"],
9
- documentId: ["*"],
10
- scope: ["*"],
11
- documentType: ["powerhouse/document-drive"],
12
- },
13
- },
14
- {
15
- processor: new DocumentAnalyticsProcessor(module.analyticsStore),
16
- filter: {
17
- branch: ["main"],
18
- documentId: ["*"],
19
- scope: ["*"],
20
- documentType: ["*"],
21
- },
22
- },
23
- ];
24
- };
25
- export * from "./document-processor.js";
26
- export * from "./drive-processor.js";
27
- export * from "./types.js";
28
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../drive-analytics/processor/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,MAAM,CAAC,MAAM,gBAAgB,GAC3B,CAAC,MAA2C,EAAE,EAAE,CAChD,CAAC,WAA6B,EAAqB,EAAE;IACnD,OAAO;QACL;YACE,SAAS,EAAE,IAAI,uBAAuB,CAAC,MAAM,CAAC,cAAc,CAAC;YAC7D,MAAM,EAAE;gBACN,MAAM,EAAE,CAAC,MAAM,CAAC;gBAChB,UAAU,EAAE,CAAC,GAAG,CAAC;gBACjB,KAAK,EAAE,CAAC,GAAG,CAAC;gBACZ,YAAY,EAAE,CAAC,2BAA2B,CAAC;aAC5C;SACF;QACD;YACE,SAAS,EAAE,IAAI,0BAA0B,CAAC,MAAM,CAAC,cAAc,CAAC;YAChE,MAAM,EAAE;gBACN,MAAM,EAAE,CAAC,MAAM,CAAC;gBAChB,UAAU,EAAE,CAAC,GAAG,CAAC;gBACjB,KAAK,EAAE,CAAC,GAAG,CAAC;gBACZ,YAAY,EAAE,CAAC,GAAG,CAAC;aACpB;SACF;KACF,CAAC;AACJ,CAAC,CAAC;AAEJ,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC"}
@@ -1,3 +0,0 @@
1
- export type NodeTarget = "DRIVE" | "NODE";
2
- export type ActionType = "CREATED" | "DUPLICATED" | "REMOVED" | "MOVED" | "UPDATED";
3
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../drive-analytics/processor/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,MAAM,CAAC;AAC1C,MAAM,MAAM,UAAU,GAClB,SAAS,GACT,YAAY,GACZ,SAAS,GACT,OAAO,GACP,SAAS,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../drive-analytics/processor/types.ts"],"names":[],"mappings":""}
@@ -1,24 +0,0 @@
1
- import type { GroupedPeriodResults } from "@powerhousedao/analytics-engine-core";
2
- import { AnalyticsGranularity } from "@powerhousedao/analytics-engine-core";
3
- import type { UseAnalyticsQueryResult } from "@powerhousedao/reactor-browser/analytics";
4
- import type { NodeTarget } from "./processor/types.js";
5
- export type UseDocumentAnalyticsOptions = {
6
- from?: string;
7
- to?: string;
8
- granularity?: AnalyticsGranularity;
9
- levelOfDetail?: {
10
- drive?: number;
11
- operation?: number;
12
- target?: number;
13
- };
14
- filters?: {
15
- driveId?: string[];
16
- documentId?: string[];
17
- operation?: string[];
18
- target?: NodeTarget[];
19
- branch?: string[];
20
- scope?: string[];
21
- };
22
- };
23
- export declare const useDocumentAnalytics: (options: UseDocumentAnalyticsOptions) => UseAnalyticsQueryResult<GroupedPeriodResults>;
24
- //# sourceMappingURL=useDocumentAnalytics.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useDocumentAnalytics.d.ts","sourceRoot":"","sources":["../../drive-analytics/useDocumentAnalytics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,oBAAoB,EACrB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,oBAAoB,EAErB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AAGxF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD,MAAM,MAAM,2BAA2B,GAAG;IACxC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,oBAAoB,CAAC;IACnC,aAAa,CAAC,EAAE;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,OAAO,CAAC,EAAE;QACR,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;QACnB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;QACtB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;QACrB,MAAM,CAAC,EAAE,UAAU,EAAE,CAAC;QACtB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;KAClB,CAAC;CACH,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAC/B,SAAS,2BAA2B,KACnC,uBAAuB,CAAC,oBAAoB,CAgF9C,CAAC"}
@@ -1,61 +0,0 @@
1
- import { AnalyticsGranularity, AnalyticsPath, } from "@powerhousedao/analytics-engine-core";
2
- import { useAnalyticsQuery } from "@powerhousedao/reactor-browser/analytics";
3
- import { DateTime } from "luxon";
4
- export const useDocumentAnalytics = (options) => {
5
- const start = options.from
6
- ? DateTime.fromISO(options.from)
7
- : DateTime.now().startOf("day");
8
- const end = options.to
9
- ? DateTime.fromISO(options.to)
10
- : DateTime.now().endOf("day");
11
- const granularity = options.granularity ?? AnalyticsGranularity.Daily;
12
- const lod = options.levelOfDetail ?? {
13
- drive: 1,
14
- };
15
- // Build drive dimension filters
16
- const selectDrives = options.filters?.driveId?.map((driveId) => AnalyticsPath.fromString(`ph/doc/drive/${driveId}`));
17
- // Build operation dimension filters
18
- const operations = options.filters?.operation?.map((operation) => AnalyticsPath.fromString(`ph/doc/operation/${operation}`));
19
- // Build target dimension filters
20
- const targets = options.filters?.target?.map((target) => AnalyticsPath.fromString(`ph/doc/target/${target}`));
21
- const select = {
22
- drive: selectDrives ?? [AnalyticsPath.fromString("ph/doc/drive")],
23
- ...(operations && { operation: operations }),
24
- ...(targets && { target: targets }),
25
- };
26
- // Build sources filter based on driveId and documentId
27
- let sources;
28
- if (options.filters?.driveId || options.filters?.documentId) {
29
- sources = [];
30
- if (options.filters?.driveId && options.filters?.documentId) {
31
- // Specific drive and document combinations
32
- for (const driveId of options.filters.driveId) {
33
- for (const documentId of options.filters.documentId) {
34
- const branch = options.filters.branch?.[0] ?? "*";
35
- const scope = options.filters.scope?.[0] ?? "*";
36
- sources.push(AnalyticsPath.fromString(`ph/doc/${driveId}/${documentId}/${branch}/${scope}`));
37
- }
38
- }
39
- }
40
- else if (options.filters?.driveId) {
41
- // All documents in specific drives
42
- for (const driveId of options.filters.driveId) {
43
- const branch = options.filters.branch?.[0] ?? "*";
44
- const scope = options.filters.scope?.[0] ?? "*";
45
- sources.push(AnalyticsPath.fromString(`ph/doc/${driveId}/*/${branch}/${scope}`));
46
- }
47
- }
48
- }
49
- const config = {
50
- start,
51
- end,
52
- metrics: ["DocumentOperations"],
53
- granularity,
54
- lod,
55
- select,
56
- };
57
- const queryOptions = sources ? { sources } : undefined;
58
- const result = useAnalyticsQuery(config, queryOptions);
59
- return result;
60
- };
61
- //# sourceMappingURL=useDocumentAnalytics.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useDocumentAnalytics.js","sourceRoot":"","sources":["../../drive-analytics/useDocumentAnalytics.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,oBAAoB,EACpB,aAAa,GACd,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAC7E,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAsBjC,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAClC,OAAoC,EACW,EAAE;IACjD,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI;QACxB,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC;QAChC,CAAC,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAElC,MAAM,GAAG,GAAG,OAAO,CAAC,EAAE;QACpB,CAAC,CAAC,QAAQ,CAAC,OAAO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GAAG,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;IAEvD,MAAM,MAAM,GAAG,iBAAiB,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IAEvD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
@@ -1,21 +0,0 @@
1
- import { AnalyticsGranularity } from "@powerhousedao/analytics-engine-core";
2
- import type { ActionType, NodeTarget } from "./processor/types.js";
3
- export type UseDriveAnalyticsOptions = {
4
- from?: string;
5
- to?: string;
6
- granularity?: AnalyticsGranularity;
7
- levelOfDetail?: {
8
- drive?: number;
9
- operation?: number;
10
- target?: number;
11
- actionType?: number;
12
- };
13
- filters?: {
14
- driveId?: string[];
15
- operation?: string[];
16
- target?: NodeTarget[];
17
- actionType?: ActionType[];
18
- };
19
- };
20
- export declare const useDriveAnalytics: (options: UseDriveAnalyticsOptions) => import("@powerhousedao/reactor-browser/analytics").UseAnalyticsQueryResult<import("@powerhousedao/analytics-engine-core").GroupedPeriodResults>;
21
- //# sourceMappingURL=useDriveAnalytics.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useDriveAnalytics.d.ts","sourceRoot":"","sources":["../../drive-analytics/useDriveAnalytics.ts"],"names":[],"mappings":"AACA,OAAO,EACL,oBAAoB,EAErB,MAAM,sCAAsC,CAAC;AAG9C,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEnE,MAAM,MAAM,wBAAwB,GAAG;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,oBAAoB,CAAC;IACnC,aAAa,CAAC,EAAE;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;IACF,OAAO,CAAC,EAAE;QACR,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;QACnB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;QACrB,MAAM,CAAC,EAAE,UAAU,EAAE,CAAC;QACtB,UAAU,CAAC,EAAE,UAAU,EAAE,CAAC;KAC3B,CAAC;CACH,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,SAAS,wBAAwB,oJAkDlE,CAAC"}
@@ -1,36 +0,0 @@
1
- import { AnalyticsGranularity, AnalyticsPath, } from "@powerhousedao/analytics-engine-core";
2
- import { useAnalyticsQuery } from "@powerhousedao/reactor-browser/analytics";
3
- import { DateTime } from "luxon";
4
- export const useDriveAnalytics = (options) => {
5
- const start = options.from
6
- ? DateTime.fromISO(options.from)
7
- : DateTime.now().startOf("day");
8
- const end = options.to
9
- ? DateTime.fromISO(options.to)
10
- : DateTime.now().endOf("day");
11
- const granularity = options.granularity ?? AnalyticsGranularity.Daily;
12
- const lod = options.levelOfDetail ?? {
13
- drive: 1,
14
- };
15
- const selectDrives = options.filters?.driveId?.map((driveId) => AnalyticsPath.fromString(`ph/drive/${driveId}`));
16
- const operations = options.filters?.operation?.map((operation) => AnalyticsPath.fromString(`ph/drive/operation/${operation}`));
17
- const targets = options.filters?.target?.map((target) => AnalyticsPath.fromString(`ph/drive/target/${target}`));
18
- const actionTypes = options.filters?.actionType?.map((actionType) => AnalyticsPath.fromString(`ph/drive/actionType/${actionType}`));
19
- const select = {
20
- drive: selectDrives ?? [AnalyticsPath.fromString("ph/drive")],
21
- ...(operations && { operation: operations }),
22
- ...(targets && { target: targets }),
23
- ...(actionTypes && { actionType: actionTypes }),
24
- };
25
- const config = {
26
- start,
27
- end,
28
- metrics: ["DriveOperations"],
29
- granularity,
30
- lod,
31
- select,
32
- };
33
- const result = useAnalyticsQuery(config);
34
- return result;
35
- };
36
- //# sourceMappingURL=useDriveAnalytics.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useDriveAnalytics.js","s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AC,MAAM,EAAE,EAAE,CACtD,aAAa,CAAC,UAAU,CAAC,mBAAmB,MAAM,EAAE,CAAC,CACtD,CAAC;IAEF,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAClE,aAAa,CAAC,UAAU,CAAC,uBAAuB,UAAU,EAAE,CAAC,CAC9D,CAAC;IAEF,MAAM,MAAM,GAAG;QACb,KAAK,EAAE,YAAY,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QAC7D,GAAG,CAAC,UAAU,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;QAC5C,GAAG,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;QACnC,GAAG,CAAC,WAAW,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC;KAChD,CAAC;IAEF,MAAM,MAAM,GAAmB;QAC7B,KAAK;QACL,GAAG;QACH,OAAO,EAAE,CAAC,iBAAiB,CAAC;QAC5B,WAAW;QACX,GAAG;QACH,MAAM;KACP,CAAC;IAEF,MAAM,MAAM,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAEzC,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare function CreateDocument(): import("react/jsx-runtime").JSX.Element | null;
2
- //# sourceMappingURL=create-document.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-document.d.ts","sourceRoot":"","sources":["../../../../editors/generic-drive-explorer/components/create-document.tsx"],"names":[],"mappings":"AAeA,wBAAgB,cAAc,mDAgC7B"}
@@ -1,19 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { PowerhouseButton } from "@powerhousedao/design-system";
3
- import { showCreateDocumentModal, useDocumentModelModules, useUserPermissions, } from "@powerhousedao/reactor-browser";
4
- function getDocumentSpec(doc) {
5
- return doc.documentModel.global;
6
- }
7
- export function CreateDocument() {
8
- const { isAllowedToCreateDocuments } = useUserPermissions();
9
- const documentModelModules = useDocumentModelModules();
10
- const nonDriveDocumentModelModules = documentModelModules?.filter((module) => module.documentModel.global.id !== "powerhouse/document-drive");
11
- if (!isAllowedToCreateDocuments)
12
- return null;
13
- return (_jsxs("div", { className: "px-6 py-4", children: [_jsx("h3", { className: "mb-3 text-xl font-bold text-gray-600", children: "New document" }), _jsx("div", { className: "flex w-full flex-wrap gap-4", children: nonDriveDocumentModelModules?.map((doc) => {
14
- const spec = getDocumentSpec(doc);
15
- const versionLabel = doc.version ? ` v${doc.version}` : "";
16
- return (_jsx(PowerhouseButton, { color: "light", title: `${spec.name}${versionLabel}`, "aria-description": spec.description, onClick: () => showCreateDocumentModal(spec.id), children: _jsxs("span", { className: "text-sm", children: [spec.name, versionLabel] }) }, `${spec.id}-v${doc.version ?? 1}`));
17
- }) })] }));
18
- }
19
- //# sourceMappingURL=create-document.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-document.js","sourceRoot":"","sources":["../../../../editors/generic-drive-explorer/components/create-document.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,gCAAgC,CAAC;AAMxC,SAAS,eAAe,CAAC,GAAwB;IAC/C,OAAO,GAAG,CAAC,aAAa,CAAC,MAAM,CAAC;AAClC,CAAC;AAED,MAAM,UAAU,cAAc;IAC5B,MAAM,EAAE,0BAA0B,EAAE,GAAG,kBAAkB,EAAE,CAAC;IAC5D,MAAM,oBAAoB,GAAG,uBAAuB,EAAE,CAAC;IACvD,MAAM,4BAA4B,GAAG,oBAAoB,EAAE,MAAM,CAC/D,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,KAAK,2BAA2B,CAC3E,CAAC;IACF,IAAI,CAAC,0BAA0B;QAAE,OAAO,IAAI,CAAC;IAC7C,OAAO,CACL,eAAK,SAAS,EAAC,WAAW,aACxB,aAAI,SAAS,EAAC,sCAAsC,6BAAkB,EACtE,cAAK,SAAS,EAAC,6BAA6B,YACzC,4BAA4B,EAAE,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;oBACzC,MAAM,IAAI,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC;oBAClC,MAAM,YAAY,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;oBAC3D,OAAO,CACL,KAAC,gBAAgB,IAEf,KAAK,EAAC,OAAO,EACb,KAAK,EAAE,GAAG,IAAI,CAAC,IAAI,GAAG,YAAY,EAAE,sBAClB,IAAI,CAAC,WAAW,EAClC,OAAO,EAAE,GAAG,EAAE,CAAC,uBAAuB,CAAC,IAAI,CAAC,EAAE,CAAC,YAE/C,gBAAM,SAAS,EAAC,SAAS,aACtB,IAAI,CAAC,IAAI,EACT,YAAY,IACR,IATF,GAAG,IAAI,CAAC,EAAE,KAAK,GAAG,CAAC,OAAO,IAAI,CAAC,EAAE,CAUrB,CACpB,CAAC;gBACJ,CAAC,CAAC,GACE,IACF,CACP,CAAC;AACJ,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare function FileContentView(): import("react/jsx-runtime").JSX.Element;
2
- //# sourceMappingURL=file-content-view.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"file-content-view.d.ts","sourceRoot":"","sources":["../../../../editors/generic-drive-explorer/components/file-content-view.tsx"],"names":[],"mappings":"AAgBA,wBAAgB,eAAe,4CAwG9B"}
@@ -1,76 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useWindowSize } from "@powerhousedao/design-system";
3
- import { FileItem } from "@powerhousedao/design-system/connect";
4
- import { isFileNodeKind, useNodesInSelectedDriveOrFolder, } from "@powerhousedao/reactor-browser";
5
- import { useVirtualizer } from "@tanstack/react-virtual";
6
- import React, { useRef } from "react";
7
- const GAP = 8;
8
- const ITEM_WIDTH = 256;
9
- const ITEM_HEIGHT = 48;
10
- const USED_SPACE = 420;
11
- export function FileContentView() {
12
- const parentRef = useRef(null);
13
- const windowSize = useWindowSize();
14
- const availableWidth = windowSize.innerWidth - USED_SPACE;
15
- const nodes = useNodesInSelectedDriveOrFolder();
16
- const fileNodes = nodes.filter((n) => isFileNodeKind(n));
17
- const columnCount = Math.floor(availableWidth / (ITEM_WIDTH + GAP)) || 1;
18
- const rowCount = Math.ceil(fileNodes.length / columnCount);
19
- const rowVirtualizer = useVirtualizer({
20
- count: rowCount,
21
- getScrollElement: () => parentRef.current,
22
- estimateSize: (index) => {
23
- if (index > 0) {
24
- return ITEM_HEIGHT + GAP;
25
- }
26
- return ITEM_HEIGHT;
27
- },
28
- overscan: 5,
29
- });
30
- const columnVirtualizer = useVirtualizer({
31
- horizontal: true,
32
- count: columnCount,
33
- getScrollElement: () => parentRef.current,
34
- estimateSize: (index) => {
35
- if (index > 0) {
36
- return ITEM_WIDTH + GAP;
37
- }
38
- return ITEM_WIDTH;
39
- },
40
- overscan: 5,
41
- });
42
- const getItemIndex = (rowIndex, columnIndex) => rowIndex * columnCount + columnIndex;
43
- const getItem = (rowIndex, columnIndex) => {
44
- const index = getItemIndex(rowIndex, columnIndex);
45
- return fileNodes[index] || null;
46
- };
47
- if (fileNodes.length === 0) {
48
- return (_jsx("div", { className: "mb-8 text-sm text-gray-400", children: "No documents or files \uD83D\uDCC4" }));
49
- }
50
- const renderItem = (rowIndex, columnIndex) => {
51
- const fileNode = getItem(rowIndex, columnIndex);
52
- if (!fileNode) {
53
- return null;
54
- }
55
- return (_jsx("div", { style: {
56
- marginLeft: columnIndex === 0 ? 0 : GAP,
57
- }, children: _jsx(FileItem, { fileNode: fileNode }, fileNode.id) }));
58
- };
59
- return (_jsx("div", { ref: parentRef, style: {
60
- width: `100%`,
61
- overflow: "auto",
62
- }, children: _jsx("div", { style: {
63
- height: `${rowVirtualizer.getTotalSize()}px`,
64
- width: `${columnVirtualizer.getTotalSize()}px`,
65
- position: "relative",
66
- }, children: rowVirtualizer.getVirtualItems().map((virtualRow) => (_jsx(React.Fragment, { children: columnVirtualizer.getVirtualItems().map((virtualColumn) => (_jsx("div", { style: {
67
- position: "absolute",
68
- top: 0,
69
- left: 0,
70
- marginTop: virtualRow.index === 0 ? 0 : GAP,
71
- width: `${virtualColumn.size}px`,
72
- height: `${virtualRow.size}px`,
73
- transform: `translateX(${virtualColumn.start}px) translateY(${virtualRow.start}px)`,
74
- }, children: renderItem(virtualRow.index, virtualColumn.index) }, virtualColumn.key))) }, virtualRow.key))) }) }));
75
- }
76
- //# sourceMappingURL=file-content-view.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"file-content-view.js","sourceRoot":"","sources":["../../../../editors/generic-drive-explorer/components/file-content-view.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAChE,OAAO,EACL,cAAc,EACd,+BAA+B,GAChC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEtC,MAAM,GAAG,GAAG,CAAC,CAAC;AACd,MAAM,UAAU,GAAG,GAAG,CAAC;AACvB,MAAM,WAAW,GAAG,EAAE,CAAC;AAEvB,MAAM,UAAU,GAAG,GAAG,CAAC;AAEvB,MAAM,UAAU,eAAe;IAC7B,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IAC/B,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;IACnC,MAAM,cAAc,GAAG,UAAU,CAAC,UAAU,GAAG,UAAU,CAAC;IAC1D,MAAM,KAAK,GAAG,+BAA+B,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AC;wBACP,SAAS,EAAE,UAAU,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;wBAC3C,KAAK,EAAE,GAAG,aAAa,CAAC,IAAI,IAAI;wBAChC,MAAM,EAAE,GAAG,UAAU,CAAC,IAAI,IAAI;wBAC9B,SAAS,EAAE,cAAc,aAAa,CAAC,KAAK,kBAAkB,UAAU,CAAC,KAAK,KAAK;qBACpF,YAEA,UAAU,CAAC,UAAU,CAAC,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,IAX7C,aAAa,CAAC,GAAG,CAYlB,CACP,CAAC,IAhBiB,UAAU,CAAC,GAAG,CAiBlB,CAClB,CAAC,GACE,GACF,CACP,CAAC;AACJ,CAAC"}
@@ -1,5 +0,0 @@
1
- export declare function FolderView(props: {
2
- className?: string;
3
- }): import("react/jsx-runtime").JSX.Element;
4
- export default FolderView;
5
- //# sourceMappingURL=folder-view.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"folder-view.d.ts","sourceRoot":"","sources":["../../../../editors/generic-drive-explorer/components/folder-view.tsx"],"names":[],"mappings":"AAWA,wBAAgB,UAAU,CAAC,KAAK,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,2CAmCvD;AAED,eAAe,UAAU,CAAC"}
@@ -1,19 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { FolderItem } from "@powerhousedao/design-system/connect";
3
- import { useDrop } from "@powerhousedao/design-system/connect";
4
- import { isFolderNodeKind, useNodesInSelectedDriveOrFolder, useSelectedFolder, } from "@powerhousedao/reactor-browser";
5
- import { twMerge } from "tailwind-merge";
6
- import { FileContentView } from "./file-content-view.js";
7
- import { DriveLayout } from "./layout.js";
8
- export function FolderView(props) {
9
- const { className } = props;
10
- const nodes = useNodesInSelectedDriveOrFolder();
11
- const selectedFolder = useSelectedFolder();
12
- const folderNodes = nodes.filter((n) => isFolderNodeKind(n));
13
- const { isDropTarget, dropProps } = useDrop({
14
- target: selectedFolder,
15
- });
16
- return (_jsxs("div", { className: twMerge("rounded-md border-2 border-transparent p-2", isDropTarget && "border-dashed border-blue-100", className), ...dropProps, children: [_jsx(DriveLayout.ContentSection, { title: "Folders", className: "mb-4", children: folderNodes.length > 0 ? (folderNodes.map((folderNode) => (_jsx(FolderItem, { folderNode: folderNode }, folderNode.id)))) : (_jsx("div", { className: "mb-8 text-sm text-gray-400", children: "No documents or files \uD83D\uDCC4" })) }), _jsx(DriveLayout.ContentSection, { title: "Documents and files", children: _jsx("div", { className: "w-full", children: _jsx(FileContentView, {}) }) })] }));
17
- }
18
- export default FolderView;
19
- //# sourceMappingURL=folder-view.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"folder-view.js","sourceRoot":"","sources":["../../../../editors/generic-drive-explorer/components/folder-view.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAC;AAC/D,OAAO,EACL,gBAAgB,EAChB,+BAA+B,EAC/B,iBAAiB,GAClB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,UAAU,UAAU,CAAC,KAA6B;IACtD,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IAC5B,MAAM,KAAK,GAAG,+BAA+B,EAAE,CAAC;IAChD,MAAM,cAAc,GAAG,iBAAiB,EAAE,CAAC;IAC3C,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7D,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;QAC1C,MAAM,EAAE,cAAc;KACvB,CAAC,CAAC;IACH,OAAO,CACL,eACE,SAAS,EAAE,OAAO,CAChB,4CAA4C,EAC5C,YAAY,IAAI,+BAA+B,EAC/C,SAAS,CACV,KACG,SAAS,aAEb,KAAC,WAAW,CAAC,cAAc,IAAC,KAAK,EAAC,SAAS,EAAC,SAAS,EAAC,MAAM,YACzD,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CACxB,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CAC9B,KAAC,UAAU,IAAqB,UAAU,EAAE,UAAU,IAArC,UAAU,CAAC,EAAE,CAA4B,CAC3D,CAAC,CACH,CAAC,CAAC,CAAC,CACF,cAAK,SAAS,EAAC,4BAA4B,mDAErC,CACP,GAC0B,EAC7B,KAAC,WAAW,CAAC,cAAc,IAAC,KAAK,EAAC,qBAAqB,YACrD,cAAK,SAAS,EAAC,QAAQ,YACrB,KAAC,eAAe,KAAG,GACf,GACqB,IACzB,CACP,CAAC;AACJ,CAAC;AAED,eAAe,UAAU,CAAC"}
@@ -1,6 +0,0 @@
1
- export * from "./create-document.js";
2
- export * from "./file-content-view.js";
3
- export * from "./folder-view.js";
4
- export * from "./layout.js";
5
- export * from "./search-bar.js";
6
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../editors/generic-drive-explorer/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC"}
@@ -1,6 +0,0 @@
1
- export * from "./create-document.js";
2
- export * from "./file-content-view.js";
3
- export * from "./folder-view.js";
4
- export * from "./layout.js";
5
- export * from "./search-bar.js";
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../editors/generic-drive-explorer/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC"}
@@ -1,12 +0,0 @@
1
- import type { BaseProps } from "@powerhousedao/common";
2
- export declare function DriveLayout({ children, className, ...props }: BaseProps): import("react/jsx-runtime").JSX.Element;
3
- export declare namespace DriveLayout {
4
- var Container: ({ children, className, containerProps, ...props }: BaseProps) => import("react/jsx-runtime").JSX.Element;
5
- var Header: ({ children, className, containerProps, ...props }: BaseProps) => import("react/jsx-runtime").JSX.Element;
6
- var Content: ({ children, className, containerProps, ...props }: BaseProps) => import("react/jsx-runtime").JSX.Element;
7
- var ContentSection: ({ title, children, className, containerProps, ...props }: BaseProps & {
8
- title?: string;
9
- }) => import("react/jsx-runtime").JSX.Element;
10
- var Footer: ({ children, className, containerProps, ...props }: BaseProps) => import("react/jsx-runtime").JSX.Element;
11
- }
12
- //# sourceMappingURL=layout.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../../editors/generic-drive-explorer/components/layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGvD,wBAAgB,WAAW,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,2CAMvE;yBANe,WAAW;uEAaxB,SAAS;oEAoBT,SAAS;qEAaT,SAAS;mFAkBT,SAAS,GAAG;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE;oEAkB9B,SAAS"}
@@ -1,21 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { cn } from "@powerhousedao/design-system";
3
- export function DriveLayout({ children, className, ...props }) {
4
- return (_jsx(DriveLayout.Container, { className: className, ...props, children: children }));
5
- }
6
- DriveLayout.Container = function DriveLayoutContainer({ children, className, containerProps, ...props }) {
7
- return (_jsx("div", { className: cn("flex grow flex-col overflow-auto rounded-2xl bg-gray-50 p-2", className), ...containerProps, ...props, children: children }));
8
- };
9
- DriveLayout.Header = function DriveLayoutHeader({ children, className, containerProps, ...props }) {
10
- return (_jsx("div", { className: cn("flex-0", className), ...containerProps, ...props, children: children }));
11
- };
12
- DriveLayout.Content = function DriveLayoutContent({ children, className, containerProps, ...props }) {
13
- return (_jsx("div", { className: cn("mb-5 flex-1 px-4", className), ...containerProps, ...props, children: children }));
14
- };
15
- DriveLayout.ContentSection = function DriveLayoutContentSection({ title, children, className, containerProps, ...props }) {
16
- return (_jsxs("div", { className: cn(className), ...containerProps, ...props, children: [title && (_jsx("div", { className: "mb-4 text-base font-semibold text-gray-600", children: title })), _jsx("div", { className: "flex flex-wrap gap-2", children: children })] }));
17
- };
18
- DriveLayout.Footer = function DriveLayoutFooter({ children, className, containerProps, ...props }) {
19
- return (_jsx("div", { className: cn("flex-0", className), ...containerProps, ...props, children: children }));
20
- };
21
- //# sourceMappingURL=layout.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"layout.js","sourceRoot":"","sources":["../../../../editors/generic-drive-explorer/components/layout.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,8BAA8B,CAAC;AAElD,MAAM,UAAU,WAAW,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,EAAa;IACtE,OAAO,CACL,KAAC,WAAW,CAAC,SAAS,IAAC,SAAS,EAAE,SAAS,KAAM,KAAK,YACnD,QAAQ,GACa,CACzB,CAAC;AACJ,CAAC;AAED,WAAW,CAAC,SAAS,GAAG,SAAS,oBAAoB,CAAC,EACpD,QAAQ,EACR,SAAS,EACT,cAAc,EACd,GAAG,KAAK,EACE;IACV,OAAO,CACL,cACE,SAAS,EAAE,EAAE,CACX,6DAA6D,EAC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react/jsx-runtime").JSX.Element;
2
- //# sourceMappingURL=search-bar.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"search-bar.d.ts","sourceRoot":"","sources":["../../../../editors/generic-drive-explorer/components/search-bar.tsx"],"names":[],"mappings":"AAkCA,eAAO,MAAM,SAAS,+CAcrB,CAAC"}
@@ -1,38 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Icon } from "@powerhousedao/design-system";
3
- import { ConnectSearchBar } from "@powerhousedao/design-system/connect";
4
- import { useState } from "react";
5
- import { useTranslation } from "react-i18next";
6
- const defaultFilterItems = [
7
- {
8
- id: "project",
9
- label: ".project",
10
- icon: _jsx(Icon, { name: "Project", color: "#FF6A55", size: 16 }),
11
- },
12
- {
13
- id: "budget",
14
- label: ".budget",
15
- icon: _jsx(Icon, { name: "BarChart", color: "#8E55EA", size: 16 }),
16
- },
17
- {
18
- id: "profile",
19
- label: ".profile",
20
- icon: _jsx(Icon, { name: "Person", color: "#3E90F0", size: 16 }),
21
- },
22
- {
23
- id: "legal",
24
- label: ".legal",
25
- icon: _jsx(Icon, { name: "Briefcase", color: "#4BAB71", size: 16 }),
26
- },
27
- {
28
- id: "atlas",
29
- label: ".Atlas",
30
- icon: _jsx(Icon, { name: "Globe", color: "#FF8A00", size: 16 }),
31
- },
32
- ];
33
- export const SearchBar = () => {
34
- const { t } = useTranslation();
35
- const [value, setValue] = useState(""); // TODO
36
- return (_jsx(ConnectSearchBar, { className: "max-w-searchbar-width m-4 shrink-0 bg-gray-100", placeholder: t("searchbar.placeholder"), filterLabel: t("searchbar.filterLabel"), filterItems: defaultFilterItems, value: value, onChange: setValue }));
37
- };
38
- //# sourceMappingURL=search-bar.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"search-bar.js","sourceRoot":"","sources":["../../../../editors/generic-drive-explorer/components/search-bar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AAEpD,OAAO,E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AAgB,IACf,SAAS,EAAC,gDAAgD,EAC1D,WAAW,EAAE,CAAC,CAAC,uBAAuB,CAAC,EACvC,WAAW,EAAE,CAAC,CAAC,uBAAuB,CAAC,EACvC,WAAW,EAAE,kBAAkB,EAC/B,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC;AACJ,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { PHDriveEditorConfig } from "@powerhousedao/reactor-browser";
2
- export declare const editorConfig: PHDriveEditorConfig;
3
- //# sourceMappingURL=config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../editors/generic-drive-explorer/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAE1E,eAAO,MAAM,YAAY,EAAE,mBAG1B,CAAC"}
@@ -1,5 +0,0 @@
1
- export const editorConfig = {
2
- allowedDocumentTypes: [],
3
- isDragAndDropEnabled: true,
4
- };
5
- //# sourceMappingURL=config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../editors/generic-drive-explorer/config.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,YAAY,GAAwB;IAC/C,oBAAoB,EAAE,EAAE;IACxB,oBAAoB,EAAE,IAAI;CAC3B,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { EditorProps } from "document-model";
2
- export default function Editor(props: EditorProps): import("react/jsx-runtime").JSX.Element;
3
- //# sourceMappingURL=editor.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../editors/generic-drive-explorer/editor.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAMlD,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,WAAW,2CA8BhD"}
@@ -1,16 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Breadcrumbs } from "@powerhousedao/design-system/connect";
3
- import { useDrop } from "@powerhousedao/design-system/connect";
4
- import { useSetPHDriveEditorConfig } from "@powerhousedao/reactor-browser";
5
- import { CreateDocument } from "./components/create-document.js";
6
- import FolderView from "./components/folder-view.js";
7
- import { DriveLayout } from "./components/layout.js";
8
- import { editorConfig } from "./config.js";
9
- export default function Editor(props) {
10
- useSetPHDriveEditorConfig(editorConfig);
11
- const { className, children } = props;
12
- const { isDropTarget, dropProps } = useDrop();
13
- const showDocumentEditor = !!children;
14
- return (_jsxs(DriveLayout, { className: className, children: [!showDocumentEditor && (_jsx(DriveLayout.Header, { children: _jsx(Breadcrumbs, {}) })), showDocumentEditor ? (children) : (_jsx(DriveLayout.Content, { ...dropProps, className: isDropTarget ? "rounded-xl bg-blue-100" : "", children: _jsx(FolderView, {}) })), !showDocumentEditor && (_jsx(DriveLayout.Footer, { children: _jsx(CreateDocument, {}) }))] }));
15
- }
16
- //# sourceMappingURL=editor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"editor.js","sourceRoot":"","sources":["../../../editors/generic-drive-explorer/editor.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAC;AAC/D,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAE3E,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,UAAU,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAkB;IAC/C,yBAAyB,CAAC,YAAY,CAAC,CAAC;IACxC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IACtC,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,GAAG,OAAO,EAAE,CAAC;IAC9C,MAAM,kBAAkB,GAAG,CAAC,CAAC,QAAQ,CAAC;IAEtC,OAAO,CACL,MAAC,WAAW,IAAC,SAAS,EAAE,SAAS,aAC9B,CAAC,kBAAkB,IAAI,CACtB,KAAC,WAAW,CAAC,MAAM,cACjB,KAAC,WAAW,KAAG,GACI,CACtB,EACA,kBAAkB,CAAC,CAAC,CAAC,CACpB,QAAQ,CACT,CAAC,CAAC,CAAC,CACF,KAAC,WAAW,CAAC,OAAO,OACd,SAAS,EACb,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC,EAAE,YAEvD,KAAC,UAAU,KAAG,GACM,CACvB,EACA,CAAC,kBAAkB,IAAI,CACtB,KAAC,WAAW,CAAC,MAAM,cACjB,KAAC,cAAc,KAAG,GACC,CACtB,IACW,CACf,CAAC;AACJ,CAAC"}
@@ -1,6 +0,0 @@
1
- import type { Meta } from "@storybook/react";
2
- import Editor from "./editor.js";
3
- declare const meta: Meta<typeof Editor>;
4
- export declare const Empty: any;
5
- export default meta;
6
- //# sourceMappingURL=generic-drive-explorer.stories.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generic-drive-explorer.stories.d.ts","sourceRoot":"","sources":["../../../editors/generic-drive-explorer/generic-drive-explorer.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAY,MAAM,kBAAkB,CAAC;AAGvD,OAAO,MAAM,MAAM,aAAa,CAAC;AAiCjC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,MAAM,CAGN,CAAC;AACzB,eAAO,MAAM,KAAK,EAAE,GAAyB,CAAC;AAE9C,eAAe,IAAI,CAAC"}