@3dverse/livelink.core 1.0.9 → 1.1.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/dist/_prebuild/engine_types/ComponentsRecord.d.ts +12 -0
- package/dist/_prebuild/engine_types/SceneSettingsRecord.d.ts +8 -0
- package/dist/_prebuild/engine_types/components.d.ts +58 -0
- package/dist/_prebuild/engine_types/sceneSettings.d.ts +36 -1
- package/dist/library.cjs +1 -1
- package/dist/library.cjs.map +2 -2
- package/dist/library.mjs +1 -1
- package/dist/library.mjs.map +3 -3
- package/dist/sources/ActivityWatcher.d.ts +2 -2
- package/dist/sources/CoreEvents.d.ts +4 -4
- package/dist/sources/LivelinkCore.d.ts +1 -3
- package/dist/sources/constants.d.ts +1 -0
- package/dist/sources/library.d.ts +5 -0
- package/package.json +1 -1
- package/dist/_prebuild/EditorConnection.d.ts +0 -6
- package/dist/sources/controllers/EditorController.d.ts +0 -1
- /package/dist/sources/{controllers → internal}/EditorEvents.d.ts +0 -0
- /package/dist/sources/{controllers → internal}/GatewayController.d.ts +0 -0
- /package/dist/sources/{controllers → internal}/GatewayEvents.d.ts +0 -0
|
@@ -92,6 +92,10 @@ export type ComponentsRecord = {
|
|
|
92
92
|
* Base component of all the other joint components (revolute_joint, etc.). By itself it will lock the orientations and distances of the constrainer and constrainee.
|
|
93
93
|
*/
|
|
94
94
|
joint: Components.Joint;
|
|
95
|
+
/**
|
|
96
|
+
* Display a label in the 3d view.
|
|
97
|
+
*/
|
|
98
|
+
label: Components.Label;
|
|
95
99
|
/**
|
|
96
100
|
* Lineage of the entity through linkers.
|
|
97
101
|
*/
|
|
@@ -112,6 +116,10 @@ export type ComponentsRecord = {
|
|
|
112
116
|
* Reference to a material.
|
|
113
117
|
*/
|
|
114
118
|
material_ref: Components.MaterialRef;
|
|
119
|
+
/**
|
|
120
|
+
* Display a measure in the 3d view.
|
|
121
|
+
*/
|
|
122
|
+
measure: Components.Measure;
|
|
115
123
|
/**
|
|
116
124
|
* Reference to a mesh.
|
|
117
125
|
*/
|
|
@@ -176,6 +184,10 @@ export type ComponentsRecord = {
|
|
|
176
184
|
* Sphere geometry.
|
|
177
185
|
*/
|
|
178
186
|
sphere_geometry: Components.SphereGeometry;
|
|
187
|
+
/**
|
|
188
|
+
* Display a spline in the 3d view.
|
|
189
|
+
*/
|
|
190
|
+
spline: Components.Spline;
|
|
179
191
|
/**
|
|
180
192
|
* Adds a cutoff to a point light to simulate a spot light.
|
|
181
193
|
*/
|
|
@@ -15,6 +15,14 @@ export type SceneSettingsRecord = {
|
|
|
15
15
|
* Settings for debug lines
|
|
16
16
|
*/
|
|
17
17
|
debug_lines?: SceneSettings.DebugLines;
|
|
18
|
+
/**
|
|
19
|
+
* Default camera component of the scene, used to create default cameras.
|
|
20
|
+
*/
|
|
21
|
+
default_camera_component?: SceneSettings.DefaultCameraComponent;
|
|
22
|
+
/**
|
|
23
|
+
* Default camera global transform of the scene, used to create default cameras.
|
|
24
|
+
*/
|
|
25
|
+
default_camera_transform?: SceneSettings.DefaultCameraTransform;
|
|
18
26
|
/**
|
|
19
27
|
* Settings for the display
|
|
20
28
|
*/
|
|
@@ -416,6 +416,29 @@ export type Joint = {
|
|
|
416
416
|
*/
|
|
417
417
|
enableCollision: boolean;
|
|
418
418
|
};
|
|
419
|
+
/**
|
|
420
|
+
* Display a label in the 3d view.
|
|
421
|
+
*/
|
|
422
|
+
export type Label = {
|
|
423
|
+
/**
|
|
424
|
+
* Title of the label.
|
|
425
|
+
*/
|
|
426
|
+
title: string;
|
|
427
|
+
/**
|
|
428
|
+
* Description of the label.
|
|
429
|
+
*/
|
|
430
|
+
description: string;
|
|
431
|
+
/**
|
|
432
|
+
* Camera distance from the label.
|
|
433
|
+
* @defaultValue 0,0,0,0,0,0,1
|
|
434
|
+
*/
|
|
435
|
+
camera: Array<Float>;
|
|
436
|
+
/**
|
|
437
|
+
* Travel speed in units per second.
|
|
438
|
+
* @defaultValue 15
|
|
439
|
+
*/
|
|
440
|
+
speed: Float;
|
|
441
|
+
};
|
|
419
442
|
/**
|
|
420
443
|
* Lineage of the entity through linkers.
|
|
421
444
|
*/
|
|
@@ -513,6 +536,21 @@ export type MaterialRef = {
|
|
|
513
536
|
*/
|
|
514
537
|
faceCulling: Int32;
|
|
515
538
|
};
|
|
539
|
+
/**
|
|
540
|
+
* Display a measure in the 3d view.
|
|
541
|
+
*/
|
|
542
|
+
export type Measure = {
|
|
543
|
+
/**
|
|
544
|
+
* Define the type of the measure.
|
|
545
|
+
* @defaultValue 0
|
|
546
|
+
*/
|
|
547
|
+
type: UInt32;
|
|
548
|
+
/**
|
|
549
|
+
* Color of the measure
|
|
550
|
+
* @defaultValue 1,1,1
|
|
551
|
+
*/
|
|
552
|
+
color: Vec3;
|
|
553
|
+
};
|
|
516
554
|
/**
|
|
517
555
|
* Reference to a mesh.
|
|
518
556
|
*/
|
|
@@ -893,6 +931,26 @@ export type SphereGeometry = {
|
|
|
893
931
|
*/
|
|
894
932
|
offset: Vec3;
|
|
895
933
|
};
|
|
934
|
+
/**
|
|
935
|
+
* Display a spline in the 3d view.
|
|
936
|
+
*/
|
|
937
|
+
export type Spline = {
|
|
938
|
+
/**
|
|
939
|
+
* Define the type of the curve.
|
|
940
|
+
* @defaultValue 0
|
|
941
|
+
*/
|
|
942
|
+
type: UInt32;
|
|
943
|
+
/**
|
|
944
|
+
* Color of the curve.
|
|
945
|
+
* @defaultValue 1,1,1
|
|
946
|
+
*/
|
|
947
|
+
color: Vec3;
|
|
948
|
+
/**
|
|
949
|
+
* When type is catmullrom, defines catmullrom's tension.
|
|
950
|
+
* @defaultValue 0.5
|
|
951
|
+
*/
|
|
952
|
+
tension: Float;
|
|
953
|
+
};
|
|
896
954
|
/**
|
|
897
955
|
* Adds a cutoff to a point light to simulate a spot light.
|
|
898
956
|
*/
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* DO NOT EDIT THIS FILE MANUALLY.
|
|
3
3
|
* This file has been generated automatically from ftl-schemas
|
|
4
4
|
*/
|
|
5
|
-
import type {
|
|
5
|
+
import type { Assets } from "../../sources/core";
|
|
6
|
+
import type { Vec3, UInt32, Float, Int32, Quat, AssetRef } from "../../sources/types";
|
|
6
7
|
/**
|
|
7
8
|
* Settings for debug lines
|
|
8
9
|
*/
|
|
@@ -68,6 +69,40 @@ export type DebugLines = {
|
|
|
68
69
|
*/
|
|
69
70
|
drawReflectionProbes?: boolean;
|
|
70
71
|
};
|
|
72
|
+
/**
|
|
73
|
+
* Default camera component of the scene, used to create default cameras.
|
|
74
|
+
*/
|
|
75
|
+
export type DefaultCameraComponent = {
|
|
76
|
+
/**
|
|
77
|
+
* Specifies which render graph this camera should use.
|
|
78
|
+
*/
|
|
79
|
+
renderGraphRef?: AssetRef<Assets.RenderGraph>;
|
|
80
|
+
/**
|
|
81
|
+
* Input values as described in the referenced render graph in their original JSON format.
|
|
82
|
+
* @defaultValue [object Object]
|
|
83
|
+
*/
|
|
84
|
+
dataJSON?: undefined;
|
|
85
|
+
/**
|
|
86
|
+
* Index of the render target to blit.
|
|
87
|
+
* @defaultValue -1
|
|
88
|
+
*/
|
|
89
|
+
renderTargetIndex?: Int32;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* Default camera global transform of the scene, used to create default cameras.
|
|
93
|
+
*/
|
|
94
|
+
export type DefaultCameraTransform = {
|
|
95
|
+
/**
|
|
96
|
+
* x, y, z position of the camera
|
|
97
|
+
* @defaultValue 0,0,0
|
|
98
|
+
*/
|
|
99
|
+
position?: Vec3;
|
|
100
|
+
/**
|
|
101
|
+
* Orientation of the camera expressed as a quaternion
|
|
102
|
+
* @defaultValue 0,0,0,1
|
|
103
|
+
*/
|
|
104
|
+
orientation?: Quat;
|
|
105
|
+
};
|
|
71
106
|
/**
|
|
72
107
|
* Settings for the display
|
|
73
108
|
*/
|
package/dist/library.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var d=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var u=(o,e)=>{for(var r in e)d(o,r,{get:e[r],enumerable:!0})},L=(o,e,r,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of c(e))!l.call(o,i)&&i!==r&&d(o,i,{get:()=>e[i],enumerable:!(t=p(e,i))||t.enumerable});return o};var m=o=>L(d({},"__esModule",{value:!0}),o);var I={};u(I,{DynamicLoader:()=>s});module.exports=m(I);var g=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,s=class o{static#e=null;static#o=null;static get Core(){if(!o.#e)throw new Error("Livelink core not initialized");return o.#e}static load(e="prod"){return o.#o||(o.#o=o.#r(e)),o.#o}static async#r(e){let r=await o.#i(e),{LivelinkCore:t}=await r();o.#e=t;let i={prod:"#FFC700",dev:"#36D399",debug:"#FB4949"};console.info(`%c Livelink Core initialized \u{1F680} %c ${t.VERSION} %c ${t.COMMIT_SHA} %c${e}`,"background: #080A12; color: #FFC700; font-weight: bold; padding: 8px; padding-right: 164px; border-radius: 16px; margin: 16px 0 16px 0","background: #9EA6D6; color: #0A1018; font-weight: bold; padding: 1px; padding-right: 0px; margin-left: -160px; border-radius: 16px 0 0 16px;","background: #6973A8; color: #0A1018; font-weight: bold; padding: 1px; padding-left: 0; border-radius: 0 16px 16px 0;",`background: ${i[e]}; color: #000; font-weight: bold; padding: 6px 16px; border: 4px solid #080A12; border-radius: 16px; margin-left: 16px`)}static async#i(e){let r="https://cdn.3dverse.com/livelink/core/1.1/"+(e!=="prod"?`core.${e}.mjs`:"core.mjs");if(!g)return new Function("return import('"+r+"')");let i=await(await fetch(r)).text(),a=await new Function("return import('node:vm')")();return a.SourceTextModule?(console.info("Using experimental VM SourceTextModule to load Livelink core"),async()=>{let n=new a.SourceTextModule(i,{identifier:r});return await n.link(()=>{}),await n.evaluate(),n.namespace}):new Function("return import('data:text/javascript;base64,"+btoa(i)+"')")}constructor(){}};typeof window<"u"&&(window.__LIVELINK__||(window.__LIVELINK__={}),Object.prototype.hasOwnProperty.call(window.__LIVELINK__,"@3dverse/livelink.core")?console.warn("\u26A0\uFE0F WARNING \u26A0\uFE0F Multiple instances of Livelink Core being imported."):window.__LIVELINK__["@3dverse/livelink.core"]="1.1.0");
|
|
2
2
|
//# sourceMappingURL=library.cjs.map
|
package/dist/library.cjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../sources/library.ts", "../sources/DynamicLoader.ts"],
|
|
4
|
-
"sourcesContent": ["export * from \"./DynamicLoader\";\nexport type * from \"./core\";\n", "import type { LivelinkCore } from \"./LivelinkCore\";\nimport type VM from \"node:vm\";\n\n/**\n *\n */\nconst isNode = typeof process !== \"undefined\" && process.versions != null && process.versions.node != null;\n\n/**\n * The URL of the Livelink core library. Injected by the build system.\n */\ndeclare const LIVELINK_CORE_URL: string;\n\n/**\n *\n */\ntype LivelinkCoreType = typeof LivelinkCore;\n\n/**\n *\n */\ntype CoreImporter = () => Promise<{\n LivelinkCore: LivelinkCoreType;\n LIVELINK_CORE_VERSION: string;\n LIVELINK_CORE_COMMIT_SHA: string;\n}>;\n\n/**\n *\n */\ntype BuildTarget = \"prod\" | \"dev\" | \"debug\";\n\n/**\n * Dynamically loads the Livelink core library.\n *\n * {@link DynamicLoader.load} must be called before accessing {@link DynamicLoader.Core}.\n *\n * ### Usage\n * ```typescript\n * await DynamicLoader.load();\n * const core = new DynamicLoader.Core();\n * ```\n *\n * @category Core\n */\nexport class DynamicLoader {\n /**\n *\n */\n static #core: LivelinkCoreType | null = null;\n\n /**\n *\n */\n static #importPromise: Promise<void> | null = null;\n\n /**\n * Returns the core.\n */\n static get Core(): LivelinkCoreType {\n if (!DynamicLoader.#core) {\n throw new Error(\"Livelink core not initialized\");\n }\n return DynamicLoader.#core;\n }\n\n /**\n * Dynamically loads the Livelink core library.\n *\n * Must be called before accessing {@link DynamicLoader.Core}.\n * Only one target can be loaded at a time.\n *\n * @param target - The target build to load.\n * - `\"prod\"`: Contains no debug information.\n * - `\"dev\"`: Contains some debug information.\n * - `\"debug\"`: Contains extra debug information.\n */\n static load(target: BuildTarget = \"prod\"): Promise<void> {\n if (!DynamicLoader.#importPromise) {\n DynamicLoader.#importPromise = DynamicLoader.#importCore(target);\n }\n\n return DynamicLoader.#importPromise;\n }\n\n /**\n *\n */\n static async #importCore(target: BuildTarget): Promise<void> {\n const dynamicImport = await DynamicLoader.#createImporter(target);\n const { LivelinkCore } = await dynamicImport();\n\n DynamicLoader.#core = LivelinkCore;\n\n const TARGET_COLOR = {\n prod: \"#FFC700\",\n dev: \"#36D399\",\n debug: \"#FB4949\",\n } satisfies Record<BuildTarget, string>;\n\n console.info(\n `%c Livelink Core initialized \uD83D\uDE80 %c ${LivelinkCore.VERSION} %c ${LivelinkCore.COMMIT_SHA} %c${target}`,\n \"background: #080A12; color: #FFC700; font-weight: bold; padding: 8px; padding-right: 164px; border-radius: 16px; margin: 16px 0 16px 0\",\n \"background: #9EA6D6; color: #0A1018; font-weight: bold; padding: 1px; padding-right: 0px; margin-left: -160px; border-radius: 16px 0 0 16px;\",\n \"background: #6973A8; color: #0A1018; font-weight: bold; padding: 1px; padding-left: 0; border-radius: 0 16px 16px 0;\",\n `background: ${TARGET_COLOR[target]}; color: #000; font-weight: bold; padding: 6px 16px; border: 4px solid #080A12; border-radius: 16px; margin-left: 16px`,\n );\n }\n\n /**\n *\n */\n static async #createImporter(target: string): Promise<CoreImporter> {\n const moduleURL = LIVELINK_CORE_URL + \"/\" + (target !== \"prod\" ? `core.${target}.mjs` : \"core.mjs\");\n\n if (!isNode) {\n return new Function(\"return import('\" + moduleURL + \"')\") as CoreImporter;\n }\n\n const response = await fetch(moduleURL);\n const source = await response.text();\n\n // As a platform neutral build, we needs to load node:vm dynamically.\n // We can't use await import('node:vm') directly because it will be resolved at build time\n // and will not be available in the browser.\n const vm = (await new Function(\"return import('node:vm')\")()) as {\n SourceTextModule: typeof VM.SourceTextModule;\n };\n\n // VM Modules is an experimental feature, so it may not be available in all versions of Node.js.\n // This feature is only available with the --experimental-vm-modules command flag enabled.\n if (!vm.SourceTextModule) {\n return new Function(\"return import('data:text/javascript;base64,\" + btoa(source) + \"')\") as CoreImporter;\n }\n\n console.info(\"Using experimental VM SourceTextModule to load Livelink core\");\n return (async () => {\n const module = new vm.SourceTextModule(source, { identifier: moduleURL });\n // @ts-expect-error: Since core has no dependencies, the linker function will never be called.\n await module.link(() => {});\n await module.evaluate();\n\n return module.namespace;\n }) as CoreImporter;\n }\n\n /**\n *\n */\n private constructor() {}\n}\n"],
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mBAAAE,IAAA,eAAAC,EAAAH,GCMA,IAAMI,EAAS,OAAO,QAAY,KAAe,QAAQ,UAAY,MAAQ,QAAQ,SAAS,MAAQ,KAuCzFC,EAAN,MAAMC,CAAc,CAIvB,MAAOC,GAAiC,KAKxC,MAAOC,GAAuC,KAK9C,WAAW,MAAyB,CAChC,GAAI,CAACF,EAAcC,GACf,MAAM,IAAI,MAAM,+BAA+B,EAEnD,OAAOD,EAAcC,EACzB,CAaA,OAAO,KAAKE,EAAsB,OAAuB,CACrD,OAAKH,EAAcE,KACfF,EAAcE,GAAiBF,EAAcI,GAAYD,CAAM,GAG5DH,EAAcE,EACzB,CAKA,YAAaE,GAAYD,EAAoC,CACzD,IAAME,EAAgB,MAAML,EAAcM,GAAgBH,CAAM,EAC1D,CAAE,aAAAI,CAAa,EAAI,MAAMF,EAAc,EAE7CL,EAAcC,GAAQM,EAEtB,IAAMC,EAAe,CACjB,KAAM,UACN,IAAK,UACL,MAAO,SACX,EAEA,QAAQ,KACJ,6CAAsCD,EAAa,OAAO,OAAOA,EAAa,UAAU,MAAMJ,CAAM,GACpG,yIACA,+IACA,uHACA,eAAeK,EAAaL,CAAM,CAAC,wHACvC,CACJ,CAKA,YAAaG,GAAgBH,EAAuC,CAChE,IAAMM,EAAY,8CAA2BN,IAAW,OAAS,QAAQA,CAAM,OAAS,YAExF,GAAI,CAACL,EACD,OAAO,IAAI,SAAS,kBAAoBW,EAAY,IAAI,EAI5D,IAAMC,EAAS,MADE,MAAM,MAAMD,CAAS,GACR,KAAK,EAK7BE,EAAM,MAAM,IAAI,SAAS,0BAA0B,EAAE,EAM3D,OAAKA,EAAG,kBAIR,QAAQ,KAAK,8DAA8D,EACnE,SAAY,CAChB,IAAMC,EAAS,IAAID,EAAG,iBAAiBD,EAAQ,CAAE,WAAYD,CAAU,CAAC,EAExE,aAAMG,EAAO,KAAK,IAAM,CAAC,CAAC,EAC1B,MAAMA,EAAO,SAAS,EAEfA,EAAO,SAClB,GAXW,IAAI,SAAS,8CAAgD,KAAKF,CAAM,EAAI,IAAI,CAY/F,CAKQ,aAAc,CAAC,CAC3B",
|
|
4
|
+
"sourcesContent": ["export * from \"./DynamicLoader\";\nexport type * from \"./core\";\n\n//------------------------------------------------------------------------------\n/**\n * Version of the Livelink Core library, injected by the build system.\n * @internal\n */\ndeclare const LIVELINK_CORE_VERSION: string;\n\n/**\n * Name of the package, injected by the build system.\n * @internal\n */\ndeclare const PACKAGE_NAME: string;\n\n//------------------------------------------------------------------------------\ndeclare global {\n interface Window {\n __LIVELINK__: Record<string, string>;\n }\n}\n\n//------------------------------------------------------------------------------\nif (typeof window !== \"undefined\") {\n if (!window.__LIVELINK__) {\n window.__LIVELINK__ = {};\n }\n\n if (Object.prototype.hasOwnProperty.call(window.__LIVELINK__, PACKAGE_NAME)) {\n console.warn(\"\u26A0\uFE0F WARNING \u26A0\uFE0F Multiple instances of Livelink Core being imported.\");\n } else {\n window.__LIVELINK__[PACKAGE_NAME] = LIVELINK_CORE_VERSION;\n }\n}\n", "import type { LivelinkCore } from \"./LivelinkCore\";\nimport type VM from \"node:vm\";\n\n/**\n *\n */\nconst isNode = typeof process !== \"undefined\" && process.versions != null && process.versions.node != null;\n\n/**\n * The URL of the Livelink core library. Injected by the build system.\n */\ndeclare const LIVELINK_CORE_URL: string;\n\n/**\n *\n */\ntype LivelinkCoreType = typeof LivelinkCore;\n\n/**\n *\n */\ntype CoreImporter = () => Promise<{\n LivelinkCore: LivelinkCoreType;\n LIVELINK_CORE_VERSION: string;\n LIVELINK_CORE_COMMIT_SHA: string;\n}>;\n\n/**\n *\n */\ntype BuildTarget = \"prod\" | \"dev\" | \"debug\";\n\n/**\n * Dynamically loads the Livelink core library.\n *\n * {@link DynamicLoader.load} must be called before accessing {@link DynamicLoader.Core}.\n *\n * ### Usage\n * ```typescript\n * await DynamicLoader.load();\n * const core = new DynamicLoader.Core();\n * ```\n *\n * @category Core\n */\nexport class DynamicLoader {\n /**\n *\n */\n static #core: LivelinkCoreType | null = null;\n\n /**\n *\n */\n static #importPromise: Promise<void> | null = null;\n\n /**\n * Returns the core.\n */\n static get Core(): LivelinkCoreType {\n if (!DynamicLoader.#core) {\n throw new Error(\"Livelink core not initialized\");\n }\n return DynamicLoader.#core;\n }\n\n /**\n * Dynamically loads the Livelink core library.\n *\n * Must be called before accessing {@link DynamicLoader.Core}.\n * Only one target can be loaded at a time.\n *\n * @param target - The target build to load.\n * - `\"prod\"`: Contains no debug information.\n * - `\"dev\"`: Contains some debug information.\n * - `\"debug\"`: Contains extra debug information.\n */\n static load(target: BuildTarget = \"prod\"): Promise<void> {\n if (!DynamicLoader.#importPromise) {\n DynamicLoader.#importPromise = DynamicLoader.#importCore(target);\n }\n\n return DynamicLoader.#importPromise;\n }\n\n /**\n *\n */\n static async #importCore(target: BuildTarget): Promise<void> {\n const dynamicImport = await DynamicLoader.#createImporter(target);\n const { LivelinkCore } = await dynamicImport();\n\n DynamicLoader.#core = LivelinkCore;\n\n const TARGET_COLOR = {\n prod: \"#FFC700\",\n dev: \"#36D399\",\n debug: \"#FB4949\",\n } satisfies Record<BuildTarget, string>;\n\n console.info(\n `%c Livelink Core initialized \uD83D\uDE80 %c ${LivelinkCore.VERSION} %c ${LivelinkCore.COMMIT_SHA} %c${target}`,\n \"background: #080A12; color: #FFC700; font-weight: bold; padding: 8px; padding-right: 164px; border-radius: 16px; margin: 16px 0 16px 0\",\n \"background: #9EA6D6; color: #0A1018; font-weight: bold; padding: 1px; padding-right: 0px; margin-left: -160px; border-radius: 16px 0 0 16px;\",\n \"background: #6973A8; color: #0A1018; font-weight: bold; padding: 1px; padding-left: 0; border-radius: 0 16px 16px 0;\",\n `background: ${TARGET_COLOR[target]}; color: #000; font-weight: bold; padding: 6px 16px; border: 4px solid #080A12; border-radius: 16px; margin-left: 16px`,\n );\n }\n\n /**\n *\n */\n static async #createImporter(target: string): Promise<CoreImporter> {\n const moduleURL = LIVELINK_CORE_URL + \"/\" + (target !== \"prod\" ? `core.${target}.mjs` : \"core.mjs\");\n\n if (!isNode) {\n return new Function(\"return import('\" + moduleURL + \"')\") as CoreImporter;\n }\n\n const response = await fetch(moduleURL);\n const source = await response.text();\n\n // As a platform neutral build, we needs to load node:vm dynamically.\n // We can't use await import('node:vm') directly because it will be resolved at build time\n // and will not be available in the browser.\n const vm = (await new Function(\"return import('node:vm')\")()) as {\n SourceTextModule: typeof VM.SourceTextModule;\n };\n\n // VM Modules is an experimental feature, so it may not be available in all versions of Node.js.\n // This feature is only available with the --experimental-vm-modules command flag enabled.\n if (!vm.SourceTextModule) {\n return new Function(\"return import('data:text/javascript;base64,\" + btoa(source) + \"')\") as CoreImporter;\n }\n\n console.info(\"Using experimental VM SourceTextModule to load Livelink core\");\n return (async () => {\n const module = new vm.SourceTextModule(source, { identifier: moduleURL });\n // @ts-expect-error: Since core has no dependencies, the linker function will never be called.\n await module.link(() => {});\n await module.evaluate();\n\n return module.namespace;\n }) as CoreImporter;\n }\n\n /**\n *\n */\n private constructor() {}\n}\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mBAAAE,IAAA,eAAAC,EAAAH,GCMA,IAAMI,EAAS,OAAO,QAAY,KAAe,QAAQ,UAAY,MAAQ,QAAQ,SAAS,MAAQ,KAuCzFC,EAAN,MAAMC,CAAc,CAIvB,MAAOC,GAAiC,KAKxC,MAAOC,GAAuC,KAK9C,WAAW,MAAyB,CAChC,GAAI,CAACF,EAAcC,GACf,MAAM,IAAI,MAAM,+BAA+B,EAEnD,OAAOD,EAAcC,EACzB,CAaA,OAAO,KAAKE,EAAsB,OAAuB,CACrD,OAAKH,EAAcE,KACfF,EAAcE,GAAiBF,EAAcI,GAAYD,CAAM,GAG5DH,EAAcE,EACzB,CAKA,YAAaE,GAAYD,EAAoC,CACzD,IAAME,EAAgB,MAAML,EAAcM,GAAgBH,CAAM,EAC1D,CAAE,aAAAI,CAAa,EAAI,MAAMF,EAAc,EAE7CL,EAAcC,GAAQM,EAEtB,IAAMC,EAAe,CACjB,KAAM,UACN,IAAK,UACL,MAAO,SACX,EAEA,QAAQ,KACJ,6CAAsCD,EAAa,OAAO,OAAOA,EAAa,UAAU,MAAMJ,CAAM,GACpG,yIACA,+IACA,uHACA,eAAeK,EAAaL,CAAM,CAAC,wHACvC,CACJ,CAKA,YAAaG,GAAgBH,EAAuC,CAChE,IAAMM,EAAY,8CAA2BN,IAAW,OAAS,QAAQA,CAAM,OAAS,YAExF,GAAI,CAACL,EACD,OAAO,IAAI,SAAS,kBAAoBW,EAAY,IAAI,EAI5D,IAAMC,EAAS,MADE,MAAM,MAAMD,CAAS,GACR,KAAK,EAK7BE,EAAM,MAAM,IAAI,SAAS,0BAA0B,EAAE,EAM3D,OAAKA,EAAG,kBAIR,QAAQ,KAAK,8DAA8D,EACnE,SAAY,CAChB,IAAMC,EAAS,IAAID,EAAG,iBAAiBD,EAAQ,CAAE,WAAYD,CAAU,CAAC,EAExE,aAAMG,EAAO,KAAK,IAAM,CAAC,CAAC,EAC1B,MAAMA,EAAO,SAAS,EAEfA,EAAO,SAClB,GAXW,IAAI,SAAS,8CAAgD,KAAKF,CAAM,EAAI,IAAI,CAY/F,CAKQ,aAAc,CAAC,CAC3B,ED9HI,OAAO,OAAW,MACb,OAAO,eACR,OAAO,aAAe,CAAC,GAGvB,OAAO,UAAU,eAAe,KAAK,OAAO,aAAc,wBAAY,EACtE,QAAQ,KAAK,uFAAmE,EAEhF,OAAO,aAAa,wBAAY,EAAI",
|
|
6
6
|
"names": ["library_exports", "__export", "DynamicLoader", "__toCommonJS", "isNode", "DynamicLoader", "_DynamicLoader", "#core", "#importPromise", "target", "#importCore", "dynamicImport", "#createImporter", "LivelinkCore", "TARGET_COLOR", "moduleURL", "source", "vm", "module"]
|
|
7
7
|
}
|
package/dist/library.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var
|
|
1
|
+
var a=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,s=class e{static#e=null;static#o=null;static get Core(){if(!e.#e)throw new Error("Livelink core not initialized");return e.#e}static load(o="prod"){return e.#o||(e.#o=e.#r(o)),e.#o}static async#r(o){let r=await e.#i(o),{LivelinkCore:i}=await r();e.#e=i;let t={prod:"#FFC700",dev:"#36D399",debug:"#FB4949"};console.info(`%c Livelink Core initialized \u{1F680} %c ${i.VERSION} %c ${i.COMMIT_SHA} %c${o}`,"background: #080A12; color: #FFC700; font-weight: bold; padding: 8px; padding-right: 164px; border-radius: 16px; margin: 16px 0 16px 0","background: #9EA6D6; color: #0A1018; font-weight: bold; padding: 1px; padding-right: 0px; margin-left: -160px; border-radius: 16px 0 0 16px;","background: #6973A8; color: #0A1018; font-weight: bold; padding: 1px; padding-left: 0; border-radius: 0 16px 16px 0;",`background: ${t[o]}; color: #000; font-weight: bold; padding: 6px 16px; border: 4px solid #080A12; border-radius: 16px; margin-left: 16px`)}static async#i(o){let r="https://cdn.3dverse.com/livelink/core/1.1/"+(o!=="prod"?`core.${o}.mjs`:"core.mjs");if(!a)return new Function("return import('"+r+"')");let t=await(await fetch(r)).text(),d=await new Function("return import('node:vm')")();return d.SourceTextModule?(console.info("Using experimental VM SourceTextModule to load Livelink core"),async()=>{let n=new d.SourceTextModule(t,{identifier:r});return await n.link(()=>{}),await n.evaluate(),n.namespace}):new Function("return import('data:text/javascript;base64,"+btoa(t)+"')")}constructor(){}};typeof window<"u"&&(window.__LIVELINK__||(window.__LIVELINK__={}),Object.prototype.hasOwnProperty.call(window.__LIVELINK__,"@3dverse/livelink.core")?console.warn("\u26A0\uFE0F WARNING \u26A0\uFE0F Multiple instances of Livelink Core being imported."):window.__LIVELINK__["@3dverse/livelink.core"]="1.1.0");export{s as DynamicLoader};
|
|
2
2
|
//# sourceMappingURL=library.mjs.map
|
package/dist/library.mjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../sources/DynamicLoader.ts"],
|
|
4
|
-
"sourcesContent": ["import type { LivelinkCore } from \"./LivelinkCore\";\nimport type VM from \"node:vm\";\n\n/**\n *\n */\nconst isNode = typeof process !== \"undefined\" && process.versions != null && process.versions.node != null;\n\n/**\n * The URL of the Livelink core library. Injected by the build system.\n */\ndeclare const LIVELINK_CORE_URL: string;\n\n/**\n *\n */\ntype LivelinkCoreType = typeof LivelinkCore;\n\n/**\n *\n */\ntype CoreImporter = () => Promise<{\n LivelinkCore: LivelinkCoreType;\n LIVELINK_CORE_VERSION: string;\n LIVELINK_CORE_COMMIT_SHA: string;\n}>;\n\n/**\n *\n */\ntype BuildTarget = \"prod\" | \"dev\" | \"debug\";\n\n/**\n * Dynamically loads the Livelink core library.\n *\n * {@link DynamicLoader.load} must be called before accessing {@link DynamicLoader.Core}.\n *\n * ### Usage\n * ```typescript\n * await DynamicLoader.load();\n * const core = new DynamicLoader.Core();\n * ```\n *\n * @category Core\n */\nexport class DynamicLoader {\n /**\n *\n */\n static #core: LivelinkCoreType | null = null;\n\n /**\n *\n */\n static #importPromise: Promise<void> | null = null;\n\n /**\n * Returns the core.\n */\n static get Core(): LivelinkCoreType {\n if (!DynamicLoader.#core) {\n throw new Error(\"Livelink core not initialized\");\n }\n return DynamicLoader.#core;\n }\n\n /**\n * Dynamically loads the Livelink core library.\n *\n * Must be called before accessing {@link DynamicLoader.Core}.\n * Only one target can be loaded at a time.\n *\n * @param target - The target build to load.\n * - `\"prod\"`: Contains no debug information.\n * - `\"dev\"`: Contains some debug information.\n * - `\"debug\"`: Contains extra debug information.\n */\n static load(target: BuildTarget = \"prod\"): Promise<void> {\n if (!DynamicLoader.#importPromise) {\n DynamicLoader.#importPromise = DynamicLoader.#importCore(target);\n }\n\n return DynamicLoader.#importPromise;\n }\n\n /**\n *\n */\n static async #importCore(target: BuildTarget): Promise<void> {\n const dynamicImport = await DynamicLoader.#createImporter(target);\n const { LivelinkCore } = await dynamicImport();\n\n DynamicLoader.#core = LivelinkCore;\n\n const TARGET_COLOR = {\n prod: \"#FFC700\",\n dev: \"#36D399\",\n debug: \"#FB4949\",\n } satisfies Record<BuildTarget, string>;\n\n console.info(\n `%c Livelink Core initialized \uD83D\uDE80 %c ${LivelinkCore.VERSION} %c ${LivelinkCore.COMMIT_SHA} %c${target}`,\n \"background: #080A12; color: #FFC700; font-weight: bold; padding: 8px; padding-right: 164px; border-radius: 16px; margin: 16px 0 16px 0\",\n \"background: #9EA6D6; color: #0A1018; font-weight: bold; padding: 1px; padding-right: 0px; margin-left: -160px; border-radius: 16px 0 0 16px;\",\n \"background: #6973A8; color: #0A1018; font-weight: bold; padding: 1px; padding-left: 0; border-radius: 0 16px 16px 0;\",\n `background: ${TARGET_COLOR[target]}; color: #000; font-weight: bold; padding: 6px 16px; border: 4px solid #080A12; border-radius: 16px; margin-left: 16px`,\n );\n }\n\n /**\n *\n */\n static async #createImporter(target: string): Promise<CoreImporter> {\n const moduleURL = LIVELINK_CORE_URL + \"/\" + (target !== \"prod\" ? `core.${target}.mjs` : \"core.mjs\");\n\n if (!isNode) {\n return new Function(\"return import('\" + moduleURL + \"')\") as CoreImporter;\n }\n\n const response = await fetch(moduleURL);\n const source = await response.text();\n\n // As a platform neutral build, we needs to load node:vm dynamically.\n // We can't use await import('node:vm') directly because it will be resolved at build time\n // and will not be available in the browser.\n const vm = (await new Function(\"return import('node:vm')\")()) as {\n SourceTextModule: typeof VM.SourceTextModule;\n };\n\n // VM Modules is an experimental feature, so it may not be available in all versions of Node.js.\n // This feature is only available with the --experimental-vm-modules command flag enabled.\n if (!vm.SourceTextModule) {\n return new Function(\"return import('data:text/javascript;base64,\" + btoa(source) + \"')\") as CoreImporter;\n }\n\n console.info(\"Using experimental VM SourceTextModule to load Livelink core\");\n return (async () => {\n const module = new vm.SourceTextModule(source, { identifier: moduleURL });\n // @ts-expect-error: Since core has no dependencies, the linker function will never be called.\n await module.link(() => {});\n await module.evaluate();\n\n return module.namespace;\n }) as CoreImporter;\n }\n\n /**\n *\n */\n private constructor() {}\n}\n"],
|
|
5
|
-
"mappings": "AAMA,IAAMA,EAAS,OAAO,QAAY,KAAe,QAAQ,UAAY,MAAQ,QAAQ,SAAS,MAAQ,KAuCzFC,EAAN,MAAMC,CAAc,CAIvB,MAAOC,GAAiC,KAKxC,MAAOC,GAAuC,KAK9C,WAAW,MAAyB,CAChC,GAAI,CAACF,EAAcC,GACf,MAAM,IAAI,MAAM,+BAA+B,EAEnD,OAAOD,EAAcC,EACzB,CAaA,OAAO,KAAKE,EAAsB,OAAuB,CACrD,OAAKH,EAAcE,KACfF,EAAcE,GAAiBF,EAAcI,GAAYD,CAAM,GAG5DH,EAAcE,EACzB,CAKA,YAAaE,GAAYD,EAAoC,CACzD,IAAME,EAAgB,MAAML,EAAcM,GAAgBH,CAAM,EAC1D,CAAE,aAAAI,CAAa,EAAI,MAAMF,EAAc,EAE7CL,EAAcC,GAAQM,EAEtB,IAAMC,EAAe,CACjB,KAAM,UACN,IAAK,UACL,MAAO,SACX,EAEA,QAAQ,KACJ,6CAAsCD,EAAa,OAAO,OAAOA,EAAa,UAAU,MAAMJ,CAAM,GACpG,yIACA,+IACA,uHACA,eAAeK,EAAaL,CAAM,CAAC,wHACvC,CACJ,CAKA,YAAaG,GAAgBH,EAAuC,CAChE,IAAMM,EAAY,8CAA2BN,IAAW,OAAS,QAAQA,CAAM,OAAS,YAExF,GAAI,CAACL,EACD,OAAO,IAAI,SAAS,kBAAoBW,EAAY,IAAI,EAI5D,IAAMC,EAAS,MADE,MAAM,MAAMD,CAAS,GACR,KAAK,EAK7BE,EAAM,MAAM,IAAI,SAAS,0BAA0B,EAAE,EAM3D,OAAKA,EAAG,kBAIR,QAAQ,KAAK,8DAA8D,EACnE,SAAY,CAChB,IAAMC,EAAS,IAAID,EAAG,iBAAiBD,EAAQ,CAAE,WAAYD,CAAU,CAAC,EAExE,aAAMG,EAAO,KAAK,IAAM,CAAC,CAAC,EAC1B,MAAMA,EAAO,SAAS,EAEfA,EAAO,SAClB,GAXW,IAAI,SAAS,8CAAgD,KAAKF,CAAM,EAAI,IAAI,CAY/F,CAKQ,aAAc,CAAC,CAC3B",
|
|
3
|
+
"sources": ["../sources/DynamicLoader.ts", "../sources/library.ts"],
|
|
4
|
+
"sourcesContent": ["import type { LivelinkCore } from \"./LivelinkCore\";\nimport type VM from \"node:vm\";\n\n/**\n *\n */\nconst isNode = typeof process !== \"undefined\" && process.versions != null && process.versions.node != null;\n\n/**\n * The URL of the Livelink core library. Injected by the build system.\n */\ndeclare const LIVELINK_CORE_URL: string;\n\n/**\n *\n */\ntype LivelinkCoreType = typeof LivelinkCore;\n\n/**\n *\n */\ntype CoreImporter = () => Promise<{\n LivelinkCore: LivelinkCoreType;\n LIVELINK_CORE_VERSION: string;\n LIVELINK_CORE_COMMIT_SHA: string;\n}>;\n\n/**\n *\n */\ntype BuildTarget = \"prod\" | \"dev\" | \"debug\";\n\n/**\n * Dynamically loads the Livelink core library.\n *\n * {@link DynamicLoader.load} must be called before accessing {@link DynamicLoader.Core}.\n *\n * ### Usage\n * ```typescript\n * await DynamicLoader.load();\n * const core = new DynamicLoader.Core();\n * ```\n *\n * @category Core\n */\nexport class DynamicLoader {\n /**\n *\n */\n static #core: LivelinkCoreType | null = null;\n\n /**\n *\n */\n static #importPromise: Promise<void> | null = null;\n\n /**\n * Returns the core.\n */\n static get Core(): LivelinkCoreType {\n if (!DynamicLoader.#core) {\n throw new Error(\"Livelink core not initialized\");\n }\n return DynamicLoader.#core;\n }\n\n /**\n * Dynamically loads the Livelink core library.\n *\n * Must be called before accessing {@link DynamicLoader.Core}.\n * Only one target can be loaded at a time.\n *\n * @param target - The target build to load.\n * - `\"prod\"`: Contains no debug information.\n * - `\"dev\"`: Contains some debug information.\n * - `\"debug\"`: Contains extra debug information.\n */\n static load(target: BuildTarget = \"prod\"): Promise<void> {\n if (!DynamicLoader.#importPromise) {\n DynamicLoader.#importPromise = DynamicLoader.#importCore(target);\n }\n\n return DynamicLoader.#importPromise;\n }\n\n /**\n *\n */\n static async #importCore(target: BuildTarget): Promise<void> {\n const dynamicImport = await DynamicLoader.#createImporter(target);\n const { LivelinkCore } = await dynamicImport();\n\n DynamicLoader.#core = LivelinkCore;\n\n const TARGET_COLOR = {\n prod: \"#FFC700\",\n dev: \"#36D399\",\n debug: \"#FB4949\",\n } satisfies Record<BuildTarget, string>;\n\n console.info(\n `%c Livelink Core initialized \uD83D\uDE80 %c ${LivelinkCore.VERSION} %c ${LivelinkCore.COMMIT_SHA} %c${target}`,\n \"background: #080A12; color: #FFC700; font-weight: bold; padding: 8px; padding-right: 164px; border-radius: 16px; margin: 16px 0 16px 0\",\n \"background: #9EA6D6; color: #0A1018; font-weight: bold; padding: 1px; padding-right: 0px; margin-left: -160px; border-radius: 16px 0 0 16px;\",\n \"background: #6973A8; color: #0A1018; font-weight: bold; padding: 1px; padding-left: 0; border-radius: 0 16px 16px 0;\",\n `background: ${TARGET_COLOR[target]}; color: #000; font-weight: bold; padding: 6px 16px; border: 4px solid #080A12; border-radius: 16px; margin-left: 16px`,\n );\n }\n\n /**\n *\n */\n static async #createImporter(target: string): Promise<CoreImporter> {\n const moduleURL = LIVELINK_CORE_URL + \"/\" + (target !== \"prod\" ? `core.${target}.mjs` : \"core.mjs\");\n\n if (!isNode) {\n return new Function(\"return import('\" + moduleURL + \"')\") as CoreImporter;\n }\n\n const response = await fetch(moduleURL);\n const source = await response.text();\n\n // As a platform neutral build, we needs to load node:vm dynamically.\n // We can't use await import('node:vm') directly because it will be resolved at build time\n // and will not be available in the browser.\n const vm = (await new Function(\"return import('node:vm')\")()) as {\n SourceTextModule: typeof VM.SourceTextModule;\n };\n\n // VM Modules is an experimental feature, so it may not be available in all versions of Node.js.\n // This feature is only available with the --experimental-vm-modules command flag enabled.\n if (!vm.SourceTextModule) {\n return new Function(\"return import('data:text/javascript;base64,\" + btoa(source) + \"')\") as CoreImporter;\n }\n\n console.info(\"Using experimental VM SourceTextModule to load Livelink core\");\n return (async () => {\n const module = new vm.SourceTextModule(source, { identifier: moduleURL });\n // @ts-expect-error: Since core has no dependencies, the linker function will never be called.\n await module.link(() => {});\n await module.evaluate();\n\n return module.namespace;\n }) as CoreImporter;\n }\n\n /**\n *\n */\n private constructor() {}\n}\n", "export * from \"./DynamicLoader\";\nexport type * from \"./core\";\n\n//------------------------------------------------------------------------------\n/**\n * Version of the Livelink Core library, injected by the build system.\n * @internal\n */\ndeclare const LIVELINK_CORE_VERSION: string;\n\n/**\n * Name of the package, injected by the build system.\n * @internal\n */\ndeclare const PACKAGE_NAME: string;\n\n//------------------------------------------------------------------------------\ndeclare global {\n interface Window {\n __LIVELINK__: Record<string, string>;\n }\n}\n\n//------------------------------------------------------------------------------\nif (typeof window !== \"undefined\") {\n if (!window.__LIVELINK__) {\n window.__LIVELINK__ = {};\n }\n\n if (Object.prototype.hasOwnProperty.call(window.__LIVELINK__, PACKAGE_NAME)) {\n console.warn(\"\u26A0\uFE0F WARNING \u26A0\uFE0F Multiple instances of Livelink Core being imported.\");\n } else {\n window.__LIVELINK__[PACKAGE_NAME] = LIVELINK_CORE_VERSION;\n }\n}\n"],
|
|
5
|
+
"mappings": "AAMA,IAAMA,EAAS,OAAO,QAAY,KAAe,QAAQ,UAAY,MAAQ,QAAQ,SAAS,MAAQ,KAuCzFC,EAAN,MAAMC,CAAc,CAIvB,MAAOC,GAAiC,KAKxC,MAAOC,GAAuC,KAK9C,WAAW,MAAyB,CAChC,GAAI,CAACF,EAAcC,GACf,MAAM,IAAI,MAAM,+BAA+B,EAEnD,OAAOD,EAAcC,EACzB,CAaA,OAAO,KAAKE,EAAsB,OAAuB,CACrD,OAAKH,EAAcE,KACfF,EAAcE,GAAiBF,EAAcI,GAAYD,CAAM,GAG5DH,EAAcE,EACzB,CAKA,YAAaE,GAAYD,EAAoC,CACzD,IAAME,EAAgB,MAAML,EAAcM,GAAgBH,CAAM,EAC1D,CAAE,aAAAI,CAAa,EAAI,MAAMF,EAAc,EAE7CL,EAAcC,GAAQM,EAEtB,IAAMC,EAAe,CACjB,KAAM,UACN,IAAK,UACL,MAAO,SACX,EAEA,QAAQ,KACJ,6CAAsCD,EAAa,OAAO,OAAOA,EAAa,UAAU,MAAMJ,CAAM,GACpG,yIACA,+IACA,uHACA,eAAeK,EAAaL,CAAM,CAAC,wHACvC,CACJ,CAKA,YAAaG,GAAgBH,EAAuC,CAChE,IAAMM,EAAY,8CAA2BN,IAAW,OAAS,QAAQA,CAAM,OAAS,YAExF,GAAI,CAACL,EACD,OAAO,IAAI,SAAS,kBAAoBW,EAAY,IAAI,EAI5D,IAAMC,EAAS,MADE,MAAM,MAAMD,CAAS,GACR,KAAK,EAK7BE,EAAM,MAAM,IAAI,SAAS,0BAA0B,EAAE,EAM3D,OAAKA,EAAG,kBAIR,QAAQ,KAAK,8DAA8D,EACnE,SAAY,CAChB,IAAMC,EAAS,IAAID,EAAG,iBAAiBD,EAAQ,CAAE,WAAYD,CAAU,CAAC,EAExE,aAAMG,EAAO,KAAK,IAAM,CAAC,CAAC,EAC1B,MAAMA,EAAO,SAAS,EAEfA,EAAO,SAClB,GAXW,IAAI,SAAS,8CAAgD,KAAKF,CAAM,EAAI,IAAI,CAY/F,CAKQ,aAAc,CAAC,CAC3B,EC9HI,OAAO,OAAW,MACb,OAAO,eACR,OAAO,aAAe,CAAC,GAGvB,OAAO,UAAU,eAAe,KAAK,OAAO,aAAc,wBAAY,EACtE,QAAQ,KAAK,uFAAmE,EAEhF,OAAO,aAAa,wBAAY,EAAI",
|
|
6
6
|
"names": ["isNode", "DynamicLoader", "_DynamicLoader", "#core", "#importPromise", "target", "#importCore", "dynamicImport", "#createImporter", "LivelinkCore", "TARGET_COLOR", "moduleURL", "source", "vm", "module"]
|
|
7
7
|
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Internally the activity watcher uses two timeouts:
|
|
7
7
|
* - Inactivity warning: the time in seconds after which the {@link InactivityWarningEvent} event is dispatched.
|
|
8
|
-
* - Inactivity timeout: the time in seconds after which the {@link DisconnectedEvent} event is dispatched.
|
|
8
|
+
* - Inactivity timeout: the time in seconds after which the {@link Events.DisconnectedEvent} event is dispatched.
|
|
9
9
|
*
|
|
10
10
|
* Whenever an internal activity is detected like a message being sent to the gateway, the activity watcher is reset
|
|
11
11
|
* and a {@link ActivityDetectedEvent} event is dispatched.
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* The application should also listen to the {@link ActivityDetectedEvent} event and update the UI accordingly.
|
|
23
23
|
*
|
|
24
24
|
* Once the inactivity timeout is reached it automatically triggers the disconnection from the gateway, and a
|
|
25
|
-
* {@link DisconnectedEvent} is dispatched with `inactivity` as the reason.
|
|
25
|
+
* {@link Events.DisconnectedEvent} is dispatched with `inactivity` as the reason.
|
|
26
26
|
* In this case, there is no way to recover the connection. The application should let the user know that the connection
|
|
27
27
|
* has been lost.
|
|
28
28
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export * from "./
|
|
2
|
-
export * from "./
|
|
3
|
-
import { AssetLoadingStatusEvent, FrameReceivedEvent, ScriptEventTriggeredEvent } from "./
|
|
4
|
-
import { EntitiesUpdatedEvent, EntityVisibilityChangedEvent } from "./
|
|
1
|
+
export * from "./internal/GatewayEvents";
|
|
2
|
+
export * from "./internal/EditorEvents";
|
|
3
|
+
import { AssetLoadingStatusEvent, FrameReceivedEvent, ScriptEventTriggeredEvent } from "./internal/GatewayEvents";
|
|
4
|
+
import { EntitiesUpdatedEvent, EntityVisibilityChangedEvent } from "./internal/EditorEvents";
|
|
5
5
|
/**
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
@@ -40,11 +40,9 @@ export declare class LivelinkCore extends TypedEventTarget<CoreEvents> {
|
|
|
40
40
|
*
|
|
41
41
|
* @param params
|
|
42
42
|
* @param params.session - The session to connect to. MUST be joinable.
|
|
43
|
-
* @param params.editor_url - The URL of the editor.
|
|
44
43
|
*/
|
|
45
|
-
connect({ session
|
|
44
|
+
connect({ session }: {
|
|
46
45
|
session: SessionInterface;
|
|
47
|
-
editor_url: string;
|
|
48
46
|
}): Promise<void>;
|
|
49
47
|
/**
|
|
50
48
|
* Closes the connections to the 3dverse server.
|
|
@@ -2,6 +2,7 @@ export declare const FTL_HEADER_SIZE: 4;
|
|
|
2
2
|
export declare const FTL_VIEWER_CONTROL_ROP_HEADER_SIZE: 1;
|
|
3
3
|
export declare const FTL_CLIENT_ROP_HEADER_SIZE: 25;
|
|
4
4
|
export declare const FTL_EDITOR_ROP_HEADER_SIZE: 25;
|
|
5
|
+
export declare const FTL_CLIENT_EDITOR_MSG_SIZE: 24;
|
|
5
6
|
export declare const LITTLE_ENDIAN: true;
|
|
6
7
|
export declare const BIG_ENDIAN: false;
|
|
7
8
|
export declare const HEARTBEAT_PERIOD_IN_MS: 2000;
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|