@clockworkdog/cogs-client 2.3.0 → 2.5.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/README.md +24 -1
- package/dist/CogsConnection.d.ts +10 -10
- package/dist/CogsConnection.js +22 -40
- package/dist/DataStore.d.ts +41 -0
- package/dist/DataStore.js +70 -0
- package/dist/browser/index.js +118 -284
- package/dist/helpers/urls.d.ts +1 -7
- package/dist/helpers/urls.js +6 -9
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/types/CogsClientMessage.d.ts +7 -2
- package/dist/types/CogsPluginManifest.d.ts +19 -0
- package/package.json +1 -2
package/dist/helpers/urls.d.ts
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
export declare const COGS_ASSETS_SERVER_PORT = 12094;
|
|
2
1
|
export declare const COGS_SERVER_PORT = 12095;
|
|
3
2
|
/**
|
|
4
|
-
*
|
|
5
|
-
* HTTP/2 asset URL or not.
|
|
3
|
+
* Get the URL of an asset hosted by the COGS server.
|
|
6
4
|
*/
|
|
7
5
|
export declare function assetUrl(file: string): string;
|
|
8
|
-
/**
|
|
9
|
-
* Returns a URL for the asset. This is different based on if HTTP/2 is requested or not
|
|
10
|
-
*/
|
|
11
|
-
export declare function assetUrl(file: string, useHttp2AssetsServer: boolean): string;
|
|
12
6
|
export declare function preloadUrl(url: string): Promise<string>;
|
package/dist/helpers/urls.js
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.preloadUrl = exports.assetUrl = exports.COGS_SERVER_PORT =
|
|
4
|
-
exports.COGS_ASSETS_SERVER_PORT = 12094;
|
|
3
|
+
exports.preloadUrl = exports.assetUrl = exports.COGS_SERVER_PORT = void 0;
|
|
5
4
|
exports.COGS_SERVER_PORT = 12095;
|
|
6
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Get the URL of an asset hosted by the COGS server.
|
|
7
|
+
*/
|
|
8
|
+
function assetUrl(file) {
|
|
7
9
|
const location = typeof window !== 'undefined' ? window.location : undefined;
|
|
8
10
|
const path = `/assets/${encodeURIComponent(file)}`;
|
|
9
|
-
|
|
10
|
-
return `https://${location === null || location === void 0 ? void 0 : location.hostname}:${exports.COGS_ASSETS_SERVER_PORT}${path}`;
|
|
11
|
-
}
|
|
12
|
-
else {
|
|
13
|
-
return `${location === null || location === void 0 ? void 0 : location.protocol}//${location === null || location === void 0 ? void 0 : location.hostname}:${exports.COGS_SERVER_PORT}${path}`;
|
|
14
|
-
}
|
|
11
|
+
return `${location === null || location === void 0 ? void 0 : location.protocol}//${location === null || location === void 0 ? void 0 : location.hostname}:${exports.COGS_SERVER_PORT}${path}`;
|
|
15
12
|
}
|
|
16
13
|
exports.assetUrl = assetUrl;
|
|
17
14
|
async function preloadUrl(url) {
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -49,3 +49,4 @@ var urls_2 = require("./helpers/urls");
|
|
|
49
49
|
Object.defineProperty(exports, "preloadUrl", { enumerable: true, get: function () { return urls_2.preloadUrl; } });
|
|
50
50
|
__exportStar(require("./types/CogsPluginManifest"), exports);
|
|
51
51
|
exports.ManifestTypes = __importStar(require("./types/ManifestTypes"));
|
|
52
|
+
__exportStar(require("./DataStore"), exports);
|
|
@@ -19,7 +19,12 @@ interface TextHintsUpdateMessage {
|
|
|
19
19
|
interface CogsEnvironmentMessage {
|
|
20
20
|
type: 'cogs_environment';
|
|
21
21
|
cogsVersion: string;
|
|
22
|
-
|
|
22
|
+
}
|
|
23
|
+
export interface DataStoreItemsClientMessage {
|
|
24
|
+
type: 'data_store_items';
|
|
25
|
+
items: {
|
|
26
|
+
[key: string]: unknown;
|
|
27
|
+
};
|
|
23
28
|
}
|
|
24
29
|
export type Media = {
|
|
25
30
|
type: 'audio';
|
|
@@ -89,5 +94,5 @@ type MediaClientMessage = {
|
|
|
89
94
|
file: string;
|
|
90
95
|
fit: MediaObjectFit;
|
|
91
96
|
};
|
|
92
|
-
export type CogsClientMessage<CustomConfig = {}> = ShowResetMessage | ShowPhaseMessage | AdjustableTimerUpdateMessage | TextHintsUpdateMessage | (MediaClientConfigMessage & CustomConfig) | CogsEnvironmentMessage | MediaClientMessage;
|
|
97
|
+
export type CogsClientMessage<CustomConfig = {}> = ShowResetMessage | ShowPhaseMessage | AdjustableTimerUpdateMessage | TextHintsUpdateMessage | (MediaClientConfigMessage & CustomConfig) | CogsEnvironmentMessage | MediaClientMessage | DataStoreItemsClientMessage;
|
|
93
98
|
export default CogsClientMessage;
|
|
@@ -120,6 +120,25 @@ export interface CogsPluginManifestJson {
|
|
|
120
120
|
video?: true;
|
|
121
121
|
images?: true;
|
|
122
122
|
};
|
|
123
|
+
/**
|
|
124
|
+
* COGS-managed key/value data store settings
|
|
125
|
+
*
|
|
126
|
+
* Allows certain key/value pairs to be saved to disk in the project folder alongside the plugin.
|
|
127
|
+
* Any key that is not listed here can still be used.
|
|
128
|
+
*/
|
|
129
|
+
store?: {
|
|
130
|
+
items?: {
|
|
131
|
+
[key: string]: {
|
|
132
|
+
/**
|
|
133
|
+
* When `true` saves this key/value pair to the project folder when the value changes
|
|
134
|
+
* and restores the value when the project is next loaded.
|
|
135
|
+
*
|
|
136
|
+
* **This option is only available for COGS plugins**, not for custom Media Master content.
|
|
137
|
+
*/
|
|
138
|
+
persistValue?: boolean;
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
};
|
|
123
142
|
}
|
|
124
143
|
/**
|
|
125
144
|
* A readonly version of `PluginManifestJson`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clockworkdog/cogs-client",
|
|
3
|
-
"version": "v2.
|
|
3
|
+
"version": "v2.5.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"unpkg": "dist/browser/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -31,7 +31,6 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@clockworkdog/media-stream-library-browser": "^11.1.1-fixes.6",
|
|
34
|
-
"compare-versions": "^6.1.0",
|
|
35
34
|
"howler": "clockwork-dog/howler.js#fix-looping-clips",
|
|
36
35
|
"reconnecting-websocket": "^4.4.0"
|
|
37
36
|
},
|