@onlive.ai/common-121 0.2.32

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.
Files changed (111) hide show
  1. package/README.md +151 -0
  2. package/package.json +39 -0
  3. package/services/audio.service.cjs +75 -0
  4. package/services/audio.service.d.cts +14 -0
  5. package/services/audio.service.d.ts +14 -0
  6. package/services/audio.service.js +52 -0
  7. package/services/firebase/firebase-api.cjs +108 -0
  8. package/services/firebase/firebase-api.d.cts +54 -0
  9. package/services/firebase/firebase-api.d.ts +54 -0
  10. package/services/firebase/firebase-api.js +105 -0
  11. package/services/firebase/firebase.service.cjs +193 -0
  12. package/services/firebase/firebase.service.d.cts +40 -0
  13. package/services/firebase/firebase.service.d.ts +40 -0
  14. package/services/firebase/firebase.service.js +190 -0
  15. package/services/livekit.service.cjs +353 -0
  16. package/services/livekit.service.d.cts +131 -0
  17. package/services/livekit.service.d.ts +131 -0
  18. package/services/livekit.service.js +329 -0
  19. package/services/request.provider.cjs +48 -0
  20. package/services/request.provider.d.cts +27 -0
  21. package/services/request.provider.d.ts +27 -0
  22. package/services/request.provider.js +22 -0
  23. package/themes/dark.cjs +433 -0
  24. package/themes/dark.d.cts +5 -0
  25. package/themes/dark.d.ts +5 -0
  26. package/themes/dark.js +408 -0
  27. package/themes/light.cjs +433 -0
  28. package/themes/light.d.cts +5 -0
  29. package/themes/light.d.ts +5 -0
  30. package/themes/light.js +408 -0
  31. package/types/tracking-options.cjs +18 -0
  32. package/types/tracking-options.d.cts +27 -0
  33. package/types/tracking-options.d.ts +27 -0
  34. package/types/tracking-options.js +0 -0
  35. package/types/window-context.cjs +18 -0
  36. package/types/window-context.d.cts +8 -0
  37. package/types/window-context.d.ts +8 -0
  38. package/types/window-context.js +0 -0
  39. package/utils/adopt-styles.cjs +66 -0
  40. package/utils/adopt-styles.d.cts +5 -0
  41. package/utils/adopt-styles.d.ts +5 -0
  42. package/utils/adopt-styles.js +41 -0
  43. package/utils/browser-preferences.cjs +67 -0
  44. package/utils/browser-preferences.d.cts +18 -0
  45. package/utils/browser-preferences.d.ts +18 -0
  46. package/utils/browser-preferences.js +42 -0
  47. package/utils/classify-media.cjs +38 -0
  48. package/utils/classify-media.d.cts +9 -0
  49. package/utils/classify-media.d.ts +9 -0
  50. package/utils/classify-media.js +13 -0
  51. package/utils/decorators.cjs +53 -0
  52. package/utils/decorators.d.cts +34 -0
  53. package/utils/decorators.d.ts +34 -0
  54. package/utils/decorators.js +28 -0
  55. package/utils/detected-lang.cjs +47 -0
  56. package/utils/detected-lang.d.cts +10 -0
  57. package/utils/detected-lang.d.ts +10 -0
  58. package/utils/detected-lang.js +22 -0
  59. package/utils/fullscreen.cjs +52 -0
  60. package/utils/fullscreen.d.cts +16 -0
  61. package/utils/fullscreen.d.ts +16 -0
  62. package/utils/fullscreen.js +26 -0
  63. package/utils/insert-script.cjs +55 -0
  64. package/utils/insert-script.d.cts +29 -0
  65. package/utils/insert-script.d.ts +29 -0
  66. package/utils/insert-script.js +30 -0
  67. package/utils/markdown.cjs +103 -0
  68. package/utils/markdown.d.cts +12 -0
  69. package/utils/markdown.d.ts +12 -0
  70. package/utils/markdown.js +68 -0
  71. package/utils/merge.cjs +47 -0
  72. package/utils/merge.d.cts +23 -0
  73. package/utils/merge.d.ts +23 -0
  74. package/utils/merge.js +22 -0
  75. package/utils/multiband-track-volume.cjs +90 -0
  76. package/utils/multiband-track-volume.d.cts +27 -0
  77. package/utils/multiband-track-volume.d.ts +27 -0
  78. package/utils/multiband-track-volume.js +65 -0
  79. package/utils/onlive-url-params.cjs +38 -0
  80. package/utils/onlive-url-params.d.cts +14 -0
  81. package/utils/onlive-url-params.d.ts +14 -0
  82. package/utils/onlive-url-params.js +13 -0
  83. package/utils/pretty-distance.cjs +45 -0
  84. package/utils/pretty-distance.d.cts +46 -0
  85. package/utils/pretty-distance.d.ts +46 -0
  86. package/utils/pretty-distance.js +20 -0
  87. package/utils/random-string.cjs +37 -0
  88. package/utils/random-string.d.cts +9 -0
  89. package/utils/random-string.d.ts +9 -0
  90. package/utils/random-string.js +12 -0
  91. package/utils/resource-type.cjs +50 -0
  92. package/utils/resource-type.d.cts +16 -0
  93. package/utils/resource-type.d.ts +16 -0
  94. package/utils/resource-type.js +24 -0
  95. package/utils/safe-html.cjs +112 -0
  96. package/utils/safe-html.d.cts +12 -0
  97. package/utils/safe-html.d.ts +12 -0
  98. package/utils/safe-html.js +77 -0
  99. package/utils/sanitize.cjs +94 -0
  100. package/utils/sanitize.d.cts +11 -0
  101. package/utils/sanitize.d.ts +11 -0
  102. package/utils/sanitize.js +59 -0
  103. package/utils/spread.cjs +70 -0
  104. package/utils/spread.d.cts +14 -0
  105. package/utils/spread.d.ts +14 -0
  106. package/utils/spread.js +47 -0
  107. package/utils/watch.cjs +54 -0
  108. package/utils/watch.d.cts +28 -0
  109. package/utils/watch.d.ts +28 -0
  110. package/utils/watch.js +29 -0
  111. package/vite-env.d.ts +22 -0
@@ -0,0 +1,59 @@
1
+ // utils/sanitize.ts
2
+ import DOMPurify from "dompurify";
3
+ var DEFAULT_PURIFY_CONFIG = {
4
+ ALLOWED_TAGS: [
5
+ // Text formatting
6
+ "p",
7
+ "br",
8
+ "span",
9
+ "b",
10
+ "strong",
11
+ "i",
12
+ "em",
13
+ "u",
14
+ "s",
15
+ "del",
16
+ // Lists
17
+ "ul",
18
+ "ol",
19
+ "li",
20
+ // Code
21
+ "code",
22
+ "pre",
23
+ // Links
24
+ "a",
25
+ // Headers (limited)
26
+ "h1",
27
+ "h2",
28
+ "h3",
29
+ "h4",
30
+ // Tables
31
+ "table",
32
+ "thead",
33
+ "tbody",
34
+ "tr",
35
+ "th",
36
+ "td"
37
+ ],
38
+ ALLOWED_ATTR: [
39
+ // Links
40
+ "href",
41
+ "target",
42
+ "rel",
43
+ // Accessibility
44
+ "title",
45
+ "aria-label",
46
+ "role",
47
+ // Tables
48
+ "colspan",
49
+ "rowspan"
50
+ ],
51
+ FORCE_HTTPS: true,
52
+ ALLOW_DATA_ATTR: false
53
+ };
54
+ var sanitize = (html, purifyConfig = DEFAULT_PURIFY_CONFIG) => {
55
+ return DOMPurify.sanitize(html, purifyConfig);
56
+ };
57
+ export {
58
+ sanitize
59
+ };
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
21
+
22
+ // utils/spread.ts
23
+ var spread_exports = {};
24
+ __export(spread_exports, {
25
+ spread: () => spread
26
+ });
27
+ module.exports = __toCommonJS(spread_exports);
28
+ var import_lit = require("lit");
29
+ var import_directive = require("lit/directive.js");
30
+ var spread = (0, import_directive.directive)(
31
+ class extends import_directive.Directive {
32
+ constructor() {
33
+ super(...arguments);
34
+ __publicField(this, "element");
35
+ __publicField(this, "previousAttributes", {});
36
+ }
37
+ render(attributeMap) {
38
+ return attributeMap;
39
+ }
40
+ update(part, [attributeMap]) {
41
+ if (!this.element) {
42
+ this.element = part.element;
43
+ this.previousAttributes = {};
44
+ }
45
+ for (const name in this.previousAttributes) {
46
+ if (!(name in attributeMap)) {
47
+ this.element.removeAttribute(name);
48
+ }
49
+ }
50
+ for (const name in attributeMap) {
51
+ const value = attributeMap[name];
52
+ if (value === null || value === void 0) {
53
+ this.element.removeAttribute(name);
54
+ } else if (value === true) {
55
+ this.element.setAttribute(name, "");
56
+ } else if (value !== false) {
57
+ this.element.setAttribute(name, String(value));
58
+ } else {
59
+ this.element.removeAttribute(name);
60
+ }
61
+ }
62
+ this.previousAttributes = { ...attributeMap };
63
+ return import_lit.nothing;
64
+ }
65
+ }
66
+ );
67
+ // Annotate the CommonJS export names for ESM import in node:
68
+ 0 && (module.exports = {
69
+ spread
70
+ });
@@ -0,0 +1,14 @@
1
+ import * as lit_directive_js from 'lit/directive.js';
2
+ import { AttributePart } from 'lit/directive.js';
3
+
4
+ declare const spread: (attributeMap: Record<string, unknown>) => lit_directive_js.DirectiveResult<{
5
+ new (_partInfo: lit_directive_js.PartInfo): {
6
+ element?: HTMLElement;
7
+ previousAttributes: Record<string, unknown>;
8
+ render(attributeMap: Record<string, unknown>): Record<string, unknown>;
9
+ update(part: AttributePart, [attributeMap]: [Record<string, unknown>]): symbol;
10
+ readonly _$isConnected: boolean;
11
+ };
12
+ }>;
13
+
14
+ export { spread };
@@ -0,0 +1,14 @@
1
+ import * as lit_directive_js from 'lit/directive.js';
2
+ import { AttributePart } from 'lit/directive.js';
3
+
4
+ declare const spread: (attributeMap: Record<string, unknown>) => lit_directive_js.DirectiveResult<{
5
+ new (_partInfo: lit_directive_js.PartInfo): {
6
+ element?: HTMLElement;
7
+ previousAttributes: Record<string, unknown>;
8
+ render(attributeMap: Record<string, unknown>): Record<string, unknown>;
9
+ update(part: AttributePart, [attributeMap]: [Record<string, unknown>]): symbol;
10
+ readonly _$isConnected: boolean;
11
+ };
12
+ }>;
13
+
14
+ export { spread };
@@ -0,0 +1,47 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
+
5
+ // utils/spread.ts
6
+ import { nothing } from "lit";
7
+ import { directive, Directive } from "lit/directive.js";
8
+ var spread = directive(
9
+ class extends Directive {
10
+ constructor() {
11
+ super(...arguments);
12
+ __publicField(this, "element");
13
+ __publicField(this, "previousAttributes", {});
14
+ }
15
+ render(attributeMap) {
16
+ return attributeMap;
17
+ }
18
+ update(part, [attributeMap]) {
19
+ if (!this.element) {
20
+ this.element = part.element;
21
+ this.previousAttributes = {};
22
+ }
23
+ for (const name in this.previousAttributes) {
24
+ if (!(name in attributeMap)) {
25
+ this.element.removeAttribute(name);
26
+ }
27
+ }
28
+ for (const name in attributeMap) {
29
+ const value = attributeMap[name];
30
+ if (value === null || value === void 0) {
31
+ this.element.removeAttribute(name);
32
+ } else if (value === true) {
33
+ this.element.setAttribute(name, "");
34
+ } else if (value !== false) {
35
+ this.element.setAttribute(name, String(value));
36
+ } else {
37
+ this.element.removeAttribute(name);
38
+ }
39
+ }
40
+ this.previousAttributes = { ...attributeMap };
41
+ return nothing;
42
+ }
43
+ }
44
+ );
45
+ export {
46
+ spread
47
+ };
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // utils/watch.ts
21
+ var watch_exports = {};
22
+ __export(watch_exports, {
23
+ watch: () => watch
24
+ });
25
+ module.exports = __toCommonJS(watch_exports);
26
+ function watch(propertyName, options) {
27
+ const resolvedOptions = {
28
+ waitUntilFirstUpdate: false,
29
+ ...options
30
+ };
31
+ return (proto, decoratedFnName) => {
32
+ const { update } = proto;
33
+ const watchedProperties = Array.isArray(propertyName) ? propertyName : [propertyName];
34
+ proto.update = function(changedProps) {
35
+ watchedProperties.forEach((property) => {
36
+ const key = property;
37
+ if (changedProps.has(key)) {
38
+ const oldValue = changedProps.get(key);
39
+ const newValue = this[key];
40
+ if (oldValue !== newValue) {
41
+ if (!resolvedOptions.waitUntilFirstUpdate || this.hasUpdated) {
42
+ this[decoratedFnName](oldValue, newValue);
43
+ }
44
+ }
45
+ }
46
+ });
47
+ update.call(this, changedProps);
48
+ };
49
+ };
50
+ }
51
+ // Annotate the CommonJS export names for ESM import in node:
52
+ 0 && (module.exports = {
53
+ watch
54
+ });
@@ -0,0 +1,28 @@
1
+ import { LitElement } from 'lit';
2
+
3
+ type UpdateHandler = (prev?: unknown, next?: unknown) => void;
4
+ type NonUndefined<A> = A extends undefined ? never : A;
5
+ type UpdateHandlerFunctionKeys<T extends object> = {
6
+ [K in keyof T]-?: NonUndefined<T[K]> extends UpdateHandler ? K : never;
7
+ }[keyof T];
8
+ interface WatchOptions {
9
+ /**
10
+ * If true, will only start watching after the initial update/render
11
+ */
12
+ waitUntilFirstUpdate?: boolean;
13
+ }
14
+ /**
15
+ * Runs when observed properties change, e.g. @property or @state, but before the component updates. To wait for an
16
+ * update to complete after a change occurs, use `await this.updateComplete` in the handler. To start watching after the
17
+ * initial update/render, use `{ waitUntilFirstUpdate: true }` or `this.hasUpdated` in the handler.
18
+ *
19
+ * Usage:
20
+ *
21
+ * @watch('propName')
22
+ * handlePropChange(oldValue, newValue) {
23
+ * ...
24
+ * }
25
+ */
26
+ declare function watch(propertyName: string | string[], options?: WatchOptions): <ElemClass extends LitElement>(proto: ElemClass, decoratedFnName: UpdateHandlerFunctionKeys<ElemClass>) => void;
27
+
28
+ export { watch };
@@ -0,0 +1,28 @@
1
+ import { LitElement } from 'lit';
2
+
3
+ type UpdateHandler = (prev?: unknown, next?: unknown) => void;
4
+ type NonUndefined<A> = A extends undefined ? never : A;
5
+ type UpdateHandlerFunctionKeys<T extends object> = {
6
+ [K in keyof T]-?: NonUndefined<T[K]> extends UpdateHandler ? K : never;
7
+ }[keyof T];
8
+ interface WatchOptions {
9
+ /**
10
+ * If true, will only start watching after the initial update/render
11
+ */
12
+ waitUntilFirstUpdate?: boolean;
13
+ }
14
+ /**
15
+ * Runs when observed properties change, e.g. @property or @state, but before the component updates. To wait for an
16
+ * update to complete after a change occurs, use `await this.updateComplete` in the handler. To start watching after the
17
+ * initial update/render, use `{ waitUntilFirstUpdate: true }` or `this.hasUpdated` in the handler.
18
+ *
19
+ * Usage:
20
+ *
21
+ * @watch('propName')
22
+ * handlePropChange(oldValue, newValue) {
23
+ * ...
24
+ * }
25
+ */
26
+ declare function watch(propertyName: string | string[], options?: WatchOptions): <ElemClass extends LitElement>(proto: ElemClass, decoratedFnName: UpdateHandlerFunctionKeys<ElemClass>) => void;
27
+
28
+ export { watch };
package/utils/watch.js ADDED
@@ -0,0 +1,29 @@
1
+ // utils/watch.ts
2
+ function watch(propertyName, options) {
3
+ const resolvedOptions = {
4
+ waitUntilFirstUpdate: false,
5
+ ...options
6
+ };
7
+ return (proto, decoratedFnName) => {
8
+ const { update } = proto;
9
+ const watchedProperties = Array.isArray(propertyName) ? propertyName : [propertyName];
10
+ proto.update = function(changedProps) {
11
+ watchedProperties.forEach((property) => {
12
+ const key = property;
13
+ if (changedProps.has(key)) {
14
+ const oldValue = changedProps.get(key);
15
+ const newValue = this[key];
16
+ if (oldValue !== newValue) {
17
+ if (!resolvedOptions.waitUntilFirstUpdate || this.hasUpdated) {
18
+ this[decoratedFnName](oldValue, newValue);
19
+ }
20
+ }
21
+ }
22
+ });
23
+ update.call(this, changedProps);
24
+ };
25
+ };
26
+ }
27
+ export {
28
+ watch
29
+ };
package/vite-env.d.ts ADDED
@@ -0,0 +1,22 @@
1
+ /// <reference types="vite/client" />
2
+
3
+ // CSS Module declarations for Vite
4
+ declare module "*.css" {
5
+ const content: string;
6
+ export default content;
7
+ }
8
+
9
+ declare module "*.css?inline" {
10
+ const content: string;
11
+ export default content;
12
+ }
13
+
14
+ declare module "video.js/dist/video-js.css" {
15
+ const content: string;
16
+ export default content;
17
+ }
18
+
19
+ declare module "video.js/dist/video-js.css?inline" {
20
+ const content: string;
21
+ export default content;
22
+ }