@dosgato/dialog 0.0.24 → 0.0.25

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.
@@ -50,6 +50,6 @@ export declare class ChooserStore<F = any> extends Store<IAssetStore> {
50
50
  init(options: ChooserStoreOptions<F>): Promise<void>;
51
51
  setPreview(item?: AnyItem): void;
52
52
  clearPreview(): void;
53
- setSource(name: string, init?: boolean): void;
53
+ setSource(name?: string, init?: boolean): void;
54
54
  }
55
55
  export {};
@@ -1,6 +1,6 @@
1
1
  import { Store, derivedStore } from '@txstate-mws/svelte-store';
2
2
  import { tick } from 'svelte';
3
- import { findIndex } from 'txstate-utils';
3
+ import { findIndex, isBlank } from 'txstate-utils';
4
4
  export const CHOOSER_STORE_CONTEXT = {};
5
5
  const nofilter = (x) => true;
6
6
  export function combinePath(path, name) {
@@ -71,6 +71,7 @@ export class ChooserStore extends Store {
71
71
  this.update(v => {
72
72
  if (!v.initialized && !init)
73
73
  return v;
74
+ name ??= [...(v.sources?.page ?? []), ...(v.sources?.asset ?? [])].filter(s => this.options.activeSources ? this.options.activeSources.has(s.name) : true)[0].name;
74
75
  const pageSource = v.sources?.page.findIndex(s => s.name === name);
75
76
  const assetSource = v.sources?.asset.findIndex(s => s.name === name);
76
77
  if (pageSource >= 0)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dosgato/dialog",
3
3
  "description": "A component library for building forms that edit a JSON document.",
4
- "version": "0.0.24",
4
+ "version": "0.0.25",
5
5
  "dependencies": {
6
6
  "@txstate-mws/svelte-components": "^1.3.5",
7
7
  "@txstate-mws/svelte-forms": "^1.1.2",