sliftutils 0.68.0 → 0.70.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/.cursorrules CHANGED
@@ -114,6 +114,23 @@ Components
114
114
  URLParam, Parameters which are stored in the URL. The second argument is the default, which can be a number, string, or an object. Set and get with .value
115
115
  const todolistURL = new URLParam("todolist", "");
116
116
 
117
+ InputLabel and InputLabelURL should be used for inputs. For example:
118
+ <InputLabelURL
119
+ label="Show Previous Video"
120
+ checkbox
121
+ persisted={showPreviousVideoURL}
122
+ />
123
+ <InputLabel
124
+ label="Notes"
125
+ fillWidth
126
+ value={node.notes || ""}
127
+ onChangeValue={async (value) => {
128
+ const updatedNode = deepCloneJSON(node);
129
+ updatedNode.notes = value;
130
+ await VideoNode.set(node.id, updatedNode);
131
+ }}
132
+ />
133
+
117
134
  API Calls
118
135
  When in an event callback (which must be async)
119
136
  APIController(getExtNodeId()).getModels.promise()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sliftutils",
3
- "version": "0.68.0",
3
+ "version": "0.70.0",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -9,6 +9,9 @@ export class Anchor extends preact.Component<{
9
9
  } & Omit<preact.JSX.HTMLAttributes<HTMLAnchorElement>, "href">> {
10
10
  render() {
11
11
  const { params, button, className, ...remaining } = this.props;
12
+ if (params.length === 0) {
13
+ return <span {...remaining}>{this.props.children}</span>;
14
+ }
12
15
  let resolvedParams = params.map(getResolvedParam);
13
16
  let searchObj = new URLSearchParams(window.location.search);
14
17
  let selected = resolvedParams.every(([param, value], index) => {
@@ -112,7 +112,7 @@ export class TransactionStorage implements IStorage<Buffer> {
112
112
  this.resyncCallbacks.push(callback);
113
113
  }
114
114
 
115
- private init: Promise<unknown> | undefined = this.loadAllTransactions();
115
+ private init: Promise<unknown> | undefined = this.loadAllTransactions(true);
116
116
 
117
117
  private getCurrentChunk(): string {
118
118
  if (this.currentChunk && this.currentChunk.timeCreated < Date.now() - FILE_MAX_LIFETIME) {
@@ -285,10 +285,10 @@ export class TransactionStorage implements IStorage<Buffer> {
285
285
 
286
286
 
287
287
  // NOTE: This is either called in init (which blocks all other calls), or inside of the global file lock, so it is safe to load.
288
- private async loadAllTransactions(): Promise<string[]> {
288
+ private async loadAllTransactions(initialLoad?: boolean): Promise<string[]> {
289
289
  if (isInBuild()) return [];
290
290
 
291
- if (this.init) {
291
+ if (initialLoad) {
292
292
  runInfinitePoll(DISK_CHECK_INTERVAL, () => this.checkDisk());
293
293
  }
294
294