@camera.ui/browser 0.1.15 → 0.1.16

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.d.ts CHANGED
@@ -771,6 +771,11 @@ export declare class NamespaceManager {
771
771
  }
772
772
  }
773
773
 
774
+ export declare interface NativeFullscreen {
775
+ enter: () => Promise<boolean>;
776
+ exit: () => Promise<void>;
777
+ }
778
+
774
779
  export { NatsStatus }
775
780
 
776
781
  declare interface NotificationManagerNamespaces {
@@ -1298,6 +1303,8 @@ export declare interface SensorRegistryRPC {
1298
1303
 
1299
1304
  export declare function setFullscreenRoot(el: HTMLElement | null): void;
1300
1305
 
1306
+ export declare function setNativeFullscreen(native: NativeFullscreen | null): void;
1307
+
1301
1308
  /* Excluded from this release type: SirenControlProperties */
1302
1309
 
1303
1310
  /* Excluded from this release type: SirenProperty */
@@ -1712,204 +1719,3 @@ declare module 'fastify' {
1712
1719
  uploadToDisk?: boolean;
1713
1720
  }
1714
1721
  }
1715
-
1716
- /**
1717
- * Copyright (c) 2017, Daniel Imms (MIT License).
1718
- * Copyright (c) 2018, Microsoft Corporation (MIT License).
1719
- */
1720
-
1721
- declare module '@scrypted/node-pty' {
1722
- /**
1723
- * Forks a process as a pseudoterminal.
1724
- * @param file The file to launch.
1725
- * @param args The file's arguments as argv (string[]) or in a pre-escaped CommandLine format
1726
- * (string). Note that the CommandLine option is only available on Windows and is expected to be
1727
- * escaped properly.
1728
- * @param options The options of the terminal.
1729
- * @see CommandLineToArgvW https://msdn.microsoft.com/en-us/library/windows/desktop/bb776391(v=vs.85).aspx
1730
- * @see Parsing C++ Comamnd-Line Arguments https://msdn.microsoft.com/en-us/library/17w5ykft.aspx
1731
- * @see GetCommandLine https://msdn.microsoft.com/en-us/library/windows/desktop/ms683156.aspx
1732
- */
1733
- export function spawn(file: string, args: string[] | string, options: IPtyForkOptions | IWindowsPtyForkOptions): IPty;
1734
-
1735
- export interface IBasePtyForkOptions {
1736
- /**
1737
- * Name of the terminal to be set in environment ($TERM variable).
1738
- */
1739
- name?: string;
1740
-
1741
- /**
1742
- * Number of intial cols of the pty.
1743
- */
1744
- cols?: number;
1745
-
1746
- /**
1747
- * Number of initial rows of the pty.
1748
- */
1749
- rows?: number;
1750
-
1751
- /**
1752
- * Working directory to be set for the child program.
1753
- */
1754
- cwd?: string;
1755
-
1756
- /**
1757
- * Environment to be set for the child program.
1758
- */
1759
- env?: Record<string, string | undefined>;
1760
-
1761
- /**
1762
- * String encoding of the underlying pty.
1763
- * If set, incoming data will be decoded to strings and outgoing strings to bytes applying this encoding.
1764
- * If unset, incoming data will be delivered as raw bytes (Buffer type).
1765
- * By default 'utf8' is assumed, to unset it explicitly set it to `null`.
1766
- */
1767
- encoding?: string | null;
1768
-
1769
- /**
1770
- * (EXPERIMENTAL)
1771
- * Whether to enable flow control handling (false by default). If enabled a message of `flowControlPause`
1772
- * will pause the socket and thus blocking the child program execution due to buffer back pressure.
1773
- * A message of `flowControlResume` will resume the socket into flow mode.
1774
- * For performance reasons only a single message as a whole will match (no message part matching).
1775
- * If flow control is enabled the `flowControlPause` and `flowControlResume` messages are not forwarded to
1776
- * the underlying pseudoterminal.
1777
- */
1778
- handleFlowControl?: boolean;
1779
-
1780
- /**
1781
- * (EXPERIMENTAL)
1782
- * The string that should pause the pty when `handleFlowControl` is true. Default is XOFF ('\x13').
1783
- */
1784
- flowControlPause?: string;
1785
-
1786
- /**
1787
- * (EXPERIMENTAL)
1788
- * The string that should resume the pty when `handleFlowControl` is true. Default is XON ('\x11').
1789
- */
1790
- flowControlResume?: string;
1791
- }
1792
-
1793
- export interface IPtyForkOptions extends IBasePtyForkOptions {
1794
- /**
1795
- * Security warning: use this option with great caution,
1796
- * as opened file descriptors with higher privileges might leak to the child program.
1797
- */
1798
- uid?: number;
1799
- gid?: number;
1800
- }
1801
-
1802
- export interface IWindowsPtyForkOptions extends IBasePtyForkOptions {
1803
- /**
1804
- * Whether to use the ConPTY system on Windows. When this is not set, ConPTY will be used when
1805
- * the Windows build number is >= 18309 (instead of winpty). Note that ConPTY is available from
1806
- * build 17134 but is too unstable to enable by default.
1807
- *
1808
- * This setting does nothing on non-Windows.
1809
- */
1810
- useConpty?: boolean;
1811
-
1812
- /**
1813
- * Whether to use PSEUDOCONSOLE_INHERIT_CURSOR in conpty.
1814
- * @see https://docs.microsoft.com/en-us/windows/console/createpseudoconsole
1815
- */
1816
- conptyInheritCursor?: boolean;
1817
- }
1818
-
1819
- /**
1820
- * An interface representing a pseudoterminal, on Windows this is emulated via the winpty library.
1821
- */
1822
- export interface IPty {
1823
- /**
1824
- * The process ID of the outer process.
1825
- */
1826
- readonly pid: number;
1827
-
1828
- /**
1829
- * The column size in characters.
1830
- */
1831
- readonly cols: number;
1832
-
1833
- /**
1834
- * The row size in characters.
1835
- */
1836
- readonly rows: number;
1837
-
1838
- /**
1839
- * The title of the active process.
1840
- */
1841
- readonly process: string;
1842
-
1843
- /**
1844
- * (EXPERIMENTAL)
1845
- * Whether to handle flow control. Useful to disable/re-enable flow control during runtime.
1846
- * Use this for binary data that is likely to contain the `flowControlPause` string by accident.
1847
- */
1848
- handleFlowControl: boolean;
1849
-
1850
- /**
1851
- * Adds an event listener for when a data event fires. This happens when data is returned from
1852
- * the pty.
1853
- * @returns an `IDisposable` to stop listening.
1854
- */
1855
- readonly onData: IEvent<string>;
1856
-
1857
- /**
1858
- * Adds an event listener for when an exit event fires. This happens when the pty exits.
1859
- * @returns an `IDisposable` to stop listening.
1860
- */
1861
- readonly onExit: IEvent<{ exitCode: number; signal?: number }>;
1862
-
1863
- /**
1864
- * Resizes the dimensions of the pty.
1865
- * @param columns The number of columns to use.
1866
- * @param rows The number of rows to use.
1867
- */
1868
- resize(columns: number, rows: number): void;
1869
-
1870
- /**
1871
- * Clears the pty's internal representation of its buffer. This is a no-op
1872
- * unless on Windows/ConPTY. This is useful if the buffer is cleared on the
1873
- * frontend in order to synchronize state with the backend to avoid ConPTY
1874
- * possibly reprinting the screen.
1875
- */
1876
- clear(): void;
1877
-
1878
- /**
1879
- * Writes data to the pty.
1880
- * @param data The data to write.
1881
- */
1882
- write(data: string): void;
1883
-
1884
- /**
1885
- * Kills the pty.
1886
- * @param signal The signal to use, defaults to SIGHUP. This parameter is not supported on
1887
- * Windows.
1888
- * @throws Will throw when signal is used on Windows.
1889
- */
1890
- kill(signal?: string): void;
1891
-
1892
- /**
1893
- * Pauses the pty for customizable flow control.
1894
- */
1895
- pause(): void;
1896
-
1897
- /**
1898
- * Resumes the pty for customizable flow control.
1899
- */
1900
- resume(): void;
1901
- }
1902
-
1903
- /**
1904
- * An object that can be disposed via a dispose function.
1905
- */
1906
- export interface IDisposable {
1907
- dispose(): void;
1908
- }
1909
-
1910
- /**
1911
- * An event that can be listened to.
1912
- * @returns an `IDisposable` to stop listening.
1913
- */
1914
- export type IEvent<T> = (listener: (e: T) => any) => IDisposable;
1915
- }
package/dist/index.js CHANGED
@@ -6161,16 +6161,46 @@ function restartConnectedStreams() {
6161
6161
  return streamManager.restartConnected();
6162
6162
  }
6163
6163
  // src/composables/useFullscreen.ts
6164
+ var documentFullscreen = {
6165
+ async enter() {
6166
+ if (!document.fullscreenEnabled || document.fullscreenElement) return false;
6167
+ await document.documentElement.requestFullscreen({ navigationUI: "hide" });
6168
+ return true;
6169
+ },
6170
+ async exit() {
6171
+ if (document.fullscreenElement) await document.exitFullscreen();
6172
+ }
6173
+ };
6164
6174
  var fsRegistry = /* @__PURE__ */ new WeakMap();
6165
6175
  var fullscreenRoot = null;
6176
+ var nativeFullscreen = documentFullscreen;
6177
+ var nativeOwned = false;
6166
6178
  function setFullscreenRoot(el) {
6167
6179
  fullscreenRoot = el;
6168
6180
  }
6181
+ function setNativeFullscreen(native) {
6182
+ nativeFullscreen = native;
6183
+ }
6169
6184
  var fullscreenStack = [];
6170
6185
  var topmostFullscreenWrapper = shallowRef(null);
6171
6186
  function refreshTopmost() {
6172
6187
  topmostFullscreenWrapper.value = fullscreenStack[fullscreenStack.length - 1] ?? null;
6173
6188
  }
6189
+ function enterNative() {
6190
+ if (!nativeFullscreen || nativeOwned) return;
6191
+ nativeOwned = true;
6192
+ nativeFullscreen.enter().then((taken) => {
6193
+ nativeOwned = taken;
6194
+ exitNative();
6195
+ }, () => {
6196
+ nativeOwned = false;
6197
+ });
6198
+ }
6199
+ function exitNative() {
6200
+ if (!nativeOwned || fullscreenStack.length > 0) return;
6201
+ nativeOwned = false;
6202
+ nativeFullscreen?.exit();
6203
+ }
6174
6204
  function useTopmostFullscreenElement() {
6175
6205
  return computed(() => topmostFullscreenWrapper.value);
6176
6206
  }
@@ -6184,9 +6214,13 @@ function useCuiFullscreen(target, options = {}) {
6184
6214
  function onEscape(e) {
6185
6215
  if (e.key === "Escape" && isFullscreen.value) exit();
6186
6216
  }
6217
+ function onNativeChange() {
6218
+ if (nativeOwned && nativeFullscreen === documentFullscreen && !document.fullscreenElement) exit();
6219
+ }
6187
6220
  async function enter() {
6188
6221
  const el = currentEl.value;
6189
6222
  if (!el || isFullscreen.value) return;
6223
+ enterNative();
6190
6224
  const wrapper = document.createElement("div");
6191
6225
  wrapper.className = `cui-fullscreen cui-fullscreen-${mode}`;
6192
6226
  applyWrapperStyles(wrapper, mode);
@@ -6211,6 +6245,7 @@ function useCuiFullscreen(target, options = {}) {
6211
6245
  behavior: "instant"
6212
6246
  });
6213
6247
  document.addEventListener("keydown", onEscape);
6248
+ document.addEventListener("fullscreenchange", onNativeChange);
6214
6249
  fullscreenStack.push(wrapper);
6215
6250
  refreshTopmost();
6216
6251
  isFullscreen.value = true;
@@ -6232,9 +6267,11 @@ function useCuiFullscreen(target, options = {}) {
6232
6267
  behavior: "instant"
6233
6268
  });
6234
6269
  document.removeEventListener("keydown", onEscape);
6270
+ document.removeEventListener("fullscreenchange", onNativeChange);
6235
6271
  const stackIndex = fullscreenStack.indexOf(state.wrapper);
6236
6272
  if (stackIndex !== -1) fullscreenStack.splice(stackIndex, 1);
6237
6273
  refreshTopmost();
6274
+ exitNative();
6238
6275
  isFullscreen.value = false;
6239
6276
  }
6240
6277
  async function toggle() {
@@ -6244,6 +6281,7 @@ function useCuiFullscreen(target, options = {}) {
6244
6281
  tryOnScopeDispose(() => {
6245
6282
  if (isFullscreen.value && currentEl.value) exit();
6246
6283
  document.removeEventListener("keydown", onEscape);
6284
+ document.removeEventListener("fullscreenchange", onNativeChange);
6247
6285
  });
6248
6286
  return {
6249
6287
  isFullscreen: computed(() => isFullscreen.value),
@@ -7180,4 +7218,4 @@ function useTerminalSessions() {
7180
7218
  function terminalProxy(r) {
7181
7219
  return r.createProxy(NamespaceManager.terminalManagerNamespaces().terminalManagerRpc);
7182
7220
  }
7183
- export { CAMERA_UI_INJECTION_KEY, NamespaceManager, STREAM_CONFIG, acquireSensorManager, clearCameraCache, clearOAuthCache, clearPluginCache, clearSensorCache, clearSnapshotCache, clearStorageCache, createActivityMode, createCameraUiPlugin, createReactiveCameraDevice, createSensorManager, getSnapshotUrl, isReactiveAudioSensor, isReactiveBatteryInfo, isReactiveCarbonDioxideInfo, isReactiveCarbonMonoxideSensor, isReactiveClassifierSensor, isReactiveColdSensor, isReactiveContactSensor, isReactiveDoorbellTrigger, isReactiveFaceSensor, isReactiveGarageControl, isReactiveGasSensor, isReactiveHeatSensor, isReactiveHumidityInfo, isReactiveIlluminanceInfo, isReactiveLeakSensor, isReactiveLicensePlateSensor, isReactiveLightControl, isReactiveLockControl, isReactiveMotionSensor, isReactiveObjectSensor, isReactiveOccupancySensor, isReactivePTZControl, isReactivePowerSensor, isReactiveProblemSensor, isReactiveSecuritySystem, isReactiveSirenControl, isReactiveSmokeSensor, isReactiveSwitchControl, isReactiveTamperSensor, isReactiveTemperatureInfo, isReactiveVibrationSensor, refreshClientSubscriptions, releaseSensorManager, resetClientState, restartConnectedStreams, rpcCall, setFullscreenRoot, useAllSensors, useAudioSensor, useCameraById, useCameraStorage, useCameraStream, useCameraUi, useClassifierSensors, useCoreManager, useCuiFullscreen, useDeviceManager, useFaceSensor, useLicensePlateSensor, useMotionSensor, useOAuth, useObjectSensor, usePTZControl, usePlugin, usePluginStorage, useRpcCall, useRpcSubscription, useSensorById, useSensorByType, useSensorStorage, useSensors, useSensorsByType, useSnapshot, useTabVisibility, useTerminal, useTerminalSessions, useTopmostFullscreenElement };
7221
+ export { CAMERA_UI_INJECTION_KEY, NamespaceManager, STREAM_CONFIG, acquireSensorManager, clearCameraCache, clearOAuthCache, clearPluginCache, clearSensorCache, clearSnapshotCache, clearStorageCache, createActivityMode, createCameraUiPlugin, createReactiveCameraDevice, createSensorManager, getSnapshotUrl, isReactiveAudioSensor, isReactiveBatteryInfo, isReactiveCarbonDioxideInfo, isReactiveCarbonMonoxideSensor, isReactiveClassifierSensor, isReactiveColdSensor, isReactiveContactSensor, isReactiveDoorbellTrigger, isReactiveFaceSensor, isReactiveGarageControl, isReactiveGasSensor, isReactiveHeatSensor, isReactiveHumidityInfo, isReactiveIlluminanceInfo, isReactiveLeakSensor, isReactiveLicensePlateSensor, isReactiveLightControl, isReactiveLockControl, isReactiveMotionSensor, isReactiveObjectSensor, isReactiveOccupancySensor, isReactivePTZControl, isReactivePowerSensor, isReactiveProblemSensor, isReactiveSecuritySystem, isReactiveSirenControl, isReactiveSmokeSensor, isReactiveSwitchControl, isReactiveTamperSensor, isReactiveTemperatureInfo, isReactiveVibrationSensor, refreshClientSubscriptions, releaseSensorManager, resetClientState, restartConnectedStreams, rpcCall, setFullscreenRoot, setNativeFullscreen, useAllSensors, useAudioSensor, useCameraById, useCameraStorage, useCameraStream, useCameraUi, useClassifierSensors, useCoreManager, useCuiFullscreen, useDeviceManager, useFaceSensor, useLicensePlateSensor, useMotionSensor, useOAuth, useObjectSensor, usePTZControl, usePlugin, usePluginStorage, useRpcCall, useRpcSubscription, useSensorById, useSensorByType, useSensorStorage, useSensors, useSensorsByType, useSnapshot, useTabVisibility, useTerminal, useTerminalSessions, useTopmostFullscreenElement };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camera.ui/browser",
3
- "version": "0.1.15",
3
+ "version": "0.1.16",
4
4
  "description": "camera.ui browser client",
5
5
  "author": "seydx (https://github.com/cameraui/clients)",
6
6
  "type": "module",
@@ -39,14 +39,14 @@
39
39
  "devDependencies": {
40
40
  "@camera.ui/logger": "file:../../packages/logger",
41
41
  "@camera.ui/rpc": "^1.1.2",
42
- "@camera.ui/sdk": "~1.4.8",
42
+ "@camera.ui/sdk": "~1.4.9",
43
43
  "@camera.ui/transport": "file:../../packages/transport",
44
44
  "@eneris/push-receiver": "^4.4.0",
45
45
  "@microsoft/api-extractor": "^7.60.1",
46
46
  "@stylistic/eslint-plugin": "^5.10.0",
47
47
  "@types/webrtc": "^0.0.47",
48
48
  "@typescript-eslint/parser": "^8.72.2",
49
- "@vitejs/plugin-vue": "^6.0.10",
49
+ "@vitejs/plugin-vue": "^6.0.11",
50
50
  "@vue/eslint-config-prettier": "^10.2.0",
51
51
  "@vue/eslint-config-typescript": "^14.9.0",
52
52
  "@vue/language-core": "^3.3.14",
@@ -56,13 +56,13 @@
56
56
  "eslint": "9.39.2",
57
57
  "eslint-plugin-vue": "^10.12.1",
58
58
  "globals": "^17.14.0",
59
- "prettier": "^3.9.10",
59
+ "prettier": "^3.10.1",
60
60
  "rimraf": "^6.1.4",
61
61
  "typescript": "5.9.3",
62
62
  "typescript-eslint": "^8.72.2",
63
63
  "unplugin-dts": "^1.1.2",
64
64
  "updates": "^20.0.1",
65
- "vite": "^8.3.7",
65
+ "vite": "^8.3.8",
66
66
  "vitest": "^5.1.0",
67
67
  "vue": "^3.5.45",
68
68
  "vue-tsc": "3.3.11"