flexdesk 0.16.1 → 0.17.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/CHANGELOG.md +112 -0
- package/LICENSE +0 -0
- package/README.md +2435 -42
- package/THIRD_PARTY_LICENSES.md +0 -0
- package/canvas.js +18 -0
- package/charts.js +21 -0
- package/core.js +14 -0
- package/css/base.css +1834 -75
- package/css/flexdesk.css +3165 -159
- package/css/overrides.css +16 -0
- package/css/reset.css +0 -0
- package/css/tokens.css +0 -0
- package/dist/canvas.js +6 -239
- package/dist/canvas.js.map +3 -3
- package/dist/charts.js +707 -18
- package/dist/charts.js.map +4 -4
- package/dist/chunk-3PHCPZHT.js +0 -0
- package/dist/chunk-3PHCPZHT.js.map +0 -0
- package/dist/chunk-4A7SJC3T.js +503 -0
- package/dist/chunk-4A7SJC3T.js.map +7 -0
- package/dist/{chunk-6JSOVNID.js → chunk-CVMCZZX2.js} +635 -10
- package/dist/chunk-CVMCZZX2.js.map +7 -0
- package/dist/chunk-D3COLZZ2.js +1311 -0
- package/dist/chunk-D3COLZZ2.js.map +7 -0
- package/dist/chunk-FOOS3T5L.js +0 -0
- package/dist/chunk-FOOS3T5L.js.map +0 -0
- package/dist/{chunk-SN4LSOAR.js → chunk-GOQLR5WR.js} +452 -2
- package/dist/chunk-GOQLR5WR.js.map +7 -0
- package/dist/{chunk-FL5KFNQH.js → chunk-HNU6MM2B.js} +52 -17
- package/dist/chunk-HNU6MM2B.js.map +7 -0
- package/dist/chunk-HYJYYEPK.js +375 -0
- package/dist/chunk-HYJYYEPK.js.map +7 -0
- package/dist/chunk-JKZLNKG6.js +2041 -0
- package/dist/chunk-JKZLNKG6.js.map +7 -0
- package/dist/chunk-JYWURG5T.js +0 -0
- package/dist/chunk-JYWURG5T.js.map +0 -0
- package/dist/{chunk-FBGP5KN5.js → chunk-LWV23YVE.js} +5073 -532
- package/dist/chunk-LWV23YVE.js.map +7 -0
- package/dist/chunk-N7HC3ADV.js +30 -0
- package/dist/chunk-N7HC3ADV.js.map +7 -0
- package/dist/{chunk-RQM5Z2MU.js → chunk-RMTRWWEO.js} +633 -311
- package/dist/chunk-RMTRWWEO.js.map +7 -0
- package/dist/{chunk-NLTOY57M.js → chunk-UURZ37SD.js} +28 -48
- package/dist/chunk-UURZ37SD.js.map +7 -0
- package/dist/{chunk-B5Q53LAJ.js → chunk-UWO43BZU.js} +2 -2
- package/dist/chunk-UWO43BZU.js.map +7 -0
- package/dist/chunk-WVFGV5FT.js +0 -0
- package/dist/chunk-WVFGV5FT.js.map +0 -0
- package/dist/core.js +170 -118
- package/dist/core.js.map +2 -2
- package/dist/editor.js +156 -70
- package/dist/editor.js.map +2 -2
- package/dist/flexdesk.css +3165 -159
- package/dist/flow.js +2789 -306
- package/dist/flow.js.map +4 -4
- package/dist/host.js +109 -3
- package/dist/host.js.map +3 -3
- package/dist/reset.css +0 -0
- package/dist/tile_registry-6WZPTUZV.js +0 -0
- package/dist/tile_registry-6WZPTUZV.js.map +0 -0
- package/dist/tiles.js +657 -234
- package/dist/tiles.js.map +4 -4
- package/dist/tokens.css +0 -0
- package/dist/widgets.js +3290 -2124
- package/dist/widgets.js.map +4 -4
- package/dist/wm.js +1227 -347
- package/dist/wm.js.map +4 -4
- package/editor.js +20 -0
- package/flow.js +21 -0
- package/host.js +14 -0
- package/package.json +12 -1
- package/src/canvas/canvas_adapter.js +5 -0
- package/src/canvas/edge_router.js +0 -0
- package/src/canvas/graph/connector_router.js +0 -0
- package/src/canvas/graph/history_service.js +0 -0
- package/src/canvas/graph/node_platform.js +0 -0
- package/src/canvas/index.js +1 -0
- package/src/canvas/layered_layout.js +244 -0
- package/src/charts/chart_types.js +0 -0
- package/src/charts/data_series_plot_window.js +0 -0
- package/src/charts/downsample.js +2 -2
- package/src/charts/plot_config.js +53 -29
- package/src/charts/plot_config_editor.js +627 -0
- package/src/charts/plot_grid.js +449 -0
- package/src/charts/plot_popout_window.js +103 -317
- package/src/charts/plotly_wrapper.js +22 -2
- package/src/charts/series_transforms.js +206 -0
- package/src/core/event_bus.js +0 -0
- package/src/core/logging.js +1 -1
- package/src/core/settings.js +105 -19
- package/src/core/state_guard.js +93 -51
- package/src/core/state_guard_config.js +85 -74
- package/src/core/state_machine.js +0 -0
- package/src/editor/editor_pane.js +3 -3
- package/src/editor/monaco_editor_factory.js +124 -60
- package/src/editor/monaco_loader.js +103 -28
- package/src/editor/notebook_search.js +0 -0
- package/src/editor/notebook_tab_bar.js +38 -52
- package/src/editor/notebook_undo_manager.js +0 -0
- package/src/editor/split_pane_container.js +6 -3
- package/src/flow/canvas_editor/connections.js +90 -0
- package/src/flow/canvas_editor/editor.js +2351 -153
- package/src/flow/canvas_editor/index.js +2 -1
- package/src/flow/canvas_editor/layout.js +119 -12
- package/src/flow/canvas_editor/strings.js +80 -0
- package/src/flow/kit/always_before.js +0 -0
- package/src/flow/kit/catalogue.js +97 -3
- package/src/flow/kit/chip_input.js +0 -0
- package/src/flow/kit/dom.js +0 -0
- package/src/flow/kit/findings.js +0 -0
- package/src/flow/kit/history.js +0 -0
- package/src/flow/kit/index.js +3 -3
- package/src/flow/kit/keys.js +7 -1
- package/src/flow/kit/logic_graph.js +97 -15
- package/src/flow/kit/references.js +0 -0
- package/src/flow/kit/settings_panel.js +0 -0
- package/src/flow/kit/settings_schema.js +2 -1
- package/src/flow/kit/step_picker.js +0 -0
- package/src/flow/kit/strings.js +3 -1
- package/src/flow/kit/value_picker.js +0 -0
- package/src/flow/kit/widgets.js +86 -109
- package/src/flow/lanes/editor.js +136 -14
- package/src/flow/lanes/index.js +3 -1
- package/src/flow/lanes/layout.js +0 -0
- package/src/flow/lanes/pipeline.js +44 -2
- package/src/flow/lanes/preview.js +0 -0
- package/src/flow/lanes/strings.js +1 -0
- package/src/flow/outline/editor.js +0 -0
- package/src/flow/outline/index.js +0 -0
- package/src/flow/outline/mapping.js +0 -0
- package/src/flow/outline/menu.js +0 -0
- package/src/flow/outline/operations.js +0 -0
- package/src/flow/outline/recognise.js +0 -0
- package/src/flow/outline/strings.js +0 -0
- package/src/help/help_modal.js +168 -42
- package/src/help/help_registry.js +12 -1
- package/src/host/external_links.js +0 -0
- package/src/host/file_picker.js +117 -0
- package/src/host/host.js +10 -2
- package/src/host/photino_host.js +9 -0
- package/src/host/photino_host.md +21 -3
- package/src/host/pywebview_host.js +10 -0
- package/src/tiles/chart_tiles.js +53 -245
- package/src/tiles/config_schema.js +8 -0
- package/src/tiles/figure_tile.js +322 -0
- package/src/tiles/layout_persistence.js +3 -3
- package/src/tiles/list_tiles.js +7 -7
- package/src/tiles/scope_picker.js +0 -0
- package/src/tiles/tile_base.js +1 -1
- package/src/tiles/tile_config_form.js +442 -0
- package/src/tiles/tile_grid.js +2 -0
- package/src/tiles/tile_registry.js +0 -0
- package/src/tiling/bottom_panel_tabs.js +67 -99
- package/src/tiling/command_palette.js +64 -19
- package/src/tiling/content_registry.js +4 -1
- package/src/tiling/desktops.js +11 -1
- package/src/tiling/entity_sources.js +0 -0
- package/src/tiling/keymap.js +403 -128
- package/src/tiling/kind_taxonomy.js +78 -0
- package/src/tiling/landing_table.js +0 -0
- package/src/tiling/loading_overlay.js +0 -0
- package/src/tiling/nav_panel.js +59 -10
- package/src/tiling/page_factory.js +5 -5
- package/src/tiling/panel_availability.js +49 -0
- package/src/tiling/panel_keys.js +0 -0
- package/src/tiling/shell.js +114 -12
- package/src/tiling/tab_strip.js +0 -0
- package/src/tiling/tile_breadcrumb.js +0 -0
- package/src/tiling/tile_renderer.js +105 -9
- package/src/tiling/tile_tab_menu.js +0 -0
- package/src/tiling/tile_tree.js +0 -0
- package/src/tiling/wm.js +562 -30
- package/src/tiling/zoom.js +0 -0
- package/src/ui/base/component_base.js +0 -0
- package/src/ui/base/controller_base.js +0 -0
- package/src/ui/base/page_base.js +0 -0
- package/src/ui/components/about_dialog.js +0 -0
- package/src/ui/components/action_dropdown.js +30 -2
- package/src/ui/components/alert_log.js +0 -0
- package/src/ui/components/alerts_pane.js +0 -0
- package/src/ui/components/attribute_list_editor.js +0 -0
- package/src/ui/components/autocomplete_field.js +0 -0
- package/src/ui/components/cell_editor_host.js +293 -0
- package/src/ui/components/cell_editors.js +480 -0
- package/src/ui/components/cell_grid.js +761 -0
- package/src/ui/components/cell_paste.js +243 -0
- package/src/ui/components/cell_selection.js +220 -0
- package/src/ui/components/choice_controls.js +351 -0
- package/src/ui/components/color_field.js +211 -0
- package/src/ui/components/color_list_field.js +210 -0
- package/src/ui/components/column_fit.js +0 -0
- package/src/ui/components/column_groups.js +314 -0
- package/src/ui/components/column_order.js +142 -0
- package/src/ui/components/computing_status_window.js +98 -25
- package/src/ui/components/confirm_dialog.js +81 -38
- package/src/ui/components/context_menu.js +2 -2
- package/src/ui/components/conversation_view.js +440 -0
- package/src/ui/components/crosstab.js +289 -0
- package/src/ui/components/data_table.js +696 -71
- package/src/ui/components/detail_header.js +22 -11
- package/src/ui/components/document_outline.js +397 -0
- package/src/ui/components/drag_reorder.js +0 -0
- package/src/ui/components/fact_table.js +0 -0
- package/src/ui/components/fill_handle.js +322 -0
- package/src/ui/components/gallery_picker.js +19 -8
- package/src/ui/components/header_actions.js +55 -0
- package/src/ui/components/inline_renamer.js +0 -0
- package/src/ui/components/job_progress.js +51 -0
- package/src/ui/components/managed_window.js +27 -4
- package/src/ui/components/menu_bar.js +745 -0
- package/src/ui/components/modal.js +449 -75
- package/src/ui/components/notification_history.js +3 -3
- package/src/ui/components/progress.js +483 -0
- package/src/ui/components/record_list.js +0 -0
- package/src/ui/components/row_activation.js +0 -0
- package/src/ui/components/section_stack.js +298 -0
- package/src/ui/components/series.js +173 -0
- package/src/ui/components/settings_view.js +634 -0
- package/src/ui/components/slide_out_panel.js +43 -6
- package/src/ui/components/slider_field.js +275 -18
- package/src/ui/components/sortable_list.js +0 -0
- package/src/ui/components/staged_edits.js +361 -0
- package/src/ui/components/staged_history.js +172 -0
- package/src/ui/components/table_filter_chips.js +0 -0
- package/src/ui/components/table_state_store.js +0 -0
- package/src/ui/components/table_structure.js +182 -0
- package/src/ui/components/table_values.js +0 -0
- package/src/ui/components/tabs.js +497 -0
- package/src/ui/components/tag_input.js +215 -0
- package/src/ui/components/toast.js +25 -8
- package/src/ui/components/toggle_field.js +175 -0
- package/src/ui/components/tree_view.js +55 -34
- package/src/ui/components/tsv.js +74 -0
- package/src/ui/components/window_taskbar.js +0 -0
- package/src/ui/components/wizard.js +563 -0
- package/src/ui/controllers/window_chrome_controller.js +2 -2
- package/src/ui/notification_center.js +375 -119
- package/src/ui/utils/auto_scrollbars.js +0 -0
- package/src/ui/utils/markdown.js +709 -0
- package/src/ui/utils/native_context_menu.js +0 -0
- package/src/ui/utils/overlay_scrollbar.js +16 -12
- package/src/ui/utils/raf_resize_observer.js +0 -0
- package/src/ui/utils/scroll_lock.js +0 -0
- package/src/ui/utils/strip_scroll.js +55 -0
- package/src/ui/utils/tooltip_service.js +0 -8
- package/tiles.js +27 -0
- package/widgets.js +69 -0
- package/wm.js +28 -0
- package/dist/chunk-6JSOVNID.js.map +0 -7
- package/dist/chunk-B5Q53LAJ.js.map +0 -7
- package/dist/chunk-FBGP5KN5.js.map +0 -7
- package/dist/chunk-FL5KFNQH.js.map +0 -7
- package/dist/chunk-NLTOY57M.js.map +0 -7
- package/dist/chunk-NNFTETK3.js +0 -633
- package/dist/chunk-NNFTETK3.js.map +0 -7
- package/dist/chunk-O5OHMWBB.js +0 -284
- package/dist/chunk-O5OHMWBB.js.map +0 -7
- package/dist/chunk-RQM5Z2MU.js.map +0 -7
- package/dist/chunk-SN4LSOAR.js.map +0 -7
- package/dist/chunk-W6FBJLPW.js +0 -367
- package/dist/chunk-W6FBJLPW.js.map +0 -7
- package/src/ui/controllers/panel_state_machine.js +0 -634
package/dist/host.js
CHANGED
|
@@ -17,11 +17,19 @@ var HOST_CONTRACT = Object.freeze({
|
|
|
17
17
|
// `chrome()` answers 'native' or 'custom', or a promise of one.
|
|
18
18
|
optional: Object.freeze(["startNativeDrag", "startNativeResize"])
|
|
19
19
|
}),
|
|
20
|
-
|
|
20
|
+
// `openFile({accept, kind, encoding})` answers {ok: true, name, path?, text | data},
|
|
21
|
+
// {ok: false, cancelled: true}, {ok: false, error}, or null when there is
|
|
22
|
+
// no dialog behind it. Optional: pickFile() (file_picker.js) falls back to
|
|
23
|
+
// the browser's file chooser without it.
|
|
24
|
+
dialogs: Object.freeze({ required: Object.freeze(["saveFile"]), optional: Object.freeze(["openFile"]) }),
|
|
21
25
|
state: Object.freeze({ required: Object.freeze(["read", "write"]), optional: Object.freeze([]) }),
|
|
22
26
|
// `openExternal(url)` hands a web address to the OS's default browser and
|
|
23
27
|
// resolves true when it did. See external_links.js.
|
|
24
|
-
shell: Object.freeze({ required: Object.freeze(["openExternal"]), optional: Object.freeze([]) })
|
|
28
|
+
shell: Object.freeze({ required: Object.freeze(["openExternal"]), optional: Object.freeze([]) }),
|
|
29
|
+
// `list(kind)` answers the starter entries `[{id, kind, label, description?,
|
|
30
|
+
// fields?}]` for one kind (every kind when `kind` is null), or a promise of
|
|
31
|
+
// them. Backs mountGalleryPicker() when it is given no `entries`.
|
|
32
|
+
gallery: Object.freeze({ required: Object.freeze(["list"]), optional: Object.freeze([]) })
|
|
25
33
|
});
|
|
26
34
|
function validateCapability(name, cap) {
|
|
27
35
|
const spec = HOST_CONTRACT[name];
|
|
@@ -102,7 +110,17 @@ function createPywebviewHost({ bridgeRef = null, resolvePath = (k) => `${k}.json
|
|
|
102
110
|
// treats it exactly like an absent `dialogs` capability: fall back to a
|
|
103
111
|
// Blob download, never report a failed save. Covered by
|
|
104
112
|
// tests/ui/test_host_save_fallback.mjs.
|
|
105
|
-
saveFile: ({ data, filename, kind }) => call("save_file_dialog", [data, filename, kind])
|
|
113
|
+
saveFile: ({ data, filename, kind }) => call("save_file_dialog", [data, filename, kind]),
|
|
114
|
+
// POSITIONAL on the wire like save_file_dialog: read_file_dialog(accept,
|
|
115
|
+
// kind, encoding), where `accept` is a list of extensions or MIME types
|
|
116
|
+
// (may be empty), `kind` a label for the filter or null, and `encoding`
|
|
117
|
+
// 'text' or 'base64'. The reply is openFile's result shape (host.js);
|
|
118
|
+
// null when the transport has no read_file_dialog, and pickFile() then
|
|
119
|
+
// opens the browser's file chooser instead. See the README host contract.
|
|
120
|
+
async openFile({ accept = [], kind = null, encoding = "text" } = {}) {
|
|
121
|
+
const r = await call("read_file_dialog", [accept, kind, encoding]);
|
|
122
|
+
return r && typeof r === "object" ? r : null;
|
|
123
|
+
}
|
|
106
124
|
},
|
|
107
125
|
state: {
|
|
108
126
|
async read(key) {
|
|
@@ -257,6 +275,18 @@ function createPhotinoHost(opts = {}) {
|
|
|
257
275
|
warn("dialogs", "saveFile", e);
|
|
258
276
|
}
|
|
259
277
|
return r && typeof r === "object" ? r : null;
|
|
278
|
+
},
|
|
279
|
+
// `{ok: true, name, path?, text | data}` | `{ok: false, cancelled: true}` |
|
|
280
|
+
// `{ok: false, error}`, or null when the host refused: pickFile() then
|
|
281
|
+
// opens the browser's chooser. No timeout, for the same reason as saveFile.
|
|
282
|
+
async openFile({ accept = [], kind = null, encoding = "text" } = {}) {
|
|
283
|
+
let r = null;
|
|
284
|
+
try {
|
|
285
|
+
r = await request("dialogs", "openFile", [{ accept, kind, encoding }], { wait: 0 });
|
|
286
|
+
} catch (e) {
|
|
287
|
+
warn("dialogs", "openFile", e);
|
|
288
|
+
}
|
|
289
|
+
return r && typeof r === "object" ? r : null;
|
|
260
290
|
}
|
|
261
291
|
},
|
|
262
292
|
shell: {
|
|
@@ -357,6 +387,81 @@ function routeExternalLinks({ host, root, win } = {}) {
|
|
|
357
387
|
}
|
|
358
388
|
};
|
|
359
389
|
}
|
|
390
|
+
|
|
391
|
+
// src/host/file_picker.js
|
|
392
|
+
var ENCODINGS = /* @__PURE__ */ new Set(["text", "base64"]);
|
|
393
|
+
function acceptList(accept) {
|
|
394
|
+
const parts = Array.isArray(accept) ? accept : accept ? String(accept).split(",") : [];
|
|
395
|
+
return parts.map((a) => String(a).trim()).filter(Boolean);
|
|
396
|
+
}
|
|
397
|
+
function acceptAttr(accept) {
|
|
398
|
+
return acceptList(accept).join(",");
|
|
399
|
+
}
|
|
400
|
+
function readFile(file, encoding, FileReaderCtor) {
|
|
401
|
+
return new Promise((resolve) => {
|
|
402
|
+
const reader = new FileReaderCtor();
|
|
403
|
+
reader.onload = () => {
|
|
404
|
+
const name = file.name;
|
|
405
|
+
if (encoding === "base64") {
|
|
406
|
+
const url = String(reader.result ?? "");
|
|
407
|
+
resolve({ ok: true, name, data: url.slice(url.indexOf(",") + 1) });
|
|
408
|
+
} else {
|
|
409
|
+
resolve({ ok: true, name, text: String(reader.result ?? "") });
|
|
410
|
+
}
|
|
411
|
+
};
|
|
412
|
+
reader.onerror = () => resolve({ ok: false, error: String(reader.error?.message || reader.error || "The file could not be read.") });
|
|
413
|
+
if (encoding === "base64") reader.readAsDataURL(file);
|
|
414
|
+
else reader.readAsText(file);
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
function browserChooser({ accept, encoding, doc }) {
|
|
418
|
+
const FileReaderCtor = doc?.defaultView?.FileReader ?? globalThis.FileReader;
|
|
419
|
+
if (!doc?.body || typeof FileReaderCtor !== "function") {
|
|
420
|
+
return Promise.resolve({ ok: false, error: "No file chooser is available here." });
|
|
421
|
+
}
|
|
422
|
+
return new Promise((resolve) => {
|
|
423
|
+
const input = doc.createElement("input");
|
|
424
|
+
input.type = "file";
|
|
425
|
+
const a = acceptAttr(accept);
|
|
426
|
+
if (a) input.accept = a;
|
|
427
|
+
input.style.display = "none";
|
|
428
|
+
let done = false;
|
|
429
|
+
const finish = (result) => {
|
|
430
|
+
if (done) return;
|
|
431
|
+
done = true;
|
|
432
|
+
input.removeEventListener("change", onChange);
|
|
433
|
+
input.removeEventListener("cancel", onCancel);
|
|
434
|
+
input.remove();
|
|
435
|
+
resolve(result);
|
|
436
|
+
};
|
|
437
|
+
const onChange = () => {
|
|
438
|
+
const file = input.files && input.files[0];
|
|
439
|
+
if (!file) {
|
|
440
|
+
finish({ ok: false, cancelled: true });
|
|
441
|
+
return;
|
|
442
|
+
}
|
|
443
|
+
readFile(file, encoding, FileReaderCtor).then(finish);
|
|
444
|
+
};
|
|
445
|
+
const onCancel = () => finish({ ok: false, cancelled: true });
|
|
446
|
+
input.addEventListener("change", onChange);
|
|
447
|
+
input.addEventListener("cancel", onCancel);
|
|
448
|
+
doc.body.appendChild(input);
|
|
449
|
+
input.click();
|
|
450
|
+
});
|
|
451
|
+
}
|
|
452
|
+
async function pickFile(host, { accept = [], kind = null, encoding = "text", document: doc } = {}) {
|
|
453
|
+
if (!ENCODINGS.has(encoding)) throw new TypeError(`pickFile: unknown encoding '${encoding}' (use 'text' or 'base64')`);
|
|
454
|
+
if (typeof host?.dialogs?.openFile === "function") {
|
|
455
|
+
let r = null;
|
|
456
|
+
try {
|
|
457
|
+
r = await host.dialogs.openFile({ accept: acceptList(accept), kind, encoding });
|
|
458
|
+
} catch {
|
|
459
|
+
r = null;
|
|
460
|
+
}
|
|
461
|
+
if (r && typeof r === "object") return r;
|
|
462
|
+
}
|
|
463
|
+
return browserChooser({ accept, encoding, doc: doc ?? (typeof document !== "undefined" ? document : null) });
|
|
464
|
+
}
|
|
360
465
|
export {
|
|
361
466
|
HOST_CONTRACT,
|
|
362
467
|
NULL_HOST,
|
|
@@ -365,6 +470,7 @@ export {
|
|
|
365
470
|
createPhotinoTransport,
|
|
366
471
|
createPywebviewHost,
|
|
367
472
|
isPhotinoWindow,
|
|
473
|
+
pickFile,
|
|
368
474
|
routeExternalLinks,
|
|
369
475
|
usesCustomWindowChrome,
|
|
370
476
|
validateCapability
|
package/dist/host.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../src/host/host.js", "../src/host/pywebview_host.js", "../src/host/photino_host.js", "../src/host/external_links.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * host.js \u2014 the host port.\n *\n * The framework declares what it needs from its embedder. A Host is a bag of\n * INDEPENDENTLY OPTIONAL capability objects:\n *\n * - absent capability => absent key (never a stub)\n * - present capability => must be complete (validated at boot)\n *\n * There is NO module-level default host and NO getHost(). Hosts are injected \u2014\n * a module singleton here would just be `window.pywebview` wearing a hat, and\n * would make a second host (mock, browser tab, VS Code webview) impossible.\n *\n * Zero pywebview. Zero EcoAgent. See pywebview_host.js for the reference\n * adapter that implements this port against the pywebview / HTTP transports.\n */\n\nexport const HOST_CONTRACT = Object.freeze({\n window: Object.freeze({\n required: Object.freeze(['chrome', 'minimize', 'close', 'isMaximized', 'setMaximized',\n 'isFullscreen', 'toggleFullscreen', 'getBounds', 'setBounds']),\n // `chrome()` answers 'native' or 'custom', or a promise of one.\n optional: Object.freeze(['startNativeDrag', 'startNativeResize']),\n }),\n dialogs: Object.freeze({ required: Object.freeze(['saveFile']), optional: Object.freeze([]) }),\n state: Object.freeze({ required: Object.freeze(['read', 'write']), optional: Object.freeze([]) }),\n // `openExternal(url)` hands a web address to the OS's default browser and\n // resolves true when it did. See external_links.js.\n shell: Object.freeze({ required: Object.freeze(['openExternal']), optional: Object.freeze([]) }),\n});\n\n/**\n * Validate ONE capability object. We validate the capability the adapter\n * authored \u2014 a plain object literal with real closures \u2014 not the raw bridge:\n * `index.html`'s browser-mode polyfill installs a `new Proxy({}, {get})` that\n * returns a function for EVERY property name, so duck-typing the bridge is\n * vacuously true and validates nothing. A Proxy cannot forge a missing key in\n * an object literal.\n *\n * @returns {{ ok: boolean, missing: string[] }}\n */\nexport function validateCapability(name, cap) {\n const spec = HOST_CONTRACT[name];\n if (!spec) return { ok: false, missing: [`unknown capability '${name}'`] };\n if (!cap || typeof cap !== 'object') return { ok: false, missing: [...spec.required] };\n const missing = spec.required.filter((m) => typeof cap[m] !== 'function');\n return { ok: missing.length === 0, missing };\n}\n\n/**\n * Validate + freeze a set of capabilities into a Host.\n * Throws at boot on an incomplete capability \u2014 a half-wired host is a bug,\n * and a bug at boot beats a silent degrade at click time.\n *\n * @param {{ window?: object, dialogs?: object, state?: object, shell?: object }} caps\n * @returns {Readonly<object>} the Host\n */\nexport function createHost(caps = {}) {\n const host = {};\n for (const name of Object.keys(HOST_CONTRACT)) {\n const cap = caps[name];\n if (cap == null) continue; // legitimately absent\n const v = validateCapability(name, cap);\n if (!v.ok) {\n throw new Error(`Host capability '${name}' is incomplete: missing ${v.missing.join(', ')}`);\n }\n host[name] = Object.freeze(cap);\n }\n return Object.freeze(host);\n}\n\n/** The zero-capability host. Every framework consumer MUST survive it. */\nexport const NULL_HOST = createHost({});\n", "/**\n * pywebview_host.js \u2014 the REFERENCE host adapter.\n *\n * Knows pywebview. Knows NOTHING about EcoAgent: every domain fact (which\n * bridge ref to use, where a state key lands on disk) arrives as a parameter.\n * This is the adapter a standalone consumer copies; EcoAgent is just its first\n * caller (see ui/js/bootstrap/app_bootstrap.js).\n *\n * It speaks to whatever `window.pywebview.api` currently is \u2014 the real\n * pywebview bridge in the desktop app, or the `POST /api/<method>` Proxy\n * polyfill that ui/index.html installs in --browser mode. Both transports are\n * positional-on-the-wire, which is why setBounds() spreads its object back out\n * into positional args.\n */\n\nimport { createHost } from './host.js';\n\nconst FRAMELESS_BACKENDS = new Set(['edgechromium', 'mshtml']);\n\n/**\n * Custom (frameless) window chrome \u2014 the min/max/close buttons, edge resize\n * handles and drag-to-move top bar \u2014 only makes sense when our top bar IS the\n * window's title bar. That holds on a native pywebview window the OS draws\n * *without* decorations of its own: Windows (frameless). On Linux/macOS the\n * window manager already draws a native title bar above our top bar, and in\n * `--browser` mode the browser supplies its own chrome \u2014 in both cases the\n * custom controls are a redundant second set, so we neither render nor wire\n * them (which also stops us swallowing native F11 fullscreen and showing dead\n * resize cursors at the window edges).\n *\n * Detection keys off the pywebview backend string, which is unambiguous: the\n * browser-mode polyfill in index.html injects only `.api`, never `.platform`,\n * so any `.platform` at all \u21D2 running as a native pywebview app. The frameless\n * (custom-title-bar) backends are the Windows WebViews \u2014 'edgechromium' /\n * 'mshtml'. Linux ('gtkwebkit2' / 'qtwebengine') and macOS ('cocoa') draw\n * native decorations, so they return false. Verified live: WebKitGTK reports\n * platform 'gtkwebkit2'.\n */\nexport function usesCustomWindowChrome() {\n // Authoritative signal from the Python host: run_pywebview_mode() appends\n // `?frameless=1` to the window URL exactly when it created a frameless native\n // window (Windows). Prefer it over the backend sniff below because it's\n // present at document parse \u2014 before pywebview finishes injecting\n // `window.pywebview` (and before the browser-mode polyfill, which sets `.api`\n // but no `.platform`, can clobber it). Reading the sniff at shell-build time\n // otherwise races and the whole custom chrome silently fails to render.\n try {\n if (new URLSearchParams(window.location.search).get('frameless') === '1') {\n return true;\n }\n } catch (_) { /* location unavailable (non-browser env) \u2014 fall through */ }\n const platform = window.pywebview && window.pywebview.platform;\n return !!platform && FRAMELESS_BACKENDS.has(platform);\n}\n\n/**\n * Build a Host backed by the pywebview bridge.\n *\n * @param {object} opts\n * @param {{current: object|null}} [opts.bridgeRef] LIVE ref to the bridge.\n * MUST be a ref, never a snapshot: `setupHostBridgeListener` mutates\n * `.current` when a late bridge arrives, and `resolveHostBridge` can\n * resolve `null` after its timeout. Snapshotting the bridge here would\n * freeze that null and reproduce as an intermittent boot failure.\n * @param {(key: string) => string} [opts.resolvePath] logical state key ->\n * storage path. THE domain seam: the framework only ever names keys\n * ('desktops', 'datatable_state'); the embedder decides where they land.\n * @param {object} [opts.logger]\n */\nexport function createPywebviewHost({ bridgeRef = null, resolvePath = (k) => `${k}.json`, logger = console } = {}) {\n const api = () => bridgeRef?.current ?? window.pywebview?.api ?? null;\n\n const call = async (name, args = []) => {\n const a = api();\n if (!a || typeof a[name] !== 'function') return null;\n try { return await a[name](...args); }\n catch (e) { logger.warn?.('[host] call failed', name, e); return null; }\n };\n\n // Envelope unwrapping, in ONE place. Transcribed from the call sites this\n // replaces, so app.py's catch-all `{ok: true}` reply (which carries no\n // `maximized` key) still reads as false, exactly as it does today.\n const okMax = (r) => Boolean(r && r.ok && r.maximized === true);\n const okFs = (r) => Boolean(r && r.ok && r.fullscreen);\n\n // ALL THREE capabilities are ALWAYS advertised. Do NOT gate them on api()\n // being non-null at construction time: the methods late-bind through the\n // ref, and gating here would permanently strand a late-arriving bridge on\n // the fallback paths (Blob download instead of the native save dialog).\n return createHost({\n window: {\n chrome: () => (usesCustomWindowChrome() ? 'custom' : 'native'),\n minimize: () => { void call('window_minimize'); },\n close: () => { void call('window_close'); },\n isMaximized: async () => okMax(await call('window_is_maximized')),\n setMaximized: async (on) => okMax(await call('window_set_maximized', [on])),\n isFullscreen: async () => okFs(await call('window_is_fullscreen')),\n toggleFullscreen: async () => okFs(await call('window_toggle_fullscreen')),\n async getBounds() {\n const r = await call('window_get_bounds');\n if (!r || !r.ok) return null;\n return { x: r.x, y: r.y, width: r.width, height: r.height };\n },\n // POSITIONAL on the wire \u2014 both transports depend on it. Not async:\n // this is a rAF hot path during a window drag/resize; nobody awaits.\n setBounds({ x = null, y = null, width = null, height = null } = {}) {\n void call('window_set_bounds', [x, y, width, height]);\n },\n startNativeDrag: async () => Boolean((await call('window_start_native_drag'))?.ok),\n },\n dialogs: {\n // Resolves to null when the transport has no save_file_dialog behind it.\n // Per host.js that is the contract for \"unavailable\", and every caller\n // treats it exactly like an absent `dialogs` capability: fall back to a\n // Blob download, never report a failed save. Covered by\n // tests/ui/test_host_save_fallback.mjs.\n saveFile: ({ data, filename, kind }) => call('save_file_dialog', [data, filename, kind]),\n },\n state: {\n async read(key) {\n const blob = await call('workspace_state_read', [{ path: resolvePath(key) }]);\n if (!blob) return null;\n try { return typeof blob === 'string' ? JSON.parse(blob) : blob; }\n catch (e) { logger.warn?.('[host] bad JSON for state key', key, e); return null; }\n },\n async write(key, value) {\n const r = await call('workspace_state_write',\n [{ path: resolvePath(key), data: JSON.stringify(value) }]);\n return r !== null;\n },\n },\n });\n}\n", "/**\n * photino_host.js \u2014 the host port over a Photino.NET window.\n *\n * Photino gives the page exactly two things: `window.external.sendMessage(text)`\n * and `window.external.receiveMessage(callback)`. Strings in, strings out, no\n * replies. This adapter puts a request/reply protocol over them, matched by id:\n *\n * page \u2192 host {\"id\": 7, \"cap\": \"window\", \"op\": \"setBounds\", \"args\": [{\"x\":0,\"y\":0,\"width\":1200,\"height\":800}]}\n * host \u2192 page {\"id\": 7, \"ok\": true, \"value\": null}\n * host \u2192 page {\"id\": 8, \"ok\": false, \"error\": \"no such op\"}\n * host \u2192 page {\"event\": \"window.maximizedChanged\", \"value\": true} // unsolicited, no id\n *\n * and offers the port's `window`, `dialogs` and `state` capabilities on top.\n * The C# side \u2014 one dispatcher on the window's web-message handler, every op\n * with its args and reply \u2014 is documented in `photino_host.md` beside this file.\n *\n * Like pywebview_host.js it knows the transport and NOTHING about the app: an\n * embedder that keeps some capability elsewhere (BugDesk keeps `state` on its\n * own server) passes that capability in, or `null` to leave it out.\n *\n * In a browser tab there is no `window.external.sendMessage`, and\n * createPhotinoHost() returns NULL_HOST \u2014 the fallback every FlexDesk consumer\n * already has to survive.\n */\n\nimport { createHost, NULL_HOST } from './host.js';\n\n/** True when `ext` (default: `window.external`) is a Photino bridge. */\nexport function isPhotinoWindow(ext = (typeof window !== 'undefined' ? window.external : undefined)) {\n return !!ext && typeof ext.sendMessage === 'function' && typeof ext.receiveMessage === 'function';\n}\n\n/**\n * The bare request/reply layer. `call(cap, op, ...args)` sends one request and\n * resolves with the reply's `value` (`request(cap, op, args, {wait})` is the\n * same with a timeout of its own). It REJECTS when the host answers\n * `ok: false` (with the host's error) and when no reply arrives within\n * `timeoutMs`. A reply for an id nobody is waiting on, a message that is not\n * JSON, and anything that is neither a reply nor an event are dropped.\n *\n * @param {object} opts\n * @param {{sendMessage: Function, receiveMessage: Function}} opts.external\n * @param {number} [opts.timeoutMs=10000]\n * @param {(name: string, value: any) => void} [opts.onEvent] id-less `{event, value}` messages\n * @param {object} [opts.logger]\n */\nexport function createPhotinoTransport({ external, timeoutMs = 10000, onEvent = null, logger = console }) {\n const pending = new Map();\n let seq = 0;\n external.receiveMessage((text) => {\n let m;\n try { m = typeof text === 'string' ? JSON.parse(text) : text; } catch { return; }\n if (!m || typeof m !== 'object') return;\n if (m.id == null) {\n if (typeof m.event === 'string' && onEvent) {\n try { onEvent(m.event, m.value); }\n catch (e) { logger.warn?.('[host] photino event handler failed', m.event, e); }\n }\n return;\n }\n const p = pending.get(m.id);\n if (!p) return;\n pending.delete(m.id);\n clearTimeout(p.timer);\n if (m.ok) p.resolve(m.value === undefined ? null : m.value);\n else p.reject(new Error(m.error || `${p.what}: refused by the host`));\n });\n // `wait` is this request's timeout in ms; 0 waits for as long as it takes.\n const request = (cap, op, args = [], { wait = timeoutMs } = {}) => new Promise((resolve, reject) => {\n const id = ++seq;\n const what = `${cap}.${op}`;\n const timer = wait > 0 ? setTimeout(() => {\n if (pending.delete(id)) reject(new Error(`${what}: no answer from the host within ${wait} ms`));\n }, wait) : null;\n pending.set(id, { resolve, reject, timer, what });\n try {\n external.sendMessage(JSON.stringify({ id, cap, op, args }));\n } catch (e) {\n pending.delete(id);\n clearTimeout(timer);\n reject(e);\n }\n });\n const call = (cap, op, ...args) => request(cap, op, args);\n return { call, request, pending: () => pending.size };\n}\n\n/**\n * Build a Host backed by a Photino window.\n *\n * The capability methods follow pywebview_host.js's contract, so a consumer\n * cannot tell the two apart: they DEGRADE instead of rejecting. A failed query\n * reads as false / null, a failed fire-and-forget is logged, and a save that\n * the host refused or never answered resolves `null` \u2014 the host.js meaning of\n * \"unavailable\", which every caller turns into a Blob download.\n *\n * @param {object} [opts]\n * @param {object} [opts.external=window.external] the Photino bridge (a fake one in tests)\n * @param {number} [opts.timeoutMs=10000]\n * @param {(name: string, value: any) => void} [opts.onEvent]\n * @param {object} [opts.logger=console]\n * @param {'auto'|'native'|'custom'} [opts.chrome='auto'] who draws the window's\n * title bar and borders. `auto` asks the native side once (`host.describe`,\n * its `frame` field), the first time somebody needs to know; `native`\n * or `custom` fixes the answer without asking. See photino_host.md.\n * @param {object|null} [opts.window] replace the window capability, or `null` to leave it out\n * @param {object|null} [opts.dialogs] replace the dialogs capability, or `null` to leave it out\n * @param {object|null} [opts.state] replace the state capability, or `null` to leave it out\n * @param {object|null} [opts.shell] replace the shell capability, or `null` to leave it out\n * @returns {Readonly<object>} a Host, or NULL_HOST outside a Photino window\n */\nexport function createPhotinoHost(opts = {}) {\n const {\n external = (typeof window !== 'undefined' ? window.external : undefined),\n timeoutMs = 10000,\n onEvent = null,\n logger = console,\n chrome = 'auto',\n } = opts;\n if (!isPhotinoWindow(external)) return NULL_HOST;\n\n const { call, request } = createPhotinoTransport({ external, timeoutMs, onEvent, logger });\n const warn = (cap, op, e) => logger.warn?.('[host] photino call failed', `${cap}.${op}`, e);\n const soft = async (fallback, cap, op, ...args) => {\n try { return await call(cap, op, ...args); }\n catch (e) { warn(cap, op, e); return fallback; }\n };\n const fire = (cap, op, ...args) => { void soft(null, cap, op, ...args); };\n\n // Who draws the frame. Asked once and remembered: a string once known, the\n // pending question before that. A native side that predates `frame`, or\n // doesn't answer within 3 s, has native chrome.\n let frame = chrome === 'custom' || chrome === 'native' ? chrome : null;\n let asking = null;\n const askFrame = () => {\n if (frame) return frame;\n asking ??= request('host', 'describe', [], { wait: 3000 })\n .then((d) => (d && d.frame === 'custom' ? 'custom' : 'native'), () => 'native')\n .then((f) => { frame = f; return f; });\n return asking;\n };\n // A drag or resize handed to the OS: the reply comes when the mouse is\n // released, however long that takes. Refused (a native side without the op,\n // or a window with native chrome) means \"not handled\": the caller does it in JS.\n const gesture = async (op, ...args) => {\n try { await request('window', op, args, { wait: 0 }); return true; }\n catch (e) { return false; }\n };\n\n const defaults = {\n window: {\n // 'native' (the OS draws the frame: FlexDesk's own buttons would be\n // a second set) or 'custom' (the native side made the window\n // frameless). A promise until the native side has said which.\n chrome: () => askFrame(),\n minimize: () => { fire('window', 'minimize'); },\n close: () => { fire('window', 'close'); },\n isMaximized: async () => (await soft(false, 'window', 'isMaximized')) === true,\n setMaximized: async (on) => (await soft(false, 'window', 'setMaximized', !!on)) === true,\n isFullscreen: async () => (await soft(false, 'window', 'isFullscreen')) === true,\n toggleFullscreen: async () => (await soft(false, 'window', 'toggleFullscreen')) === true,\n async getBounds() {\n const b = await soft(null, 'window', 'getBounds');\n if (!b || typeof b !== 'object') return null;\n return { x: b.x, y: b.y, width: b.width, height: b.height };\n },\n startNativeDrag: () => gesture('startDrag'),\n startNativeResize: (edge) => gesture('startResize', String(edge || '')),\n // Not async, like pywebview's: a rAF hot path during a drag; nobody awaits.\n setBounds({ x = null, y = null, width = null, height = null } = {}) {\n fire('window', 'setBounds', { x, y, width, height });\n },\n },\n dialogs: {\n // `{ok: true, path}` | `{ok: false, cancelled: true}` | `{ok: false, error}`,\n // or null when the host refused: fall back to a download. NO TIMEOUT \u2014\n // the dialog is open for as long as the user takes, and giving up on it\n // would download the file a second time behind the dialog.\n async saveFile({ data, filename, kind } = {}) {\n let r = null;\n try { r = await request('dialogs', 'saveFile', [{ data, filename, kind }], { wait: 0 }); }\n catch (e) { warn('dialogs', 'saveFile', e); }\n return r && typeof r === 'object' ? r : null;\n },\n },\n shell: {\n // True when the native side opened it in the system browser; false\n // when it refused (a scheme it won't open, an older native side\n // without the op): the caller falls back to window.open.\n openExternal: async (url) => (await soft(false, 'shell', 'openExternal', String(url || ''))) === true,\n },\n state: {\n async read(key) {\n const v = await soft(null, 'state', 'read', key);\n if (typeof v !== 'string') return v ?? null;\n try { return JSON.parse(v); }\n catch (e) { logger.warn?.('[host] bad JSON for state key', key, e); return null; }\n },\n async write(key, value) {\n return (await soft(false, 'state', 'write', key, value)) !== false;\n },\n },\n };\n\n const caps = {};\n for (const name of Object.keys(defaults)) {\n if (!(name in opts)) caps[name] = defaults[name];\n else if (opts[name] != null) caps[name] = opts[name];\n }\n return createHost(caps);\n}\n", "/**\n * external_links.js \u2014 links that leave the app open in the system browser.\n *\n * In a browser tab, `target=\"_blank\"` and `window.open()` open a new tab, which\n * is what everyone expects. In a native window (Photino, a webview) they open\n * either nothing or a bare popup with no address bar and no way back. The host\n * knows how to hand a URL to the OS (`host.shell.openExternal`); this routes\n * the page's outbound links there.\n *\n * Without a `shell` capability it changes nothing, so an app can call it\n * unconditionally at boot: in a browser tab it is a no-op.\n */\n\nconst SCHEMES = new Set(['http:', 'https:', 'mailto:']);\n\n/** The URL as an absolute URL when it is one we would send out, else null. */\nfunction outbound(href, base) {\n let url;\n try { url = new URL(String(href), base); } catch { return null; }\n return SCHEMES.has(url.protocol) ? url : null;\n}\n\n/**\n * Send external link clicks and `window.open` calls to `host.shell.openExternal`.\n *\n * A link goes out when it is http(s) or mailto AND it has `target=\"_blank\"`,\n * points to another origin, or is mailto. A same-origin link without a target\n * is the app's own navigation and is left alone; a same-origin `_blank` goes\n * out too, because in a native window the alternative is a bare popup. A\n * handler that already called `preventDefault()` on the click keeps it.\n *\n * When `openExternal` resolves false (the native side refused it), the original\n * `window.open` runs instead, so the click still does something.\n *\n * @param {object} opts\n * @param {object} opts.host a Host; does nothing without `host.shell`\n * @param {EventTarget} [opts.root=document] where clicks are listened for\n * @param {Window} [opts.win=window] whose `open` is wrapped\n * @returns {{ dispose: () => void }}\n */\nexport function routeExternalLinks({ host, root, win } = {}) {\n const w = win ?? (typeof window !== 'undefined' ? window : null);\n const r = root ?? (typeof document !== 'undefined' ? document : null);\n const shell = host?.shell;\n if (!shell || typeof shell.openExternal !== 'function' || !w || !r) return { dispose() {} };\n\n const base = () => w.location?.href;\n const origin = () => { try { return new URL(base()).origin; } catch { return null; } };\n const nativeOpen = w.open;\n const fallback = (href) => { try { nativeOpen?.call(w, href, '_blank', 'noopener'); } catch { /* blocked */ } };\n const send = (href) => {\n Promise.resolve()\n .then(() => shell.openExternal(href))\n .then((opened) => { if (opened !== true) fallback(href); }, () => fallback(href));\n };\n\n const onClick = (e) => {\n if (e.defaultPrevented) return;\n // Left click, or a middle click (auxclick): both open a new window.\n if (e.type === 'click' ? e.button !== 0 : e.button !== 1) return;\n const a = e.target?.closest?.('a[href]');\n if (!a || a.hasAttribute('download')) return;\n const url = outbound(a.getAttribute('href'), base());\n if (!url) return;\n const leaves = url.protocol === 'mailto:'\n || (a.getAttribute('target') || '').toLowerCase() === '_blank'\n || url.origin !== origin()\n || e.button === 1;\n if (!leaves) return;\n e.preventDefault();\n send(url.href);\n };\n\n const routedOpen = function open(href, target, features) {\n const url = href == null ? null : outbound(href, base());\n if (url && (url.protocol === 'mailto:' || url.origin !== origin())) {\n send(url.href);\n return null;\n }\n return nativeOpen.call(w, href, target, features);\n };\n\n r.addEventListener('click', onClick);\n r.addEventListener('auxclick', onClick);\n w.open = routedOpen;\n\n return {\n dispose() {\n r.removeEventListener('click', onClick);\n r.removeEventListener('auxclick', onClick);\n if (w.open === routedOpen) w.open = nativeOpen;\n },\n };\n}\n"],
|
|
5
|
-
"mappings": ";;;AAiBO,IAAM,gBAAgB,OAAO,OAAO;AAAA,EACvC,QAAQ,OAAO,OAAO;AAAA,IAClB,UAAU,OAAO,OAAO;AAAA,MAAC;AAAA,MAAU;AAAA,MAAY;AAAA,MAAS;AAAA,MAAe;AAAA,MAC9C;AAAA,MAAgB;AAAA,MAAoB;AAAA,MAAa;AAAA,IAAW,CAAC;AAAA;AAAA,IAEtF,UAAU,OAAO,OAAO,CAAC,mBAAmB,mBAAmB,CAAC;AAAA,EACpE,CAAC;AAAA,EACD,SAAS,OAAO,OAAO,EAAE,UAAU,OAAO,OAAO,CAAC,UAAU,CAAC,GAAG,UAAU,OAAO,OAAO,CAAC,CAAC,EAAE,CAAC;AAAA,EAC7F,OAAS,OAAO,OAAO,EAAE,UAAU,OAAO,OAAO,CAAC,QAAQ,OAAO,CAAC,GAAG,UAAU,OAAO,OAAO,CAAC,CAAC,EAAE,CAAC;AAAA;AAAA;AAAA,EAGlG,OAAS,OAAO,OAAO,EAAE,UAAU,OAAO,OAAO,CAAC,cAAc,CAAC,GAAG,UAAU,OAAO,OAAO,CAAC,CAAC,EAAE,CAAC;AACrG,CAAC;AAYM,SAAS,mBAAmB,MAAM,KAAK;AAC1C,QAAM,OAAO,cAAc,IAAI;A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MAAM,SAAS,EAAE,aAAa,MAAM,GAAG,KAAK,CAAC;AACnD,QAAI,CAAC,IAAK;AACV,UAAM,SAAS,IAAI,aAAa,cACxB,EAAE,aAAa,QAAQ,KAAK,IAAI,YAAY,MAAM,YACnD,IAAI,WAAW,OAAO,KACtB,EAAE,WAAW;AACpB,QAAI,CAAC,OAAQ;AACb,MAAE,eAAe;AACjB,SAAK,IAAI,IAAI;AAAA,EACjB;AAEA,QAAM,aAAa,SAAS,KAAK,MAAM,QAAQ,UAAU;AACrD,UAAM,MAAM,QAAQ,OAAO,OAAO,SAAS,MAAM,KAAK,CAAC;AACvD,QAAI,QAAQ,IAAI,aAAa,aAAa,IAAI,WAAW,OAAO,IAAI;AAChE,WAAK,IAAI,IAAI;AACb,aAAO;AAAA,IACX;AACA,WAAO,WAAW,KAAK,GAAG,MAAM,QAAQ,QAAQ;AAAA,EACpD;AAEA,IAAE,iBAAiB,SAAS,OAAO;AACnC,IAAE,iBAAiB,YAAY,OAAO;AACtC,IAAE,OAAO;AAET,SAAO;AAAA,IACH,UAAU;AACN,QAAE,oBAAoB,SAAS,OAAO;AACtC,QAAE,oBAAoB,YAAY,OAAO;AACzC,UAAI,EAAE,SAAS,WAAY,GAAE,OAAO;AAAA,IACxC;AAAA,EACJ;AACJ;",
|
|
3
|
+
"sources": ["../src/host/host.js", "../src/host/pywebview_host.js", "../src/host/photino_host.js", "../src/host/external_links.js", "../src/host/file_picker.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * host.js \u2014 the host port.\n *\n * The framework declares what it needs from its embedder. A Host is a bag of\n * INDEPENDENTLY OPTIONAL capability objects:\n *\n * - absent capability => absent key (never a stub)\n * - present capability => must be complete (validated at boot)\n *\n * There is NO module-level default host and NO getHost(). Hosts are injected \u2014\n * a module singleton here would just be `window.pywebview` wearing a hat, and\n * would make a second host (mock, browser tab, VS Code webview) impossible.\n *\n * Zero pywebview. Zero EcoAgent. See pywebview_host.js for the reference\n * adapter that implements this port against the pywebview / HTTP transports.\n */\n\nexport const HOST_CONTRACT = Object.freeze({\n window: Object.freeze({\n required: Object.freeze(['chrome', 'minimize', 'close', 'isMaximized', 'setMaximized',\n 'isFullscreen', 'toggleFullscreen', 'getBounds', 'setBounds']),\n // `chrome()` answers 'native' or 'custom', or a promise of one.\n optional: Object.freeze(['startNativeDrag', 'startNativeResize']),\n }),\n // `openFile({accept, kind, encoding})` answers {ok: true, name, path?, text | data},\n // {ok: false, cancelled: true}, {ok: false, error}, or null when there is\n // no dialog behind it. Optional: pickFile() (file_picker.js) falls back to\n // the browser's file chooser without it.\n dialogs: Object.freeze({ required: Object.freeze(['saveFile']), optional: Object.freeze(['openFile']) }),\n state: Object.freeze({ required: Object.freeze(['read', 'write']), optional: Object.freeze([]) }),\n // `openExternal(url)` hands a web address to the OS's default browser and\n // resolves true when it did. See external_links.js.\n shell: Object.freeze({ required: Object.freeze(['openExternal']), optional: Object.freeze([]) }),\n // `list(kind)` answers the starter entries `[{id, kind, label, description?,\n // fields?}]` for one kind (every kind when `kind` is null), or a promise of\n // them. Backs mountGalleryPicker() when it is given no `entries`.\n gallery: Object.freeze({ required: Object.freeze(['list']), optional: Object.freeze([]) }),\n});\n\n/**\n * Validate ONE capability object. We validate the capability the adapter\n * authored \u2014 a plain object literal with real closures \u2014 not the raw bridge:\n * `index.html`'s browser-mode polyfill installs a `new Proxy({}, {get})` that\n * returns a function for EVERY property name, so duck-typing the bridge is\n * vacuously true and validates nothing. A Proxy cannot forge a missing key in\n * an object literal.\n *\n * @returns {{ ok: boolean, missing: string[] }}\n */\nexport function validateCapability(name, cap) {\n const spec = HOST_CONTRACT[name];\n if (!spec) return { ok: false, missing: [`unknown capability '${name}'`] };\n if (!cap || typeof cap !== 'object') return { ok: false, missing: [...spec.required] };\n const missing = spec.required.filter((m) => typeof cap[m] !== 'function');\n return { ok: missing.length === 0, missing };\n}\n\n/**\n * Validate + freeze a set of capabilities into a Host.\n * Throws at boot on an incomplete capability \u2014 a half-wired host is a bug,\n * and a bug at boot beats a silent degrade at click time.\n *\n * @param {{ window?: object, dialogs?: object, state?: object, shell?: object, gallery?: object }} caps\n * @returns {Readonly<object>} the Host\n */\nexport function createHost(caps = {}) {\n const host = {};\n for (const name of Object.keys(HOST_CONTRACT)) {\n const cap = caps[name];\n if (cap == null) continue; // legitimately absent\n const v = validateCapability(name, cap);\n if (!v.ok) {\n throw new Error(`Host capability '${name}' is incomplete: missing ${v.missing.join(', ')}`);\n }\n host[name] = Object.freeze(cap);\n }\n return Object.freeze(host);\n}\n\n/** The zero-capability host. Every framework consumer MUST survive it. */\nexport const NULL_HOST = createHost({});\n", "/**\n * pywebview_host.js \u2014 the REFERENCE host adapter.\n *\n * Knows pywebview. Knows NOTHING about EcoAgent: every domain fact (which\n * bridge ref to use, where a state key lands on disk) arrives as a parameter.\n * This is the adapter a standalone consumer copies; EcoAgent is just its first\n * caller (see ui/js/bootstrap/app_bootstrap.js).\n *\n * It speaks to whatever `window.pywebview.api` currently is \u2014 the real\n * pywebview bridge in the desktop app, or the `POST /api/<method>` Proxy\n * polyfill that ui/index.html installs in --browser mode. Both transports are\n * positional-on-the-wire, which is why setBounds() spreads its object back out\n * into positional args.\n */\n\nimport { createHost } from './host.js';\n\nconst FRAMELESS_BACKENDS = new Set(['edgechromium', 'mshtml']);\n\n/**\n * Custom (frameless) window chrome \u2014 the min/max/close buttons, edge resize\n * handles and drag-to-move top bar \u2014 only makes sense when our top bar IS the\n * window's title bar. That holds on a native pywebview window the OS draws\n * *without* decorations of its own: Windows (frameless). On Linux/macOS the\n * window manager already draws a native title bar above our top bar, and in\n * `--browser` mode the browser supplies its own chrome \u2014 in both cases the\n * custom controls are a redundant second set, so we neither render nor wire\n * them (which also stops us swallowing native F11 fullscreen and showing dead\n * resize cursors at the window edges).\n *\n * Detection keys off the pywebview backend string, which is unambiguous: the\n * browser-mode polyfill in index.html injects only `.api`, never `.platform`,\n * so any `.platform` at all \u21D2 running as a native pywebview app. The frameless\n * (custom-title-bar) backends are the Windows WebViews \u2014 'edgechromium' /\n * 'mshtml'. Linux ('gtkwebkit2' / 'qtwebengine') and macOS ('cocoa') draw\n * native decorations, so they return false. Verified live: WebKitGTK reports\n * platform 'gtkwebkit2'.\n */\nexport function usesCustomWindowChrome() {\n // Authoritative signal from the Python host: run_pywebview_mode() appends\n // `?frameless=1` to the window URL exactly when it created a frameless native\n // window (Windows). Prefer it over the backend sniff below because it's\n // present at document parse \u2014 before pywebview finishes injecting\n // `window.pywebview` (and before the browser-mode polyfill, which sets `.api`\n // but no `.platform`, can clobber it). Reading the sniff at shell-build time\n // otherwise races and the whole custom chrome silently fails to render.\n try {\n if (new URLSearchParams(window.location.search).get('frameless') === '1') {\n return true;\n }\n } catch (_) { /* location unavailable (non-browser env) \u2014 fall through */ }\n const platform = window.pywebview && window.pywebview.platform;\n return !!platform && FRAMELESS_BACKENDS.has(platform);\n}\n\n/**\n * Build a Host backed by the pywebview bridge.\n *\n * @param {object} opts\n * @param {{current: object|null}} [opts.bridgeRef] LIVE ref to the bridge.\n * MUST be a ref, never a snapshot: `setupHostBridgeListener` mutates\n * `.current` when a late bridge arrives, and `resolveHostBridge` can\n * resolve `null` after its timeout. Snapshotting the bridge here would\n * freeze that null and reproduce as an intermittent boot failure.\n * @param {(key: string) => string} [opts.resolvePath] logical state key ->\n * storage path. THE domain seam: the framework only ever names keys\n * ('desktops', 'datatable_state'); the embedder decides where they land.\n * @param {object} [opts.logger]\n */\nexport function createPywebviewHost({ bridgeRef = null, resolvePath = (k) => `${k}.json`, logger = console } = {}) {\n const api = () => bridgeRef?.current ?? window.pywebview?.api ?? null;\n\n const call = async (name, args = []) => {\n const a = api();\n if (!a || typeof a[name] !== 'function') return null;\n try { return await a[name](...args); }\n catch (e) { logger.warn?.('[host] call failed', name, e); return null; }\n };\n\n // Envelope unwrapping, in ONE place. Transcribed from the call sites this\n // replaces, so app.py's catch-all `{ok: true}` reply (which carries no\n // `maximized` key) still reads as false, exactly as it does today.\n const okMax = (r) => Boolean(r && r.ok && r.maximized === true);\n const okFs = (r) => Boolean(r && r.ok && r.fullscreen);\n\n // ALL THREE capabilities are ALWAYS advertised. Do NOT gate them on api()\n // being non-null at construction time: the methods late-bind through the\n // ref, and gating here would permanently strand a late-arriving bridge on\n // the fallback paths (Blob download instead of the native save dialog).\n return createHost({\n window: {\n chrome: () => (usesCustomWindowChrome() ? 'custom' : 'native'),\n minimize: () => { void call('window_minimize'); },\n close: () => { void call('window_close'); },\n isMaximized: async () => okMax(await call('window_is_maximized')),\n setMaximized: async (on) => okMax(await call('window_set_maximized', [on])),\n isFullscreen: async () => okFs(await call('window_is_fullscreen')),\n toggleFullscreen: async () => okFs(await call('window_toggle_fullscreen')),\n async getBounds() {\n const r = await call('window_get_bounds');\n if (!r || !r.ok) return null;\n return { x: r.x, y: r.y, width: r.width, height: r.height };\n },\n // POSITIONAL on the wire \u2014 both transports depend on it. Not async:\n // this is a rAF hot path during a window drag/resize; nobody awaits.\n setBounds({ x = null, y = null, width = null, height = null } = {}) {\n void call('window_set_bounds', [x, y, width, height]);\n },\n startNativeDrag: async () => Boolean((await call('window_start_native_drag'))?.ok),\n },\n dialogs: {\n // Resolves to null when the transport has no save_file_dialog behind it.\n // Per host.js that is the contract for \"unavailable\", and every caller\n // treats it exactly like an absent `dialogs` capability: fall back to a\n // Blob download, never report a failed save. Covered by\n // tests/ui/test_host_save_fallback.mjs.\n saveFile: ({ data, filename, kind }) => call('save_file_dialog', [data, filename, kind]),\n // POSITIONAL on the wire like save_file_dialog: read_file_dialog(accept,\n // kind, encoding), where `accept` is a list of extensions or MIME types\n // (may be empty), `kind` a label for the filter or null, and `encoding`\n // 'text' or 'base64'. The reply is openFile's result shape (host.js);\n // null when the transport has no read_file_dialog, and pickFile() then\n // opens the browser's file chooser instead. See the README host contract.\n async openFile({ accept = [], kind = null, encoding = 'text' } = {}) {\n const r = await call('read_file_dialog', [accept, kind, encoding]);\n return r && typeof r === 'object' ? r : null;\n },\n },\n state: {\n async read(key) {\n const blob = await call('workspace_state_read', [{ path: resolvePath(key) }]);\n if (!blob) return null;\n try { return typeof blob === 'string' ? JSON.parse(blob) : blob; }\n catch (e) { logger.warn?.('[host] bad JSON for state key', key, e); return null; }\n },\n async write(key, value) {\n const r = await call('workspace_state_write',\n [{ path: resolvePath(key), data: JSON.stringify(value) }]);\n return r !== null;\n },\n },\n });\n}\n", "/**\n * photino_host.js \u2014 the host port over a Photino.NET window.\n *\n * Photino gives the page exactly two things: `window.external.sendMessage(text)`\n * and `window.external.receiveMessage(callback)`. Strings in, strings out, no\n * replies. This adapter puts a request/reply protocol over them, matched by id:\n *\n * page \u2192 host {\"id\": 7, \"cap\": \"window\", \"op\": \"setBounds\", \"args\": [{\"x\":0,\"y\":0,\"width\":1200,\"height\":800}]}\n * host \u2192 page {\"id\": 7, \"ok\": true, \"value\": null}\n * host \u2192 page {\"id\": 8, \"ok\": false, \"error\": \"no such op\"}\n * host \u2192 page {\"event\": \"window.maximizedChanged\", \"value\": true} // unsolicited, no id\n *\n * and offers the port's `window`, `dialogs` and `state` capabilities on top.\n * The C# side \u2014 one dispatcher on the window's web-message handler, every op\n * with its args and reply \u2014 is documented in `photino_host.md` beside this file.\n *\n * Like pywebview_host.js it knows the transport and NOTHING about the app: an\n * embedder that keeps some capability elsewhere (BugDesk keeps `state` on its\n * own server) passes that capability in, or `null` to leave it out.\n *\n * In a browser tab there is no `window.external.sendMessage`, and\n * createPhotinoHost() returns NULL_HOST \u2014 the fallback every FlexDesk consumer\n * already has to survive.\n */\n\nimport { createHost, NULL_HOST } from './host.js';\n\n/** True when `ext` (default: `window.external`) is a Photino bridge. */\nexport function isPhotinoWindow(ext = (typeof window !== 'undefined' ? window.external : undefined)) {\n return !!ext && typeof ext.sendMessage === 'function' && typeof ext.receiveMessage === 'function';\n}\n\n/**\n * The bare request/reply layer. `call(cap, op, ...args)` sends one request and\n * resolves with the reply's `value` (`request(cap, op, args, {wait})` is the\n * same with a timeout of its own). It REJECTS when the host answers\n * `ok: false` (with the host's error) and when no reply arrives within\n * `timeoutMs`. A reply for an id nobody is waiting on, a message that is not\n * JSON, and anything that is neither a reply nor an event are dropped.\n *\n * @param {object} opts\n * @param {{sendMessage: Function, receiveMessage: Function}} opts.external\n * @param {number} [opts.timeoutMs=10000]\n * @param {(name: string, value: any) => void} [opts.onEvent] id-less `{event, value}` messages\n * @param {object} [opts.logger]\n */\nexport function createPhotinoTransport({ external, timeoutMs = 10000, onEvent = null, logger = console }) {\n const pending = new Map();\n let seq = 0;\n external.receiveMessage((text) => {\n let m;\n try { m = typeof text === 'string' ? JSON.parse(text) : text; } catch { return; }\n if (!m || typeof m !== 'object') return;\n if (m.id == null) {\n if (typeof m.event === 'string' && onEvent) {\n try { onEvent(m.event, m.value); }\n catch (e) { logger.warn?.('[host] photino event handler failed', m.event, e); }\n }\n return;\n }\n const p = pending.get(m.id);\n if (!p) return;\n pending.delete(m.id);\n clearTimeout(p.timer);\n if (m.ok) p.resolve(m.value === undefined ? null : m.value);\n else p.reject(new Error(m.error || `${p.what}: refused by the host`));\n });\n // `wait` is this request's timeout in ms; 0 waits for as long as it takes.\n const request = (cap, op, args = [], { wait = timeoutMs } = {}) => new Promise((resolve, reject) => {\n const id = ++seq;\n const what = `${cap}.${op}`;\n const timer = wait > 0 ? setTimeout(() => {\n if (pending.delete(id)) reject(new Error(`${what}: no answer from the host within ${wait} ms`));\n }, wait) : null;\n pending.set(id, { resolve, reject, timer, what });\n try {\n external.sendMessage(JSON.stringify({ id, cap, op, args }));\n } catch (e) {\n pending.delete(id);\n clearTimeout(timer);\n reject(e);\n }\n });\n const call = (cap, op, ...args) => request(cap, op, args);\n return { call, request, pending: () => pending.size };\n}\n\n/**\n * Build a Host backed by a Photino window.\n *\n * The capability methods follow pywebview_host.js's contract, so a consumer\n * cannot tell the two apart: they DEGRADE instead of rejecting. A failed query\n * reads as false / null, a failed fire-and-forget is logged, and a save that\n * the host refused or never answered resolves `null` \u2014 the host.js meaning of\n * \"unavailable\", which every caller turns into a Blob download.\n *\n * @param {object} [opts]\n * @param {object} [opts.external=window.external] the Photino bridge (a fake one in tests)\n * @param {number} [opts.timeoutMs=10000]\n * @param {(name: string, value: any) => void} [opts.onEvent]\n * @param {object} [opts.logger=console]\n * @param {'auto'|'native'|'custom'} [opts.chrome='auto'] who draws the window's\n * title bar and borders. `auto` asks the native side once (`host.describe`,\n * its `frame` field), the first time somebody needs to know; `native`\n * or `custom` fixes the answer without asking. See photino_host.md.\n * @param {object|null} [opts.window] replace the window capability, or `null` to leave it out\n * @param {object|null} [opts.dialogs] replace the dialogs capability, or `null` to leave it out\n * @param {object|null} [opts.state] replace the state capability, or `null` to leave it out\n * @param {object|null} [opts.shell] replace the shell capability, or `null` to leave it out\n * @returns {Readonly<object>} a Host, or NULL_HOST outside a Photino window\n */\nexport function createPhotinoHost(opts = {}) {\n const {\n external = (typeof window !== 'undefined' ? window.external : undefined),\n timeoutMs = 10000,\n onEvent = null,\n logger = console,\n chrome = 'auto',\n } = opts;\n if (!isPhotinoWindow(external)) return NULL_HOST;\n\n const { call, request } = createPhotinoTransport({ external, timeoutMs, onEvent, logger });\n const warn = (cap, op, e) => logger.warn?.('[host] photino call failed', `${cap}.${op}`, e);\n const soft = async (fallback, cap, op, ...args) => {\n try { return await call(cap, op, ...args); }\n catch (e) { warn(cap, op, e); return fallback; }\n };\n const fire = (cap, op, ...args) => { void soft(null, cap, op, ...args); };\n\n // Who draws the frame. Asked once and remembered: a string once known, the\n // pending question before that. A native side that predates `frame`, or\n // doesn't answer within 3 s, has native chrome.\n let frame = chrome === 'custom' || chrome === 'native' ? chrome : null;\n let asking = null;\n const askFrame = () => {\n if (frame) return frame;\n asking ??= request('host', 'describe', [], { wait: 3000 })\n .then((d) => (d && d.frame === 'custom' ? 'custom' : 'native'), () => 'native')\n .then((f) => { frame = f; return f; });\n return asking;\n };\n // A drag or resize handed to the OS: the reply comes when the mouse is\n // released, however long that takes. Refused (a native side without the op,\n // or a window with native chrome) means \"not handled\": the caller does it in JS.\n const gesture = async (op, ...args) => {\n try { await request('window', op, args, { wait: 0 }); return true; }\n catch (e) { return false; }\n };\n\n const defaults = {\n window: {\n // 'native' (the OS draws the frame: FlexDesk's own buttons would be\n // a second set) or 'custom' (the native side made the window\n // frameless). A promise until the native side has said which.\n chrome: () => askFrame(),\n minimize: () => { fire('window', 'minimize'); },\n close: () => { fire('window', 'close'); },\n isMaximized: async () => (await soft(false, 'window', 'isMaximized')) === true,\n setMaximized: async (on) => (await soft(false, 'window', 'setMaximized', !!on)) === true,\n isFullscreen: async () => (await soft(false, 'window', 'isFullscreen')) === true,\n toggleFullscreen: async () => (await soft(false, 'window', 'toggleFullscreen')) === true,\n async getBounds() {\n const b = await soft(null, 'window', 'getBounds');\n if (!b || typeof b !== 'object') return null;\n return { x: b.x, y: b.y, width: b.width, height: b.height };\n },\n startNativeDrag: () => gesture('startDrag'),\n startNativeResize: (edge) => gesture('startResize', String(edge || '')),\n // Not async, like pywebview's: a rAF hot path during a drag; nobody awaits.\n setBounds({ x = null, y = null, width = null, height = null } = {}) {\n fire('window', 'setBounds', { x, y, width, height });\n },\n },\n dialogs: {\n // `{ok: true, path}` | `{ok: false, cancelled: true}` | `{ok: false, error}`,\n // or null when the host refused: fall back to a download. NO TIMEOUT \u2014\n // the dialog is open for as long as the user takes, and giving up on it\n // would download the file a second time behind the dialog.\n async saveFile({ data, filename, kind } = {}) {\n let r = null;\n try { r = await request('dialogs', 'saveFile', [{ data, filename, kind }], { wait: 0 }); }\n catch (e) { warn('dialogs', 'saveFile', e); }\n return r && typeof r === 'object' ? r : null;\n },\n // `{ok: true, name, path?, text | data}` | `{ok: false, cancelled: true}` |\n // `{ok: false, error}`, or null when the host refused: pickFile() then\n // opens the browser's chooser. No timeout, for the same reason as saveFile.\n async openFile({ accept = [], kind = null, encoding = 'text' } = {}) {\n let r = null;\n try { r = await request('dialogs', 'openFile', [{ accept, kind, encoding }], { wait: 0 }); }\n catch (e) { warn('dialogs', 'openFile', e); }\n return r && typeof r === 'object' ? r : null;\n },\n },\n shell: {\n // True when the native side opened it in the system browser; false\n // when it refused (a scheme it won't open, an older native side\n // without the op): the caller falls back to window.open.\n openExternal: async (url) => (await soft(false, 'shell', 'openExternal', String(url || ''))) === true,\n },\n state: {\n async read(key) {\n const v = await soft(null, 'state', 'read', key);\n if (typeof v !== 'string') return v ?? null;\n try { return JSON.parse(v); }\n catch (e) { logger.warn?.('[host] bad JSON for state key', key, e); return null; }\n },\n async write(key, value) {\n return (await soft(false, 'state', 'write', key, value)) !== false;\n },\n },\n };\n\n const caps = {};\n for (const name of Object.keys(defaults)) {\n if (!(name in opts)) caps[name] = defaults[name];\n else if (opts[name] != null) caps[name] = opts[name];\n }\n return createHost(caps);\n}\n", "/**\n * external_links.js \u2014 links that leave the app open in the system browser.\n *\n * In a browser tab, `target=\"_blank\"` and `window.open()` open a new tab, which\n * is what everyone expects. In a native window (Photino, a webview) they open\n * either nothing or a bare popup with no address bar and no way back. The host\n * knows how to hand a URL to the OS (`host.shell.openExternal`); this routes\n * the page's outbound links there.\n *\n * Without a `shell` capability it changes nothing, so an app can call it\n * unconditionally at boot: in a browser tab it is a no-op.\n */\n\nconst SCHEMES = new Set(['http:', 'https:', 'mailto:']);\n\n/** The URL as an absolute URL when it is one we would send out, else null. */\nfunction outbound(href, base) {\n let url;\n try { url = new URL(String(href), base); } catch { return null; }\n return SCHEMES.has(url.protocol) ? url : null;\n}\n\n/**\n * Send external link clicks and `window.open` calls to `host.shell.openExternal`.\n *\n * A link goes out when it is http(s) or mailto AND it has `target=\"_blank\"`,\n * points to another origin, or is mailto. A same-origin link without a target\n * is the app's own navigation and is left alone; a same-origin `_blank` goes\n * out too, because in a native window the alternative is a bare popup. A\n * handler that already called `preventDefault()` on the click keeps it.\n *\n * When `openExternal` resolves false (the native side refused it), the original\n * `window.open` runs instead, so the click still does something.\n *\n * @param {object} opts\n * @param {object} opts.host a Host; does nothing without `host.shell`\n * @param {EventTarget} [opts.root=document] where clicks are listened for\n * @param {Window} [opts.win=window] whose `open` is wrapped\n * @returns {{ dispose: () => void }}\n */\nexport function routeExternalLinks({ host, root, win } = {}) {\n const w = win ?? (typeof window !== 'undefined' ? window : null);\n const r = root ?? (typeof document !== 'undefined' ? document : null);\n const shell = host?.shell;\n if (!shell || typeof shell.openExternal !== 'function' || !w || !r) return { dispose() {} };\n\n const base = () => w.location?.href;\n const origin = () => { try { return new URL(base()).origin; } catch { return null; } };\n const nativeOpen = w.open;\n const fallback = (href) => { try { nativeOpen?.call(w, href, '_blank', 'noopener'); } catch { /* blocked */ } };\n const send = (href) => {\n Promise.resolve()\n .then(() => shell.openExternal(href))\n .then((opened) => { if (opened !== true) fallback(href); }, () => fallback(href));\n };\n\n const onClick = (e) => {\n if (e.defaultPrevented) return;\n // Left click, or a middle click (auxclick): both open a new window.\n if (e.type === 'click' ? e.button !== 0 : e.button !== 1) return;\n const a = e.target?.closest?.('a[href]');\n if (!a || a.hasAttribute('download')) return;\n const url = outbound(a.getAttribute('href'), base());\n if (!url) return;\n const leaves = url.protocol === 'mailto:'\n || (a.getAttribute('target') || '').toLowerCase() === '_blank'\n || url.origin !== origin()\n || e.button === 1;\n if (!leaves) return;\n e.preventDefault();\n send(url.href);\n };\n\n const routedOpen = function open(href, target, features) {\n const url = href == null ? null : outbound(href, base());\n if (url && (url.protocol === 'mailto:' || url.origin !== origin())) {\n send(url.href);\n return null;\n }\n return nativeOpen.call(w, href, target, features);\n };\n\n r.addEventListener('click', onClick);\n r.addEventListener('auxclick', onClick);\n w.open = routedOpen;\n\n return {\n dispose() {\n r.removeEventListener('click', onClick);\n r.removeEventListener('auxclick', onClick);\n if (w.open === routedOpen) w.open = nativeOpen;\n },\n };\n}\n", "/**\n * file_picker.js \u2014 let the user choose a file to open, and read it.\n *\n * A native window (pywebview, Photino) offers a real open dialog through the\n * optional `host.dialogs.openFile` capability; a browser tab has none. pickFile()\n * asks the host first and, when the host has no `openFile` or answers null\n * (\"no dialog behind it\", per host.js), opens the browser's own file chooser\n * through a transient `<input type=\"file\">`. The caller gets ONE result shape\n * either way:\n *\n * {ok: true, name, path?, text} encoding 'text' (the default)\n * {ok: true, name, path?, data} encoding 'base64': the file's bytes, base64\n * {ok: false, cancelled: true} the user closed the chooser: say nothing\n * {ok: false, error} show it to the user\n *\n * `path` comes only from a native host; a browser never reveals one.\n */\n\nconst ENCODINGS = new Set(['text', 'base64']);\n\n/**\n * `accept` as a list of extensions or MIME types: an array is kept, a string\n * is split on commas (the `<input accept>` form), each entry trimmed and the\n * empty ones dropped. `'.json, .csv'` \u2192 `['.json', '.csv']`.\n */\nfunction acceptList(accept) {\n const parts = Array.isArray(accept) ? accept : (accept ? String(accept).split(',') : []);\n return parts.map((a) => String(a).trim()).filter(Boolean);\n}\n\n/** `accept` as the `<input accept>` attribute wants it: comma-separated. */\nfunction acceptAttr(accept) {\n return acceptList(accept).join(',');\n}\n\n/** Read `file` as text or as base64, with the FileReader of the file's own window. */\nfunction readFile(file, encoding, FileReaderCtor) {\n return new Promise((resolve) => {\n const reader = new FileReaderCtor();\n reader.onload = () => {\n const name = file.name;\n if (encoding === 'base64') {\n const url = String(reader.result ?? '');\n resolve({ ok: true, name, data: url.slice(url.indexOf(',') + 1) });\n } else {\n resolve({ ok: true, name, text: String(reader.result ?? '') });\n }\n };\n reader.onerror = () => resolve({ ok: false, error: String(reader.error?.message || reader.error || 'The file could not be read.') });\n if (encoding === 'base64') reader.readAsDataURL(file);\n else reader.readAsText(file);\n });\n}\n\n/**\n * The browser's file chooser: a hidden `<input type=\"file\">`, clicked, removed\n * again once it answers. Cancelling is the input's `cancel` event (every\n * current engine fires it; an engine that does not leaves the promise pending\n * until the user does choose a file).\n */\nfunction browserChooser({ accept, encoding, doc }) {\n const FileReaderCtor = doc?.defaultView?.FileReader ?? globalThis.FileReader;\n if (!doc?.body || typeof FileReaderCtor !== 'function') {\n return Promise.resolve({ ok: false, error: 'No file chooser is available here.' });\n }\n return new Promise((resolve) => {\n const input = doc.createElement('input');\n input.type = 'file';\n const a = acceptAttr(accept);\n if (a) input.accept = a;\n input.style.display = 'none';\n let done = false;\n const finish = (result) => {\n if (done) return;\n done = true;\n input.removeEventListener('change', onChange);\n input.removeEventListener('cancel', onCancel);\n input.remove();\n resolve(result);\n };\n const onChange = () => {\n const file = input.files && input.files[0];\n if (!file) { finish({ ok: false, cancelled: true }); return; }\n readFile(file, encoding, FileReaderCtor).then(finish);\n };\n const onCancel = () => finish({ ok: false, cancelled: true });\n input.addEventListener('change', onChange);\n input.addEventListener('cancel', onCancel);\n doc.body.appendChild(input);\n input.click();\n });\n}\n\n/**\n * Let the user choose one file and read it.\n *\n * @param {object} host a Host; its optional `dialogs.openFile` is asked first\n * @param {object} [opts]\n * @param {string[]|string} [opts.accept] extensions or MIME types, e.g. ['.json', '.csv'];\n * a string is comma-separated ('.json,.csv'). The\n * native host always receives the list.\n * @param {string|null} [opts.kind] a label for the native dialog's filter (e.g. 'json')\n * @param {'text'|'base64'} [opts.encoding='text'] text, or the bytes as base64\n * @param {Document} [opts.document] where the browser chooser goes (default: the page's)\n * @returns {Promise<{ok: true, name: string, path?: string, text?: string, data?: string}\n * | {ok: false, cancelled: true} | {ok: false, error: string}>}\n */\nexport async function pickFile(host, { accept = [], kind = null, encoding = 'text', document: doc } = {}) {\n if (!ENCODINGS.has(encoding)) throw new TypeError(`pickFile: unknown encoding '${encoding}' (use 'text' or 'base64')`);\n if (typeof host?.dialogs?.openFile === 'function') {\n let r = null;\n try { r = await host.dialogs.openFile({ accept: acceptList(accept), kind, encoding }); }\n catch { r = null; } // a failing host degrades like an absent one\n if (r && typeof r === 'object') return r;\n }\n return browserChooser({ accept, encoding, doc: doc ?? (typeof document !== 'undefined' ? document : null) });\n}\n"],
|
|
5
|
+
"mappings": ";;;AAiBO,IAAM,gBAAgB,OAAO,OAAO;AAAA,EACvC,QAAQ,OAAO,OAAO;AAAA,IAClB,UAAU,OAAO,OAAO;AAAA,MAAC;AAAA,MAAU;AAAA,MAAY;AAAA,MAAS;AAAA,MAAe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