@symbo.ls/button 0.5.8 → 0.6.2
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/dist/index.js +99 -0
- package/dist/index.js.map +1 -0
- package/package.json +7 -7
- package/packages/react/dist/index.js +17 -0
- package/packages/react/dist/index.js.map +1 -0
- package/packages/react/package.json +5 -5
- package/packages/react/{index.js → src/index.js} +0 -0
- package/packages/react/node_modules/.yarn-integrity +0 -91
- package/packages/react/node_modules/@domql/cache/LICENSE +0 -21
- package/packages/react/node_modules/@domql/cache/index.js +0 -0
- package/packages/react/node_modules/@domql/cache/package.json +0 -10
- package/packages/react/node_modules/@domql/cookie/LICENSE +0 -21
- package/packages/react/node_modules/@domql/cookie/index.js +0 -22
- package/packages/react/node_modules/@domql/cookie/package.json +0 -10
- package/packages/react/node_modules/@domql/define/LICENSE +0 -21
- package/packages/react/node_modules/@domql/define/index.js +0 -13
- package/packages/react/node_modules/@domql/define/package.json +0 -11
- package/packages/react/node_modules/@domql/domql/LICENSE +0 -21
- package/packages/react/node_modules/@domql/domql/package.json +0 -33
- package/packages/react/node_modules/@domql/domql/src/all_exports.js +0 -17
- package/packages/react/node_modules/@domql/domql/src/index.js +0 -15
- package/packages/react/node_modules/@domql/element/LICENSE +0 -21
- package/packages/react/node_modules/@domql/element/package.json +0 -20
- package/packages/react/node_modules/@domql/element/src/assign.js +0 -22
- package/packages/react/node_modules/@domql/element/src/create.js +0 -125
- package/packages/react/node_modules/@domql/element/src/index.js +0 -8
- package/packages/react/node_modules/@domql/element/src/iterate.js +0 -80
- package/packages/react/node_modules/@domql/element/src/methods.js +0 -96
- package/packages/react/node_modules/@domql/element/src/set.js +0 -44
- package/packages/react/node_modules/@domql/element/src/update.js +0 -98
- package/packages/react/node_modules/@domql/event/LICENSE +0 -21
- package/packages/react/node_modules/@domql/event/package.json +0 -14
- package/packages/react/node_modules/@domql/event/src/can.js +0 -10
- package/packages/react/node_modules/@domql/event/src/index.js +0 -11
- package/packages/react/node_modules/@domql/event/src/is.js +0 -13
- package/packages/react/node_modules/@domql/event/src/on.js +0 -33
- package/packages/react/node_modules/@domql/event/src/store.js +0 -6
- package/packages/react/node_modules/@domql/event/src/wrappers.js +0 -14
- package/packages/react/node_modules/@domql/event/yarn-error.log +0 -44
- package/packages/react/node_modules/@domql/id/LICENSE +0 -21
- package/packages/react/node_modules/@domql/id/index.js +0 -12
- package/packages/react/node_modules/@domql/id/package.json +0 -10
- package/packages/react/node_modules/@domql/mixins/LICENSE +0 -21
- package/packages/react/node_modules/@domql/mixins/package.json +0 -12
- package/packages/react/node_modules/@domql/mixins/src/attr.js +0 -19
- package/packages/react/node_modules/@domql/mixins/src/classList.js +0 -37
- package/packages/react/node_modules/@domql/mixins/src/content.js +0 -17
- package/packages/react/node_modules/@domql/mixins/src/data.js +0 -21
- package/packages/react/node_modules/@domql/mixins/src/html.js +0 -17
- package/packages/react/node_modules/@domql/mixins/src/index.js +0 -11
- package/packages/react/node_modules/@domql/mixins/src/registry.js +0 -55
- package/packages/react/node_modules/@domql/mixins/src/state.js +0 -16
- package/packages/react/node_modules/@domql/mixins/src/style.js +0 -14
- package/packages/react/node_modules/@domql/mixins/src/text.js +0 -19
- package/packages/react/node_modules/@domql/node/LICENSE +0 -21
- package/packages/react/node_modules/@domql/node/package.json +0 -17
- package/packages/react/node_modules/@domql/node/src/cache.js +0 -52
- package/packages/react/node_modules/@domql/node/src/create.js +0 -86
- package/packages/react/node_modules/@domql/node/src/index.js +0 -5
- package/packages/react/node_modules/@domql/node/src/registry.js +0 -139
- package/packages/react/node_modules/@domql/parse/LICENSE +0 -21
- package/packages/react/node_modules/@domql/parse/index.js +0 -16
- package/packages/react/node_modules/@domql/parse/package.json +0 -10
- package/packages/react/node_modules/@domql/props/LICENSE +0 -21
- package/packages/react/node_modules/@domql/props/package.json +0 -10
- package/packages/react/node_modules/@domql/props/src/index.js +0 -62
- package/packages/react/node_modules/@domql/proto/LICENSE +0 -21
- package/packages/react/node_modules/@domql/proto/index.js +0 -66
- package/packages/react/node_modules/@domql/proto/package.json +0 -10
- package/packages/react/node_modules/@domql/react-transformer/LICENSE +0 -21
- package/packages/react/node_modules/@domql/react-transformer/index.js +0 -25
- package/packages/react/node_modules/@domql/react-transformer/package.json +0 -12
- package/packages/react/node_modules/@domql/react-transformer/yarn-error.log +0 -41
- package/packages/react/node_modules/@domql/report/LICENSE +0 -21
- package/packages/react/node_modules/@domql/report/index.js +0 -62
- package/packages/react/node_modules/@domql/report/package.json +0 -7
- package/packages/react/node_modules/@domql/state/LICENSE +0 -21
- package/packages/react/node_modules/@domql/state/package.json +0 -11
- package/packages/react/node_modules/@domql/state/src/index.js +0 -51
- package/packages/react/node_modules/@domql/tree/LICENSE +0 -21
- package/packages/react/node_modules/@domql/tree/index.js +0 -6
- package/packages/react/node_modules/@domql/tree/package.json +0 -10
- package/packages/react/node_modules/@domql/tree/root.js +0 -8
- package/packages/react/node_modules/@domql/utils/LICENSE +0 -21
- package/packages/react/node_modules/@domql/utils/package.json +0 -13
- package/packages/react/node_modules/@domql/utils/src/index.js +0 -5
- package/packages/react/node_modules/@domql/utils/src/node.js +0 -10
- package/packages/react/node_modules/@domql/utils/src/object.js +0 -193
- package/packages/react/node_modules/@domql/utils/src/protoUtils.js +0 -119
- package/packages/react/node_modules/js-tokens/CHANGELOG.md +0 -151
- package/packages/react/node_modules/js-tokens/LICENSE +0 -21
- package/packages/react/node_modules/js-tokens/README.md +0 -240
- package/packages/react/node_modules/js-tokens/index.js +0 -23
- package/packages/react/node_modules/js-tokens/package.json +0 -30
- package/packages/react/node_modules/loose-envify/LICENSE +0 -21
- package/packages/react/node_modules/loose-envify/README.md +0 -45
- package/packages/react/node_modules/loose-envify/cli.js +0 -16
- package/packages/react/node_modules/loose-envify/custom.js +0 -4
- package/packages/react/node_modules/loose-envify/index.js +0 -3
- package/packages/react/node_modules/loose-envify/loose-envify.js +0 -36
- package/packages/react/node_modules/loose-envify/package.json +0 -36
- package/packages/react/node_modules/loose-envify/replace.js +0 -65
- package/packages/react/node_modules/object-assign/index.js +0 -90
- package/packages/react/node_modules/object-assign/license +0 -21
- package/packages/react/node_modules/object-assign/package.json +0 -42
- package/packages/react/node_modules/object-assign/readme.md +0 -61
- package/packages/react/node_modules/react/LICENSE +0 -21
- package/packages/react/node_modules/react/README.md +0 -13
- package/packages/react/node_modules/react/build-info.json +0 -8
- package/packages/react/node_modules/react/cjs/react-jsx-dev-runtime.development.js +0 -1203
- package/packages/react/node_modules/react/cjs/react-jsx-dev-runtime.production.min.js +0 -9
- package/packages/react/node_modules/react/cjs/react-jsx-dev-runtime.profiling.min.js +0 -9
- package/packages/react/node_modules/react/cjs/react-jsx-runtime.development.js +0 -1221
- package/packages/react/node_modules/react/cjs/react-jsx-runtime.production.min.js +0 -10
- package/packages/react/node_modules/react/cjs/react-jsx-runtime.profiling.min.js +0 -10
- package/packages/react/node_modules/react/cjs/react.development.js +0 -2333
- package/packages/react/node_modules/react/cjs/react.production.min.js +0 -23
- package/packages/react/node_modules/react/index.js +0 -7
- package/packages/react/node_modules/react/jsx-dev-runtime.js +0 -7
- package/packages/react/node_modules/react/jsx-runtime.js +0 -7
- package/packages/react/node_modules/react/package.json +0 -39
- package/packages/react/node_modules/react/umd/react.development.js +0 -3357
- package/packages/react/node_modules/react/umd/react.production.min.js +0 -31
- package/packages/react/node_modules/react/umd/react.profiling.min.js +0 -36
- package/packages/react/node_modules/regenerator-runtime/LICENSE +0 -21
- package/packages/react/node_modules/regenerator-runtime/README.md +0 -31
- package/packages/react/node_modules/regenerator-runtime/package.json +0 -19
- package/packages/react/node_modules/regenerator-runtime/path.js +0 -11
- package/packages/react/node_modules/regenerator-runtime/runtime.js +0 -754
- package/packages/react/yarn.lock +0 -183
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
import { deepClone, deepMerge, exec, isArray } from '@domql/utils'
|
|
4
|
-
|
|
5
|
-
const initProps = (element, parent) => {
|
|
6
|
-
const propsStack = []
|
|
7
|
-
if (element.props) propsStack.push(element.props)
|
|
8
|
-
|
|
9
|
-
if (isArray(element.__proto)) {
|
|
10
|
-
element.__proto.map(proto => {
|
|
11
|
-
if (proto.props) propsStack.push(proto.props)
|
|
12
|
-
return proto.props
|
|
13
|
-
})
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
return propsStack
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const inheritProps = (element, parent) => {
|
|
20
|
-
element.props = (parent && parent.props) || { update, __element: element }
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export const syncProps = (props, element) => {
|
|
24
|
-
element.props = {}
|
|
25
|
-
const mergedProps = { update, __element: element }
|
|
26
|
-
props.forEach(v => {
|
|
27
|
-
if (v === 'update' || v === '__element') return
|
|
28
|
-
element.props = deepMerge(mergedProps, deepClone(exec(v, element)))
|
|
29
|
-
})
|
|
30
|
-
element.props = mergedProps
|
|
31
|
-
return element.props
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export const createProps = function (element, parent, cached) {
|
|
35
|
-
const propsStack = cached || initProps(element, parent)
|
|
36
|
-
|
|
37
|
-
if (propsStack.length) {
|
|
38
|
-
element.__props = propsStack
|
|
39
|
-
syncProps(propsStack, element)
|
|
40
|
-
element.props.update = update
|
|
41
|
-
} else inheritProps(element, parent)
|
|
42
|
-
|
|
43
|
-
return element
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export const updateProps = (newProps, element, parent) => {
|
|
47
|
-
let propsStack = element.__props
|
|
48
|
-
|
|
49
|
-
if (newProps) propsStack = element.__props = [].concat(newProps, propsStack)
|
|
50
|
-
|
|
51
|
-
if (propsStack) syncProps(propsStack, element)
|
|
52
|
-
else inheritProps(element, parent)
|
|
53
|
-
|
|
54
|
-
// console.log(cachedProps)
|
|
55
|
-
return element
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function update (props) {
|
|
59
|
-
const element = this.__element
|
|
60
|
-
// element.update({ props })
|
|
61
|
-
element.update()
|
|
62
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2016 rackai
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
import { isFunction, exec, getProtoStack, jointStacks, cloneAndMergeArrayProto, deepMergeProto } from '@domql/utils'
|
|
4
|
-
|
|
5
|
-
const ENV = process.env.NODE_ENV
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Checks whether element has `proto` or is a part
|
|
9
|
-
* of parent's `childProto` prototype
|
|
10
|
-
*/
|
|
11
|
-
export const applyPrototype = (element, parent, options = {}) => {
|
|
12
|
-
if (isFunction(element)) element = exec(element, parent)
|
|
13
|
-
|
|
14
|
-
const { proto } = element
|
|
15
|
-
|
|
16
|
-
// merge if proto is array
|
|
17
|
-
// const proto = mergeAndCloneIfArray(element.proto, v => {
|
|
18
|
-
// if (v.props) cache.props.push(v.props)
|
|
19
|
-
// console.log('v.propsIN_PROTO:')
|
|
20
|
-
// console.log(v.props)
|
|
21
|
-
// })
|
|
22
|
-
|
|
23
|
-
// console.log(proto)
|
|
24
|
-
const protoStack = getProtoStack(proto)
|
|
25
|
-
|
|
26
|
-
if (ENV !== 'test' || ENV !== 'development') delete element.proto
|
|
27
|
-
|
|
28
|
-
// console.log(parent.childProto)
|
|
29
|
-
|
|
30
|
-
// console.log(element)
|
|
31
|
-
// console.log(proto)
|
|
32
|
-
// console.log(protoStack)
|
|
33
|
-
// debugger
|
|
34
|
-
|
|
35
|
-
let childProtoStack = []
|
|
36
|
-
if (parent) {
|
|
37
|
-
// Assign parent attr to the element
|
|
38
|
-
element.parent = parent
|
|
39
|
-
if (!options.ignoreChildProto) {
|
|
40
|
-
childProtoStack = getProtoStack(parent.childProto)
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// console.log(proto, parent && parent.childProto)
|
|
45
|
-
// console.log(protoStack, childProtoStack)
|
|
46
|
-
|
|
47
|
-
const protoLength = protoStack.length
|
|
48
|
-
const childProtoLength = childProtoStack.length
|
|
49
|
-
|
|
50
|
-
let stack = []
|
|
51
|
-
if (protoLength && childProtoLength) {
|
|
52
|
-
stack = jointStacks(protoStack, childProtoStack)
|
|
53
|
-
} else if (protoLength) {
|
|
54
|
-
stack = protoStack
|
|
55
|
-
} else if (childProtoLength) {
|
|
56
|
-
stack = childProtoStack
|
|
57
|
-
} else return element
|
|
58
|
-
|
|
59
|
-
element.__proto = stack
|
|
60
|
-
const mergedProto = cloneAndMergeArrayProto(stack)
|
|
61
|
-
|
|
62
|
-
// console.log(mergedProto)
|
|
63
|
-
return deepMergeProto(element, mergedProto)
|
|
64
|
-
|
|
65
|
-
// final merging with prototype
|
|
66
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2016 rackai
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
import React, { useEffect, useRef } from 'react'
|
|
4
|
-
import { create } from '@domql/element'
|
|
5
|
-
import { clone } from '@domql/utils'
|
|
6
|
-
|
|
7
|
-
export function DOMQLRenderer (component, parent, props) {
|
|
8
|
-
create({
|
|
9
|
-
proto: component,
|
|
10
|
-
props: clone(props)
|
|
11
|
-
}, parent)
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export const reactTransformer = (component, props, state) => {
|
|
15
|
-
const ref = useRef(null)
|
|
16
|
-
return (
|
|
17
|
-
<React.Fragment ref={ref}>
|
|
18
|
-
{
|
|
19
|
-
useEffect(() => {
|
|
20
|
-
DOMQLRenderer(component, ref.current, props)
|
|
21
|
-
})
|
|
22
|
-
}
|
|
23
|
-
</React.Fragment>
|
|
24
|
-
)
|
|
25
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@domql/react-transformer",
|
|
3
|
-
"version": "1.3.0",
|
|
4
|
-
"main": "index.js",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"dependencies": {
|
|
7
|
-
"@domql/domql": "^1.3.0",
|
|
8
|
-
"@domql/utils": "^1.3.0",
|
|
9
|
-
"react": "^17.0.2"
|
|
10
|
-
},
|
|
11
|
-
"gitHead": "3140379c0f6da459a39068f32630275c6ea3b33f"
|
|
12
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
Arguments:
|
|
2
|
-
/Users/nikoloza/.nvm/versions/node/v14.17.1/bin/node /Users/nikoloza/.nvm/versions/node/v14.17.1/bin/yarn init
|
|
3
|
-
|
|
4
|
-
PATH:
|
|
5
|
-
/Users/nikoloza/.nvm/versions/node/v14.17.1/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Little Snitch.app/Contents/Components:/Library/Apple/usr/bin:/Users/nikoloza/.fzf/bin
|
|
6
|
-
|
|
7
|
-
Yarn version:
|
|
8
|
-
1.22.10
|
|
9
|
-
|
|
10
|
-
Node version:
|
|
11
|
-
14.17.1
|
|
12
|
-
|
|
13
|
-
Platform:
|
|
14
|
-
darwin x64
|
|
15
|
-
|
|
16
|
-
Trace:
|
|
17
|
-
Error: canceled
|
|
18
|
-
at Interface.<anonymous> (/Users/nikoloza/.nvm/versions/node/v14.17.1/lib/node_modules/yarn/lib/cli.js:136216:13)
|
|
19
|
-
at Interface.emit (events.js:375:28)
|
|
20
|
-
at Interface._ttyWrite (readline.js:910:16)
|
|
21
|
-
at ReadStream.onkeypress (readline.js:235:10)
|
|
22
|
-
at ReadStream.emit (events.js:375:28)
|
|
23
|
-
at emitKeys (internal/readline/utils.js:358:14)
|
|
24
|
-
at emitKeys.next (<anonymous>)
|
|
25
|
-
at ReadStream.onData (readline.js:1179:36)
|
|
26
|
-
at ReadStream.emit (events.js:375:28)
|
|
27
|
-
at addChunk (internal/streams/readable.js:290:12)
|
|
28
|
-
|
|
29
|
-
npm manifest:
|
|
30
|
-
{
|
|
31
|
-
"name": "@domql/react-transformer",
|
|
32
|
-
"version": "1.0.0",
|
|
33
|
-
"main": "index.js",
|
|
34
|
-
"license": "MIT"
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
yarn manifest:
|
|
38
|
-
No manifest
|
|
39
|
-
|
|
40
|
-
Lockfile:
|
|
41
|
-
No lockfile
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2016 rackai
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
export const ERRORS_REGISTRY = {
|
|
4
|
-
en: {
|
|
5
|
-
DocumentNotDefined: {
|
|
6
|
-
title: 'Document is undefined',
|
|
7
|
-
description: 'To tweak with DOM, you should use browser.'
|
|
8
|
-
},
|
|
9
|
-
OverwriteToBuiltin: {
|
|
10
|
-
title: 'Overwriting to builtin method',
|
|
11
|
-
description: 'Overwriting a builtin method in the global define is not possible, please choose different name'
|
|
12
|
-
},
|
|
13
|
-
BrowserNotDefined: {
|
|
14
|
-
title: 'Can\'t recognize environment',
|
|
15
|
-
description: 'Environment should be browser application, that can run Javascript'
|
|
16
|
-
},
|
|
17
|
-
SetQuickPreferancesIsNotObject: {
|
|
18
|
-
title: 'Quick preferances object is required',
|
|
19
|
-
description: 'Please pass a plain object with "lang", "culture" and "area" properties'
|
|
20
|
-
},
|
|
21
|
-
InvalidParams: {
|
|
22
|
-
title: 'Params are invalid',
|
|
23
|
-
description: 'Please pass a plain object with "lang", "culture" and "area" properties'
|
|
24
|
-
},
|
|
25
|
-
CantCreateWithoutNode: {
|
|
26
|
-
title: 'You must provide node',
|
|
27
|
-
description: 'Can\'t create DOM element without setting node or text'
|
|
28
|
-
},
|
|
29
|
-
HTMLInvalidTag: {
|
|
30
|
-
title: 'Element tag name (or DOM nodeName) is invalid',
|
|
31
|
-
description: 'To create element, you must provide valid DOM node. See full list of them at here: http://www.w3schools.com/tags/'
|
|
32
|
-
},
|
|
33
|
-
HTMLInvalidAttr: {
|
|
34
|
-
title: 'Attibutes object is invalid',
|
|
35
|
-
description: 'Please pass a valid plain object to apply as an attributes for a DOM node'
|
|
36
|
-
},
|
|
37
|
-
HTMLInvalidData: {
|
|
38
|
-
title: 'Data object is invalid',
|
|
39
|
-
description: 'Please pass a valid plain object to apply as an dataset for a DOM node'
|
|
40
|
-
},
|
|
41
|
-
HTMLInvalidStyles: {
|
|
42
|
-
title: 'Styles object is invalid',
|
|
43
|
-
description: 'Please pass a valid plain object to apply as an style for a DOM node'
|
|
44
|
-
},
|
|
45
|
-
HTMLInvalidText: {
|
|
46
|
-
title: 'Text string is invalid',
|
|
47
|
-
description: 'Please pass a valid string to apply text to DOM node'
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export const report = (err, arg, element) => {
|
|
53
|
-
const currentLang = 'en'
|
|
54
|
-
let errObj
|
|
55
|
-
if (err && typeof err === 'string') errObj = ERRORS_REGISTRY[currentLang][err]
|
|
56
|
-
|
|
57
|
-
return new Error(
|
|
58
|
-
`"${err}", "${arg}"\n\n`,
|
|
59
|
-
`${errObj.description}`,
|
|
60
|
-
element ? `\n\n${element}` : ''
|
|
61
|
-
)
|
|
62
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2016 rackai
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
import { on } from '@domql/event'
|
|
4
|
-
import { deepClone, exec, isFunction, overwriteDeep } from '@domql/utils'
|
|
5
|
-
|
|
6
|
-
export const parseState = function () {
|
|
7
|
-
const state = this
|
|
8
|
-
const parseState = {}
|
|
9
|
-
for (const param in state) {
|
|
10
|
-
if (param !== '__element' && param !== 'update' && param !== 'parse') {
|
|
11
|
-
parseState[param] = state[param]
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
return parseState
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export const updateState = function (obj, options = {}) {
|
|
18
|
-
const state = this
|
|
19
|
-
const element = state.__element
|
|
20
|
-
|
|
21
|
-
// run `on.stateUpdated`
|
|
22
|
-
if (element.on && isFunction(element.on.initStateUpdated)) {
|
|
23
|
-
on.initStateUpdated(element.on.initStateUpdated, element, state)
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
overwriteDeep(state, obj, ['update', 'parse', '__element'])
|
|
27
|
-
if (!options.preventUpdate) element.update()
|
|
28
|
-
|
|
29
|
-
// run `on.stateUpdated`
|
|
30
|
-
if (element.on && isFunction(element.on.stateUpdated)) {
|
|
31
|
-
on.stateUpdated(element.on.stateUpdated, element, state)
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export function createState (element, parent) {
|
|
36
|
-
let { state } = element
|
|
37
|
-
if (!state) return (parent && parent.state) || {}
|
|
38
|
-
if (isFunction(state)) state = exec(state, element)
|
|
39
|
-
|
|
40
|
-
state = deepClone(state, ['update', 'parse', '__element'])
|
|
41
|
-
state.__element = element
|
|
42
|
-
state.parse = parseState
|
|
43
|
-
state.update = updateState
|
|
44
|
-
|
|
45
|
-
// run `on.stateCreated`
|
|
46
|
-
if (element.on && isFunction(element.on.stateCreated)) {
|
|
47
|
-
on.stateCreated(element.on.stateCreated, element, element.state)
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return state
|
|
51
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2016 rackai
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2016 rackai
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@domql/utils",
|
|
3
|
-
"version": "1.3.0",
|
|
4
|
-
"main": "src/index.js",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"vpatch": "npm version patch && npm publish --access public"
|
|
8
|
-
},
|
|
9
|
-
"dependencies": {
|
|
10
|
-
"@domql/node": "^1.3.0"
|
|
11
|
-
},
|
|
12
|
-
"gitHead": "3140379c0f6da459a39068f32630275c6ea3b33f"
|
|
13
|
-
}
|