querysub 0.702.0 → 0.703.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/package.json
CHANGED
package/src/4-dom/qreact.tsx
CHANGED
|
@@ -760,11 +760,11 @@ class QRenderClass {
|
|
|
760
760
|
if (equalJSON) {
|
|
761
761
|
// ALSO, we need to make sure the change WAS only because of props...
|
|
762
762
|
let changes = renderWatcher.triggeredByChanges;
|
|
763
|
-
let propsPath =
|
|
763
|
+
let propsPath = getProxyPath(() => self.data().props);
|
|
764
764
|
let onlyPropsChanges = (
|
|
765
|
-
Array.from(changes?.newParentsSynced || []).
|
|
765
|
+
!Array.from(changes?.newParentsSynced || []).some(p => p !== propsPath)
|
|
766
766
|
&& !changes?.extraReasons?.length
|
|
767
|
-
&& Array.from(changes?.paths || []).
|
|
767
|
+
&& !Array.from(changes?.paths || []).some(p => p !== propsPath)
|
|
768
768
|
);
|
|
769
769
|
if (onlyPropsChanges) {
|
|
770
770
|
proxyWatcher.reuseLastWatches();
|
|
@@ -864,6 +864,10 @@ class QRenderClass {
|
|
|
864
864
|
props = syncedData.props;
|
|
865
865
|
});
|
|
866
866
|
} else {
|
|
867
|
+
let atomicProps = statics.atomicSetProps || statics.jsonComparePropUpdates;
|
|
868
|
+
if (atomicProps) {
|
|
869
|
+
syncedData.props = vNode.props;
|
|
870
|
+
}
|
|
867
871
|
// Have each prop be a synced field, so conditional props work (accessing a prop not
|
|
868
872
|
// provided returns undefined). Atomic writes is on, so write objects
|
|
869
873
|
// aren't destructured (this allows passing functions, exotics, etc).
|
|
@@ -873,7 +877,9 @@ class QRenderClass {
|
|
|
873
877
|
if (key === "className") {
|
|
874
878
|
value = String(value);
|
|
875
879
|
}
|
|
876
|
-
|
|
880
|
+
if (!atomicProps) {
|
|
881
|
+
syncedData.props[key] = value;
|
|
882
|
+
}
|
|
877
883
|
// We then need to use a getter in the props, so that it causes a synced read
|
|
878
884
|
// UNLESS that prop is not defined, then it is just undefined
|
|
879
885
|
Object.defineProperty(props, key, {
|
|
@@ -3,8 +3,8 @@ import { css } from "typesafecss";
|
|
|
3
3
|
import { formatNumber } from "socket-function/src/formatting/format";
|
|
4
4
|
|
|
5
5
|
const FLASH_CLASS_NAME = "UsageBar-flash";
|
|
6
|
-
const
|
|
7
|
-
const SUB_BAR_ALPHA = 0.
|
|
6
|
+
const SUB_BAR_HUE = 210;
|
|
7
|
+
const SUB_BAR_ALPHA = 0.35;
|
|
8
8
|
|
|
9
9
|
export const MEMORY_WARNING_THRESHOLD = 0.7;
|
|
10
10
|
export const MEMORY_ERROR_THRESHOLD = 0.85;
|
|
@@ -56,11 +56,10 @@ export class UsageBar extends qreact.Component<{
|
|
|
56
56
|
+ (isError && (" " + FLASH_CLASS_NAME) || "")
|
|
57
57
|
} />
|
|
58
58
|
{subValue !== undefined && <div className={
|
|
59
|
-
css.absolute.pos(0,
|
|
59
|
+
css.absolute.pos(0, 0).size(`${Math.min(subFraction, 1) * 100}%`, "100%").hsla(SUB_BAR_HUE, 80, 55, SUB_BAR_ALPHA)
|
|
60
60
|
} />}
|
|
61
|
-
<div className={css.relative}>
|
|
62
|
-
{label} ({formatNumber(value)}{suffix} / {formatNumber(max)}{suffix})
|
|
63
|
-
{subValue !== undefined && <span className={css.opacity(0.75)}>, {subLabel || "sub"} {formatNumber(subValue)}{suffix}</span>}
|
|
61
|
+
<div className={css.relative} title={subValue !== undefined ? `${subLabel || "sub"} / used / total` : "used / total"}>
|
|
62
|
+
{label} ({subValue !== undefined && <span className={css.opacity(0.75)}>{formatNumber(subValue)}{suffix} / </span>}{formatNumber(value)}{suffix} / {formatNumber(max)}{suffix})
|
|
64
63
|
</div>
|
|
65
64
|
{isError && <style>{`
|
|
66
65
|
@keyframes ${FLASH_CLASS_NAME}-anim {
|