@htmlplus/element 0.2.0 → 0.3.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/README.md +34 -4
- package/{dist/client → client}/decorators/attributes.d.ts +0 -0
- package/{dist/client → client}/decorators/attributes.js +1 -1
- package/{dist/client → client}/decorators/bind.d.ts +0 -0
- package/{dist/client → client}/decorators/bind.js +0 -0
- package/{dist/client → client}/decorators/element.d.ts +0 -0
- package/{dist/client → client}/decorators/element.js +1 -1
- package/{dist/client → client}/decorators/event.d.ts +0 -0
- package/{dist/client → client}/decorators/event.js +0 -0
- package/{dist/client → client}/decorators/index.d.ts +0 -0
- package/{dist/client → client}/decorators/index.js +0 -0
- package/{dist/client → client}/decorators/listen.d.ts +0 -0
- package/{dist/client → client}/decorators/listen.js +1 -1
- package/{dist/client → client}/decorators/method.d.ts +0 -0
- package/{dist/client → client}/decorators/method.js +0 -0
- package/{dist/client → client}/decorators/property.d.ts +0 -0
- package/{dist/client → client}/decorators/property.js +0 -0
- package/{dist/client → client}/decorators/state.d.ts +0 -0
- package/{dist/client → client}/decorators/state.js +0 -0
- package/{dist/client → client}/decorators/watch.d.ts +0 -0
- package/{dist/client → client}/decorators/watch.js +1 -1
- package/{dist/client → client}/helpers/classes.d.ts +0 -0
- package/{dist/client → client}/helpers/classes.js +0 -0
- package/{dist/client → client}/helpers/direction.d.ts +0 -0
- package/{dist/client → client}/helpers/direction.js +0 -0
- package/{dist/client → client}/helpers/index.d.ts +0 -0
- package/{dist/client → client}/helpers/index.js +0 -0
- package/{dist/client → client}/helpers/is-rtl.d.ts +0 -0
- package/{dist/client → client}/helpers/is-rtl.js +0 -0
- package/{dist/client → client}/helpers/query-all.d.ts +0 -0
- package/{dist/client → client}/helpers/query-all.js +0 -0
- package/{dist/client → client}/helpers/query.d.ts +0 -0
- package/{dist/client → client}/helpers/query.js +0 -0
- package/{dist/client → client}/helpers/slots.d.ts +0 -0
- package/{dist/client → client}/helpers/slots.js +0 -0
- package/{dist/client → client}/helpers/styles.d.ts +0 -0
- package/{dist/client → client}/helpers/styles.js +0 -0
- package/{dist/client → client}/helpers/to-unit.d.ts +0 -0
- package/{dist/client → client}/helpers/to-unit.js +0 -0
- package/{dist/client → client}/index.d.ts +0 -0
- package/{dist/client → client}/index.js +0 -0
- package/{dist/client → client}/services/index.d.ts +0 -0
- package/{dist/client → client}/services/index.js +0 -0
- package/{dist/client → client}/services/link.d.ts +0 -0
- package/{dist/client → client}/services/link.js +0 -0
- package/{dist/client → client}/utils/append-to-method.d.ts +0 -0
- package/{dist/client → client}/utils/append-to-method.js +0 -0
- package/{dist/client → client}/utils/call.d.ts +0 -0
- package/{dist/client → client}/utils/call.js +0 -0
- package/{dist/client → client}/utils/define-property.d.ts +0 -0
- package/{dist/client → client}/utils/define-property.js +0 -0
- package/{dist/client → client}/utils/event.d.ts +0 -0
- package/{dist/client → client}/utils/event.js +0 -0
- package/{dist/client → client}/utils/get-members.d.ts +0 -0
- package/{dist/client → client}/utils/get-members.js +1 -1
- package/{dist/client → client}/utils/get-styles.d.ts +0 -0
- package/{dist/client → client}/utils/get-styles.js +1 -1
- package/{dist/client → client}/utils/host.d.ts +0 -0
- package/{dist/client → client}/utils/host.js +1 -1
- package/{dist/client → client}/utils/index.d.ts +0 -0
- package/{dist/client → client}/utils/index.js +0 -0
- package/{dist/client → client}/utils/is-event.d.ts +0 -0
- package/{dist/client → client}/utils/is-event.js +0 -0
- package/{dist/client → client}/utils/is-ready.d.ts +0 -0
- package/{dist/client → client}/utils/is-ready.js +1 -1
- package/{dist/client → client}/utils/is-server.d.ts +0 -0
- package/{dist/client → client}/utils/is-server.js +0 -0
- package/{dist/client → client}/utils/on-ready.d.ts +0 -0
- package/{dist/client → client}/utils/on-ready.js +1 -1
- package/{dist/client → client}/utils/parse-value.d.ts +0 -0
- package/{dist/client → client}/utils/parse-value.js +1 -1
- package/{dist/client → client}/utils/render.d.ts +0 -0
- package/{dist/client → client}/utils/render.js +1 -1
- package/{dist/client → client}/utils/request.d.ts +0 -0
- package/{dist/client → client}/utils/request.js +5 -2
- package/{dist/client → client}/utils/sync.d.ts +0 -0
- package/{dist/client → client}/utils/sync.js +0 -0
- package/{dist/client → client}/utils/task.d.ts +0 -0
- package/{dist/client → client}/utils/task.js +0 -0
- package/{dist/client → client}/utils/to-boolean.d.ts +0 -0
- package/{dist/client → client}/utils/to-boolean.js +0 -0
- package/{dist/client → client}/utils/to-event.d.ts +0 -0
- package/{dist/client → client}/utils/to-event.js +0 -0
- package/{dist/client → client}/utils/type-of.d.ts +0 -0
- package/{dist/client → client}/utils/type-of.js +0 -0
- package/{dist/client → client}/utils/update-attribute.d.ts +0 -0
- package/{dist/client → client}/utils/update-attribute.js +0 -0
- package/{dist/compiler → compiler}/compiler.d.ts +0 -0
- package/compiler/compiler.js +55 -0
- package/{dist/compiler → compiler}/index.d.ts +0 -0
- package/{dist/compiler → compiler}/index.js +0 -0
- package/compiler/plugins/componentDependencyResolver.d.ts +5 -0
- package/compiler/plugins/componentDependencyResolver.js +40 -0
- package/{dist/compiler/plugins/uhtml.d.ts → compiler/plugins/customElement.d.ts} +1 -1
- package/compiler/plugins/customElement.js +138 -0
- package/compiler/plugins/customElementReact/customElementReact.d.ts +12 -0
- package/{dist/compiler/plugins/react.proxy/react.proxy.js → compiler/plugins/customElementReact/customElementReact.js} +13 -9
- package/compiler/plugins/customElementReact/index.d.ts +1 -0
- package/compiler/plugins/customElementReact/index.js +1 -0
- package/{dist/compiler/plugins/react.proxy → compiler/plugins/customElementReact}/templates/README.md.hbs +0 -0
- package/{dist/compiler/plugins/react.proxy → compiler/plugins/customElementReact}/templates/_.gitignore.hbs +0 -0
- package/{dist/compiler/plugins/react.proxy → compiler/plugins/customElementReact}/templates/package.json.hbs +0 -0
- package/{dist/compiler/plugins/react.proxy → compiler/plugins/customElementReact}/templates/rollup.config.js.hbs +0 -0
- package/{dist/compiler/plugins/react.proxy → compiler/plugins/customElementReact}/templates/src/components/index.ts.hbs +0 -0
- package/{dist/compiler/plugins/react.proxy → compiler/plugins/customElementReact}/templates/src/components/{{fileName}}.compact.ts.hbs +0 -0
- package/{dist/compiler/plugins/react.proxy → compiler/plugins/customElementReact}/templates/src/components/{{fileName}}.ts.hbs +0 -0
- package/{dist/compiler/plugins/react.proxy → compiler/plugins/customElementReact}/templates/src/index.ts.hbs +0 -0
- package/{dist/compiler/plugins/react.proxy → compiler/plugins/customElementReact}/templates/src/proxy.ts.hbs +0 -0
- package/{dist/compiler/plugins/react.proxy → compiler/plugins/customElementReact}/templates/tsconfig.json.hbs +0 -0
- package/{dist/compiler → compiler}/plugins/docs.d.ts +0 -0
- package/{dist/compiler → compiler}/plugins/docs.js +0 -0
- package/{dist/compiler → compiler}/plugins/extract.d.ts +0 -0
- package/{dist/compiler → compiler}/plugins/extract.js +1 -8
- package/compiler/plugins/index.d.ts +7 -0
- package/compiler/plugins/index.js +7 -0
- package/{dist/compiler → compiler}/plugins/parse.d.ts +0 -0
- package/{dist/compiler → compiler}/plugins/parse.js +0 -0
- package/{dist/compiler → compiler}/plugins/read.d.ts +0 -0
- package/{dist/compiler → compiler}/plugins/read.js +0 -0
- package/compiler/plugins/style.d.ts +10 -0
- package/compiler/plugins/style.js +36 -0
- package/{dist/compiler → compiler}/plugins/validate.d.ts +0 -0
- package/compiler/plugins/validate.js +40 -0
- package/{dist/compiler → compiler}/plugins/vscode.d.ts +0 -0
- package/{dist/compiler → compiler}/plugins/vscode.js +0 -0
- package/{dist/compiler → compiler}/utils/__dirname.d.ts +0 -0
- package/{dist/compiler → compiler}/utils/__dirname.js +0 -0
- package/{dist/compiler → compiler}/utils/get-initializer.d.ts +0 -0
- package/{dist/compiler → compiler}/utils/get-initializer.js +0 -0
- package/{dist/compiler → compiler}/utils/get-tags.d.ts +0 -0
- package/{dist/compiler → compiler}/utils/get-tags.js +0 -0
- package/{dist/compiler → compiler}/utils/get-type.d.ts +0 -0
- package/{dist/compiler → compiler}/utils/get-type.js +0 -0
- package/{dist/compiler → compiler}/utils/has-decorator.d.ts +0 -0
- package/{dist/compiler → compiler}/utils/has-decorator.js +0 -0
- package/{dist/compiler → compiler}/utils/index.d.ts +0 -0
- package/{dist/compiler → compiler}/utils/index.js +0 -0
- package/{dist/compiler → compiler}/utils/is-directory-empty.d.ts +0 -0
- package/{dist/compiler → compiler}/utils/is-directory-empty.js +0 -0
- package/{dist/compiler → compiler}/utils/print-type.d.ts +0 -0
- package/{dist/compiler → compiler}/utils/print-type.js +0 -0
- package/{dist/compiler → compiler}/utils/print.d.ts +0 -0
- package/{dist/compiler → compiler}/utils/print.js +0 -0
- package/{dist/compiler → compiler}/utils/render-template.d.ts +0 -0
- package/{dist/compiler → compiler}/utils/render-template.js +0 -0
- package/{dist/compiler → compiler}/utils/visitor.d.ts +0 -0
- package/{dist/compiler → compiler}/utils/visitor.js +0 -0
- package/{dist/configs/constants.d.ts → constants/index.d.ts} +1 -0
- package/{dist/configs/constants.js → constants/index.js} +1 -0
- package/package.json +10 -47
- package/{dist/runtime → runtime}/index.d.ts +0 -0
- package/{dist/runtime → runtime}/index.js +0 -0
- package/{dist/types → types}/context.d.ts +3 -0
- package/{dist/types → types}/context.js +0 -0
- package/types/global.d.ts +4 -0
- package/{dist/types/plugin.js → types/global.js} +0 -0
- package/{dist/types → types}/index.d.ts +1 -0
- package/{dist/types → types}/index.js +1 -0
- package/types/plugin.d.ts +9 -0
- package/{dist/types/plus-element.js → types/plugin.js} +0 -0
- package/{dist/types → types}/plus-element.d.ts +0 -0
- package/types/plus-element.js +1 -0
- package/dist/compiler/compiler.js +0 -47
- package/dist/compiler/plugins/attach.d.ts +0 -11
- package/dist/compiler/plugins/attach.js +0 -101
- package/dist/compiler/plugins/index.d.ts +0 -11
- package/dist/compiler/plugins/index.js +0 -11
- package/dist/compiler/plugins/print.d.ts +0 -5
- package/dist/compiler/plugins/print.js +0 -11
- package/dist/compiler/plugins/react.proxy/index.d.ts +0 -1
- package/dist/compiler/plugins/react.proxy/index.js +0 -1
- package/dist/compiler/plugins/react.proxy/react.proxy.d.ts +0 -11
- package/dist/compiler/plugins/sass.d.ts +0 -6
- package/dist/compiler/plugins/sass.js +0 -15
- package/dist/compiler/plugins/uhtml.js +0 -59
- package/dist/compiler/plugins/validate.js +0 -8
- package/dist/types/plugin.d.ts +0 -8
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export * from './react.proxy/index.js';
|
|
2
|
-
export * from './attach.js';
|
|
3
|
-
export * from './docs.js';
|
|
4
|
-
export * from './extract.js';
|
|
5
|
-
export * from './parse.js';
|
|
6
|
-
export * from './print.js';
|
|
7
|
-
export * from './read.js';
|
|
8
|
-
export * from './sass.js';
|
|
9
|
-
export * from './uhtml.js';
|
|
10
|
-
export * from './validate.js';
|
|
11
|
-
export * from './vscode.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './react.proxy.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './react.proxy.js';
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export interface ReactProxyOptions {
|
|
2
|
-
compact?: boolean;
|
|
3
|
-
dist: string;
|
|
4
|
-
eventName?: (eventName: string) => string;
|
|
5
|
-
importerComponent?: (context: any) => string;
|
|
6
|
-
importerComponentType?: (context: any) => string;
|
|
7
|
-
}
|
|
8
|
-
export declare const reactProxy: (options: ReactProxyOptions) => {
|
|
9
|
-
name: string;
|
|
10
|
-
finish: (global: any) => void;
|
|
11
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import core from 'sass';
|
|
2
|
-
export const sass = (options) => {
|
|
3
|
-
const name = 'sass';
|
|
4
|
-
const next = (context) => {
|
|
5
|
-
if (!context.stylePath)
|
|
6
|
-
return;
|
|
7
|
-
const { css, loadedUrls } = core.compile(context.stylePath, Object.assign(Object.assign({}, (options || {})), { style: 'compressed' }));
|
|
8
|
-
context.styleParsed = css.toString();
|
|
9
|
-
context.styleDependencies = []; // TODO loadedUrls;
|
|
10
|
-
};
|
|
11
|
-
return {
|
|
12
|
-
name,
|
|
13
|
-
next
|
|
14
|
-
};
|
|
15
|
-
};
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import t from '@babel/types';
|
|
2
|
-
import { print, visitor } from '../utils/index.js';
|
|
3
|
-
export const uhtml = () => {
|
|
4
|
-
const name = 'uhtml';
|
|
5
|
-
const next = (context) => {
|
|
6
|
-
context.fileAST.program.body.unshift(t.importDeclaration([t.importSpecifier(t.identifier('html'), t.identifier('html'))], t.stringLiteral('@htmlplus/element/runtime')));
|
|
7
|
-
visitor(context.fileAST, {
|
|
8
|
-
JSXAttribute: {
|
|
9
|
-
exit(path) {
|
|
10
|
-
var _a;
|
|
11
|
-
if (((_a = path.node.value) === null || _a === void 0 ? void 0 : _a.type) == 'JSXExpressionContainer') {
|
|
12
|
-
let node = path.node;
|
|
13
|
-
if (path.node.name.name == 'ref') {
|
|
14
|
-
node = t.jsxAttribute(path.node.name, t.jSXExpressionContainer(t.arrowFunctionExpression([t.identifier('$element')], t.assignmentExpression('=', path.node.value.expression, t.identifier('$element')))));
|
|
15
|
-
}
|
|
16
|
-
path.replaceWith(t.jsxIdentifier(print(node).replace('={', '=${')));
|
|
17
|
-
path.skip();
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
JSXElement: {
|
|
23
|
-
exit(path) {
|
|
24
|
-
if (path.parent.type == 'JSXElement' || path.parent.type == 'JSXFragment') {
|
|
25
|
-
path.replaceWith(t.identifier(print(path.node)));
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
path.replaceWith(t.identifier('html`' + print(path.node) + '`'));
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
JSXFragment: {
|
|
35
|
-
exit(path) {
|
|
36
|
-
path.replaceWith(t.identifier(['html`', ...path.node.children.map((child) => print(child)), '`'].join('')));
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
JSXExpressionContainer: {
|
|
40
|
-
exit(path) {
|
|
41
|
-
if (path.parent.type == 'JSXElement' || path.parent.type == 'JSXFragment') {
|
|
42
|
-
path.replaceWith(t.identifier('$' + print(path.node)));
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
JSXSpreadAttribute: {
|
|
48
|
-
enter(path) {
|
|
49
|
-
// TODO
|
|
50
|
-
path.replaceWith(t.jsxAttribute(t.jsxIdentifier('.dataset'), t.jsxExpressionContainer(path.node.argument)));
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
};
|
|
55
|
-
return {
|
|
56
|
-
name,
|
|
57
|
-
next
|
|
58
|
-
};
|
|
59
|
-
};
|
package/dist/types/plugin.d.ts
DELETED
|
@@ -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
|
-
};
|