@powerhousedao/connect 4.1.0-dev.14 → 4.1.0-dev.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AddDriveModal.BS70zcOt.js → AddDriveModal.B5tyt8LU.js} +2 -2
- package/dist/assets/{AddDriveModal.BS70zcOt.js.map → AddDriveModal.B5tyt8LU.js.map} +1 -1
- package/dist/assets/{AddRemoteDriveModal.B4vRLfuY.js → AddRemoteDriveModal.CNg1GzwL.js} +2 -2
- package/dist/assets/{AddRemoteDriveModal.B4vRLfuY.js.map → AddRemoteDriveModal.CNg1GzwL.js.map} +1 -1
- package/dist/assets/{CookiesPolicyModal.BB5tPLL1.js → CookiesPolicyModal.C5DWX70T.js} +2 -2
- package/dist/assets/{CookiesPolicyModal.BB5tPLL1.js.map → CookiesPolicyModal.C5DWX70T.js.map} +1 -1
- package/dist/assets/{CreateDocumentModal.CH46uens.js → CreateDocumentModal.CbdEnRrU.js} +2 -2
- package/dist/assets/{CreateDocumentModal.CH46uens.js.map → CreateDocumentModal.CbdEnRrU.js.map} +1 -1
- package/dist/assets/{DebugSettingsModal.DrwrnsQg.js → DebugSettingsModal.CFg5VoJ6.js} +2 -2
- package/dist/assets/{DebugSettingsModal.DrwrnsQg.js.map → DebugSettingsModal.CFg5VoJ6.js.map} +1 -1
- package/dist/assets/{DeleteDriveModal.Ci2Tk1nU.js → DeleteDriveModal.B5yUJP5q.js} +2 -2
- package/dist/assets/{DeleteDriveModal.Ci2Tk1nU.js.map → DeleteDriveModal.B5yUJP5q.js.map} +1 -1
- package/dist/assets/{DeleteItemModal.DSTkzCfP.js → DeleteItemModal.D8opbQsy.js} +2 -2
- package/dist/assets/{DeleteItemModal.DSTkzCfP.js.map → DeleteItemModal.D8opbQsy.js.map} +1 -1
- package/dist/assets/{DisclaimerModal.C15wk_lm.js → DisclaimerModal.BpvymWth.js} +2 -2
- package/dist/assets/{DisclaimerModal.C15wk_lm.js.map → DisclaimerModal.BpvymWth.js.map} +1 -1
- package/dist/assets/{DriveSettingsModal.C-G7CykG.js → DriveSettingsModal.1OIJQ5Ic.js} +2 -2
- package/dist/assets/{DriveSettingsModal.C-G7CykG.js.map → DriveSettingsModal.1OIJQ5Ic.js.map} +1 -1
- package/dist/assets/{SettingsModal.wa7YqU2k.js → SettingsModal.DlTpTFpB.js} +2 -2
- package/dist/assets/{SettingsModal.wa7YqU2k.js.map → SettingsModal.DlTpTFpB.js.map} +1 -1
- package/dist/assets/{Trans.fzROOCo7.js → Trans.z2fDSlpD.js} +2 -2
- package/dist/assets/{Trans.fzROOCo7.js.map → Trans.z2fDSlpD.js.map} +1 -1
- package/dist/assets/{UpgradeDriveModal.CZjzdZUT.js → UpgradeDriveModal.P8VsMLo6.js} +2 -2
- package/dist/assets/{UpgradeDriveModal.CZjzdZUT.js.map → UpgradeDriveModal.P8VsMLo6.js.map} +1 -1
- package/dist/assets/{atlas-import.KoebOAIH.js → atlas-import.DF_6EcA0.js} +2 -2
- package/dist/assets/{atlas-import.KoebOAIH.js.map → atlas-import.DF_6EcA0.js.map} +1 -1
- package/dist/assets/{content.DOqiMQud.js → content.CQTByPIP.js} +3 -3
- package/dist/assets/{content.DOqiMQud.js.map → content.CQTByPIP.js.map} +1 -1
- package/dist/assets/{cookie-banner.BnV4V9SC.js → cookie-banner.pQpNvegX.js} +2 -2
- package/dist/assets/{cookie-banner.BnV4V9SC.js.map → cookie-banner.pQpNvegX.js.map} +1 -1
- package/dist/assets/{index.CFBhtw7k.js → index.-h1Ier73.js} +2 -2
- package/dist/assets/{index.CFBhtw7k.js.map → index.-h1Ier73.js.map} +1 -1
- package/dist/assets/{index.CYihR6D1.js → index.11hBdWUl.js} +5 -5
- package/dist/assets/{index.CYihR6D1.js.map → index.11hBdWUl.js.map} +1 -1
- package/dist/assets/{index.Cxw5H4RY.js → index.CMHigXQ2.js} +2 -2
- package/dist/assets/{index.Cxw5H4RY.js.map → index.CMHigXQ2.js.map} +1 -1
- package/dist/assets/{index.BrAiYFNe.js → index.D1CGlf4e.js} +2 -2
- package/dist/assets/{index.BrAiYFNe.js.map → index.D1CGlf4e.js.map} +1 -1
- package/dist/assets/{index.Ddrhov_Q.js → index.D78Ar8AW.js} +2 -2
- package/dist/assets/{index.Ddrhov_Q.js.map → index.D78Ar8AW.js.map} +1 -1
- package/dist/assets/{index.DD46OEj6.js → index.DWB2CbzG.js} +2 -2
- package/dist/assets/{index.DD46OEj6.js.map → index.DWB2CbzG.js.map} +1 -1
- package/dist/assets/{index.CGEMCdxE.js → index.Pz2zlae7.js} +2 -2
- package/dist/assets/{index.CGEMCdxE.js.map → index.Pz2zlae7.js.map} +1 -1
- package/dist/assets/{index.D0rNrBNg.js → index.mLp5EUlc.js} +2 -2
- package/dist/assets/{index.D0rNrBNg.js.map → index.mLp5EUlc.js.map} +1 -1
- package/dist/assets/{main.D9ohwghr.js → main.DObR8lKM.js} +3 -3
- package/dist/assets/{main.D9ohwghr.js.map → main.DObR8lKM.js.map} +1 -1
- package/dist/assets/{modal.B5QcwU3z.js → modal.lkIjFYMB.js} +3 -3
- package/dist/assets/{modal.B5QcwU3z.js.map → modal.lkIjFYMB.js.map} +1 -1
- package/dist/assets/{modals.CNMxXHX5.js → modals.CdoO5Ilx.js} +2 -2
- package/dist/assets/{modals.CNMxXHX5.js.map → modals.CdoO5Ilx.js.map} +1 -1
- package/dist/assets/{nodefs.D8koVME7.js → nodefs.BBX7N1xn.js} +2 -2
- package/dist/assets/{nodefs.D8koVME7.js.map → nodefs.BBX7N1xn.js.map} +1 -1
- package/dist/assets/{nodes.CzVpU5ay.js → nodes.DDzNCaVx.js} +2 -2
- package/dist/assets/{nodes.CzVpU5ay.js.map → nodes.DDzNCaVx.js.map} +1 -1
- package/dist/assets/{opfs-ahp.DtxBzzyG.js → opfs-ahp.DSrQmqAr.js} +2 -2
- package/dist/assets/{opfs-ahp.DtxBzzyG.js.map → opfs-ahp.DSrQmqAr.js.map} +1 -1
- package/dist/assets/{registerServiceWorker.DKuDmwXm.js → registerServiceWorker.D80hHzJO.js} +2 -2
- package/dist/assets/{registerServiceWorker.DKuDmwXm.js.map → registerServiceWorker.D80hHzJO.js.map} +1 -1
- package/dist/assets/{root.clzrzcwe.js → root.CheA4ARx.js} +2 -2
- package/dist/assets/{root.clzrzcwe.js.map → root.CheA4ARx.js.map} +1 -1
- package/dist/assets/{useAcceptedCookies.gs7EPZvN.js → useAcceptedCookies.4eUWnx8d.js} +2 -2
- package/dist/assets/{useAcceptedCookies.gs7EPZvN.js.map → useAcceptedCookies.4eUWnx8d.js.map} +1 -1
- package/dist/assets/useDefaultDocumentModelEditor.DLHjZc5c.js +2 -0
- package/dist/assets/{useDefaultDocumentModelEditor.C3yx0NsG.js.map → useDefaultDocumentModelEditor.DLHjZc5c.js.map} +1 -1
- package/dist/assets/{useInitSentry.BjNhCx3t.js → useInitSentry.B7Z97TE_.js} +6 -6
- package/dist/assets/{useInitSentry.BjNhCx3t.js.map → useInitSentry.B7Z97TE_.js.map} +1 -1
- package/dist/index.html +1 -1
- package/dist/vite-envs.sh +1 -1
- package/package.json +11 -11
- package/dist/assets/useDefaultDocumentModelEditor.C3yx0NsG.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var v=Object.defineProperty;var _=(r,e,t)=>e in r?v(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var S=(r,e,t)=>_(r,typeof e!="symbol"?e+"":e,t);import{c as O}from"./index.
|
|
2
|
-
//# sourceMappingURL=index.
|
|
1
|
+
var v=Object.defineProperty;var _=(r,e,t)=>e in r?v(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var S=(r,e,t)=>_(r,typeof e!="symbol"?e+"":e,t);import{c as O}from"./index.11hBdWUl.js";import{A as n,D as I}from"./useInitSentry.B7Z97TE_.js";import"react-dom/client";import"./index.CW6hXWch.js";import"react";import"react/jsx-runtime";import"react-dom";import"./browser.BkwNmV2Z.js";import"./app-skeleton.js";import"./useAcceptedCookies.4eUWnx8d.js";import"./registerServiceWorker.D80hHzJO.js";class w{constructor(e,t=O(["processor","document-analytics"])){S(this,"analyticsStore");S(this,"logger");this.analyticsStore=e,this.logger=t}async onStrands(e){if(e.length!==0)for(const t of e){if(t.operations.length===0)continue;const D=t.operations[0],u=n.fromString(`ph/doc/${t.driveId}/${t.documentId}/${t.branch}/${t.scope}`);D.index===0&&await this.clearSource(u);const{driveId:s,documentId:f,branch:E,scope:a}=t,p=s===f?"DRIVE":"NODE",l=50;for(let o=0;o<t.operations.length;o+=l){const i=t.operations.slice(o,o+l),c=[];for(const d of i){const g=d.index,h={source:u,metric:"DocumentOperations",start:I.fromISO(d.timestamp),value:1,dimensions:{drive:n.fromString(`ph/doc/drive/${s}/${E}/${a}/${g}`),operation:n.fromString(`ph/doc/operation/${d.type}/${d.index}`),target:n.fromString(`ph/doc/target/${s}/${p}/${f}`)}};for(c.push(h);c.length>=l;){const y=c.splice(0,l);await this.analyticsStore.addSeriesValues(y)}}c.length>0&&await this.analyticsStore.addSeriesValues(c)}}}async onDisconnect(){}async clearSource(e){try{await this.analyticsStore.clearSeriesBySource(e,!0)}catch(t){this.logger.error("Failed to clear source",t)}}}const $=["ADD_FILE","ADD_FOLDER"],T=["COPY_NODE"],C=["UPDATE_FILE","UPDATE_NODE"],A=["MOVE_NODE"],N=["DELETE_NODE"],V=[...$,...T,...C,...A,...N];class b{constructor(e,t=O(["processor","drive-analytics"])){S(this,"analyticsStore");S(this,"logger");this.analyticsStore=e,this.logger=t}async onStrands(e){if(e.length!==0)for(const t of e){if(t.operations.length===0)continue;const D=t.operations[0],u=n.fromString(`ph/drive/${t.documentId}/${t.branch}/${t.scope}`);D.index===0&&await this.clearSource(u);const{documentId:s,branch:f,scope:E}=t,a=50;for(let p=0;p<t.operations.length;p+=a){const l=t.operations.slice(p,p+a),o=[];for(const i of l){const c=i.index,d=this.getActionType(i.type),g=V.includes(i.type)?"NODE":"DRIVE";let h=s;if(g==="NODE"){const m=i.input;h=m.id||m.targetId||m.srcFolder||s}const y={source:u,metric:"DriveOperations",start:I.fromISO(i.timestamp),value:1,dimensions:{drive:n.fromString(`ph/drive/${s}/${f}/${E}/${c}`),operation:n.fromString(`ph/drive/operation/${i.type}/${i.index}`),target:n.fromString(`ph/drive/target/${g}/${h}`),actionType:n.fromString(`ph/drive/actionType/${d}/${h}`)}};for(o.push(y);o.length>=a;){const m=o.splice(0,a);await this.analyticsStore.addSeriesValues(m)}}o.length>0&&await this.analyticsStore.addSeriesValues(o)}}}async onDisconnect(){}getActionType(e){return $.includes(e)?"CREATED":T.includes(e)?"DUPLICATED":N.includes(e)?"REMOVED":A.includes(e)?"MOVED":"UPDATED"}async clearSource(e){try{await this.analyticsStore.clearSeriesBySource(e,!0)}catch(t){this.logger.error("Failed to clear source",t)}}}const Y=r=>e=>[{processor:new b(r.analyticsStore),filter:{branch:["main"],documentId:["*"],scope:["*"],documentType:["powerhouse/document-drive"]}},{processor:new w(r.analyticsStore),filter:{branch:["main"],documentId:["*"],scope:["*"],documentType:["*"]}}];export{w as DocumentAnalyticsProcessor,b as DriveAnalyticsProcessor,Y as processorFactory};
|
|
2
|
+
//# sourceMappingURL=index.CMHigXQ2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.Cxw5H4RY.js","sources":["../../../../packages/common/dist/drive-analytics/processor/document-processor.js","../../../../packages/common/dist/drive-analytics/processor/drive-processor.js","../../../../packages/common/dist/drive-analytics/processor/index.js"],"sourcesContent":["import { AnalyticsPath, DateTime, } from \"@powerhousedao/reactor-browser/analytics\";\nimport { childLogger } from \"document-drive\";\nexport class DocumentAnalyticsProcessor {\n analyticsStore;\n logger;\n constructor(analyticsStore, logger = childLogger([\"processor\", \"document-analytics\"])) {\n this.analyticsStore = analyticsStore;\n this.logger = logger;\n //\n }\n async onStrands(strands) {\n if (strands.length === 0) {\n return;\n }\n for (const strand of strands) {\n // skip empty strands\n if (strand.operations.length === 0) {\n continue;\n }\n const firstOp = strand.operations[0];\n const source = AnalyticsPath.fromString(`ph/doc/${strand.driveId}/${strand.documentId}/${strand.branch}/${strand.scope}`);\n if (firstOp.index === 0) {\n await this.clearSource(source);\n }\n const { driveId, documentId, branch, scope } = strand;\n const target = driveId === documentId ? \"DRIVE\" : \"NODE\";\n const CHUNK_SIZE = 50;\n for (let i = 0; i < strand.operations.length; i += CHUNK_SIZE) {\n const chunk = strand.operations.slice(i, i + CHUNK_SIZE);\n const buffer = [];\n for (const operation of chunk) {\n const revision = operation.index;\n const seriesInput = {\n source,\n metric: \"DocumentOperations\",\n start: DateTime.fromISO(operation.timestamp),\n value: 1,\n dimensions: {\n drive: AnalyticsPath.fromString(`ph/doc/drive/${driveId}/${branch}/${scope}/${revision}`),\n operation: AnalyticsPath.fromString(`ph/doc/operation/${operation.type}/${operation.index}`),\n target: AnalyticsPath.fromString(`ph/doc/target/${driveId}/${target}/${documentId}`),\n },\n };\n buffer.push(seriesInput);\n while (buffer.length >= CHUNK_SIZE) {\n const batch = buffer.splice(0, CHUNK_SIZE);\n await this.analyticsStore.addSeriesValues(batch);\n }\n }\n if (buffer.length > 0) {\n await this.analyticsStore.addSeriesValues(buffer);\n }\n }\n }\n }\n async onDisconnect() { }\n async clearSource(source) {\n try {\n await this.analyticsStore.clearSeriesBySource(source, true);\n }\n catch (e) {\n this.logger.error(\"Failed to clear source\", e);\n }\n }\n}\n//# sourceMappingURL=document-processor.js.map","import { AnalyticsPath, DateTime, } from \"@powerhousedao/reactor-browser/analytics\";\nimport { childLogger } from \"document-drive\";\nconst CREATE_NODE_ACTIONS = [\"ADD_FILE\", \"ADD_FOLDER\"];\nconst DUPLICATE_NODE_ACTIONS = [\"COPY_NODE\"];\nconst UPDATE_NODE_ACTIONS = [\"UPDATE_FILE\", \"UPDATE_NODE\"];\nconst MOVE_NODE_ACTIONS = [\"MOVE_NODE\"];\nconst REMOVE_NODE_ACTIONS = [\"DELETE_NODE\"];\nconst NODE_ACTIONS = [\n ...CREATE_NODE_ACTIONS,\n ...DUPLICATE_NODE_ACTIONS,\n ...UPDATE_NODE_ACTIONS,\n ...MOVE_NODE_ACTIONS,\n ...REMOVE_NODE_ACTIONS,\n];\nexport class DriveAnalyticsProcessor {\n analyticsStore;\n logger;\n constructor(analyticsStore, logger = childLogger([\"processor\", \"drive-analytics\"])) {\n this.analyticsStore = analyticsStore;\n this.logger = logger;\n //\n }\n async onStrands(strands) {\n if (strands.length === 0) {\n return;\n }\n for (const strand of strands) {\n // skip empty strands\n if (strand.operations.length === 0) {\n continue;\n }\n const firstOp = strand.operations[0];\n const source = AnalyticsPath.fromString(`ph/drive/${strand.documentId}/${strand.branch}/${strand.scope}`);\n if (firstOp.index === 0) {\n await this.clearSource(source);\n }\n const { documentId: driveId, branch, scope } = strand;\n const CHUNK_SIZE = 50;\n for (let i = 0; i < strand.operations.length; i += CHUNK_SIZE) {\n const chunk = strand.operations.slice(i, i + CHUNK_SIZE);\n const buffer = [];\n for (const operation of chunk) {\n const revision = operation.index;\n const actionType = this.getActionType(operation.type);\n const target = NODE_ACTIONS.includes(operation.type)\n ? \"NODE\"\n : \"DRIVE\";\n let targetId = driveId;\n if (target === \"NODE\") {\n const operationInput = operation.input;\n targetId =\n operationInput.id ||\n operationInput.targetId ||\n operationInput.srcFolder ||\n driveId;\n }\n const seriesInput = {\n source,\n metric: \"DriveOperations\",\n start: DateTime.fromISO(operation.timestamp),\n value: 1,\n dimensions: {\n drive: AnalyticsPath.fromString(`ph/drive/${driveId}/${branch}/${scope}/${revision}`),\n operation: AnalyticsPath.fromString(`ph/drive/operation/${operation.type}/${operation.index}`),\n target: AnalyticsPath.fromString(`ph/drive/target/${target}/${targetId}`),\n actionType: AnalyticsPath.fromString(`ph/drive/actionType/${actionType}/${targetId}`),\n },\n };\n buffer.push(seriesInput);\n while (buffer.length >= CHUNK_SIZE) {\n const batch = buffer.splice(0, CHUNK_SIZE);\n await this.analyticsStore.addSeriesValues(batch);\n }\n }\n if (buffer.length > 0) {\n await this.analyticsStore.addSeriesValues(buffer);\n }\n }\n }\n }\n async onDisconnect() { }\n getActionType(action) {\n if (CREATE_NODE_ACTIONS.includes(action)) {\n return \"CREATED\";\n }\n if (DUPLICATE_NODE_ACTIONS.includes(action)) {\n return \"DUPLICATED\";\n }\n if (REMOVE_NODE_ACTIONS.includes(action)) {\n return \"REMOVED\";\n }\n if (MOVE_NODE_ACTIONS.includes(action)) {\n return \"MOVED\";\n }\n return \"UPDATED\";\n }\n async clearSource(source) {\n try {\n await this.analyticsStore.clearSeriesBySource(source, true);\n }\n catch (e) {\n this.logger.error(\"Failed to clear source\", e);\n }\n }\n}\n//# sourceMappingURL=drive-processor.js.map","import { DocumentAnalyticsProcessor } from \"./document-processor.js\";\nimport { DriveAnalyticsProcessor } from \"./drive-processor.js\";\nexport const processorFactory = (module) => (driveId) => {\n return [\n {\n processor: new DriveAnalyticsProcessor(module.analyticsStore),\n filter: {\n branch: [\"main\"],\n documentId: [\"*\"],\n scope: [\"*\"],\n documentType: [\"powerhouse/document-drive\"],\n },\n },\n {\n processor: new DocumentAnalyticsProcessor(module.analyticsStore),\n filter: {\n branch: [\"main\"],\n documentId: [\"*\"],\n scope: [\"*\"],\n documentType: [\"*\"],\n },\n },\n ];\n};\nexport * from \"./document-processor.js\";\nexport * from \"./drive-processor.js\";\n//# sourceMappingURL=index.js.map"],"names":["DocumentAnalyticsProcessor","analyticsStore","logger","childLogger","__publicField","strands","strand","firstOp","source","AnalyticsPath","driveId","documentId","branch","scope","target","CHUNK_SIZE","i","chunk","buffer","operation","revision","seriesInput","DateTime","batch","e","CREATE_NODE_ACTIONS","DUPLICATE_NODE_ACTIONS","UPDATE_NODE_ACTIONS","MOVE_NODE_ACTIONS","REMOVE_NODE_ACTIONS","NODE_ACTIONS","DriveAnalyticsProcessor","actionType","targetId","operationInput","action","processorFactory","module"],"mappings":"+fAEO,MAAMA,CAA2B,CAGpC,YAAYC,EAAgBC,EAASC,EAAY,CAAC,YAAa,oBAAoB,CAAC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ACH,CACI,UAAW,IAAIqB,EAAwBM,EAAO,cAAc,EAC5D,OAAQ,CACJ,OAAQ,CAAC,MAAM,EACf,WAAY,CAAC,GAAG,EAChB,MAAO,CAAC,GAAG,EACX,aAAc,CAAC,2BAA2B,CAC1D,CACA,EACQ,CACI,UAAW,IAAIrC,EAA2BqC,EAAO,cAAc,EAC/D,OAAQ,CACJ,OAAQ,CAAC,MAAM,EACf,WAAY,CAAC,GAAG,EAChB,MAAO,CAAC,GAAG,EACX,aAAc,CAAC,GAAG,CAClC,CACA,CACA"}
|
|
1
|
+
{"version":3,"file":"index.CMHigXQ2.js","sources":["../../../../packages/common/dist/drive-analytics/processor/document-processor.js","../../../../packages/common/dist/drive-analytics/processor/drive-processor.js","../../../../packages/common/dist/drive-analytics/processor/index.js"],"sourcesContent":["import { AnalyticsPath, DateTime, } from \"@powerhousedao/reactor-browser/analytics\";\nimport { childLogger } from \"document-drive\";\nexport class DocumentAnalyticsProcessor {\n analyticsStore;\n logger;\n constructor(analyticsStore, logger = childLogger([\"processor\", \"document-analytics\"])) {\n this.analyticsStore = analyticsStore;\n this.logger = logger;\n //\n }\n async onStrands(strands) {\n if (strands.length === 0) {\n return;\n }\n for (const strand of strands) {\n // skip empty strands\n if (strand.operations.length === 0) {\n continue;\n }\n const firstOp = strand.operations[0];\n const source = AnalyticsPath.fromString(`ph/doc/${strand.driveId}/${strand.documentId}/${strand.branch}/${strand.scope}`);\n if (firstOp.index === 0) {\n await this.clearSource(source);\n }\n const { driveId, documentId, branch, scope } = strand;\n const target = driveId === documentId ? \"DRIVE\" : \"NODE\";\n const CHUNK_SIZE = 50;\n for (let i = 0; i < strand.operations.length; i += CHUNK_SIZE) {\n const chunk = strand.operations.slice(i, i + CHUNK_SIZE);\n const buffer = [];\n for (const operation of chunk) {\n const revision = operation.index;\n const seriesInput = {\n source,\n metric: \"DocumentOperations\",\n start: DateTime.fromISO(operation.timestamp),\n value: 1,\n dimensions: {\n drive: AnalyticsPath.fromString(`ph/doc/drive/${driveId}/${branch}/${scope}/${revision}`),\n operation: AnalyticsPath.fromString(`ph/doc/operation/${operation.type}/${operation.index}`),\n target: AnalyticsPath.fromString(`ph/doc/target/${driveId}/${target}/${documentId}`),\n },\n };\n buffer.push(seriesInput);\n while (buffer.length >= CHUNK_SIZE) {\n const batch = buffer.splice(0, CHUNK_SIZE);\n await this.analyticsStore.addSeriesValues(batch);\n }\n }\n if (buffer.length > 0) {\n await this.analyticsStore.addSeriesValues(buffer);\n }\n }\n }\n }\n async onDisconnect() { }\n async clearSource(source) {\n try {\n await this.analyticsStore.clearSeriesBySource(source, true);\n }\n catch (e) {\n this.logger.error(\"Failed to clear source\", e);\n }\n }\n}\n//# sourceMappingURL=document-processor.js.map","import { AnalyticsPath, DateTime, } from \"@powerhousedao/reactor-browser/analytics\";\nimport { childLogger } from \"document-drive\";\nconst CREATE_NODE_ACTIONS = [\"ADD_FILE\", \"ADD_FOLDER\"];\nconst DUPLICATE_NODE_ACTIONS = [\"COPY_NODE\"];\nconst UPDATE_NODE_ACTIONS = [\"UPDATE_FILE\", \"UPDATE_NODE\"];\nconst MOVE_NODE_ACTIONS = [\"MOVE_NODE\"];\nconst REMOVE_NODE_ACTIONS = [\"DELETE_NODE\"];\nconst NODE_ACTIONS = [\n ...CREATE_NODE_ACTIONS,\n ...DUPLICATE_NODE_ACTIONS,\n ...UPDATE_NODE_ACTIONS,\n ...MOVE_NODE_ACTIONS,\n ...REMOVE_NODE_ACTIONS,\n];\nexport class DriveAnalyticsProcessor {\n analyticsStore;\n logger;\n constructor(analyticsStore, logger = childLogger([\"processor\", \"drive-analytics\"])) {\n this.analyticsStore = analyticsStore;\n this.logger = logger;\n //\n }\n async onStrands(strands) {\n if (strands.length === 0) {\n return;\n }\n for (const strand of strands) {\n // skip empty strands\n if (strand.operations.length === 0) {\n continue;\n }\n const firstOp = strand.operations[0];\n const source = AnalyticsPath.fromString(`ph/drive/${strand.documentId}/${strand.branch}/${strand.scope}`);\n if (firstOp.index === 0) {\n await this.clearSource(source);\n }\n const { documentId: driveId, branch, scope } = strand;\n const CHUNK_SIZE = 50;\n for (let i = 0; i < strand.operations.length; i += CHUNK_SIZE) {\n const chunk = strand.operations.slice(i, i + CHUNK_SIZE);\n const buffer = [];\n for (const operation of chunk) {\n const revision = operation.index;\n const actionType = this.getActionType(operation.type);\n const target = NODE_ACTIONS.includes(operation.type)\n ? \"NODE\"\n : \"DRIVE\";\n let targetId = driveId;\n if (target === \"NODE\") {\n const operationInput = operation.input;\n targetId =\n operationInput.id ||\n operationInput.targetId ||\n operationInput.srcFolder ||\n driveId;\n }\n const seriesInput = {\n source,\n metric: \"DriveOperations\",\n start: DateTime.fromISO(operation.timestamp),\n value: 1,\n dimensions: {\n drive: AnalyticsPath.fromString(`ph/drive/${driveId}/${branch}/${scope}/${revision}`),\n operation: AnalyticsPath.fromString(`ph/drive/operation/${operation.type}/${operation.index}`),\n target: AnalyticsPath.fromString(`ph/drive/target/${target}/${targetId}`),\n actionType: AnalyticsPath.fromString(`ph/drive/actionType/${actionType}/${targetId}`),\n },\n };\n buffer.push(seriesInput);\n while (buffer.length >= CHUNK_SIZE) {\n const batch = buffer.splice(0, CHUNK_SIZE);\n await this.analyticsStore.addSeriesValues(batch);\n }\n }\n if (buffer.length > 0) {\n await this.analyticsStore.addSeriesValues(buffer);\n }\n }\n }\n }\n async onDisconnect() { }\n getActionType(action) {\n if (CREATE_NODE_ACTIONS.includes(action)) {\n return \"CREATED\";\n }\n if (DUPLICATE_NODE_ACTIONS.includes(action)) {\n return \"DUPLICATED\";\n }\n if (REMOVE_NODE_ACTIONS.includes(action)) {\n return \"REMOVED\";\n }\n if (MOVE_NODE_ACTIONS.includes(action)) {\n return \"MOVED\";\n }\n return \"UPDATED\";\n }\n async clearSource(source) {\n try {\n await this.analyticsStore.clearSeriesBySource(source, true);\n }\n catch (e) {\n this.logger.error(\"Failed to clear source\", e);\n }\n }\n}\n//# sourceMappingURL=drive-processor.js.map","import { DocumentAnalyticsProcessor } from \"./document-processor.js\";\nimport { DriveAnalyticsProcessor } from \"./drive-processor.js\";\nexport const processorFactory = (module) => (driveId) => {\n return [\n {\n processor: new DriveAnalyticsProcessor(module.analyticsStore),\n filter: {\n branch: [\"main\"],\n documentId: [\"*\"],\n scope: [\"*\"],\n documentType: [\"powerhouse/document-drive\"],\n },\n },\n {\n processor: new DocumentAnalyticsProcessor(module.analyticsStore),\n filter: {\n branch: [\"main\"],\n documentId: [\"*\"],\n scope: [\"*\"],\n documentType: [\"*\"],\n },\n },\n ];\n};\nexport * from \"./document-processor.js\";\nexport * from \"./drive-processor.js\";\n//# sourceMappingURL=index.js.map"],"names":["DocumentAnalyticsProcessor","analyticsStore","logger","childLogger","__publicField","strands","strand","firstOp","source","AnalyticsPath","driveId","documentId","branch","scope","target","CHUNK_SIZE","i","chunk","buffer","operation","revision","seriesInput","DateTime","batch","e","CREATE_NODE_ACTIONS","DUPLICATE_NODE_ACTIONS","UPDATE_NODE_ACTIONS","MOVE_NODE_ACTIONS","REMOVE_NODE_ACTIONS","NODE_ACTIONS","DriveAnalyticsProcessor","actionType","targetId","operationInput","action","processorFactory","module"],"mappings":"+fAEO,MAAMA,CAA2B,CAGpC,YAAYC,EAAgBC,EAASC,EAAY,CAAC,YAAa,oBAAoB,CAAC,EAAG,CAFvFC,EAAA,uBACAA,EAAA,eAEI,KAAK,eAAiBH,EACtB,KAAK,OAASC,CAEtB,CACI,MAAM,UAAUG,EAAS,CACrB,GAAIA,EAAQ,SAAW,EAGvB,UAAWC,KAAUD,EAAS,CAE1B,GAAIC,EAAO,WAAW,SAAW,EAC7B,SAEJ,MAAMC,EAAUD,EAAO,WAAW,CAAC,EAC7BE,EAASC,EAAc,WAAW,UAAUH,EAAO,OAAO,IAAIA,EAAO,UAAU,IAAIA,EAAO,MAAM,IAAIA,EAAO,KAAK,EAAE,EACpHC,EAAQ,QAAU,GAClB,MAAM,KAAK,YAAYC,CAAM,EAEjC,KAAM,CAAE,QAAAE,EAAS,WAAAC,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ms,useEffect as en,createContext as Z_,useContext as Y_,forwardRef as fh,useRef as Nt,useCallback as ve,useImperativeHandle as wb,useId as dh,memo as xb,useMemo as to}from"react";import{ar as z_,a_ as K_,o as Ci,a$ as ii,s as Ie,b0 as X_,b1 as kb,b as Ib,b2 as J_,d as eN,b3 as tN,w as Ln,b4 as Vf,b5 as jc,b6 as Rb,g as nN,b7 as iN,b8 as rN,l as sN,b9 as oN,ba as aN,bb as lN,bc as uN,bd as cN,be as fN,bf as dN,p as hN,bg as pN,bh as mN,bi as Db,bj as Cb,bk as Pb,bl as Ep,bm as gN,bn as vN,bo as yN,bp as bN,bq as ON,br as Ap,bs as SN,q as Gc,bt as TN,bu as EN,bv as AN,bw as _N,bx as NN,by as wN,bz as xN,bA as kN,bB as IN,bC as RN,bD as DN}from"./index.CW6hXWch.js";import{c2 as Mb,c3 as ie,c4 as On,c5 as Su,c6 as En,c7 as bc,c8 as Ht,c9 as tn,ca as Oc,cb as Lr,cc as Ls,cd as CN,ce as z,cf as PN,cg as MN,ch as Lb,ci as $b,cj as LN,ck as Qb,cl as _p,cm as Oi,cn as Np,co as wp,cp as xp,cq as $N,cr as ui,cs as Cn,ct as QN,cu as $r,cv as $s,cw as ot,cx as Qs,cy as hh,cz as Fb,cA as Vb,cB as Bb,cC as Ub,cD as Bf,cE as FN,cF as Mu,cG as VN,cH as ph,cI as mh,cJ as qb,cK as jb,cL as BN,cM as Uf,cN as qf,cO as jf,cP as gs,cQ as UN,cR as Gb,cS as qN,cT as jN,cU as it,cV as GN,cW as HN,cX as WN}from"./index.
|
|
1
|
+
import{jsx as Y,jsxs as Me}from"react/jsx-runtime";import*as Gt from"react";import Pu,{useState as Ms,useEffect as en,createContext as Z_,useContext as Y_,forwardRef as fh,useRef as Nt,useCallback as ve,useImperativeHandle as wb,useId as dh,memo as xb,useMemo as to}from"react";import{ar as z_,a_ as K_,o as Ci,a$ as ii,s as Ie,b0 as X_,b1 as kb,b as Ib,b2 as J_,d as eN,b3 as tN,w as Ln,b4 as Vf,b5 as jc,b6 as Rb,g as nN,b7 as iN,b8 as rN,l as sN,b9 as oN,ba as aN,bb as lN,bc as uN,bd as cN,be as fN,bf as dN,p as hN,bg as pN,bh as mN,bi as Db,bj as Cb,bk as Pb,bl as Ep,bm as gN,bn as vN,bo as yN,bp as bN,bq as ON,br as Ap,bs as SN,q as Gc,bt as TN,bu as EN,bv as AN,bw as _N,bx as NN,by as wN,bz as xN,bA as kN,bB as IN,bC as RN,bD as DN}from"./index.CW6hXWch.js";import{c2 as Mb,c3 as ie,c4 as On,c5 as Su,c6 as En,c7 as bc,c8 as Ht,c9 as tn,ca as Oc,cb as Lr,cc as Ls,cd as CN,ce as z,cf as PN,cg as MN,ch as Lb,ci as $b,cj as LN,ck as Qb,cl as _p,cm as Oi,cn as Np,co as wp,cp as xp,cq as $N,cr as ui,cs as Cn,ct as QN,cu as $r,cv as $s,cw as ot,cx as Qs,cy as hh,cz as Fb,cA as Vb,cB as Bb,cC as Ub,cD as Bf,cE as FN,cF as Mu,cG as VN,cH as ph,cI as mh,cJ as qb,cK as jb,cL as BN,cM as Uf,cN as qf,cO as jf,cP as gs,cQ as UN,cR as Gb,cS as qN,cT as jN,cU as it,cV as GN,cW as HN,cX as WN}from"./index.11hBdWUl.js";import"react-dom";import"react-dom/client";import"./browser.BkwNmV2Z.js";import"./app-skeleton.js";const ZN=Object.freeze({major:16,minor:11,patch:0,preReleaseTag:null});function YN(n){return n instanceof Error?n:new zN(n)}class zN extends Error{constructor(e){super("Unexpected error value: "+Mb(e)),this.name="NonErrorThrown",this.thrownValue=e}}function KN(n,e,t){var i;const r=YN(n);return XN(r)?r:new ie(r.message,{nodes:(i=r.nodes)!==null&&i!==void 0?i:e,source:r.source,positions:r.positions,path:t,originalError:r})}function XN(n){return Array.isArray(n.path)}function JN(n){return{Field(e){const t=n.getFieldDef(),i=t==null?void 0:t.deprecationReason;if(t&&i!=null){const r=n.getParentType();r!=null||Su(!1),n.reportError(new ie(`The field ${r.name}.${t.name} is deprecated. ${i}`,{nodes:e}))}},Argument(e){const t=n.getArgument(),i=t==null?void 0:t.deprecationReason;if(t&&i!=null){const r=n.getDirective();if(r!=null)n.reportError(new ie(`Directive "@${r.name}" argument "${t.name}" is deprecated. ${i}`,{nodes:e}));else{const s=n.getParentType(),o=n.getFieldDef();s!=null&&o!=null||Su(!1),n.reportError(new ie(`Field "${s.name}.${o.name}" argument "${t.name}" is deprecated. ${i}`,{nodes:e}))}}},ObjectField(e){const t=On(n.getParentInputType());if(En(t)){const i=t.getFields()[e.name.value],r=i==null?void 0:i.deprecationReason;r!=null&&n.reportError(new ie(`The input field ${t.name}.${i.name} is deprecated. ${r}`,{nodes:e}))}},EnumValue(e){const t=n.getEnumValue(),i=t==null?void 0:t.deprecationReason;if(t&&i!=null){const r=On(n.getInputType());r!=null||Su(!1),n.reportError(new ie(`The enum value "${r.name}.${t.name}" is deprecated. ${i}`,{nodes:e}))}}}}function gh(n){return tw(n,e=>!Lb(e),ew)}function ew(n){return!$b(n)&&!LN(n)}function tw(n,e,t){const i=n.getDirectives().filter(e),r=Object.values(n.getTypeMap()).filter(t);return[nw(n),...i.map(s=>fw(s)),...r.map(s=>rw(s))].filter(Boolean).join(`
|
|
2
2
|
|
|
3
3
|
`)}function nw(n){if(n.description==null&&iw(n))return;const e=[],t=n.getQueryType();t&&e.push(` query: ${t.name}`);const i=n.getMutationType();i&&e.push(` mutation: ${i.name}`);const r=n.getSubscriptionType();return r&&e.push(` subscription: ${r.name}`),Wt(n)+`schema {
|
|
4
4
|
${e.join(`
|
|
@@ -111,4 +111,4 @@ In some cases, you need to provide options to alter GraphQL's execution behavior
|
|
|
111
111
|
"errors editor"
|
|
112
112
|
`,gridTemplateRows:"auto 1fr"},children:[Me("div",{className:"flex flex-col gap-2",style:{gridArea:"left"},children:[Y(HS,{operation:e,onAddOperationAndInitialSchema:s,updateOperationName:o,deleteOperation:a,module:t,allOperationNames:i}),Y(MQ,{operation:e,focusOnMount:e.id===r,setOperationDescription:u})]}),Y("div",{className:"relative top-8",style:{gridArea:"editor"},children:Y(ah,{doc:e.schema??"",updateDocumentInModel:h,customLinter:p})}),Me("div",{style:{gridArea:"errors"},children:[Y("h3",{className:"my-2 text-sm font-medium text-gray-700",children:"Reducer Exceptions"}),Y(LQ,{operation:e,addOperationError:f,deleteOperationError:c,setOperationErrorName:d})]})]})}function VQ({module:n,allOperations:e,shouldFocusNewOperation:t,updateOperationName:i,deleteOperation:r,addOperationAndInitialSchema:s,addOperationError:o,deleteOperationError:a,setOperationErrorName:l,updateOperationSchema:u,setOperationDescription:f}){const[c,d]=Ms(null),h=dh(),p=e.map(g=>g.name).filter(g=>g!==null),m=ve(async(g,v)=>{const y=await s(g,v);return y&&d(y),y},[s,d]);return Me("div",{children:[n.operations.map(g=>Y("div",{children:Y(FQ,{operation:g,module:n,lastCreatedOperationId:c,allOperationNames:p,addOperationError:o,deleteOperationError:a,setOperationErrorName:l,onAddOperationAndInitialSchema:m,updateOperationName:i,deleteOperation:r,updateOperationSchema:u,setOperationDescription:f})},g.id)),Y("div",{className:"mt-6 w-1/2 pr-6",children:Y(HS,{onAddOperationAndInitialSchema:m,updateOperationName:i,deleteOperation:r,module:n,allOperationNames:p,focusOnMount:t},h)})]})}function Eb(n){const{module:e,modules:t,allOperations:i,lastCreatedModuleId:r,onAddModule:s,updateModuleName:o,deleteModule:a,updateOperationName:l,deleteOperation:u,addOperationAndInitialSchema:f,updateOperationSchema:c,setOperationDescription:d,addOperationError:h,deleteOperationError:p,setOperationErrorName:m}=n;return Me("div",{className:"relative rounded-3xl bg-gray-100 p-6",children:[Me("div",{className:"mb-2 w-1/2 pr-6",children:[Y(IR,{modules:t,module:e,onAddModule:s,updateModuleName:o}),!!e&&Y("button",{"aria-label":"Delete module",tabIndex:-1,className:"absolute right-1 top-1 p-2 text-gray-800 transition-colors hover:text-gray-500",onClick:()=>{a(e.id)},children:Y("svg",{className:"size-6",viewBox:"0 0 24 24",fill:"currentcolor",children:Y("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.9993 8.51506L15.4844 7L11.9994 10.4852L8.51497 7.00057L7 8.51562L10.4844 12.0003L7.00056 15.4843L8.51552 16.9994L11.9994 13.5153L15.4838 17L16.9988 15.4849L13.5144 12.0003L16.9993 8.51506Z"})})})]}),!!e&&Y(VQ,{module:e,allOperations:i,shouldFocusNewOperation:e.id===r,updateOperationName:l,deleteOperation:u,addOperationAndInitialSchema:f,updateOperationSchema:c,setOperationDescription:d,addOperationError:h,deleteOperationError:p,setOperationErrorName:m})]})}function BQ({modules:n,allOperations:e,addModule:t,updateModuleName:i,deleteModule:r,updateOperationName:s,deleteOperation:o,addOperationAndInitialSchema:a,updateOperationSchema:l,setOperationDescription:u,addOperationError:f,deleteOperationError:c,setOperationErrorName:d}){const[h,p]=Ms(null),m=Nt(null),g=ve(async v=>{var O;const y=await t(v);return y&&(p(y),(O=m.current)==null||O.focus()),y},[t,p]);return Me("div",{className:"flex flex-col gap-2",children:[n.map(v=>Y(Eb,{module:v,modules:n,allOperations:e,lastCreatedModuleId:h,onAddModule:g,updateModuleName:i,deleteModule:r,updateOperationName:s,deleteOperation:o,addOperationAndInitialSchema:a,updateOperationSchema:l,setOperationDescription:u,addOperationError:f,deleteOperationError:c,setOperationErrorName:d},v.id)),Y(Eb,{modules:n,allOperations:e,lastCreatedModuleId:h,onAddModule:g,updateModuleName:i,deleteModule:r,updateOperationName:s,deleteOperation:o,addOperationAndInitialSchema:a,updateOperationSchema:l,setOperationDescription:u,addOperationError:f,deleteOperationError:c,setOperationErrorName:d},"add-module"),Y("div",{ref:m,tabIndex:0,className:"size-0 overflow-hidden","aria-hidden":"true"})]})}const lh=fh((n,e)=>{const{className:t,...i}=n;return Y("button",{ref:e,...i,className:Yt("h-10 whitespace-nowrap rounded-md border border-gray-200 bg-gray-50 px-4 py-2 text-sm font-medium text-gray-800 transition-colors hover:bg-gray-100 hover:text-gray-900 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",t)})}),UQ=Yh({String:Q.string,Number:Q.number,"True False":Q.bool,PropertyName:Q.propertyName,Null:Q.null,", :":Q.separator,"[ ]":Q.squareBracket,"{ }":Q.brace}),qQ=ks.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[UQ],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),jQ=()=>n=>{try{JSON.parse(n.state.doc.toString())}catch(e){if(!(e instanceof SyntaxError))throw e;const t=GQ(e,n.state.doc);return[{from:t,message:e.message,severity:"error",to:t}]}return[]};function GQ(n,e){let t;return(t=n.message.match(/at position (\d+)/))?Math.min(+t[1],e.length):(t=n.message.match(/at line (\d+) column (\d+)/))?Math.min(e.line(+t[1]).from+ +t[2]-1,e.length):0}const S_=Is.define({name:"json",parser:qQ.configure({props:[Xh.add({Object:my({except:/^\s*\}/}),Array:my({except:/^\s*\]/})}),ep.add({"Object Array":GE})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function HQ(){return new UE(S_)}const WQ=xb(function(e){const{doc:t,readonly:i=!1,updateDocumentInModel:r}=e,{editorRef:s,viewRef:o,updateListenerCompartment:a,focusHandlerCompartment:l,pasteHandlerCompartment:u,timeoutRef:f}=h_();return en(()=>{o.current||(o.current=new ne({state:Ee.create({doc:t,extensions:[...v_,wc.of(y_),oA,S_,HQ(),Uh(jQ()),a.current.of(yp(i,f,r)),l.current.of(bp(i,f,r)),u.current.of(Op(i,f,r)),Ee.readOnly.of(i)]}),parent:s.current}),kr(o.current))},[]),p_(o),m_(o.current,i,f,r,{updateListener:a.current,focusHandler:l.current,pasteHandler:u.current}),g_(o.current,t),Y("div",{ref:s})}),ZQ=mN,T_=Gt.forwardRef(({className:n,...e},t)=>Y(Db,{ref:t,className:Yt("flex items-center justify-center rounded-xl bg-slate-50 p-1 shadow-[inset_0px_0px_2px_rgba(255,255,255,0.50)]",n),...e}));T_.displayName=Db.displayName;const uh=Gt.forwardRef(({className:n,...e},t)=>Y(Cb,{ref:t,className:Yt("flex w-full items-center justify-center whitespace-nowrap rounded-lg p-1 text-sm text-gray-500 transition-all disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-gray-50 data-[state=active]:text-gray-800 data-[state=active]:shadow-[0px_16px_16px_-4px_rgba(0,0,0,0.10)]",n),...e}));uh.displayName=Cb.displayName;const ch=Gt.forwardRef(({className:n,...e},t)=>Y(Pb,{ref:t,className:Yt("",n),...e}));ch.displayName=Pb.displayName;function Ab({modelName:n,stateSchema:e,initialValue:t,setStateSchema:i,setInitialState:r,scope:s}){const o=nS(),[a,l]=Ms(!1),u=ve(p=>$Q(p,n,s),[n,s]),f=ve(()=>{l(p=>!p)},[]),c=ve(p=>i(p,s),[i,s]),d=ve(p=>r(p,s),[r,s]),h=ve(()=>{const p=t||"{}",m=nn(o);if(!m)return;const g=nn(e);if(!g)return;const v=iS(n,s);if(!v)return;const y=g.definitions.find(S=>S.kind===z.OBJECT_TYPE_DEFINITION&&S.name.value===v);if(!y||y.kind!==z.OBJECT_TYPE_DEFINITION)return;const O=lk({sharedSchemaDocumentNode:m,stateTypeDefinitionNode:y,existingValue:p});r(O,s)},[o,t,r,s]);return Me("div",{className:"grid grid-cols-2 gap-4",children:[Me("div",{children:[Me("h3",{className:"mb-2 text-lg capitalize",children:[s," state schema"]}),Me(lh,{onClick:f,className:"mb-2 flex w-fit items-center gap-2",children:[a?"Hide":"Show"," standard library",Y("svg",{className:Yt("inline-block transition-transform",a?"rotate-180":"rotate-0"),xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:Y("path",{d:"M11.9883 6.01172C11.4363 6.01172 10.9883 6.45972 10.9883 7.01172V13.0117H6.98828L11.9883 18.0117L16.9883 13.0117H12.9883V7.01172C12.9883 6.45972 12.5403 6.01172 11.9883 6.01172Z",fill:"black"})})]}),a&&Y(ah,{doc:bh,readonly:!0}),Y(ah,{doc:e,updateDocumentInModel:c,customLinter:u})]}),Me("div",{children:[Me("div",{className:"flex flex-col items-end",children:[Me("h3",{className:"mb-2 text-right text-lg capitalize",children:[s," state initial value"]}),Me(lh,{onClick:h,className:"mb-2 flex w-fit items-center gap-2",children:["Sync with schema"," ",Y("svg",{className:"inline-block",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:Y("path",{d:"M8.00521 1.99219C6.63588 1.99219 5.32788 2.45152 4.27588 3.28419C3.98721 3.51219 3.94321 3.93285 4.17188 4.22151C4.40054 4.51018 4.82055 4.55418 5.10921 4.32552C5.92721 3.67819 6.93921 3.32552 8.00521 3.32552C10.5825 3.32552 12.6719 5.41485 12.6719 7.99218H11.3385L13.3385 10.6588L15.3385 7.99218H14.0052C14.0052 4.67818 11.3192 1.99219 8.00521 1.99219ZM2.67188 5.32552L0.671875 7.99218H2.00521C2.00521 11.3062 4.69121 13.9922 8.00521 13.9922C9.37521 13.9922 10.6825 13.5335 11.7345 12.7002C12.0232 12.4722 12.0672 12.0515 11.8385 11.7628C11.6099 11.4742 11.1899 11.4302 10.9012 11.6588C10.0825 12.3068 9.07188 12.6588 8.00521 12.6588C5.42788 12.6588 3.33854 10.5695 3.33854 7.99218H4.67188L2.67188 5.32552Z",fill:"#343839"})})]})]}),Y(WQ,{doc:t,updateDocumentInModel:d})]})]})}function YQ({modelName:n,globalStateSchema:e,localStateSchema:t,globalStateInitialValue:i,localStateInitialValue:r,setStateSchema:s,setInitialState:o}){const a=ve(()=>{const l=Oh(n,"local");s(l,"local"),o("","local")},[n,s,o]);return Me(ZQ,{className:"pb-8",activationMode:"manual",defaultValue:"global",children:[Y("div",{className:"my-6",children:Me(T_,{className:"mx-auto flex max-w-sm",children:[Y(uh,{value:"global",children:"Global"}),Y(uh,{value:"local",children:"Local"})]})}),Y(ch,{value:"global",tabIndex:-1,children:Y(Ab,{modelName:n,stateSchema:e,initialValue:i,setStateSchema:s,setInitialState:o,scope:"global"})}),Y(ch,{value:"local",tabIndex:-1,children:t?Y(Ab,{modelName:n,stateSchema:t,initialValue:r,setStateSchema:s,setInitialState:o,scope:"local"}):Me("div",{className:"",children:[Y("h3",{className:"mb-2 text-lg capitalize",children:"local state schema"}),Y(lh,{onClick:a,children:"Add local state"})]})})]})}function zQ(n){const{document:e,documentNodeName:t,dispatch:i}=n,{name:r,id:s,extension:o,description:a,author:{name:l,website:u}}=to(()=>e.state.global,[e.state.global]),{state:{global:{schema:f,initialValue:c},local:{schema:d,initialValue:h}},modules:p}=to(()=>e.state.global.specifications[0],[e.state.global.specifications[0]]),m=to(()=>p.flatMap(B=>B.operations),[p]),g=Nt(!r&&!!t&&m.length===0);en(()=>{!g.current||!t||(i(Ep({name:t})),lS({modelName:t,setStateSchema:(B,ee)=>{i(Ap({schema:B,scope:ee}))}}),g.current=!1)},[t]);const v=to(()=>m.flatMap(B=>B.schema??[]).join(`
|
|
113
113
|
`),[m]),y=ve(B=>{ct(B,s)||i(gN({id:B}))},[s]),O=ve(B=>{ct(B,a)||i(vN({description:B}))},[a]),S=ve(B=>{ct(B,o)||i(yN({extension:B}))},[o]),b=ve(B=>{ct(B,r)||i(Ep({name:B}))},[r]),T=ve(B=>{ct(B,l)||i(bN({authorName:B}))},[l]),w=ve(B=>{ct(B,u??"")||i(ON({authorWebsite:B}))},[u]),C=ve((B,ee)=>{ct(B,ee==="global"?f:d)||i(Ap({schema:B,scope:ee}))},[f,d]),D=ve((B,ee)=>{ct(B,ee==="global"?c:h)||i(SN({initialValue:B,scope:ee}))},[c,h]),k=ve(B=>new Promise(ee=>{try{if(p.some(pe=>ct(pe.name,B))){ee(void 0);return}const re=Gc();i(TN({id:re,name:B})),ee(re)}catch(re){console.error("Failed to add module:",re),ee(void 0)}}),[p]),$=ve((B,ee)=>{p.some(re=>ct(re.name,ee))||i(EN({id:B,name:ee}))},[p]),A=ve(B=>i(AN({id:B})),[]),_=ve((B,ee)=>new Promise(re=>{var pe;try{if((((pe=p.find(Ue=>Ue.id===B))==null?void 0:pe.operations.map(Ue=>Ue.name).filter(Boolean))??[]).some(Ue=>ct(Ue,ee))){re(void 0);return}const Le=Gc();i(_N({id:Le,moduleId:B,name:ee})),re(Le)}catch(xe){console.error("Failed to add operation:",xe),re(void 0)}}),[p]),I=ve((B,ee)=>{const re=p.find(xe=>xe.operations.some(Le=>Le.id===B));((re==null?void 0:re.operations.map(xe=>xe.name).filter(Boolean))??[]).some(xe=>ct(xe,ee))||i(NN({id:B,name:ee}))},[p]),R=ve((B,ee)=>{const re=m.find(pe=>pe.id===B);re!=null&&re.schema&&ct(ee,re.schema)||i(wN({id:B,schema:ee}))},[m]),F=ve((B,ee)=>{var pe;const re=((pe=m.find(xe=>xe.id===B))==null?void 0:pe.description)??"";ct(re,ee)||i(xN({id:B,description:ee}))},[m]),U=ve(B=>i(kN({id:B})),[]),X=ve((B,ee)=>new Promise(re=>{try{const pe=m.find(Ue=>Ue.id===B);if(((pe==null?void 0:pe.errors.map(Ue=>Ue.name).filter(Boolean))??[]).some(Ue=>ct(Ue,ee))){re(void 0);return}const Le=Gc();i(IN({id:Le,operationId:B,errorName:ee})),re(Le)}catch(pe){console.error("Failed to add operation error:",pe),re(void 0)}}),[m]),te=ve(B=>i(RN({id:B})),[]),ue=ve((B,ee,re)=>{const pe=m.find(Le=>Le.id===B);((pe==null?void 0:pe.errors.map(Le=>Le.name).filter(Boolean))??[]).some(Le=>ct(Le,re))||i(DN({id:ee,errorName:re}))},[m]),fe=ve(async(B,ee)=>{try{const re=await _(B,ee);if(!re)return;try{return R(re,ok(ee)),re}catch(pe){console.error("Failed to update operation schema:",pe);return}}catch(re){console.error("Failed to add operation and schema:",re);return}},[_,R]);return Y("main",{className:"min-h-dvh bg-gray-50",children:Y(sk,{globalStateSchemaSdl:f,localStateSchemaSdl:d,operationSchemasSdl:v,children:Me("div",{className:"mx-auto max-w-6xl px-4 pt-8",children:[Y(ER,{name:r,documentType:s,extension:o,description:a,authorName:l,authorWebsite:u??"",globalStateSchema:f,localStateSchema:d,setModelId:y,setModelDescription:O,setModelExtension:S,setModelName:b,setAuthorName:T,setAuthorWebsite:w,setStateSchema:C}),Y(kp,{}),Me("div",{children:[Y(YQ,{modelName:r,globalStateSchema:f,globalStateInitialValue:c,localStateSchema:d,localStateInitialValue:h,setStateSchema:C,setInitialState:D}),Y(kp,{}),Y("h3",{className:"mb-6 text-lg",children:"Global Operations"}),Y(BQ,{modules:p,allOperations:m,addModule:k,updateModuleName:$,deleteModule:A,updateOperationName:I,updateOperationSchema:R,setOperationDescription:F,deleteOperation:U,addOperationError:X,deleteOperationError:te,setOperationErrorName:ue,addOperationAndInitialSchema:fe})]})]})})})}const dF={Component:zQ,documentTypes:["powerhouse/document-model"],config:{id:"document-model-editor-v2",disableExternalControls:!0,documentToolbarEnabled:!0,timelineEnabled:!0}};export{zQ as DocumentModelEditor,dF as documentModelEditorModule};
|
|
114
|
-
//# sourceMappingURL=index.
|
|
114
|
+
//# sourceMappingURL=index.D1CGlf4e.js.map
|