dome-embedded-app-sdk 0.4.3 → 0.5.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/README.md +83 -83
- package/dist/card-sdk.d.ts +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/docs/card-sdk.md +162 -162
- package/docs/viewer-sdk.md +50 -50
- package/package.json +56 -56
package/README.md
CHANGED
|
@@ -1,83 +1,83 @@
|
|
|
1
|
-
# Dome Embedded App SDK
|
|
2
|
-
|
|
3
|
-
Build Dome cards and document viewers with a single SDK. Cards let you extend a dome with custom functionality, while viewers let you render and edit documents inside Dome.
|
|
4
|
-
|
|
5
|
-
## Install
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install dome-embedded-app-sdk
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## What you can build
|
|
12
|
-
|
|
13
|
-
### **Cards**
|
|
14
|
-
|
|
15
|
-
A "card" in Dome enables you to extend the functionality of a dome. Each "card" is like a mini website (webapp) that you can build as per your needs. Each dome is made up of cards. By adding your custom card to your dome, you can extend it's functionality.
|
|
16
|
-
|
|
17
|
-
Use this SDK to create your custom card that can do whatever you like: a simple todo list, snake & ladder game, to a complex project management tool, a 3D AR visualization, to anything else you can imagine! Anything you can build in React or Angular can be created into a card!
|
|
18
|
-
|
|
19
|
-
### **Document viewers**
|
|
20
|
-
|
|
21
|
-
Add view / edit capability for any document in Dome. For example, you can come up with your own spreadsheet and make it instantly available to all users of Dome. Alternatively, you can create your own viewer that views & (optionally) edits existing documents such as Excel files. The options a limitless!
|
|
22
|
-
|
|
23
|
-
> Note: We currently support React and Angular, with support for more frameworks planned in the future.
|
|
24
|
-
|
|
25
|
-
## Getting started
|
|
26
|
-
|
|
27
|
-
1. Register your card or viewer at [https://dome.so/developer](https://dome.so/developer).
|
|
28
|
-
2. Initialize the SDK in your app.
|
|
29
|
-
3. Handle lifecycle events and call SDK APIs.
|
|
30
|
-
|
|
31
|
-
For more detail, check out the [Guides](#guides)
|
|
32
|
-
|
|
33
|
-
### Cards quick start
|
|
34
|
-
|
|
35
|
-
```JavaScript
|
|
36
|
-
import { CardSdk, getKeyFromBlob } from "dome-embedded-app-sdk";
|
|
37
|
-
|
|
38
|
-
const my_card_decryption_blob = {...};
|
|
39
|
-
|
|
40
|
-
CardSdk.init(getKeyFromBlob(my_card_decryption_blob), {
|
|
41
|
-
onInit: (data) => {
|
|
42
|
-
console.log("Init payload", data);
|
|
43
|
-
},
|
|
44
|
-
onError: ({ error_code, message }) => {
|
|
45
|
-
console.error("Some Error", `${message} (${error_code})`);
|
|
46
|
-
}
|
|
47
|
-
}).then((sdk) => console.log("SDK Instance", sdk));
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
### Document viewer quick start
|
|
51
|
-
|
|
52
|
-
```JavaScript
|
|
53
|
-
import { ViewerSdk } from "dome-embedded-app-sdk";
|
|
54
|
-
|
|
55
|
-
ViewerSdk.init({
|
|
56
|
-
onInitialData: ({ doc, ui }) => {
|
|
57
|
-
console.log("Initial doc", doc, ui);
|
|
58
|
-
},
|
|
59
|
-
onDataChange: ({ doc }) => {
|
|
60
|
-
console.log("Doc updated", doc);
|
|
61
|
-
},
|
|
62
|
-
onCloseRequest: () => {
|
|
63
|
-
console.log("Close requested");
|
|
64
|
-
},
|
|
65
|
-
onSaveRequest: () => {
|
|
66
|
-
console.log("Save requested");
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
## Guides
|
|
72
|
-
|
|
73
|
-
- [Card SDK guide](docs/card-sdk.md)
|
|
74
|
-
- [Viewer SDK guide](docs/viewer-sdk.md)
|
|
75
|
-
|
|
76
|
-
## Starter projects
|
|
77
|
-
|
|
78
|
-
- React card starter: <https://github.com/DomeHQ/card-react_starter>
|
|
79
|
-
- Angular card starter: <https://github.com/DomeHQ/card-angular_starter>
|
|
80
|
-
|
|
81
|
-
## Help
|
|
82
|
-
|
|
83
|
-
Join our developer community on Dome here: [https://dome.so/developer](https://dome.so/developer). Hang out, get latest updates, ask questions, and get support.
|
|
1
|
+
# Dome Embedded App SDK
|
|
2
|
+
|
|
3
|
+
Build Dome cards and document viewers with a single SDK. Cards let you extend a dome with custom functionality, while viewers let you render and edit documents inside Dome.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install dome-embedded-app-sdk
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## What you can build
|
|
12
|
+
|
|
13
|
+
### **Cards**
|
|
14
|
+
|
|
15
|
+
A "card" in Dome enables you to extend the functionality of a dome. Each "card" is like a mini website (webapp) that you can build as per your needs. Each dome is made up of cards. By adding your custom card to your dome, you can extend it's functionality.
|
|
16
|
+
|
|
17
|
+
Use this SDK to create your custom card that can do whatever you like: a simple todo list, snake & ladder game, to a complex project management tool, a 3D AR visualization, to anything else you can imagine! Anything you can build in React or Angular can be created into a card!
|
|
18
|
+
|
|
19
|
+
### **Document viewers**
|
|
20
|
+
|
|
21
|
+
Add view / edit capability for any document in Dome. For example, you can come up with your own spreadsheet and make it instantly available to all users of Dome. Alternatively, you can create your own viewer that views & (optionally) edits existing documents such as Excel files. The options a limitless!
|
|
22
|
+
|
|
23
|
+
> Note: We currently support React and Angular, with support for more frameworks planned in the future.
|
|
24
|
+
|
|
25
|
+
## Getting started
|
|
26
|
+
|
|
27
|
+
1. Register your card or viewer at [https://dome.so/developer](https://dome.so/developer).
|
|
28
|
+
2. Initialize the SDK in your app.
|
|
29
|
+
3. Handle lifecycle events and call SDK APIs.
|
|
30
|
+
|
|
31
|
+
For more detail, check out the [Guides](#guides)
|
|
32
|
+
|
|
33
|
+
### Cards quick start
|
|
34
|
+
|
|
35
|
+
```JavaScript
|
|
36
|
+
import { CardSdk, getKeyFromBlob } from "dome-embedded-app-sdk";
|
|
37
|
+
|
|
38
|
+
const my_card_decryption_blob = {...};
|
|
39
|
+
|
|
40
|
+
CardSdk.init(getKeyFromBlob(my_card_decryption_blob), {
|
|
41
|
+
onInit: (data) => {
|
|
42
|
+
console.log("Init payload", data);
|
|
43
|
+
},
|
|
44
|
+
onError: ({ error_code, message }) => {
|
|
45
|
+
console.error("Some Error", `${message} (${error_code})`);
|
|
46
|
+
}
|
|
47
|
+
}).then((sdk) => console.log("SDK Instance", sdk));
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Document viewer quick start
|
|
51
|
+
|
|
52
|
+
```JavaScript
|
|
53
|
+
import { ViewerSdk } from "dome-embedded-app-sdk";
|
|
54
|
+
|
|
55
|
+
ViewerSdk.init({
|
|
56
|
+
onInitialData: ({ doc, ui }) => {
|
|
57
|
+
console.log("Initial doc", doc, ui);
|
|
58
|
+
},
|
|
59
|
+
onDataChange: ({ doc }) => {
|
|
60
|
+
console.log("Doc updated", doc);
|
|
61
|
+
},
|
|
62
|
+
onCloseRequest: () => {
|
|
63
|
+
console.log("Close requested");
|
|
64
|
+
},
|
|
65
|
+
onSaveRequest: () => {
|
|
66
|
+
console.log("Save requested");
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Guides
|
|
72
|
+
|
|
73
|
+
- [Card SDK guide](docs/card-sdk.md)
|
|
74
|
+
- [Viewer SDK guide](docs/viewer-sdk.md)
|
|
75
|
+
|
|
76
|
+
## Starter projects
|
|
77
|
+
|
|
78
|
+
- React card starter: <https://github.com/DomeHQ/card-react_starter>
|
|
79
|
+
- Angular card starter: <https://github.com/DomeHQ/card-angular_starter>
|
|
80
|
+
|
|
81
|
+
## Help
|
|
82
|
+
|
|
83
|
+
Join our developer community on Dome here: [https://dome.so/developer](https://dome.so/developer). Hang out, get latest updates, ask questions, and get support.
|
package/dist/card-sdk.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { CardFsFileType, CardPermission } from "./types/card-sdk.types";
|
|
|
3
3
|
import type { CardEventHandler, CardFsCallback, CardFsListHandler, CardFsReadHandler, CardFsWriteUpdatePayload, CardKeyBlob, CardPermissionsMap, CardUser, CardUserRole } from "./types/card-sdk.types";
|
|
4
4
|
export { CardFsErrorCode, CardFsFileType, CardPermission, cardPermission } from "./types/card-sdk.types";
|
|
5
5
|
export type { CardEventHandler, CardFileChangePayload, CardFsCallback, CardFsErrorPayload, CardFsListHandler, CardFsListResult, CardFsReadHandler, CardFsReadResult, CardFsReadUpdatePayload, CardFsWriteUpdatePayload, CardInitData, CardInitErrorPayload, CardKeyBlob, CardKeyBlobV1, CardPermissionsMap, CardRefreshRequestPayload, CardUiProps, CardUser, CardUserCover, CardUserCoverPhoto, CardUserName, CardUserOrganization, CardUserPhoto, CardUserRole, } from "./types/card-sdk.types";
|
|
6
|
+
export declare function getKeyFromBlobStr(blobStr: string): string;
|
|
6
7
|
export declare function getKeyFromBlob(blob: CardKeyBlob): string;
|
|
7
8
|
/**
|
|
8
9
|
* Use CardSdk to create webapp cards
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,6 @@ export { DomeEmbeddedAppSdk, ViewerMessageType, CardMessageType, CommonClientMes
|
|
|
2
2
|
export type { HostInfo, HostCapabilities, HostDetails } from "./dome-sdk";
|
|
3
3
|
export { ViewerSdk } from "./viewer-sdk";
|
|
4
4
|
export type { ViewerEventHandler, Document, UiProps } from "./viewer-sdk";
|
|
5
|
-
export { CardSdk, CardPermission, cardPermission, getKeyFromBlob, CardFsErrorCode, CardFsFileType } from "./card-sdk";
|
|
5
|
+
export { CardSdk, CardPermission, cardPermission, getKeyFromBlob, getKeyFromBlobStr, CardFsErrorCode, CardFsFileType } from "./card-sdk";
|
|
6
6
|
export type { CardEventHandler, CardFileChangePayload, CardFsErrorPayload, CardFsCallback, CardFsReadResult, CardFsReadHandler, CardInitData, CardInitErrorPayload, CardPermissionsMap, CardRefreshRequestPayload, CardUiProps, CardUser, CardUserCover, CardUserCoverPhoto, CardUserName, CardUserOrganization, CardUserPhoto, CardUserRole, CardKeyBlob, CardKeyBlobV1, } from "./card-sdk";
|
|
7
7
|
export { CryptoA01 } from "./crypto";
|