@netless/fastboard 1.0.0-canary.3 → 1.0.0-canary.4
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/index.js +0 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -14
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/create.ts +0 -2
- package/src/replay.ts +0 -2
- package/src/behaviors/netless-ua.ts +0 -15
package/dist/index.js
CHANGED
|
@@ -44,25 +44,12 @@ function registerDefaultApps() {
|
|
|
44
44
|
windowManager.WindowManager.register({ kind, ...DefaultApps[kind] });
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
|
-
var injected = false;
|
|
48
|
-
function ensureNetlessUA() {
|
|
49
|
-
if (typeof window !== "undefined" && !injected) {
|
|
50
|
-
injected = true;
|
|
51
|
-
let str = window.__netlessUA || "";
|
|
52
|
-
str += ` ${fastboardCore.name}/${fastboardCore.version} `;
|
|
53
|
-
window.__netlessUA = str;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// src/create.ts
|
|
58
47
|
async function createFastboard(options) {
|
|
59
|
-
ensureNetlessUA();
|
|
60
48
|
registerSlide();
|
|
61
49
|
registerDefaultApps();
|
|
62
50
|
return fastboardCore.createFastboardCore(options);
|
|
63
51
|
}
|
|
64
52
|
async function replayFastboard(options) {
|
|
65
|
-
ensureNetlessUA();
|
|
66
53
|
registerSlide();
|
|
67
54
|
registerDefaultApps();
|
|
68
55
|
return fastboardCore.replayFastboardCore(options);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/behaviors/netless-app.ts","../src/create.ts","../src/
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/behaviors/netless-app.ts","../src/create.ts","../src/replay.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAEA,cAAc;AACd,cAAc;;;ACKd,SAAS,qBAAqB;AAE9B,OAAO,mBAAmB,UAAU,cAAc,OAAO,mBAAmB;AAKrE,SAAS,gBAAgB;AAC9B,MAAI,cAAc,WAAW,IAAI,gBAAgB,IAAI;AAAG;AACxD,gBAAc,SAAS;AAAA,IACrB,MAAM,gBAAgB;AAAA,IACtB,YAAY,EAAE,OAAO,MAAM;AAAA,IAC3B,KAAK;AAAA,IACL;AAAA,EACF,CAAC;AACH;AAEA,IAAM,cAEF,CAAC;AAEE,SAAS,sBAAsB;AACpC,SAAO,KAAK,WAAW,EAAE,QAAQ,UAAQ;AACvC,QAAI,cAAc,WAAW,IAAI,IAAI;AAAG;AACxC,kBAAc,SAAS,EAAE,MAAM,GAAG,YAAY,MAAM,CAAC;AAAA,EACvD,CAAC;AACH;;;AChCA,SAAS,2BAA2B;AAkBpC,eAAsB,gBACpB,SACmC;AACnC,gBAAc;AACd,sBAAoB;AACpB,SAAO,oBAAgC,OAAO;AAChD;;;ACxBA,SAAS,2BAA2B;AAmBpC,eAAsB,gBACpB,SACsC;AACtC,gBAAc;AACd,sBAAoB;AACpB,SAAO,oBAAgC,OAAO;AAChD","sourcesContent":["import \"./style.scss\";\n\nexport * from \"@netless/fastboard-core\";\nexport * from \"@netless/fastboard-ui\";\n\nexport * from \"./behaviors\";\nexport * from \"./create\";\nexport * from \"./replay\";\n","import type {\n AppOptions as NetlessAppSlideAppOptions,\n Attributes as NetlessAppSlideAttributes,\n SlideState,\n SlideViewerOptions,\n} from \"@netless/app-slide\";\nimport type { RegisterParams } from \"@netless/window-manager\";\n\nimport { WindowManager } from \"@netless/window-manager\";\n\nimport NetlessAppSlide, { addHooks, previewSlide, Slide, SlideViewer } from \"@netless/app-slide\";\n\nexport { Slide, SlideViewer, previewSlide };\nexport type { NetlessAppSlideAttributes, SlideState, SlideViewerOptions };\n\nexport function registerSlide() {\n if (WindowManager.registered.has(NetlessAppSlide.kind)) return;\n WindowManager.register({\n kind: NetlessAppSlide.kind,\n appOptions: { debug: false } as NetlessAppSlideAppOptions,\n src: NetlessAppSlide,\n addHooks,\n });\n}\n\nconst DefaultApps: {\n [kind: string]: Omit<RegisterParams, \"kind\">;\n} = {};\n\nexport function registerDefaultApps() {\n Object.keys(DefaultApps).forEach(kind => {\n if (WindowManager.registered.has(kind)) return;\n WindowManager.register({ kind, ...DefaultApps[kind] });\n });\n}\n","import type { FastboardApp, FastboardOptions } from \"@netless/fastboard-core\";\n\nimport { createFastboardCore } from \"@netless/fastboard-core\";\nimport { registerDefaultApps, registerSlide } from \"./behaviors/netless-app\";\n\n/**\n * Create a FastboardApp instance.\n * @example\n * let app = await createFastboard({\n * sdkConfig: {\n * appIdentifier: import.meta.env.VITE_APPID,\n * region: 'cn-hz',\n * },\n * joinRoom: {\n * uid: unique_id,\n * uuid: import.meta.env.VITE_ROOM_UUID,\n * roomToken: import.meta.env.VITE_ROOM_TOKEN,\n * },\n * })\n */\nexport async function createFastboard<TEventData = any>(\n options: FastboardOptions\n): Promise<FastboardApp<TEventData>> {\n registerSlide();\n registerDefaultApps();\n return createFastboardCore<TEventData>(options);\n}\n","import type { FastboardPlayer, FastboardReplayOptions } from \"@netless/fastboard-core\";\n\nimport { replayFastboardCore } from \"@netless/fastboard-core\";\nimport { registerDefaultApps, registerSlide } from \"./behaviors/netless-app\";\n\n/**\n * Create a FastboardPlayer instance.\n * @example\n * let player = await replayFastboard({\n * sdkConfig: {\n * appIdentifier: import.meta.env.VITE_APPID,\n * region: 'cn-hz',\n * },\n * replayRoom: {\n * room: \"room uuid\",\n * roomToken: \"NETLESSROOM_...\",\n * beginTimestamp: 1646619090394,\n * duration: 70448,\n * },\n * })\n */\nexport async function replayFastboard<TEventData = any>(\n options: FastboardReplayOptions\n): Promise<FastboardPlayer<TEventData>> {\n registerSlide();\n registerDefaultApps();\n return replayFastboardCore<TEventData>(options);\n}\n"]}
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createFastboardCore, replayFastboardCore
|
|
1
|
+
import { createFastboardCore, replayFastboardCore } from '@netless/fastboard-core';
|
|
2
2
|
export * from '@netless/fastboard-core';
|
|
3
3
|
export * from '@netless/fastboard-ui';
|
|
4
4
|
import { WindowManager } from '@netless/window-manager';
|
|
@@ -38,25 +38,12 @@ function registerDefaultApps() {
|
|
|
38
38
|
WindowManager.register({ kind, ...DefaultApps[kind] });
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
-
var injected = false;
|
|
42
|
-
function ensureNetlessUA() {
|
|
43
|
-
if (typeof window !== "undefined" && !injected) {
|
|
44
|
-
injected = true;
|
|
45
|
-
let str = window.__netlessUA || "";
|
|
46
|
-
str += ` ${name}/${version} `;
|
|
47
|
-
window.__netlessUA = str;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// src/create.ts
|
|
52
41
|
async function createFastboard(options) {
|
|
53
|
-
ensureNetlessUA();
|
|
54
42
|
registerSlide();
|
|
55
43
|
registerDefaultApps();
|
|
56
44
|
return createFastboardCore(options);
|
|
57
45
|
}
|
|
58
46
|
async function replayFastboard(options) {
|
|
59
|
-
ensureNetlessUA();
|
|
60
47
|
registerSlide();
|
|
61
48
|
registerDefaultApps();
|
|
62
49
|
return replayFastboardCore(options);
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/behaviors/netless-app.ts","../src/create.ts","../src/
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/behaviors/netless-app.ts","../src/create.ts","../src/replay.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAEA,cAAc;AACd,cAAc;;;ACKd,SAAS,qBAAqB;AAE9B,OAAO,mBAAmB,UAAU,cAAc,OAAO,mBAAmB;AAKrE,SAAS,gBAAgB;AAC9B,MAAI,cAAc,WAAW,IAAI,gBAAgB,IAAI;AAAG;AACxD,gBAAc,SAAS;AAAA,IACrB,MAAM,gBAAgB;AAAA,IACtB,YAAY,EAAE,OAAO,MAAM;AAAA,IAC3B,KAAK;AAAA,IACL;AAAA,EACF,CAAC;AACH;AAEA,IAAM,cAEF,CAAC;AAEE,SAAS,sBAAsB;AACpC,SAAO,KAAK,WAAW,EAAE,QAAQ,UAAQ;AACvC,QAAI,cAAc,WAAW,IAAI,IAAI;AAAG;AACxC,kBAAc,SAAS,EAAE,MAAM,GAAG,YAAY,MAAM,CAAC;AAAA,EACvD,CAAC;AACH;;;AChCA,SAAS,2BAA2B;AAkBpC,eAAsB,gBACpB,SACmC;AACnC,gBAAc;AACd,sBAAoB;AACpB,SAAO,oBAAgC,OAAO;AAChD;;;ACxBA,SAAS,2BAA2B;AAmBpC,eAAsB,gBACpB,SACsC;AACtC,gBAAc;AACd,sBAAoB;AACpB,SAAO,oBAAgC,OAAO;AAChD","sourcesContent":["import \"./style.scss\";\n\nexport * from \"@netless/fastboard-core\";\nexport * from \"@netless/fastboard-ui\";\n\nexport * from \"./behaviors\";\nexport * from \"./create\";\nexport * from \"./replay\";\n","import type {\n AppOptions as NetlessAppSlideAppOptions,\n Attributes as NetlessAppSlideAttributes,\n SlideState,\n SlideViewerOptions,\n} from \"@netless/app-slide\";\nimport type { RegisterParams } from \"@netless/window-manager\";\n\nimport { WindowManager } from \"@netless/window-manager\";\n\nimport NetlessAppSlide, { addHooks, previewSlide, Slide, SlideViewer } from \"@netless/app-slide\";\n\nexport { Slide, SlideViewer, previewSlide };\nexport type { NetlessAppSlideAttributes, SlideState, SlideViewerOptions };\n\nexport function registerSlide() {\n if (WindowManager.registered.has(NetlessAppSlide.kind)) return;\n WindowManager.register({\n kind: NetlessAppSlide.kind,\n appOptions: { debug: false } as NetlessAppSlideAppOptions,\n src: NetlessAppSlide,\n addHooks,\n });\n}\n\nconst DefaultApps: {\n [kind: string]: Omit<RegisterParams, \"kind\">;\n} = {};\n\nexport function registerDefaultApps() {\n Object.keys(DefaultApps).forEach(kind => {\n if (WindowManager.registered.has(kind)) return;\n WindowManager.register({ kind, ...DefaultApps[kind] });\n });\n}\n","import type { FastboardApp, FastboardOptions } from \"@netless/fastboard-core\";\n\nimport { createFastboardCore } from \"@netless/fastboard-core\";\nimport { registerDefaultApps, registerSlide } from \"./behaviors/netless-app\";\n\n/**\n * Create a FastboardApp instance.\n * @example\n * let app = await createFastboard({\n * sdkConfig: {\n * appIdentifier: import.meta.env.VITE_APPID,\n * region: 'cn-hz',\n * },\n * joinRoom: {\n * uid: unique_id,\n * uuid: import.meta.env.VITE_ROOM_UUID,\n * roomToken: import.meta.env.VITE_ROOM_TOKEN,\n * },\n * })\n */\nexport async function createFastboard<TEventData = any>(\n options: FastboardOptions\n): Promise<FastboardApp<TEventData>> {\n registerSlide();\n registerDefaultApps();\n return createFastboardCore<TEventData>(options);\n}\n","import type { FastboardPlayer, FastboardReplayOptions } from \"@netless/fastboard-core\";\n\nimport { replayFastboardCore } from \"@netless/fastboard-core\";\nimport { registerDefaultApps, registerSlide } from \"./behaviors/netless-app\";\n\n/**\n * Create a FastboardPlayer instance.\n * @example\n * let player = await replayFastboard({\n * sdkConfig: {\n * appIdentifier: import.meta.env.VITE_APPID,\n * region: 'cn-hz',\n * },\n * replayRoom: {\n * room: \"room uuid\",\n * roomToken: \"NETLESSROOM_...\",\n * beginTimestamp: 1646619090394,\n * duration: 70448,\n * },\n * })\n */\nexport async function replayFastboard<TEventData = any>(\n options: FastboardReplayOptions\n): Promise<FastboardPlayer<TEventData>> {\n registerSlide();\n registerDefaultApps();\n return replayFastboardCore<TEventData>(options);\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netless/fastboard",
|
|
3
|
-
"version": "1.0.0-canary.
|
|
3
|
+
"version": "1.0.0-canary.4",
|
|
4
4
|
"description": "A tiny wrapper of white-web-sdk and @netless/window-manager.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"files": [
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@netless/app-slide": "0.3.0-canary.7",
|
|
17
|
-
"@netless/fastboard-core": "1.0.0-canary.
|
|
18
|
-
"@netless/fastboard-ui": "1.0.0-canary.
|
|
17
|
+
"@netless/fastboard-core": "1.0.0-canary.4",
|
|
18
|
+
"@netless/fastboard-ui": "1.0.0-canary.4"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@netless/esbuild-plugin-inline-sass": "0.1.0"
|
package/src/create.ts
CHANGED
|
@@ -2,7 +2,6 @@ import type { FastboardApp, FastboardOptions } from "@netless/fastboard-core";
|
|
|
2
2
|
|
|
3
3
|
import { createFastboardCore } from "@netless/fastboard-core";
|
|
4
4
|
import { registerDefaultApps, registerSlide } from "./behaviors/netless-app";
|
|
5
|
-
import { ensureNetlessUA } from "./behaviors/netless-ua";
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* Create a FastboardApp instance.
|
|
@@ -22,7 +21,6 @@ import { ensureNetlessUA } from "./behaviors/netless-ua";
|
|
|
22
21
|
export async function createFastboard<TEventData = any>(
|
|
23
22
|
options: FastboardOptions
|
|
24
23
|
): Promise<FastboardApp<TEventData>> {
|
|
25
|
-
ensureNetlessUA();
|
|
26
24
|
registerSlide();
|
|
27
25
|
registerDefaultApps();
|
|
28
26
|
return createFastboardCore<TEventData>(options);
|
package/src/replay.ts
CHANGED
|
@@ -2,7 +2,6 @@ import type { FastboardPlayer, FastboardReplayOptions } from "@netless/fastboard
|
|
|
2
2
|
|
|
3
3
|
import { replayFastboardCore } from "@netless/fastboard-core";
|
|
4
4
|
import { registerDefaultApps, registerSlide } from "./behaviors/netless-app";
|
|
5
|
-
import { ensureNetlessUA } from "./behaviors/netless-ua";
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* Create a FastboardPlayer instance.
|
|
@@ -23,7 +22,6 @@ import { ensureNetlessUA } from "./behaviors/netless-ua";
|
|
|
23
22
|
export async function replayFastboard<TEventData = any>(
|
|
24
23
|
options: FastboardReplayOptions
|
|
25
24
|
): Promise<FastboardPlayer<TEventData>> {
|
|
26
|
-
ensureNetlessUA();
|
|
27
25
|
registerSlide();
|
|
28
26
|
registerDefaultApps();
|
|
29
27
|
return replayFastboardCore<TEventData>(options);
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { name, version } from "@netless/fastboard-core";
|
|
2
|
-
|
|
3
|
-
interface InjectTarget {
|
|
4
|
-
__netlessUA?: string;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
let injected = false;
|
|
8
|
-
export function ensureNetlessUA() {
|
|
9
|
-
if (typeof window !== "undefined" && !injected) {
|
|
10
|
-
injected = true;
|
|
11
|
-
let str = (window as InjectTarget).__netlessUA || "";
|
|
12
|
-
str += ` ${name}/${version} `;
|
|
13
|
-
(window as InjectTarget).__netlessUA = str;
|
|
14
|
-
}
|
|
15
|
-
}
|