@perspective-dev/viewer 5.5.0 → 5.5.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/dist/cdn/perspective-viewer.js +1 -1
- package/dist/cdn/perspective-viewer.js.map +1 -1
- package/dist/css/monokai.css +1 -1
- package/dist/css/themes.css +1 -1
- package/dist/css/vaporwave.css +1 -1
- package/dist/docs/perspective-docs.json +1 -1
- package/dist/esm/perspective-viewer.inline.js +3 -3
- package/dist/esm/perspective-viewer.inline.js.map +2 -2
- package/dist/esm/perspective-viewer.js +1 -1
- package/dist/esm/perspective-viewer.js.map +1 -1
- package/dist/esm/ts-rs/ExportMethod.d.ts +1 -1
- package/dist/wasm/perspective-viewer.d.ts +27 -16
- package/dist/wasm/perspective-viewer.js +112 -101
- package/dist/wasm/perspective-viewer.wasm +0 -0
- package/dist/wasm/perspective-viewer.wasm.d.ts +16 -16
- package/package.json +7 -7
- package/src/rust/components/export_dropdown.rs +6 -0
- package/src/rust/components/status_bar.rs +12 -3
- package/src/rust/components/viewer/filters.rs +2 -2
- package/src/rust/components/viewer/msg.rs +4 -0
- package/src/rust/components/viewer/panels.rs +3 -3
- package/src/rust/components/viewer/wiring.rs +4 -1
- package/src/rust/components/viewer.rs +2 -2
- package/src/rust/config/export_method.rs +24 -0
- package/src/rust/custom_elements/viewer.rs +21 -17
- package/src/rust/session/metadata.rs +5 -10
- package/src/rust/session.rs +123 -116
- package/src/rust/tasks/copy_export.rs +67 -0
- package/src/rust/tasks/create_panel.rs +13 -13
- package/src/rust/tasks/pipeline.rs +8 -1
- package/src/rust/tasks/restore_panel.rs +15 -15
- package/src/rust/tasks/sync_update_panels.rs +3 -3
- package/src/rust/utils/in_flight.rs +74 -0
- package/src/rust/utils/mod.rs +2 -0
- package/src/rust/utils/pending_effects.rs +6 -30
- package/src/themes/monokai.css +1 -1
- package/src/themes/vaporwave.css +1 -1
- package/src/ts/ts-rs/ExportMethod.ts +1 -1
- /package/dist/wasm/snippets/{perspective-viewer-ea71a3990cad35d7 → perspective-viewer-6813b568219c6763}/inline0.js +0 -0
- /package/dist/wasm/snippets/{perspective-viewer-ea71a3990cad35d7 → perspective-viewer-6813b568219c6763}/inline1.js +0 -0
- /package/dist/wasm/snippets/{perspective-viewer-ea71a3990cad35d7 → perspective-viewer-6813b568219c6763}/inline2.js +0 -0
- /package/dist/wasm/snippets/{perspective-viewer-ea71a3990cad35d7 → perspective-viewer-6813b568219c6763}/inline3.js +0 -0
- /package/dist/wasm/snippets/{perspective-viewer-ea71a3990cad35d7 → perspective-viewer-6813b568219c6763}/inline4.js +0 -0
- /package/dist/wasm/snippets/{perspective-viewer-ea71a3990cad35d7 → perspective-viewer-6813b568219c6763}/inline5.js +0 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
|
2
|
+
// ┃ ██████ ██████ ██████ █ █ █ █ █ █▄ ▀███ █ ┃
|
|
3
|
+
// ┃ ▄▄▄▄▄█ █▄▄▄▄▄ ▄▄▄▄▄█ ▀▀▀▀▀█▀▀▀▀▀ █ ▀▀▀▀▀█ ████████▌▐███ ███▄ ▀█ █ ▀▀▀▀▀ ┃
|
|
4
|
+
// ┃ █▀▀▀▀▀ █▀▀▀▀▀ █▀██▀▀ ▄▄▄▄▄ █ ▄▄▄▄▄█ ▄▄▄▄▄█ ████████▌▐███ █████▄ █ ▄▄▄▄▄ ┃
|
|
5
|
+
// ┃ █ ██████ █ ▀█▄ █ ██████ █ ███▌▐███ ███████▄ █ ┃
|
|
6
|
+
// ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
|
|
7
|
+
// ┃ Copyright (c) 2017, the Perspective Authors. ┃
|
|
8
|
+
// ┃ ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ ┃
|
|
9
|
+
// ┃ This file is part of the Perspective library, distributed under the terms ┃
|
|
10
|
+
// ┃ of the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0). ┃
|
|
11
|
+
// ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
|
|
12
|
+
|
|
13
|
+
use std::cell::Cell;
|
|
14
|
+
use std::rc::Rc;
|
|
15
|
+
|
|
16
|
+
use super::pubsub::PubSub;
|
|
17
|
+
|
|
18
|
+
/// A refcounted account of concurrent in-flight work, moved only by
|
|
19
|
+
/// [`InFlightGuard`]'s `Drop` so no exit path can strand the count.
|
|
20
|
+
#[derive(Clone, Default)]
|
|
21
|
+
pub struct InFlight(Rc<InFlightData>);
|
|
22
|
+
|
|
23
|
+
#[derive(Default)]
|
|
24
|
+
struct InFlightData {
|
|
25
|
+
count: Cell<u32>,
|
|
26
|
+
changed: PubSub<u32>,
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/// One unit of in-flight work, moved INTO the future it accounts for.
|
|
30
|
+
#[must_use]
|
|
31
|
+
pub struct InFlightGuard(InFlight);
|
|
32
|
+
|
|
33
|
+
impl InFlight {
|
|
34
|
+
pub fn guard(&self) -> InFlightGuard {
|
|
35
|
+
let count = self.0.count.get() + 1;
|
|
36
|
+
self.0.count.set(count);
|
|
37
|
+
self.0.changed.emit(count);
|
|
38
|
+
InFlightGuard(self.clone())
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
pub fn count(&self) -> u32 {
|
|
42
|
+
self.0.count.get()
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
pub fn is_empty(&self) -> bool {
|
|
46
|
+
self.0.count.get() == 0
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/// Fires with the ABSOLUTE [`Self::count`] on both edges, so subscribers
|
|
50
|
+
/// assign rather than accumulate.
|
|
51
|
+
pub fn changed(&self) -> &PubSub<u32> {
|
|
52
|
+
&self.0.changed
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/// Resolve once every unit in flight has settled.
|
|
56
|
+
pub async fn settle(&self) {
|
|
57
|
+
while self.0.count.get() > 0 {
|
|
58
|
+
if self.0.changed.read_next().await.is_err() {
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
impl Drop for InFlightGuard {
|
|
66
|
+
fn drop(&mut self) {
|
|
67
|
+
let data = &self.0.0;
|
|
68
|
+
let count = data.count.get();
|
|
69
|
+
debug_assert!(count > 0, "InFlight underflow");
|
|
70
|
+
let count = count.saturating_sub(1);
|
|
71
|
+
data.count.set(count);
|
|
72
|
+
data.changed.emit(count);
|
|
73
|
+
}
|
|
74
|
+
}
|
package/src/rust/utils/mod.rs
CHANGED
|
@@ -24,6 +24,7 @@ mod custom_element;
|
|
|
24
24
|
mod datetime;
|
|
25
25
|
mod debounce;
|
|
26
26
|
mod hooks;
|
|
27
|
+
mod in_flight;
|
|
27
28
|
mod local_fonts;
|
|
28
29
|
mod modal_position;
|
|
29
30
|
mod number_format;
|
|
@@ -44,6 +45,7 @@ pub use custom_element::*;
|
|
|
44
45
|
pub use datetime::*;
|
|
45
46
|
pub use debounce::*;
|
|
46
47
|
pub use hooks::*;
|
|
48
|
+
pub use in_flight::*;
|
|
47
49
|
pub use local_fonts::*;
|
|
48
50
|
pub use modal_position::*;
|
|
49
51
|
pub use number_format::*;
|
|
@@ -10,10 +10,7 @@
|
|
|
10
10
|
// ┃ of the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0). ┃
|
|
11
11
|
// ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
|
|
12
12
|
|
|
13
|
-
use
|
|
14
|
-
use std::rc::Rc;
|
|
15
|
-
|
|
16
|
-
use super::pubsub::PubSub;
|
|
13
|
+
use super::in_flight::{InFlight, InFlightGuard};
|
|
17
14
|
|
|
18
15
|
/// The element-scoped ledger of in-flight EFFECTS: every effectful public
|
|
19
16
|
/// method (and the internal flows they schedule, e.g. the `before-resize`
|
|
@@ -22,41 +19,20 @@ use super::pubsub::PubSub;
|
|
|
22
19
|
/// after the ledger drains, so "called before `flush`" implies "applied
|
|
23
20
|
/// before `flush` resolves".
|
|
24
21
|
#[derive(Clone, Default)]
|
|
25
|
-
pub struct EffectLedger(
|
|
26
|
-
|
|
27
|
-
#[derive(Default)]
|
|
28
|
-
struct EffectLedgerData {
|
|
29
|
-
count: Cell<u32>,
|
|
30
|
-
on_drain: PubSub<()>,
|
|
31
|
-
}
|
|
22
|
+
pub struct EffectLedger(InFlight);
|
|
32
23
|
|
|
33
|
-
pub
|
|
24
|
+
pub type EffectGuard = InFlightGuard;
|
|
34
25
|
|
|
35
26
|
impl EffectLedger {
|
|
36
27
|
pub fn guard(&self) -> EffectGuard {
|
|
37
|
-
self.0.
|
|
38
|
-
EffectGuard(self.clone())
|
|
28
|
+
self.0.guard()
|
|
39
29
|
}
|
|
40
30
|
|
|
41
31
|
pub fn is_empty(&self) -> bool {
|
|
42
|
-
self.0.
|
|
32
|
+
self.0.is_empty()
|
|
43
33
|
}
|
|
44
34
|
|
|
45
35
|
pub async fn settle(&self) {
|
|
46
|
-
|
|
47
|
-
if self.0.on_drain.read_next().await.is_err() {
|
|
48
|
-
break;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
impl Drop for EffectGuard {
|
|
55
|
-
fn drop(&mut self) {
|
|
56
|
-
let data = &self.0.0;
|
|
57
|
-
data.count.set(data.count.get() - 1);
|
|
58
|
-
if data.count.get() == 0 {
|
|
59
|
-
data.on_drain.emit(());
|
|
60
|
-
}
|
|
36
|
+
self.0.settle().await
|
|
61
37
|
}
|
|
62
38
|
}
|
package/src/themes/monokai.css
CHANGED
|
@@ -131,7 +131,7 @@ perspective-viewer [theme="Monokai"] {
|
|
|
131
131
|
--psp-datagrid--border-color: #444444;
|
|
132
132
|
|
|
133
133
|
/* FIXME: broken in shadow DOM */
|
|
134
|
-
regular-table table tbody th
|
|
134
|
+
regular-table table tbody th.psp-tree-spacer {
|
|
135
135
|
background: linear-gradient(
|
|
136
136
|
to right,
|
|
137
137
|
transparent 9px,
|
package/src/themes/vaporwave.css
CHANGED
|
@@ -130,7 +130,7 @@ perspective-viewer [theme="Vaporwave"] {
|
|
|
130
130
|
--psp-datagrid--hover--border-color: var(--pp-color-1) !important;
|
|
131
131
|
|
|
132
132
|
/* FIXME: broken in shadow DOM */
|
|
133
|
-
regular-table table tbody th
|
|
133
|
+
regular-table table tbody th.psp-tree-spacer {
|
|
134
134
|
background: linear-gradient(
|
|
135
135
|
to right,
|
|
136
136
|
transparent 9px,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
2
2
|
|
|
3
|
-
export type ExportMethod = "csv" | "csv-all" | "csv-selected" | "json" | "json-all" | "json-selected" | "ndjson" | "ndjson-all" | "ndjson-selected" | "html" | "plugin" | "arrow" | "arrow-selected" | "arrow-all" | "json-config";
|
|
3
|
+
export type ExportMethod = "csv" | "csv-all" | "csv-selected" | "json" | "json-all" | "json-selected" | "ndjson" | "ndjson-all" | "ndjson-selected" | "html" | "plugin" | "arrow" | "arrow-selected" | "arrow-all" | "arrow-lz4" | "arrow-lz4-selected" | "arrow-lz4-all" | "arrow-zstd" | "arrow-zstd-selected" | "arrow-zstd-all" | "json-config";
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|