@powerhousedao/powerhouse-vetra-packages 6.2.3-dev.69 → 6.2.3-dev.70

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 (92) hide show
  1. package/dist/browser/document-models/index.js +1 -1
  2. package/dist/{node/documents-D70S9PZL.mjs → browser/documents-BLZ-QW5b.js} +4 -5
  3. package/dist/browser/documents-BLZ-QW5b.js.map +1 -0
  4. package/dist/browser/{editor-C46DbRGz.js → editor-Dmpkd8pQ.js} +3 -3
  5. package/dist/browser/{editor-C46DbRGz.js.map → editor-Dmpkd8pQ.js.map} +1 -1
  6. package/dist/browser/editor-x1UIfSot.js +2277 -0
  7. package/dist/browser/editor-x1UIfSot.js.map +1 -0
  8. package/dist/browser/editors/document-model-editor/module.js +1 -1
  9. package/dist/browser/editors/document-model-editor/module.js.map +1 -1
  10. package/dist/browser/editors/generic-drive-explorer/index.js +4 -341
  11. package/dist/browser/editors/generic-drive-explorer/index.js.map +1 -1
  12. package/dist/browser/editors/generic-drive-explorer/module.js +1 -1
  13. package/dist/browser/folder-view-CwIU4XEe.js +237 -0
  14. package/dist/browser/folder-view-CwIU4XEe.js.map +1 -0
  15. package/dist/browser/graphql-editor-CpcGaYmP.js +103 -0
  16. package/dist/browser/graphql-editor-CpcGaYmP.js.map +1 -0
  17. package/dist/browser/hooks-BmHa-lY2.js +126 -0
  18. package/dist/browser/hooks-BmHa-lY2.js.map +1 -0
  19. package/dist/browser/index.js +5 -805
  20. package/dist/browser/index.js.map +1 -1
  21. package/dist/browser/json-editor-CB1XmZgN.js +55 -0
  22. package/dist/browser/json-editor-CB1XmZgN.js.map +1 -0
  23. package/dist/browser/schema-context-5evhtuMb.js +70 -0
  24. package/dist/browser/schema-context-5evhtuMb.js.map +1 -0
  25. package/dist/browser/state-schemas-DHLAg1w0.js +300 -0
  26. package/dist/browser/state-schemas-DHLAg1w0.js.map +1 -0
  27. package/dist/node/bundle-mjs-Cuu3DEfT.mjs +3140 -0
  28. package/dist/node/bundle-mjs-Cuu3DEfT.mjs.map +1 -0
  29. package/dist/node/{graphql-Dp4j7rmx.mjs → documents-CFiuC6XV.mjs} +16 -3
  30. package/dist/node/documents-CFiuC6XV.mjs.map +1 -0
  31. package/dist/node/{editor-pTt1k9t6.mjs → editor-7g9ujMII.mjs} +2883 -2733
  32. package/dist/node/editor-7g9ujMII.mjs.map +1 -0
  33. package/dist/node/{editor-DXke64og.mjs → editor-NwTlNx8z.mjs} +3 -3
  34. package/dist/node/{editor-DXke64og.mjs.map → editor-NwTlNx8z.mjs.map} +1 -1
  35. package/dist/node/editors/document-model-editor/module.mjs +1 -1
  36. package/dist/node/editors/document-model-editor/module.mjs.map +1 -1
  37. package/dist/node/editors/generic-drive-explorer/index.mjs +3 -4
  38. package/dist/node/editors/generic-drive-explorer/index.mjs.map +1 -1
  39. package/dist/node/editors/generic-drive-explorer/module.mjs +1 -1
  40. package/dist/node/{folder-view-UO8P7SfT.mjs → folder-view-CkCNU8A_.mjs} +4 -4
  41. package/dist/node/folder-view-CkCNU8A_.mjs.map +1 -0
  42. package/dist/node/{graphql-editor-CBJXEY_C.mjs → graphql-editor-v1OXETjM.mjs} +5079 -26
  43. package/dist/node/graphql-editor-v1OXETjM.mjs.map +1 -0
  44. package/dist/{browser/hooks-eQxBX7g4.js → node/hooks-gEAaW5rF.mjs} +2 -2
  45. package/dist/node/{hooks-C2b46djt.mjs.map → hooks-gEAaW5rF.mjs.map} +1 -1
  46. package/dist/node/index.mjs +3 -178
  47. package/dist/node/index.mjs.map +1 -1
  48. package/dist/{browser/json-editor-DfRD-pfk.js → node/json-editor-8dfjgcaX.mjs} +3 -3
  49. package/dist/node/{json-editor-DaqHARBD.mjs.map → json-editor-8dfjgcaX.mjs.map} +1 -1
  50. package/dist/node/rolldown-runtime-Bl3dcgcQ.mjs +16 -0
  51. package/dist/node/{schema-context-CojjnSE6.mjs → schema-context-DgUu7l_Q.mjs} +2 -3
  52. package/dist/node/{schema-context-CojjnSE6.mjs.map → schema-context-DgUu7l_Q.mjs.map} +1 -1
  53. package/dist/node/{state-schemas-C-3b_V-y.mjs → state-schemas-DXWpf1zO.mjs} +419 -53
  54. package/dist/node/state-schemas-DXWpf1zO.mjs.map +1 -0
  55. package/package.json +19 -17
  56. package/dist/browser/assets/entry-oIniX8Dq.js +0 -418
  57. package/dist/browser/assets/projection-entry-CdlLTrjU.js +0 -482
  58. package/dist/browser/documents-CRzouuNR.js +0 -6067
  59. package/dist/browser/documents-CRzouuNR.js.map +0 -1
  60. package/dist/browser/editor-CHAz7_5H.js +0 -4676
  61. package/dist/browser/editor-CHAz7_5H.js.map +0 -1
  62. package/dist/browser/folder-view-ByndDKAA.js +0 -966
  63. package/dist/browser/folder-view-ByndDKAA.js.map +0 -1
  64. package/dist/browser/graphql-editor-DaeXCZJ2.js +0 -11708
  65. package/dist/browser/graphql-editor-DaeXCZJ2.js.map +0 -1
  66. package/dist/browser/hooks-eQxBX7g4.js.map +0 -1
  67. package/dist/browser/icon-components-CJ4I3Y6Y-63fqUqwJ.js +0 -3188
  68. package/dist/browser/icon-components-CJ4I3Y6Y-63fqUqwJ.js.map +0 -1
  69. package/dist/browser/json-editor-DfRD-pfk.js.map +0 -1
  70. package/dist/browser/parser-DtbeHA3H.js +0 -2554
  71. package/dist/browser/parser-DtbeHA3H.js.map +0 -1
  72. package/dist/browser/rolldown-runtime-DC62tzP2.js +0 -33
  73. package/dist/browser/src-CohvVFnR-DSqs821B.js +0 -5694
  74. package/dist/browser/src-CohvVFnR-DSqs821B.js.map +0 -1
  75. package/dist/browser/state-schemas-CVfWDSOU.js +0 -696
  76. package/dist/browser/state-schemas-CVfWDSOU.js.map +0 -1
  77. package/dist/browser/tslib.es6-Cno80yFJ.js +0 -32
  78. package/dist/browser/tslib.es6-Cno80yFJ.js.map +0 -1
  79. package/dist/node/documents-D70S9PZL.mjs.map +0 -1
  80. package/dist/node/editor-pTt1k9t6.mjs.map +0 -1
  81. package/dist/node/folder-view-UO8P7SfT.mjs.map +0 -1
  82. package/dist/node/graphql-Dp4j7rmx.mjs.map +0 -1
  83. package/dist/node/graphql-editor-CBJXEY_C.mjs.map +0 -1
  84. package/dist/node/hooks-C2b46djt.mjs +0 -24593
  85. package/dist/node/icon-components-CJ4I3Y6Y-BEyG_aKA.mjs +0 -3188
  86. package/dist/node/icon-components-CJ4I3Y6Y-BEyG_aKA.mjs.map +0 -1
  87. package/dist/node/json-editor-DaqHARBD.mjs +0 -153
  88. package/dist/node/src-CohvVFnR-6ubKLBl5.mjs +0 -6375
  89. package/dist/node/src-CohvVFnR-6ubKLBl5.mjs.map +0 -1
  90. package/dist/node/state-schemas-C-3b_V-y.mjs.map +0 -1
  91. package/dist/node/tslib.es6-VORZjfk3.mjs +0 -583
  92. package/dist/node/tslib.es6-VORZjfk3.mjs.map +0 -1
@@ -1,346 +1,9 @@
1
- import { t as __commonJSMin } from "../../rolldown-runtime-DC62tzP2.js";
2
1
  import { GenericDriveExplorer } from "./module.js";
3
- import { A as Icon } from "../../src-CohvVFnR-DSqs821B.js";
4
- import { i as CreateDocument, n as DriveLayout, r as FileContentView, t as FolderView } from "../../folder-view-ByndDKAA.js";
5
- import * as m from "react";
6
- import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
2
+ import { i as CreateDocument, n as DriveLayout, r as FileContentView, t as FolderView } from "../../folder-view-CwIU4XEe.js";
3
+ import { useState } from "react";
4
+ import { ConnectSearchBar, Icon } from "@powerhousedao/design-system/connect";
7
5
  import { jsx } from "react/jsx-runtime";
8
- import { ConnectSearchBar } from "@powerhousedao/design-system/connect";
9
- //#region ../../node_modules/.pnpm/react-i18next@16.5.4_i18next@25.8.13_typescript@7.0.2__react-dom@19.2.6_react@19.2.6__react@19.2.6_typescript@7.0.2/node_modules/react-i18next/dist/es/utils.js
10
- const warn = (i18n, code, msg, rest) => {
11
- const args = [msg, {
12
- code,
13
- ...rest || {}
14
- }];
15
- if (i18n?.services?.logger?.forward) return i18n.services.logger.forward(args, "warn", "react-i18next::", true);
16
- if (isString(args[0])) args[0] = `react-i18next:: ${args[0]}`;
17
- if (i18n?.services?.logger?.warn) i18n.services.logger.warn(...args);
18
- else if (console?.warn) console.warn(...args);
19
- };
20
- const alreadyWarned = {};
21
- const warnOnce = (i18n, code, msg, rest) => {
22
- if (isString(msg) && alreadyWarned[msg]) return;
23
- if (isString(msg)) alreadyWarned[msg] = /* @__PURE__ */ new Date();
24
- warn(i18n, code, msg, rest);
25
- };
26
- const loadedClb = (i18n, cb) => () => {
27
- if (i18n.isInitialized) cb();
28
- else {
29
- const initialized = () => {
30
- setTimeout(() => {
31
- i18n.off("initialized", initialized);
32
- }, 0);
33
- cb();
34
- };
35
- i18n.on("initialized", initialized);
36
- }
37
- };
38
- const loadNamespaces = (i18n, ns, cb) => {
39
- i18n.loadNamespaces(ns, loadedClb(i18n, cb));
40
- };
41
- const loadLanguages = (i18n, lng, ns, cb) => {
42
- if (isString(ns)) ns = [ns];
43
- if (i18n.options.preload && i18n.options.preload.indexOf(lng) > -1) return loadNamespaces(i18n, ns, cb);
44
- ns.forEach((n) => {
45
- if (i18n.options.ns.indexOf(n) < 0) i18n.options.ns.push(n);
46
- });
47
- i18n.loadLanguages(lng, loadedClb(i18n, cb));
48
- };
49
- const hasLoadedNamespace = (ns, i18n, options = {}) => {
50
- if (!i18n.languages || !i18n.languages.length) {
51
- warnOnce(i18n, "NO_LANGUAGES", "i18n.languages were undefined or empty", { languages: i18n.languages });
52
- return true;
53
- }
54
- return i18n.hasLoadedNamespace(ns, {
55
- lng: options.lng,
56
- precheck: (i18nInstance, loadNotPending) => {
57
- if (options.bindI18n && options.bindI18n.indexOf("languageChanging") > -1 && i18nInstance.services.backendConnector.backend && i18nInstance.isLanguageChangingTo && !loadNotPending(i18nInstance.isLanguageChangingTo, ns)) return false;
58
- }
59
- });
60
- };
61
- const isString = (obj) => typeof obj === "string";
62
- const isObject = (obj) => typeof obj === "object" && obj !== null;
63
- //#endregion
64
- //#region ../../node_modules/.pnpm/react-i18next@16.5.4_i18next@25.8.13_typescript@7.0.2__react-dom@19.2.6_react@19.2.6__react@19.2.6_typescript@7.0.2/node_modules/react-i18next/dist/es/unescape.js
65
- const matchHtmlEntity = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g;
66
- const htmlEntities = {
67
- "&amp;": "&",
68
- "&#38;": "&",
69
- "&lt;": "<",
70
- "&#60;": "<",
71
- "&gt;": ">",
72
- "&#62;": ">",
73
- "&apos;": "'",
74
- "&#39;": "'",
75
- "&quot;": "\"",
76
- "&#34;": "\"",
77
- "&nbsp;": " ",
78
- "&#160;": " ",
79
- "&copy;": "©",
80
- "&#169;": "©",
81
- "&reg;": "®",
82
- "&#174;": "®",
83
- "&hellip;": "…",
84
- "&#8230;": "…",
85
- "&#x2F;": "/",
86
- "&#47;": "/"
87
- };
88
- const unescapeHtmlEntity = (m) => htmlEntities[m];
89
- const unescape = (text) => text.replace(matchHtmlEntity, unescapeHtmlEntity);
90
- //#endregion
91
- //#region ../../node_modules/.pnpm/react-i18next@16.5.4_i18next@25.8.13_typescript@7.0.2__react-dom@19.2.6_react@19.2.6__react@19.2.6_typescript@7.0.2/node_modules/react-i18next/dist/es/defaults.js
92
- let defaultOptions = {
93
- bindI18n: "languageChanged",
94
- bindI18nStore: "",
95
- transEmptyNodeValue: "",
96
- transSupportBasicHtmlNodes: true,
97
- transWrapTextNodes: "",
98
- transKeepBasicHtmlNodesFor: [
99
- "br",
100
- "strong",
101
- "i",
102
- "p"
103
- ],
104
- useSuspense: true,
105
- unescape,
106
- transDefaultProps: void 0
107
- };
108
- const getDefaults = () => defaultOptions;
109
- //#endregion
110
- //#region ../../node_modules/.pnpm/react-i18next@16.5.4_i18next@25.8.13_typescript@7.0.2__react-dom@19.2.6_react@19.2.6__react@19.2.6_typescript@7.0.2/node_modules/react-i18next/dist/es/i18nInstance.js
111
- let i18nInstance;
112
- const getI18n = () => i18nInstance;
113
- //#endregion
114
- //#region ../../node_modules/.pnpm/react-i18next@16.5.4_i18next@25.8.13_typescript@7.0.2__react-dom@19.2.6_react@19.2.6__react@19.2.6_typescript@7.0.2/node_modules/react-i18next/dist/es/context.js
115
- const I18nContext = createContext();
116
- var ReportNamespaces = class {
117
- constructor() {
118
- this.usedNamespaces = {};
119
- }
120
- addUsedNamespaces(namespaces) {
121
- namespaces.forEach((ns) => {
122
- if (!this.usedNamespaces[ns]) this.usedNamespaces[ns] = true;
123
- });
124
- }
125
- getUsedNamespaces() {
126
- return Object.keys(this.usedNamespaces);
127
- }
128
- };
129
- //#endregion
130
- //#region builtin:esm-external-require-react
131
- var require_builtin_esm_external_require_react = /* @__PURE__ */ __commonJSMin(((exports, module) => {
132
- module.exports = { ...m };
133
- }));
134
- //#endregion
135
- //#region ../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.6/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js
136
- /**
137
- * @license React
138
- * use-sync-external-store-shim.development.js
139
- *
140
- * Copyright (c) Meta Platforms, Inc. and affiliates.
141
- *
142
- * This source code is licensed under the MIT license found in the
143
- * LICENSE file in the root directory of this source tree.
144
- */
145
- var require_use_sync_external_store_shim_development = /* @__PURE__ */ __commonJSMin(((exports) => {
146
- (function() {
147
- function is(x, y) {
148
- return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
149
- }
150
- function useSyncExternalStore$2(subscribe, getSnapshot) {
151
- didWarnOld18Alpha || void 0 === React.startTransition || (didWarnOld18Alpha = !0, console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));
152
- var value = getSnapshot();
153
- if (!didWarnUncachedGetSnapshot) {
154
- var cachedValue = getSnapshot();
155
- objectIs(value, cachedValue) || (console.error("The result of getSnapshot should be cached to avoid an infinite loop"), didWarnUncachedGetSnapshot = !0);
156
- }
157
- cachedValue = useState({ inst: {
158
- value,
159
- getSnapshot
160
- } });
161
- var inst = cachedValue[0].inst, forceUpdate = cachedValue[1];
162
- useLayoutEffect(function() {
163
- inst.value = value;
164
- inst.getSnapshot = getSnapshot;
165
- checkIfSnapshotChanged(inst) && forceUpdate({ inst });
166
- }, [
167
- subscribe,
168
- value,
169
- getSnapshot
170
- ]);
171
- useEffect(function() {
172
- checkIfSnapshotChanged(inst) && forceUpdate({ inst });
173
- return subscribe(function() {
174
- checkIfSnapshotChanged(inst) && forceUpdate({ inst });
175
- });
176
- }, [subscribe]);
177
- useDebugValue(value);
178
- return value;
179
- }
180
- function checkIfSnapshotChanged(inst) {
181
- var latestGetSnapshot = inst.getSnapshot;
182
- inst = inst.value;
183
- try {
184
- var nextValue = latestGetSnapshot();
185
- return !objectIs(inst, nextValue);
186
- } catch (error) {
187
- return !0;
188
- }
189
- }
190
- function useSyncExternalStore$1(subscribe, getSnapshot) {
191
- return getSnapshot();
192
- }
193
- "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
194
- var React = require_builtin_esm_external_require_react(), objectIs = "function" === typeof Object.is ? Object.is : is, useState = React.useState, useEffect = React.useEffect, useLayoutEffect = React.useLayoutEffect, useDebugValue = React.useDebugValue, didWarnOld18Alpha = !1, didWarnUncachedGetSnapshot = !1, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
195
- exports.useSyncExternalStore = void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;
196
- "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
197
- })();
198
- }));
199
- //#endregion
200
- //#region ../../node_modules/.pnpm/react-i18next@16.5.4_i18next@25.8.13_typescript@7.0.2__react-dom@19.2.6_react@19.2.6__react@19.2.6_typescript@7.0.2/node_modules/react-i18next/dist/es/useTranslation.js
201
- var import_shim = (/* @__PURE__ */ __commonJSMin(((exports, module) => {
202
- module.exports = require_use_sync_external_store_shim_development();
203
- })))();
204
- const notReadyT = (k, optsOrDefaultValue) => {
205
- if (isString(optsOrDefaultValue)) return optsOrDefaultValue;
206
- if (isObject(optsOrDefaultValue) && isString(optsOrDefaultValue.defaultValue)) return optsOrDefaultValue.defaultValue;
207
- return Array.isArray(k) ? k[k.length - 1] : k;
208
- };
209
- const notReadySnapshot = {
210
- t: notReadyT,
211
- ready: false
212
- };
213
- const dummySubscribe = () => () => {};
214
- const useTranslation = (ns, props = {}) => {
215
- const { i18n: i18nFromProps } = props;
216
- const { i18n: i18nFromContext, defaultNS: defaultNSFromContext } = useContext(I18nContext) || {};
217
- const i18n = i18nFromProps || i18nFromContext || getI18n();
218
- if (i18n && !i18n.reportNamespaces) i18n.reportNamespaces = new ReportNamespaces();
219
- if (!i18n) warnOnce(i18n, "NO_I18NEXT_INSTANCE", "useTranslation: You will need to pass in an i18next instance by using initReactI18next");
220
- const i18nOptions = useMemo(() => ({
221
- ...getDefaults(),
222
- ...i18n?.options?.react,
223
- ...props
224
- }), [i18n, props]);
225
- const { useSuspense, keyPrefix } = i18nOptions;
226
- const nsOrContext = ns || defaultNSFromContext || i18n?.options?.defaultNS;
227
- const unstableNamespaces = isString(nsOrContext) ? [nsOrContext] : nsOrContext || ["translation"];
228
- const namespaces = useMemo(() => unstableNamespaces, unstableNamespaces);
229
- i18n?.reportNamespaces?.addUsedNamespaces?.(namespaces);
230
- const revisionRef = useRef(0);
231
- const subscribe = useCallback((callback) => {
232
- if (!i18n) return dummySubscribe;
233
- const { bindI18n, bindI18nStore } = i18nOptions;
234
- const wrappedCallback = () => {
235
- revisionRef.current += 1;
236
- callback();
237
- };
238
- if (bindI18n) i18n.on(bindI18n, wrappedCallback);
239
- if (bindI18nStore) i18n.store.on(bindI18nStore, wrappedCallback);
240
- return () => {
241
- if (bindI18n) bindI18n.split(" ").forEach((e) => i18n.off(e, wrappedCallback));
242
- if (bindI18nStore) bindI18nStore.split(" ").forEach((e) => i18n.store.off(e, wrappedCallback));
243
- };
244
- }, [i18n, i18nOptions]);
245
- const snapshotRef = useRef();
246
- const getSnapshot = useCallback(() => {
247
- if (!i18n) return notReadySnapshot;
248
- const calculatedReady = !!(i18n.isInitialized || i18n.initializedStoreOnce) && namespaces.every((n) => hasLoadedNamespace(n, i18n, i18nOptions));
249
- const currentLng = props.lng || i18n.language;
250
- const currentRevision = revisionRef.current;
251
- const lastSnapshot = snapshotRef.current;
252
- if (lastSnapshot && lastSnapshot.ready === calculatedReady && lastSnapshot.lng === currentLng && lastSnapshot.keyPrefix === keyPrefix && lastSnapshot.revision === currentRevision) return lastSnapshot;
253
- const newSnapshot = {
254
- t: i18n.getFixedT(currentLng, i18nOptions.nsMode === "fallback" ? namespaces : namespaces[0], keyPrefix),
255
- ready: calculatedReady,
256
- lng: currentLng,
257
- keyPrefix,
258
- revision: currentRevision
259
- };
260
- snapshotRef.current = newSnapshot;
261
- return newSnapshot;
262
- }, [
263
- i18n,
264
- namespaces,
265
- keyPrefix,
266
- i18nOptions,
267
- props.lng
268
- ]);
269
- const [loadCount, setLoadCount] = useState(0);
270
- const { t, ready } = (0, import_shim.useSyncExternalStore)(subscribe, getSnapshot, getSnapshot);
271
- useEffect(() => {
272
- if (i18n && !ready && !useSuspense) {
273
- const onLoaded = () => setLoadCount((c) => c + 1);
274
- if (props.lng) loadLanguages(i18n, props.lng, namespaces, onLoaded);
275
- else loadNamespaces(i18n, namespaces, onLoaded);
276
- }
277
- }, [
278
- i18n,
279
- props.lng,
280
- namespaces,
281
- ready,
282
- useSuspense,
283
- loadCount
284
- ]);
285
- const finalI18n = i18n || {};
286
- const wrapperRef = useRef(null);
287
- const wrapperLangRef = useRef();
288
- const createI18nWrapper = (original) => {
289
- const descriptors = Object.getOwnPropertyDescriptors(original);
290
- if (descriptors.__original) delete descriptors.__original;
291
- const wrapper = Object.create(Object.getPrototypeOf(original), descriptors);
292
- if (!Object.prototype.hasOwnProperty.call(wrapper, "__original")) try {
293
- Object.defineProperty(wrapper, "__original", {
294
- value: original,
295
- writable: false,
296
- enumerable: false,
297
- configurable: false
298
- });
299
- } catch (_) {}
300
- return wrapper;
301
- };
302
- const ret = useMemo(() => {
303
- const original = finalI18n;
304
- const lang = original?.language;
305
- let i18nWrapper = original;
306
- if (original) {
307
- if (wrapperRef.current && wrapperRef.current.__original === original) {
308
- if (wrapperLangRef.current !== lang) {
309
- i18nWrapper = createI18nWrapper(original);
310
- wrapperRef.current = i18nWrapper;
311
- wrapperLangRef.current = lang;
312
- } else i18nWrapper = wrapperRef.current;
313
- } else {
314
- i18nWrapper = createI18nWrapper(original);
315
- wrapperRef.current = i18nWrapper;
316
- wrapperLangRef.current = lang;
317
- }
318
- }
319
- const arr = [
320
- t,
321
- i18nWrapper,
322
- ready
323
- ];
324
- arr.t = t;
325
- arr.i18n = i18nWrapper;
326
- arr.ready = ready;
327
- return arr;
328
- }, [
329
- t,
330
- finalI18n,
331
- ready,
332
- finalI18n.resolvedLanguage,
333
- finalI18n.language,
334
- finalI18n.languages
335
- ]);
336
- if (i18n && useSuspense && !ready) throw new Promise((resolve) => {
337
- const onLoaded = () => resolve();
338
- if (props.lng) loadLanguages(i18n, props.lng, namespaces, onLoaded);
339
- else loadNamespaces(i18n, namespaces, onLoaded);
340
- });
341
- return ret;
342
- };
343
- //#endregion
6
+ import { useTranslation } from "react-i18next";
344
7
  //#region editors/generic-drive-explorer/components/search-bar.tsx
345
8
  const defaultFilterItems = [
346
9
  {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["useSyncExternalStore"],"sources":["../../../../../../node_modules/.pnpm/react-i18next@16.5.4_i18next@25.8.13_typescript@7.0.2__react-dom@19.2.6_react@19.2.6__react@19.2.6_typescript@7.0.2/node_modules/react-i18next/dist/es/utils.js","../../../../../../node_modules/.pnpm/react-i18next@16.5.4_i18next@25.8.13_typescript@7.0.2__react-dom@19.2.6_react@19.2.6__react@19.2.6_typescript@7.0.2/node_modules/react-i18next/dist/es/unescape.js","../../../../../../node_modules/.pnpm/react-i18next@16.5.4_i18next@25.8.13_typescript@7.0.2__react-dom@19.2.6_react@19.2.6__react@19.2.6_typescript@7.0.2/node_modules/react-i18next/dist/es/defaults.js","../../../../../../node_modules/.pnpm/react-i18next@16.5.4_i18next@25.8.13_typescript@7.0.2__react-dom@19.2.6_react@19.2.6__react@19.2.6_typescript@7.0.2/node_modules/react-i18next/dist/es/i18nInstance.js","../../../../../../node_modules/.pnpm/react-i18next@16.5.4_i18next@25.8.13_typescript@7.0.2__react-dom@19.2.6_react@19.2.6__react@19.2.6_typescript@7.0.2/node_modules/react-i18next/dist/es/context.js","../../../../builtin:esm-external-require-react","../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.6/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js","../../../../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.6/node_modules/use-sync-external-store/shim/index.js","../../../../../../node_modules/.pnpm/react-i18next@16.5.4_i18next@25.8.13_typescript@7.0.2__react-dom@19.2.6_react@19.2.6__react@19.2.6_typescript@7.0.2/node_modules/react-i18next/dist/es/useTranslation.js","../../../../editors/generic-drive-explorer/components/search-bar.tsx"],"sourcesContent":["export const warn = (i18n, code, msg, rest) => {\n const args = [msg, {\n code,\n ...(rest || {})\n }];\n if (i18n?.services?.logger?.forward) {\n return i18n.services.logger.forward(args, 'warn', 'react-i18next::', true);\n }\n if (isString(args[0])) args[0] = `react-i18next:: ${args[0]}`;\n if (i18n?.services?.logger?.warn) {\n i18n.services.logger.warn(...args);\n } else if (console?.warn) {\n console.warn(...args);\n }\n};\nconst alreadyWarned = {};\nexport const warnOnce = (i18n, code, msg, rest) => {\n if (isString(msg) && alreadyWarned[msg]) return;\n if (isString(msg)) alreadyWarned[msg] = new Date();\n warn(i18n, code, msg, rest);\n};\nconst loadedClb = (i18n, cb) => () => {\n if (i18n.isInitialized) {\n cb();\n } else {\n const initialized = () => {\n setTimeout(() => {\n i18n.off('initialized', initialized);\n }, 0);\n cb();\n };\n i18n.on('initialized', initialized);\n }\n};\nexport const loadNamespaces = (i18n, ns, cb) => {\n i18n.loadNamespaces(ns, loadedClb(i18n, cb));\n};\nexport const loadLanguages = (i18n, lng, ns, cb) => {\n if (isString(ns)) ns = [ns];\n if (i18n.options.preload && i18n.options.preload.indexOf(lng) > -1) return loadNamespaces(i18n, ns, cb);\n ns.forEach(n => {\n if (i18n.options.ns.indexOf(n) < 0) i18n.options.ns.push(n);\n });\n i18n.loadLanguages(lng, loadedClb(i18n, cb));\n};\nexport const hasLoadedNamespace = (ns, i18n, options = {}) => {\n if (!i18n.languages || !i18n.languages.length) {\n warnOnce(i18n, 'NO_LANGUAGES', 'i18n.languages were undefined or empty', {\n languages: i18n.languages\n });\n return true;\n }\n return i18n.hasLoadedNamespace(ns, {\n lng: options.lng,\n precheck: (i18nInstance, loadNotPending) => {\n if (options.bindI18n && options.bindI18n.indexOf('languageChanging') > -1 && i18nInstance.services.backendConnector.backend && i18nInstance.isLanguageChangingTo && !loadNotPending(i18nInstance.isLanguageChangingTo, ns)) return false;\n }\n });\n};\nexport const getDisplayName = Component => Component.displayName || Component.name || (isString(Component) && Component.length > 0 ? Component : 'Unknown');\nexport const isString = obj => typeof obj === 'string';\nexport const isObject = obj => typeof obj === 'object' && obj !== null;","const matchHtmlEntity = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g;\nconst htmlEntities = {\n '&amp;': '&',\n '&#38;': '&',\n '&lt;': '<',\n '&#60;': '<',\n '&gt;': '>',\n '&#62;': '>',\n '&apos;': \"'\",\n '&#39;': \"'\",\n '&quot;': '\"',\n '&#34;': '\"',\n '&nbsp;': ' ',\n '&#160;': ' ',\n '&copy;': '©',\n '&#169;': '©',\n '&reg;': '®',\n '&#174;': '®',\n '&hellip;': '…',\n '&#8230;': '…',\n '&#x2F;': '/',\n '&#47;': '/'\n};\nconst unescapeHtmlEntity = m => htmlEntities[m];\nexport const unescape = text => text.replace(matchHtmlEntity, unescapeHtmlEntity);","import { unescape } from './unescape.js';\nlet defaultOptions = {\n bindI18n: 'languageChanged',\n bindI18nStore: '',\n transEmptyNodeValue: '',\n transSupportBasicHtmlNodes: true,\n transWrapTextNodes: '',\n transKeepBasicHtmlNodesFor: ['br', 'strong', 'i', 'p'],\n useSuspense: true,\n unescape,\n transDefaultProps: undefined\n};\nexport const setDefaults = (options = {}) => {\n defaultOptions = {\n ...defaultOptions,\n ...options\n };\n};\nexport const getDefaults = () => defaultOptions;","let i18nInstance;\nexport const setI18n = instance => {\n i18nInstance = instance;\n};\nexport const getI18n = () => i18nInstance;","import { createContext } from 'react';\nimport { getDefaults, setDefaults } from './defaults.js';\nimport { getI18n, setI18n } from './i18nInstance.js';\nimport { initReactI18next } from './initReactI18next.js';\nexport { getDefaults, setDefaults, getI18n, setI18n, initReactI18next };\nexport const I18nContext = createContext();\nexport class ReportNamespaces {\n constructor() {\n this.usedNamespaces = {};\n }\n addUsedNamespaces(namespaces) {\n namespaces.forEach(ns => {\n if (!this.usedNamespaces[ns]) this.usedNamespaces[ns] = true;\n });\n }\n getUsedNamespaces() {\n return Object.keys(this.usedNamespaces);\n }\n}\nexport const composeInitialProps = ForComponent => async ctx => {\n const componentsInitialProps = (await ForComponent.getInitialProps?.(ctx)) ?? {};\n const i18nInitialProps = getInitialProps();\n return {\n ...componentsInitialProps,\n ...i18nInitialProps\n };\n};\nexport const getInitialProps = () => {\n const i18n = getI18n();\n const namespaces = i18n.reportNamespaces?.getUsedNamespaces() ?? [];\n const ret = {};\n const initialI18nStore = {};\n i18n.languages.forEach(l => {\n initialI18nStore[l] = {};\n namespaces.forEach(ns => {\n initialI18nStore[l][ns] = i18n.getResourceBundle(l, ns) || {};\n });\n });\n ret.initialI18nStore = initialI18nStore;\n ret.initialLanguage = i18n.language;\n return ret;\n};","import * as m from 'react';module.exports = { ...m };","/**\n * @license React\n * use-sync-external-store-shim.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n }\n function useSyncExternalStore$2(subscribe, getSnapshot) {\n didWarnOld18Alpha ||\n void 0 === React.startTransition ||\n ((didWarnOld18Alpha = !0),\n console.error(\n \"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release.\"\n ));\n var value = getSnapshot();\n if (!didWarnUncachedGetSnapshot) {\n var cachedValue = getSnapshot();\n objectIs(value, cachedValue) ||\n (console.error(\n \"The result of getSnapshot should be cached to avoid an infinite loop\"\n ),\n (didWarnUncachedGetSnapshot = !0));\n }\n cachedValue = useState({\n inst: { value: value, getSnapshot: getSnapshot }\n });\n var inst = cachedValue[0].inst,\n forceUpdate = cachedValue[1];\n useLayoutEffect(\n function () {\n inst.value = value;\n inst.getSnapshot = getSnapshot;\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n },\n [subscribe, value, getSnapshot]\n );\n useEffect(\n function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n return subscribe(function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n });\n },\n [subscribe]\n );\n useDebugValue(value);\n return value;\n }\n function checkIfSnapshotChanged(inst) {\n var latestGetSnapshot = inst.getSnapshot;\n inst = inst.value;\n try {\n var nextValue = latestGetSnapshot();\n return !objectIs(inst, nextValue);\n } catch (error) {\n return !0;\n }\n }\n function useSyncExternalStore$1(subscribe, getSnapshot) {\n return getSnapshot();\n }\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());\n var React = require(\"react\"),\n objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useState = React.useState,\n useEffect = React.useEffect,\n useLayoutEffect = React.useLayoutEffect,\n useDebugValue = React.useDebugValue,\n didWarnOld18Alpha = !1,\n didWarnUncachedGetSnapshot = !1,\n shim =\n \"undefined\" === typeof window ||\n \"undefined\" === typeof window.document ||\n \"undefined\" === typeof window.document.createElement\n ? useSyncExternalStore$1\n : useSyncExternalStore$2;\n exports.useSyncExternalStore =\n void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());\n })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('../cjs/use-sync-external-store-shim.production.js');\n} else {\n module.exports = require('../cjs/use-sync-external-store-shim.development.js');\n}\n","import { useContext, useCallback, useMemo, useEffect, useRef, useState } from 'react';\nimport { useSyncExternalStore } from 'use-sync-external-store/shim';\nimport { getI18n, getDefaults, ReportNamespaces, I18nContext } from './context.js';\nimport { warnOnce, loadNamespaces, loadLanguages, hasLoadedNamespace, isString, isObject } from './utils.js';\nconst notReadyT = (k, optsOrDefaultValue) => {\n if (isString(optsOrDefaultValue)) return optsOrDefaultValue;\n if (isObject(optsOrDefaultValue) && isString(optsOrDefaultValue.defaultValue)) return optsOrDefaultValue.defaultValue;\n return Array.isArray(k) ? k[k.length - 1] : k;\n};\nconst notReadySnapshot = {\n t: notReadyT,\n ready: false\n};\nconst dummySubscribe = () => () => {};\nexport const useTranslation = (ns, props = {}) => {\n const {\n i18n: i18nFromProps\n } = props;\n const {\n i18n: i18nFromContext,\n defaultNS: defaultNSFromContext\n } = useContext(I18nContext) || {};\n const i18n = i18nFromProps || i18nFromContext || getI18n();\n if (i18n && !i18n.reportNamespaces) i18n.reportNamespaces = new ReportNamespaces();\n if (!i18n) {\n warnOnce(i18n, 'NO_I18NEXT_INSTANCE', 'useTranslation: You will need to pass in an i18next instance by using initReactI18next');\n }\n const i18nOptions = useMemo(() => ({\n ...getDefaults(),\n ...i18n?.options?.react,\n ...props\n }), [i18n, props]);\n const {\n useSuspense,\n keyPrefix\n } = i18nOptions;\n const nsOrContext = ns || defaultNSFromContext || i18n?.options?.defaultNS;\n const unstableNamespaces = isString(nsOrContext) ? [nsOrContext] : nsOrContext || ['translation'];\n const namespaces = useMemo(() => unstableNamespaces, unstableNamespaces);\n i18n?.reportNamespaces?.addUsedNamespaces?.(namespaces);\n const revisionRef = useRef(0);\n const subscribe = useCallback(callback => {\n if (!i18n) return dummySubscribe;\n const {\n bindI18n,\n bindI18nStore\n } = i18nOptions;\n const wrappedCallback = () => {\n revisionRef.current += 1;\n callback();\n };\n if (bindI18n) i18n.on(bindI18n, wrappedCallback);\n if (bindI18nStore) i18n.store.on(bindI18nStore, wrappedCallback);\n return () => {\n if (bindI18n) bindI18n.split(' ').forEach(e => i18n.off(e, wrappedCallback));\n if (bindI18nStore) bindI18nStore.split(' ').forEach(e => i18n.store.off(e, wrappedCallback));\n };\n }, [i18n, i18nOptions]);\n const snapshotRef = useRef();\n const getSnapshot = useCallback(() => {\n if (!i18n) {\n return notReadySnapshot;\n }\n const calculatedReady = !!(i18n.isInitialized || i18n.initializedStoreOnce) && namespaces.every(n => hasLoadedNamespace(n, i18n, i18nOptions));\n const currentLng = props.lng || i18n.language;\n const currentRevision = revisionRef.current;\n const lastSnapshot = snapshotRef.current;\n if (lastSnapshot && lastSnapshot.ready === calculatedReady && lastSnapshot.lng === currentLng && lastSnapshot.keyPrefix === keyPrefix && lastSnapshot.revision === currentRevision) {\n return lastSnapshot;\n }\n const calculatedT = i18n.getFixedT(currentLng, i18nOptions.nsMode === 'fallback' ? namespaces : namespaces[0], keyPrefix);\n const newSnapshot = {\n t: calculatedT,\n ready: calculatedReady,\n lng: currentLng,\n keyPrefix,\n revision: currentRevision\n };\n snapshotRef.current = newSnapshot;\n return newSnapshot;\n }, [i18n, namespaces, keyPrefix, i18nOptions, props.lng]);\n const [loadCount, setLoadCount] = useState(0);\n const {\n t,\n ready\n } = useSyncExternalStore(subscribe, getSnapshot, getSnapshot);\n useEffect(() => {\n if (i18n && !ready && !useSuspense) {\n const onLoaded = () => setLoadCount(c => c + 1);\n if (props.lng) {\n loadLanguages(i18n, props.lng, namespaces, onLoaded);\n } else {\n loadNamespaces(i18n, namespaces, onLoaded);\n }\n }\n }, [i18n, props.lng, namespaces, ready, useSuspense, loadCount]);\n const finalI18n = i18n || {};\n const wrapperRef = useRef(null);\n const wrapperLangRef = useRef();\n const createI18nWrapper = original => {\n const descriptors = Object.getOwnPropertyDescriptors(original);\n if (descriptors.__original) delete descriptors.__original;\n const wrapper = Object.create(Object.getPrototypeOf(original), descriptors);\n if (!Object.prototype.hasOwnProperty.call(wrapper, '__original')) {\n try {\n Object.defineProperty(wrapper, '__original', {\n value: original,\n writable: false,\n enumerable: false,\n configurable: false\n });\n } catch (_) {}\n }\n return wrapper;\n };\n const ret = useMemo(() => {\n const original = finalI18n;\n const lang = original?.language;\n let i18nWrapper = original;\n if (original) {\n if (wrapperRef.current && wrapperRef.current.__original === original) {\n if (wrapperLangRef.current !== lang) {\n i18nWrapper = createI18nWrapper(original);\n wrapperRef.current = i18nWrapper;\n wrapperLangRef.current = lang;\n } else {\n i18nWrapper = wrapperRef.current;\n }\n } else {\n i18nWrapper = createI18nWrapper(original);\n wrapperRef.current = i18nWrapper;\n wrapperLangRef.current = lang;\n }\n }\n const arr = [t, i18nWrapper, ready];\n arr.t = t;\n arr.i18n = i18nWrapper;\n arr.ready = ready;\n return arr;\n }, [t, finalI18n, ready, finalI18n.resolvedLanguage, finalI18n.language, finalI18n.languages]);\n if (i18n && useSuspense && !ready) {\n throw new Promise(resolve => {\n const onLoaded = () => resolve();\n if (props.lng) {\n loadLanguages(i18n, props.lng, namespaces, onLoaded);\n } else {\n loadNamespaces(i18n, namespaces, onLoaded);\n }\n });\n }\n return ret;\n};","import { Icon } from \"@powerhousedao/design-system\";\nimport type { ConnectSearchBarProps } from \"@powerhousedao/design-system/connect\";\nimport { ConnectSearchBar } from \"@powerhousedao/design-system/connect\";\nimport { useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nconst defaultFilterItems: ConnectSearchBarProps[\"filterItems\"] = [\n {\n id: \"project\",\n label: \".project\",\n icon: <Icon name=\"Project\" color=\"#FF6A55\" size={16} />,\n },\n {\n id: \"budget\",\n label: \".budget\",\n icon: <Icon name=\"BarChart\" color=\"#8E55EA\" size={16} />,\n },\n {\n id: \"profile\",\n label: \".profile\",\n icon: <Icon name=\"Person\" color=\"#3E90F0\" size={16} />,\n },\n {\n id: \"legal\",\n label: \".legal\",\n icon: <Icon name=\"Briefcase\" color=\"#4BAB71\" size={16} />,\n },\n {\n id: \"atlas\",\n label: \".Atlas\",\n icon: <Icon name=\"Globe\" color=\"#FF8A00\" size={16} />,\n },\n];\n\nexport const SearchBar = () => {\n const { t } = useTranslation();\n const [value, setValue] = useState(\"\"); // TODO\n\n return (\n <ConnectSearchBar\n className=\"m-4 shrink-0 bg-muted\"\n placeholder={t(\"searchbar.placeholder\")}\n filterLabel={t(\"searchbar.filterLabel\")}\n filterItems={defaultFilterItems}\n value={value}\n onChange={setValue}\n />\n );\n};\n"],"x_google_ignoreList":[0,1,2,3,4,6,7,8],"mappings":";;;;;;;;;AAAA,MAAa,QAAQ,MAAM,MAAM,KAAK,SAAS;CAC7C,MAAM,OAAO,CAAC,KAAK;EACjB;EACA,GAAI,QAAQ,CAAC;CACf,CAAC;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BAAC,kBAAD;EACE,WAAU;EACV,aAAa,EAAE,uBAAuB;EACtC,aAAa,EAAE,uBAAuB;EACtC,aAAa;EACN;EACP,UAAU;CACX,CAAA;AAEL"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../editors/generic-drive-explorer/components/search-bar.tsx"],"sourcesContent":["import { ConnectSearchBar, Icon } from \"@powerhousedao/design-system/connect\";\nimport type { ConnectSearchBarProps } from \"@powerhousedao/design-system/connect\";\nimport { useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nconst defaultFilterItems: ConnectSearchBarProps[\"filterItems\"] = [\n {\n id: \"project\",\n label: \".project\",\n icon: <Icon name=\"Project\" color=\"#FF6A55\" size={16} />,\n },\n {\n id: \"budget\",\n label: \".budget\",\n icon: <Icon name=\"BarChart\" color=\"#8E55EA\" size={16} />,\n },\n {\n id: \"profile\",\n label: \".profile\",\n icon: <Icon name=\"Person\" color=\"#3E90F0\" size={16} />,\n },\n {\n id: \"legal\",\n label: \".legal\",\n icon: <Icon name=\"Briefcase\" color=\"#4BAB71\" size={16} />,\n },\n {\n id: \"atlas\",\n label: \".Atlas\",\n icon: <Icon name=\"Globe\" color=\"#FF8A00\" size={16} />,\n },\n];\n\nexport const SearchBar = () => {\n const { t } = useTranslation();\n const [value, setValue] = useState(\"\"); // TODO\n\n return (\n <ConnectSearchBar\n className=\"m-4 shrink-0 bg-muted\"\n placeholder={t(\"searchbar.placeholder\")}\n filterLabel={t(\"searchbar.filterLabel\")}\n filterItems={defaultFilterItems}\n value={value}\n onChange={setValue}\n />\n );\n};\n"],"mappings":";;;;;;;AAKA,MAAM,qBAA2D;CAC/D;EACE,IAAI;EACJ,OAAO;EACP,MAAM,oBAAC,MAAD;GAAM,MAAK;GAAU,OAAM;GAAU,MAAM;EAAK,CAAA;CACxD;CACA;EACE,IAAI;EACJ,OAAO;EACP,MAAM,oBAAC,MAAD;GAAM,MAAK;GAAW,OAAM;GAAU,MAAM;EAAK,CAAA;CACzD;CACA;EACE,IAAI;EACJ,OAAO;EACP,MAAM,oBAAC,MAAD;GAAM,MAAK;GAAS,OAAM;GAAU,MAAM;EAAK,CAAA;CACvD;CACA;EACE,IAAI;EACJ,OAAO;EACP,MAAM,oBAAC,MAAD;GAAM,MAAK;GAAY,OAAM;GAAU,MAAM;EAAK,CAAA;CAC1D;CACA;EACE,IAAI;EACJ,OAAO;EACP,MAAM,oBAAC,MAAD;GAAM,MAAK;GAAQ,OAAM;GAAU,MAAM;EAAK,CAAA;CACtD;AACF;AAEA,MAAa,kBAAkB;CAC7B,MAAM,EAAE,MAAM,eAAe;CAC7B,MAAM,CAAC,OAAO,YAAY,SAAS,EAAE;CAErC,OACE,oBAAC,kBAAD;EACE,WAAU;EACV,aAAa,EAAE,uBAAuB;EACtC,aAAa,EAAE,uBAAuB;EACtC,aAAa;EACN;EACP,UAAU;CACX,CAAA;AAEL"}
@@ -1,7 +1,7 @@
1
1
  import { lazy } from "react";
2
2
  //#region editors/generic-drive-explorer/module.ts
3
3
  const GenericDriveExplorer = {
4
- Component: lazy(() => import("../../editor-C46DbRGz.js")),
4
+ Component: lazy(() => import("../../editor-Dmpkd8pQ.js")),
5
5
  config: {
6
6
  id: "GenericDriveExplorer",
7
7
  name: "Drive Explorer App"
@@ -0,0 +1,237 @@
1
+ import React, { useRef, useState } from "react";
2
+ import { CreateDocumentWithTypeModal, FileItem, FolderItem, Icon, PowerhouseButton, useWindowSize } from "@powerhousedao/design-system/connect";
3
+ import { addDocument, isFileNodeKind, isFolderNodeKind, preloadEditorModule, useAllowedDocumentModelModules, useDisabledEditors, useEditorModules, useNodesInSelectedDriveOrFolder, useParentFolderForSelectedNode, useSelectedDriveSafe, useSelectedFolder, useSetSelectedNode, useStudioMode, useUserPermissions } from "@powerhousedao/reactor-browser";
4
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
+ import { useVirtualizer } from "@tanstack/react-virtual";
6
+ import { twMerge } from "tailwind-merge";
7
+ //#region editors/generic-drive-explorer/utils/select-creatable-modules.ts
8
+ /**
9
+ * The modules a user may pick from when creating a new document. Outside
10
+ * studio mode only the latest version of each document type is offered: new
11
+ * documents should never start on an outdated schema. Builders testing
12
+ * migrations run in studio mode and still get every version.
13
+ */
14
+ function selectCreatableModules(modules, studioMode) {
15
+ if (studioMode) return [...modules];
16
+ const latestByType = /* @__PURE__ */ new Map();
17
+ for (const module of modules) {
18
+ const id = module.documentModel.global.id;
19
+ const current = latestByType.get(id);
20
+ if (!current || (module.version ?? 1) > (current.version ?? 1)) latestByType.set(id, module);
21
+ }
22
+ return [...latestByType.values()];
23
+ }
24
+ //#endregion
25
+ //#region editors/generic-drive-explorer/components/create-document.tsx
26
+ function toDocumentTypeOption(doc, studioMode) {
27
+ const spec = doc.documentModel.global;
28
+ return {
29
+ documentType: spec.id,
30
+ name: spec.name,
31
+ version: studioMode ? doc.version : void 0,
32
+ description: spec.description
33
+ };
34
+ }
35
+ function CreateDocument() {
36
+ const [showModal, setShowModal] = useState(false);
37
+ const setSelectedNode = useSetSelectedNode();
38
+ const { isAllowedToCreateDocuments } = useUserPermissions();
39
+ const allowedDocumentModelModules = useAllowedDocumentModelModules();
40
+ const editorModules = useEditorModules();
41
+ const disabledEditors = useDisabledEditors() ?? [];
42
+ const [selectedDrive] = useSelectedDriveSafe();
43
+ const selectedFolder = useSelectedFolder();
44
+ const parentFolder = useParentFolderForSelectedNode();
45
+ const DRIVE_CONTAINER_TYPES = ["powerhouse/document-drive", "powerhouse/reactor-drive"];
46
+ const studioMode = useStudioMode() ?? false;
47
+ const visibleDocumentModelModules = selectCreatableModules(allowedDocumentModelModules ?? [], studioMode).filter((module) => {
48
+ const id = module.documentModel.global.id;
49
+ return !DRIVE_CONTAINER_TYPES.includes(id) && !disabledEditors.includes(id);
50
+ });
51
+ const preloadEditorsForType = (documentType) => editorModules?.filter((editorModule) => editorModule.documentTypes.includes(documentType)).forEach((editorModule) => {
52
+ preloadEditorModule(editorModule);
53
+ });
54
+ const handleCreate = async ({ name, documentType, version }) => {
55
+ setShowModal(false);
56
+ if (!selectedDrive) return;
57
+ try {
58
+ const node = await addDocument(selectedDrive.header.id, name, documentType, selectedFolder?.id ?? parentFolder?.id, void 0, void 0, void 0, version);
59
+ setSelectedNode(node);
60
+ } catch (error) {
61
+ console.error("Failed to create document:", error);
62
+ }
63
+ };
64
+ if (!isAllowedToCreateDocuments) return null;
65
+ if (!visibleDocumentModelModules.length) return null;
66
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(PowerhouseButton, {
67
+ className: "py-2",
68
+ color: "blue",
69
+ icon: /* @__PURE__ */ jsx(Icon, {
70
+ name: "Plus",
71
+ size: 14
72
+ }),
73
+ onClick: () => setShowModal(true),
74
+ size: "small",
75
+ children: "Create New Document"
76
+ }), /* @__PURE__ */ jsx(CreateDocumentWithTypeModal, {
77
+ documentTypes: visibleDocumentModelModules.map((module) => toDocumentTypeOption(module, studioMode)),
78
+ onCreate: (input) => void handleCreate(input),
79
+ onOpenChange: setShowModal,
80
+ onTypeSelected: preloadEditorsForType,
81
+ open: showModal
82
+ })] });
83
+ }
84
+ //#endregion
85
+ //#region editors/generic-drive-explorer/components/file-content-view.tsx
86
+ const GAP = 8;
87
+ const ITEM_WIDTH = 256;
88
+ const ITEM_HEIGHT = 48;
89
+ const USED_SPACE = 420;
90
+ function FileContentView() {
91
+ const parentRef = useRef(null);
92
+ const availableWidth = useWindowSize().innerWidth - USED_SPACE;
93
+ const fileNodes = useNodesInSelectedDriveOrFolder().filter((n) => isFileNodeKind(n));
94
+ const columnCount = Math.floor(availableWidth / 264) || 1;
95
+ const rowCount = Math.ceil(fileNodes.length / columnCount);
96
+ const rowVirtualizer = useVirtualizer({
97
+ count: rowCount,
98
+ getScrollElement: () => parentRef.current,
99
+ estimateSize: (index) => {
100
+ if (index > 0) return 56;
101
+ return ITEM_HEIGHT;
102
+ },
103
+ overscan: 5
104
+ });
105
+ const columnVirtualizer = useVirtualizer({
106
+ horizontal: true,
107
+ count: columnCount,
108
+ getScrollElement: () => parentRef.current,
109
+ estimateSize: (index) => {
110
+ if (index > 0) return 264;
111
+ return ITEM_WIDTH;
112
+ },
113
+ overscan: 5
114
+ });
115
+ const getItemIndex = (rowIndex, columnIndex) => rowIndex * columnCount + columnIndex;
116
+ const getItem = (rowIndex, columnIndex) => {
117
+ const index = getItemIndex(rowIndex, columnIndex);
118
+ return fileNodes[index] || null;
119
+ };
120
+ if (fileNodes.length === 0) return /* @__PURE__ */ jsx("div", {
121
+ className: "mb-8 text-sm text-muted-foreground",
122
+ children: "No documents or files 📄"
123
+ });
124
+ const renderItem = (rowIndex, columnIndex) => {
125
+ const fileNode = getItem(rowIndex, columnIndex);
126
+ if (!fileNode) return null;
127
+ return /* @__PURE__ */ jsx("div", {
128
+ style: { marginLeft: columnIndex === 0 ? 0 : GAP },
129
+ children: /* @__PURE__ */ jsx(FileItem, { fileNode }, fileNode.id)
130
+ });
131
+ };
132
+ return /* @__PURE__ */ jsx("div", {
133
+ ref: parentRef,
134
+ style: {
135
+ width: `100%`,
136
+ overflow: "auto"
137
+ },
138
+ children: /* @__PURE__ */ jsx("div", {
139
+ style: {
140
+ height: `${rowVirtualizer.getTotalSize()}px`,
141
+ width: `${columnVirtualizer.getTotalSize()}px`,
142
+ position: "relative"
143
+ },
144
+ children: rowVirtualizer.getVirtualItems().map((virtualRow) => /* @__PURE__ */ jsx(React.Fragment, { children: columnVirtualizer.getVirtualItems().map((virtualColumn) => /* @__PURE__ */ jsx("div", {
145
+ style: {
146
+ position: "absolute",
147
+ top: 0,
148
+ left: 0,
149
+ marginTop: virtualRow.index === 0 ? 0 : GAP,
150
+ width: `${virtualColumn.size}px`,
151
+ height: `${ITEM_HEIGHT}px`,
152
+ overflow: "hidden",
153
+ transform: `translateX(${virtualColumn.start}px) translateY(${virtualRow.start}px)`
154
+ },
155
+ children: renderItem(virtualRow.index, virtualColumn.index)
156
+ }, virtualColumn.key)) }, virtualRow.key))
157
+ })
158
+ });
159
+ }
160
+ //#endregion
161
+ //#region editors/generic-drive-explorer/components/layout.tsx
162
+ function DriveLayout({ children, className, ...props }) {
163
+ return /* @__PURE__ */ jsx(DriveLayout.Container, {
164
+ className,
165
+ ...props,
166
+ children
167
+ });
168
+ }
169
+ DriveLayout.Container = function DriveLayoutContainer({ children, className, containerProps, ...props }) {
170
+ return /* @__PURE__ */ jsx("div", {
171
+ className: twMerge("flex grow flex-col overflow-auto", className),
172
+ ...containerProps,
173
+ ...props,
174
+ children
175
+ });
176
+ };
177
+ DriveLayout.Header = function DriveLayoutHeader({ children, className, containerProps, ...props }) {
178
+ return /* @__PURE__ */ jsx("div", {
179
+ className: twMerge("flex-0", className),
180
+ ...containerProps,
181
+ ...props,
182
+ children
183
+ });
184
+ };
185
+ DriveLayout.Content = function DriveLayoutContent({ children, className, containerProps, ...props }) {
186
+ return /* @__PURE__ */ jsx("div", {
187
+ className: twMerge("mb-5 flex-1 px-4", className),
188
+ ...containerProps,
189
+ ...props,
190
+ children
191
+ });
192
+ };
193
+ DriveLayout.ContentSection = function DriveLayoutContentSection({ title, actions, children, className, containerProps, ...props }) {
194
+ return /* @__PURE__ */ jsxs("div", {
195
+ className: twMerge(className),
196
+ ...containerProps,
197
+ ...props,
198
+ children: [(title || actions) && /* @__PURE__ */ jsxs("div", {
199
+ className: "mb-4 flex items-center justify-between gap-3",
200
+ children: [title && /* @__PURE__ */ jsx("div", {
201
+ className: "text-base font-semibold text-foreground",
202
+ children: title
203
+ }), actions]
204
+ }), /* @__PURE__ */ jsx("div", {
205
+ className: "flex flex-wrap gap-2",
206
+ children
207
+ })]
208
+ });
209
+ };
210
+ //#endregion
211
+ //#region editors/generic-drive-explorer/components/folder-view.tsx
212
+ function FolderView(props) {
213
+ const { className } = props;
214
+ const folderNodes = useNodesInSelectedDriveOrFolder().filter((n) => isFolderNodeKind(n));
215
+ return /* @__PURE__ */ jsxs("div", {
216
+ className: twMerge("rounded-md border-2 border-transparent p-2", className),
217
+ children: [/* @__PURE__ */ jsx(DriveLayout.ContentSection, {
218
+ title: "Folders",
219
+ className: "mb-4",
220
+ children: folderNodes.length > 0 ? folderNodes.map((folderNode) => /* @__PURE__ */ jsx(FolderItem, { folderNode }, folderNode.id)) : /* @__PURE__ */ jsx("div", {
221
+ className: "mb-8 text-sm text-muted-foreground",
222
+ children: "No documents or files 📄"
223
+ })
224
+ }), /* @__PURE__ */ jsx(DriveLayout.ContentSection, {
225
+ title: "Documents and files",
226
+ actions: /* @__PURE__ */ jsx(CreateDocument, {}),
227
+ children: /* @__PURE__ */ jsx("div", {
228
+ className: "w-full",
229
+ children: /* @__PURE__ */ jsx(FileContentView, {})
230
+ })
231
+ })]
232
+ });
233
+ }
234
+ //#endregion
235
+ export { CreateDocument as i, DriveLayout as n, FileContentView as r, FolderView as t };
236
+
237
+ //# sourceMappingURL=folder-view-CwIU4XEe.js.map