@htmlplus/element 0.3.0 → 0.3.3

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 +5 -5
  2. package/{dist/client → client}/decorators/attributes.d.ts +0 -0
  3. package/{dist/client → client}/decorators/attributes.js +0 -0
  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 +0 -0
  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 +0 -0
  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 +0 -0
  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 +0 -0
  56. package/{dist/client → client}/utils/get-styles.d.ts +0 -0
  57. package/{dist/client → client}/utils/get-styles.js +0 -0
  58. package/{dist/client → client}/utils/host.d.ts +0 -0
  59. package/{dist/client → client}/utils/host.js +0 -0
  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 +0 -0
  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 +0 -0
  70. package/{dist/client → client}/utils/parse-value.d.ts +0 -0
  71. package/{dist/client → client}/utils/parse-value.js +0 -0
  72. package/{dist/client → client}/utils/render.d.ts +0 -0
  73. package/{dist/client → client}/utils/render.js +0 -0
  74. package/{dist/client → client}/utils/request.d.ts +0 -0
  75. package/{dist/client → client}/utils/request.js +0 -0
  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/{dist/compiler → compiler}/compiler.js +0 -0
  90. package/{dist/compiler → compiler}/index.d.ts +0 -0
  91. package/{dist/compiler → compiler}/index.js +0 -0
  92. package/{dist/compiler → compiler}/plugins/componentDependencyResolver.d.ts +0 -0
  93. package/{dist/compiler → compiler}/plugins/componentDependencyResolver.js +0 -0
  94. package/{dist/compiler → compiler}/plugins/customElement.d.ts +0 -0
  95. package/{dist/compiler → compiler}/plugins/customElement.js +0 -0
  96. package/{dist/compiler → compiler}/plugins/customElementReact/customElementReact.d.ts +0 -0
  97. package/{dist/compiler → compiler}/plugins/customElementReact/customElementReact.js +0 -0
  98. package/{dist/compiler → compiler}/plugins/customElementReact/index.d.ts +0 -0
  99. package/{dist/compiler → compiler}/plugins/customElementReact/index.js +0 -0
  100. package/{dist/compiler → compiler}/plugins/customElementReact/templates/README.md.hbs +0 -0
  101. package/{dist/compiler → compiler}/plugins/customElementReact/templates/_.gitignore.hbs +0 -0
  102. package/{dist/compiler → compiler}/plugins/customElementReact/templates/package.json.hbs +0 -0
  103. package/{dist/compiler → compiler}/plugins/customElementReact/templates/rollup.config.js.hbs +0 -0
  104. package/{dist/compiler → compiler}/plugins/customElementReact/templates/src/components/index.ts.hbs +0 -0
  105. package/{dist/compiler → compiler}/plugins/customElementReact/templates/src/components/{{fileName}}.compact.ts.hbs +0 -0
  106. package/{dist/compiler → compiler}/plugins/customElementReact/templates/src/components/{{fileName}}.ts.hbs +0 -0
  107. package/{dist/compiler → compiler}/plugins/customElementReact/templates/src/index.ts.hbs +0 -0
  108. package/{dist/compiler → compiler}/plugins/customElementReact/templates/src/proxy.ts.hbs +0 -0
  109. package/{dist/compiler → 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 +0 -0
  114. package/{dist/compiler → compiler}/plugins/index.d.ts +0 -0
  115. package/{dist/compiler → compiler}/plugins/index.js +0 -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/{dist/compiler → compiler}/plugins/style.d.ts +1 -3
  121. package/{dist/compiler → compiler}/plugins/style.js +2 -8
  122. package/{dist/compiler → compiler}/plugins/validate.d.ts +0 -0
  123. package/{dist/compiler → compiler}/plugins/validate.js +0 -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/constants → constants}/index.d.ts +0 -0
  149. package/{dist/constants → constants}/index.js +0 -0
  150. package/package.json +8 -45
  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 +0 -0
  154. /package/{dist/types → types}/context.js +0 -0
  155. /package/{dist/types → types}/global.d.ts +0 -0
  156. /package/{dist/types → types}/global.js +0 -0
  157. /package/{dist/types → types}/index.d.ts +0 -0
  158. /package/{dist/types → types}/index.js +0 -0
  159. /package/{dist/types → types}/plugin.d.ts +0 -0
  160. /package/{dist/types → types}/plugin.js +0 -0
  161. /package/{dist/types → types}/plus-element.d.ts +0 -0
  162. /package/{dist/types → types}/plus-element.js +0 -0
package/README.md CHANGED
@@ -941,16 +941,16 @@ const { start, next, finish } = compiler(...plugins);
941
941
  TODO
942
942
 
943
943
  ```js
944
- import compiler from '@htmlplus/element/compiler';
945
- import { read, parse, extract, attach, uhtml, print } from '@htmlplus/element/compiler';
944
+ import compiler from '@htmlplus/element/compiler/index.js';
945
+ import { customElement, extract, parse, read, style, validate } from '@htmlplus/element/compiler/index.js';
946
946
 
947
947
  const { start, next, finish } = compiler(
948
948
  read(),
949
949
  parse(),
950
+ validate(),
950
951
  extract(),
951
- attach(),
952
- uhtml(),
953
- print(),
952
+ style(),
953
+ customElement(),
954
954
  );
955
955
 
956
956
  await start();
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,10 +1,8 @@
1
- import { Options } from 'sass';
2
1
  import { Context } from '../../types/index.js';
3
2
  export declare type StyleOptions = {
4
- extensions?: Array<'scss' | 'css'>;
3
+ extensions?: Array<string>;
5
4
  directory?: (context: Context) => string;
6
5
  filename?: (context: Context) => string;
7
- sass?: Options<'sync'>;
8
6
  };
9
7
  export declare const style: (options: StyleOptions) => {
10
8
  name: string;
@@ -1,7 +1,6 @@
1
1
  import t from '@babel/types';
2
2
  import fs from 'fs';
3
3
  import path from 'path';
4
- import core from 'sass';
5
4
  import * as CONSTANTS from '../../constants/index.js';
6
5
  const defaults = {
7
6
  extensions: ['scss', 'css'],
@@ -27,13 +26,8 @@ export const style = (options) => {
27
26
  }
28
27
  if (!context.stylePath)
29
28
  return;
30
- const { css, loadedUrls } = core.compile(context.stylePath, Object.assign(Object.assign({}, (options.sass || {})), { style: 'compressed' }));
31
- context.styleParsed = css.toString();
32
- // TODO loadedUrls;
33
- context.styleDependencies = [];
34
- if (!context.styleParsed)
35
- return;
36
- context.class.body.body.unshift(t.classProperty(t.identifier(CONSTANTS.STATIC_STYLES), t.stringLiteral(context.styleParsed), undefined, null, undefined, true));
29
+ context.fileAST.program.body.unshift(t.importDeclaration([t.importDefaultSpecifier(t.identifier('AUTO_IMPORT_STYLE'))], t.stringLiteral(context.stylePath + '?inline')));
30
+ context.class.body.body.unshift(t.classProperty(t.identifier(CONSTANTS.STATIC_STYLES), t.identifier('AUTO_IMPORT_STYLE'), undefined, null, undefined, true));
37
31
  };
38
32
  return {
39
33
  name,
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/package.json CHANGED
@@ -1,10 +1,12 @@
1
1
  {
2
2
  "name": "@htmlplus/element",
3
- "version": "0.3.0",
3
+ "version": "0.3.3",
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": "./client/index.js",
9
+ "types": "./client/index.d.ts",
8
10
  "scripts": {
9
11
  "prebuild": "npm run clean",
10
12
  "build": "tsc",
@@ -15,50 +17,12 @@
15
17
  "dev:start": "node src/dev/scripts/start.js",
16
18
  "dev:build": "node src/dev/scripts/build.js"
17
19
  },
18
- "exports": {
19
- ".": {
20
- "default": "./dist/client/index.js"
21
- },
22
- "./compiler": {
23
- "default": "./dist/compiler/index.js"
24
- },
25
- "./decorators": {
26
- "default": "./dist/client/decorators/index.js"
27
- },
28
- "./helpers": {
29
- "default": "./dist/client/helpers/index.js"
30
- },
31
- "./runtime": {
32
- "default": "./dist/runtime/index.js"
33
- },
34
- "./services": {
35
- "default": "./dist/client/services/index.js"
36
- }
37
- },
38
- "typesVersions": {
39
- "*": {
40
- "*": [
41
- "./dist/client/index.d.ts"
42
- ],
43
- "compiler": [
44
- "./dist/compiler/index.d.ts"
45
- ],
46
- "decorators": [
47
- "./dist/client/decorators/index.d.ts"
48
- ],
49
- "helpers": [
50
- "./dist/client/helpers/index.d.ts"
51
- ],
52
- "runtime": [
53
- "./dist/runtime/index.d.ts"
54
- ],
55
- "services": [
56
- "./dist/client/services/index.d.ts"
57
- ]
58
- }
59
- },
60
20
  "files": [
61
- "dist",
21
+ "client",
22
+ "compiler",
23
+ "constants",
24
+ "runtime",
25
+ "types",
62
26
  "package.json",
63
27
  "README.md"
64
28
  ],
@@ -84,7 +48,6 @@
84
48
  "fast-glob": "^3.2.11",
85
49
  "handlebars": "^4.7.7",
86
50
  "log-update": "^5.0.0",
87
- "sass": "^1.43.4",
88
51
  "ts-node": "^10.4.0",
89
52
  "typescript": "^4.5.2",
90
53
  "uhtml": "^2.7.6"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes