Skip to content

Commit

Permalink
deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
gbishop committed Feb 15, 2024
1 parent b493509 commit d0c841f
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 12 deletions.
32 changes: 23 additions & 9 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7534,7 +7534,6 @@ main.filters = filters;
* @property {import('./components/access/cues').CueList} cues
* @property {import('./components/access/method').MethodChooser} method
* @property {import('./components/monitor').Monitor} monitor
* @property {import('./components/toolbar').ToolBar} toolbar
* @property {import('./components/designer').Designer} designer
* @property {import('./components/errors').Messages} error
* @property {function():Promise<void>} restart
Expand Down Expand Up @@ -9215,7 +9214,7 @@ class DB {
return this.readDesignFromBlob(blob, name, etag);
}

/** Return the URL (if any) this designed was imported from
/** Return the URL (if any) this design was imported from
* @returns {Promise<string>}
*/
async getDesignURL() {
Expand Down Expand Up @@ -9602,6 +9601,14 @@ const Functions = {
open_editor: () => {
Globals.state.update({ editing: !Globals.state.get("editing") });
},
share: async (/** @type {string} */ text) => {
try {
await navigator.share({ text });
return "Shared";
} catch (err) {
return err.message;
}
},
};

/**
Expand Down Expand Up @@ -12349,21 +12356,28 @@ let State$1 = class State {
* update the state with a patch and invoke any listeners
*
* @param {Object} patch - the changes to make to the state
* @return {void}
* @return {Promise<void>}
*/
update(patch = {}) {
async update(patch = {}) {
// wait on any promises in the patch
const pvalues = await Promise.all(Object.values(patch));
const pentries = Object.keys(patch).map((k, i) => [k, pvalues[i]]);
patch = Object.fromEntries(pentries);

// note the keys that get changed
for (const key in patch) {
this.updated.add(key);
}
// do the merge
this.values = o(this.values, patch);
// call any listeners
for (const callback of this.listeners) {
callback();
}

// persist the new state
if (this.persistKey) {
const persist = JSON.stringify(this.values);
window.sessionStorage.setItem(this.persistKey, persist);
// console.trace("persist $tabControl", this.values["$tabControl"]);
}
}

Expand Down Expand Up @@ -22738,8 +22752,8 @@ async function start() {
);

/* ToolBar */
Globals.toolbar = ToolBar.create("ToolBar", null);
Globals.toolbar.init();
const toolbar = ToolBar.create("ToolBar", null);
toolbar.init();

/* Monitor */
const monitor = Monitor.create("Monitor", null);
Expand All @@ -22765,7 +22779,7 @@ async function start() {
safeRender("cues", Globals.cues);
safeRender("UI", Globals.layout.children[0]);
if (editing) {
safeRender("toolbar", Globals.toolbar);
safeRender("toolbar", toolbar);
safeRender("tabs", Globals.designer);
safeRender("monitor", monitor);
safeRender("errors", Globals.error);
Expand Down
2 changes: 1 addition & 1 deletion index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion service-worker.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion service-worker.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d0c841f

Please sign in to comment.