@powerhousedao/connect 5.0.0-staging.22 → 5.0.0-staging.23
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/{atlas-import.BgATR-r7.js → atlas-import.DV9NGIcV.js} +2 -2
- package/dist/assets/{atlas-import.BgATR-r7.js.map → atlas-import.DV9NGIcV.js.map} +1 -1
- package/dist/assets/{ccip.jl18lENV.js → ccip.BYxx80kf.js} +2 -2
- package/dist/assets/{ccip.jl18lENV.js.map → ccip.BYxx80kf.js.map} +1 -1
- package/dist/assets/{content.DvmXmlAV.js → content.DS8bCjW3.js} +2 -2
- package/dist/assets/{content.DvmXmlAV.js.map → content.DS8bCjW3.js.map} +1 -1
- package/dist/assets/{creators.DxnBvZmB.js → creators.CjFm02Wg.js} +2 -2
- package/dist/assets/{creators.DxnBvZmB.js.map → creators.CjFm02Wg.js.map} +1 -1
- package/dist/assets/{drive-icon.BkTTXAVC.js → drive-icon.BEe60eO5.js} +2 -2
- package/dist/assets/{drive-icon.BkTTXAVC.js.map → drive-icon.BEe60eO5.js.map} +1 -1
- package/dist/assets/{index.gzsoMXLp.js → index.6RVr5bn1.js} +2 -2
- package/dist/assets/{index.gzsoMXLp.js.map → index.6RVr5bn1.js.map} +1 -1
- package/dist/assets/{index.HEXeD-Ya.js → index.Bt-6AiBl.js} +2 -2
- package/dist/assets/{index.HEXeD-Ya.js.map → index.Bt-6AiBl.js.map} +1 -1
- package/dist/assets/{index.huU8PUzV.js → index.CSVNwIam.js} +2 -2
- package/dist/assets/{index.huU8PUzV.js.map → index.CSVNwIam.js.map} +1 -1
- package/dist/assets/{index.D0MzbN42.js → index.DHgLJqcJ.js} +2 -2
- package/dist/assets/{index.D0MzbN42.js.map → index.DHgLJqcJ.js.map} +1 -1
- package/dist/assets/{index.m18NImLB.js → index.DnJYbUXB.js} +2 -2
- package/dist/assets/{index.m18NImLB.js.map → index.DnJYbUXB.js.map} +1 -1
- package/dist/assets/{index.BxyhGJau.js → index.J5BySxKV.js} +2 -2
- package/dist/assets/{index.BxyhGJau.js.map → index.J5BySxKV.js.map} +1 -1
- package/dist/assets/{index.r8UiWE99.js → index.OK3T5arx.js} +2 -2
- package/dist/assets/{index.r8UiWE99.js.map → index.OK3T5arx.js.map} +1 -1
- package/dist/assets/{main.CrANKVyU.js → main.D9OoNJWh.js} +7 -7
- package/dist/assets/{main.CrANKVyU.js.map → main.D9OoNJWh.js.map} +1 -1
- package/dist/assets/{nodefs.BoXHuKHB.js → nodefs.D4Jzt58G.js} +2 -2
- package/dist/assets/{nodefs.BoXHuKHB.js.map → nodefs.D4Jzt58G.js.map} +1 -1
- package/dist/assets/{opfs-ahp.hLLeu4rw.js → opfs-ahp.DuAFuh-M.js} +2 -2
- package/dist/assets/{opfs-ahp.hLLeu4rw.js.map → opfs-ahp.DuAFuh-M.js.map} +1 -1
- package/dist/assets/{root.BB4-uWle.js → root.DytsescB.js} +2 -2
- package/dist/assets/{root.BB4-uWle.js.map → root.DytsescB.js.map} +1 -1
- package/dist/index.html +1 -1
- package/dist/vite-envs.sh +1 -1
- package/package.json +9 -9
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a6 as t,a7 as e,a8 as r,a9 as o,aa as u,ab as a}from"./main.
|
|
2
|
-
//# sourceMappingURL=creators.
|
|
1
|
+
import{a6 as t,a7 as e,a8 as r,a9 as o,aa as u,ab as a}from"./main.D9OoNJWh.js";const s=n=>n!=null;u().refine(n=>s(n));function q(){return t({__typename:r("AddChangeLogItemInput").optional(),content:e(),id:e(),insertBefore:e().nullable()})}function d(){return t({description:e().nullish(),id:e(),name:e()})}function l(){return t({errorCode:e().nullish(),errorDescription:e().nullish(),errorName:e().nullish(),errorTemplate:e().nullish(),id:e(),operationId:e()})}function z(){return t({example:e(),id:e(),operationId:e()})}function c(){return t({description:e().nullish(),id:e(),moduleId:e(),name:e(),reducer:e().nullish(),schema:e().nullish(),template:e().nullish(),scope:i().nullish()})}function p(){return t({scope:e(),example:e(),id:e(),insertBefore:e().nullish()})}function F(){return t({__typename:r("DeleteChangeLogItemInput").optional(),id:e()})}function E(){return t({id:e()})}function S(){return t({id:e()})}function G(){return t({id:e()})}function m(){return t({id:e()})}function O(){return t({scope:e(),id:e()})}function i(){return e()}function I(){return t({newModuleId:e(),operationId:e()})}function J(){return t({__typename:r("ReorderChangeLogItemsInput").optional(),order:o(e())})}function h(){return t({moduleId:e(),order:o(e())})}function f(){return t({order:o(e())})}function T(){return t({operationId:e(),order:o(e())})}function K(){return t({operationId:e(),order:o(e())})}function _(){return t({scope:e(),order:o(e())})}function R(){return t({authorName:e()})}function A(){return t({authorWebsite:e()})}function g(){return t({scope:e(),initialValue:e()})}function D(){return t({description:e()})}function M(){return t({extension:e()})}function N(){return t({id:e()})}function b(){return t({name:e()})}function L(){return t({description:e().nullish(),id:e()})}function P(){return t({id:e(),name:e().nullish()})}function C(){return t({description:e().nullish(),id:e()})}function x(){return t({errorCode:e().nullish(),id:e()})}function U(){return t({errorDescription:e().nullish(),id:e()})}function y(){return t({errorName:e().nullish(),id:e()})}function X(){return t({errorTemplate:e().nullish(),id:e()})}function H(){return t({id:e(),name:e().nullish()})}function W(){return t({id:e(),scope:i()})}function w(){return t({id:e(),reducer:e().nullish()})}function B(){return t({id:e(),schema:e().nullish()})}function j(){return t({id:e(),template:e().nullish()})}function V(){return t({scope:e(),schema:e()})}function Q(){return t({__typename:r("UpdateChangeLogItemInput").optional(),id:e(),newContent:e()})}function Y(){return t({example:e(),id:e()})}function k(){return t({scope:e(),id:e(),newExample:e()})}const Z=n=>a("SET_MODEL_NAME",{...n},void 0,b,"global"),$=n=>a("SET_MODEL_ID",{...n},void 0,N,"global"),ee=n=>a("SET_MODEL_EXTENSION",{...n},void 0,M,"global"),ne=n=>a("SET_MODEL_DESCRIPTION",{...n},void 0,D,"global"),te=n=>a("SET_AUTHOR_NAME",{...n},void 0,R,"global"),ae=n=>a("SET_AUTHOR_WEBSITE",{...n},void 0,A,"global"),oe=n=>a("ADD_MODULE",{...n},void 0,d,"global"),re=n=>a("SET_MODULE_NAME",{...n},void 0,P,"global"),ie=n=>a("SET_MODULE_DESCRIPTION",{...n},void 0,L,"global"),ue=n=>a("DELETE_MODULE",{...n},void 0,E,"global"),se=n=>a("REORDER_MODULES",{...n},void 0,f,"global"),de=n=>a("ADD_OPERATION_ERROR",{...n},void 0,l,"global"),le=n=>a("SET_OPERATION_ERROR_CODE",{...n},void 0,x,"global"),ce=n=>a("SET_OPERATION_ERROR_NAME",{...n},void 0,y,"global"),pe=n=>a("SET_OPERATION_ERROR_DESCRIPTION",{...n},void 0,U,"global"),Ee=n=>a("SET_OPERATION_ERROR_TEMPLATE",{...n},void 0,X,"global"),Se=n=>a("DELETE_OPERATION_ERROR",{...n},void 0,S,"global"),me=n=>a("REORDER_OPERATION_ERRORS",{...n},void 0,T,"global"),Oe=n=>a("ADD_OPERATION",{...n},void 0,c,"global"),Ie=n=>a("SET_OPERATION_NAME",{...n},void 0,H,"global"),he=n=>a("SET_OPERATION_SCOPE",{...n},void 0,W,"global"),fe=n=>a("SET_OPERATION_SCHEMA",{...n},void 0,B,"global"),Te=n=>a("SET_OPERATION_DESCRIPTION",{...n},void 0,C,"global"),_e=n=>a("SET_OPERATION_TEMPLATE",{...n},void 0,j,"global"),Re=n=>a("SET_OPERATION_REDUCER",{...n},void 0,w,"global"),Ae=n=>a("MOVE_OPERATION",{...n},void 0,I,"global"),ge=n=>a("DELETE_OPERATION",{...n},void 0,m,"global"),De=n=>a("REORDER_MODULE_OPERATIONS",{...n},void 0,h,"global"),Me=n=>a("SET_STATE_SCHEMA",{...n},void 0,V,"global"),Ne=n=>a("SET_INITIAL_STATE",{...n},void 0,g,"global"),be=n=>a("ADD_STATE_EXAMPLE",{...n},void 0,p,"global"),Le=n=>a("UPDATE_STATE_EXAMPLE",{...n},void 0,k,"global"),Pe=n=>a("DELETE_STATE_EXAMPLE",{...n},void 0,O,"global"),Ce=n=>a("REORDER_STATE_EXAMPLES",{...n},void 0,_,"global");export{C as $,q as A,Te as B,le as C,F as D,pe as E,ce as F,Ee as G,Ie as H,Re as I,fe as J,he as K,_e as L,Me as M,Le as N,_ as O,O as P,k as Q,J as R,p as S,g as T,Q as U,V,h as W,m as X,I as Y,w as Z,j as _,z as a,B as a0,W as a1,H as a2,c as a3,T as a4,S as a5,X as a6,U as a7,y as a8,x as a9,l as aa,f as ab,E as ac,L as ad,P as ae,d as af,A as ag,R as ah,D as ai,M as aj,N as ak,b as al,Y as b,G as c,K as d,oe as e,Oe as f,de as g,be as h,ue as i,ge as j,Se as k,Pe as l,Ae as m,se as n,me as o,Ce as p,ae as q,De as r,te as s,Ne as t,ne as u,ee as v,$ as w,Z as x,ie as y,re as z};
|
|
2
|
+
//# sourceMappingURL=creators.CjFm02Wg.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"creators.DxnBvZmB.js","sources":["../../../../packages/document-model/dist/src/document-model/gen/schema/zod.js","../../../../packages/document-model/dist/src/document-model/gen/header/creators.js","../../../../packages/document-model/dist/src/document-model/gen/module/creators.js","../../../../packages/document-model/dist/src/document-model/gen/operation-error/creators.js","../../../../packages/document-model/dist/src/document-model/gen/operation/creators.js","../../../../packages/document-model/dist/src/document-model/gen/state/creators.js"],"sourcesContent":["import { z } from \"zod\";\nexport const isDefinedNonNullAny = (v) => v !== undefined && v !== null;\nexport const definedNonNullAnySchema = z\n .any()\n .refine((v) => isDefinedNonNullAny(v));\nexport function AddChangeLogItemInputSchema() {\n return z.object({\n __typename: z.literal(\"AddChangeLogItemInput\").optional(),\n content: z.string(),\n id: z.string(),\n insertBefore: z.string().nullable(),\n });\n}\nexport function AddModuleInputSchema() {\n return z.object({\n description: z.string().nullish(),\n id: z.string(),\n name: z.string(),\n });\n}\nexport function AddOperationErrorInputSchema() {\n return z.object({\n errorCode: z.string().nullish(),\n errorDescription: z.string().nullish(),\n errorName: z.string().nullish(),\n errorTemplate: z.string().nullish(),\n id: z.string(),\n operationId: z.string(),\n });\n}\nexport function AddOperationExampleInputSchema() {\n return z.object({\n example: z.string(),\n id: z.string(),\n operationId: z.string(),\n });\n}\nexport function AddOperationInputSchema() {\n return z.object({\n description: z.string().nullish(),\n id: z.string(),\n moduleId: z.string(),\n name: z.string(),\n reducer: z.string().nullish(),\n schema: z.string().nullish(),\n template: z.string().nullish(),\n scope: OperationScopeSchema().nullish(),\n });\n}\nexport function AddStateExampleInputSchema() {\n return z.object({\n scope: z.string(),\n example: z.string(),\n id: z.string(),\n insertBefore: z.string().nullish(),\n });\n}\nexport function AuthorSchema() {\n return z.object({\n __typename: z.literal(\"Author\").optional(),\n name: z.string(),\n website: z.string().nullable(),\n });\n}\nexport function CodeExampleSchema() {\n return z.object({\n __typename: z.literal(\"CodeExample\").optional(),\n id: z.string(),\n value: z.string(),\n });\n}\nexport function DeleteChangeLogItemInputSchema() {\n return z.object({\n __typename: z.literal(\"DeleteChangeLogItemInput\").optional(),\n id: z.string(),\n });\n}\nexport function DeleteModuleInputSchema() {\n return z.object({\n id: z.string(),\n });\n}\nexport function DeleteOperationErrorInputSchema() {\n return z.object({\n id: z.string(),\n });\n}\nexport function DeleteOperationExampleInputSchema() {\n return z.object({\n id: z.string(),\n });\n}\nexport function DeleteOperationInputSchema() {\n return z.object({\n id: z.string(),\n });\n}\nexport function DeleteStateExampleInputSchema() {\n return z.object({\n scope: z.string(),\n id: z.string(),\n });\n}\nexport function OperationScopeSchema() {\n return z.string();\n}\nexport function DocumentModelInputSchema() {\n return z.union([\n AddChangeLogItemInputSchema(),\n AddModuleInputSchema(),\n AddOperationErrorInputSchema(),\n AddOperationExampleInputSchema(),\n AddOperationInputSchema(),\n AddStateExampleInputSchema(),\n DeleteChangeLogItemInputSchema(),\n DeleteModuleInputSchema(),\n DeleteOperationErrorInputSchema(),\n DeleteOperationExampleInputSchema(),\n DeleteOperationInputSchema(),\n DeleteStateExampleInputSchema(),\n MoveOperationInputSchema(),\n ReorderChangeLogItemsInputSchema(),\n ReorderModuleOperationsInputSchema(),\n ReorderModulesInputSchema(),\n ReorderOperationErrorsInputSchema(),\n ReorderOperationExamplesInputSchema(),\n ReorderStateExamplesInputSchema(),\n SetAuthorNameInputSchema(),\n SetAuthorWebsiteInputSchema(),\n SetInitialStateInputSchema(),\n SetModelDescriptionInputSchema(),\n SetModelExtensionInputSchema(),\n SetModelIdInputSchema(),\n SetModelNameInputSchema(),\n SetModuleDescriptionInputSchema(),\n SetModuleNameInputSchema(),\n SetOperationDescriptionInputSchema(),\n SetOperationErrorCodeInputSchema(),\n SetOperationErrorDescriptionInputSchema(),\n SetOperationErrorNameInputSchema(),\n SetOperationErrorTemplateInputSchema(),\n SetOperationNameInputSchema(),\n SetOperationReducerInputSchema(),\n SetOperationSchemaInputSchema(),\n SetOperationTemplateInputSchema(),\n SetStateSchemaInputSchema(),\n UpdateChangeLogItemInputSchema(),\n UpdateOperationExampleInputSchema(),\n UpdateStateExampleInputSchema(),\n ]);\n}\nexport function DocumentModelStateSchema() {\n return z.object({\n __typename: z.literal(\"DocumentModelState\").optional(),\n author: AuthorSchema(),\n description: z.string(),\n extension: z.string(),\n id: z.string(),\n name: z.string(),\n specifications: z.array(DocumentSpecificationSchema()),\n });\n}\nexport function DocumentSpecificationSchema() {\n return z.object({\n __typename: z.literal(\"DocumentSpecification\").optional(),\n changeLog: z.array(z.string()),\n modules: z.array(ModuleSchema()),\n state: ScopeStateSchema(),\n version: z.number(),\n });\n}\nexport function ModuleSchema() {\n return z.object({\n __typename: z.literal(\"Module\").optional(),\n description: z.string().nullable(),\n id: z.string(),\n name: z.string(),\n operations: z.array(OperationSchema()),\n });\n}\nexport function MoveOperationInputSchema() {\n return z.object({\n newModuleId: z.string(),\n operationId: z.string(),\n });\n}\nexport function OperationSchema() {\n return z.object({\n __typename: z.literal(\"Operation\").optional(),\n description: z.string().nullable(),\n errors: z.array(OperationErrorSchema()),\n examples: z.array(CodeExampleSchema()),\n id: z.string(),\n name: z.string().nullable(),\n reducer: z.string().nullable(),\n schema: z.string().nullable(),\n template: z.string().nullable(),\n scope: OperationScopeSchema(),\n });\n}\nexport function OperationErrorSchema() {\n return z.object({\n __typename: z.literal(\"OperationError\").optional(),\n code: z.string().nullable(),\n description: z.string().nullable(),\n id: z.string(),\n name: z.string().nullable(),\n template: z.string().nullable(),\n });\n}\nexport function ReorderChangeLogItemsInputSchema() {\n return z.object({\n __typename: z.literal(\"ReorderChangeLogItemsInput\").optional(),\n order: z.array(z.string()),\n });\n}\nexport function ReorderModuleOperationsInputSchema() {\n return z.object({\n moduleId: z.string(),\n order: z.array(z.string()),\n });\n}\nexport function ReorderModulesInputSchema() {\n return z.object({\n order: z.array(z.string()),\n });\n}\nexport function ReorderOperationErrorsInputSchema() {\n return z.object({\n operationId: z.string(),\n order: z.array(z.string()),\n });\n}\nexport function ReorderOperationExamplesInputSchema() {\n return z.object({\n operationId: z.string(),\n order: z.array(z.string()),\n });\n}\nexport function ReorderStateExamplesInputSchema() {\n return z.object({\n scope: z.string(),\n order: z.array(z.string()),\n });\n}\nexport function SetAuthorNameInputSchema() {\n return z.object({\n authorName: z.string(),\n });\n}\nexport function SetAuthorWebsiteInputSchema() {\n return z.object({\n authorWebsite: z.string(),\n });\n}\nexport function SetInitialStateInputSchema() {\n return z.object({\n scope: z.string(),\n initialValue: z.string(),\n });\n}\nexport function SetModelDescriptionInputSchema() {\n return z.object({\n description: z.string(),\n });\n}\nexport function SetModelExtensionInputSchema() {\n return z.object({\n extension: z.string(),\n });\n}\nexport function SetModelIdInputSchema() {\n return z.object({\n id: z.string(),\n });\n}\nexport function SetModelNameInputSchema() {\n return z.object({\n name: z.string(),\n });\n}\nexport function SetModuleDescriptionInputSchema() {\n return z.object({\n description: z.string().nullish(),\n id: z.string(),\n });\n}\nexport function SetModuleNameInputSchema() {\n return z.object({\n id: z.string(),\n name: z.string().nullish(),\n });\n}\nexport function SetOperationDescriptionInputSchema() {\n return z.object({\n description: z.string().nullish(),\n id: z.string(),\n });\n}\nexport function SetOperationErrorCodeInputSchema() {\n return z.object({\n errorCode: z.string().nullish(),\n id: z.string(),\n });\n}\nexport function SetOperationErrorDescriptionInputSchema() {\n return z.object({\n errorDescription: z.string().nullish(),\n id: z.string(),\n });\n}\nexport function SetOperationErrorNameInputSchema() {\n return z.object({\n errorName: z.string().nullish(),\n id: z.string(),\n });\n}\nexport function SetOperationErrorTemplateInputSchema() {\n return z.object({\n errorTemplate: z.string().nullish(),\n id: z.string(),\n });\n}\nexport function SetOperationNameInputSchema() {\n return z.object({\n id: z.string(),\n name: z.string().nullish(),\n });\n}\nexport function SetOperationScopeInputSchema() {\n return z.object({\n id: z.string(),\n scope: OperationScopeSchema(),\n });\n}\nexport function SetOperationReducerInputSchema() {\n return z.object({\n id: z.string(),\n reducer: z.string().nullish(),\n });\n}\nexport function SetOperationSchemaInputSchema() {\n return z.object({\n id: z.string(),\n schema: z.string().nullish(),\n });\n}\nexport function SetOperationTemplateInputSchema() {\n return z.object({\n id: z.string(),\n template: z.string().nullish(),\n });\n}\nexport function SetStateSchemaInputSchema() {\n return z.object({\n scope: z.string(),\n schema: z.string(),\n });\n}\nexport function StateSchema() {\n return z.object({\n __typename: z.literal(\"State\").optional(),\n examples: z.array(CodeExampleSchema()),\n initialValue: z.string(),\n schema: z.string(),\n });\n}\nexport function ScopeStateSchema() {\n return z.object({\n global: StateSchema(),\n local: StateSchema(),\n });\n}\nexport function UpdateChangeLogItemInputSchema() {\n return z.object({\n __typename: z.literal(\"UpdateChangeLogItemInput\").optional(),\n id: z.string(),\n newContent: z.string(),\n });\n}\nexport function UpdateOperationExampleInputSchema() {\n return z.object({\n example: z.string(),\n id: z.string(),\n });\n}\nexport function UpdateStateExampleInputSchema() {\n return z.object({\n scope: z.string(),\n id: z.string(),\n newExample: z.string(),\n });\n}\n//# sourceMappingURL=zod.js.map","import { createAction } from \"../../../document/utils/base.js\";\nimport { z, } from \"../schema/index.js\";\nexport const setModelName = (input) => createAction(\"SET_MODEL_NAME\", { ...input }, undefined, z.SetModelNameInputSchema, \"global\");\nexport const setModelId = (input) => createAction(\"SET_MODEL_ID\", { ...input }, undefined, z.SetModelIdInputSchema, \"global\");\nexport const setModelExtension = (input) => createAction(\"SET_MODEL_EXTENSION\", { ...input }, undefined, z.SetModelExtensionInputSchema, \"global\");\nexport const setModelDescription = (input) => createAction(\"SET_MODEL_DESCRIPTION\", { ...input }, undefined, z.SetModelDescriptionInputSchema, \"global\");\nexport const setAuthorName = (input) => createAction(\"SET_AUTHOR_NAME\", { ...input }, undefined, z.SetAuthorNameInputSchema, \"global\");\nexport const setAuthorWebsite = (input) => createAction(\"SET_AUTHOR_WEBSITE\", { ...input }, undefined, z.SetAuthorWebsiteInputSchema, \"global\");\n//# sourceMappingURL=creators.js.map","import { createAction } from \"../../../document/utils/base.js\";\nimport { z, } from \"../schema/index.js\";\nexport const addModule = (input) => createAction(\"ADD_MODULE\", { ...input }, undefined, z.AddModuleInputSchema, \"global\");\nexport const setModuleName = (input) => createAction(\"SET_MODULE_NAME\", { ...input }, undefined, z.SetModuleNameInputSchema, \"global\");\nexport const setModuleDescription = (input) => createAction(\"SET_MODULE_DESCRIPTION\", { ...input }, undefined, z.SetModuleDescriptionInputSchema, \"global\");\nexport const deleteModule = (input) => createAction(\"DELETE_MODULE\", { ...input }, undefined, z.DeleteModuleInputSchema, \"global\");\nexport const reorderModules = (input) => createAction(\"REORDER_MODULES\", { ...input }, undefined, z.ReorderModulesInputSchema, \"global\");\n//# sourceMappingURL=creators.js.map","import { createAction } from \"../../../document/utils/base.js\";\nimport { z, } from \"../schema/index.js\";\nexport const addOperationError = (input) => createAction(\"ADD_OPERATION_ERROR\", { ...input }, undefined, z.AddOperationErrorInputSchema, \"global\");\nexport const setOperationErrorCode = (input) => createAction(\"SET_OPERATION_ERROR_CODE\", { ...input }, undefined, z.SetOperationErrorCodeInputSchema, \"global\");\nexport const setOperationErrorName = (input) => createAction(\"SET_OPERATION_ERROR_NAME\", { ...input }, undefined, z.SetOperationErrorNameInputSchema, \"global\");\nexport const setOperationErrorDescription = (input) => createAction(\"SET_OPERATION_ERROR_DESCRIPTION\", { ...input }, undefined, z.SetOperationErrorDescriptionInputSchema, \"global\");\nexport const setOperationErrorTemplate = (input) => createAction(\"SET_OPERATION_ERROR_TEMPLATE\", { ...input }, undefined, z.SetOperationErrorTemplateInputSchema, \"global\");\nexport const deleteOperationError = (input) => createAction(\"DELETE_OPERATION_ERROR\", { ...input }, undefined, z.DeleteOperationErrorInputSchema, \"global\");\nexport const reorderOperationErrors = (input) => createAction(\"REORDER_OPERATION_ERRORS\", { ...input }, undefined, z.ReorderOperationErrorsInputSchema, \"global\");\n//# sourceMappingURL=creators.js.map","import { createAction } from \"../../../document/utils/base.js\";\nimport { z, } from \"../schema/index.js\";\nexport const addOperation = (input) => createAction(\"ADD_OPERATION\", { ...input }, undefined, z.AddOperationInputSchema, \"global\");\nexport const setOperationName = (input) => createAction(\"SET_OPERATION_NAME\", { ...input }, undefined, z.SetOperationNameInputSchema, \"global\");\nexport const setOperationScope = (input) => createAction(\"SET_OPERATION_SCOPE\", { ...input }, undefined, z.SetOperationScopeInputSchema, \"global\");\nexport const setOperationSchema = (input) => createAction(\"SET_OPERATION_SCHEMA\", { ...input }, undefined, z.SetOperationSchemaInputSchema, \"global\");\nexport const setOperationDescription = (input) => createAction(\"SET_OPERATION_DESCRIPTION\", { ...input }, undefined, z.SetOperationDescriptionInputSchema, \"global\");\nexport const setOperationTemplate = (input) => createAction(\"SET_OPERATION_TEMPLATE\", { ...input }, undefined, z.SetOperationTemplateInputSchema, \"global\");\nexport const setOperationReducer = (input) => createAction(\"SET_OPERATION_REDUCER\", { ...input }, undefined, z.SetOperationReducerInputSchema, \"global\");\nexport const moveOperation = (input) => createAction(\"MOVE_OPERATION\", { ...input }, undefined, z.MoveOperationInputSchema, \"global\");\nexport const deleteOperation = (input) => createAction(\"DELETE_OPERATION\", { ...input }, undefined, z.DeleteOperationInputSchema, \"global\");\nexport const reorderModuleOperations = (input) => createAction(\"REORDER_MODULE_OPERATIONS\", { ...input }, undefined, z.ReorderModuleOperationsInputSchema, \"global\");\n//# sourceMappingURL=creators.js.map","import { createAction } from \"../../../document/utils/base.js\";\nimport { z, } from \"../schema/index.js\";\nexport const setStateSchema = (input) => createAction(\"SET_STATE_SCHEMA\", { ...input }, undefined, z.SetStateSchemaInputSchema, \"global\");\nexport const setInitialState = (input) => createAction(\"SET_INITIAL_STATE\", { ...input }, undefined, z.SetInitialStateInputSchema, \"global\");\nexport const addStateExample = (input) => createAction(\"ADD_STATE_EXAMPLE\", { ...input }, undefined, z.AddStateExampleInputSchema, \"global\");\nexport const updateStateExample = (input) => createAction(\"UPDATE_STATE_EXAMPLE\", { ...input }, undefined, z.UpdateStateExampleInputSchema, \"global\");\nexport const deleteStateExample = (input) => createAction(\"DELETE_STATE_EXAMPLE\", { ...input }, undefined, z.DeleteStateExampleInputSchema, \"global\");\nexport const reorderStateExamples = (input) => createAction(\"REORDER_STATE_EXAMPLES\", { ...input }, undefined, z.ReorderStateExamplesInputSchema, \"global\");\n//# sourceMappingURL=creators.js.map"],"names":["isDefinedNonNullAny","v","z\n .any","AddChangeLogItemInputSchema","z.object","z.literal","z.string","AddModuleInputSchema","AddOperationErrorInputSchema","AddOperationExampleInputSchema","AddOperationInputSchema","OperationScopeSchema","AddStateExampleInputSchema","DeleteChangeLogItemInputSchema","DeleteModuleInputSchema","DeleteOperationErrorInputSchema","DeleteOperationExampleInputSchema","DeleteOperationInputSchema","DeleteStateExampleInputSchema","MoveOperationInputSchema","ReorderChangeLogItemsInputSchema","z.array","ReorderModuleOperationsInputSchema","ReorderModulesInputSchema","ReorderOperationErrorsInputSchema","ReorderOperationExamplesInputSchema","ReorderStateExamplesInputSchema","SetAuthorNameInputSchema","SetAuthorWebsiteInputSchema","SetInitialStateInputSchema","SetModelDescriptionInputSchema","SetModelExtensionInputSchema","SetModelIdInputSchema","SetModelNameInputSchema","SetModuleDescriptionInputSchema","SetModuleNameInputSchema","SetOperationDescriptionInputSchema","SetOperationErrorCodeInputSchema","SetOperationErrorDescriptionInputSchema","SetOperationErrorNameInputSchema","SetOperationErrorTemplateInputSchema","SetOperationNameInputSchema","SetOperationScopeInputSchema","SetOperationReducerInputSchema","SetOperationSchemaInputSchema","SetOperationTemplateInputSchema","SetStateSchemaInputSchema","UpdateChangeLogItemInputSchema","UpdateOperationExampleInputSchema","UpdateStateExampleInputSchema","setModelName","input","createAction","z.SetModelNameInputSchema","setModelId","z.SetModelIdInputSchema","setModelExtension","z.SetModelExtensionInputSchema","setModelDescription","z.SetModelDescriptionInputSchema","setAuthorName","z.SetAuthorNameInputSchema","setAuthorWebsite","z.SetAuthorWebsiteInputSchema","addModule","z.AddModuleInputSchema","setModuleName","z.SetModuleNameInputSchema","setModuleDescription","z.SetModuleDescriptionInputSchema","deleteModule","z.DeleteModuleInputSchema","reorderModules","z.ReorderModulesInputSchema","addOperationError","z.AddOperationErrorInputSchema","setOperationErrorCode","z.SetOperationErrorCodeInputSchema","setOperationErrorName","z.SetOperationErrorNameInputSchema","setOperationErrorDescription","z.SetOperationErrorDescriptionInputSchema","setOperationErrorTemplate","z.SetOperationErrorTemplateInputSchema","deleteOperationError","z.DeleteOperationErrorInputSchema","reorderOperationErrors","z.ReorderOperationErrorsInputSchema","addOperation","z.AddOperationInputSchema","setOperationName","z.SetOperationNameInputSchema","setOperationScope","z.SetOperationScopeInputSchema","setOperationSchema","z.SetOperationSchemaInputSchema","setOperationDescription","z.SetOperationDescriptionInputSchema","setOperationTemplate","z.SetOperationTemplateInputSchema","setOperationReducer","z.SetOperationReducerInputSchema","moveOperation","z.MoveOperationInputSchema","deleteOperation","z.DeleteOperationInputSchema","reorderModuleOperations","z.ReorderModuleOperationsInputSchema","setStateSchema","z.SetStateSchemaInputSchema","setInitialState","z.SetInitialStateInputSchema","addStateExample","z.AddStateExampleInputSchema","updateStateExample","z.UpdateStateExampleInputSchema","deleteStateExample","z.DeleteStateExampleInputSchema","reorderStateExamples","z.ReorderStateExamplesInputSchema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AW4D,EAA8B,QAAQ,EAC9HC,GAAmB7D,GAAUC,EAAa,oBAAqB,CAAE,GAAGD,CAAK,EAAI,OAAW8D,EAA8B,QAAQ,EAC9HC,GAAsB/D,GAAUC,EAAa,uBAAwB,CAAE,GAAGD,CAAK,EAAI,OAAWgE,EAAiC,QAAQ,EACvIC,GAAsBjE,GAAUC,EAAa,uBAAwB,CAAE,GAAGD,CAAK,EAAI,OAAWkE,EAAiC,QAAQ,EACvIC,GAAwBnE,GAAUC,EAAa,yBAA0B,CAAE,GAAGD,CAAK,EAAI,OAAWoE,EAAmC,QAAQ"}
|
|
1
|
+
{"version":3,"file":"creators.CjFm02Wg.js","sources":["../../../../packages/document-model/dist/src/document-model/gen/schema/zod.js","../../../../packages/document-model/dist/src/document-model/gen/header/creators.js","../../../../packages/document-model/dist/src/document-model/gen/module/creators.js","../../../../packages/document-model/dist/src/document-model/gen/operation-error/creators.js","../../../../packages/document-model/dist/src/document-model/gen/operation/creators.js","../../../../packages/document-model/dist/src/document-model/gen/state/creators.js"],"sourcesContent":["import { z } from \"zod\";\nexport const isDefinedNonNullAny = (v) => v !== undefined && v !== null;\nexport const definedNonNullAnySchema = z\n .any()\n .refine((v) => isDefinedNonNullAny(v));\nexport function AddChangeLogItemInputSchema() {\n return z.object({\n __typename: z.literal(\"AddChangeLogItemInput\").optional(),\n content: z.string(),\n id: z.string(),\n insertBefore: z.string().nullable(),\n });\n}\nexport function AddModuleInputSchema() {\n return z.object({\n description: z.string().nullish(),\n id: z.string(),\n name: z.string(),\n });\n}\nexport function AddOperationErrorInputSchema() {\n return z.object({\n errorCode: z.string().nullish(),\n errorDescription: z.string().nullish(),\n errorName: z.string().nullish(),\n errorTemplate: z.string().nullish(),\n id: z.string(),\n operationId: z.string(),\n });\n}\nexport function AddOperationExampleInputSchema() {\n return z.object({\n example: z.string(),\n id: z.string(),\n operationId: z.string(),\n });\n}\nexport function AddOperationInputSchema() {\n return z.object({\n description: z.string().nullish(),\n id: z.string(),\n moduleId: z.string(),\n name: z.string(),\n reducer: z.string().nullish(),\n schema: z.string().nullish(),\n template: z.string().nullish(),\n scope: OperationScopeSchema().nullish(),\n });\n}\nexport function AddStateExampleInputSchema() {\n return z.object({\n scope: z.string(),\n example: z.string(),\n id: z.string(),\n insertBefore: z.string().nullish(),\n });\n}\nexport function AuthorSchema() {\n return z.object({\n __typename: z.literal(\"Author\").optional(),\n name: z.string(),\n website: z.string().nullable(),\n });\n}\nexport function CodeExampleSchema() {\n return z.object({\n __typename: z.literal(\"CodeExample\").optional(),\n id: z.string(),\n value: z.string(),\n });\n}\nexport function DeleteChangeLogItemInputSchema() {\n return z.object({\n __typename: z.literal(\"DeleteChangeLogItemInput\").optional(),\n id: z.string(),\n });\n}\nexport function DeleteModuleInputSchema() {\n return z.object({\n id: z.string(),\n });\n}\nexport function DeleteOperationErrorInputSchema() {\n return z.object({\n id: z.string(),\n });\n}\nexport function DeleteOperationExampleInputSchema() {\n return z.object({\n id: z.string(),\n });\n}\nexport function DeleteOperationInputSchema() {\n return z.object({\n id: z.string(),\n });\n}\nexport function DeleteStateExampleInputSchema() {\n return z.object({\n scope: z.string(),\n id: z.string(),\n });\n}\nexport function OperationScopeSchema() {\n return z.string();\n}\nexport function DocumentModelInputSchema() {\n return z.union([\n AddChangeLogItemInputSchema(),\n AddModuleInputSchema(),\n AddOperationErrorInputSchema(),\n AddOperationExampleInputSchema(),\n AddOperationInputSchema(),\n AddStateExampleInputSchema(),\n DeleteChangeLogItemInputSchema(),\n DeleteModuleInputSchema(),\n DeleteOperationErrorInputSchema(),\n DeleteOperationExampleInputSchema(),\n DeleteOperationInputSchema(),\n DeleteStateExampleInputSchema(),\n MoveOperationInputSchema(),\n ReorderChangeLogItemsInputSchema(),\n ReorderModuleOperationsInputSchema(),\n ReorderModulesInputSchema(),\n ReorderOperationErrorsInputSchema(),\n ReorderOperationExamplesInputSchema(),\n ReorderStateExamplesInputSchema(),\n SetAuthorNameInputSchema(),\n SetAuthorWebsiteInputSchema(),\n SetInitialStateInputSchema(),\n SetModelDescriptionInputSchema(),\n SetModelExtensionInputSchema(),\n SetModelIdInputSchema(),\n SetModelNameInputSchema(),\n SetModuleDescriptionInputSchema(),\n SetModuleNameInputSchema(),\n SetOperationDescriptionInputSchema(),\n SetOperationErrorCodeInputSchema(),\n SetOperationErrorDescriptionInputSchema(),\n SetOperationErrorNameInputSchema(),\n SetOperationErrorTemplateInputSchema(),\n SetOperationNameInputSchema(),\n SetOperationReducerInputSchema(),\n SetOperationSchemaInputSchema(),\n SetOperationTemplateInputSchema(),\n SetStateSchemaInputSchema(),\n UpdateChangeLogItemInputSchema(),\n UpdateOperationExampleInputSchema(),\n UpdateStateExampleInputSchema(),\n ]);\n}\nexport function DocumentModelStateSchema() {\n return z.object({\n __typename: z.literal(\"DocumentModelState\").optional(),\n author: AuthorSchema(),\n description: z.string(),\n extension: z.string(),\n id: z.string(),\n name: z.string(),\n specifications: z.array(DocumentSpecificationSchema()),\n });\n}\nexport function DocumentSpecificationSchema() {\n return z.object({\n __typename: z.literal(\"DocumentSpecification\").optional(),\n changeLog: z.array(z.string()),\n modules: z.array(ModuleSchema()),\n state: ScopeStateSchema(),\n version: z.number(),\n });\n}\nexport function ModuleSchema() {\n return z.object({\n __typename: z.literal(\"Module\").optional(),\n description: z.string().nullable(),\n id: z.string(),\n name: z.string(),\n operations: z.array(OperationSchema()),\n });\n}\nexport function MoveOperationInputSchema() {\n return z.object({\n newModuleId: z.string(),\n operationId: z.string(),\n });\n}\nexport function OperationSchema() {\n return z.object({\n __typename: z.literal(\"Operation\").optional(),\n description: z.string().nullable(),\n errors: z.array(OperationErrorSchema()),\n examples: z.array(CodeExampleSchema()),\n id: z.string(),\n name: z.string().nullable(),\n reducer: z.string().nullable(),\n schema: z.string().nullable(),\n template: z.string().nullable(),\n scope: OperationScopeSchema(),\n });\n}\nexport function OperationErrorSchema() {\n return z.object({\n __typename: z.literal(\"OperationError\").optional(),\n code: z.string().nullable(),\n description: z.string().nullable(),\n id: z.string(),\n name: z.string().nullable(),\n template: z.string().nullable(),\n });\n}\nexport function ReorderChangeLogItemsInputSchema() {\n return z.object({\n __typename: z.literal(\"ReorderChangeLogItemsInput\").optional(),\n order: z.array(z.string()),\n });\n}\nexport function ReorderModuleOperationsInputSchema() {\n return z.object({\n moduleId: z.string(),\n order: z.array(z.string()),\n });\n}\nexport function ReorderModulesInputSchema() {\n return z.object({\n order: z.array(z.string()),\n });\n}\nexport function ReorderOperationErrorsInputSchema() {\n return z.object({\n operationId: z.string(),\n order: z.array(z.string()),\n });\n}\nexport function ReorderOperationExamplesInputSchema() {\n return z.object({\n operationId: z.string(),\n order: z.array(z.string()),\n });\n}\nexport function ReorderStateExamplesInputSchema() {\n return z.object({\n scope: z.string(),\n order: z.array(z.string()),\n });\n}\nexport function SetAuthorNameInputSchema() {\n return z.object({\n authorName: z.string(),\n });\n}\nexport function SetAuthorWebsiteInputSchema() {\n return z.object({\n authorWebsite: z.string(),\n });\n}\nexport function SetInitialStateInputSchema() {\n return z.object({\n scope: z.string(),\n initialValue: z.string(),\n });\n}\nexport function SetModelDescriptionInputSchema() {\n return z.object({\n description: z.string(),\n });\n}\nexport function SetModelExtensionInputSchema() {\n return z.object({\n extension: z.string(),\n });\n}\nexport function SetModelIdInputSchema() {\n return z.object({\n id: z.string(),\n });\n}\nexport function SetModelNameInputSchema() {\n return z.object({\n name: z.string(),\n });\n}\nexport function SetModuleDescriptionInputSchema() {\n return z.object({\n description: z.string().nullish(),\n id: z.string(),\n });\n}\nexport function SetModuleNameInputSchema() {\n return z.object({\n id: z.string(),\n name: z.string().nullish(),\n });\n}\nexport function SetOperationDescriptionInputSchema() {\n return z.object({\n description: z.string().nullish(),\n id: z.string(),\n });\n}\nexport function SetOperationErrorCodeInputSchema() {\n return z.object({\n errorCode: z.string().nullish(),\n id: z.string(),\n });\n}\nexport function SetOperationErrorDescriptionInputSchema() {\n return z.object({\n errorDescription: z.string().nullish(),\n id: z.string(),\n });\n}\nexport function SetOperationErrorNameInputSchema() {\n return z.object({\n errorName: z.string().nullish(),\n id: z.string(),\n });\n}\nexport function SetOperationErrorTemplateInputSchema() {\n return z.object({\n errorTemplate: z.string().nullish(),\n id: z.string(),\n });\n}\nexport function SetOperationNameInputSchema() {\n return z.object({\n id: z.string(),\n name: z.string().nullish(),\n });\n}\nexport function SetOperationScopeInputSchema() {\n return z.object({\n id: z.string(),\n scope: OperationScopeSchema(),\n });\n}\nexport function SetOperationReducerInputSchema() {\n return z.object({\n id: z.string(),\n reducer: z.string().nullish(),\n });\n}\nexport function SetOperationSchemaInputSchema() {\n return z.object({\n id: z.string(),\n schema: z.string().nullish(),\n });\n}\nexport function SetOperationTemplateInputSchema() {\n return z.object({\n id: z.string(),\n template: z.string().nullish(),\n });\n}\nexport function SetStateSchemaInputSchema() {\n return z.object({\n scope: z.string(),\n schema: z.string(),\n });\n}\nexport function StateSchema() {\n return z.object({\n __typename: z.literal(\"State\").optional(),\n examples: z.array(CodeExampleSchema()),\n initialValue: z.string(),\n schema: z.string(),\n });\n}\nexport function ScopeStateSchema() {\n return z.object({\n global: StateSchema(),\n local: StateSchema(),\n });\n}\nexport function UpdateChangeLogItemInputSchema() {\n return z.object({\n __typename: z.literal(\"UpdateChangeLogItemInput\").optional(),\n id: z.string(),\n newContent: z.string(),\n });\n}\nexport function UpdateOperationExampleInputSchema() {\n return z.object({\n example: z.string(),\n id: z.string(),\n });\n}\nexport function UpdateStateExampleInputSchema() {\n return z.object({\n scope: z.string(),\n id: z.string(),\n newExample: z.string(),\n });\n}\n//# sourceMappingURL=zod.js.map","import { createAction } from \"../../../document/utils/base.js\";\nimport { z, } from \"../schema/index.js\";\nexport const setModelName = (input) => createAction(\"SET_MODEL_NAME\", { ...input }, undefined, z.SetModelNameInputSchema, \"global\");\nexport const setModelId = (input) => createAction(\"SET_MODEL_ID\", { ...input }, undefined, z.SetModelIdInputSchema, \"global\");\nexport const setModelExtension = (input) => createAction(\"SET_MODEL_EXTENSION\", { ...input }, undefined, z.SetModelExtensionInputSchema, \"global\");\nexport const setModelDescription = (input) => createAction(\"SET_MODEL_DESCRIPTION\", { ...input }, undefined, z.SetModelDescriptionInputSchema, \"global\");\nexport const setAuthorName = (input) => createAction(\"SET_AUTHOR_NAME\", { ...input }, undefined, z.SetAuthorNameInputSchema, \"global\");\nexport const setAuthorWebsite = (input) => createAction(\"SET_AUTHOR_WEBSITE\", { ...input }, undefined, z.SetAuthorWebsiteInputSchema, \"global\");\n//# sourceMappingURL=creators.js.map","import { createAction } from \"../../../document/utils/base.js\";\nimport { z, } from \"../schema/index.js\";\nexport const addModule = (input) => createAction(\"ADD_MODULE\", { ...input }, undefined, z.AddModuleInputSchema, \"global\");\nexport const setModuleName = (input) => createAction(\"SET_MODULE_NAME\", { ...input }, undefined, z.SetModuleNameInputSchema, \"global\");\nexport const setModuleDescription = (input) => createAction(\"SET_MODULE_DESCRIPTION\", { ...input }, undefined, z.SetModuleDescriptionInputSchema, \"global\");\nexport const deleteModule = (input) => createAction(\"DELETE_MODULE\", { ...input }, undefined, z.DeleteModuleInputSchema, \"global\");\nexport const reorderModules = (input) => createAction(\"REORDER_MODULES\", { ...input }, undefined, z.ReorderModulesInputSchema, \"global\");\n//# sourceMappingURL=creators.js.map","import { createAction } from \"../../../document/utils/base.js\";\nimport { z, } from \"../schema/index.js\";\nexport const addOperationError = (input) => createAction(\"ADD_OPERATION_ERROR\", { ...input }, undefined, z.AddOperationErrorInputSchema, \"global\");\nexport const setOperationErrorCode = (input) => createAction(\"SET_OPERATION_ERROR_CODE\", { ...input }, undefined, z.SetOperationErrorCodeInputSchema, \"global\");\nexport const setOperationErrorName = (input) => createAction(\"SET_OPERATION_ERROR_NAME\", { ...input }, undefined, z.SetOperationErrorNameInputSchema, \"global\");\nexport const setOperationErrorDescription = (input) => createAction(\"SET_OPERATION_ERROR_DESCRIPTION\", { ...input }, undefined, z.SetOperationErrorDescriptionInputSchema, \"global\");\nexport const setOperationErrorTemplate = (input) => createAction(\"SET_OPERATION_ERROR_TEMPLATE\", { ...input }, undefined, z.SetOperationErrorTemplateInputSchema, \"global\");\nexport const deleteOperationError = (input) => createAction(\"DELETE_OPERATION_ERROR\", { ...input }, undefined, z.DeleteOperationErrorInputSchema, \"global\");\nexport const reorderOperationErrors = (input) => createAction(\"REORDER_OPERATION_ERRORS\", { ...input }, undefined, z.ReorderOperationErrorsInputSchema, \"global\");\n//# sourceMappingURL=creators.js.map","import { createAction } from \"../../../document/utils/base.js\";\nimport { z, } from \"../schema/index.js\";\nexport const addOperation = (input) => createAction(\"ADD_OPERATION\", { ...input }, undefined, z.AddOperationInputSchema, \"global\");\nexport const setOperationName = (input) => createAction(\"SET_OPERATION_NAME\", { ...input }, undefined, z.SetOperationNameInputSchema, \"global\");\nexport const setOperationScope = (input) => createAction(\"SET_OPERATION_SCOPE\", { ...input }, undefined, z.SetOperationScopeInputSchema, \"global\");\nexport const setOperationSchema = (input) => createAction(\"SET_OPERATION_SCHEMA\", { ...input }, undefined, z.SetOperationSchemaInputSchema, \"global\");\nexport const setOperationDescription = (input) => createAction(\"SET_OPERATION_DESCRIPTION\", { ...input }, undefined, z.SetOperationDescriptionInputSchema, \"global\");\nexport const setOperationTemplate = (input) => createAction(\"SET_OPERATION_TEMPLATE\", { ...input }, undefined, z.SetOperationTemplateInputSchema, \"global\");\nexport const setOperationReducer = (input) => createAction(\"SET_OPERATION_REDUCER\", { ...input }, undefined, z.SetOperationReducerInputSchema, \"global\");\nexport const moveOperation = (input) => createAction(\"MOVE_OPERATION\", { ...input }, undefined, z.MoveOperationInputSchema, \"global\");\nexport const deleteOperation = (input) => createAction(\"DELETE_OPERATION\", { ...input }, undefined, z.DeleteOperationInputSchema, \"global\");\nexport const reorderModuleOperations = (input) => createAction(\"REORDER_MODULE_OPERATIONS\", { ...input }, undefined, z.ReorderModuleOperationsInputSchema, \"global\");\n//# sourceMappingURL=creators.js.map","import { createAction } from \"../../../document/utils/base.js\";\nimport { z, } from \"../schema/index.js\";\nexport const setStateSchema = (input) => createAction(\"SET_STATE_SCHEMA\", { ...input }, undefined, z.SetStateSchemaInputSchema, \"global\");\nexport const setInitialState = (input) => createAction(\"SET_INITIAL_STATE\", { ...input }, undefined, z.SetInitialStateInputSchema, \"global\");\nexport const addStateExample = (input) => createAction(\"ADD_STATE_EXAMPLE\", { ...input }, undefined, z.AddStateExampleInputSchema, \"global\");\nexport const updateStateExample = (input) => createAction(\"UPDATE_STATE_EXAMPLE\", { ...input }, undefined, z.UpdateStateExampleInputSchema, \"global\");\nexport const deleteStateExample = (input) => createAction(\"DELETE_STATE_EXAMPLE\", { ...input }, undefined, z.DeleteStateExampleInputSchema, \"global\");\nexport const reorderStateExamples = (input) => createAction(\"REORDER_STATE_EXAMPLES\", { ...input }, undefined, z.ReorderStateExamplesInputSchema, \"global\");\n//# sourceMappingURL=creators.js.map"],"names":["isDefinedNonNullAny","v","z\n .any","AddChangeLogItemInputSchema","z.object","z.literal","z.string","AddModuleInputSchema","AddOperationErrorInputSchema","AddOperationExampleInputSchema","AddOperationInputSchema","OperationScopeSchema","AddStateExampleInputSchema","DeleteChangeLogItemInputSchema","DeleteModuleInputSchema","DeleteOperationErrorInputSchema","DeleteOperationExampleInputSchema","DeleteOperationInputSchema","DeleteStateExampleInputSchema","MoveOperationInputSchema","ReorderChangeLogItemsInputSchema","z.array","ReorderModuleOperationsInputSchema","ReorderModulesInputSchema","ReorderOperationErrorsInputSchema","ReorderOperationExamplesInputSchema","ReorderStateExamplesInputSchema","SetAuthorNameInputSchema","SetAuthorWebsiteInputSchema","SetInitialStateInputSchema","SetModelDescriptionInputSchema","SetModelExtensionInputSchema","SetModelIdInputSchema","SetModelNameInputSchema","SetModuleDescriptionInputSchema","SetModuleNameInputSchema","SetOperationDescriptionInputSchema","SetOperationErrorCodeInputSchema","SetOperationErrorDescriptionInputSchema","SetOperationErrorNameInputSchema","SetOperationErrorTemplateInputSchema","SetOperationNameInputSchema","SetOperationScopeInputSchema","SetOperationReducerInputSchema","SetOperationSchemaInputSchema","SetOperationTemplateInputSchema","SetStateSchemaInputSchema","UpdateChangeLogItemInputSchema","UpdateOperationExampleInputSchema","UpdateStateExampleInputSchema","setModelName","input","createAction","z.SetModelNameInputSchema","setModelId","z.SetModelIdInputSchema","setModelExtension","z.SetModelExtensionInputSchema","setModelDescription","z.SetModelDescriptionInputSchema","setAuthorName","z.SetAuthorNameInputSchema","setAuthorWebsite","z.SetAuthorWebsiteInputSchema","addModule","z.AddModuleInputSchema","setModuleName","z.SetModuleNameInputSchema","setModuleDescription","z.SetModuleDescriptionInputSchema","deleteModule","z.DeleteModuleInputSchema","reorderModules","z.ReorderModulesInputSchema","addOperationError","z.AddOperationErrorInputSchema","setOperationErrorCode","z.SetOperationErrorCodeInputSchema","setOperationErrorName","z.SetOperationErrorNameInputSchema","setOperationErrorDescription","z.SetOperationErrorDescriptionInputSchema","setOperationErrorTemplate","z.SetOperationErrorTemplateInputSchema","deleteOperationError","z.DeleteOperationErrorInputSchema","reorderOperationErrors","z.ReorderOperationErrorsInputSchema","addOperation","z.AddOperationInputSchema","setOperationName","z.SetOperationNameInputSchema","setOperationScope","z.SetOperationScopeInputSchema","setOperationSchema","z.SetOperationSchemaInputSchema","setOperationDescription","z.SetOperationDescriptionInputSchema","setOperationTemplate","z.SetOperationTemplateInputSchema","setOperationReducer","z.SetOperationReducerInputSchema","moveOperation","z.MoveOperationInputSchema","deleteOperation","z.DeleteOperationInputSchema","reorderModuleOperations","z.ReorderModuleOperationsInputSchema","setStateSchema","z.SetStateSchemaInputSchema","setInitialState","z.SetInitialStateInputSchema","addStateExample","z.AddStateExampleInputSchema","updateStateExample","z.UpdateStateExampleInputSchema","deleteStateExample","z.DeleteStateExampleInputSchema","reorderStateExamples","z.ReorderStateExamplesInputSchema"],"mappings":"gFACO,MAAMA,EAAuBC,GAAyBA,GAAM,KAC5BC,EAC/B,EACH,OAAQD,GAAMD,EAAoBC,CAAC,CAAC,EAClC,SAASE,GAA8B,CAC1C,OAAOC,EAAS,CACZ,WAA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AE,GAAGD,CAAK,EAAI,OAAWgE,EAAiC,QAAQ,EACvIC,GAAsBjE,GAAUC,EAAa,uBAAwB,CAAE,GAAGD,CAAK,EAAI,OAAWkE,EAAiC,QAAQ,EACvIC,GAAwBnE,GAAUC,EAAa,yBAA0B,CAAE,GAAGD,CAAK,EAAI,OAAWoE,EAAmC,QAAQ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Component as m,createElement as u,createContext as f}from"react";import{jsx as l}from"react/jsx-runtime";import{i as g,I as h}from"./main.
|
|
2
|
-
//# sourceMappingURL=drive-icon.
|
|
1
|
+
import{Component as m,createElement as u,createContext as f}from"react";import{jsx as l}from"react/jsx-runtime";import{i as g,I as h}from"./main.D9OoNJWh.js";const p=f(null),c={didCatch:!1,error:null};class B extends m{constructor(r){super(r),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=c}static getDerivedStateFromError(r){return{didCatch:!0,error:r}}resetErrorBoundary(){const{error:r}=this.state;if(r!==null){for(var e,t,n=arguments.length,a=new Array(n),o=0;o<n;o++)a[o]=arguments[o];(e=(t=this.props).onReset)===null||e===void 0||e.call(t,{args:a,reason:"imperative-api"}),this.setState(c)}}componentDidCatch(r,e){var t,n;(t=(n=this.props).onError)===null||t===void 0||t.call(n,r,e)}componentDidUpdate(r,e){const{didCatch:t}=this.state,{resetKeys:n}=this.props;if(t&&e.error!==null&&y(r.resetKeys,n)){var a,o;(a=(o=this.props).onReset)===null||a===void 0||a.call(o,{next:n,prev:r.resetKeys,reason:"keys"}),this.setState(c)}}render(){const{children:r,fallbackRender:e,FallbackComponent:t,fallback:n}=this.props,{didCatch:a,error:o}=this.state;let i=r;if(a){const d={error:o,resetErrorBoundary:this.resetErrorBoundary};if(typeof e=="function")i=e(d);else if(t)i=u(t,d);else if(n!==void 0)i=n;else throw o}return u(p.Provider,{value:{didCatch:a,error:o,resetErrorBoundary:this.resetErrorBoundary}},i)}}function y(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return s.length!==r.length||s.some((e,t)=>!Object.is(e,r[t]))}function b({drive:s}){const r=s?g(s):void 0,e=s==null?void 0:s.state.global.icon;return e?l("img",{src:e,alt:s.header.name,height:32,width:32}):r==="LOCAL"?l(h,{name:"Hdd",size:32}):l(h,{name:"Server",size:32})}export{b as D,B as E};
|
|
2
|
+
//# sourceMappingURL=drive-icon.BEe60eO5.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drive-icon.
|
|
1
|
+
{"version":3,"file":"drive-icon.BEe60eO5.js","sources":["../../../../node_modules/.pnpm/react-error-boundary@4.1.2_react@18.3.1/node_modules/react-error-boundary/dist/react-error-boundary.esm.js","../../src/components/drive-icon.tsx"],"sourcesContent":["'use client';\nimport { createContext, Component, createElement, useContext, useState, useMemo, forwardRef } from 'react';\n\nconst ErrorBoundaryContext = createContext(null);\n\nconst initialState = {\n didCatch: false,\n error: null\n};\nclass ErrorBoundary extends Component {\n constructor(props) {\n super(props);\n this.resetErrorBoundary = this.resetErrorBoundary.bind(this);\n this.state = initialState;\n }\n static getDerivedStateFromError(error) {\n return {\n didCatch: true,\n error\n };\n }\n resetErrorBoundary() {\n const {\n error\n } = this.state;\n if (error !== null) {\n var _this$props$onReset, _this$props;\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n (_this$props$onReset = (_this$props = this.props).onReset) === null || _this$props$onReset === void 0 ? void 0 : _this$props$onReset.call(_this$props, {\n args,\n reason: \"imperative-api\"\n });\n this.setState(initialState);\n }\n }\n componentDidCatch(error, info) {\n var _this$props$onError, _this$props2;\n (_this$props$onError = (_this$props2 = this.props).onError) === null || _this$props$onError === void 0 ? void 0 : _this$props$onError.call(_this$props2, error, info);\n }\n componentDidUpdate(prevProps, prevState) {\n const {\n didCatch\n } = this.state;\n const {\n resetKeys\n } = this.props;\n\n // There's an edge case where if the thing that triggered the error happens to *also* be in the resetKeys array,\n // we'd end up resetting the error boundary immediately.\n // This would likely trigger a second error to be thrown.\n // So we make sure that we don't check the resetKeys on the first call of cDU after the error is set.\n\n if (didCatch && prevState.error !== null && hasArrayChanged(prevProps.resetKeys, resetKeys)) {\n var _this$props$onReset2, _this$props3;\n (_this$props$onReset2 = (_this$props3 = this.props).onReset) === null || _this$props$onReset2 === void 0 ? void 0 : _this$props$onReset2.call(_this$props3, {\n next: resetKeys,\n prev: prevProps.resetKeys,\n reason: \"keys\"\n });\n this.setState(initialState);\n }\n }\n render() {\n const {\n children,\n fallbackRender,\n FallbackComponent,\n fallback\n } = this.props;\n const {\n didCatch,\n error\n } = this.state;\n let childToRender = children;\n if (didCatch) {\n const props = {\n error,\n resetErrorBoundary: this.resetErrorBoundary\n };\n if (typeof fallbackRender === \"function\") {\n childToRender = fallbackRender(props);\n } else if (FallbackComponent) {\n childToRender = createElement(FallbackComponent, props);\n } else if (fallback !== undefined) {\n childToRender = fallback;\n } else {\n throw error;\n }\n }\n return createElement(ErrorBoundaryContext.Provider, {\n value: {\n didCatch,\n error,\n resetErrorBoundary: this.resetErrorBoundary\n }\n }, childToRender);\n }\n}\nfunction hasArrayChanged() {\n let a = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n let b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n return a.length !== b.length || a.some((item, index) => !Object.is(item, b[index]));\n}\n\nfunction assertErrorBoundaryContext(value) {\n if (value == null || typeof value.didCatch !== \"boolean\" || typeof value.resetErrorBoundary !== \"function\") {\n throw new Error(\"ErrorBoundaryContext not found\");\n }\n}\n\nfunction useErrorBoundary() {\n const context = useContext(ErrorBoundaryContext);\n assertErrorBoundaryContext(context);\n const [state, setState] = useState({\n error: null,\n hasError: false\n });\n const memoized = useMemo(() => ({\n resetBoundary: () => {\n context.resetErrorBoundary();\n setState({\n error: null,\n hasError: false\n });\n },\n showBoundary: error => setState({\n error,\n hasError: true\n })\n }), [context.resetErrorBoundary]);\n if (state.hasError) {\n throw state.error;\n }\n return memoized;\n}\n\nfunction withErrorBoundary(component, errorBoundaryProps) {\n const Wrapped = forwardRef((props, ref) => createElement(ErrorBoundary, errorBoundaryProps, createElement(component, {\n ...props,\n ref\n })));\n\n // Format for display in DevTools\n const name = component.displayName || component.name || \"Unknown\";\n Wrapped.displayName = \"withErrorBoundary(\".concat(name, \")\");\n return Wrapped;\n}\n\nexport { ErrorBoundary, ErrorBoundaryContext, useErrorBoundary, withErrorBoundary };\n","import { Icon } from \"@powerhousedao/design-system\";\nimport type { DocumentDriveDocument } from \"document-drive\";\nimport { getDriveSharingType } from \"document-drive/server/utils\";\n\nexport function DriveIcon({\n drive,\n}: {\n drive: DocumentDriveDocument | undefined;\n}) {\n const sharingType = drive ? getDriveSharingType(drive) : undefined;\n const driveIconSrc = drive?.state.global.icon;\n\n if (driveIconSrc) {\n return (\n <img src={driveIconSrc} alt={drive.header.name} height={32} width={32} />\n );\n }\n\n if (sharingType === \"LOCAL\") {\n return <Icon name=\"Hdd\" size={32} />;\n }\n\n return <Icon name=\"Server\" size={32} />;\n}\n"],"names":["ErrorBoundaryContext","createContext","initialState","ErrorBoundary","Component","props","error","_this$props$onReset","_this$props","_len","args","_key","info","_this$props$onError","_this$props2","prevProps","prevState","didCatch","resetKeys","hasArrayChanged","_this$props$onReset2","_this$props3","children","fallbackRender","FallbackComponent","fallback","childToRender","createElement","a","b","item","index","DriveIcon","drive","sharingType","getDriveSharingType","driveIconSrc","jsx","Icon"],"mappings":"8JAGA,MAAMA,EAAuBC,EAAc,IAAI,EAEzCC,EAAe,CACnB,SAAU,GACV,MAAO,IACT,EACA,MAAMC,UAAsBC,CAAU,CACpC,YAAYC,EAAO,CACjB,MAAMA,CAAK,EACX,KAAK,mBAAqB,KAAK,mBAAmB,KAAK,IAAI,EAC3D,KAAK,MAAQH,CACf,CACA,OAAO,yBAAyBI,EAAO,CACrC,MAAO,CACL,SAAU,GACV,MAAAA,CACN,CACE,CACA,oBAA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C,EAAcH,EAAmBnB,CAAK,UAC7CoB,IAAa,OACtBC,EAAgBD,MAEhB,OAAMnB,CAEV,CACA,OAAOqB,EAAc3B,EAAqB,SAAU,CAClD,MAAO,CACL,SAAAiB,EACA,MAAAX,EACA,mBAAoB,KAAK,kBACjC,CACA,EAAOoB,CAAa,CAClB,CACF,CACA,SAASP,GAAkB,CACzB,IAAIS,EAAI,UAAU,OAAS,GAAK,UAAU,CAAC,IAAM,OAAY,UAAU,CAAC,EAAI,CAAA,EACxEC,EAAI,UAAU,OAAS,GAAK,UAAU,CAAC,IAAM,OAAY,UAAU,CAAC,EAAI,CAAA,EAC5E,OAAOD,EAAE,SAAWC,EAAE,QAAUD,EAAE,KAAK,CAACE,EAAMC,IAAU,CAAC,OAAO,GAAGD,EAAMD,EAAEE,CAAK,CAAC,CAAC,CACpF,CCpGO,SAASC,EAAU,CACxB,MAAAC,CACF,EAEG,CACD,MAAMC,EAAcD,EAAQE,EAAoBF,CAAK,EAAI,OACnDG,EAAeH,GAAA,YAAAA,EAAO,MAAM,OAAO,KAEzC,OAAIG,EAEAC,EAAC,MAAA,CAAI,IAAKD,EAAc,IAAKH,EAAM,OAAO,KAAM,OAAQ,GAAI,MAAO,EAAA,CAAI,EAIvEC,IAAgB,QACXG,EAACC,EAAA,CAAK,KAAK,MAAM,KAAM,GAAI,EAG7BD,EAACC,EAAA,CAAK,KAAK,SAAS,KAAM,GAAI,CACvC","x_google_ignoreList":[0]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ab as s,ac as b,ad as A,ae as x,af as M,ag as N,ah as L,ai as P,aj as C,ak as w,al as k}from"./main.CrANKVyU.js";import{aK as Pt,ao as Ct,ap as wt,aq as kt,aF as vt,aG as Ut,aH as yt,at as jt,as as Gt,aI as Ht,aJ as Xt,aL as Vt,aM as $t,ar as Ft,aN as Wt,am as Bt,aO as zt,aA as Qt,aP as qt,aB as Jt,aC as Kt,aQ as Zt,an as Yt,aR as eo,aD as to,aS as oo,aT as ro,aE as no,au as ao,av as io,aw as so,ax as po,ay as lo,az as mo}from"./main.CrANKVyU.js";import{A as O,U as S,D as h,R as g,a as I,b as f,c as _,d as D,e as v,f as U,g as y,h as j,i as G,j as H,k as X,l as V,m as $,r as F,n as W,o as B,p as z,s as Q,q,t as J,u as K,v as Z,w as Y,x as ee,y as te,z as oe,B as re,C as ne,E as ae,F as ie,G as se,H as pe,I as le,J as de,K as me,L as ce,M as ue,N as Ee,O as Oe,P as Se,Q as he,S as ge,T as Ie,V as fe,W as _e,X as De,Y as Te,Z as Re,_ as be,$ as Ae,a0 as xe,a1 as Me,a2 as Ne,a3 as Le,a4 as Pe,a5 as Ce,a6 as we,a7 as ke,a8 as ve,a9 as Ue,aa as ye,ab as je,ac as Ge,ad as He,ae as Xe,af as Ve,ag as $e,ah as Fe,ai as We,aj as Be,ak as ze,al as Qe}from"./creators.DxnBvZmB.js";import"react/jsx-runtime";import"react-dom/client";import"react";import"react-dom";const qe=t=>s("ADD_CHANGE_LOG_ITEM",{...t},void 0,O,"global"),Je=t=>s("UPDATE_CHANGE_LOG_ITEM",{...t},void 0,S,"global"),Ke=t=>s("DELETE_CHANGE_LOG_ITEM",{...t},void 0,h,"global"),Ze=t=>s("REORDER_CHANGE_LOG_ITEMS",{...t},void 0,g,"global"),Ye=()=>s("RELEASE_NEW_VERSION",{},void 0,void 0,"global"),et=t=>s("ADD_OPERATION_EXAMPLE",{...t},void 0,I,"global"),tt=t=>s("UPDATE_OPERATION_EXAMPLE",{...t},void 0,f,"global"),ot=t=>s("DELETE_OPERATION_EXAMPLE",{...t},void 0,_,"global"),rt=t=>s("REORDER_OPERATION_EXAMPLES",{...t},void 0,D,"global"),nt=Object.freeze(Object.defineProperty({__proto__:null,addChangeLogItem:qe,addModule:v,addOperation:U,addOperationError:y,addOperationExample:et,addStateExample:j,deleteChangeLogItem:Ke,deleteModule:G,deleteOperation:H,deleteOperationError:X,deleteOperationExample:ot,deleteStateExample:V,moveOperation:$,releaseNewVersion:Ye,reorderChangeLogItems:Ze,reorderModuleOperations:F,reorderModules:W,reorderOperationErrors:B,reorderOperationExamples:rt,reorderStateExamples:z,setAuthorName:Q,setAuthorWebsite:q,setInitialState:J,setModelDescription:K,setModelExtension:Z,setModelId:Y,setModelName:ee,setModuleDescription:te,setModuleName:oe,setOperationDescription:re,setOperationErrorCode:ne,setOperationErrorDescription:ae,setOperationErrorName:ie,setOperationErrorTemplate:se,setOperationName:pe,setOperationReducer:le,setOperationSchema:de,setOperationScope:me,setOperationTemplate:ce,setStateSchema:ue,updateChangeLogItem:Je,updateOperationExample:tt,updateStateExample:Ee},Symbol.toStringTag,{value:"Module"})),l={setModelNameOperation(t,e){t.name=e.input.name},setModelIdOperation(t,e){t.id=e.input.id},setModelExtensionOperation(t,e){t.extension=e.input.extension},setModelDescriptionOperation(t,e){t.description=e.input.description},setAuthorNameOperation(t,e){t.author=t.author||{name:"",website:null},t.author.name=e.input.authorName},setAuthorWebsiteOperation(t,e){t.author=t.author||{name:"",website:null},t.author.website=e.input.authorWebsite}},at=t=>{const e={};return t.forEach((r,o)=>e[r]=o),(r,o)=>(e[o.id]||999999)-(e[r.id]||999999)},m={addModuleOperation(t,e){t.specifications[t.specifications.length-1].modules.push({id:e.input.id,name:e.input.name,description:e.input.description||"",operations:[]})},setModuleNameOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let o=0;o<r.modules.length;o++)r.modules[o].id===e.input.id&&(r.modules[o].name=e.input.name||"")},setModuleDescriptionOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let o=0;o<r.modules.length;o++)r.modules[o].id===e.input.id&&(r.modules[o].description=e.input.description||"")},deleteModuleOperation(t,e){const r=t.specifications[t.specifications.length-1];r.modules=r.modules.filter(o=>o.id!=e.input.id)},reorderModulesOperation(t,e){t.specifications[t.specifications.length-1].modules.sort(at(e.input.order))}},it=t=>{const e={};return t.forEach((r,o)=>e[r]=o),(r,o)=>(e[o.id]||999999)-(e[r.id]||999999)},p={addOperationErrorOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let o=0;o<r.modules.length;o++)for(let n=0;n<r.modules[o].operations.length;n++)r.modules[o].operations[n].id==e.input.operationId&&r.modules[o].operations[n].errors.push({id:e.input.id,name:e.input.errorName||"",code:e.input.errorCode||"",description:e.input.errorDescription||"",template:e.input.errorTemplate||""})},setOperationErrorCodeOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let o=0;o<r.modules.length;o++)for(let n=0;n<r.modules[o].operations.length;n++)for(let a=0;a<r.modules[o].operations[n].errors.length;a++)r.modules[o].operations[n].errors[a].id==e.input.id&&(r.modules[o].operations[n].errors[a].code=e.input.errorCode||"")},setOperationErrorNameOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let o=0;o<r.modules.length;o++)for(let n=0;n<r.modules[o].operations.length;n++)for(let a=0;a<r.modules[o].operations[n].errors.length;a++)r.modules[o].operations[n].errors[a].id==e.input.id&&(r.modules[o].operations[n].errors[a].name=e.input.errorName||"")},setOperationErrorDescriptionOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let o=0;o<r.modules.length;o++)for(let n=0;n<r.modules[o].operations.length;n++)for(let a=0;a<r.modules[o].operations[n].errors.length;a++)r.modules[o].operations[n].errors[a].id==e.input.id&&(r.modules[o].operations[n].errors[a].description=e.input.errorDescription||"")},setOperationErrorTemplateOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let o=0;o<r.modules.length;o++)for(let n=0;n<r.modules[o].operations.length;n++)for(let a=0;a<r.modules[o].operations[n].errors.length;a++)r.modules[o].operations[n].errors[a].id==e.input.id&&(r.modules[o].operations[n].errors[a].template=e.input.errorTemplate||"")},deleteOperationErrorOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let o=0;o<r.modules.length;o++)for(let n=0;n<r.modules[o].operations.length;n++)r.modules[o].operations[n].errors=r.modules[o].operations[n].errors.filter(a=>a.id!=e.input.id)},reorderOperationErrorsOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let o=0;o<r.modules.length;o++)for(let n=0;n<r.modules[o].operations.length;n++)r.modules[o].operations[n].id==e.input.operationId&&r.modules[o].operations[n].errors.sort(it(e.input.order))}},st=t=>{const e={};return t.forEach((r,o)=>e[r]=o),(r,o)=>(e[o.id]||999999)-(e[r.id]||999999)},u={addOperationExampleOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let o=0;o<r.modules.length;o++)for(let n=0;n<r.modules[o].operations.length;n++)r.modules[o].operations[n].id==e.input.operationId&&r.modules[o].operations[n].examples.push({id:e.input.id,value:e.input.example})},updateOperationExampleOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let o=0;o<r.modules.length;o++)for(let n=0;n<r.modules[o].operations.length;n++)for(let a=0;a<r.modules[o].operations[n].examples.length;a++)r.modules[o].operations[n].examples[a].id==e.input.id&&(r.modules[o].operations[n].examples[a].value=e.input.example)},deleteOperationExampleOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let o=0;o<r.modules.length;o++)for(let n=0;n<r.modules[o].operations.length;n++)r.modules[o].operations[n].examples=r.modules[o].operations[n].examples.filter(a=>a.id!=e.input.id)},reorderOperationExamplesOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let o=0;o<r.modules.length;o++)for(let n=0;n<r.modules[o].operations.length;n++)r.modules[o].operations[n].id==e.input.operationId&&r.modules[o].operations[n].examples.sort(st(e.input.order))}},pt=t=>{const e={};return t.forEach((r,o)=>e[r]=o),(r,o)=>(e[o.id]||999999)-(e[r.id]||999999)},i={addOperationOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let o=0;o<r.modules.length;o++)r.modules[o].id==e.input.moduleId&&r.modules[o].operations.push({id:e.input.id,name:e.input.name,description:e.input.description||"",schema:e.input.schema||"",template:e.input.template||e.input.description||"",reducer:e.input.reducer||"",errors:[],examples:[],scope:e.input.scope||"global"})},setOperationNameOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let o=0;o<r.modules.length;o++)for(let n=0;n<r.modules[o].operations.length;n++)r.modules[o].operations[n].id==e.input.id&&(r.modules[o].operations[n].name=e.input.name||"")},setOperationScopeOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let o=0;o<r.modules.length;o++)for(let n=0;n<r.modules[o].operations.length;n++)r.modules[o].operations[n].id==e.input.id&&(r.modules[o].operations[n].scope=e.input.scope||"global")},setOperationSchemaOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let o=0;o<r.modules.length;o++)for(let n=0;n<r.modules[o].operations.length;n++)r.modules[o].operations[n].id==e.input.id&&(r.modules[o].operations[n].schema=e.input.schema||"")},setOperationDescriptionOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let o=0;o<r.modules.length;o++)for(let n=0;n<r.modules[o].operations.length;n++)r.modules[o].operations[n].id==e.input.id&&(r.modules[o].operations[n].description=e.input.description||"")},setOperationTemplateOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let o=0;o<r.modules.length;o++)for(let n=0;n<r.modules[o].operations.length;n++)r.modules[o].operations[n].id==e.input.id&&(r.modules[o].operations[n].template=e.input.template||"")},setOperationReducerOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let o=0;o<r.modules.length;o++)for(let n=0;n<r.modules[o].operations.length;n++)r.modules[o].operations[n].id==e.input.id&&(r.modules[o].operations[n].reducer=e.input.reducer||"")},moveOperationOperation(t,e){const r=[],o=t.specifications[t.specifications.length-1];for(let n=0;n<o.modules.length;n++)o.modules[n].operations=o.modules[n].operations.filter(a=>a.id==e.input.operationId?(r.push(a),!1):!0);for(let n=0;n<o.modules.length;n++)o.modules[n].id==e.input.newModuleId&&o.modules[n].operations.push(...r)},deleteOperationOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let o=0;o<r.modules.length;o++)r.modules[o].operations=r.modules[o].operations.filter(n=>n.id!=e.input.id)},reorderModuleOperationsOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let o=0;o<r.modules.length;o++)r.modules[o].id==e.input.moduleId&&r.modules[o].operations.sort(pt(e.input.order))}},lt=t=>{const e={};return t.forEach((r,o)=>e[r]=o),(r,o)=>(e[o.id]||999999)-(e[r.id]||999999)},d={setStateSchemaOperation(t,e){const r=t.specifications[t.specifications.length-1];if(Object.keys(r.state).includes(e.input.scope))r.state[e.input.scope].schema=e.input.schema;else throw new Error(`Invalid scope: ${e.input.scope}`)},setInitialStateOperation(t,e){const r=t.specifications[t.specifications.length-1];if(Object.keys(r.state).includes(e.input.scope))r.state[e.input.scope].initialValue=e.input.initialValue;else throw new Error(`Invalid scope: ${e.input.scope}`)},addStateExampleOperation(t,e){const r=t.specifications[t.specifications.length-1];if(Object.keys(r.state).includes(e.input.scope))r.state[e.input.scope].examples.push({id:e.input.id,value:e.input.example});else throw new Error(`Invalid scope: ${e.input.scope}`)},updateStateExampleOperation(t,e){const r=t.specifications[t.specifications.length-1];if(!Object.keys(r.state).includes(e.input.scope))throw new Error(`Invalid scope: ${e.input.scope}`);const o=r.state[e.input.scope].examples;for(let n=0;n<o.length;n++)o[n].id==e.input.id&&(o[n].value=e.input.newExample)},deleteStateExampleOperation(t,e){const r=t.specifications[t.specifications.length-1];if(Object.keys(r.state).includes(e.input.scope))r.state[e.input.scope].examples=r.state[e.input.scope].examples.filter(o=>o.id!=e.input.id);else throw new Error(`Invalid scope: ${e.input.scope}`)},reorderStateExamplesOperation(t,e){const r=t.specifications[t.specifications.length-1];if(Object.keys(r.state).includes(e.input.scope))r.state[e.input.scope].examples.sort(lt(e.input.order));else throw new Error(`Invalid scope: ${e.input.scope}`)}},c={addChangeLogItemOperation(t,e){throw new Error('Reducer "addChangeLogItemOperation" not yet implemented')},updateChangeLogItemOperation(t,e){throw new Error('Reducer "updateChangeLogItemOperation" not yet implemented')},deleteChangeLogItemOperation(t,e){throw new Error('Reducer "deleteChangeLogItemOperation" not yet implemented')},reorderChangeLogItemsOperation(t,e){throw new Error('Reducer "reorderChangeLogItemsOperation" not yet implemented')},releaseNewVersionOperation(t,e){throw new Error('Reducer "releaseNewVersionOperation" not yet implemented')}},dt=(t,e)=>{if(A(e))return t;switch(e.type){case"SET_MODEL_NAME":Qe().parse(e.input),l.setModelNameOperation(t.global,e);break;case"SET_MODEL_ID":ze().parse(e.input),l.setModelIdOperation(t.global,e);break;case"SET_MODEL_EXTENSION":Be().parse(e.input),l.setModelExtensionOperation(t.global,e);break;case"SET_MODEL_DESCRIPTION":We().parse(e.input),l.setModelDescriptionOperation(t.global,e);break;case"SET_AUTHOR_NAME":Fe().parse(e.input),l.setAuthorNameOperation(t.global,e);break;case"SET_AUTHOR_WEBSITE":$e().parse(e.input),l.setAuthorWebsiteOperation(t.global,e);break;case"ADD_CHANGE_LOG_ITEM":O().parse(e.input),c.addChangeLogItemOperation(t.global,e);break;case"UPDATE_CHANGE_LOG_ITEM":S().parse(e.input),c.updateChangeLogItemOperation(t.global,e);break;case"DELETE_CHANGE_LOG_ITEM":h().parse(e.input),c.deleteChangeLogItemOperation(t.global,e);break;case"REORDER_CHANGE_LOG_ITEMS":g().parse(e.input),c.reorderChangeLogItemsOperation(t.global,e);break;case"RELEASE_NEW_VERSION":if(Object.keys(e.input).length>0)throw new Error("Expected empty input for action RELEASE_NEW_VERSION");c.releaseNewVersionOperation(t.global,e);break;case"ADD_MODULE":Ve().parse(e.input),m.addModuleOperation(t.global,e);break;case"SET_MODULE_NAME":Xe().parse(e.input),m.setModuleNameOperation(t.global,e);break;case"SET_MODULE_DESCRIPTION":He().parse(e.input),m.setModuleDescriptionOperation(t.global,e);break;case"DELETE_MODULE":Ge().parse(e.input),m.deleteModuleOperation(t.global,e);break;case"REORDER_MODULES":je().parse(e.input),m.reorderModulesOperation(t.global,e);break;case"ADD_OPERATION_ERROR":ye().parse(e.input),p.addOperationErrorOperation(t.global,e);break;case"SET_OPERATION_ERROR_CODE":Ue().parse(e.input),p.setOperationErrorCodeOperation(t.global,e);break;case"SET_OPERATION_ERROR_NAME":ve().parse(e.input),p.setOperationErrorNameOperation(t.global,e);break;case"SET_OPERATION_ERROR_DESCRIPTION":ke().parse(e.input),p.setOperationErrorDescriptionOperation(t.global,e);break;case"SET_OPERATION_ERROR_TEMPLATE":we().parse(e.input),p.setOperationErrorTemplateOperation(t.global,e);break;case"DELETE_OPERATION_ERROR":Ce().parse(e.input),p.deleteOperationErrorOperation(t.global,e);break;case"REORDER_OPERATION_ERRORS":Pe().parse(e.input),p.reorderOperationErrorsOperation(t.global,e);break;case"ADD_OPERATION_EXAMPLE":I().parse(e.input),u.addOperationExampleOperation(t.global,e);break;case"UPDATE_OPERATION_EXAMPLE":f().parse(e.input),u.updateOperationExampleOperation(t.global,e);break;case"DELETE_OPERATION_EXAMPLE":_().parse(e.input),u.deleteOperationExampleOperation(t.global,e);break;case"REORDER_OPERATION_EXAMPLES":D().parse(e.input),u.reorderOperationExamplesOperation(t.global,e);break;case"ADD_OPERATION":Le().parse(e.input),i.addOperationOperation(t.global,e);break;case"SET_OPERATION_NAME":Ne().parse(e.input),i.setOperationNameOperation(t.global,e);break;case"SET_OPERATION_SCOPE":Me().parse(e.input),i.setOperationScopeOperation(t.global,e);break;case"SET_OPERATION_SCHEMA":xe().parse(e.input),i.setOperationSchemaOperation(t.global,e);break;case"SET_OPERATION_DESCRIPTION":Ae().parse(e.input),i.setOperationDescriptionOperation(t.global,e);break;case"SET_OPERATION_TEMPLATE":be().parse(e.input),i.setOperationTemplateOperation(t.global,e);break;case"SET_OPERATION_REDUCER":Re().parse(e.input),i.setOperationReducerOperation(t.global,e);break;case"MOVE_OPERATION":Te().parse(e.input),i.moveOperationOperation(t.global,e);break;case"DELETE_OPERATION":De().parse(e.input),i.deleteOperationOperation(t.global,e);break;case"REORDER_MODULE_OPERATIONS":_e().parse(e.input),i.reorderModuleOperationsOperation(t.global,e);break;case"SET_STATE_SCHEMA":fe().parse(e.input),d.setStateSchemaOperation(t.global,e);break;case"SET_INITIAL_STATE":Ie().parse(e.input),d.setInitialStateOperation(t.global,e);break;case"ADD_STATE_EXAMPLE":ge().parse(e.input),d.addStateExampleOperation(t.global,e);break;case"UPDATE_STATE_EXAMPLE":he().parse(e.input),d.updateStateExampleOperation(t.global,e);break;case"DELETE_STATE_EXAMPLE":Se().parse(e.input),d.deleteStateExampleOperation(t.global,e);break;case"REORDER_STATE_EXAMPLES":Oe().parse(e.input),d.reorderStateExamplesOperation(t.global,e);break;default:return t}},E=b(dt),mt={id:"",name:"",extension:"",description:"",author:{name:"",website:""},specifications:[{version:1,changeLog:[],state:{global:{schema:"",initialValue:"",examples:[]},local:{schema:"",initialValue:"",examples:[]}},modules:[]}]},ct={},T="phdm",ut="powerhouse/document-model",R=t=>({...x(),global:{...mt,...(t==null?void 0:t.global)??{}},local:{...ct,...(t==null?void 0:t.local)??{}}}),Et=t=>{const e=M(R,t);return e.header.documentType=ut,e},Ot=(t,e,r)=>N(t,e,T,r),St=(t,e)=>L(t,e),ht=t=>P(t,E),gt=t=>C(t,E),It=Object.freeze(Object.defineProperty({__proto__:null,createDocument:Et,createState:R,fileExtension:T,loadFromFile:ht,loadFromInput:gt,saveToFile:Ot,saveToFileHandle:St},Symbol.toStringTag,{value:"Module"})),ft={id:"powerhouse/document-model",name:"DocumentModel",extension:"phdm",description:"The Powerhouse Document Model describes the state and operations of a document type.",author:{name:"Powerhouse",website:"https://www.powerhouse.inc/"},specifications:[{version:1,changeLog:[],state:{global:{schema:`type CodeExample {
|
|
1
|
+
import{ab as s,ac as b,ad as A,ae as x,af as M,ag as N,ah as L,ai as P,aj as C,ak as w,al as k}from"./main.D9OoNJWh.js";import{aK as Pt,ao as Ct,ap as wt,aq as kt,aF as vt,aG as Ut,aH as yt,at as jt,as as Gt,aI as Ht,aJ as Xt,aL as Vt,aM as $t,ar as Ft,aN as Wt,am as Bt,aO as zt,aA as Qt,aP as qt,aB as Jt,aC as Kt,aQ as Zt,an as Yt,aR as eo,aD as to,aS as oo,aT as ro,aE as no,au as ao,av as io,aw as so,ax as po,ay as lo,az as mo}from"./main.D9OoNJWh.js";import{A as O,U as S,D as h,R as g,a as I,b as f,c as _,d as D,e as v,f as U,g as y,h as j,i as G,j as H,k as X,l as V,m as $,r as F,n as W,o as B,p as z,s as Q,q,t as J,u as K,v as Z,w as Y,x as ee,y as te,z as oe,B as re,C as ne,E as ae,F as ie,G as se,H as pe,I as le,J as de,K as me,L as ce,M as ue,N as Ee,O as Oe,P as Se,Q as he,S as ge,T as Ie,V as fe,W as _e,X as De,Y as Te,Z as Re,_ as be,$ as Ae,a0 as xe,a1 as Me,a2 as Ne,a3 as Le,a4 as Pe,a5 as Ce,a6 as we,a7 as ke,a8 as ve,a9 as Ue,aa as ye,ab as je,ac as Ge,ad as He,ae as Xe,af as Ve,ag as $e,ah as Fe,ai as We,aj as Be,ak as ze,al as Qe}from"./creators.CjFm02Wg.js";import"react/jsx-runtime";import"react-dom/client";import"react";import"react-dom";const qe=t=>s("ADD_CHANGE_LOG_ITEM",{...t},void 0,O,"global"),Je=t=>s("UPDATE_CHANGE_LOG_ITEM",{...t},void 0,S,"global"),Ke=t=>s("DELETE_CHANGE_LOG_ITEM",{...t},void 0,h,"global"),Ze=t=>s("REORDER_CHANGE_LOG_ITEMS",{...t},void 0,g,"global"),Ye=()=>s("RELEASE_NEW_VERSION",{},void 0,void 0,"global"),et=t=>s("ADD_OPERATION_EXAMPLE",{...t},void 0,I,"global"),tt=t=>s("UPDATE_OPERATION_EXAMPLE",{...t},void 0,f,"global"),ot=t=>s("DELETE_OPERATION_EXAMPLE",{...t},void 0,_,"global"),rt=t=>s("REORDER_OPERATION_EXAMPLES",{...t},void 0,D,"global"),nt=Object.freeze(Object.defineProperty({__proto__:null,addChangeLogItem:qe,addModule:v,addOperation:U,addOperationError:y,addOperationExample:et,addStateExample:j,deleteChangeLogItem:Ke,deleteModule:G,deleteOperation:H,deleteOperationError:X,deleteOperationExample:ot,deleteStateExample:V,moveOperation:$,releaseNewVersion:Ye,reorderChangeLogItems:Ze,reorderModuleOperations:F,reorderModules:W,reorderOperationErrors:B,reorderOperationExamples:rt,reorderStateExamples:z,setAuthorName:Q,setAuthorWebsite:q,setInitialState:J,setModelDescription:K,setModelExtension:Z,setModelId:Y,setModelName:ee,setModuleDescription:te,setModuleName:oe,setOperationDescription:re,setOperationErrorCode:ne,setOperationErrorDescription:ae,setOperationErrorName:ie,setOperationErrorTemplate:se,setOperationName:pe,setOperationReducer:le,setOperationSchema:de,setOperationScope:me,setOperationTemplate:ce,setStateSchema:ue,updateChangeLogItem:Je,updateOperationExample:tt,updateStateExample:Ee},Symbol.toStringTag,{value:"Module"})),l={setModelNameOperation(t,e){t.name=e.input.name},setModelIdOperation(t,e){t.id=e.input.id},setModelExtensionOperation(t,e){t.extension=e.input.extension},setModelDescriptionOperation(t,e){t.description=e.input.description},setAuthorNameOperation(t,e){t.author=t.author||{name:"",website:null},t.author.name=e.input.authorName},setAuthorWebsiteOperation(t,e){t.author=t.author||{name:"",website:null},t.author.website=e.input.authorWebsite}},at=t=>{const e={};return t.forEach((r,o)=>e[r]=o),(r,o)=>(e[o.id]||999999)-(e[r.id]||999999)},m={addModuleOperation(t,e){t.specifications[t.specifications.length-1].modules.push({id:e.input.id,name:e.input.name,description:e.input.description||"",operations:[]})},setModuleNameOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let o=0;o<r.modules.length;o++)r.modules[o].id===e.input.id&&(r.modules[o].name=e.input.name||"")},setModuleDescriptionOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let o=0;o<r.modules.length;o++)r.modules[o].id===e.input.id&&(r.modules[o].description=e.input.description||"")},deleteModuleOperation(t,e){const r=t.specifications[t.specifications.length-1];r.modules=r.modules.filter(o=>o.id!=e.input.id)},reorderModulesOperation(t,e){t.specifications[t.specifications.length-1].modules.sort(at(e.input.order))}},it=t=>{const e={};return t.forEach((r,o)=>e[r]=o),(r,o)=>(e[o.id]||999999)-(e[r.id]||999999)},p={addOperationErrorOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let o=0;o<r.modules.length;o++)for(let n=0;n<r.modules[o].operations.length;n++)r.modules[o].operations[n].id==e.input.operationId&&r.modules[o].operations[n].errors.push({id:e.input.id,name:e.input.errorName||"",code:e.input.errorCode||"",description:e.input.errorDescription||"",template:e.input.errorTemplate||""})},setOperationErrorCodeOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let o=0;o<r.modules.length;o++)for(let n=0;n<r.modules[o].operations.length;n++)for(let a=0;a<r.modules[o].operations[n].errors.length;a++)r.modules[o].operations[n].errors[a].id==e.input.id&&(r.modules[o].operations[n].errors[a].code=e.input.errorCode||"")},setOperationErrorNameOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let o=0;o<r.modules.length;o++)for(let n=0;n<r.modules[o].operations.length;n++)for(let a=0;a<r.modules[o].operations[n].errors.length;a++)r.modules[o].operations[n].errors[a].id==e.input.id&&(r.modules[o].operations[n].errors[a].name=e.input.errorName||"")},setOperationErrorDescriptionOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let o=0;o<r.modules.length;o++)for(let n=0;n<r.modules[o].operations.length;n++)for(let a=0;a<r.modules[o].operations[n].errors.length;a++)r.modules[o].operations[n].errors[a].id==e.input.id&&(r.modules[o].operations[n].errors[a].description=e.input.errorDescription||"")},setOperationErrorTemplateOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let o=0;o<r.modules.length;o++)for(let n=0;n<r.modules[o].operations.length;n++)for(let a=0;a<r.modules[o].operations[n].errors.length;a++)r.modules[o].operations[n].errors[a].id==e.input.id&&(r.modules[o].operations[n].errors[a].template=e.input.errorTemplate||"")},deleteOperationErrorOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let o=0;o<r.modules.length;o++)for(let n=0;n<r.modules[o].operations.length;n++)r.modules[o].operations[n].errors=r.modules[o].operations[n].errors.filter(a=>a.id!=e.input.id)},reorderOperationErrorsOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let o=0;o<r.modules.length;o++)for(let n=0;n<r.modules[o].operations.length;n++)r.modules[o].operations[n].id==e.input.operationId&&r.modules[o].operations[n].errors.sort(it(e.input.order))}},st=t=>{const e={};return t.forEach((r,o)=>e[r]=o),(r,o)=>(e[o.id]||999999)-(e[r.id]||999999)},u={addOperationExampleOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let o=0;o<r.modules.length;o++)for(let n=0;n<r.modules[o].operations.length;n++)r.modules[o].operations[n].id==e.input.operationId&&r.modules[o].operations[n].examples.push({id:e.input.id,value:e.input.example})},updateOperationExampleOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let o=0;o<r.modules.length;o++)for(let n=0;n<r.modules[o].operations.length;n++)for(let a=0;a<r.modules[o].operations[n].examples.length;a++)r.modules[o].operations[n].examples[a].id==e.input.id&&(r.modules[o].operations[n].examples[a].value=e.input.example)},deleteOperationExampleOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let o=0;o<r.modules.length;o++)for(let n=0;n<r.modules[o].operations.length;n++)r.modules[o].operations[n].examples=r.modules[o].operations[n].examples.filter(a=>a.id!=e.input.id)},reorderOperationExamplesOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let o=0;o<r.modules.length;o++)for(let n=0;n<r.modules[o].operations.length;n++)r.modules[o].operations[n].id==e.input.operationId&&r.modules[o].operations[n].examples.sort(st(e.input.order))}},pt=t=>{const e={};return t.forEach((r,o)=>e[r]=o),(r,o)=>(e[o.id]||999999)-(e[r.id]||999999)},i={addOperationOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let o=0;o<r.modules.length;o++)r.modules[o].id==e.input.moduleId&&r.modules[o].operations.push({id:e.input.id,name:e.input.name,description:e.input.description||"",schema:e.input.schema||"",template:e.input.template||e.input.description||"",reducer:e.input.reducer||"",errors:[],examples:[],scope:e.input.scope||"global"})},setOperationNameOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let o=0;o<r.modules.length;o++)for(let n=0;n<r.modules[o].operations.length;n++)r.modules[o].operations[n].id==e.input.id&&(r.modules[o].operations[n].name=e.input.name||"")},setOperationScopeOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let o=0;o<r.modules.length;o++)for(let n=0;n<r.modules[o].operations.length;n++)r.modules[o].operations[n].id==e.input.id&&(r.modules[o].operations[n].scope=e.input.scope||"global")},setOperationSchemaOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let o=0;o<r.modules.length;o++)for(let n=0;n<r.modules[o].operations.length;n++)r.modules[o].operations[n].id==e.input.id&&(r.modules[o].operations[n].schema=e.input.schema||"")},setOperationDescriptionOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let o=0;o<r.modules.length;o++)for(let n=0;n<r.modules[o].operations.length;n++)r.modules[o].operations[n].id==e.input.id&&(r.modules[o].operations[n].description=e.input.description||"")},setOperationTemplateOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let o=0;o<r.modules.length;o++)for(let n=0;n<r.modules[o].operations.length;n++)r.modules[o].operations[n].id==e.input.id&&(r.modules[o].operations[n].template=e.input.template||"")},setOperationReducerOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let o=0;o<r.modules.length;o++)for(let n=0;n<r.modules[o].operations.length;n++)r.modules[o].operations[n].id==e.input.id&&(r.modules[o].operations[n].reducer=e.input.reducer||"")},moveOperationOperation(t,e){const r=[],o=t.specifications[t.specifications.length-1];for(let n=0;n<o.modules.length;n++)o.modules[n].operations=o.modules[n].operations.filter(a=>a.id==e.input.operationId?(r.push(a),!1):!0);for(let n=0;n<o.modules.length;n++)o.modules[n].id==e.input.newModuleId&&o.modules[n].operations.push(...r)},deleteOperationOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let o=0;o<r.modules.length;o++)r.modules[o].operations=r.modules[o].operations.filter(n=>n.id!=e.input.id)},reorderModuleOperationsOperation(t,e){const r=t.specifications[t.specifications.length-1];for(let o=0;o<r.modules.length;o++)r.modules[o].id==e.input.moduleId&&r.modules[o].operations.sort(pt(e.input.order))}},lt=t=>{const e={};return t.forEach((r,o)=>e[r]=o),(r,o)=>(e[o.id]||999999)-(e[r.id]||999999)},d={setStateSchemaOperation(t,e){const r=t.specifications[t.specifications.length-1];if(Object.keys(r.state).includes(e.input.scope))r.state[e.input.scope].schema=e.input.schema;else throw new Error(`Invalid scope: ${e.input.scope}`)},setInitialStateOperation(t,e){const r=t.specifications[t.specifications.length-1];if(Object.keys(r.state).includes(e.input.scope))r.state[e.input.scope].initialValue=e.input.initialValue;else throw new Error(`Invalid scope: ${e.input.scope}`)},addStateExampleOperation(t,e){const r=t.specifications[t.specifications.length-1];if(Object.keys(r.state).includes(e.input.scope))r.state[e.input.scope].examples.push({id:e.input.id,value:e.input.example});else throw new Error(`Invalid scope: ${e.input.scope}`)},updateStateExampleOperation(t,e){const r=t.specifications[t.specifications.length-1];if(!Object.keys(r.state).includes(e.input.scope))throw new Error(`Invalid scope: ${e.input.scope}`);const o=r.state[e.input.scope].examples;for(let n=0;n<o.length;n++)o[n].id==e.input.id&&(o[n].value=e.input.newExample)},deleteStateExampleOperation(t,e){const r=t.specifications[t.specifications.length-1];if(Object.keys(r.state).includes(e.input.scope))r.state[e.input.scope].examples=r.state[e.input.scope].examples.filter(o=>o.id!=e.input.id);else throw new Error(`Invalid scope: ${e.input.scope}`)},reorderStateExamplesOperation(t,e){const r=t.specifications[t.specifications.length-1];if(Object.keys(r.state).includes(e.input.scope))r.state[e.input.scope].examples.sort(lt(e.input.order));else throw new Error(`Invalid scope: ${e.input.scope}`)}},c={addChangeLogItemOperation(t,e){throw new Error('Reducer "addChangeLogItemOperation" not yet implemented')},updateChangeLogItemOperation(t,e){throw new Error('Reducer "updateChangeLogItemOperation" not yet implemented')},deleteChangeLogItemOperation(t,e){throw new Error('Reducer "deleteChangeLogItemOperation" not yet implemented')},reorderChangeLogItemsOperation(t,e){throw new Error('Reducer "reorderChangeLogItemsOperation" not yet implemented')},releaseNewVersionOperation(t,e){throw new Error('Reducer "releaseNewVersionOperation" not yet implemented')}},dt=(t,e)=>{if(A(e))return t;switch(e.type){case"SET_MODEL_NAME":Qe().parse(e.input),l.setModelNameOperation(t.global,e);break;case"SET_MODEL_ID":ze().parse(e.input),l.setModelIdOperation(t.global,e);break;case"SET_MODEL_EXTENSION":Be().parse(e.input),l.setModelExtensionOperation(t.global,e);break;case"SET_MODEL_DESCRIPTION":We().parse(e.input),l.setModelDescriptionOperation(t.global,e);break;case"SET_AUTHOR_NAME":Fe().parse(e.input),l.setAuthorNameOperation(t.global,e);break;case"SET_AUTHOR_WEBSITE":$e().parse(e.input),l.setAuthorWebsiteOperation(t.global,e);break;case"ADD_CHANGE_LOG_ITEM":O().parse(e.input),c.addChangeLogItemOperation(t.global,e);break;case"UPDATE_CHANGE_LOG_ITEM":S().parse(e.input),c.updateChangeLogItemOperation(t.global,e);break;case"DELETE_CHANGE_LOG_ITEM":h().parse(e.input),c.deleteChangeLogItemOperation(t.global,e);break;case"REORDER_CHANGE_LOG_ITEMS":g().parse(e.input),c.reorderChangeLogItemsOperation(t.global,e);break;case"RELEASE_NEW_VERSION":if(Object.keys(e.input).length>0)throw new Error("Expected empty input for action RELEASE_NEW_VERSION");c.releaseNewVersionOperation(t.global,e);break;case"ADD_MODULE":Ve().parse(e.input),m.addModuleOperation(t.global,e);break;case"SET_MODULE_NAME":Xe().parse(e.input),m.setModuleNameOperation(t.global,e);break;case"SET_MODULE_DESCRIPTION":He().parse(e.input),m.setModuleDescriptionOperation(t.global,e);break;case"DELETE_MODULE":Ge().parse(e.input),m.deleteModuleOperation(t.global,e);break;case"REORDER_MODULES":je().parse(e.input),m.reorderModulesOperation(t.global,e);break;case"ADD_OPERATION_ERROR":ye().parse(e.input),p.addOperationErrorOperation(t.global,e);break;case"SET_OPERATION_ERROR_CODE":Ue().parse(e.input),p.setOperationErrorCodeOperation(t.global,e);break;case"SET_OPERATION_ERROR_NAME":ve().parse(e.input),p.setOperationErrorNameOperation(t.global,e);break;case"SET_OPERATION_ERROR_DESCRIPTION":ke().parse(e.input),p.setOperationErrorDescriptionOperation(t.global,e);break;case"SET_OPERATION_ERROR_TEMPLATE":we().parse(e.input),p.setOperationErrorTemplateOperation(t.global,e);break;case"DELETE_OPERATION_ERROR":Ce().parse(e.input),p.deleteOperationErrorOperation(t.global,e);break;case"REORDER_OPERATION_ERRORS":Pe().parse(e.input),p.reorderOperationErrorsOperation(t.global,e);break;case"ADD_OPERATION_EXAMPLE":I().parse(e.input),u.addOperationExampleOperation(t.global,e);break;case"UPDATE_OPERATION_EXAMPLE":f().parse(e.input),u.updateOperationExampleOperation(t.global,e);break;case"DELETE_OPERATION_EXAMPLE":_().parse(e.input),u.deleteOperationExampleOperation(t.global,e);break;case"REORDER_OPERATION_EXAMPLES":D().parse(e.input),u.reorderOperationExamplesOperation(t.global,e);break;case"ADD_OPERATION":Le().parse(e.input),i.addOperationOperation(t.global,e);break;case"SET_OPERATION_NAME":Ne().parse(e.input),i.setOperationNameOperation(t.global,e);break;case"SET_OPERATION_SCOPE":Me().parse(e.input),i.setOperationScopeOperation(t.global,e);break;case"SET_OPERATION_SCHEMA":xe().parse(e.input),i.setOperationSchemaOperation(t.global,e);break;case"SET_OPERATION_DESCRIPTION":Ae().parse(e.input),i.setOperationDescriptionOperation(t.global,e);break;case"SET_OPERATION_TEMPLATE":be().parse(e.input),i.setOperationTemplateOperation(t.global,e);break;case"SET_OPERATION_REDUCER":Re().parse(e.input),i.setOperationReducerOperation(t.global,e);break;case"MOVE_OPERATION":Te().parse(e.input),i.moveOperationOperation(t.global,e);break;case"DELETE_OPERATION":De().parse(e.input),i.deleteOperationOperation(t.global,e);break;case"REORDER_MODULE_OPERATIONS":_e().parse(e.input),i.reorderModuleOperationsOperation(t.global,e);break;case"SET_STATE_SCHEMA":fe().parse(e.input),d.setStateSchemaOperation(t.global,e);break;case"SET_INITIAL_STATE":Ie().parse(e.input),d.setInitialStateOperation(t.global,e);break;case"ADD_STATE_EXAMPLE":ge().parse(e.input),d.addStateExampleOperation(t.global,e);break;case"UPDATE_STATE_EXAMPLE":he().parse(e.input),d.updateStateExampleOperation(t.global,e);break;case"DELETE_STATE_EXAMPLE":Se().parse(e.input),d.deleteStateExampleOperation(t.global,e);break;case"REORDER_STATE_EXAMPLES":Oe().parse(e.input),d.reorderStateExamplesOperation(t.global,e);break;default:return t}},E=b(dt),mt={id:"",name:"",extension:"",description:"",author:{name:"",website:""},specifications:[{version:1,changeLog:[],state:{global:{schema:"",initialValue:"",examples:[]},local:{schema:"",initialValue:"",examples:[]}},modules:[]}]},ct={},T="phdm",ut="powerhouse/document-model",R=t=>({...x(),global:{...mt,...(t==null?void 0:t.global)??{}},local:{...ct,...(t==null?void 0:t.local)??{}}}),Et=t=>{const e=M(R,t);return e.header.documentType=ut,e},Ot=(t,e,r)=>N(t,e,T,r),St=(t,e)=>L(t,e),ht=t=>P(t,E),gt=t=>C(t,E),It=Object.freeze(Object.defineProperty({__proto__:null,createDocument:Et,createState:R,fileExtension:T,loadFromFile:ht,loadFromInput:gt,saveToFile:Ot,saveToFileHandle:St},Symbol.toStringTag,{value:"Module"})),ft={id:"powerhouse/document-model",name:"DocumentModel",extension:"phdm",description:"The Powerhouse Document Model describes the state and operations of a document type.",author:{name:"Powerhouse",website:"https://www.powerhouse.inc/"},specifications:[{version:1,changeLog:[],state:{global:{schema:`type CodeExample {
|
|
2
2
|
id: ID!
|
|
3
3
|
value: String!
|
|
4
4
|
}
|
|
@@ -207,4 +207,4 @@ type DocumentModelState {
|
|
|
207
207
|
scope: String!
|
|
208
208
|
order: [ID!]!
|
|
209
209
|
}`,template:"",reducer:"",examples:[],errors:[],scope:"global"}],id:"",description:""}]}]},_t={...k,...nt},Mt={reducer:E,documentModel:ft,actions:_t,utils:{...It,...w}};export{k as actions,v as addModule,U as addOperation,y as addOperationError,Pt as attachBranch,M as baseCreateDocument,P as baseLoadFromFile,C as baseLoadFromInput,N as baseSaveToFile,L as baseSaveToFileHandle,Ct as buildOperationSignature,wt as buildOperationSignatureMessage,kt as buildSignedAction,s as createAction,vt as createAuthState,Ut as createBaseState,Et as createDocument,yt as createDocumentState,jt as createPresignedHeader,b as createReducer,R as createState,Gt as createZip,Ht as defaultAuthState,x as defaultBaseState,Xt as defaultDocumentState,G as deleteModule,H as deleteOperation,X as deleteOperationError,_t as documentModelActions,Mt as documentModelDocumentModelModule,ht as documentModelLoadFromFile,E as documentModelReducer,Vt as garbageCollect,$t as garbageCollectDocumentOperations,Ft as generateId,Wt as groupOperationsByScope,Bt as hashDocumentStateForScope,A as isDocumentAction,zt as merge,Qt as noop,qt as precedes,Jt as prune,Kt as redo,Zt as removeExistingOperations,Yt as replayDocument,eo as reshuffleByTimestamp,Q as setAuthorName,q as setAuthorWebsite,J as setInitialState,K as setModelDescription,Z as setModelExtension,Y as setModelId,ee as setModelName,oe as setModuleName,to as setName,re as setOperationDescription,ie as setOperationErrorName,pe as setOperationName,de as setOperationSchema,ue as setStateSchema,oo as skipHeaderOperations,ro as sortOperations,no as undo,ao as validateHeader,io as validateInitialState,so as validateModule,po as validateModuleOperation,lo as validateModules,mo as validateStateSchemaName};
|
|
210
|
-
//# sourceMappingURL=index.
|
|
210
|
+
//# sourceMappingURL=index.6RVr5bn1.js.map
|