@visualizevalue/mint-app-base 0.1.120 → 0.1.122
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/.env.example +0 -1
- package/components/Mint/Renderer/Markdown.client.vue +2 -2
- package/components/MintTokenBar.vue +1 -2
- package/components/Token/Detail.client.vue +1 -2
- package/components/Token/OverviewCard.vue +2 -1
- package/composables/mintConfig.ts +1 -2
- package/composables/mintDefault.ts +2 -2
- package/nuxt.config.ts +0 -1
- package/package.json +1 -1
- package/utils/markdown.ts +3 -9
package/.env.example
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
<script setup>
|
|
13
13
|
import { watchDebounced } from '@vueuse/core'
|
|
14
|
-
import { getMarkdownSvgUri,
|
|
14
|
+
import { getMarkdownSvgUri, getMarkdownUri } from '~/utils/markdown'
|
|
15
15
|
|
|
16
16
|
const { artifact, image, animationUrl, name, description } = useCreateMintData()
|
|
17
17
|
|
|
@@ -25,7 +25,7 @@ const updatePreview = () => {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
image.value = getMarkdownSvgUri(name.value || '', markdown.value)
|
|
28
|
-
animationUrl.value =
|
|
28
|
+
animationUrl.value = getMarkdownUri(markdown.value)
|
|
29
29
|
}
|
|
30
30
|
watchDebounced([markdown, name], updatePreview, { debounce: 500, maxWait: 3000 })
|
|
31
31
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
type="number"
|
|
6
6
|
v-model="mintCount"
|
|
7
7
|
min="1"
|
|
8
|
-
|
|
8
|
+
step="1"
|
|
9
9
|
required
|
|
10
10
|
class="amount"
|
|
11
11
|
/>
|
|
@@ -41,7 +41,6 @@ const props = defineProps({
|
|
|
41
41
|
mintRequest: Function,
|
|
42
42
|
transactionFlowConfig: Object,
|
|
43
43
|
minted: Function,
|
|
44
|
-
step: { type: Number, default: 1 },
|
|
45
44
|
defaultAmount: { type: Number, default: 1 },
|
|
46
45
|
})
|
|
47
46
|
|
|
@@ -41,7 +41,6 @@
|
|
|
41
41
|
mintRequest,
|
|
42
42
|
transactionFlowConfig,
|
|
43
43
|
minted,
|
|
44
|
-
step,
|
|
45
44
|
defaultAmount,
|
|
46
45
|
}"
|
|
47
46
|
/>
|
|
@@ -74,7 +73,7 @@ const { token } = defineProps<{
|
|
|
74
73
|
const store = useOnchainStore()
|
|
75
74
|
const collection = computed(() => store.collection(token.collection))
|
|
76
75
|
|
|
77
|
-
const { defaultAmount, mintCount
|
|
76
|
+
const { defaultAmount, mintCount } = useMintDefault()
|
|
78
77
|
const ownedBalance = computed(
|
|
79
78
|
() => collection.value && store.tokenBalance(collection.value.address, token.tokenId),
|
|
80
79
|
)
|
|
@@ -54,6 +54,7 @@
|
|
|
54
54
|
mintRequest,
|
|
55
55
|
transactionFlowConfig,
|
|
56
56
|
minted,
|
|
57
|
+
defaultAmount,
|
|
57
58
|
}"
|
|
58
59
|
/>
|
|
59
60
|
<p class="muted" v-if="ownedBalance">
|
|
@@ -73,7 +74,7 @@ const { token } = defineProps<{
|
|
|
73
74
|
const store = useOnchainStore()
|
|
74
75
|
const collection = computed(() => store.collection(token.collection)) as ComputedRef<Collection>
|
|
75
76
|
|
|
76
|
-
const mintCount =
|
|
77
|
+
const { defaultAmount, mintCount } = useMintDefault()
|
|
77
78
|
const ownedBalance = computed(() => store.tokenBalance(collection.value.address, token.tokenId))
|
|
78
79
|
</script>
|
|
79
80
|
|
|
@@ -4,8 +4,7 @@ export const useMintConfig = () => {
|
|
|
4
4
|
|
|
5
5
|
// Query param > ENV > default
|
|
6
6
|
const amount = computed(() => Number(route.query.amount) || Number(config.public.mintAmount) || 1)
|
|
7
|
-
const step = computed(() => Number(route.query.step) || Number(config.public.mintStep) || 1)
|
|
8
7
|
const value = computed(() => Number(route.query.value) || Number(config.public.mintValue) || 0)
|
|
9
8
|
|
|
10
|
-
return { amount,
|
|
9
|
+
return { amount, value }
|
|
11
10
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export const useMintDefault = () => {
|
|
2
|
-
const { amount,
|
|
2
|
+
const { amount, value } = useMintConfig()
|
|
3
3
|
const gasPrice = useGasPrice()
|
|
4
4
|
const priceFeed = usePriceFeedStore()
|
|
5
5
|
|
|
@@ -30,5 +30,5 @@ export const useMintDefault = () => {
|
|
|
30
30
|
|
|
31
31
|
watch(defaultAmount, (v) => { mintCount.value = String(v) })
|
|
32
32
|
|
|
33
|
-
return { defaultAmount, mintCount
|
|
33
|
+
return { defaultAmount, mintCount }
|
|
34
34
|
}
|
package/nuxt.config.ts
CHANGED
package/package.json
CHANGED
package/utils/markdown.ts
CHANGED
|
@@ -38,13 +38,7 @@ export const getMarkdownSvgUri = (title: string, content: string) =>
|
|
|
38
38
|
toBase64DataUri('image/svg+xml', getMarkdownSvg(title, content))
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
|
-
* Generate a
|
|
41
|
+
* Generate a markdown data URI matching the on-chain MarkdownRenderer output.
|
|
42
42
|
*/
|
|
43
|
-
export const
|
|
44
|
-
|
|
45
|
-
`*{margin:0;padding:0;box-sizing:border-box}` +
|
|
46
|
-
`body{font-family:monospace;font-size:14px;color:#999;background:#111;padding:2rem;white-space:pre-wrap;word-break:break-word}` +
|
|
47
|
-
`</style></head><body>${escapeXml(content)}</body></html>`
|
|
48
|
-
|
|
49
|
-
export const getMarkdownHtmlUri = (content: string) =>
|
|
50
|
-
toBase64DataUri('text/html', getMarkdownHtml(content))
|
|
43
|
+
export const getMarkdownUri = (content: string) =>
|
|
44
|
+
toBase64DataUri('text/markdown', content)
|