document-model 1.0.22 → 1.0.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/browser/document-model.cjs +1 -1
- package/dist/browser/document-model.js +2 -2
- package/dist/browser/document.cjs +1 -1
- package/dist/browser/document.js +4 -4
- package/dist/browser/index.cjs +1 -1
- package/dist/browser/index.js +3 -3
- package/dist/browser/internal/{index-k0_xGFJa.js → index-8aac3662.js} +400 -398
- package/dist/browser/internal/index-8fceb2dc.js +1 -0
- package/dist/browser/internal/index-cd28e4ab.js +22 -0
- package/dist/browser/internal/index-e127ba7e.js +36 -0
- package/dist/browser/internal/{object-wtPuW7QY.js → object-67d1240b.js} +409 -359
- package/dist/browser/internal/object-ba4e810d.js +6 -0
- package/dist/browser/src/document/actions/creators.d.ts +3 -2
- package/dist/browser/src/document/actions/types.d.ts +1 -1
- package/dist/browser/src/document/object.d.ts +58 -2
- package/dist/browser/src/document/reducer.d.ts +2 -2
- package/dist/browser/src/document/schema/types.d.ts +9 -3
- package/dist/browser/src/document/signal.d.ts +7 -1
- package/dist/browser/src/document/types.d.ts +12 -1
- package/dist/browser/src/document/utils/base.d.ts +15 -2
- package/dist/browser/src/document-model/gen/header/object.d.ts +7 -6
- package/dist/browser/src/document-model/gen/module/object.d.ts +6 -5
- package/dist/browser/src/document-model/gen/operation/object.d.ts +11 -10
- package/dist/browser/src/document-model/gen/operation-error/object.d.ts +8 -7
- package/dist/browser/src/document-model/gen/operation-example/object.d.ts +5 -4
- package/dist/browser/src/document-model/gen/reducer.d.ts +2 -0
- package/dist/browser/src/document-model/gen/state/object.d.ts +7 -6
- package/dist/browser/src/document-model/gen/versioning/object.d.ts +6 -5
- package/dist/browser/src/document-model/index.d.ts +2 -1
- package/dist/browser/test/document/skip-operations.test.d.ts +1 -0
- package/dist/browser/test/document-model/skip-operations.test.d.ts +1 -0
- package/dist/browser/test/helpers.d.ts +5 -2
- package/dist/node/document-model.cjs +1 -1
- package/dist/node/document-model.js +2 -2
- package/dist/node/document.cjs +1 -1
- package/dist/node/document.js +4 -4
- package/dist/node/index.cjs +1 -1
- package/dist/node/index.js +3 -3
- package/dist/node/internal/index-ac24dd92.js +36 -0
- package/dist/node/internal/index-c75a9c7a.js +1 -0
- package/dist/node/internal/{index-vqhz-N10.js → index-e9f12d45.js} +400 -398
- package/dist/node/internal/index-f04f94a6.js +22 -0
- package/dist/node/internal/object-10b89c54.js +1 -0
- package/dist/node/internal/{object-yzJ3jRpE.js → object-cb276649.js} +317 -267
- package/dist/node/src/document/actions/creators.d.ts +3 -2
- package/dist/node/src/document/actions/types.d.ts +1 -1
- package/dist/node/src/document/object.d.ts +58 -2
- package/dist/node/src/document/reducer.d.ts +2 -2
- package/dist/node/src/document/schema/types.d.ts +9 -3
- package/dist/node/src/document/signal.d.ts +7 -1
- package/dist/node/src/document/types.d.ts +12 -1
- package/dist/node/src/document/utils/base.d.ts +15 -2
- package/dist/node/src/document-model/gen/header/object.d.ts +7 -6
- package/dist/node/src/document-model/gen/module/object.d.ts +6 -5
- package/dist/node/src/document-model/gen/operation/object.d.ts +11 -10
- package/dist/node/src/document-model/gen/operation-error/object.d.ts +8 -7
- package/dist/node/src/document-model/gen/operation-example/object.d.ts +5 -4
- package/dist/node/src/document-model/gen/reducer.d.ts +2 -0
- package/dist/node/src/document-model/gen/state/object.d.ts +7 -6
- package/dist/node/src/document-model/gen/versioning/object.d.ts +6 -5
- package/dist/node/src/document-model/index.d.ts +2 -1
- package/dist/node/test/document/skip-operations.test.d.ts +1 -0
- package/dist/node/test/document-model/skip-operations.test.d.ts +1 -0
- package/dist/node/test/helpers.d.ts +5 -2
- package/package.json +1 -1
- package/dist/browser/internal/index-BGvdUwMj.js +0 -1
- package/dist/browser/internal/index-ZaSXpgfR.js +0 -22
- package/dist/browser/internal/index-vHDbgY8i.js +0 -34
- package/dist/browser/internal/object-fIfH8K9b.js +0 -6
- package/dist/node/internal/index-3_D7m254.js +0 -34
- package/dist/node/internal/index-ffEJwj4v.js +0 -22
- package/dist/node/internal/index-frYzO4l6.js +0 -1
- package/dist/node/internal/object-Vf10stKL.js +0 -1
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { BaseDocument } from '../../../document/object';
|
|
2
2
|
import { AddOperationExampleInput, UpdateOperationExampleInput, DeleteOperationExampleInput, ReorderOperationExamplesInput, DocumentModelState, DocumentModelLocalState } from '../types';
|
|
3
3
|
import { DocumentModelAction } from '../actions';
|
|
4
|
+
import { ReducerOptions } from '../../../document';
|
|
4
5
|
export default class DocumentModel_OperationExample extends BaseDocument<DocumentModelState, DocumentModelAction, DocumentModelLocalState> {
|
|
5
|
-
addOperationExample(input: AddOperationExampleInput): this;
|
|
6
|
-
updateOperationExample(input: UpdateOperationExampleInput): this;
|
|
7
|
-
deleteOperationExample(input: DeleteOperationExampleInput): this;
|
|
8
|
-
reorderOperationExamples(input: ReorderOperationExamplesInput): this;
|
|
6
|
+
addOperationExample(input: AddOperationExampleInput, options?: ReducerOptions): this;
|
|
7
|
+
updateOperationExample(input: UpdateOperationExampleInput, options?: ReducerOptions): this;
|
|
8
|
+
deleteOperationExample(input: DeleteOperationExampleInput, options?: ReducerOptions): this;
|
|
9
|
+
reorderOperationExamples(input: ReorderOperationExamplesInput, options?: ReducerOptions): this;
|
|
9
10
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { ImmutableStateReducer } from '../../document/types';
|
|
1
2
|
import { DocumentModelLocalState, DocumentModelState } from './schema';
|
|
2
3
|
import { DocumentModelAction } from './actions';
|
|
4
|
+
export declare const stateReducer: ImmutableStateReducer<DocumentModelState, DocumentModelAction, DocumentModelLocalState>;
|
|
3
5
|
export declare const reducer: import("../../document/types").Reducer<DocumentModelState, DocumentModelAction, DocumentModelLocalState>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { BaseDocument } from '../../../document/object';
|
|
2
2
|
import { SetStateSchemaInput, SetInitialStateInput, AddStateExampleInput, UpdateStateExampleInput, DeleteStateExampleInput, ReorderStateExamplesInput, DocumentModelState, DocumentModelLocalState } from '../types';
|
|
3
3
|
import { DocumentModelAction } from '../actions';
|
|
4
|
+
import { ReducerOptions } from '../../../document';
|
|
4
5
|
export default class DocumentModel_State extends BaseDocument<DocumentModelState, DocumentModelAction, DocumentModelLocalState> {
|
|
5
|
-
setStateSchema(input: SetStateSchemaInput): this;
|
|
6
|
-
setInitialState(input: SetInitialStateInput): this;
|
|
7
|
-
addStateExample(input: AddStateExampleInput): this;
|
|
8
|
-
updateStateExample(input: UpdateStateExampleInput): this;
|
|
9
|
-
deleteStateExample(input: DeleteStateExampleInput): this;
|
|
10
|
-
reorderStateExamples(input: ReorderStateExamplesInput): this;
|
|
6
|
+
setStateSchema(input: SetStateSchemaInput, options?: ReducerOptions): this;
|
|
7
|
+
setInitialState(input: SetInitialStateInput, options?: ReducerOptions): this;
|
|
8
|
+
addStateExample(input: AddStateExampleInput, options?: ReducerOptions): this;
|
|
9
|
+
updateStateExample(input: UpdateStateExampleInput, options?: ReducerOptions): this;
|
|
10
|
+
deleteStateExample(input: DeleteStateExampleInput, options?: ReducerOptions): this;
|
|
11
|
+
reorderStateExamples(input: ReorderStateExamplesInput, options?: ReducerOptions): this;
|
|
11
12
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { BaseDocument } from '../../../document/object';
|
|
2
2
|
import { AddChangeLogItemInput, UpdateChangeLogItemInput, DeleteChangeLogItemInput, ReorderChangeLogItemsInput, DocumentModelState, DocumentModelLocalState } from '../types';
|
|
3
3
|
import { DocumentModelAction } from '../actions';
|
|
4
|
+
import { ReducerOptions } from '../../../document';
|
|
4
5
|
export default class DocumentModel_Versioning extends BaseDocument<DocumentModelState, DocumentModelAction, DocumentModelLocalState> {
|
|
5
|
-
addChangeLogItem(input: AddChangeLogItemInput): this;
|
|
6
|
-
updateChangeLogItem(input: UpdateChangeLogItemInput): this;
|
|
7
|
-
deleteChangeLogItem(input: DeleteChangeLogItemInput): this;
|
|
8
|
-
reorderChangeLogItems(input: ReorderChangeLogItemsInput): this;
|
|
9
|
-
releaseNewVersion(): this;
|
|
6
|
+
addChangeLogItem(input: AddChangeLogItemInput, options?: ReducerOptions): this;
|
|
7
|
+
updateChangeLogItem(input: UpdateChangeLogItemInput, options?: ReducerOptions): this;
|
|
8
|
+
deleteChangeLogItem(input: DeleteChangeLogItemInput, options?: ReducerOptions): this;
|
|
9
|
+
reorderChangeLogItems(input: ReorderChangeLogItemsInput, options?: ReducerOptions): this;
|
|
10
|
+
releaseNewVersion(options?: ReducerOptions): this;
|
|
10
11
|
}
|
|
@@ -63,10 +63,11 @@ declare const actions: {
|
|
|
63
63
|
deleteStateExample: (input: import("./gen").DeleteStateExampleInput) => import("./gen").DeleteStateExampleAction;
|
|
64
64
|
reorderStateExamples: (input: import("./gen").ReorderStateExamplesInput) => import("./gen").ReorderStateExamplesAction;
|
|
65
65
|
setName: (name: string) => import("../document").SetNameAction;
|
|
66
|
-
undo: (
|
|
66
|
+
undo: (skip?: number, scope?: import("../document").OperationScope) => import("../document").UndoAction;
|
|
67
67
|
redo: (count?: number, scope?: import("../document").OperationScope) => import("../document").RedoAction;
|
|
68
68
|
prune: (start?: number | undefined, end?: number | undefined, scope?: import("../document").OperationScope) => import("../document").PruneAction;
|
|
69
69
|
loadState: <S, T>(state: Pick<import("../document").ExtendedState<S, T>, "name" | "state">, operations: number) => import("../document").LoadStateAction;
|
|
70
|
+
noop: (scope?: import("../document").OperationScope) => import("../document").NOOPAction;
|
|
70
71
|
};
|
|
71
72
|
export declare const module: _DocumentModel<DocumentModelState, DocumentModelAction, DocumentModelLocalState, DocumentModel>;
|
|
72
73
|
export * from './custom/utils';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Action, Operation } from '../src/document/types';
|
|
1
|
+
import { Action, ImmutableStateReducer, Operation, OperationScope } from '../src/document/types';
|
|
2
2
|
export declare const emptyReducer: import("../src/document/types").Reducer<unknown, Action, unknown>;
|
|
3
3
|
export interface IncrementAction extends Action {
|
|
4
4
|
type: 'INCREMENT';
|
|
@@ -20,10 +20,13 @@ export type CountLocalState = {
|
|
|
20
20
|
export declare const increment: () => IncrementAction;
|
|
21
21
|
export declare const decrement: () => DecrementAction;
|
|
22
22
|
export declare const setLocalName: (name: string) => SetLocalNameAction;
|
|
23
|
+
export declare const baseCountReducer: ImmutableStateReducer<CountState, CountAction, CountLocalState>;
|
|
23
24
|
export declare const countReducer: import("../src/document/types").Reducer<CountState, CountAction, CountLocalState>;
|
|
24
25
|
export declare const mapOperations: (operations: Operation[]) => {
|
|
25
26
|
input: unknown;
|
|
26
27
|
type: string;
|
|
27
28
|
index: number;
|
|
28
|
-
scope:
|
|
29
|
+
scope: OperationScope;
|
|
30
|
+
skip: number;
|
|
29
31
|
}[];
|
|
32
|
+
export declare const createFakeOperation: (index?: number, skip?: number, scope?: OperationScope) => Operation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./internal/object-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./internal/object-10b89c54.js");require("json-stringify-deterministic");require("immer");require("jszip");require("crypto");require("fs");require("https");require("path");const e=require("./internal/index-f04f94a6.js");require("zod");exports.Document=e.Document;exports.DocumentModel=e.DocumentModel$1;exports.actions=e.actions;exports.documentModel=e.documentModel;exports.module=e.module;exports.reducer=e.reducer;exports.utils=e.utils;exports.z=e.zod;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./internal/object-
|
|
1
|
+
import "./internal/object-cb276649.js";
|
|
2
2
|
import "json-stringify-deterministic";
|
|
3
3
|
import "immer";
|
|
4
4
|
import "jszip";
|
|
@@ -6,7 +6,7 @@ import "crypto";
|
|
|
6
6
|
import "fs";
|
|
7
7
|
import "https";
|
|
8
8
|
import "path";
|
|
9
|
-
import { b as d, a as l, c as n, d as D, m as M, r as b, u as f, z as x } from "./internal/index-
|
|
9
|
+
import { b as d, a as l, c as n, d as D, m as M, r as b, u as f, z as x } from "./internal/index-e9f12d45.js";
|
|
10
10
|
import "zod";
|
|
11
11
|
export {
|
|
12
12
|
d as Document,
|
package/dist/node/document.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./internal/object-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./internal/object-10b89c54.js"),r=require("./internal/index-c75a9c7a.js");require("json-stringify-deterministic");require("immer");require("zod");require("jszip");require("crypto");require("fs");require("https");require("path");exports.BaseDocument=e.BaseDocument;exports.actions=e.BaseActions;exports.applyMixins=e.applyMixins;exports.baseReducer=e.baseReducer;exports.z=e.zod;exports.utils=r.index;
|
package/dist/node/document.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as
|
|
2
|
-
import { i as b } from "./internal/index-
|
|
1
|
+
import { B as n, h as u, g as x, w as f, z as l } from "./internal/object-cb276649.js";
|
|
2
|
+
import { i as b } from "./internal/index-ac24dd92.js";
|
|
3
3
|
import "json-stringify-deterministic";
|
|
4
4
|
import "immer";
|
|
5
5
|
import "zod";
|
|
@@ -9,8 +9,8 @@ import "fs";
|
|
|
9
9
|
import "https";
|
|
10
10
|
import "path";
|
|
11
11
|
export {
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
n as BaseDocument,
|
|
13
|
+
u as actions,
|
|
14
14
|
x as applyMixins,
|
|
15
15
|
f as baseReducer,
|
|
16
16
|
b as utils,
|
package/dist/node/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./internal/index-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./internal/index-c75a9c7a.js"),o=require("./internal/index-f04f94a6.js");require("./internal/object-10b89c54.js");require("json-stringify-deterministic");require("immer");require("zod");require("jszip");require("crypto");require("fs");require("https");require("path");const u={"powerhouse/document":e.Document,"powerhouse/document-model":o.DocumentModel},r={Document:e.Document,DocumentModel:o.DocumentModel};exports.Document=e.Document;exports.DocumentModel=o.DocumentModel;exports.DocumentModels=u;exports.default=r;
|
package/dist/node/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { D as o } from "./internal/index-
|
|
2
|
-
import { D as t } from "./internal/index-
|
|
3
|
-
import "./internal/object-
|
|
1
|
+
import { D as o } from "./internal/index-ac24dd92.js";
|
|
2
|
+
import { D as t } from "./internal/index-e9f12d45.js";
|
|
3
|
+
import "./internal/object-cb276649.js";
|
|
4
4
|
import "json-stringify-deterministic";
|
|
5
5
|
import "immer";
|
|
6
6
|
import "zod";
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { f as e, b as a, a as s, c as t, j as o, k as r, m as n, n as i, o as l, i as c, l as p, e as d, p as u, r as m, q as y, t as O, s as b, d as _, u as g, v as F, B as f, h as D, g as S, w as h, z as j } from "./object-cb276649.js";
|
|
2
|
+
const v = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3
|
+
__proto__: null,
|
|
4
|
+
createAction: e,
|
|
5
|
+
createDocument: a,
|
|
6
|
+
createExtendedState: s,
|
|
7
|
+
createReducer: t,
|
|
8
|
+
createZip: o,
|
|
9
|
+
getLocalFile: r,
|
|
10
|
+
getRemoteFile: n,
|
|
11
|
+
hashDocument: i,
|
|
12
|
+
hashKey: l,
|
|
13
|
+
isBaseAction: c,
|
|
14
|
+
loadFromFile: p,
|
|
15
|
+
loadFromInput: d,
|
|
16
|
+
mapSkippedOperations: u,
|
|
17
|
+
readOnly: m,
|
|
18
|
+
replayDocument: y,
|
|
19
|
+
replayOperations: O,
|
|
20
|
+
saveToFile: b,
|
|
21
|
+
saveToFileHandle: _,
|
|
22
|
+
sortMappedOperations: g,
|
|
23
|
+
sortOperations: F
|
|
24
|
+
}, Symbol.toStringTag, { value: "Module" })), x = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
25
|
+
__proto__: null,
|
|
26
|
+
BaseDocument: f,
|
|
27
|
+
actions: D,
|
|
28
|
+
applyMixins: S,
|
|
29
|
+
baseReducer: h,
|
|
30
|
+
utils: v,
|
|
31
|
+
z: j
|
|
32
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
33
|
+
export {
|
|
34
|
+
x as D,
|
|
35
|
+
v as i
|
|
36
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("./object-10b89c54.js"),t=Object.freeze(Object.defineProperty({__proto__:null,createAction:e.createAction,createDocument:e.createDocument,createExtendedState:e.createExtendedState,createReducer:e.createReducer,createZip:e.createZip,getLocalFile:e.getLocalFile,getRemoteFile:e.getRemoteFile,hashDocument:e.hashDocument,hashKey:e.hashKey,isBaseAction:e.isBaseAction,loadFromFile:e.loadFromFile,loadFromInput:e.loadFromInput,mapSkippedOperations:e.mapSkippedOperations,readOnly:e.readOnly,replayDocument:e.replayDocument,replayOperations:e.replayOperations,saveToFile:e.saveToFile,saveToFileHandle:e.saveToFileHandle,sortMappedOperations:e.sortMappedOperations,sortOperations:e.sortOperations},Symbol.toStringTag,{value:"Module"})),o=Object.freeze(Object.defineProperty({__proto__:null,BaseDocument:e.BaseDocument,actions:e.BaseActions,applyMixins:e.applyMixins,baseReducer:e.baseReducer,utils:t,z:e.zod},Symbol.toStringTag,{value:"Module"}));exports.Document=o;exports.index=t;
|