-
-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix multiple pattern occurrences on one page with context stores
- Loading branch information
Showing
8 changed files
with
150 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<script> | ||
import { getContext } from "svelte"; | ||
import ContentBrowser from "./ContentBrowser.svelte"; | ||
import SelectedItems from "./SelectedItems.svelte"; | ||
import { | ||
setConfig, | ||
setSelectedItems, | ||
setSelectedUids, | ||
setShowContentBrowser, | ||
} from "./stores"; | ||
export let maxDepth; | ||
export let basePath = ""; | ||
export let selectableTypes = []; | ||
export let maximumSelectionSize = -1; | ||
export let attributes; | ||
export let separator; | ||
export let selection = []; | ||
export let vocabularyUrl; | ||
export let fieldId; | ||
// initialize context stores | ||
setConfig(); | ||
setSelectedItems(); | ||
setShowContentBrowser(); | ||
setSelectedUids(); | ||
let config = getContext("config"); | ||
$config = { | ||
maxDepth: maxDepth, | ||
basePath: basePath, | ||
selectableTypes: selectableTypes, | ||
maximumSelectionSize: maximumSelectionSize, | ||
attributes: attributes, | ||
separator: separator, | ||
selection: selection, | ||
vocabularyUrl: vocabularyUrl, | ||
fieldId: fieldId, | ||
} | ||
console.log(`Initialized App<${fieldId}> with config ${JSON.stringify($config)}`); | ||
</script> | ||
|
||
<ContentBrowser /> | ||
<SelectedItems /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.