@htmlplus/element 0.4.8 → 0.5.0

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.
Files changed (49) hide show
  1. package/client/decorators/attributes.js +2 -3
  2. package/client/decorators/element.js +15 -18
  3. package/client/decorators/property.js +10 -20
  4. package/client/decorators/state.js +5 -9
  5. package/client/decorators/watch.d.ts +2 -0
  6. package/client/decorators/watch.js +10 -13
  7. package/client/helpers/query.js +3 -3
  8. package/client/helpers/queryAll.js +3 -3
  9. package/client/helpers/slots.js +10 -12
  10. package/client/utils/appendToMethod.d.ts +1 -1
  11. package/client/utils/appendToMethod.js +3 -3
  12. package/client/utils/call.d.ts +1 -1
  13. package/client/utils/call.js +2 -2
  14. package/client/utils/index.d.ts +1 -0
  15. package/client/utils/index.js +1 -0
  16. package/client/utils/request.d.ts +8 -3
  17. package/client/utils/request.js +51 -25
  18. package/client/utils/shadowRoot.d.ts +2 -0
  19. package/client/utils/shadowRoot.js +5 -0
  20. package/client/utils/task.d.ts +4 -4
  21. package/client/utils/task.js +5 -8
  22. package/compiler/compiler.js +21 -20
  23. package/compiler/plugins/assets.d.ts +1 -0
  24. package/compiler/plugins/assets.js +9 -2
  25. package/compiler/plugins/copy.d.ts +3 -4
  26. package/compiler/plugins/copy.js +6 -3
  27. package/compiler/plugins/customElement.js +10 -2
  28. package/compiler/plugins/customElementReact/customElementReact.d.ts +9 -3
  29. package/compiler/plugins/customElementReact/customElementReact.js +9 -42
  30. package/compiler/plugins/customElementReact/templates/src/components/{{fileName}}.compact.ts.hbs +10 -7
  31. package/compiler/plugins/customElementReact/templates/src/components/{{fileName}}.ts.hbs +3 -3
  32. package/compiler/plugins/document.d.ts +2 -1
  33. package/compiler/plugins/document.js +9 -32
  34. package/compiler/plugins/extract.js +2 -4
  35. package/compiler/plugins/index.d.ts +1 -0
  36. package/compiler/plugins/index.js +1 -0
  37. package/compiler/plugins/parse.d.ts +3 -1
  38. package/compiler/plugins/parse.js +8 -7
  39. package/compiler/plugins/readme.d.ts +8 -0
  40. package/compiler/plugins/readme.js +23 -0
  41. package/compiler/plugins/style.d.ts +2 -2
  42. package/compiler/plugins/style.js +8 -5
  43. package/compiler/plugins/webTypes.d.ts +3 -2
  44. package/compiler/plugins/webTypes.js +15 -15
  45. package/compiler/utils/tags.js +21 -32
  46. package/constants/index.d.ts +11 -6
  47. package/constants/index.js +11 -7
  48. package/package.json +1 -1
  49. package/types/context.d.ts +13 -15
@@ -2,8 +2,12 @@ export const PACKAGE_NAME = '@htmlplus/element';
2
2
  // apis
3
3
  export const API_HOST = Symbol();
4
4
  export const API_INSTANCE = Symbol();
5
- // TODO
6
- export const API_STATUS = Symbol();
5
+ export const API_IS_CONNECTED = Symbol();
6
+ export const API_IS_DISABLED_ATTRIBUTE_CHANGED_CALLBACK = Symbol();
7
+ export const API_IS_LOADED = Symbol();
8
+ export const API_ATTRIBUTES_SYNCER = Symbol();
9
+ export const API_REQUEST = Symbol();
10
+ export const API_STACKS = Symbol();
7
11
  // decorators
8
12
  export const DECORATOR_ELEMENT = 'Element';
9
13
  export const DECORATOR_EVENT = 'Event';
@@ -25,11 +29,11 @@ export const STATIC_MEMBERS_INITIALIZER = 'default';
25
29
  export const STATIC_MEMBERS_TYPE = 'type';
26
30
  export const STATIC_STYLES = 'styles';
27
31
  // types
28
- export const TYPE_BOOLEAN = 'boolean';
29
- export const TYPE_DATE = 'date';
30
- export const TYPE_FUNCTION = 'function';
31
- export const TYPE_STRING = 'string';
32
- export const TYPE_NUMBER = 'number';
32
+ export const TYPE_BOOLEAN = 'Boolean';
33
+ export const TYPE_DATE = 'Date';
34
+ export const TYPE_FUNCTION = 'Function';
35
+ export const TYPE_STRING = 'String';
36
+ export const TYPE_NUMBER = 'Number';
33
37
  // utils
34
38
  export const UTILS_STYLE_MAP = 'styles';
35
39
  // TODO
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@htmlplus/element",
3
- "version": "0.4.8",
3
+ "version": "0.5.0",
4
4
  "license": "MIT",
5
5
  "author": "Masood Abdolian <m.abdolian@gmail.com>",
6
6
  "description": "Compiler of HTMLPlus",
@@ -1,9 +1,6 @@
1
1
  import { ClassBody, ClassDeclaration, ClassMethod, ClassProperty, File } from '@babel/types';
2
2
  export interface Context {
3
- assets?: string;
4
3
  customElementNames?: Array<string>;
5
- dependencies?: Array<Context>;
6
- dependenciesUnresolved?: Array<string>;
7
4
  isInvalid?: boolean;
8
5
  script?: string;
9
6
  outputs?: Array<{
@@ -11,8 +8,17 @@ export interface Context {
11
8
  options?: any;
12
9
  output?: any;
13
10
  }>;
14
- componentClassName?: string;
15
- componentClassNamePrune?: string;
11
+ assets?: string;
12
+ class?: ClassDeclaration;
13
+ classEvents?: Array<ClassProperty>;
14
+ classHasMount?: boolean;
15
+ classHasUnmount?: boolean;
16
+ classMembers?: ClassBody['body'];
17
+ classMethods?: Array<ClassMethod>;
18
+ className?: string;
19
+ classProperties?: Array<ClassProperty>;
20
+ classRender?: ClassMethod;
21
+ classStates?: Array<ClassProperty>;
16
22
  componentInterfaceName?: string;
17
23
  componentKey?: string;
18
24
  componentTag?: string;
@@ -23,18 +29,10 @@ export interface Context {
23
29
  fileExtension?: string;
24
30
  fileName?: string;
25
31
  filePath?: string;
32
+ readmeContent?: string;
33
+ readmePath?: string;
26
34
  styleContent?: string;
27
35
  styleDependencies?: Array<string>;
28
36
  styleParsed?: string;
29
37
  stylePath?: string;
30
- class?: ClassDeclaration;
31
- classEvents?: Array<ClassProperty>;
32
- classHasMount?: boolean;
33
- classHasUnmount?: boolean;
34
- classMembers?: ClassBody['body'];
35
- classMethods?: Array<ClassMethod>;
36
- className?: string;
37
- classProperties?: Array<ClassProperty>;
38
- classRender?: ClassMethod;
39
- classStates?: Array<ClassProperty>;
40
38
  }