@powerhousedao/powerhouse-vetra-packages 6.2.2-dev.52 → 6.2.2-dev.54

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 (59) hide show
  1. package/dist/browser/assets/{entry-CHj7_KqV.js → entry-D-JZwwGk.js} +2 -2
  2. package/dist/browser/assets/{projection-entry-Deqa5Gd1.js → projection-entry-64-WZZjU.js} +2 -2
  3. package/dist/browser/{connect-MB8tpoQw.js → connect-D1KIMa_5.js} +4 -4
  4. package/dist/browser/{connect-MB8tpoQw.js.map → connect-D1KIMa_5.js.map} +1 -1
  5. package/dist/browser/{dist-BesM2uPE.js → dist-dmLcxsWV.js} +46 -18
  6. package/dist/browser/dist-dmLcxsWV.js.map +1 -0
  7. package/dist/browser/{document-drive-CJz0STcj.js → document-drive-cxHraTVQ.js} +83 -2
  8. package/dist/browser/document-drive-cxHraTVQ.js.map +1 -0
  9. package/dist/browser/document-models/index.js +1 -1
  10. package/dist/browser/{editor-BDpW8vq8.js → editor-BAUTcFP2.js} +6 -6
  11. package/dist/browser/{editor-BDpW8vq8.js.map → editor-BAUTcFP2.js.map} +1 -1
  12. package/dist/browser/{editor-DQ49fg9m.js → editor-PmQcB82h.js} +5 -5
  13. package/dist/browser/{editor-DQ49fg9m.js.map → editor-PmQcB82h.js.map} +1 -1
  14. package/dist/browser/editors/document-model-editor/module.js +1 -1
  15. package/dist/browser/editors/generic-drive-explorer/index.js +4 -4
  16. package/dist/browser/editors/generic-drive-explorer/module.js +1 -1
  17. package/dist/browser/{folder-view-BG4n0zgH.js → folder-view-CWnDdLMC.js} +3 -3
  18. package/dist/browser/{folder-view-BG4n0zgH.js.map → folder-view-CWnDdLMC.js.map} +1 -1
  19. package/dist/browser/{graphql-editor-gWZAjvBa.js → graphql-editor-Cq_L5IUQ.js} +3 -3
  20. package/dist/browser/{graphql-editor-gWZAjvBa.js.map → graphql-editor-Cq_L5IUQ.js.map} +1 -1
  21. package/dist/browser/index.js +2 -2
  22. package/dist/browser/{json-editor-DCA4V_DS.js → json-editor-D8lysNHE.js} +3 -3
  23. package/dist/browser/{json-editor-DCA4V_DS.js.map → json-editor-D8lysNHE.js.map} +1 -1
  24. package/dist/browser/{lib-V-A4Y98b.js → lib-DKvC6Hnv.js} +3 -4
  25. package/dist/browser/lib-DKvC6Hnv.js.map +1 -0
  26. package/dist/browser/{state-schemas-oLJnYfWV.js → state-schemas-NyThZN-C.js} +3 -3
  27. package/dist/browser/{state-schemas-oLJnYfWV.js.map → state-schemas-NyThZN-C.js.map} +1 -1
  28. package/dist/node/{connect-Cdie59_O.mjs → connect-BixjoUPL.mjs} +4 -4
  29. package/dist/node/{connect-Cdie59_O.mjs.map → connect-BixjoUPL.mjs.map} +1 -1
  30. package/dist/node/{dist-BIdl6Tbq.mjs → dist-BtnA_6jV.mjs} +46 -18
  31. package/dist/node/dist-BtnA_6jV.mjs.map +1 -0
  32. package/dist/node/{document-drive-BgHPyTwW.mjs → document-drive-ChLoGFvU.mjs} +83 -2
  33. package/dist/node/document-drive-ChLoGFvU.mjs.map +1 -0
  34. package/dist/node/document-models/index.mjs +1 -1
  35. package/dist/node/{editor-C_RkuhbJ.mjs → editor-C8Drq-be.mjs} +5 -5
  36. package/dist/node/{editor-C_RkuhbJ.mjs.map → editor-C8Drq-be.mjs.map} +1 -1
  37. package/dist/node/{editor-CyRFyoHM.mjs → editor-cfoi-9LF.mjs} +6 -6
  38. package/dist/node/{editor-CyRFyoHM.mjs.map → editor-cfoi-9LF.mjs.map} +1 -1
  39. package/dist/node/editors/document-model-editor/module.mjs +1 -1
  40. package/dist/node/editors/generic-drive-explorer/index.mjs +4 -4
  41. package/dist/node/editors/generic-drive-explorer/module.mjs +1 -1
  42. package/dist/node/{folder-view-jO8_grQ6.mjs → folder-view--I9GOsir.mjs} +3 -3
  43. package/dist/node/{folder-view-jO8_grQ6.mjs.map → folder-view--I9GOsir.mjs.map} +1 -1
  44. package/dist/node/{graphql-editor-DyuSPAfc.mjs → graphql-editor-BKGQ8ojN.mjs} +3 -3
  45. package/dist/node/{graphql-editor-DyuSPAfc.mjs.map → graphql-editor-BKGQ8ojN.mjs.map} +1 -1
  46. package/dist/node/index.mjs +2 -2
  47. package/dist/node/{json-editor-DtNAniwW.mjs → json-editor-32paCJkU.mjs} +3 -3
  48. package/dist/node/{json-editor-DtNAniwW.mjs.map → json-editor-32paCJkU.mjs.map} +1 -1
  49. package/dist/node/{main-C2GlZ2Rh.mjs → main-DRfab-vL.mjs} +3 -4
  50. package/dist/node/main-DRfab-vL.mjs.map +1 -0
  51. package/dist/node/{state-schemas-CeAvAzja.mjs → state-schemas-ClrkM0Fn.mjs} +3 -3
  52. package/dist/node/{state-schemas-CeAvAzja.mjs.map → state-schemas-ClrkM0Fn.mjs.map} +1 -1
  53. package/package.json +7 -7
  54. package/dist/browser/dist-BesM2uPE.js.map +0 -1
  55. package/dist/browser/document-drive-CJz0STcj.js.map +0 -1
  56. package/dist/browser/lib-V-A4Y98b.js.map +0 -1
  57. package/dist/node/dist-BIdl6Tbq.mjs.map +0 -1
  58. package/dist/node/document-drive-BgHPyTwW.mjs.map +0 -1
  59. package/dist/node/main-C2GlZ2Rh.mjs.map +0 -1
@@ -2980,6 +2980,76 @@ function castDraft(value) {
2980
2980
  }
2981
2981
  //#endregion
2982
2982
  //#region ../shared/dist/document-model/index.js
2983
+ /**
2984
+ * What separates a signature's params when it travels as one string.
2985
+ *
2986
+ * GraphQL declares `signatures` as a list of strings, not a list of lists, so a
2987
+ * tuple is joined for transport and split on arrival. The separator is here so
2988
+ * the two halves cannot disagree about it - they live in different packages, and
2989
+ * a mismatch would corrupt every signature that crossed the wire rather than
2990
+ * failing outright.
2991
+ */
2992
+ const SIGNATURE_PARAM_SEPARATOR = ", ";
2993
+ /** The number of params a signature carries. */
2994
+ const SIGNATURE_PARAM_COUNT = 5;
2995
+ /** Joins a signature's params for transport. Already-joined input passes through. */
2996
+ function serializeSignature(signature) {
2997
+ return Array.isArray(signature) ? signature.join(SIGNATURE_PARAM_SEPARATOR) : signature;
2998
+ }
2999
+ /**
3000
+ * Splits a transported signature back into its params. A tuple passes through.
3001
+ *
3002
+ * Short input is padded rather than refused: verification reads the params by
3003
+ * position and fails on a wrong one, which says more than a length complaint
3004
+ * raised here would.
3005
+ */
3006
+ function deserializeSignature(signature) {
3007
+ if (Array.isArray(signature)) return signature;
3008
+ const parts = signature.split(SIGNATURE_PARAM_SEPARATOR);
3009
+ return Array.from({ length: SIGNATURE_PARAM_COUNT }, (_unused, index) => parts[index] ?? "");
3010
+ }
3011
+ /**
3012
+ * Projects an action onto the fields the GraphQL `ActionInput` declares.
3013
+ *
3014
+ * A projection rather than a spread, because an input object rejects a field it
3015
+ * does not declare, and that refusal takes the whole request with it. An action
3016
+ * read back out of storage can carry fields the type no longer has - a legacy
3017
+ * `attachments` array, or the operation fields left behind by a signing helper
3018
+ * that returns an operation - and any one of them would sink an otherwise valid
3019
+ * submission.
3020
+ *
3021
+ * Only fields the action actually carries are emitted, so an unsigned action
3022
+ * sends no context at all rather than a context full of nulls.
3023
+ */
3024
+ function toTransportAction(action) {
3025
+ if (action.input === void 0 || action.input === null) throw new Error(`Action ${action.id} (${action.type}) has no input, which the wire requires`);
3026
+ const projected = {
3027
+ id: action.id,
3028
+ type: action.type,
3029
+ timestampUtcMs: action.timestampUtcMs,
3030
+ input: action.input,
3031
+ scope: action.scope
3032
+ };
3033
+ const context = toTransportContext(action.context);
3034
+ return context ? {
3035
+ ...projected,
3036
+ context
3037
+ } : projected;
3038
+ }
3039
+ function toTransportContext(context) {
3040
+ if (!context) return;
3041
+ const projected = {};
3042
+ if (context.prevOpIndex !== void 0) projected.prevOpIndex = context.prevOpIndex;
3043
+ if (context.prevOpHash !== void 0) projected.prevOpHash = context.prevOpHash;
3044
+ if (context.nonce !== void 0) projected.nonce = context.nonce;
3045
+ const signer = context.signer;
3046
+ if (signer) projected.signer = {
3047
+ ...signer.user ? { user: signer.user } : {},
3048
+ ...signer.app ? { app: signer.app } : {},
3049
+ signatures: (signer.signatures ?? []).map(serializeSignature)
3050
+ };
3051
+ return Object.keys(projected).length > 0 ? projected : void 0;
3052
+ }
2983
3053
  var InvalidActionInputError = class extends Error {
2984
3054
  data;
2985
3055
  constructor(data) {
@@ -6861,6 +6931,17 @@ const documentModelStateReducer = (state, action) => {
6861
6931
  }
6862
6932
  };
6863
6933
  const documentModelReducer = createReducer(documentModelStateReducer);
6934
+ /**
6935
+ * Canonical document-model version normalization: documents stamped with 0
6936
+ * or nothing at all predate versioning and are treated as version 1, the
6937
+ * same version the registry assigns unversioned modules. Every consumer
6938
+ * that resolves a module or compares versions must use this rule; resolving
6939
+ * 0 to "latest" instead re-pins a legacy document's history to whichever
6940
+ * module happens to be newest.
6941
+ */
6942
+ function normalizeDocumentModelVersion(version) {
6943
+ return version && version > 0 ? version : 1;
6944
+ }
6864
6945
  function applyInitialState(document, action) {
6865
6946
  const input = action.input;
6866
6947
  const newState = input.initialState || input.state;
@@ -8315,6 +8396,6 @@ const driveDocumentModelModule = {
8315
8396
  }
8316
8397
  };
8317
8398
  //#endregion
8318
- export { setOperationSchema as $, createZip as A, replayDocumentVersioned as B, baseSaveToFileHandle as C, createPresignedHeader as D, createBaseState as E, documentModelDocumentType as F, setModelExtension as G, setAuthorWebsite as H, hashDocumentStateForScope as I, setModuleName as J, setModelId as K, isDocumentAction as L, deleteModule as M, deleteOperation as N, createReducer as O, deleteOperationError as P, setOperationName as Q, redo as R, baseLoadFromInputVersioned as S, createAction as T, setInitialState as U, setAuthorName as V, setModelDescription as W, setOperationDescription as X, setName as Y, setOperationErrorName as Z, addOperationError as _, handleTargetNameCollisions as a, generateId as at, baseCreateDocument as b, isValidName as c, documentModelDocumentModelModule as d, setStateSchema as et, logger as f, addOperation as g, addModule as h, generateNodesCopy as i, validateStateSchemaName as it, defaultBaseState as j, createState as k, moveNode as l, BaseDocumentStateSchema as m, copyNode as n, validateInitialState as nt, isFileNode as o, BaseDocumentHeaderSchema as p, setModelName as q, driveDocumentModelModule as r, validateModules as rt, isFolderNode as s, addFolder as t, undo as tt, updateNode as u, assertAuthPreservedOnDuplicate as v, buildSignedAction as w, baseLoadFromInput as x, baseActions as y, releaseNewVersion as z };
8399
+ export { setOperationErrorName as $, createZip as A, redo as B, baseSaveToFileHandle as C, createPresignedHeader as D, createBaseState as E, deserializeSignature as F, setInitialState as G, replayDocumentVersioned as H, documentModelDocumentType as I, setModelId as J, setModelDescription as K, hashDocumentStateForScope as L, deleteModule as M, deleteOperation as N, createReducer as O, deleteOperationError as P, setOperationDescription as Q, isDocumentAction as R, baseLoadFromInputVersioned as S, createAction as T, setAuthorName as U, releaseNewVersion as V, setAuthorWebsite as W, setModuleName as X, setModelName as Y, setName as Z, addOperationError as _, handleTargetNameCollisions as a, validateInitialState as at, baseCreateDocument as b, isValidName as c, generateId as ct, documentModelDocumentModelModule as d, setOperationName as et, logger as f, addOperation as g, addModule as h, generateNodesCopy as i, undo as it, defaultBaseState as j, createState as k, moveNode as l, BaseDocumentStateSchema as m, copyNode as n, setStateSchema as nt, isFileNode as o, validateModules as ot, BaseDocumentHeaderSchema as p, setModelExtension as q, driveDocumentModelModule as r, toTransportAction as rt, isFolderNode as s, validateStateSchemaName as st, addFolder as t, setOperationSchema as tt, updateNode as u, assertAuthPreservedOnDuplicate as v, buildSignedAction as w, baseLoadFromInput as x, baseActions as y, normalizeDocumentModelVersion as z };
8319
8400
 
8320
- //# sourceMappingURL=document-drive-CJz0STcj.js.map
8401
+ //# sourceMappingURL=document-drive-cxHraTVQ.js.map