Merge branch '86-refactor-docs-make-it-so-that-inline-sandbox-does-not-require-xolibs-binding' into 'development'

Resolve "refactor(Docs): Make it so that inline sandbox does not require xolibs binding"

Closes #86

See merge request GeneralProtocols/xo/stack!127
This commit is contained in:
Emergent Reasons
2025-08-31 08:19:27 +00:00
2 changed files with 5 additions and 14 deletions
@@ -75,7 +75,7 @@ const props = withDefaults(defineProps<CodeSandboxProps>(), {
editorHeight: 'auto', editorHeight: 'auto',
outputHeight: 'auto', outputHeight: 'auto',
hideRunButton: false, hideRunButton: false,
libs: (): Record<string, ImportedLib> => ({}), libs: (): Record<string, ImportedLib> => useXOCashLibs(),
saveable: false, saveable: false,
}); });
+4 -13
View File
@@ -4,9 +4,6 @@ aside: false
<script lang="ts" setup> <script lang="ts" setup>
import CodeSandbox from '@theme/components/CodeSandbox.vue' import CodeSandbox from '@theme/components/CodeSandbox.vue'
import { useXOCashLibs } from '@theme/utils/useXOCashLibs';
const xocashLibs = useXOCashLibs();
</script> </script>
# Sandbox # Sandbox
@@ -24,9 +21,7 @@ The below is Address mess.
<!-- NOTE: It is absolutely crucial you leave a blank line before and after the backticks! Otherwise, you'll end up with errors.--> <!-- NOTE: It is absolutely crucial you leave a blank line before and after the backticks! Otherwise, you'll end up with errors.-->
<CodeSandbox <CodeSandbox>
:libs="xocashLibs"
>
``` ```
import { Address } from '@xocash/stack'; import { Address } from '@xocash/stack';
@@ -50,9 +45,7 @@ We can have more than one per page too. For example:
<!-- NOTE: It is absolutely crucial you leave a blank line before and after the backticks! Otherwise, you'll end up with errors.--> <!-- NOTE: It is absolutely crucial you leave a blank line before and after the backticks! Otherwise, you'll end up with errors.-->
<CodeSandbox <CodeSandbox>
:libs="xocashLibs"
>
``` ```
import { BlockchainElectrum } from '@xocash/stack'; import { BlockchainElectrum } from '@xocash/stack';
@@ -74,14 +67,12 @@ The below demonstrates instantiating a wallet.
<!-- NOTE: It is absolutely crucial you leave a blank line before and after the backticks! Otherwise, you'll end up with errors.--> <!-- NOTE: It is absolutely crucial you leave a blank line before and after the backticks! Otherwise, you'll end up with errors.-->
<CodeSandbox <CodeSandbox>
:libs="xocashLibs"
>
``` ```
import { BlockchainElectrum, WalletP2PKH } from '@xocash/stack'; import { BlockchainElectrum, WalletP2PKH } from '@xocash/stack';
const wallet = WalletP2PKH.generateRandom({ const wallet = await WalletP2PKH.generateRandom({
blockchain: new BlockchainElectrum blockchain: new BlockchainElectrum
}); });