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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "querysub",
3
- "version": "0.702.0",
3
+ "version": "0.703.0",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "note1": "note on node-forge fork, see https://github.com/digitalbazaar/forge/issues/744 for details",
@@ -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 = isValueProxy2(props)!;
763
+ let propsPath = getProxyPath(() => self.data().props);
764
764
  let onlyPropsChanges = (
765
- Array.from(changes?.newParentsSynced || []).every(p => p.startsWith(propsPath))
765
+ !Array.from(changes?.newParentsSynced || []).some(p => p !== propsPath)
766
766
  && !changes?.extraReasons?.length
767
- && Array.from(changes?.paths || []).every(p => p.startsWith(propsPath))
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
- syncedData.props[key] = value;
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 SUB_BAR_HEIGHT_PERCENT = 35;
7
- const SUB_BAR_ALPHA = 0.3;
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, `${100 - SUB_BAR_HEIGHT_PERCENT}%`).size(`${Math.min(subFraction, 1) * 100}%`, `${SUB_BAR_HEIGHT_PERCENT}%`).hsla(0, 0, 0, SUB_BAR_ALPHA)
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 {