document-model 2.11.0 → 2.12.0
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/browser/cjs/document-model.js +3 -2
- package/dist/browser/cjs/document-model.js.map +1 -1
- package/dist/browser/cjs/document.js +11 -10
- package/dist/browser/cjs/document.js.map +1 -1
- package/dist/browser/cjs/index.js +2 -2
- package/dist/browser/cjs/internal/{object-BdIbCX0K.js → creators-BFR88wjA.js} +32 -180
- package/dist/browser/cjs/internal/creators-BFR88wjA.js.map +1 -0
- package/dist/browser/cjs/internal/index-B4JwoOCW.js +19 -0
- package/dist/browser/cjs/internal/index-B4JwoOCW.js.map +1 -0
- package/dist/browser/cjs/internal/index-CQbaipWs.js +46 -0
- package/dist/browser/cjs/internal/index-CQbaipWs.js.map +1 -0
- package/dist/browser/cjs/internal/{index-hPntrUvN.js → index-sKyQchiV.js} +56 -55
- package/dist/{node/cjs/internal/index-Bsyn7lZ0.js.map → browser/cjs/internal/index-sKyQchiV.js.map} +1 -1
- package/dist/browser/cjs/internal/object-Cffgxa2p.js +183 -0
- package/dist/browser/cjs/internal/object-Cffgxa2p.js.map +1 -0
- package/dist/browser/cjs/utils.js +43 -0
- package/dist/browser/cjs/utils.js.map +1 -0
- package/dist/browser/es/document-model.js +3 -2
- package/dist/browser/es/document-model.js.map +1 -1
- package/dist/browser/es/document.js +12 -11
- package/dist/browser/es/document.js.map +1 -1
- package/dist/browser/es/index.js +2 -2
- package/dist/browser/es/internal/{object-oB7gkKNr.js → creators-B8Nq9c1o.js} +67 -215
- package/dist/browser/es/internal/creators-B8Nq9c1o.js.map +1 -0
- package/dist/browser/es/internal/index-BBMtae0d.js +20 -0
- package/dist/browser/es/internal/index-BBMtae0d.js.map +1 -0
- package/dist/browser/es/internal/index-BH94ELCG.js +47 -0
- package/dist/browser/es/internal/index-BH94ELCG.js.map +1 -0
- package/dist/browser/es/internal/{index-D_fwH6L3.js → index-BoZSovTG.js} +4 -3
- package/dist/{node/es/internal/index-D4oqm7Ua.js.map → browser/es/internal/index-BoZSovTG.js.map} +1 -1
- package/dist/browser/es/internal/object-4B35tX7x.js +184 -0
- package/dist/browser/es/internal/object-4B35tX7x.js.map +1 -0
- package/dist/browser/es/utils.js +43 -0
- package/dist/browser/es/utils.js.map +1 -0
- package/dist/browser/src/document/utils/base.d.ts.map +1 -1
- package/dist/browser/src/document/utils/errors.d.ts +10 -0
- package/dist/browser/src/document/utils/errors.d.ts.map +1 -0
- package/dist/browser/src/document/utils/index.d.ts +1 -0
- package/dist/browser/src/document/utils/index.d.ts.map +1 -1
- package/dist/browser/utils.d.ts +2 -0
- package/dist/browser/vite.config.d.ts.map +1 -1
- package/dist/node/cjs/document-model.js +3 -2
- package/dist/node/cjs/document-model.js.map +1 -1
- package/dist/node/cjs/document.js +11 -10
- package/dist/node/cjs/document.js.map +1 -1
- package/dist/node/cjs/index.js +2 -2
- package/dist/node/cjs/internal/{object-DqFXYK4g.js → creators-cVAOzgAh.js} +32 -180
- package/dist/node/cjs/internal/creators-cVAOzgAh.js.map +1 -0
- package/dist/node/cjs/internal/index-TqZ14nZp.js +19 -0
- package/dist/node/cjs/internal/index-TqZ14nZp.js.map +1 -0
- package/dist/node/cjs/internal/index-Zf6dGXol.js +46 -0
- package/dist/node/cjs/internal/index-Zf6dGXol.js.map +1 -0
- package/dist/node/cjs/internal/{index-Bsyn7lZ0.js → index-kuBJXCvW.js} +56 -55
- package/dist/{browser/cjs/internal/index-hPntrUvN.js.map → node/cjs/internal/index-kuBJXCvW.js.map} +1 -1
- package/dist/node/cjs/internal/object-DrxUkgaL.js +183 -0
- package/dist/node/cjs/internal/object-DrxUkgaL.js.map +1 -0
- package/dist/node/cjs/utils.js +43 -0
- package/dist/node/cjs/utils.js.map +1 -0
- package/dist/node/es/document-model.js +3 -2
- package/dist/node/es/document-model.js.map +1 -1
- package/dist/node/es/document.js +12 -11
- package/dist/node/es/document.js.map +1 -1
- package/dist/node/es/index.js +2 -2
- package/dist/node/es/internal/{object-2XgKQb4s.js → creators-Cb-W0me8.js} +67 -215
- package/dist/node/es/internal/creators-Cb-W0me8.js.map +1 -0
- package/dist/node/es/internal/index-D3XxyPtg.js +20 -0
- package/dist/node/es/internal/index-D3XxyPtg.js.map +1 -0
- package/dist/node/es/internal/index-DaOQbHFb.js +47 -0
- package/dist/node/es/internal/index-DaOQbHFb.js.map +1 -0
- package/dist/node/es/internal/{index-D4oqm7Ua.js → index-nspj7nvI.js} +4 -3
- package/dist/{browser/es/internal/index-D_fwH6L3.js.map → node/es/internal/index-nspj7nvI.js.map} +1 -1
- package/dist/node/es/internal/object-8ji4ZOox.js +184 -0
- package/dist/node/es/internal/object-8ji4ZOox.js.map +1 -0
- package/dist/node/es/utils.js +43 -0
- package/dist/node/es/utils.js.map +1 -0
- package/dist/node/src/document/utils/base.d.ts.map +1 -1
- package/dist/node/src/document/utils/errors.d.ts +10 -0
- package/dist/node/src/document/utils/errors.d.ts.map +1 -0
- package/dist/node/src/document/utils/index.d.ts +1 -0
- package/dist/node/src/document/utils/index.d.ts.map +1 -1
- package/dist/node/utils.d.ts +2 -0
- package/dist/node/vite.config.d.ts.map +1 -1
- package/package.json +11 -1
- package/dist/browser/cjs/internal/index-B62DRxDu.js +0 -58
- package/dist/browser/cjs/internal/index-B62DRxDu.js.map +0 -1
- package/dist/browser/cjs/internal/object-BdIbCX0K.js.map +0 -1
- package/dist/browser/es/internal/index-CPWf201E.js +0 -59
- package/dist/browser/es/internal/index-CPWf201E.js.map +0 -1
- package/dist/browser/es/internal/object-oB7gkKNr.js.map +0 -1
- package/dist/node/cjs/internal/index-DozfRrse.js +0 -58
- package/dist/node/cjs/internal/index-DozfRrse.js.map +0 -1
- package/dist/node/cjs/internal/object-DqFXYK4g.js.map +0 -1
- package/dist/node/es/internal/index-Bf87b5UD.js +0 -59
- package/dist/node/es/internal/index-Bf87b5UD.js.map +0 -1
- package/dist/node/es/internal/object-2XgKQb4s.js.map +0 -1
|
@@ -3,10 +3,11 @@ var __defProp = Object.defineProperty;
|
|
|
3
3
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
4
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
5
|
var _a;
|
|
6
|
-
const
|
|
6
|
+
const creators = require("./creators-BFR88wjA.js");
|
|
7
7
|
require("mutative");
|
|
8
|
-
require("jszip");
|
|
9
8
|
const zod$1 = require("zod");
|
|
9
|
+
require("jszip");
|
|
10
|
+
const object = require("./object-Cffgxa2p.js");
|
|
10
11
|
const SPLIT_LOWER_UPPER_RE = new RegExp("([\\p{Ll}\\d])(\\p{Lu})", "gu");
|
|
11
12
|
const SPLIT_UPPER_UPPER_RE = new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])", "gu");
|
|
12
13
|
const SPLIT_SEPARATE_NUMBER_RE = new RegExp("(\\d)\\p{Ll}|(\\p{L})\\d", "u");
|
|
@@ -1601,7 +1602,7 @@ const reducer$1 = {
|
|
|
1601
1602
|
}
|
|
1602
1603
|
};
|
|
1603
1604
|
const stateReducer = (state, action) => {
|
|
1604
|
-
if (
|
|
1605
|
+
if (creators.isBaseAction(action)) {
|
|
1605
1606
|
return state;
|
|
1606
1607
|
}
|
|
1607
1608
|
switch (action.type) {
|
|
@@ -1809,7 +1810,7 @@ const stateReducer = (state, action) => {
|
|
|
1809
1810
|
return state;
|
|
1810
1811
|
}
|
|
1811
1812
|
};
|
|
1812
|
-
const reducer =
|
|
1813
|
+
const reducer = creators.createReducer(stateReducer);
|
|
1813
1814
|
const initialGlobalState = {
|
|
1814
1815
|
id: "",
|
|
1815
1816
|
name: "",
|
|
@@ -1849,38 +1850,38 @@ const utils$1 = {
|
|
|
1849
1850
|
};
|
|
1850
1851
|
},
|
|
1851
1852
|
createExtendedState(extendedState) {
|
|
1852
|
-
return
|
|
1853
|
+
return creators.createExtendedState(
|
|
1853
1854
|
{ ...extendedState, documentType: "powerhouse/document-model" },
|
|
1854
1855
|
utils$1.createState
|
|
1855
1856
|
);
|
|
1856
1857
|
},
|
|
1857
1858
|
createDocument(state) {
|
|
1858
|
-
return
|
|
1859
|
+
return creators.createDocument(
|
|
1859
1860
|
utils$1.createExtendedState(state),
|
|
1860
1861
|
utils$1.createState
|
|
1861
1862
|
);
|
|
1862
1863
|
},
|
|
1863
1864
|
saveToFile(document, path, name) {
|
|
1864
|
-
return
|
|
1865
|
+
return creators.saveToFile(document, path, "phdm", name);
|
|
1865
1866
|
},
|
|
1866
1867
|
saveToFileHandle(document, input) {
|
|
1867
|
-
return
|
|
1868
|
+
return creators.saveToFileHandle(document, input);
|
|
1868
1869
|
},
|
|
1869
1870
|
loadFromFile(path) {
|
|
1870
|
-
return
|
|
1871
|
+
return creators.loadFromFile(path, reducer);
|
|
1871
1872
|
},
|
|
1872
1873
|
loadFromInput(input) {
|
|
1873
|
-
return
|
|
1874
|
+
return creators.loadFromInput(input, reducer);
|
|
1874
1875
|
}
|
|
1875
1876
|
};
|
|
1876
|
-
const setModelName = (input) =>
|
|
1877
|
-
const setModelId = (input) =>
|
|
1878
|
-
const setModelExtension = (input) =>
|
|
1879
|
-
const setModelDescription = (input) =>
|
|
1877
|
+
const setModelName = (input) => creators.createAction("SET_MODEL_NAME", { ...input });
|
|
1878
|
+
const setModelId = (input) => creators.createAction("SET_MODEL_ID", { ...input });
|
|
1879
|
+
const setModelExtension = (input) => creators.createAction("SET_MODEL_EXTENSION", { ...input });
|
|
1880
|
+
const setModelDescription = (input) => creators.createAction("SET_MODEL_DESCRIPTION", {
|
|
1880
1881
|
...input
|
|
1881
1882
|
});
|
|
1882
|
-
const setAuthorName = (input) =>
|
|
1883
|
-
const setAuthorWebsite = (input) =>
|
|
1883
|
+
const setAuthorName = (input) => creators.createAction("SET_AUTHOR_NAME", { ...input });
|
|
1884
|
+
const setAuthorWebsite = (input) => creators.createAction("SET_AUTHOR_WEBSITE", { ...input });
|
|
1884
1885
|
class DocumentModel_Header extends object.BaseDocument {
|
|
1885
1886
|
setModelName(input, options) {
|
|
1886
1887
|
return this.dispatch(setModelName(input), options);
|
|
@@ -1901,17 +1902,17 @@ class DocumentModel_Header extends object.BaseDocument {
|
|
|
1901
1902
|
return this.dispatch(setAuthorWebsite(input), options);
|
|
1902
1903
|
}
|
|
1903
1904
|
}
|
|
1904
|
-
const addChangeLogItem = (input) =>
|
|
1905
|
-
const updateChangeLogItem = (input) =>
|
|
1905
|
+
const addChangeLogItem = (input) => creators.createAction("ADD_CHANGE_LOG_ITEM", { ...input });
|
|
1906
|
+
const updateChangeLogItem = (input) => creators.createAction("UPDATE_CHANGE_LOG_ITEM", {
|
|
1906
1907
|
...input
|
|
1907
1908
|
});
|
|
1908
|
-
const deleteChangeLogItem = (input) =>
|
|
1909
|
+
const deleteChangeLogItem = (input) => creators.createAction("DELETE_CHANGE_LOG_ITEM", {
|
|
1909
1910
|
...input
|
|
1910
1911
|
});
|
|
1911
|
-
const reorderChangeLogItems = (input) =>
|
|
1912
|
+
const reorderChangeLogItems = (input) => creators.createAction("REORDER_CHANGE_LOG_ITEMS", {
|
|
1912
1913
|
...input
|
|
1913
1914
|
});
|
|
1914
|
-
const releaseNewVersion = () =>
|
|
1915
|
+
const releaseNewVersion = () => creators.createAction("RELEASE_NEW_VERSION");
|
|
1915
1916
|
class DocumentModel_Versioning extends object.BaseDocument {
|
|
1916
1917
|
addChangeLogItem(input, options) {
|
|
1917
1918
|
return this.dispatch(addChangeLogItem(input), options);
|
|
@@ -1929,13 +1930,13 @@ class DocumentModel_Versioning extends object.BaseDocument {
|
|
|
1929
1930
|
return this.dispatch(releaseNewVersion(), options);
|
|
1930
1931
|
}
|
|
1931
1932
|
}
|
|
1932
|
-
const addModule = (input) =>
|
|
1933
|
-
const setModuleName = (input) =>
|
|
1934
|
-
const setModuleDescription = (input) =>
|
|
1933
|
+
const addModule = (input) => creators.createAction("ADD_MODULE", { ...input });
|
|
1934
|
+
const setModuleName = (input) => creators.createAction("SET_MODULE_NAME", { ...input });
|
|
1935
|
+
const setModuleDescription = (input) => creators.createAction("SET_MODULE_DESCRIPTION", {
|
|
1935
1936
|
...input
|
|
1936
1937
|
});
|
|
1937
|
-
const deleteModule = (input) =>
|
|
1938
|
-
const reorderModules = (input) =>
|
|
1938
|
+
const deleteModule = (input) => creators.createAction("DELETE_MODULE", { ...input });
|
|
1939
|
+
const reorderModules = (input) => creators.createAction("REORDER_MODULES", { ...input });
|
|
1939
1940
|
class DocumentModel_Module extends object.BaseDocument {
|
|
1940
1941
|
addModule(input, options) {
|
|
1941
1942
|
return this.dispatch(addModule(input), options);
|
|
@@ -1953,25 +1954,25 @@ class DocumentModel_Module extends object.BaseDocument {
|
|
|
1953
1954
|
return this.dispatch(reorderModules(input), options);
|
|
1954
1955
|
}
|
|
1955
1956
|
}
|
|
1956
|
-
const addOperationError = (input) =>
|
|
1957
|
-
const setOperationErrorCode = (input) =>
|
|
1957
|
+
const addOperationError = (input) => creators.createAction("ADD_OPERATION_ERROR", { ...input });
|
|
1958
|
+
const setOperationErrorCode = (input) => creators.createAction("SET_OPERATION_ERROR_CODE", {
|
|
1958
1959
|
...input
|
|
1959
1960
|
});
|
|
1960
|
-
const setOperationErrorName = (input) =>
|
|
1961
|
+
const setOperationErrorName = (input) => creators.createAction("SET_OPERATION_ERROR_NAME", {
|
|
1961
1962
|
...input
|
|
1962
1963
|
});
|
|
1963
|
-
const setOperationErrorDescription = (input) =>
|
|
1964
|
+
const setOperationErrorDescription = (input) => creators.createAction(
|
|
1964
1965
|
"SET_OPERATION_ERROR_DESCRIPTION",
|
|
1965
1966
|
{ ...input }
|
|
1966
1967
|
);
|
|
1967
|
-
const setOperationErrorTemplate = (input) =>
|
|
1968
|
+
const setOperationErrorTemplate = (input) => creators.createAction(
|
|
1968
1969
|
"SET_OPERATION_ERROR_TEMPLATE",
|
|
1969
1970
|
{ ...input }
|
|
1970
1971
|
);
|
|
1971
|
-
const deleteOperationError = (input) =>
|
|
1972
|
+
const deleteOperationError = (input) => creators.createAction("DELETE_OPERATION_ERROR", {
|
|
1972
1973
|
...input
|
|
1973
1974
|
});
|
|
1974
|
-
const reorderOperationErrors = (input) =>
|
|
1975
|
+
const reorderOperationErrors = (input) => creators.createAction("REORDER_OPERATION_ERRORS", {
|
|
1975
1976
|
...input
|
|
1976
1977
|
});
|
|
1977
1978
|
class DocumentModel_OperationError extends object.BaseDocument {
|
|
@@ -1997,16 +1998,16 @@ class DocumentModel_OperationError extends object.BaseDocument {
|
|
|
1997
1998
|
return this.dispatch(reorderOperationErrors(input), options);
|
|
1998
1999
|
}
|
|
1999
2000
|
}
|
|
2000
|
-
const addOperationExample = (input) =>
|
|
2001
|
+
const addOperationExample = (input) => creators.createAction("ADD_OPERATION_EXAMPLE", {
|
|
2001
2002
|
...input
|
|
2002
2003
|
});
|
|
2003
|
-
const updateOperationExample = (input) =>
|
|
2004
|
+
const updateOperationExample = (input) => creators.createAction("UPDATE_OPERATION_EXAMPLE", {
|
|
2004
2005
|
...input
|
|
2005
2006
|
});
|
|
2006
|
-
const deleteOperationExample = (input) =>
|
|
2007
|
+
const deleteOperationExample = (input) => creators.createAction("DELETE_OPERATION_EXAMPLE", {
|
|
2007
2008
|
...input
|
|
2008
2009
|
});
|
|
2009
|
-
const reorderOperationExamples = (input) =>
|
|
2010
|
+
const reorderOperationExamples = (input) => creators.createAction("REORDER_OPERATION_EXAMPLES", {
|
|
2010
2011
|
...input
|
|
2011
2012
|
});
|
|
2012
2013
|
class DocumentModel_OperationExample extends object.BaseDocument {
|
|
@@ -2023,22 +2024,22 @@ class DocumentModel_OperationExample extends object.BaseDocument {
|
|
|
2023
2024
|
return this.dispatch(reorderOperationExamples(input), options);
|
|
2024
2025
|
}
|
|
2025
2026
|
}
|
|
2026
|
-
const addOperation = (input) =>
|
|
2027
|
-
const setOperationName = (input) =>
|
|
2028
|
-
const setOperationScope = (input) =>
|
|
2029
|
-
const setOperationSchema = (input) =>
|
|
2030
|
-
const setOperationDescription = (input) =>
|
|
2027
|
+
const addOperation = (input) => creators.createAction("ADD_OPERATION", { ...input });
|
|
2028
|
+
const setOperationName = (input) => creators.createAction("SET_OPERATION_NAME", { ...input });
|
|
2029
|
+
const setOperationScope = (input) => creators.createAction("SET_OPERATION_SCOPE", { ...input });
|
|
2030
|
+
const setOperationSchema = (input) => creators.createAction("SET_OPERATION_SCHEMA", { ...input });
|
|
2031
|
+
const setOperationDescription = (input) => creators.createAction("SET_OPERATION_DESCRIPTION", {
|
|
2031
2032
|
...input
|
|
2032
2033
|
});
|
|
2033
|
-
const setOperationTemplate = (input) =>
|
|
2034
|
+
const setOperationTemplate = (input) => creators.createAction("SET_OPERATION_TEMPLATE", {
|
|
2034
2035
|
...input
|
|
2035
2036
|
});
|
|
2036
|
-
const setOperationReducer = (input) =>
|
|
2037
|
+
const setOperationReducer = (input) => creators.createAction("SET_OPERATION_REDUCER", {
|
|
2037
2038
|
...input
|
|
2038
2039
|
});
|
|
2039
|
-
const moveOperation = (input) =>
|
|
2040
|
-
const deleteOperation = (input) =>
|
|
2041
|
-
const reorderModuleOperations = (input) =>
|
|
2040
|
+
const moveOperation = (input) => creators.createAction("MOVE_OPERATION", { ...input });
|
|
2041
|
+
const deleteOperation = (input) => creators.createAction("DELETE_OPERATION", { ...input });
|
|
2042
|
+
const reorderModuleOperations = (input) => creators.createAction("REORDER_MODULE_OPERATIONS", {
|
|
2042
2043
|
...input
|
|
2043
2044
|
});
|
|
2044
2045
|
class DocumentModel_Operation extends object.BaseDocument {
|
|
@@ -2073,12 +2074,12 @@ class DocumentModel_Operation extends object.BaseDocument {
|
|
|
2073
2074
|
return this.dispatch(reorderModuleOperations(input), options);
|
|
2074
2075
|
}
|
|
2075
2076
|
}
|
|
2076
|
-
const setStateSchema = (input) =>
|
|
2077
|
-
const setInitialState = (input) =>
|
|
2078
|
-
const addStateExample = (input) =>
|
|
2079
|
-
const updateStateExample = (input) =>
|
|
2080
|
-
const deleteStateExample = (input) =>
|
|
2081
|
-
const reorderStateExamples = (input) =>
|
|
2077
|
+
const setStateSchema = (input) => creators.createAction("SET_STATE_SCHEMA", { ...input });
|
|
2078
|
+
const setInitialState = (input) => creators.createAction("SET_INITIAL_STATE", { ...input });
|
|
2079
|
+
const addStateExample = (input) => creators.createAction("ADD_STATE_EXAMPLE", { ...input });
|
|
2080
|
+
const updateStateExample = (input) => creators.createAction("UPDATE_STATE_EXAMPLE", { ...input });
|
|
2081
|
+
const deleteStateExample = (input) => creators.createAction("DELETE_STATE_EXAMPLE", { ...input });
|
|
2082
|
+
const reorderStateExamples = (input) => creators.createAction("REORDER_STATE_EXAMPLES", {
|
|
2082
2083
|
...input
|
|
2083
2084
|
});
|
|
2084
2085
|
class DocumentModel_State extends object.BaseDocument {
|
|
@@ -2174,7 +2175,7 @@ const DocumentModelActions = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Objec
|
|
|
2174
2175
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2175
2176
|
const Document = DocumentModel$1;
|
|
2176
2177
|
const utils = { ...utils$1, ...customUtils };
|
|
2177
|
-
const actions = { ...
|
|
2178
|
+
const actions = { ...creators.BaseActions, ...DocumentModelActions };
|
|
2178
2179
|
const module$1 = {
|
|
2179
2180
|
Document,
|
|
2180
2181
|
reducer,
|
|
@@ -2212,4 +2213,4 @@ exports.validateModuleOperation = validateModuleOperation;
|
|
|
2212
2213
|
exports.validateModules = validateModules;
|
|
2213
2214
|
exports.validateStateSchemaName = validateStateSchemaName;
|
|
2214
2215
|
exports.zod = zod;
|
|
2215
|
-
//# sourceMappingURL=index-
|
|
2216
|
+
//# sourceMappingURL=index-sKyQchiV.js.map
|