@htmlplus/element 0.3.1 → 0.4.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.
- package/README.md +2 -2
- package/client/decorators/attributes.d.ts +2 -0
- package/client/decorators/attributes.js +13 -0
- package/client/decorators/bind.d.ts +4 -0
- package/client/decorators/bind.js +17 -0
- package/client/decorators/element.d.ts +2 -0
- package/client/decorators/element.js +53 -0
- package/client/decorators/event.d.ts +21 -0
- package/client/decorators/event.js +17 -0
- package/client/decorators/index.d.ts +9 -0
- package/client/decorators/index.js +9 -0
- package/client/decorators/listen.d.ts +12 -0
- package/client/decorators/listen.js +31 -0
- package/client/decorators/method.d.ts +2 -0
- package/client/decorators/method.js +11 -0
- package/client/decorators/property.d.ts +8 -0
- package/client/decorators/property.js +45 -0
- package/client/decorators/state.d.ts +2 -0
- package/client/decorators/state.js +23 -0
- package/client/decorators/watch.d.ts +8 -0
- package/client/decorators/watch.js +34 -0
- package/client/helpers/classes.d.ts +1 -0
- package/client/helpers/classes.js +62 -0
- package/client/helpers/direction.d.ts +3 -0
- package/client/helpers/direction.js +4 -0
- package/client/helpers/index.d.ts +9 -0
- package/client/helpers/index.js +9 -0
- package/client/helpers/isRTL.d.ts +2 -0
- package/client/helpers/isRTL.js +2 -0
- package/client/helpers/query.d.ts +3 -0
- package/client/helpers/query.js +5 -0
- package/client/helpers/queryAll.d.ts +3 -0
- package/client/helpers/queryAll.js +5 -0
- package/client/helpers/slots.d.ts +6 -0
- package/client/helpers/slots.js +15 -0
- package/client/helpers/styles.d.ts +1 -0
- package/client/helpers/styles.js +17 -0
- package/client/helpers/toUnit.d.ts +1 -0
- package/client/helpers/toUnit.js +7 -0
- package/client/index.d.ts +3 -0
- package/client/index.js +3 -0
- package/client/services/index.d.ts +1 -0
- package/client/services/index.js +1 -0
- package/client/services/link.d.ts +4 -0
- package/client/services/link.js +196 -0
- package/client/utils/appendToMethod.d.ts +2 -0
- package/client/utils/appendToMethod.js +7 -0
- package/client/utils/call.d.ts +2 -0
- package/client/utils/call.js +4 -0
- package/client/utils/defineProperty.d.ts +1 -0
- package/client/utils/defineProperty.js +1 -0
- package/client/utils/event.d.ts +5 -0
- package/client/utils/event.js +9 -0
- package/client/utils/getMembers.d.ts +2 -0
- package/client/utils/getMembers.js +5 -0
- package/client/utils/getStyles.d.ts +2 -0
- package/client/utils/getStyles.js +5 -0
- package/client/utils/host.d.ts +2 -0
- package/client/utils/host.js +4 -0
- package/client/utils/index.d.ts +17 -0
- package/client/utils/index.js +17 -0
- package/client/utils/isEvent.d.ts +1 -0
- package/client/utils/isEvent.js +3 -0
- package/client/utils/isServer.d.ts +1 -0
- package/client/utils/isServer.js +3 -0
- package/client/utils/parseValue.d.ts +1 -0
- package/client/utils/parseValue.js +15 -0
- package/client/utils/request.d.ts +4 -0
- package/client/utils/request.js +38 -0
- package/client/utils/sync.d.ts +1 -0
- package/client/utils/sync.js +31 -0
- package/client/utils/task.d.ts +6 -0
- package/client/utils/task.js +37 -0
- package/client/utils/toBoolean.d.ts +1 -0
- package/client/utils/toBoolean.js +3 -0
- package/client/utils/toEvent.d.ts +1 -0
- package/client/utils/toEvent.js +3 -0
- package/client/utils/typeOf.d.ts +3 -0
- package/client/utils/typeOf.js +6 -0
- package/client/utils/updateAttribute.d.ts +1 -0
- package/client/utils/updateAttribute.js +7 -0
- package/client/vendor/uhtml.d.ts +22 -0
- package/client/vendor/uhtml.js +700 -0
- package/compiler/compiler.d.ts +7 -0
- package/compiler/compiler.js +72 -0
- package/compiler/index.d.ts +2 -0
- package/compiler/index.js +2 -0
- package/compiler/plugins/customElement.d.ts +8 -0
- package/compiler/plugins/customElement.js +157 -0
- package/compiler/plugins/customElementReact/customElementReact.d.ts +12 -0
- package/compiler/plugins/customElementReact/customElementReact.js +129 -0
- package/compiler/plugins/customElementReact/index.d.ts +1 -0
- package/compiler/plugins/customElementReact/index.js +1 -0
- package/compiler/plugins/customElementReact/templates/README.md.hbs +1 -0
- package/compiler/plugins/customElementReact/templates/_.gitignore.hbs +2 -0
- package/compiler/plugins/customElementReact/templates/package.json.hbs +37 -0
- package/compiler/plugins/customElementReact/templates/rollup.config.js.hbs +21 -0
- package/compiler/plugins/customElementReact/templates/src/components/index.ts.hbs +17 -0
- package/compiler/plugins/customElementReact/templates/src/components/{{fileName}}.compact.ts.hbs +18 -0
- package/compiler/plugins/customElementReact/templates/src/components/{{fileName}}.ts.hbs +26 -0
- package/compiler/plugins/customElementReact/templates/src/index.ts.hbs +1 -0
- package/compiler/plugins/customElementReact/templates/src/proxy.ts.hbs +278 -0
- package/compiler/plugins/customElementReact/templates/tsconfig.json.hbs +17 -0
- package/compiler/plugins/document.d.ts +10 -0
- package/compiler/plugins/document.js +254 -0
- package/compiler/plugins/external.d.ts +9 -0
- package/compiler/plugins/external.js +25 -0
- package/compiler/plugins/extract.d.ts +8 -0
- package/compiler/plugins/extract.js +62 -0
- package/compiler/plugins/index.d.ts +9 -0
- package/compiler/plugins/index.js +9 -0
- package/compiler/plugins/parse.d.ts +5 -0
- package/compiler/plugins/parse.js +16 -0
- package/compiler/plugins/read.d.ts +5 -0
- package/compiler/plugins/read.js +13 -0
- package/compiler/plugins/style.d.ts +10 -0
- package/compiler/plugins/style.js +36 -0
- package/compiler/plugins/validate.d.ts +5 -0
- package/compiler/plugins/validate.js +40 -0
- package/compiler/plugins/vscode.d.ts +11 -0
- package/compiler/plugins/vscode.js +83 -0
- package/compiler/utils/__dirname.d.ts +1 -0
- package/compiler/utils/__dirname.js +5 -0
- package/compiler/utils/getInitializer.d.ts +2 -0
- package/compiler/utils/getInitializer.js +10 -0
- package/compiler/utils/getType.d.ts +2 -0
- package/compiler/utils/getType.js +69 -0
- package/compiler/utils/getTypeReference.d.ts +2 -0
- package/compiler/utils/getTypeReference.js +33 -0
- package/compiler/utils/hasDecorator.d.ts +1 -0
- package/compiler/utils/hasDecorator.js +5 -0
- package/compiler/utils/index.d.ts +11 -0
- package/compiler/utils/index.js +11 -0
- package/compiler/utils/isDirectoryEmpty.d.ts +1 -0
- package/compiler/utils/isDirectoryEmpty.js +10 -0
- package/compiler/utils/print.d.ts +2 -0
- package/compiler/utils/print.js +5 -0
- package/compiler/utils/printType.d.ts +1 -0
- package/compiler/utils/printType.js +69 -0
- package/compiler/utils/renderTemplate.d.ts +1 -0
- package/compiler/utils/renderTemplate.js +25 -0
- package/compiler/utils/tags.d.ts +13 -0
- package/compiler/utils/tags.js +53 -0
- package/compiler/utils/visitor.d.ts +2 -0
- package/compiler/utils/visitor.js +5 -0
- package/constants/index.d.ts +22 -0
- package/constants/index.js +28 -0
- package/package.json +14 -17
- package/types/context.d.ts +38 -0
- package/types/context.js +1 -0
- package/types/global.d.ts +4 -0
- package/types/global.js +1 -0
- package/types/index.d.ts +4 -0
- package/types/index.js +4 -0
- package/types/plugin.d.ts +10 -0
- package/types/plugin.js +1 -0
- package/types/plusElement.d.ts +2 -0
- package/types/plusElement.js +1 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export const PACKAGE_NAME = '@htmlplus/element';
|
|
2
|
+
// apis
|
|
3
|
+
export const API_HOST = '$host$';
|
|
4
|
+
export const API_READY = '$ready$';
|
|
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';
|
package/package.json
CHANGED
|
@@ -1,22 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@htmlplus/element",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Masood Abdolian <m.abdolian@gmail.com>",
|
|
6
6
|
"description": "Compiler of HTMLPlus",
|
|
7
7
|
"type": "module",
|
|
8
|
-
"main": "
|
|
9
|
-
"types": "
|
|
10
|
-
"scripts": {
|
|
11
|
-
"prebuild": "npm run clean",
|
|
12
|
-
"build": "tsc",
|
|
13
|
-
"build:watch": "tsc -w",
|
|
14
|
-
"postbuild": "node scripts/build.post.js",
|
|
15
|
-
"clean": "rimraf dist",
|
|
16
|
-
"format": "prettier --write .",
|
|
17
|
-
"dev:start": "node src/dev/scripts/start.js",
|
|
18
|
-
"dev:build": "node src/dev/scripts/build.js"
|
|
19
|
-
},
|
|
8
|
+
"main": "client/index.js",
|
|
9
|
+
"types": "client/index.d.ts",
|
|
20
10
|
"files": [
|
|
21
11
|
"client",
|
|
22
12
|
"compiler",
|
|
@@ -26,6 +16,9 @@
|
|
|
26
16
|
"package.json",
|
|
27
17
|
"README.md"
|
|
28
18
|
],
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"directory": "dist"
|
|
21
|
+
},
|
|
29
22
|
"engines": {
|
|
30
23
|
"node": ">= 12.7.0"
|
|
31
24
|
},
|
|
@@ -46,17 +39,21 @@
|
|
|
46
39
|
"@types/node": "^16.11.11",
|
|
47
40
|
"change-case": "^4.1.2",
|
|
48
41
|
"fast-glob": "^3.2.11",
|
|
42
|
+
"fs-extra": "^10.1.0",
|
|
49
43
|
"handlebars": "^4.7.7",
|
|
44
|
+
"listr2": "^4.0.5",
|
|
50
45
|
"log-update": "^5.0.0",
|
|
51
|
-
"
|
|
46
|
+
"ora": "^6.1.0",
|
|
52
47
|
"typescript": "^4.5.2",
|
|
53
|
-
"uhtml": "^
|
|
48
|
+
"uhtml": "^3.0.1"
|
|
54
49
|
},
|
|
55
50
|
"devDependencies": {
|
|
56
51
|
"@trivago/prettier-plugin-sort-imports": "^3.1.1",
|
|
57
|
-
"cpy": "^9.0.
|
|
52
|
+
"cpy": "^9.0.1",
|
|
53
|
+
"nodemon": "^2.0.16",
|
|
58
54
|
"prettier": "^2.5.0",
|
|
59
55
|
"rimraf": "^3.0.2",
|
|
56
|
+
"ts-node": "^10.7.0",
|
|
60
57
|
"vite": "^2.7.10"
|
|
61
58
|
}
|
|
62
|
-
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ClassBody, ClassDeclaration, ClassMethod, ClassProperty, File } from '@babel/types';
|
|
2
|
+
export interface Context {
|
|
3
|
+
dependencies?: Array<Context>;
|
|
4
|
+
dependenciesUnresolved?: Array<string>;
|
|
5
|
+
isInvalid?: boolean;
|
|
6
|
+
script?: string;
|
|
7
|
+
outputs?: Array<{
|
|
8
|
+
name: string;
|
|
9
|
+
options?: any;
|
|
10
|
+
output?: any;
|
|
11
|
+
}>;
|
|
12
|
+
componentClassName?: string;
|
|
13
|
+
componentClassNamePrune?: string;
|
|
14
|
+
componentInterfaceName?: string;
|
|
15
|
+
componentKey?: string;
|
|
16
|
+
componentTag?: string;
|
|
17
|
+
directoryName?: string;
|
|
18
|
+
directoryPath?: string;
|
|
19
|
+
fileAST?: File;
|
|
20
|
+
fileContent?: string;
|
|
21
|
+
fileExtension?: string;
|
|
22
|
+
fileName?: string;
|
|
23
|
+
filePath?: string;
|
|
24
|
+
styleContent?: string;
|
|
25
|
+
styleDependencies?: Array<string>;
|
|
26
|
+
styleParsed?: string;
|
|
27
|
+
stylePath?: string;
|
|
28
|
+
class?: ClassDeclaration;
|
|
29
|
+
classEvents?: Array<ClassProperty>;
|
|
30
|
+
classHasMount?: boolean;
|
|
31
|
+
classHasUnmount?: boolean;
|
|
32
|
+
classMembers?: ClassBody['body'];
|
|
33
|
+
classMethods?: Array<ClassMethod>;
|
|
34
|
+
className?: string;
|
|
35
|
+
classProperties?: Array<ClassProperty>;
|
|
36
|
+
classRender?: ClassMethod;
|
|
37
|
+
classStates?: Array<ClassProperty>;
|
|
38
|
+
}
|
package/types/context.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/types/global.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/types/index.d.ts
ADDED
package/types/index.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Context } from './context.js';
|
|
2
|
+
import { Global } from './global';
|
|
3
|
+
export declare type Return<T> = void | T | Promise<T>;
|
|
4
|
+
export declare type Plugin = {
|
|
5
|
+
name: string;
|
|
6
|
+
options?: any;
|
|
7
|
+
start?: (global: Global) => Return<void>;
|
|
8
|
+
next?: (context: Context, global: Global) => Return<any>;
|
|
9
|
+
finish?: (global: Global) => Return<void>;
|
|
10
|
+
};
|
package/types/plugin.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|