@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.
Files changed (177) hide show
  1. package/README.md +34 -4
  2. package/{dist/client → client}/decorators/attributes.d.ts +0 -0
  3. package/{dist/client → client}/decorators/attributes.js +1 -1
  4. package/{dist/client → client}/decorators/bind.d.ts +0 -0
  5. package/{dist/client → client}/decorators/bind.js +0 -0
  6. package/{dist/client → client}/decorators/element.d.ts +0 -0
  7. package/{dist/client → client}/decorators/element.js +1 -1
  8. package/{dist/client → client}/decorators/event.d.ts +0 -0
  9. package/{dist/client → client}/decorators/event.js +0 -0
  10. package/{dist/client → client}/decorators/index.d.ts +0 -0
  11. package/{dist/client → client}/decorators/index.js +0 -0
  12. package/{dist/client → client}/decorators/listen.d.ts +0 -0
  13. package/{dist/client → client}/decorators/listen.js +1 -1
  14. package/{dist/client → client}/decorators/method.d.ts +0 -0
  15. package/{dist/client → client}/decorators/method.js +0 -0
  16. package/{dist/client → client}/decorators/property.d.ts +0 -0
  17. package/{dist/client → client}/decorators/property.js +0 -0
  18. package/{dist/client → client}/decorators/state.d.ts +0 -0
  19. package/{dist/client → client}/decorators/state.js +0 -0
  20. package/{dist/client → client}/decorators/watch.d.ts +0 -0
  21. package/{dist/client → client}/decorators/watch.js +1 -1
  22. package/{dist/client → client}/helpers/classes.d.ts +0 -0
  23. package/{dist/client → client}/helpers/classes.js +0 -0
  24. package/{dist/client → client}/helpers/direction.d.ts +0 -0
  25. package/{dist/client → client}/helpers/direction.js +0 -0
  26. package/{dist/client → client}/helpers/index.d.ts +0 -0
  27. package/{dist/client → client}/helpers/index.js +0 -0
  28. package/{dist/client → client}/helpers/is-rtl.d.ts +0 -0
  29. package/{dist/client → client}/helpers/is-rtl.js +0 -0
  30. package/{dist/client → client}/helpers/query-all.d.ts +0 -0
  31. package/{dist/client → client}/helpers/query-all.js +0 -0
  32. package/{dist/client → client}/helpers/query.d.ts +0 -0
  33. package/{dist/client → client}/helpers/query.js +0 -0
  34. package/{dist/client → client}/helpers/slots.d.ts +0 -0
  35. package/{dist/client → client}/helpers/slots.js +0 -0
  36. package/{dist/client → client}/helpers/styles.d.ts +0 -0
  37. package/{dist/client → client}/helpers/styles.js +0 -0
  38. package/{dist/client → client}/helpers/to-unit.d.ts +0 -0
  39. package/{dist/client → client}/helpers/to-unit.js +0 -0
  40. package/{dist/client → client}/index.d.ts +0 -0
  41. package/{dist/client → client}/index.js +0 -0
  42. package/{dist/client → client}/services/index.d.ts +0 -0
  43. package/{dist/client → client}/services/index.js +0 -0
  44. package/{dist/client → client}/services/link.d.ts +0 -0
  45. package/{dist/client → client}/services/link.js +0 -0
  46. package/{dist/client → client}/utils/append-to-method.d.ts +0 -0
  47. package/{dist/client → client}/utils/append-to-method.js +0 -0
  48. package/{dist/client → client}/utils/call.d.ts +0 -0
  49. package/{dist/client → client}/utils/call.js +0 -0
  50. package/{dist/client → client}/utils/define-property.d.ts +0 -0
  51. package/{dist/client → client}/utils/define-property.js +0 -0
  52. package/{dist/client → client}/utils/event.d.ts +0 -0
  53. package/{dist/client → client}/utils/event.js +0 -0
  54. package/{dist/client → client}/utils/get-members.d.ts +0 -0
  55. package/{dist/client → client}/utils/get-members.js +1 -1
  56. package/{dist/client → client}/utils/get-styles.d.ts +0 -0
  57. package/{dist/client → client}/utils/get-styles.js +1 -1
  58. package/{dist/client → client}/utils/host.d.ts +0 -0
  59. package/{dist/client → client}/utils/host.js +1 -1
  60. package/{dist/client → client}/utils/index.d.ts +0 -0
  61. package/{dist/client → client}/utils/index.js +0 -0
  62. package/{dist/client → client}/utils/is-event.d.ts +0 -0
  63. package/{dist/client → client}/utils/is-event.js +0 -0
  64. package/{dist/client → client}/utils/is-ready.d.ts +0 -0
  65. package/{dist/client → client}/utils/is-ready.js +1 -1
  66. package/{dist/client → client}/utils/is-server.d.ts +0 -0
  67. package/{dist/client → client}/utils/is-server.js +0 -0
  68. package/{dist/client → client}/utils/on-ready.d.ts +0 -0
  69. package/{dist/client → client}/utils/on-ready.js +1 -1
  70. package/{dist/client → client}/utils/parse-value.d.ts +0 -0
  71. package/{dist/client → client}/utils/parse-value.js +1 -1
  72. package/{dist/client → client}/utils/render.d.ts +0 -0
  73. package/{dist/client → client}/utils/render.js +1 -1
  74. package/{dist/client → client}/utils/request.d.ts +0 -0
  75. package/{dist/client → client}/utils/request.js +5 -2
  76. package/{dist/client → client}/utils/sync.d.ts +0 -0
  77. package/{dist/client → client}/utils/sync.js +0 -0
  78. package/{dist/client → client}/utils/task.d.ts +0 -0
  79. package/{dist/client → client}/utils/task.js +0 -0
  80. package/{dist/client → client}/utils/to-boolean.d.ts +0 -0
  81. package/{dist/client → client}/utils/to-boolean.js +0 -0
  82. package/{dist/client → client}/utils/to-event.d.ts +0 -0
  83. package/{dist/client → client}/utils/to-event.js +0 -0
  84. package/{dist/client → client}/utils/type-of.d.ts +0 -0
  85. package/{dist/client → client}/utils/type-of.js +0 -0
  86. package/{dist/client → client}/utils/update-attribute.d.ts +0 -0
  87. package/{dist/client → client}/utils/update-attribute.js +0 -0
  88. package/{dist/compiler → compiler}/compiler.d.ts +0 -0
  89. package/compiler/compiler.js +55 -0
  90. package/{dist/compiler → compiler}/index.d.ts +0 -0
  91. package/{dist/compiler → compiler}/index.js +0 -0
  92. package/compiler/plugins/componentDependencyResolver.d.ts +5 -0
  93. package/compiler/plugins/componentDependencyResolver.js +40 -0
  94. package/{dist/compiler/plugins/uhtml.d.ts → compiler/plugins/customElement.d.ts} +1 -1
  95. package/compiler/plugins/customElement.js +138 -0
  96. package/compiler/plugins/customElementReact/customElementReact.d.ts +12 -0
  97. package/{dist/compiler/plugins/react.proxy/react.proxy.js → compiler/plugins/customElementReact/customElementReact.js} +13 -9
  98. package/compiler/plugins/customElementReact/index.d.ts +1 -0
  99. package/compiler/plugins/customElementReact/index.js +1 -0
  100. package/{dist/compiler/plugins/react.proxy → compiler/plugins/customElementReact}/templates/README.md.hbs +0 -0
  101. package/{dist/compiler/plugins/react.proxy → compiler/plugins/customElementReact}/templates/_.gitignore.hbs +0 -0
  102. package/{dist/compiler/plugins/react.proxy → compiler/plugins/customElementReact}/templates/package.json.hbs +0 -0
  103. package/{dist/compiler/plugins/react.proxy → compiler/plugins/customElementReact}/templates/rollup.config.js.hbs +0 -0
  104. package/{dist/compiler/plugins/react.proxy → compiler/plugins/customElementReact}/templates/src/components/index.ts.hbs +0 -0
  105. package/{dist/compiler/plugins/react.proxy → compiler/plugins/customElementReact}/templates/src/components/{{fileName}}.compact.ts.hbs +0 -0
  106. package/{dist/compiler/plugins/react.proxy → compiler/plugins/customElementReact}/templates/src/components/{{fileName}}.ts.hbs +0 -0
  107. package/{dist/compiler/plugins/react.proxy → compiler/plugins/customElementReact}/templates/src/index.ts.hbs +0 -0
  108. package/{dist/compiler/plugins/react.proxy → compiler/plugins/customElementReact}/templates/src/proxy.ts.hbs +0 -0
  109. package/{dist/compiler/plugins/react.proxy → compiler/plugins/customElementReact}/templates/tsconfig.json.hbs +0 -0
  110. package/{dist/compiler → compiler}/plugins/docs.d.ts +0 -0
  111. package/{dist/compiler → compiler}/plugins/docs.js +0 -0
  112. package/{dist/compiler → compiler}/plugins/extract.d.ts +0 -0
  113. package/{dist/compiler → compiler}/plugins/extract.js +1 -8
  114. package/compiler/plugins/index.d.ts +7 -0
  115. package/compiler/plugins/index.js +7 -0
  116. package/{dist/compiler → compiler}/plugins/parse.d.ts +0 -0
  117. package/{dist/compiler → compiler}/plugins/parse.js +0 -0
  118. package/{dist/compiler → compiler}/plugins/read.d.ts +0 -0
  119. package/{dist/compiler → compiler}/plugins/read.js +0 -0
  120. package/compiler/plugins/style.d.ts +10 -0
  121. package/compiler/plugins/style.js +36 -0
  122. package/{dist/compiler → compiler}/plugins/validate.d.ts +0 -0
  123. package/compiler/plugins/validate.js +40 -0
  124. package/{dist/compiler → compiler}/plugins/vscode.d.ts +0 -0
  125. package/{dist/compiler → compiler}/plugins/vscode.js +0 -0
  126. package/{dist/compiler → compiler}/utils/__dirname.d.ts +0 -0
  127. package/{dist/compiler → compiler}/utils/__dirname.js +0 -0
  128. package/{dist/compiler → compiler}/utils/get-initializer.d.ts +0 -0
  129. package/{dist/compiler → compiler}/utils/get-initializer.js +0 -0
  130. package/{dist/compiler → compiler}/utils/get-tags.d.ts +0 -0
  131. package/{dist/compiler → compiler}/utils/get-tags.js +0 -0
  132. package/{dist/compiler → compiler}/utils/get-type.d.ts +0 -0
  133. package/{dist/compiler → compiler}/utils/get-type.js +0 -0
  134. package/{dist/compiler → compiler}/utils/has-decorator.d.ts +0 -0
  135. package/{dist/compiler → compiler}/utils/has-decorator.js +0 -0
  136. package/{dist/compiler → compiler}/utils/index.d.ts +0 -0
  137. package/{dist/compiler → compiler}/utils/index.js +0 -0
  138. package/{dist/compiler → compiler}/utils/is-directory-empty.d.ts +0 -0
  139. package/{dist/compiler → compiler}/utils/is-directory-empty.js +0 -0
  140. package/{dist/compiler → compiler}/utils/print-type.d.ts +0 -0
  141. package/{dist/compiler → compiler}/utils/print-type.js +0 -0
  142. package/{dist/compiler → compiler}/utils/print.d.ts +0 -0
  143. package/{dist/compiler → compiler}/utils/print.js +0 -0
  144. package/{dist/compiler → compiler}/utils/render-template.d.ts +0 -0
  145. package/{dist/compiler → compiler}/utils/render-template.js +0 -0
  146. package/{dist/compiler → compiler}/utils/visitor.d.ts +0 -0
  147. package/{dist/compiler → compiler}/utils/visitor.js +0 -0
  148. package/{dist/configs/constants.d.ts → constants/index.d.ts} +1 -0
  149. package/{dist/configs/constants.js → constants/index.js} +1 -0
  150. package/package.json +10 -47
  151. package/{dist/runtime → runtime}/index.d.ts +0 -0
  152. package/{dist/runtime → runtime}/index.js +0 -0
  153. package/{dist/types → types}/context.d.ts +3 -0
  154. package/{dist/types → types}/context.js +0 -0
  155. package/types/global.d.ts +4 -0
  156. package/{dist/types/plugin.js → types/global.js} +0 -0
  157. package/{dist/types → types}/index.d.ts +1 -0
  158. package/{dist/types → types}/index.js +1 -0
  159. package/types/plugin.d.ts +9 -0
  160. package/{dist/types/plus-element.js → types/plugin.js} +0 -0
  161. package/{dist/types → types}/plus-element.d.ts +0 -0
  162. package/types/plus-element.js +1 -0
  163. package/dist/compiler/compiler.js +0 -47
  164. package/dist/compiler/plugins/attach.d.ts +0 -11
  165. package/dist/compiler/plugins/attach.js +0 -101
  166. package/dist/compiler/plugins/index.d.ts +0 -11
  167. package/dist/compiler/plugins/index.js +0 -11
  168. package/dist/compiler/plugins/print.d.ts +0 -5
  169. package/dist/compiler/plugins/print.js +0 -11
  170. package/dist/compiler/plugins/react.proxy/index.d.ts +0 -1
  171. package/dist/compiler/plugins/react.proxy/index.js +0 -1
  172. package/dist/compiler/plugins/react.proxy/react.proxy.d.ts +0 -11
  173. package/dist/compiler/plugins/sass.d.ts +0 -6
  174. package/dist/compiler/plugins/sass.js +0 -15
  175. package/dist/compiler/plugins/uhtml.js +0 -59
  176. package/dist/compiler/plugins/validate.js +0 -8
  177. 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,5 +0,0 @@
1
- import { Context } from '../../types/index.js';
2
- export declare const print: () => {
3
- name: string;
4
- next: (context: Context) => void;
5
- };
@@ -1,11 +0,0 @@
1
- import { print as core } from '../utils/index.js';
2
- export const print = () => {
3
- const name = 'print';
4
- const next = (context) => {
5
- context.script = core(context.fileAST);
6
- };
7
- return {
8
- name,
9
- next
10
- };
11
- };
@@ -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,6 +0,0 @@
1
- import core from 'sass';
2
- import { Context } from '../../types/index.js';
3
- export declare const sass: (options?: core.Options<"sync"> | undefined) => {
4
- name: string;
5
- next: (context: Context) => void;
6
- };
@@ -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
- };
@@ -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,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
- };