@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 CHANGED
@@ -12,7 +12,6 @@ NUXT_PUBLIC_DESCRIPTION=To mint is a human right.
12
12
  # MINT DEFAULTS
13
13
  # =========================
14
14
  # NUXT_PUBLIC_MINT_AMOUNT=1
15
- # NUXT_PUBLIC_MINT_STEP=1
16
15
  # NUXT_PUBLIC_MINT_VALUE=5
17
16
 
18
17
  # =========================
@@ -11,7 +11,7 @@
11
11
 
12
12
  <script setup>
13
13
  import { watchDebounced } from '@vueuse/core'
14
- import { getMarkdownSvgUri, getMarkdownHtmlUri } from '~/utils/markdown'
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 = getMarkdownHtmlUri(markdown.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
- :step="step"
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, step } = useMintDefault()
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 = ref('1')
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, step, value }
9
+ return { amount, value }
11
10
  }
@@ -1,5 +1,5 @@
1
1
  export const useMintDefault = () => {
2
- const { amount, step, value } = useMintConfig()
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, step }
33
+ return { defaultAmount, mintCount }
34
34
  }
package/nuxt.config.ts CHANGED
@@ -25,7 +25,6 @@ export default defineNuxtConfig({
25
25
  ipfsGateway: 'https://ipfs.io/ipfs/',
26
26
  arweaveGateway: 'https://arweave.net/',
27
27
  mintAmount: 1,
28
- mintStep: 1,
29
28
  mintValue: 0,
30
29
  title: 'Mint',
31
30
  walletConnectProjectId: '',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visualizevalue/mint-app-base",
3
- "version": "0.1.120",
3
+ "version": "0.1.122",
4
4
  "type": "module",
5
5
  "main": "./nuxt.config.ts",
6
6
  "dependencies": {
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 simple HTML preview for the markdown content.
41
+ * Generate a markdown data URI matching the on-chain MarkdownRenderer output.
42
42
  */
43
- export const getMarkdownHtml = (content: string) =>
44
- `<!DOCTYPE html><html><head><meta charset="utf-8"><style>` +
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)