tauri-kargo-tools 0.1.7 → 0.1.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tauri-kargo-tools",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "",
5
5
  "files": ["src"],
6
6
  "exports": { "./*": "./src/*" },
@@ -88,4 +88,6 @@ defineVue(Main, (ui) => {
88
88
 
89
89
  },{ init:"initVue"})
90
90
 
91
- boot(new Main(), "#app")
91
+ boot(new Main())
92
+
93
+
@@ -158,5 +158,5 @@ defineVue(Panel, (ui) => {
158
158
  })
159
159
  })
160
160
 
161
- boot(new Panel(), "#app")
161
+ boot(new Panel())
162
162
 
@@ -126,8 +126,21 @@ export class Builder {
126
126
  }
127
127
 
128
128
  /** Monte `ui` dans `selector`. */
129
- boot<T extends object>(a: T, selector: string): VueRuntime<T> {
130
- this.container = document.querySelector(selector) as HTMLElement | null;
129
+ boot<T extends object>(a: T, selector?: string): VueRuntime<T> {
130
+ if (!selector) {
131
+ document.body.className = "app"
132
+ this.container = document.createElement("div")
133
+ document.body.appendChild(this.container)
134
+ const link = document.createElement("link")
135
+ link.rel ="stylesheet"
136
+ const scriptUrl = import.meta.url;
137
+ const scriptDir = scriptUrl.substring(0, scriptUrl.lastIndexOf('/') + 1);
138
+ const cssLink= `${scriptDir}css/vue-darkmode.css`
139
+ link.href = cssLink
140
+ document.body.appendChild(link)
141
+ } else {
142
+ this.container = document.querySelector(selector) as HTMLElement | null;
143
+ }
131
144
  if (!this.container) throw new Error('Conteneur introuvable : ' + selector);
132
145
  this.container.replaceChildren()
133
146
  return this.bootInto(this.findVueFor(a)!, a, this.container);
@@ -206,7 +219,7 @@ export class Builder {
206
219
  case 'custom': buildCustom(this, node as CustomNode<T, any, any>, ctx); break;
207
220
  case "bootVue": buildBootVue(this, node as BootVueNode<T, any>, ctx); break;
208
221
  case 'staticBootVue': buildStaticBootVue(this, node as StaticBootVueNode<T>, ctx); break;
209
- case "space":buildSpace(this,node as Space,ctx);
222
+ case "space": buildSpace(this, node as Space, ctx);
210
223
  }
211
224
  }
212
225
  }