@rip-lang/ui 0.3.10 → 0.3.11
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/README.md +101 -6
- package/dist/rip-ui.min.js +66 -66
- package/dist/rip-ui.min.js.br +0 -0
- package/package.json +1 -1
- package/ui.rip +16 -1
package/dist/rip-ui.min.js.br
CHANGED
|
Binary file
|
package/package.json
CHANGED
package/ui.rip
CHANGED
|
@@ -834,9 +834,24 @@ export launch = (appBase = '', opts = {}) ->
|
|
|
834
834
|
el.id = target.replace(/^#/, '')
|
|
835
835
|
document.body.prepend el
|
|
836
836
|
|
|
837
|
-
# Get the app bundle —
|
|
837
|
+
# Get the app bundle — explicit, static files, inline DOM, or server fetch
|
|
838
838
|
if opts.bundle
|
|
839
839
|
bundle = opts.bundle
|
|
840
|
+
else if opts.components and Array.isArray(opts.components)
|
|
841
|
+
components = {}
|
|
842
|
+
for url in opts.components
|
|
843
|
+
res = await fetch(url)
|
|
844
|
+
if res.ok
|
|
845
|
+
name = url.split('/').pop()
|
|
846
|
+
components["components/#{name}"] = await res.text()
|
|
847
|
+
bundle = { components, data: {} }
|
|
848
|
+
else if typeof document isnt 'undefined' and document.querySelectorAll('script[type="text/rip"][data-name]').length > 0
|
|
849
|
+
components = {}
|
|
850
|
+
for script in document.querySelectorAll('script[type="text/rip"][data-name]')
|
|
851
|
+
name = script.getAttribute('data-name')
|
|
852
|
+
name += '.rip' unless name.endsWith('.rip')
|
|
853
|
+
components["components/#{name}"] = script.textContent
|
|
854
|
+
bundle = { components, data: {} }
|
|
840
855
|
else
|
|
841
856
|
bundleUrl = "#{appBase}/bundle"
|
|
842
857
|
res = await fetch(bundleUrl)
|