@visualizevalue/mint-app-base 0.1.121 → 0.1.123

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.
@@ -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
 
@@ -4,6 +4,7 @@
4
4
  <FormInput
5
5
  type="number"
6
6
  v-model="mintCount"
7
+ @input="userEdited = true"
7
8
  min="1"
8
9
  step="1"
9
10
  required
@@ -45,7 +46,14 @@ const props = defineProps({
45
46
  })
46
47
 
47
48
  const mintCount = defineModel('mintCount', { default: '1' })
49
+ const userEdited = ref(false)
50
+
51
+ watch(() => props.defaultAmount, (v) => {
52
+ if (! userEdited.value) mintCount.value = String(v)
53
+ }, { immediate: true })
54
+
48
55
  const onMinted = () => {
56
+ userEdited.value = false
49
57
  mintCount.value = String(props.defaultAmount)
50
58
  props.minted()
51
59
  }
@@ -28,7 +28,5 @@ export const useMintDefault = () => {
28
28
  // Persist across navigations so the value survives remounts
29
29
  const mintCount = useState('mint-count', () => String(defaultAmount.value))
30
30
 
31
- watch(defaultAmount, (v) => { mintCount.value = String(v) })
32
-
33
31
  return { defaultAmount, mintCount }
34
32
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visualizevalue/mint-app-base",
3
- "version": "0.1.121",
3
+ "version": "0.1.123",
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)