@powerhousedao/powerhouse-vetra-packages 6.2.3 → 6.3.0-dev.1

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 (95) hide show
  1. package/dist/browser/document-models/index.js +1 -1
  2. package/dist/browser/documents-cxt8RRxe.js +18 -0
  3. package/dist/browser/documents-cxt8RRxe.js.map +1 -0
  4. package/dist/browser/editor-DXAJ8Mqb.js +2293 -0
  5. package/dist/browser/editor-DXAJ8Mqb.js.map +1 -0
  6. package/dist/browser/{editor-CiR6XQBO.js → editor-Dmpkd8pQ.js} +3 -3
  7. package/dist/browser/{editor-CiR6XQBO.js.map → editor-Dmpkd8pQ.js.map} +1 -1
  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 -340
  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-CGxwONKl.js +103 -0
  16. package/dist/browser/graphql-editor-CGxwONKl.js.map +1 -0
  17. package/dist/browser/hooks-D15NCia0.js +126 -0
  18. package/dist/browser/hooks-D15NCia0.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--jgLEwP2.js +55 -0
  22. package/dist/browser/json-editor--jgLEwP2.js.map +1 -0
  23. package/dist/browser/schema-context-CC_WFs1x.js +73 -0
  24. package/dist/browser/schema-context-CC_WFs1x.js.map +1 -0
  25. package/dist/browser/state-schemas-DSY44MOd.js +307 -0
  26. package/dist/browser/state-schemas-DSY44MOd.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-DH2fyf7U.mjs} +32 -3
  30. package/dist/node/documents-DH2fyf7U.mjs.map +1 -0
  31. package/dist/node/{editor-96sMeumV.mjs → editor-BcvUeBW7.mjs} +2902 -2738
  32. package/dist/node/editor-BcvUeBW7.mjs.map +1 -0
  33. package/dist/node/editor-DJCghViS.mjs +983 -0
  34. package/dist/node/editor-DJCghViS.mjs.map +1 -0
  35. package/dist/node/editors/index.mjs +23 -2
  36. package/dist/node/editors/index.mjs.map +1 -0
  37. package/dist/node/{graphql-editor-CBJXEY_C.mjs → graphql-editor-u9NStKLL.mjs} +5078 -26
  38. package/dist/node/graphql-editor-u9NStKLL.mjs.map +1 -0
  39. package/dist/{browser/hooks-eQxBX7g4.js → node/hooks-BiLz75cj.mjs} +2 -2
  40. package/dist/node/{hooks-C2b46djt.mjs.map → hooks-BiLz75cj.mjs.map} +1 -1
  41. package/dist/node/index.mjs +12 -189
  42. package/dist/node/index.mjs.map +1 -1
  43. package/dist/{browser/json-editor-DfRD-pfk.js → node/json-editor-BfcrckeT.mjs} +3 -3
  44. package/dist/node/{json-editor-DaqHARBD.mjs.map → json-editor-BfcrckeT.mjs.map} +1 -1
  45. package/dist/node/{schema-context-CojjnSE6.mjs → schema-context-r0MTQnRC.mjs} +6 -4
  46. package/dist/node/schema-context-r0MTQnRC.mjs.map +1 -0
  47. package/dist/node/{state-schemas-BHuo0GPl.mjs → state-schemas-o3PZdBW2.mjs} +427 -54
  48. package/dist/node/state-schemas-o3PZdBW2.mjs.map +1 -0
  49. package/package.json +21 -19
  50. package/style.css +2 -0
  51. package/dist/browser/assets/entry-D62sYiFV.js +0 -318
  52. package/dist/browser/assets/projection-entry-BGcu_9-p.js +0 -446
  53. package/dist/browser/documents-CRzouuNR.js +0 -6067
  54. package/dist/browser/documents-CRzouuNR.js.map +0 -1
  55. package/dist/browser/editor-C7KBR_ar.js +0 -4676
  56. package/dist/browser/editor-C7KBR_ar.js.map +0 -1
  57. package/dist/browser/folder-view-DSgXN79D.js +0 -4409
  58. package/dist/browser/folder-view-DSgXN79D.js.map +0 -1
  59. package/dist/browser/graphql-editor-Cgi5UOrF.js +0 -11708
  60. package/dist/browser/graphql-editor-Cgi5UOrF.js.map +0 -1
  61. package/dist/browser/hooks-eQxBX7g4.js.map +0 -1
  62. package/dist/browser/json-editor-DfRD-pfk.js.map +0 -1
  63. package/dist/browser/parser-DtbeHA3H.js +0 -2554
  64. package/dist/browser/parser-DtbeHA3H.js.map +0 -1
  65. package/dist/browser/rolldown-runtime-DC62tzP2.js +0 -33
  66. package/dist/browser/src-CrUksCLW-B2dkRdgq.js +0 -5254
  67. package/dist/browser/src-CrUksCLW-B2dkRdgq.js.map +0 -1
  68. package/dist/browser/state-schemas-B5Bk_l1s.js +0 -696
  69. package/dist/browser/state-schemas-B5Bk_l1s.js.map +0 -1
  70. package/dist/browser/tslib.es6-Cno80yFJ.js +0 -32
  71. package/dist/browser/tslib.es6-Cno80yFJ.js.map +0 -1
  72. package/dist/node/documents-D70S9PZL.mjs +0 -17
  73. package/dist/node/documents-D70S9PZL.mjs.map +0 -1
  74. package/dist/node/editor-96sMeumV.mjs.map +0 -1
  75. package/dist/node/editor-wqvKwcO5.mjs +0 -24
  76. package/dist/node/editor-wqvKwcO5.mjs.map +0 -1
  77. package/dist/node/editors/document-model-editor/index.mjs +0 -1
  78. package/dist/node/editors/document-model-editor/module.mjs +0 -14
  79. package/dist/node/editors/document-model-editor/module.mjs.map +0 -1
  80. package/dist/node/editors/generic-drive-explorer/index.mjs +0 -461
  81. package/dist/node/editors/generic-drive-explorer/index.mjs.map +0 -1
  82. package/dist/node/editors/generic-drive-explorer/module.mjs +0 -14
  83. package/dist/node/editors/generic-drive-explorer/module.mjs.map +0 -1
  84. package/dist/node/folder-view-ktfv2Cvw.mjs +0 -4409
  85. package/dist/node/folder-view-ktfv2Cvw.mjs.map +0 -1
  86. package/dist/node/graphql-Dp4j7rmx.mjs.map +0 -1
  87. package/dist/node/graphql-editor-CBJXEY_C.mjs.map +0 -1
  88. package/dist/node/hooks-C2b46djt.mjs +0 -24593
  89. package/dist/node/json-editor-DaqHARBD.mjs +0 -153
  90. package/dist/node/schema-context-CojjnSE6.mjs.map +0 -1
  91. package/dist/node/src-CrUksCLW-TvF37aMo.mjs +0 -5935
  92. package/dist/node/src-CrUksCLW-TvF37aMo.mjs.map +0 -1
  93. package/dist/node/state-schemas-BHuo0GPl.mjs.map +0 -1
  94. package/dist/node/tslib.es6-VORZjfk3.mjs +0 -583
  95. package/dist/node/tslib.es6-VORZjfk3.mjs.map +0 -1
@@ -1,345 +1,9 @@
1
- import { t as __commonJSMin } from "../../rolldown-runtime-DC62tzP2.js";
2
1
  import { GenericDriveExplorer } from "./module.js";
3
- import { a as Icon, i as CreateDocument, n as DriveLayout, r as FileContentView, t as FolderView } from "../../folder-view-DSgXN79D.js";
4
- import * as m from "react";
5
- 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";
6
5
  import { jsx } from "react/jsx-runtime";
7
- import { ConnectSearchBar } from "@powerhousedao/design-system/connect";
8
- //#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
9
- const warn = (i18n, code, msg, rest) => {
10
- const args = [msg, {
11
- code,
12
- ...rest || {}
13
- }];
14
- if (i18n?.services?.logger?.forward) return i18n.services.logger.forward(args, "warn", "react-i18next::", true);
15
- if (isString(args[0])) args[0] = `react-i18next:: ${args[0]}`;
16
- if (i18n?.services?.logger?.warn) i18n.services.logger.warn(...args);
17
- else if (console?.warn) console.warn(...args);
18
- };
19
- const alreadyWarned = {};
20
- const warnOnce = (i18n, code, msg, rest) => {
21
- if (isString(msg) && alreadyWarned[msg]) return;
22
- if (isString(msg)) alreadyWarned[msg] = /* @__PURE__ */ new Date();
23
- warn(i18n, code, msg, rest);
24
- };
25
- const loadedClb = (i18n, cb) => () => {
26
- if (i18n.isInitialized) cb();
27
- else {
28
- const initialized = () => {
29
- setTimeout(() => {
30
- i18n.off("initialized", initialized);
31
- }, 0);
32
- cb();
33
- };
34
- i18n.on("initialized", initialized);
35
- }
36
- };
37
- const loadNamespaces = (i18n, ns, cb) => {
38
- i18n.loadNamespaces(ns, loadedClb(i18n, cb));
39
- };
40
- const loadLanguages = (i18n, lng, ns, cb) => {
41
- if (isString(ns)) ns = [ns];
42
- if (i18n.options.preload && i18n.options.preload.indexOf(lng) > -1) return loadNamespaces(i18n, ns, cb);
43
- ns.forEach((n) => {
44
- if (i18n.options.ns.indexOf(n) < 0) i18n.options.ns.push(n);
45
- });
46
- i18n.loadLanguages(lng, loadedClb(i18n, cb));
47
- };
48
- const hasLoadedNamespace = (ns, i18n, options = {}) => {
49
- if (!i18n.languages || !i18n.languages.length) {
50
- warnOnce(i18n, "NO_LANGUAGES", "i18n.languages were undefined or empty", { languages: i18n.languages });
51
- return true;
52
- }
53
- return i18n.hasLoadedNamespace(ns, {
54
- lng: options.lng,
55
- precheck: (i18nInstance, loadNotPending) => {
56
- if (options.bindI18n && options.bindI18n.indexOf("languageChanging") > -1 && i18nInstance.services.backendConnector.backend && i18nInstance.isLanguageChangingTo && !loadNotPending(i18nInstance.isLanguageChangingTo, ns)) return false;
57
- }
58
- });
59
- };
60
- const isString = (obj) => typeof obj === "string";
61
- const isObject = (obj) => typeof obj === "object" && obj !== null;
62
- //#endregion
63
- //#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
64
- const matchHtmlEntity = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g;
65
- const htmlEntities = {
66
- "&amp;": "&",
67
- "&#38;": "&",
68
- "&lt;": "<",
69
- "&#60;": "<",
70
- "&gt;": ">",
71
- "&#62;": ">",
72
- "&apos;": "'",
73
- "&#39;": "'",
74
- "&quot;": "\"",
75
- "&#34;": "\"",
76
- "&nbsp;": " ",
77
- "&#160;": " ",
78
- "&copy;": "©",
79
- "&#169;": "©",
80
- "&reg;": "®",
81
- "&#174;": "®",
82
- "&hellip;": "…",
83
- "&#8230;": "…",
84
- "&#x2F;": "/",
85
- "&#47;": "/"
86
- };
87
- const unescapeHtmlEntity = (m) => htmlEntities[m];
88
- const unescape = (text) => text.replace(matchHtmlEntity, unescapeHtmlEntity);
89
- //#endregion
90
- //#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
91
- let defaultOptions = {
92
- bindI18n: "languageChanged",
93
- bindI18nStore: "",
94
- transEmptyNodeValue: "",
95
- transSupportBasicHtmlNodes: true,
96
- transWrapTextNodes: "",
97
- transKeepBasicHtmlNodesFor: [
98
- "br",
99
- "strong",
100
- "i",
101
- "p"
102
- ],
103
- useSuspense: true,
104
- unescape,
105
- transDefaultProps: void 0
106
- };
107
- const getDefaults = () => defaultOptions;
108
- //#endregion
109
- //#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
110
- let i18nInstance;
111
- const getI18n = () => i18nInstance;
112
- //#endregion
113
- //#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
114
- const I18nContext = createContext();
115
- var ReportNamespaces = class {
116
- constructor() {
117
- this.usedNamespaces = {};
118
- }
119
- addUsedNamespaces(namespaces) {
120
- namespaces.forEach((ns) => {
121
- if (!this.usedNamespaces[ns]) this.usedNamespaces[ns] = true;
122
- });
123
- }
124
- getUsedNamespaces() {
125
- return Object.keys(this.usedNamespaces);
126
- }
127
- };
128
- //#endregion
129
- //#region builtin:esm-external-require-react
130
- var require_builtin_esm_external_require_react = /* @__PURE__ */ __commonJSMin(((exports, module) => {
131
- module.exports = { ...m };
132
- }));
133
- //#endregion
134
- //#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
135
- /**
136
- * @license React
137
- * use-sync-external-store-shim.development.js
138
- *
139
- * Copyright (c) Meta Platforms, Inc. and affiliates.
140
- *
141
- * This source code is licensed under the MIT license found in the
142
- * LICENSE file in the root directory of this source tree.
143
- */
144
- var require_use_sync_external_store_shim_development = /* @__PURE__ */ __commonJSMin(((exports) => {
145
- (function() {
146
- function is(x, y) {
147
- return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
148
- }
149
- function useSyncExternalStore$2(subscribe, getSnapshot) {
150
- 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."));
151
- var value = getSnapshot();
152
- if (!didWarnUncachedGetSnapshot) {
153
- var cachedValue = getSnapshot();
154
- objectIs(value, cachedValue) || (console.error("The result of getSnapshot should be cached to avoid an infinite loop"), didWarnUncachedGetSnapshot = !0);
155
- }
156
- cachedValue = useState({ inst: {
157
- value,
158
- getSnapshot
159
- } });
160
- var inst = cachedValue[0].inst, forceUpdate = cachedValue[1];
161
- useLayoutEffect(function() {
162
- inst.value = value;
163
- inst.getSnapshot = getSnapshot;
164
- checkIfSnapshotChanged(inst) && forceUpdate({ inst });
165
- }, [
166
- subscribe,
167
- value,
168
- getSnapshot
169
- ]);
170
- useEffect(function() {
171
- checkIfSnapshotChanged(inst) && forceUpdate({ inst });
172
- return subscribe(function() {
173
- checkIfSnapshotChanged(inst) && forceUpdate({ inst });
174
- });
175
- }, [subscribe]);
176
- useDebugValue(value);
177
- return value;
178
- }
179
- function checkIfSnapshotChanged(inst) {
180
- var latestGetSnapshot = inst.getSnapshot;
181
- inst = inst.value;
182
- try {
183
- var nextValue = latestGetSnapshot();
184
- return !objectIs(inst, nextValue);
185
- } catch (error) {
186
- return !0;
187
- }
188
- }
189
- function useSyncExternalStore$1(subscribe, getSnapshot) {
190
- return getSnapshot();
191
- }
192
- "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
193
- 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;
194
- exports.useSyncExternalStore = void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;
195
- "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
196
- })();
197
- }));
198
- //#endregion
199
- //#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
200
- var import_shim = (/* @__PURE__ */ __commonJSMin(((exports, module) => {
201
- module.exports = require_use_sync_external_store_shim_development();
202
- })))();
203
- const notReadyT = (k, optsOrDefaultValue) => {
204
- if (isString(optsOrDefaultValue)) return optsOrDefaultValue;
205
- if (isObject(optsOrDefaultValue) && isString(optsOrDefaultValue.defaultValue)) return optsOrDefaultValue.defaultValue;
206
- return Array.isArray(k) ? k[k.length - 1] : k;
207
- };
208
- const notReadySnapshot = {
209
- t: notReadyT,
210
- ready: false
211
- };
212
- const dummySubscribe = () => () => {};
213
- const useTranslation = (ns, props = {}) => {
214
- const { i18n: i18nFromProps } = props;
215
- const { i18n: i18nFromContext, defaultNS: defaultNSFromContext } = useContext(I18nContext) || {};
216
- const i18n = i18nFromProps || i18nFromContext || getI18n();
217
- if (i18n && !i18n.reportNamespaces) i18n.reportNamespaces = new ReportNamespaces();
218
- if (!i18n) warnOnce(i18n, "NO_I18NEXT_INSTANCE", "useTranslation: You will need to pass in an i18next instance by using initReactI18next");
219
- const i18nOptions = useMemo(() => ({
220
- ...getDefaults(),
221
- ...i18n?.options?.react,
222
- ...props
223
- }), [i18n, props]);
224
- const { useSuspense, keyPrefix } = i18nOptions;
225
- const nsOrContext = ns || defaultNSFromContext || i18n?.options?.defaultNS;
226
- const unstableNamespaces = isString(nsOrContext) ? [nsOrContext] : nsOrContext || ["translation"];
227
- const namespaces = useMemo(() => unstableNamespaces, unstableNamespaces);
228
- i18n?.reportNamespaces?.addUsedNamespaces?.(namespaces);
229
- const revisionRef = useRef(0);
230
- const subscribe = useCallback((callback) => {
231
- if (!i18n) return dummySubscribe;
232
- const { bindI18n, bindI18nStore } = i18nOptions;
233
- const wrappedCallback = () => {
234
- revisionRef.current += 1;
235
- callback();
236
- };
237
- if (bindI18n) i18n.on(bindI18n, wrappedCallback);
238
- if (bindI18nStore) i18n.store.on(bindI18nStore, wrappedCallback);
239
- return () => {
240
- if (bindI18n) bindI18n.split(" ").forEach((e) => i18n.off(e, wrappedCallback));
241
- if (bindI18nStore) bindI18nStore.split(" ").forEach((e) => i18n.store.off(e, wrappedCallback));
242
- };
243
- }, [i18n, i18nOptions]);
244
- const snapshotRef = useRef();
245
- const getSnapshot = useCallback(() => {
246
- if (!i18n) return notReadySnapshot;
247
- const calculatedReady = !!(i18n.isInitialized || i18n.initializedStoreOnce) && namespaces.every((n) => hasLoadedNamespace(n, i18n, i18nOptions));
248
- const currentLng = props.lng || i18n.language;
249
- const currentRevision = revisionRef.current;
250
- const lastSnapshot = snapshotRef.current;
251
- if (lastSnapshot && lastSnapshot.ready === calculatedReady && lastSnapshot.lng === currentLng && lastSnapshot.keyPrefix === keyPrefix && lastSnapshot.revision === currentRevision) return lastSnapshot;
252
- const newSnapshot = {
253
- t: i18n.getFixedT(currentLng, i18nOptions.nsMode === "fallback" ? namespaces : namespaces[0], keyPrefix),
254
- ready: calculatedReady,
255
- lng: currentLng,
256
- keyPrefix,
257
- revision: currentRevision
258
- };
259
- snapshotRef.current = newSnapshot;
260
- return newSnapshot;
261
- }, [
262
- i18n,
263
- namespaces,
264
- keyPrefix,
265
- i18nOptions,
266
- props.lng
267
- ]);
268
- const [loadCount, setLoadCount] = useState(0);
269
- const { t, ready } = (0, import_shim.useSyncExternalStore)(subscribe, getSnapshot, getSnapshot);
270
- useEffect(() => {
271
- if (i18n && !ready && !useSuspense) {
272
- const onLoaded = () => setLoadCount((c) => c + 1);
273
- if (props.lng) loadLanguages(i18n, props.lng, namespaces, onLoaded);
274
- else loadNamespaces(i18n, namespaces, onLoaded);
275
- }
276
- }, [
277
- i18n,
278
- props.lng,
279
- namespaces,
280
- ready,
281
- useSuspense,
282
- loadCount
283
- ]);
284
- const finalI18n = i18n || {};
285
- const wrapperRef = useRef(null);
286
- const wrapperLangRef = useRef();
287
- const createI18nWrapper = (original) => {
288
- const descriptors = Object.getOwnPropertyDescriptors(original);
289
- if (descriptors.__original) delete descriptors.__original;
290
- const wrapper = Object.create(Object.getPrototypeOf(original), descriptors);
291
- if (!Object.prototype.hasOwnProperty.call(wrapper, "__original")) try {
292
- Object.defineProperty(wrapper, "__original", {
293
- value: original,
294
- writable: false,
295
- enumerable: false,
296
- configurable: false
297
- });
298
- } catch (_) {}
299
- return wrapper;
300
- };
301
- const ret = useMemo(() => {
302
- const original = finalI18n;
303
- const lang = original?.language;
304
- let i18nWrapper = original;
305
- if (original) {
306
- if (wrapperRef.current && wrapperRef.current.__original === original) {
307
- if (wrapperLangRef.current !== lang) {
308
- i18nWrapper = createI18nWrapper(original);
309
- wrapperRef.current = i18nWrapper;
310
- wrapperLangRef.current = lang;
311
- } else i18nWrapper = wrapperRef.current;
312
- } else {
313
- i18nWrapper = createI18nWrapper(original);
314
- wrapperRef.current = i18nWrapper;
315
- wrapperLangRef.current = lang;
316
- }
317
- }
318
- const arr = [
319
- t,
320
- i18nWrapper,
321
- ready
322
- ];
323
- arr.t = t;
324
- arr.i18n = i18nWrapper;
325
- arr.ready = ready;
326
- return arr;
327
- }, [
328
- t,
329
- finalI18n,
330
- ready,
331
- finalI18n.resolvedLanguage,
332
- finalI18n.language,
333
- finalI18n.languages
334
- ]);
335
- if (i18n && useSuspense && !ready) throw new Promise((resolve) => {
336
- const onLoaded = () => resolve();
337
- if (props.lng) loadLanguages(i18n, props.lng, namespaces, onLoaded);
338
- else loadNamespaces(i18n, namespaces, onLoaded);
339
- });
340
- return ret;
341
- };
342
- //#endregion
6
+ import { useTranslation } from "react-i18next";
343
7
  //#region editors/generic-drive-explorer/components/search-bar.tsx
344
8
  const defaultFilterItems = [
345
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;CACD,IAAI,MAAM,UAAU,QAAQ,SAC1B,OAAO,KAAK,SAAS,OAAO,QAAQ,MAAM,QAAQ,mBAAmB,IAAI;CAE3E,IAAI,SAAS,KAAK,EAAE,GAAG,KAAK,KAAK,mBAAmB,KAAK;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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-CiR6XQBO.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