@fluidframework/fluid-static 0.50.0-41365 → 0.50.2
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/fluidContainer.d.ts +24 -1
- package/dist/fluidContainer.d.ts.map +1 -1
- package/dist/fluidContainer.js +6 -0
- package/dist/fluidContainer.js.map +1 -1
- package/lib/fluidContainer.d.ts +24 -1
- package/lib/fluidContainer.d.ts.map +1 -1
- package/lib/fluidContainer.js +6 -0
- package/lib/fluidContainer.js.map +1 -1
- package/package.json +11 -11
- package/src/fluidContainer.ts +28 -1
package/dist/fluidContainer.d.ts
CHANGED
|
@@ -41,9 +41,30 @@ import { RootDataObject } from "./rootDataObject";
|
|
|
41
41
|
* ```typescript
|
|
42
42
|
* () => void;
|
|
43
43
|
* ```
|
|
44
|
+
*
|
|
45
|
+
* ### "saved"
|
|
46
|
+
*
|
|
47
|
+
* The saved event is emitted when the `IFluidContainer` has local changes acknowledged by the service.
|
|
48
|
+
*
|
|
49
|
+
* #### Listener signature
|
|
50
|
+
*
|
|
51
|
+
* ```typescript
|
|
52
|
+
* () => void
|
|
53
|
+
* ```
|
|
54
|
+
*
|
|
55
|
+
* ### "dirty"
|
|
56
|
+
*
|
|
57
|
+
* The dirty event is emitted when the `IFluidContainer` has local changes that have not yet
|
|
58
|
+
* been acknowledged by the service.
|
|
59
|
+
*
|
|
60
|
+
* #### Listener signature
|
|
61
|
+
*
|
|
62
|
+
* ```typescript
|
|
63
|
+
* () => void
|
|
64
|
+
* ```
|
|
44
65
|
*/
|
|
45
66
|
export interface IFluidContainerEvents extends IEvent {
|
|
46
|
-
(event: "connected" | "dispose" | "disconnected", listener: () => void): void;
|
|
67
|
+
(event: "connected" | "dispose" | "disconnected" | "saved" | "dirty", listener: () => void): void;
|
|
47
68
|
}
|
|
48
69
|
/**
|
|
49
70
|
* The IFluidContainer provides an entrypoint into the client side of collaborative Fluid data. It provides access
|
|
@@ -110,6 +131,8 @@ export declare class FluidContainer extends TypedEventEmitter<IFluidContainerEve
|
|
|
110
131
|
private readonly connectedHandler;
|
|
111
132
|
private readonly disconnectedHandler;
|
|
112
133
|
private readonly disposedHandler;
|
|
134
|
+
private readonly savedHandler;
|
|
135
|
+
private readonly dirtyHandler;
|
|
113
136
|
constructor(container: Container, rootDataObject: RootDataObject);
|
|
114
137
|
/**
|
|
115
138
|
* {@inheritDoc IFluidContainer.isDirty}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fluidContainer.d.ts","sourceRoot":"","sources":["../src/fluidContainer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD
|
|
1
|
+
{"version":3,"file":"fluidContainer.d.ts","sourceRoot":"","sources":["../src/fluidContainer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AACpE,OAAO,EAAE,cAAc,E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ACzD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA4B;gBAGpC,SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,cAAc;IAUnD;;OAEG;IACF,IAAW,OAAO,IAAI,OAAO,CAE7B;IAED;;OAEG;IACH,IAAW,WAAW,IAAI,WAAW,CAEpC;IAED;;OAEG;IACH,IAAW,QAAQ,YAElB;IAED;;OAEG;IACH,IAAW,SAAS,YAEnB;IAED;;OAEG;IACH,IAAW,cAAc,mCAExB;IAED;;OAEG;IACU,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC;IAItC;;OAEG;IACU,MAAM,CAAC,CAAC,SAAS,cAAc,EAAE,WAAW,EAAE,mBAAmB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAI9F;;OAEG;IACI,OAAO;CAQjB"}
|
package/dist/fluidContainer.js
CHANGED
|
@@ -17,9 +17,13 @@ class FluidContainer extends common_utils_1.TypedEventEmitter {
|
|
|
17
17
|
this.connectedHandler = () => this.emit("connected");
|
|
18
18
|
this.disconnectedHandler = () => this.emit("disconnected");
|
|
19
19
|
this.disposedHandler = () => this.emit("disposed");
|
|
20
|
+
this.savedHandler = () => this.emit("saved");
|
|
21
|
+
this.dirtyHandler = () => this.emit("dirty");
|
|
20
22
|
container.on("connected", this.connectedHandler);
|
|
21
23
|
container.on("closed", this.disposedHandler);
|
|
22
24
|
container.on("disconnected", this.disconnectedHandler);
|
|
25
|
+
container.on("saved", this.savedHandler);
|
|
26
|
+
container.on("dirty", this.dirtyHandler);
|
|
23
27
|
}
|
|
24
28
|
/**
|
|
25
29
|
* {@inheritDoc IFluidContainer.isDirty}
|
|
@@ -71,6 +75,8 @@ class FluidContainer extends common_utils_1.TypedEventEmitter {
|
|
|
71
75
|
this.container.off("connected", this.connectedHandler);
|
|
72
76
|
this.container.off("closed", this.disposedHandler);
|
|
73
77
|
this.container.off("disconnected", this.disconnectedHandler);
|
|
78
|
+
this.container.off("saved", this.savedHandler);
|
|
79
|
+
this.container.off("dirty", this.dirtyHandler);
|
|
74
80
|
}
|
|
75
81
|
}
|
|
76
82
|
exports.FluidContainer = FluidContainer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fluidContainer.js","sourceRoot":"","sources":["../src/fluidContainer.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,+DAAiE;
|
|
1
|
+
{"version":3,"file":"fluidContainer.js","sourceRoot":"","sources":["../src/fluidContainer.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,+DAAiE;AAkIjE;;GAEG;AACH,MAAa,cAAe,SAAQ,gCAAwC;IAOxE,YACqB,SAAoB,EACpB,cAA8B;QAE/C,KAAK,EAAE,CAAC;QAHS,cAAS,GAAT,SAAS,CAAW;QACpB,mBAAc,GAAd,cAAc,CAAgB;QARlC,qBAAgB,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAChD,wBAAmB,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QACtD,oBAAe,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC9C,iBAAY,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACxC,iBAAY,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAOrD,SAAS,CAAC,EAAE,CAAC,WAAW,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;QACjD,SAAS,CAAC,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;QAC7C,SAAS,CAAC,EAAE,CAAC,cAAc,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;QACvD,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QACzC,SAAS,CAAC,EAAE,CAAC,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AAC;CACJ;AA/ED,wCA+EC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { TypedEventEmitter } from \"@fluidframework/common-utils\";\nimport { Container } from \"@fluidframework/container-loader\";\nimport { IFluidLoadable } from \"@fluidframework/core-interfaces\";\nimport { IEvent, IEventProvider } from \"@fluidframework/common-definitions\";\nimport { AttachState } from \"@fluidframework/container-definitions\";\nimport { LoadableObjectClass, LoadableObjectRecord } from \"./types\";\nimport { RootDataObject } from \"./rootDataObject\";\n\n/**\n * Events emitted from IFluidContainer.\n *\n * ### \"connected\"\n *\n * The connected event is emitted when the `IFluidContainer` completes connecting to the Fluid service.\n *\n * #### Listener signature\n *\n * ```typescript\n * () => void;\n * ```\n *\n * ### \"dispose\"\n *\n * The dispose event is emitted when the `IFluidContainer` is disposed, which permanently disables it.\n *\n * #### Listener signature\n *\n * ```typescript\n * () => void;\n * ```\n *\n * ### \"disconnected\"\n *\n * The disconnected event is emitted when the `IFluidContainer` becomes disconnected from the Fluid service.\n *\n * #### Listener signature\n *\n * ```typescript\n * () => void;\n * ```\n *\n * ### \"saved\"\n *\n * The saved event is emitted when the `IFluidContainer` has local changes acknowledged by the service.\n *\n * #### Listener signature\n *\n * ```typescript\n * () => void\n * ```\n *\n * ### \"dirty\"\n *\n * The dirty event is emitted when the `IFluidContainer` has local changes that have not yet\n * been acknowledged by the service.\n *\n * #### Listener signature\n *\n * ```typescript\n * () => void\n * ```\n */\nexport interface IFluidContainerEvents extends IEvent {\n (event: \"connected\" | \"dispose\" | \"disconnected\" | \"saved\" | \"dirty\", listener: () => void): void;\n}\n\n/**\n * The IFluidContainer provides an entrypoint into the client side of collaborative Fluid data. It provides access\n * to the data as well as status on the collaboration session.\n */\nexport interface IFluidContainer extends IEventProvider<IFluidContainerEvents> {\n /**\n * Whether the container is connected to the collaboration session.\n */\n readonly connected: boolean;\n\n /**\n * A container is considered **dirty** if it has local changes that have not yet been acknowledged by the service.\n * acknowledged by the service. Closing the container while `isDirty === true` will result in the loss of these\n * local changes. You should always check the `isDirty` flag before closing the container or navigating away\n * from the page.\n *\n * A container is considered dirty in the following cases:\n *\n * 1. The container has local changes that have not yet been acknowledged by the service. These unacknowledged\n * changes will be lost if the container is closed.\n *\n * 1. There is no network connection while making changes to the container. These changes cannot be\n * acknowledged by the service until the network connection is restored.\n */\n readonly isDirty: boolean;\n\n /**\n * Whether the container is disposed, which permanently disables it.\n */\n readonly disposed: boolean;\n\n /**\n * The collection of data objects and DDSes that were specified by the schema. These data objects and DDSes exist\n * for the lifetime of the container.\n */\n readonly initialObjects: LoadableObjectRecord;\n\n /**\n * The current attachment state of the container. Once a container has been attached, it remains attached.\n * When loading an existing container, it will already be attached.\n */\n readonly attachState: AttachState;\n\n /**\n * A newly created container starts detached from the collaborative service. Calling attach() uploads the\n * new container to the service and connects to the collaborative service.\n * @returns A promise which resolves when the attach is complete, with the string identifier of the container.\n */\n attach(): Promise<string>;\n\n /**\n * Create a new data object or DDS of the specified type. In order to share the data object or DDS with other\n * collaborators and retrieve it later, store its handle in a collection like a SharedDirectory from your\n * initialObjects.\n * @param objectClass - The class of data object or DDS to create\n */\n create<T extends IFluidLoadable>(objectClass: LoadableObjectClass<T>): Promise<T>;\n\n /**\n * Dispose of the container instance, permanently disabling it.\n */\n dispose(): void;\n}\n\n/**\n * Implementation of the IFluidContainer.\n */\nexport class FluidContainer extends TypedEventEmitter<IFluidContainerEvents> implements IFluidContainer {\n private readonly connectedHandler = () => this.emit(\"connected\");\n private readonly disconnectedHandler = () => this.emit(\"disconnected\");\n private readonly disposedHandler = () => this.emit(\"disposed\");\n private readonly savedHandler = () => this.emit(\"saved\");\n private readonly dirtyHandler = () => this.emit(\"dirty\");\n\n public constructor(\n private readonly container: Container,\n private readonly rootDataObject: RootDataObject,\n ) {\n super();\n container.on(\"connected\", this.connectedHandler);\n container.on(\"closed\", this.disposedHandler);\n container.on(\"disconnected\", this.disconnectedHandler);\n container.on(\"saved\", this.savedHandler);\n container.on(\"dirty\", this.dirtyHandler);\n }\n\n /**\n * {@inheritDoc IFluidContainer.isDirty}\n */\n public get isDirty(): boolean {\n return this.container.isDirty;\n }\n\n /**\n * {@inheritDoc IFluidContainer.attachState}\n */\n public get attachState(): AttachState {\n return this.container.attachState;\n }\n\n /**\n * {@inheritDoc IFluidContainer.disposed}\n */\n public get disposed() {\n return this.container.closed;\n }\n\n /**\n * {@inheritDoc IFluidContainer.connected}\n */\n public get connected() {\n return this.container.connected;\n }\n\n /**\n * {@inheritDoc IFluidContainer.initialObjects}\n */\n public get initialObjects() {\n return this.rootDataObject.initialObjects;\n }\n\n /**\n * {@inheritDoc IFluidContainer.attach}\n */\n public async attach(): Promise<string> {\n throw new Error(\"Cannot attach container. Container is not in detached state\");\n }\n\n /**\n * {@inheritDoc IFluidContainer.create}\n */\n public async create<T extends IFluidLoadable>(objectClass: LoadableObjectClass<T>): Promise<T> {\n return this.rootDataObject.create(objectClass);\n }\n\n /**\n * {@inheritDoc IFluidContainer.dispose}\n */\n public dispose() {\n this.container.close();\n this.container.off(\"connected\", this.connectedHandler);\n this.container.off(\"closed\", this.disposedHandler);\n this.container.off(\"disconnected\", this.disconnectedHandler);\n this.container.off(\"saved\", this.savedHandler);\n this.container.off(\"dirty\", this.dirtyHandler);\n }\n}\n"]}
|
package/lib/fluidContainer.d.ts
CHANGED
|
@@ -41,9 +41,30 @@ import { RootDataObject } from "./rootDataObject";
|
|
|
41
41
|
* ```typescript
|
|
42
42
|
* () => void;
|
|
43
43
|
* ```
|
|
44
|
+
*
|
|
45
|
+
* ### "saved"
|
|
46
|
+
*
|
|
47
|
+
* The saved event is emitted when the `IFluidContainer` has local changes acknowledged by the service.
|
|
48
|
+
*
|
|
49
|
+
* #### Listener signature
|
|
50
|
+
*
|
|
51
|
+
* ```typescript
|
|
52
|
+
* () => void
|
|
53
|
+
* ```
|
|
54
|
+
*
|
|
55
|
+
* ### "dirty"
|
|
56
|
+
*
|
|
57
|
+
* The dirty event is emitted when the `IFluidContainer` has local changes that have not yet
|
|
58
|
+
* been acknowledged by the service.
|
|
59
|
+
*
|
|
60
|
+
* #### Listener signature
|
|
61
|
+
*
|
|
62
|
+
* ```typescript
|
|
63
|
+
* () => void
|
|
64
|
+
* ```
|
|
44
65
|
*/
|
|
45
66
|
export interface IFluidContainerEvents extends IEvent {
|
|
46
|
-
(event: "connected" | "dispose" | "disconnected", listener: () => void): void;
|
|
67
|
+
(event: "connected" | "dispose" | "disconnected" | "saved" | "dirty", listener: () => void): void;
|
|
47
68
|
}
|
|
48
69
|
/**
|
|
49
70
|
* The IFluidContainer provides an entrypoint into the client side of collaborative Fluid data. It provides access
|
|
@@ -110,6 +131,8 @@ export declare class FluidContainer extends TypedEventEmitter<IFluidContainerEve
|
|
|
110
131
|
private readonly connectedHandler;
|
|
111
132
|
private readonly disconnectedHandler;
|
|
112
133
|
private readonly disposedHandler;
|
|
134
|
+
private readonly savedHandler;
|
|
135
|
+
private readonly dirtyHandler;
|
|
113
136
|
constructor(container: Container, rootDataObject: RootDataObject);
|
|
114
137
|
/**
|
|
115
138
|
* {@inheritDoc IFluidContainer.isDirty}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fluidContainer.d.ts","sourceRoot":"","sources":["../src/fluidContainer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD
|
|
1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BAAmB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAElF;;OAEG;IACH,OAAO,IAAI,IAAI,CAAC;CACnB;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,iBAAiB,CAAC,qBAAqB,CAAE,YAAW,eAAe;IAQ/F,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,cAAc;IARnC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAgC;IACjE,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAmC;IACvE,OAAO,CAAC,QAAQ,CAAC,eAAe,CAA+B;IAC/D,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA4B;IACzD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA4B;gBAGpC,SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,cAAc;IAUnD;;OAEG;IACF,IAAW,OAAO,IAAI,OAAO,CAE7B;IAED;;OAEG;IACH,IAAW,WAAW,IAAI,WAAW,CAEpC;IAED;;OAEG;IACH,IAAW,QAAQ,YAElB;IAED;;OAEG;IACH,IAAW,SAAS,YAEnB;IAED;;OAEG;IACH,IAAW,cAAc,mCAExB;IAED;;OAEG;IACU,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC;IAItC;;OAEG;IACU,MAAM,CAAC,CAAC,SAAS,cAAc,EAAE,WAAW,EAAE,mBAAmB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAI9F;;OAEG;IACI,OAAO;CAQjB"}
|
package/lib/fluidContainer.js
CHANGED
|
@@ -14,9 +14,13 @@ export class FluidContainer extends TypedEventEmitter {
|
|
|
14
14
|
this.connectedHandler = () => this.emit("connected");
|
|
15
15
|
this.disconnectedHandler = () => this.emit("disconnected");
|
|
16
16
|
this.disposedHandler = () => this.emit("disposed");
|
|
17
|
+
this.savedHandler = () => this.emit("saved");
|
|
18
|
+
this.dirtyHandler = () => this.emit("dirty");
|
|
17
19
|
container.on("connected", this.connectedHandler);
|
|
18
20
|
container.on("closed", this.disposedHandler);
|
|
19
21
|
container.on("disconnected", this.disconnectedHandler);
|
|
22
|
+
container.on("saved", this.savedHandler);
|
|
23
|
+
container.on("dirty", this.dirtyHandler);
|
|
20
24
|
}
|
|
21
25
|
/**
|
|
22
26
|
* {@inheritDoc IFluidContainer.isDirty}
|
|
@@ -68,6 +72,8 @@ export class FluidContainer extends TypedEventEmitter {
|
|
|
68
72
|
this.container.off("connected", this.connectedHandler);
|
|
69
73
|
this.container.off("closed", this.disposedHandler);
|
|
70
74
|
this.container.off("disconnected", this.disconnectedHandler);
|
|
75
|
+
this.container.off("saved", this.savedHandler);
|
|
76
|
+
this.container.off("dirty", this.dirtyHandler);
|
|
71
77
|
}
|
|
72
78
|
}
|
|
73
79
|
//# sourceMappingURL=fluidContainer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fluidContainer.js","sourceRoot":"","sources":["../src/fluidContainer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"fluidContainer.js","sourceRoot":"","sources":["../src/fluidContainer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAkIjE;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,iBAAwC;IAOxE,YACqB,SAAoB,EACpB,cAA8B;QAE/C,KAAK,EAAE,CAAC;QAHS,cAAS,GAAT,SAAS,CAAW;QACpB,mBAAc,GAAd,cAAc,CAAgB;QARlC,qBAAgB,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAChD,wBAAmB,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QACtD,oBAAe,GAAG,GAAG,EAAE,CAAC,IAAI,CAA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;IACnD,CAAC;IAED;;OAEG;IACI,OAAO;QACV,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;QACvB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;QACvD,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;QACnD,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,cAAc,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;QAC7D,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QAC/C,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IACnD,CAAC;CACJ","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { TypedEventEmitter } from \"@fluidframework/common-utils\";\nimport { Container } from \"@fluidframework/container-loader\";\nimport { IFluidLoadable } from \"@fluidframework/core-interfaces\";\nimport { IEvent, IEventProvider } from \"@fluidframework/common-definitions\";\nimport { AttachState } from \"@fluidframework/container-definitions\";\nimport { LoadableObjectClass, LoadableObjectRecord } from \"./types\";\nimport { RootDataObject } from \"./rootDataObject\";\n\n/**\n * Events emitted from IFluidContainer.\n *\n * ### \"connected\"\n *\n * The connected event is emitted when the `IFluidContainer` completes connecting to the Fluid service.\n *\n * #### Listener signature\n *\n * ```typescript\n * () => void;\n * ```\n *\n * ### \"dispose\"\n *\n * The dispose event is emitted when the `IFluidContainer` is disposed, which permanently disables it.\n *\n * #### Listener signature\n *\n * ```typescript\n * () => void;\n * ```\n *\n * ### \"disconnected\"\n *\n * The disconnected event is emitted when the `IFluidContainer` becomes disconnected from the Fluid service.\n *\n * #### Listener signature\n *\n * ```typescript\n * () => void;\n * ```\n *\n * ### \"saved\"\n *\n * The saved event is emitted when the `IFluidContainer` has local changes acknowledged by the service.\n *\n * #### Listener signature\n *\n * ```typescript\n * () => void\n * ```\n *\n * ### \"dirty\"\n *\n * The dirty event is emitted when the `IFluidContainer` has local changes that have not yet\n * been acknowledged by the service.\n *\n * #### Listener signature\n *\n * ```typescript\n * () => void\n * ```\n */\nexport interface IFluidContainerEvents extends IEvent {\n (event: \"connected\" | \"dispose\" | \"disconnected\" | \"saved\" | \"dirty\", listener: () => void): void;\n}\n\n/**\n * The IFluidContainer provides an entrypoint into the client side of collaborative Fluid data. It provides access\n * to the data as well as status on the collaboration session.\n */\nexport interface IFluidContainer extends IEventProvider<IFluidContainerEvents> {\n /**\n * Whether the container is connected to the collaboration session.\n */\n readonly connected: boolean;\n\n /**\n * A container is considered **dirty** if it has local changes that have not yet been acknowledged by the service.\n * acknowledged by the service. Closing the container while `isDirty === true` will result in the loss of these\n * local changes. You should always check the `isDirty` flag before closing the container or navigating away\n * from the page.\n *\n * A container is considered dirty in the following cases:\n *\n * 1. The container has local changes that have not yet been acknowledged by the service. These unacknowledged\n * changes will be lost if the container is closed.\n *\n * 1. There is no network connection while making changes to the container. These changes cannot be\n * acknowledged by the service until the network connection is restored.\n */\n readonly isDirty: boolean;\n\n /**\n * Whether the container is disposed, which permanently disables it.\n */\n readonly disposed: boolean;\n\n /**\n * The collection of data objects and DDSes that were specified by the schema. These data objects and DDSes exist\n * for the lifetime of the container.\n */\n readonly initialObjects: LoadableObjectRecord;\n\n /**\n * The current attachment state of the container. Once a container has been attached, it remains attached.\n * When loading an existing container, it will already be attached.\n */\n readonly attachState: AttachState;\n\n /**\n * A newly created container starts detached from the collaborative service. Calling attach() uploads the\n * new container to the service and connects to the collaborative service.\n * @returns A promise which resolves when the attach is complete, with the string identifier of the container.\n */\n attach(): Promise<string>;\n\n /**\n * Create a new data object or DDS of the specified type. In order to share the data object or DDS with other\n * collaborators and retrieve it later, store its handle in a collection like a SharedDirectory from your\n * initialObjects.\n * @param objectClass - The class of data object or DDS to create\n */\n create<T extends IFluidLoadable>(objectClass: LoadableObjectClass<T>): Promise<T>;\n\n /**\n * Dispose of the container instance, permanently disabling it.\n */\n dispose(): void;\n}\n\n/**\n * Implementation of the IFluidContainer.\n */\nexport class FluidContainer extends TypedEventEmitter<IFluidContainerEvents> implements IFluidContainer {\n private readonly connectedHandler = () => this.emit(\"connected\");\n private readonly disconnectedHandler = () => this.emit(\"disconnected\");\n private readonly disposedHandler = () => this.emit(\"disposed\");\n private readonly savedHandler = () => this.emit(\"saved\");\n private readonly dirtyHandler = () => this.emit(\"dirty\");\n\n public constructor(\n private readonly container: Container,\n private readonly rootDataObject: RootDataObject,\n ) {\n super();\n container.on(\"connected\", this.connectedHandler);\n container.on(\"closed\", this.disposedHandler);\n container.on(\"disconnected\", this.disconnectedHandler);\n container.on(\"saved\", this.savedHandler);\n container.on(\"dirty\", this.dirtyHandler);\n }\n\n /**\n * {@inheritDoc IFluidContainer.isDirty}\n */\n public get isDirty(): boolean {\n return this.container.isDirty;\n }\n\n /**\n * {@inheritDoc IFluidContainer.attachState}\n */\n public get attachState(): AttachState {\n return this.container.attachState;\n }\n\n /**\n * {@inheritDoc IFluidContainer.disposed}\n */\n public get disposed() {\n return this.container.closed;\n }\n\n /**\n * {@inheritDoc IFluidContainer.connected}\n */\n public get connected() {\n return this.container.connected;\n }\n\n /**\n * {@inheritDoc IFluidContainer.initialObjects}\n */\n public get initialObjects() {\n return this.rootDataObject.initialObjects;\n }\n\n /**\n * {@inheritDoc IFluidContainer.attach}\n */\n public async attach(): Promise<string> {\n throw new Error(\"Cannot attach container. Container is not in detached state\");\n }\n\n /**\n * {@inheritDoc IFluidContainer.create}\n */\n public async create<T extends IFluidLoadable>(objectClass: LoadableObjectClass<T>): Promise<T> {\n return this.rootDataObject.create(objectClass);\n }\n\n /**\n * {@inheritDoc IFluidContainer.dispose}\n */\n public dispose() {\n this.container.close();\n this.container.off(\"connected\", this.connectedHandler);\n this.container.off(\"closed\", this.disposedHandler);\n this.container.off(\"disconnected\", this.disconnectedHandler);\n this.container.off(\"saved\", this.savedHandler);\n this.container.off(\"dirty\", this.dirtyHandler);\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/fluid-static",
|
|
3
|
-
"version": "0.50.
|
|
3
|
+
"version": "0.50.2",
|
|
4
4
|
"description": "A tool to enable consumption of Fluid Data Objects without requiring custom container code.",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": "https://github.com/microsoft/FluidFramework",
|
|
@@ -29,21 +29,21 @@
|
|
|
29
29
|
"tsfmt:fix": "tsfmt --replace"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@fluidframework/aqueduct": "0.50.
|
|
32
|
+
"@fluidframework/aqueduct": "^0.50.2",
|
|
33
33
|
"@fluidframework/common-definitions": "^0.20.1",
|
|
34
34
|
"@fluidframework/common-utils": "^0.32.1",
|
|
35
|
-
"@fluidframework/container-definitions": "^0.
|
|
36
|
-
"@fluidframework/container-loader": "0.50.
|
|
37
|
-
"@fluidframework/container-runtime-definitions": "0.50.
|
|
38
|
-
"@fluidframework/core-interfaces": "^0.
|
|
39
|
-
"@fluidframework/datastore-definitions": "0.50.
|
|
35
|
+
"@fluidframework/container-definitions": "^0.41.0",
|
|
36
|
+
"@fluidframework/container-loader": "^0.50.2",
|
|
37
|
+
"@fluidframework/container-runtime-definitions": "^0.50.2",
|
|
38
|
+
"@fluidframework/core-interfaces": "^0.40.0",
|
|
39
|
+
"@fluidframework/datastore-definitions": "^0.50.2",
|
|
40
40
|
"@fluidframework/protocol-definitions": "^0.1025.0",
|
|
41
|
-
"@fluidframework/request-handler": "0.50.
|
|
42
|
-
"@fluidframework/runtime-definitions": "0.50.
|
|
43
|
-
"@fluidframework/runtime-utils": "0.50.
|
|
41
|
+
"@fluidframework/request-handler": "^0.50.2",
|
|
42
|
+
"@fluidframework/runtime-definitions": "^0.50.2",
|
|
43
|
+
"@fluidframework/runtime-utils": "^0.50.2"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@fluid-experimental/get-container": "0.50.
|
|
46
|
+
"@fluid-experimental/get-container": "^0.50.2",
|
|
47
47
|
"@fluidframework/build-common": "^0.23.0",
|
|
48
48
|
"@fluidframework/eslint-config-fluid": "^0.23.0",
|
|
49
49
|
"@microsoft/api-extractor": "^7.16.1",
|
package/src/fluidContainer.ts
CHANGED
|
@@ -42,9 +42,30 @@ import { RootDataObject } from "./rootDataObject";
|
|
|
42
42
|
* ```typescript
|
|
43
43
|
* () => void;
|
|
44
44
|
* ```
|
|
45
|
+
*
|
|
46
|
+
* ### "saved"
|
|
47
|
+
*
|
|
48
|
+
* The saved event is emitted when the `IFluidContainer` has local changes acknowledged by the service.
|
|
49
|
+
*
|
|
50
|
+
* #### Listener signature
|
|
51
|
+
*
|
|
52
|
+
* ```typescript
|
|
53
|
+
* () => void
|
|
54
|
+
* ```
|
|
55
|
+
*
|
|
56
|
+
* ### "dirty"
|
|
57
|
+
*
|
|
58
|
+
* The dirty event is emitted when the `IFluidContainer` has local changes that have not yet
|
|
59
|
+
* been acknowledged by the service.
|
|
60
|
+
*
|
|
61
|
+
* #### Listener signature
|
|
62
|
+
*
|
|
63
|
+
* ```typescript
|
|
64
|
+
* () => void
|
|
65
|
+
* ```
|
|
45
66
|
*/
|
|
46
67
|
export interface IFluidContainerEvents extends IEvent {
|
|
47
|
-
(event: "connected" | "dispose" | "disconnected", listener: () => void): void;
|
|
68
|
+
(event: "connected" | "dispose" | "disconnected" | "saved" | "dirty", listener: () => void): void;
|
|
48
69
|
}
|
|
49
70
|
|
|
50
71
|
/**
|
|
@@ -118,6 +139,8 @@ export class FluidContainer extends TypedEventEmitter<IFluidContainerEvents> imp
|
|
|
118
139
|
private readonly connectedHandler = () => this.emit("connected");
|
|
119
140
|
private readonly disconnectedHandler = () => this.emit("disconnected");
|
|
120
141
|
private readonly disposedHandler = () => this.emit("disposed");
|
|
142
|
+
private readonly savedHandler = () => this.emit("saved");
|
|
143
|
+
private readonly dirtyHandler = () => this.emit("dirty");
|
|
121
144
|
|
|
122
145
|
public constructor(
|
|
123
146
|
private readonly container: Container,
|
|
@@ -127,6 +150,8 @@ export class FluidContainer extends TypedEventEmitter<IFluidContainerEvents> imp
|
|
|
127
150
|
container.on("connected", this.connectedHandler);
|
|
128
151
|
container.on("closed", this.disposedHandler);
|
|
129
152
|
container.on("disconnected", this.disconnectedHandler);
|
|
153
|
+
container.on("saved", this.savedHandler);
|
|
154
|
+
container.on("dirty", this.dirtyHandler);
|
|
130
155
|
}
|
|
131
156
|
|
|
132
157
|
/**
|
|
@@ -186,5 +211,7 @@ export class FluidContainer extends TypedEventEmitter<IFluidContainerEvents> imp
|
|
|
186
211
|
this.container.off("connected", this.connectedHandler);
|
|
187
212
|
this.container.off("closed", this.disposedHandler);
|
|
188
213
|
this.container.off("disconnected", this.disconnectedHandler);
|
|
214
|
+
this.container.off("saved", this.savedHandler);
|
|
215
|
+
this.container.off("dirty", this.dirtyHandler);
|
|
189
216
|
}
|
|
190
217
|
}
|