@dosgato/dialog 1.5.2 → 1.5.3

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.
@@ -146,7 +146,12 @@
146
146
  parent: editorelement
147
147
  })
148
148
  updatePreamble = (text: string) => {
149
- env.updateFile(PREAMBLE_PATH, text)
149
+ const content = text || ' '
150
+ if (env.getSourceFile(PREAMBLE_PATH)) {
151
+ env.updateFile(PREAMBLE_PATH, content)
152
+ } else {
153
+ env.createFile(PREAMBLE_PATH, content)
154
+ }
150
155
  }
151
156
  updateCode = code => {
152
157
  if (editor.state.doc.toString() !== code) editor.update([editor.state.update({ changes: { from: 0, to: editor.state.doc.length, insert: code } })])
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dosgato/dialog",
3
3
  "description": "A component library for building forms that edit a JSON document.",
4
- "version": "1.5.2",
4
+ "version": "1.5.3",
5
5
  "scripts": {
6
6
  "prepublishOnly": "svelte-package",
7
7
  "dev": "vite dev --force",