@snap/camera-kit 0.14.0 → 0.14.1
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 +1 -1
- package/docs/html/classes/CameraKit.html +3 -3
- package/docs/html/classes/CameraKitSession.html +3 -3
- package/docs/html/classes/CameraKitSource.html +3 -3
- package/docs/html/classes/LensPerformanceMeasurement.html +3 -3
- package/docs/html/classes/LensPerformanceMetrics.html +3 -3
- package/docs/html/classes/LensRepository.html +3 -3
- package/docs/html/classes/LensSources.html +3 -3
- package/docs/html/classes/Transform2D.html +3 -3
- package/docs/html/classes/TypedCustomEvent.html +3 -3
- package/docs/html/classes/TypedEventTarget.html +3 -3
- package/docs/html/functions/Injectable.html +3 -3
- package/docs/html/functions/bootstrapCameraKit.html +3 -3
- package/docs/html/functions/createExtension.html +3 -3
- package/docs/html/functions/createImageSource.html +3 -3
- package/docs/html/functions/createMediaStreamSource.html +3 -3
- package/docs/html/functions/createUserMediaSource.html +3 -3
- package/docs/html/functions/createVideoSource.html +3 -3
- package/docs/html/functions/estimateLensPerformance.html +3 -3
- package/docs/html/functions/getRequiredBootstrapURLs.html +3 -3
- package/docs/html/functions/lensSourcesFactory.html +3 -3
- package/docs/html/functions/remoteApiServicesFactory.html +3 -3
- package/docs/html/index.html +5 -5
- package/docs/html/interfaces/CameraKitBootstrapConfiguration.html +3 -3
- package/docs/html/interfaces/CameraKitSourceSubscriber.html +3 -3
- package/docs/html/interfaces/ComputedFrameMetrics.html +3 -3
- package/docs/html/interfaces/CreateSessionOptions.html +3 -3
- package/docs/html/interfaces/EstimatedLensPerformance.html +3 -3
- package/docs/html/interfaces/Lens.html +3 -3
- package/docs/html/interfaces/LensSource.html +3 -3
- package/docs/html/interfaces/MediaStreamSourceOptions.html +3 -3
- package/docs/html/interfaces/Preview.html +3 -3
- package/docs/html/interfaces/RemoteApiRequest.html +3 -3
- package/docs/html/interfaces/RemoteApiResponse.html +3 -3
- package/docs/html/interfaces/RemoteApiService.html +3 -3
- package/docs/html/interfaces/Snapcode.html +3 -3
- package/docs/html/interfaces/UriCancelRequest.html +3 -3
- package/docs/html/interfaces/UriRequest.html +3 -3
- package/docs/html/interfaces/UriResponse.html +3 -3
- package/docs/html/interfaces/VideoSourceOptions.html +3 -3
- package/docs/html/modules.html +4 -4
- package/docs/html/types/AssetLoader.html +3 -3
- package/docs/html/types/AssetTiming.html +3 -3
- package/docs/html/types/BenchmarkError.html +3 -3
- package/docs/html/types/BootstrapError.html +3 -3
- package/docs/html/types/CacheKeyNotFoundError.html +3 -3
- package/docs/html/types/CameraKitDeviceInfo.html +3 -3
- package/docs/html/types/CameraKitDeviceOptions.html +3 -3
- package/docs/html/types/CameraKitSessionEventListener.html +3 -3
- package/docs/html/types/CameraKitSessionEvents.html +3 -3
- package/docs/html/types/CameraKitSourceError.html +3 -3
- package/docs/html/types/CameraKitSourceInfo.html +3 -3
- package/docs/html/types/CameraKitSourceOptions.html +3 -3
- package/docs/html/types/ConfigurationError.html +3 -3
- package/docs/html/types/Keyboard.html +3 -3
- package/docs/html/types/KeyboardEvents.html +3 -3
- package/docs/html/types/LegalError.html +3 -3
- package/docs/html/types/LensAbortError.html +3 -3
- package/docs/html/types/LensAssetError.html +3 -3
- package/docs/html/types/LensContentValidationError.html +3 -3
- package/docs/html/types/LensError.html +3 -3
- package/docs/html/types/LensExecutionError.html +3 -3
- package/docs/html/types/LensImagePickerError.html +3 -3
- package/docs/html/types/LensLaunchParams.html +3 -3
- package/docs/html/types/LensMetricsEvents.html +3 -3
- package/docs/html/types/LensPerformanceCluster.html +3 -3
- package/docs/html/types/LensView.html +3 -3
- package/docs/html/types/LensWait.html +3 -3
- package/docs/html/types/PersistentStoreError.html +3 -3
- package/docs/html/types/PlatformNotSupportedError.html +3 -3
- package/docs/html/types/PublicContainer.html +3 -3
- package/docs/html/types/RemoteApiRequestHandler.html +3 -3
- package/docs/html/types/RemoteApiServices.html +3 -3
- package/docs/html/types/RemoteApiStatus.html +3 -3
- package/docs/html/types/RenderTarget.html +3 -3
- package/docs/html/types/Uri.html +3 -3
- package/docs/html/types/WebGLError.html +3 -3
- package/docs/html/variables/extensionRequestContext.html +3 -3
- package/docs/md/README.md +1 -1
- package/docs/md/classes/CameraKit.md +1 -1
- package/docs/md/classes/CameraKitSession.md +1 -1
- package/docs/md/classes/CameraKitSource.md +1 -1
- package/docs/md/classes/LensPerformanceMeasurement.md +1 -1
- package/docs/md/classes/LensPerformanceMetrics.md +1 -1
- package/docs/md/classes/LensRepository.md +1 -1
- package/docs/md/classes/LensSources.md +1 -1
- package/docs/md/classes/Transform2D.md +1 -1
- package/docs/md/classes/TypedCustomEvent.md +1 -1
- package/docs/md/classes/TypedEventTarget.md +1 -1
- package/docs/md/interfaces/CameraKitBootstrapConfiguration.md +1 -1
- package/docs/md/interfaces/CameraKitSourceSubscriber.md +1 -1
- package/docs/md/interfaces/ComputedFrameMetrics.md +1 -1
- package/docs/md/interfaces/CreateSessionOptions.md +1 -1
- package/docs/md/interfaces/EstimatedLensPerformance.md +1 -1
- package/docs/md/interfaces/Lens.md +1 -1
- package/docs/md/interfaces/LensSource.md +1 -1
- package/docs/md/interfaces/MediaStreamSourceOptions.md +1 -1
- package/docs/md/interfaces/Preview.md +1 -1
- package/docs/md/interfaces/RemoteApiRequest.md +1 -1
- package/docs/md/interfaces/RemoteApiResponse.md +1 -1
- package/docs/md/interfaces/RemoteApiService.md +1 -1
- package/docs/md/interfaces/Snapcode.md +1 -1
- package/docs/md/interfaces/UriCancelRequest.md +1 -1
- package/docs/md/interfaces/UriRequest.md +1 -1
- package/docs/md/interfaces/UriResponse.md +1 -1
- package/docs/md/interfaces/VideoSourceOptions.md +1 -1
- package/docs/md/modules.md +2 -2
- package/lib/environment.json +1 -1
- package/lib/platform/platformCapabilities.js +2 -1
- package/lib/platform/platformCapabilities.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platformCapabilities.js","sourceRoot":"","sources":["../../src/platform/platformCapabilities.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAejD,+DAA+D;AAC/D,uHAAuH;AACvH,oHAAoH;AACpH,qEAAqE;AACrE,MAAM,yBAAyB,GAAG,IAAI,CAAC;AAEvC;;;;GAIG;AACH,SAAS,eAAe
|
|
1
|
+
{"version":3,"file":"platformCapabilities.js","sourceRoot":"","sources":["../../src/platform/platformCapabilities.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAejD,+DAA+D;AAC/D,uHAAuH;AACvH,oHAAoH;AACpH,qEAAqE;AACrE,MAAM,yBAAyB,GAAG,IAAI,CAAC;AAEvC;;;;GAIG;AACH,SAAS,eAAe;;IACpB,MAAM,GAAG,GAAG,MAAA,UAAU,CAAC,QAAQ,0CAAE,aAAa,CAAC,QAAQ,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC9E,IAAI,CAAC,GAAG;QACJ,OAAO;YACH,SAAS,EAAE,KAAK;YAChB,KAAK,EAAE,yBAAyB,CAAC,sEAAsE,CAAC;SAC3G,CAAC;IACN,MAAM,cAAc,GAAG,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAC9D,MAAM,SAAS,GAAG,cAAc,IAAI,yBAAyB,CAAC;IAC9D,OAAO,SAAS;QACZ,CAAC,CA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CAAC;CAAA;AAQD;;;;;GAKG;AACH,SAAe,oBAAoB;;QAC/B,MAAM,YAAY,GAAoB;YAClC,SAAS,EAAE,KAAK;YAChB,KAAK,EAAE,yBAAyB,CAC5B,4EAA4E;gBACxE,sDAAsD,CAC7D;SACJ,CAAC;QACF,IAAI,CAAC,eAAe;YAAE,OAAO,YAAY,CAAC;QAC1C,IAAI,CAAC,SAAS,CAAC,EAAE;YAAE,OAAO,YAAY,CAAC;QACvC,MAAM,sBAAsB,GAAG,MAAM,SAAS,CAAC,EAAE,CAAC,kBAAkB,CAAC,cAAc,CAAC,CAAC;QACrF,OAAO,sBAAsB;YACzB,CAAC,CAAC;gBACI,SAAS,EAAE,IAAI;gBACf,eAAe,EAAE,IAAI;gBACrB,mBAAmB,EAAE,IAAI;aAC5B;YACH,CAAC,CAAC,YAAY,CAAC;IACvB,CAAC;CAAA;AASD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,OAAO,CAAC,SAAe,uBAAuB;;QACjF,OAAO;YACH,KAAK,EAAE,eAAe,EAAE;YACxB,IAAI,EAAE,MAAM,0BAA0B,EAAE;YACxC,KAAK,EAAE,MAAM,oBAAoB,EAAE;SACtC,CAAC;IACN,CAAC;CAAA,CAAC,CAAC","sourcesContent":["import { exceptions, simd } from \"wasm-feature-detect\";\nimport { memoize } from \"../common/memoize\";\nimport { XrCapabilities } from \"../lens-core-module\";\nimport { platformNotSupportedError } from \"../namedErrors\";\nimport { getPlatformInfo } from \"./platformInfo\";\n\n/** @internal */\nexport type SupportedCapability<T> = T & { supported: true };\n/** @internal */\nexport type UnsupportedCapability = { supported: false; error: Error };\n/** @internal */\nexport type Capability<T = void> = SupportedCapability<T> | UnsupportedCapability;\n\n//-----------\n// WebGL\n//-----------\n\ntype WebGlCapability = Capability<{ maxTextureSize: number }>;\n\n// This required minimum max texture size is based on data from\n// https://web3dsurvey.com/webgl/parameters/MAX_TEXTURE_SIZE. Checking for a reasonable minimum MAX_TEXTURE_SIZE avoids\n// attempting to run lenses on platforms that will not support them -- most commonly, we've seen some platforms that\n// report 0 MAX_TEXTURE_SIZE, which will cause errors for all lenses.\nconst minRequiredMaxTextureSize = 1024;\n\n/**\n * @returns An object with fields describing support for various WebGL features.\n *\n * @internal\n */\nfunction getWebGlSupport(): WebGlCapability {\n const ctx = globalThis.document?.createElement(\"canvas\").getContext(\"webgl2\");\n if (!ctx)\n return {\n supported: false,\n error: platformNotSupportedError(\"CameraKit requires WebGL2, but this browser does not support WebGL2.\"),\n };\n const maxTextureSize = ctx.getParameter(ctx.MAX_TEXTURE_SIZE);\n const supported = maxTextureSize >= minRequiredMaxTextureSize;\n return supported\n ? { supported, maxTextureSize }\n : {\n supported,\n error: platformNotSupportedError(\n `CameraKit requires WebGL's MAX_TEXTURE_SIZE exceed a minimum value of ` +\n `${minRequiredMaxTextureSize}, but the browser's reported MAX_TEXTURE_SIZE is ${maxTextureSize}.`\n ),\n };\n}\n\n//-----------\n// WASM\n//-----------\n\ntype WasmCapability = Capability<{ wasmFeatures: number }>;\n\n/**\n * Because there may be a large number of WASM-related capabilities, and because these may correspond to various builds\n * of LensCore, we encode the various WASM capabilities into a single number by bitwise OR-ing together the numbers\n * corresponding to each capability.\n *\n * Since each combindation of capabilities is represented by a single number, we can easily map between that number and\n * the corresponding LensCore build name that makes use of those capabilities.\n *\n * @internal\n */\nexport enum WasmFeatures {\n Default = 0b00000000,\n SIMD = 0b00000001,\n ExceptionHandling = 0b00000010,\n}\n\n/**\n * @returns A non-negative integer representing the combination of supported WebAssembly features, or -1 if WebAssembly\n * is not supported at all.\n *\n * @internal\n */\nasync function getWebAssemblyCapabilities(): Promise<WasmCapability> {\n if (globalThis.WebAssembly === undefined)\n return {\n supported: false,\n error: platformNotSupportedError(\n \"CameraKit requires WebAssembly, but this browser does not support WebAssembly.\"\n ),\n };\n return {\n supported: true,\n wasmFeatures: (\n await Promise.all([\n simd().then((supported) => {\n // Although Safari 16.4 reports SIMD support, LensCore encounters rendering bugs when using\n // SIMD in Safari 16.4. We will disable SIMD for now until Safari stabilizes the feature.\n if (getPlatformInfo().browser.brand === \"Safari\") return WasmFeatures.Default;\n return supported ? WasmFeatures.SIMD : WasmFeatures.Default;\n }),\n exceptions().then((supported) => (supported ? WasmFeatures.ExceptionHandling : WasmFeatures.Default)),\n ])\n ).reduce((features, feature) => features | feature, WasmFeatures.Default),\n };\n}\n\n//-----------\n// WebXR\n//-----------\n\ntype WebXrCapability = Capability<XrCapabilities>;\n\n/**\n * @returns A Promise containing an object with fields describing the support of various WebXR features. This object's\n * type is defined by LensCore, as they consume these capabilities and adjust behavior accordingly.\n *\n * @internal\n */\nasync function getWebXrCapabilities(): Promise<WebXrCapability> {\n const notSupported: WebXrCapability = {\n supported: false,\n error: platformNotSupportedError(\n `Use of this feature requires WebXR support for immersive AR sessions, but ` +\n `this browser does not support immersive AR sessions.`\n ),\n };\n if (!isSecureContext) return notSupported;\n if (!navigator.xr) return notSupported;\n const isImmersiveArSupported = await navigator.xr.isSessionSupported(\"immersive-ar\");\n return isImmersiveArSupported\n ? {\n supported: true,\n sixDofSupported: true,\n sceneDepthSupported: true,\n }\n : notSupported;\n}\n\n/** @internal */\nexport interface PlatformCapabilities {\n webgl: WebGlCapability;\n wasm: WasmCapability;\n webxr: WebXrCapability;\n}\n\n/**\n * Get information about the current platform capabilities, including:\n * - WebGL support and various WebGL parameters.\n * - WASM support and support for various WASM features.\n * - WebXR support and support for various WebXR features.\n *\n * @internal\n */\nexport const getPlatformCapabilities = memoize(async function getPlatformCapabilities(): Promise<PlatformCapabilities> {\n return {\n webgl: getWebGlSupport(),\n wasm: await getWebAssemblyCapabilities(),\n webxr: await getWebXrCapabilities(),\n };\n});\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@snap/camera-kit",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.1",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
5
5
|
"description": "Camera Kit Web",
|
|
6
6
|
"homepage": "https://ar.snap.com/camera-kit",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@improbable-eng/grpc-web": "^0.15.0",
|
|
52
|
-
"@snap/state-management": "
|
|
52
|
+
"@snap/state-management": "0.14.1",
|
|
53
53
|
"browser-fs-access": "^0.31.1",
|
|
54
54
|
"browser-headers": "^0.4.1",
|
|
55
55
|
"long": "^4.0.0",
|