@fluid-topics/ft-viewer 2.2.16 → 2.2.18
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/build/asset/components/registration.js +1 -1
- package/build/asset/ft-asset-viewer-context.d.ts +1 -1
- package/build/asset/ft-asset-viewer-context.js +3 -2
- package/build/asset/model/FtAssetViewerStateManager.js +1 -1
- package/build/common/model/FtViewerStateManager.d.ts +4 -1
- package/build/common/model/FtViewerStateManager.js +7 -1
- package/build/ft-viewer.light.js +183 -183
- package/build/ft-viewer.min.js +421 -421
- package/build/ud/components/registration.js +1 -1
- package/build/ud/ft-ud-viewer-context.d.ts +1 -1
- package/build/ud/ft-ud-viewer-context.js +3 -2
- package/build/ud/model/FtUdViewerService.d.ts +0 -1
- package/build/ud/model/FtUdViewerService.js +0 -3
- package/build/ud/model/FtUdViewerStateManager.js +11 -12
- package/package.json +10 -10
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { applyMixinOnce, } from "@fluid-topics/ft-wc-utils";
|
|
8
8
|
import { state } from "lit/decorators.js";
|
|
9
9
|
import { consume, createContext, } from "@lit/context";
|
|
10
|
-
export const assetViewerStateManagerContext = createContext(
|
|
10
|
+
export const assetViewerStateManagerContext = createContext("asset-viewer-state-manager");
|
|
11
11
|
export const toFtAssetViewerComponent = applyMixinOnce(Symbol("toFtAssetViewerComponent"), function (ReduxClass) {
|
|
12
12
|
class FtAssetViewerComponentClass extends ReduxClass {
|
|
13
13
|
willUpdate(props) {
|
|
@@ -10,7 +10,7 @@ export declare class FtAssetViewerContext extends FtLitElementRedux implements F
|
|
|
10
10
|
viewerStateManager: FtAssetViewerStateManager;
|
|
11
11
|
protected render(): import("lit-html").TemplateResult<1>;
|
|
12
12
|
protected willUpdate(props: PropertyValues<FtAssetViewerContext>): void;
|
|
13
|
-
|
|
13
|
+
load(): Promise<void>;
|
|
14
14
|
connectedCallback(): void;
|
|
15
15
|
onAuthenticationChange(): void;
|
|
16
16
|
}
|
|
@@ -25,10 +25,10 @@ export class FtAssetViewerContext extends FtLitElementRedux {
|
|
|
25
25
|
willUpdate(props) {
|
|
26
26
|
super.willUpdate(props);
|
|
27
27
|
if (props.has("documentId") || props.has("assetId") || props.has("origin")) {
|
|
28
|
-
this.
|
|
28
|
+
this.load();
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
async
|
|
31
|
+
async load() {
|
|
32
32
|
try {
|
|
33
33
|
const state = await this.viewerStateManager.init(this.documentId, this.assetId, this.origin);
|
|
34
34
|
if (this.documentId && this.assetId && this.origin) {
|
|
@@ -42,6 +42,7 @@ export class FtAssetViewerContext extends FtLitElementRedux {
|
|
|
42
42
|
connectedCallback() {
|
|
43
43
|
super.connectedCallback();
|
|
44
44
|
this.addStore(ftAppInfoStore);
|
|
45
|
+
this.load();
|
|
45
46
|
}
|
|
46
47
|
onAuthenticationChange() {
|
|
47
48
|
this.viewerStateManager.reload();
|
|
@@ -6,7 +6,7 @@ export class FtAssetViewerStateManager extends FtViewerStateManager {
|
|
|
6
6
|
return new FtAssetViewerStateManager(createViewerStore(viewerId), new FtAssetViewerService());
|
|
7
7
|
}
|
|
8
8
|
constructor(store, service) {
|
|
9
|
-
super(store);
|
|
9
|
+
super(store, service);
|
|
10
10
|
this.store = store;
|
|
11
11
|
this.service = service;
|
|
12
12
|
}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { FtStateManager } from "@fluid-topics/ft-wc-utils";
|
|
2
2
|
import { FtViewerReduxStore } from "./FtViewerReduxStore";
|
|
3
|
+
import { FtServiceWithCache } from "@fluid-topics/ft-app-context";
|
|
3
4
|
export declare abstract class FtViewerStateManager extends FtStateManager {
|
|
4
5
|
store: FtViewerReduxStore;
|
|
5
|
-
|
|
6
|
+
service: FtServiceWithCache;
|
|
7
|
+
protected constructor(store: FtViewerReduxStore, service: FtServiceWithCache);
|
|
8
|
+
abstract clear(): void;
|
|
6
9
|
setZoom(zoom: number | undefined): void;
|
|
7
10
|
setRotation(rotation: number): void;
|
|
8
11
|
}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { FtStateManager } from "@fluid-topics/ft-wc-utils";
|
|
2
|
+
import { AuthenticationChangeEvent, ftAppInfoStore, } from "@fluid-topics/ft-app-context";
|
|
2
3
|
export class FtViewerStateManager extends FtStateManager {
|
|
3
|
-
constructor(store) {
|
|
4
|
+
constructor(store, service) {
|
|
4
5
|
super();
|
|
5
6
|
this.store = store;
|
|
7
|
+
this.service = service;
|
|
8
|
+
ftAppInfoStore.addEventListener(AuthenticationChangeEvent.eventName, () => {
|
|
9
|
+
service.clearCache();
|
|
10
|
+
this.clear();
|
|
11
|
+
});
|
|
6
12
|
}
|
|
7
13
|
setZoom(zoom) {
|
|
8
14
|
this.store.actions.setZoom(zoom);
|