@htmlplus/element 0.5.2 → 0.5.4

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/client/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './decorators/index.js';
2
2
  export * from './helpers/index.js';
3
3
  export * from './services/index.js';
4
+ export { getConfig, setConfig } from './utils/config.js';
package/client/index.js CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './decorators/index.js';
2
2
  export * from './helpers/index.js';
3
3
  export * from './services/index.js';
4
+ export { getConfig, setConfig } from './utils/config.js';
@@ -18,12 +18,17 @@ const merge = (target, ...sources) => {
18
18
  for (const source of sources) {
19
19
  if (!source)
20
20
  continue;
21
- for (const key of Object.keys(source)) {
22
- if (source[key] instanceof Object) {
23
- target[key] = merge(target[key] || {}, source[key]);
24
- }
25
- else {
26
- target[key] = source[key];
21
+ if (Array.isArray(source)) {
22
+ target = source;
23
+ }
24
+ else {
25
+ for (const key of Object.keys(source)) {
26
+ if (source[key] instanceof Object) {
27
+ target[key] = merge(target[key] || {}, source[key]);
28
+ }
29
+ else {
30
+ target[key] = source[key];
31
+ }
27
32
  }
28
33
  }
29
34
  }
@@ -57,10 +57,7 @@ export const customElement = (options) => {
57
57
  exit(path) {
58
58
  var _a;
59
59
  if (((_a = path.node.value) === null || _a === void 0 ? void 0 : _a.type) == 'JSXExpressionContainer') {
60
- let node = path.node;
61
- if (path.node.name.name == 'ref') {
62
- node = t.jsxAttribute(path.node.name, t.jSXExpressionContainer(t.arrowFunctionExpression([t.identifier('$element')], t.assignmentExpression('=', path.node.value.expression, t.identifier('$element')))));
63
- }
60
+ const node = path.node;
64
61
  path.replaceWith(t.jsxIdentifier(print(node).replace('={', '=${')));
65
62
  path.skip();
66
63
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@htmlplus/element",
3
- "version": "0.5.2",
3
+ "version": "0.5.4",
4
4
  "license": "MIT",
5
5
  "author": "Masood Abdolian <m.abdolian@gmail.com>",
6
6
  "description": "A powerful library for building scalable, reusable, fast, tastable and lightweight design system for any web technologies. Powerd by Web Component.",