simplyview 3.0.1 → 3.0.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.
package/src/view.mjs ADDED
@@ -0,0 +1,20 @@
1
+ export function view(options) {
2
+ if (options.app) {
3
+ options.app.view = options.view || {}
4
+
5
+ const load = () => {
6
+ const data = options.app.view
7
+ const path = globalThis.editor.data.getDataPath(options.app.container || document.body)
8
+ options.app.view = globalThis.editor.currentData[path]
9
+ Object.assign(options.app.view, data)
10
+ }
11
+ if (globalThis.editor && globalThis.editor.currentData) {
12
+ load()
13
+ } else {
14
+ document.addEventListener('simply-content-loaded', load)
15
+ }
16
+ return options.app.view
17
+ } else {
18
+ return options.view
19
+ }
20
+ }
package/src/changes.md DELETED
@@ -1,18 +0,0 @@
1
- # changes
2
-
3
- removed:
4
- - render, observe
5
- these are replaced with bind.mjs and state.mjs (signal, effect)
6
- - view
7
- replaced by state.mjs (signal)
8
- - collect
9
- replaced by state.mjs (effect)
10
- - keyboard
11
- renamed to key.mjs
12
- - path
13
- was never used, use jsonPointer instead if you need it
14
- - viewmodel
15
- replaced wiht model.mjs
16
- - resize
17
- use @container queries instead
18
-
@@ -1 +0,0 @@
1
- document.dispatchEvent(new Event('simply-include-next'));