@htmlplus/element 0.1.9 → 0.3.1

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 (162) hide show
  1. package/README.md +34 -4
  2. package/package.json +10 -47
  3. package/dist/client/decorators/attributes.d.ts +0 -2
  4. package/dist/client/decorators/attributes.js +0 -13
  5. package/dist/client/decorators/bind.d.ts +0 -4
  6. package/dist/client/decorators/bind.js +0 -17
  7. package/dist/client/decorators/element.d.ts +0 -2
  8. package/dist/client/decorators/element.js +0 -49
  9. package/dist/client/decorators/event.d.ts +0 -21
  10. package/dist/client/decorators/event.js +0 -18
  11. package/dist/client/decorators/index.d.ts +0 -9
  12. package/dist/client/decorators/index.js +0 -9
  13. package/dist/client/decorators/listen.d.ts +0 -12
  14. package/dist/client/decorators/listen.js +0 -30
  15. package/dist/client/decorators/method.d.ts +0 -2
  16. package/dist/client/decorators/method.js +0 -12
  17. package/dist/client/decorators/property.d.ts +0 -12
  18. package/dist/client/decorators/property.js +0 -51
  19. package/dist/client/decorators/state.d.ts +0 -2
  20. package/dist/client/decorators/state.js +0 -32
  21. package/dist/client/decorators/watch.d.ts +0 -2
  22. package/dist/client/decorators/watch.js +0 -17
  23. package/dist/client/helpers/classes.d.ts +0 -1
  24. package/dist/client/helpers/classes.js +0 -62
  25. package/dist/client/helpers/direction.d.ts +0 -3
  26. package/dist/client/helpers/direction.js +0 -4
  27. package/dist/client/helpers/index.d.ts +0 -9
  28. package/dist/client/helpers/index.js +0 -9
  29. package/dist/client/helpers/is-rtl.d.ts +0 -2
  30. package/dist/client/helpers/is-rtl.js +0 -2
  31. package/dist/client/helpers/query-all.d.ts +0 -3
  32. package/dist/client/helpers/query-all.js +0 -5
  33. package/dist/client/helpers/query.d.ts +0 -3
  34. package/dist/client/helpers/query.js +0 -5
  35. package/dist/client/helpers/slots.d.ts +0 -6
  36. package/dist/client/helpers/slots.js +0 -15
  37. package/dist/client/helpers/styles.d.ts +0 -1
  38. package/dist/client/helpers/styles.js +0 -16
  39. package/dist/client/helpers/to-unit.d.ts +0 -1
  40. package/dist/client/helpers/to-unit.js +0 -7
  41. package/dist/client/index.d.ts +0 -3
  42. package/dist/client/index.js +0 -3
  43. package/dist/client/services/index.d.ts +0 -1
  44. package/dist/client/services/index.js +0 -1
  45. package/dist/client/services/link.d.ts +0 -4
  46. package/dist/client/services/link.js +0 -196
  47. package/dist/client/utils/append-to-method.d.ts +0 -2
  48. package/dist/client/utils/append-to-method.js +0 -7
  49. package/dist/client/utils/call.d.ts +0 -2
  50. package/dist/client/utils/call.js +0 -4
  51. package/dist/client/utils/define-property.d.ts +0 -1
  52. package/dist/client/utils/define-property.js +0 -1
  53. package/dist/client/utils/event.d.ts +0 -2
  54. package/dist/client/utils/event.js +0 -6
  55. package/dist/client/utils/get-members.d.ts +0 -2
  56. package/dist/client/utils/get-members.js +0 -5
  57. package/dist/client/utils/get-styles.d.ts +0 -2
  58. package/dist/client/utils/get-styles.js +0 -5
  59. package/dist/client/utils/host.d.ts +0 -2
  60. package/dist/client/utils/host.js +0 -4
  61. package/dist/client/utils/index.d.ts +0 -20
  62. package/dist/client/utils/index.js +0 -20
  63. package/dist/client/utils/is-event.d.ts +0 -1
  64. package/dist/client/utils/is-event.js +0 -3
  65. package/dist/client/utils/is-ready.d.ts +0 -2
  66. package/dist/client/utils/is-ready.js +0 -4
  67. package/dist/client/utils/is-server.d.ts +0 -1
  68. package/dist/client/utils/is-server.js +0 -3
  69. package/dist/client/utils/on-ready.d.ts +0 -2
  70. package/dist/client/utils/on-ready.js +0 -6
  71. package/dist/client/utils/parse-value.d.ts +0 -1
  72. package/dist/client/utils/parse-value.js +0 -15
  73. package/dist/client/utils/render.d.ts +0 -2
  74. package/dist/client/utils/render.js +0 -17
  75. package/dist/client/utils/request.d.ts +0 -2
  76. package/dist/client/utils/request.js +0 -25
  77. package/dist/client/utils/sync.d.ts +0 -1
  78. package/dist/client/utils/sync.js +0 -31
  79. package/dist/client/utils/task.d.ts +0 -6
  80. package/dist/client/utils/task.js +0 -46
  81. package/dist/client/utils/to-boolean.d.ts +0 -1
  82. package/dist/client/utils/to-boolean.js +0 -3
  83. package/dist/client/utils/to-event.d.ts +0 -1
  84. package/dist/client/utils/to-event.js +0 -3
  85. package/dist/client/utils/type-of.d.ts +0 -3
  86. package/dist/client/utils/type-of.js +0 -6
  87. package/dist/client/utils/update-attribute.d.ts +0 -1
  88. package/dist/client/utils/update-attribute.js +0 -7
  89. package/dist/compiler/compiler.d.ts +0 -7
  90. package/dist/compiler/compiler.js +0 -56
  91. package/dist/compiler/index.d.ts +0 -2
  92. package/dist/compiler/index.js +0 -2
  93. package/dist/compiler/plugins/attach.d.ts +0 -11
  94. package/dist/compiler/plugins/attach.js +0 -101
  95. package/dist/compiler/plugins/docs.d.ts +0 -11
  96. package/dist/compiler/plugins/docs.js +0 -320
  97. package/dist/compiler/plugins/extract.d.ts +0 -8
  98. package/dist/compiler/plugins/extract.js +0 -77
  99. package/dist/compiler/plugins/index.d.ts +0 -11
  100. package/dist/compiler/plugins/index.js +0 -11
  101. package/dist/compiler/plugins/parse.d.ts +0 -5
  102. package/dist/compiler/plugins/parse.js +0 -16
  103. package/dist/compiler/plugins/print.d.ts +0 -5
  104. package/dist/compiler/plugins/print.js +0 -11
  105. package/dist/compiler/plugins/react.proxy/index.d.ts +0 -1
  106. package/dist/compiler/plugins/react.proxy/index.js +0 -1
  107. package/dist/compiler/plugins/react.proxy/react.proxy.d.ts +0 -11
  108. package/dist/compiler/plugins/react.proxy/react.proxy.js +0 -121
  109. package/dist/compiler/plugins/react.proxy/templates/README.md.hbs +0 -1
  110. package/dist/compiler/plugins/react.proxy/templates/_.gitignore.hbs +0 -2
  111. package/dist/compiler/plugins/react.proxy/templates/package.json.hbs +0 -37
  112. package/dist/compiler/plugins/react.proxy/templates/rollup.config.js.hbs +0 -21
  113. package/dist/compiler/plugins/react.proxy/templates/src/components/index.ts.hbs +0 -17
  114. package/dist/compiler/plugins/react.proxy/templates/src/components/{{fileName}}.compact.ts.hbs +0 -18
  115. package/dist/compiler/plugins/react.proxy/templates/src/components/{{fileName}}.ts.hbs +0 -26
  116. package/dist/compiler/plugins/react.proxy/templates/src/index.ts.hbs +0 -1
  117. package/dist/compiler/plugins/react.proxy/templates/src/proxy.ts.hbs +0 -278
  118. package/dist/compiler/plugins/react.proxy/templates/tsconfig.json.hbs +0 -17
  119. package/dist/compiler/plugins/read.d.ts +0 -5
  120. package/dist/compiler/plugins/read.js +0 -13
  121. package/dist/compiler/plugins/sass.d.ts +0 -6
  122. package/dist/compiler/plugins/sass.js +0 -15
  123. package/dist/compiler/plugins/uhtml.d.ts +0 -5
  124. package/dist/compiler/plugins/uhtml.js +0 -59
  125. package/dist/compiler/plugins/validate.d.ts +0 -5
  126. package/dist/compiler/plugins/validate.js +0 -8
  127. package/dist/compiler/plugins/vscode.d.ts +0 -11
  128. package/dist/compiler/plugins/vscode.js +0 -83
  129. package/dist/compiler/utils/__dirname.d.ts +0 -1
  130. package/dist/compiler/utils/__dirname.js +0 -5
  131. package/dist/compiler/utils/get-initializer.d.ts +0 -2
  132. package/dist/compiler/utils/get-initializer.js +0 -10
  133. package/dist/compiler/utils/get-tags.d.ts +0 -6
  134. package/dist/compiler/utils/get-tags.js +0 -34
  135. package/dist/compiler/utils/get-type.d.ts +0 -2
  136. package/dist/compiler/utils/get-type.js +0 -69
  137. package/dist/compiler/utils/has-decorator.d.ts +0 -1
  138. package/dist/compiler/utils/has-decorator.js +0 -5
  139. package/dist/compiler/utils/index.d.ts +0 -10
  140. package/dist/compiler/utils/index.js +0 -10
  141. package/dist/compiler/utils/is-directory-empty.d.ts +0 -1
  142. package/dist/compiler/utils/is-directory-empty.js +0 -10
  143. package/dist/compiler/utils/print-type.d.ts +0 -1
  144. package/dist/compiler/utils/print-type.js +0 -69
  145. package/dist/compiler/utils/print.d.ts +0 -2
  146. package/dist/compiler/utils/print.js +0 -5
  147. package/dist/compiler/utils/render-template.d.ts +0 -1
  148. package/dist/compiler/utils/render-template.js +0 -25
  149. package/dist/compiler/utils/visitor.d.ts +0 -2
  150. package/dist/compiler/utils/visitor.js +0 -5
  151. package/dist/configs/constants.d.ts +0 -22
  152. package/dist/configs/constants.js +0 -28
  153. package/dist/runtime/index.d.ts +0 -1
  154. package/dist/runtime/index.js +0 -4
  155. package/dist/types/context.d.ts +0 -29
  156. package/dist/types/context.js +0 -1
  157. package/dist/types/index.d.ts +0 -3
  158. package/dist/types/index.js +0 -3
  159. package/dist/types/plugin.d.ts +0 -8
  160. package/dist/types/plugin.js +0 -1
  161. package/dist/types/plus-element.d.ts +0 -2
  162. package/dist/types/plus-element.js +0 -1
@@ -1,8 +0,0 @@
1
- export const validate = () => {
2
- const name = 'validate';
3
- const next = (context) => { };
4
- return {
5
- name,
6
- next
7
- };
8
- };
@@ -1,11 +0,0 @@
1
- import { Context } from '../../types/index.js';
2
- export interface VscodeOptions {
3
- dist: string;
4
- prefix: string;
5
- }
6
- export declare const vscode: (options: VscodeOptions) => {
7
- name: string;
8
- start: (global: any) => void;
9
- next: (context: Context, global: any) => void;
10
- finish: (global: any) => void;
11
- };
@@ -1,83 +0,0 @@
1
- import { paramCase } from 'change-case';
2
- import fs from 'fs';
3
- import path from 'path';
4
- import { getTags, getType, printType } from '../utils/index.js';
5
- export const vscode = (options) => {
6
- const name = 'vscode';
7
- const start = (global) => {
8
- global.vscode = {
9
- version: 1.1,
10
- tags: []
11
- };
12
- };
13
- const next = (context, global) => {
14
- const readme = (() => {
15
- try {
16
- const source = path.resolve(context.directoryPath || '', `${context.fileName}.md`);
17
- return fs.readFileSync(source, 'utf8');
18
- }
19
- catch (_a) { }
20
- })();
21
- const description = (() => {
22
- const content = readme || '';
23
- if (!content.startsWith('# '))
24
- return '';
25
- const sections = content.split('\n');
26
- for (let i = 1; i < sections.length; i++) {
27
- const section = sections[i].trim();
28
- if (!section)
29
- continue;
30
- return section;
31
- }
32
- return '';
33
- })();
34
- const properties = (context.classProperties || []).map((property) => {
35
- var _a;
36
- const name = paramCase(property.key['name']);
37
- const description = (_a = getTags(property).find((tag) => !tag.key)) === null || _a === void 0 ? void 0 : _a.value;
38
- const attribute = {
39
- name,
40
- description
41
- };
42
- // TODO
43
- let { members = [] } = (() => {
44
- const ast = getType(context.fileAST, (property.typeAnnotation || {})['typeAnnotation'], {
45
- directory: context.directoryPath
46
- });
47
- return printType(ast);
48
- })();
49
- // TODO
50
- members = members.filter((member) => member.key !== member.type).map((member) => ({ name: member.key }));
51
- if (members.length)
52
- attribute.values = members;
53
- return attribute;
54
- });
55
- global.vscode.tags.push({
56
- name: context.componentKey,
57
- description: {
58
- kind: 'markdown',
59
- value: description
60
- },
61
- attributes: properties,
62
- references: [
63
- {
64
- name: 'Source code',
65
- url: `https://github.com/htmlplus/core/tree/main/src/components/${context.directoryName}/${context.fileName}.tsx`
66
- }
67
- ]
68
- });
69
- };
70
- const finish = (global) => {
71
- global.vscode.tags = global.vscode.tags.sort((a, b) => (a.name > b.name ? 1 : -1));
72
- // TODO
73
- // fs.ensureDirSync(path.dirname(options.dist));
74
- // TODO
75
- // fs.writeJSONSync(options.dist, global.vscode, { replacer: null, spaces: 2 });
76
- };
77
- return {
78
- name,
79
- start,
80
- next,
81
- finish
82
- };
83
- };
@@ -1 +0,0 @@
1
- export declare const __dirname: (url: string | URL) => string;
@@ -1,5 +0,0 @@
1
- import { dirname } from 'path';
2
- import { fileURLToPath } from 'url';
3
- export const __dirname = (url) => {
4
- return dirname(fileURLToPath(url));
5
- };
@@ -1,2 +0,0 @@
1
- import { Expression } from '@babel/types';
2
- export declare const getInitializer: (node: Expression) => any;
@@ -1,10 +0,0 @@
1
- // TODO: return type
2
- export const getInitializer = (node) => {
3
- if (!node)
4
- return node;
5
- const value = node;
6
- if (!value)
7
- return;
8
- const extra = value.extra || {};
9
- return extra.raw || value['value'];
10
- };
@@ -1,6 +0,0 @@
1
- import { Node } from '@babel/types';
2
- export interface Tag {
3
- key?: string;
4
- value?: string;
5
- }
6
- export declare const getTags: (node?: Node | undefined) => Array<Tag>;
@@ -1,34 +0,0 @@
1
- export const getTags = (node) => {
2
- if (!node)
3
- return [];
4
- const tags = [];
5
- const lines = [];
6
- const comments = (node.leadingComments || [])
7
- .map((comment) => comment.value)
8
- .join('\r\n')
9
- .split('\r\n');
10
- for (const comment of comments) {
11
- let line = comment.trimLeft();
12
- if (line.startsWith('*'))
13
- line = line.slice(1);
14
- if (!line)
15
- continue;
16
- const isTag = line.trim().startsWith('@');
17
- if (isTag || !lines.length)
18
- lines.push(line);
19
- else
20
- lines[lines.length - 1] += line;
21
- }
22
- for (const line of lines) {
23
- let value = line.trim();
24
- if (!value.startsWith('@')) {
25
- tags.push({ value });
26
- continue;
27
- }
28
- const sections = value.split(' ');
29
- const key = sections[0].slice(1);
30
- value = sections.slice(1).join(' ').trim();
31
- tags.push({ key, value });
32
- }
33
- return tags;
34
- };
@@ -1,2 +0,0 @@
1
- import { File } from '@babel/types';
2
- export declare const getType: (file: File, node: any, options: any) => any;
@@ -1,69 +0,0 @@
1
- import { parse } from '@babel/parser';
2
- import fs from 'fs';
3
- import { dirname, resolve } from 'path';
4
- import { visitor } from './visitor.js';
5
- // TODO: return type
6
- export const getType = (file, node, options) => {
7
- if (!node)
8
- return node;
9
- if (node.type != 'TSTypeReference')
10
- return node;
11
- const { directory } = options;
12
- let result;
13
- visitor(file, {
14
- ClassDeclaration(path) {
15
- if (path.node.id.name != node.typeName.name)
16
- return;
17
- result = path.node;
18
- path.stop();
19
- },
20
- ImportDeclaration(path) {
21
- for (const specifier of path.node.specifiers) {
22
- const alias = specifier.local.name;
23
- if (alias != node.typeName.name)
24
- continue;
25
- let key;
26
- switch (specifier.type) {
27
- case 'ImportNamespaceSpecifier':
28
- key = '*';
29
- break;
30
- case 'ImportDefaultSpecifier':
31
- key = 'default';
32
- break;
33
- case 'ImportSpecifier':
34
- key = specifier.imported.name;
35
- break;
36
- }
37
- try {
38
- const filePath = resolve(directory, path.node.source.value + '.ts');
39
- path.$ast =
40
- path.$ast ||
41
- parse(fs.readFileSync(filePath, 'utf8'), {
42
- allowImportExportEverywhere: true,
43
- plugins: ['typescript'],
44
- ranges: false
45
- });
46
- result = getType(path.$ast, node, {
47
- directory: dirname(filePath)
48
- });
49
- }
50
- catch (_a) { }
51
- path.stop();
52
- break;
53
- }
54
- },
55
- TSInterfaceDeclaration(path) {
56
- if (path.node.id.name != node.typeName.name)
57
- return;
58
- result = path.node;
59
- path.stop();
60
- },
61
- TSTypeAliasDeclaration(path) {
62
- if (path.node.id.name != node.typeName.name)
63
- return;
64
- result = path.node;
65
- path.stop();
66
- }
67
- });
68
- return result || node;
69
- };
@@ -1 +0,0 @@
1
- export declare const hasDecorator: (node: any, name: string) => boolean;
@@ -1,5 +0,0 @@
1
- export const hasDecorator = (node, name) => {
2
- if (!node.decorators)
3
- return false;
4
- return !!node.decorators.some((decorator) => { var _a; return ((_a = decorator.expression.callee) === null || _a === void 0 ? void 0 : _a.name) == name; });
5
- };
@@ -1,10 +0,0 @@
1
- export * from './__dirname.js';
2
- export * from './get-initializer.js';
3
- export * from './get-tags.js';
4
- export * from './get-type.js';
5
- export * from './has-decorator.js';
6
- export * from './is-directory-empty.js';
7
- export * from './print-type.js';
8
- export * from './print.js';
9
- export * from './render-template.js';
10
- export * from './visitor.js';
@@ -1,10 +0,0 @@
1
- export * from './__dirname.js';
2
- export * from './get-initializer.js';
3
- export * from './get-tags.js';
4
- export * from './get-type.js';
5
- export * from './has-decorator.js';
6
- export * from './is-directory-empty.js';
7
- export * from './print-type.js';
8
- export * from './print.js';
9
- export * from './render-template.js';
10
- export * from './visitor.js';
@@ -1 +0,0 @@
1
- export declare const isDirectoryEmpty: (directory: string) => boolean;
@@ -1,10 +0,0 @@
1
- import fs from 'fs';
2
- export const isDirectoryEmpty = (directory) => {
3
- try {
4
- const files = fs.readdirSync(directory);
5
- return !files.length;
6
- }
7
- catch (_a) {
8
- return true;
9
- }
10
- };
@@ -1 +0,0 @@
1
- export declare const printType: (ast: any) => any;
@@ -1,69 +0,0 @@
1
- import { print } from './print.js';
2
- // TODO
3
- // args types
4
- // return type
5
- // components\grid-item\grid-item.types.ts
6
- // components\portal\portal.tsx
7
- export const printType = (ast) => {
8
- if (!ast)
9
- return ast;
10
- let result = {};
11
- switch (ast.type) {
12
- case 'BooleanLiteral':
13
- case 'NumericLiteral':
14
- case 'StringLiteral': {
15
- result.key = ast.value;
16
- result.type = ast.type.replace('Literal', '').toLowerCase();
17
- break;
18
- }
19
- case 'TSBooleanKeyword':
20
- case 'TSNumberKeyword':
21
- case 'TSStringKeyword': {
22
- const type = ast.type.replace('TS', '').replace('Keyword', '').toLowerCase();
23
- result.key = type;
24
- result.type = type;
25
- break;
26
- }
27
- case 'TSAnyKeyword': {
28
- result.type = 'any';
29
- break;
30
- }
31
- case 'TSArrayType': {
32
- const type = print(ast.elementType) + '[]';
33
- result.key = type;
34
- result.type = type;
35
- break;
36
- }
37
- case 'TSInterfaceDeclaration': {
38
- result.type = ast.id.name;
39
- result.members = ast.body.body.map((body) => printType(body));
40
- break;
41
- }
42
- case 'TSLiteralType': {
43
- result = printType(ast.literal);
44
- break;
45
- }
46
- case 'TSPropertySignature': {
47
- const { typeAnnotation } = ast;
48
- result.key = ast.key.name;
49
- if (typeAnnotation && typeAnnotation.typeAnnotation)
50
- result.type = printType(ast.typeAnnotation.typeAnnotation).type;
51
- break;
52
- }
53
- case 'TSTypeAliasDeclaration': {
54
- result = printType(ast.typeAnnotation);
55
- break;
56
- }
57
- case 'TSTypeReference': {
58
- result.key = ast.typeName.name;
59
- result.type = ast.typeName.name;
60
- break;
61
- }
62
- case 'TSUnionType': {
63
- result.type = print(ast);
64
- result.members = ast.types.map((type) => printType(type));
65
- break;
66
- }
67
- }
68
- return result;
69
- };
@@ -1,2 +0,0 @@
1
- import { Node } from '@babel/types';
2
- export declare const print: (ast: Node) => string;
@@ -1,5 +0,0 @@
1
- import generator from '@babel/generator';
2
- // TODO: add options
3
- export const print = (ast) => {
4
- return (generator.default || generator)(ast, { decoratorsBeforeExport: true }).code;
5
- };
@@ -1 +0,0 @@
1
- export declare const renderTemplate: (source: string | Array<string>, destination: string, options?: any) => (context: any) => void;
@@ -1,25 +0,0 @@
1
- import glob from 'fast-glob';
2
- import fs from 'fs';
3
- import handlebars from 'handlebars';
4
- import path from 'path';
5
- export const renderTemplate = (source, destination, options) => (context) => {
6
- const files = glob.sync(source, options);
7
- for (const file of files) {
8
- const from = path.resolve((options === null || options === void 0 ? void 0 : options.cwd) || '', file);
9
- const to = path.join(destination, path
10
- .normalize(file)
11
- .split(path.sep)
12
- .slice(1)
13
- .map((section) => handlebars.compile(section)(context))
14
- .join(path.sep)
15
- .replace('_.', '.')
16
- .replace('.hbs', ''));
17
- const directory = path.dirname(to);
18
- const raw = fs.readFileSync(from, 'utf8');
19
- const template = handlebars.compile(raw)(context);
20
- if (!fs.existsSync(directory)) {
21
- fs.mkdirSync(directory, { recursive: true });
22
- }
23
- fs.writeFileSync(to, template, 'utf8');
24
- }
25
- };
@@ -1,2 +0,0 @@
1
- import { Node } from '@babel/types';
2
- export declare const visitor: (ast: Node, options: any) => void;
@@ -1,5 +0,0 @@
1
- import traverse from '@babel/traverse';
2
- // TODO: options type
3
- export const visitor = (ast, options) => {
4
- (traverse.default || traverse)(ast, options);
5
- };
@@ -1,22 +0,0 @@
1
- export declare const API_HOST = "$host$";
2
- export declare const API_READY = "$ready$";
3
- export declare const API_SETUP = "$setup$";
4
- export declare const DECORATOR_ELEMENT = "Element";
5
- export declare const DECORATOR_EVENT = "Event";
6
- export declare const DECORATOR_PROPERTY = "Property";
7
- export declare const DECORATOR_STATE = "State";
8
- export declare const DECORATOR_METHOD = "Method";
9
- export declare const LIFECYCLE_ADOPTED = "adoptedCallback";
10
- export declare const LIFECYCLE_CONNECTED = "connectedCallback";
11
- export declare const LIFECYCLE_DISCONNECTED = "disconnectedCallback";
12
- export declare const LIFECYCLE_LOADED = "loadedCallback";
13
- export declare const LIFECYCLE_UPDATE = "updateCallback";
14
- export declare const LIFECYCLE_UPDATED = "updatedCallback";
15
- export declare const METHOD_RENDER = "render";
16
- export declare const STATIC_MEMBERS = "members";
17
- export declare const STATIC_STYLES = "styles";
18
- export declare const TYPE_BOOLEAN = "boolean";
19
- export declare const TYPE_DATE = "date";
20
- export declare const TYPE_FUNCTION = "function";
21
- export declare const TYPE_STRING = "string";
22
- export declare const TYPE_NUMBER = "number";
@@ -1,28 +0,0 @@
1
- // apis
2
- export const API_HOST = '$host$';
3
- export const API_READY = '$ready$';
4
- export const API_SETUP = '$setup$';
5
- // decorators
6
- export const DECORATOR_ELEMENT = 'Element';
7
- export const DECORATOR_EVENT = 'Event';
8
- export const DECORATOR_PROPERTY = 'Property';
9
- export const DECORATOR_STATE = 'State';
10
- export const DECORATOR_METHOD = 'Method';
11
- // lifecycle
12
- export const LIFECYCLE_ADOPTED = 'adoptedCallback';
13
- export const LIFECYCLE_CONNECTED = 'connectedCallback';
14
- export const LIFECYCLE_DISCONNECTED = 'disconnectedCallback';
15
- export const LIFECYCLE_LOADED = 'loadedCallback';
16
- export const LIFECYCLE_UPDATE = 'updateCallback';
17
- export const LIFECYCLE_UPDATED = 'updatedCallback';
18
- // methods
19
- export const METHOD_RENDER = 'render';
20
- // statics
21
- export const STATIC_MEMBERS = 'members';
22
- export const STATIC_STYLES = 'styles';
23
- // types
24
- export const TYPE_BOOLEAN = 'boolean';
25
- export const TYPE_DATE = 'date';
26
- export const TYPE_FUNCTION = 'function';
27
- export const TYPE_STRING = 'string';
28
- export const TYPE_NUMBER = 'number';
@@ -1 +0,0 @@
1
- export declare const html: (template: any, ...values: any[]) => any;
@@ -1,4 +0,0 @@
1
- import { html as core } from 'uhtml';
2
- export const html = (template, ...values) => {
3
- return core(template, ...values);
4
- };
@@ -1,29 +0,0 @@
1
- import { ClassBody, ClassDeclaration, ClassMethod, ClassProperty, File } from '@babel/types';
2
- export interface Context {
3
- script?: string;
4
- componentClassName?: string;
5
- componentInterfaceName?: string;
6
- componentKey?: string;
7
- componentTag?: string;
8
- directoryName?: string;
9
- directoryPath?: string;
10
- fileAST?: File;
11
- fileContent?: string;
12
- fileExtension?: string;
13
- fileName?: string;
14
- filePath?: string;
15
- styleContent?: string;
16
- styleDependencies?: Array<string>;
17
- styleParsed?: string;
18
- stylePath?: string;
19
- class?: ClassDeclaration;
20
- classEvents?: Array<ClassProperty>;
21
- classHasMount?: boolean;
22
- classHasUnmount?: boolean;
23
- classMembers?: ClassBody['body'];
24
- classMethods?: Array<ClassMethod>;
25
- className?: string;
26
- classProperties?: Array<ClassProperty>;
27
- classRender?: ClassMethod;
28
- classStates?: Array<ClassProperty>;
29
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,3 +0,0 @@
1
- export * from './context.js';
2
- export * from './plugin.js';
3
- export * from './plus-element.js';
@@ -1,3 +0,0 @@
1
- export * from './context.js';
2
- export * from './plugin.js';
3
- export * from './plus-element.js';
@@ -1,8 +0,0 @@
1
- import { Context } from './context.js';
2
- export declare type Return<T> = void | T | Promise<T>;
3
- export declare type Plugin = {
4
- name: string;
5
- start?: (global: any) => Return<any>;
6
- next?: (context: Context, global: any) => Return<Context>;
7
- finish?: (global: any) => Return<any>;
8
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,2 +0,0 @@
1
- export interface PlusElement {
2
- }
@@ -1 +0,0 @@
1
- export {};