domql 1.5.102 → 1.5.104

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
@@ -2,7 +2,7 @@
2
2
  "name": "domql",
3
3
  "description": "DOM rendering Javascript framework at early stage.",
4
4
  "author": "symbo.ls",
5
- "version": "1.5.102",
5
+ "version": "1.5.104",
6
6
  "repository": "https://github.com/domql/domql",
7
7
  "publishConfig": {
8
8
  "registry": "https://registry.npmjs.org"
@@ -6,8 +6,8 @@ import { deepClone, overwriteShallow, overwriteDeep } from '../utils'
6
6
 
7
7
  export const IGNORE_STATE_PARAMS = [
8
8
  'update', 'parse', 'clean', 'create', 'parent', '__element', '__depends', '__ref', '__root',
9
- '__components',
10
- '__projectSystem', '__projectState', '__projectComponents', '__projectPages', '__projectSnippets',
9
+ 'COMPONENTS',
10
+ 'PROJECT_SYSTEM', 'PROJECT_STATE', 'PROJECT_COMPONENTS', 'PROJECT_PAGES', 'PROJECT_SNIPPETS',
11
11
  'projectStateUpdate', 'projectSystemUpdate'
12
12
  ]
13
13
 
@@ -184,12 +184,12 @@ export const createState = function (element, parent, opts) {
184
184
  // editor stuff
185
185
  state.projectSystemUpdate = projectSystemUpdate
186
186
  state.projectStateUpdate = projectStateUpdate
187
- state.__components = state.__root.COMPONENTS
188
- state.__projectSystem = state.__root.PROJECT_SYSTEM
189
- state.__projectState = state.__root.PROJECT_STATE
190
- state.__projectComponents = state.__root.PROJECT_COMPONENTS
191
- state.__projectPages = state.__root.PROJECT_PAGES
192
- state.__projectSnippets = state.__root.PROJECT_SNIPPETS
187
+ state.COMPONENTS = state.__root.COMPONENTS
188
+ state.PROJECT_SYSTEM = state.__root.PROJECT_SYSTEM
189
+ state.PROJECT_STATE = state.__root.PROJECT_STATE
190
+ state.PROJECT_COMPONENTS = state.__root.PROJECT_COMPONENTS
191
+ state.PROJECT_PAGES = state.__root.PROJECT_PAGES
192
+ state.PROJECT_SNIPPETS = state.__root.PROJECT_SNIPPETS
193
193
 
194
194
  // run `on.stateCreated`
195
195
  if (element.on && isFunction(element.on.stateCreated)) {
@@ -92,7 +92,7 @@ const update = function (params = {}, options = UPDATE_DEFAULT_OPTIONS) {
92
92
  if (__ref.__if && !options.preventPropsUpdate) updateProps(params.props, element, parent)
93
93
 
94
94
  if (element.on && isFunction(element.on.initUpdate) && !options.ignoreInitUpdate) {
95
- const whatinitreturns = on.initUpdate(element.on.initUpdate, element, element.state)
95
+ const whatinitreturns = on.initUpdate(element.on.initUpdate, element, element.state, params)
96
96
  if (whatinitreturns === false) return
97
97
  }
98
98
 
package/src/event/on.js CHANGED
@@ -12,8 +12,8 @@ export const render = (param, element, state) => {
12
12
  return param(element, state)
13
13
  }
14
14
 
15
- export const initUpdate = (param, element, state) => {
16
- return param(element, state)
15
+ export const initUpdate = (param, element, state, changes) => {
16
+ return param(element, state, changes)
17
17
  }
18
18
 
19
19
  export const attachNode = (param, element, state) => {
@@ -1,24 +0,0 @@
1
- 'use strict'
2
-
3
- import { document } from '@domql/globals'
4
-
5
- export const isMobile = (() => /Mobi/.test(navigator.userAgent))()
6
-
7
- export const setCookie = (cname, cvalue, exdays = 365) => {
8
- const d = new Date()
9
- d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000))
10
- const expires = `expires=${d.toUTCString()}`
11
- document.cookie = `${cname}=${cvalue};${expires};path=/`
12
- }
13
-
14
- export const getCookie = (cname) => {
15
- const name = `${cname}=`
16
- const decodedCookie = decodeURIComponent(document.cookie)
17
- const ca = decodedCookie.split(';')
18
- for (let i = 0; i < ca.length; i++) {
19
- let c = ca[i]
20
- while (c.charAt(0) === ' ') c = c.substring(1)
21
- if (c.indexOf(name) === 0) return c.substring(name.length, c.length)
22
- }
23
- return ''
24
- }
@@ -1 +0,0 @@
1
- 'use strict'
@@ -1,20 +0,0 @@
1
- {
2
- "name": "@domql/object",
3
- "version": "0.0.1",
4
- "private": false,
5
- "description": "",
6
- "main": "index.js",
7
- "scripts": {
8
- "test": "echo \"Error: no test specified\" && exit 1"
9
- },
10
- "repository": {
11
- "type": "git",
12
- "url": "git+https://github.com/domql/domql.git"
13
- },
14
- "author": "Rackai",
15
- "license": "ISC",
16
- "bugs": {
17
- "url": "https://github.com/domql/domql/issues"
18
- },
19
- "homepage": "https://github.com/domql/domql#readme"
20
- }