@htmlplus/element 0.5.6 → 0.5.7

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 (36) hide show
  1. package/bundlers/rollup.js +2 -2
  2. package/bundlers/vite.js +2 -2
  3. package/client/decorators/listen.d.ts +3 -3
  4. package/client/decorators/listen.js +3 -3
  5. package/client/decorators/watch.js +3 -3
  6. package/client/utils/appendToMethod.js +12 -4
  7. package/client/utils/request.js +2 -2
  8. package/client/utils/task.js +5 -5
  9. package/compiler/compiler.d.ts +1 -1
  10. package/compiler/compiler.js +11 -23
  11. package/compiler/plugins/assets.d.ts +2 -5
  12. package/compiler/plugins/assets.js +2 -2
  13. package/compiler/plugins/copy.d.ts +3 -7
  14. package/compiler/plugins/copy.js +3 -3
  15. package/compiler/plugins/customElement.d.ts +2 -5
  16. package/compiler/plugins/customElement.js +2 -2
  17. package/compiler/plugins/customElementReact/customElementReact.d.ts +2 -5
  18. package/compiler/plugins/document.d.ts +2 -5
  19. package/compiler/plugins/extract.d.ts +2 -5
  20. package/compiler/plugins/extract.js +2 -2
  21. package/compiler/plugins/parse.d.ts +2 -5
  22. package/compiler/plugins/parse.js +2 -2
  23. package/compiler/plugins/read.d.ts +2 -5
  24. package/compiler/plugins/read.js +2 -2
  25. package/compiler/plugins/readme.d.ts +2 -5
  26. package/compiler/plugins/style.d.ts +2 -5
  27. package/compiler/plugins/style.js +2 -2
  28. package/compiler/plugins/validate.d.ts +2 -5
  29. package/compiler/plugins/validate.js +2 -2
  30. package/compiler/plugins/visualStudioCode.d.ts +2 -5
  31. package/compiler/plugins/webTypes.d.ts +2 -5
  32. package/constants/index.d.ts +1 -1
  33. package/constants/index.js +1 -1
  34. package/package.json +1 -1
  35. package/types/context.d.ts +0 -5
  36. package/types/plugin.d.ts +4 -4
@@ -1,6 +1,6 @@
1
1
  import { compiler } from '../compiler/index.js';
2
2
  export const rollup = (...plugins) => {
3
- const { start, next, finish } = compiler(...plugins);
3
+ const { start, run, finish } = compiler(...plugins);
4
4
  return {
5
5
  name: 'htmlplus',
6
6
  async buildStart() {
@@ -9,7 +9,7 @@ export const rollup = (...plugins) => {
9
9
  async load(id) {
10
10
  if (!id.endsWith('.tsx'))
11
11
  return;
12
- const { isInvalid, script } = await next(id);
12
+ const { isInvalid, script } = await run(id);
13
13
  if (isInvalid)
14
14
  return;
15
15
  return script;
package/bundlers/vite.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import path from 'path';
2
2
  import { compiler } from '../compiler/index.js';
3
3
  export const vite = (...plugins) => {
4
- const { start, next, finish } = compiler(...plugins);
4
+ const { start, run, finish } = compiler(...plugins);
5
5
  return {
6
6
  name: 'htmlplus',
7
7
  async buildStart() {
@@ -10,7 +10,7 @@ export const vite = (...plugins) => {
10
10
  async load(id) {
11
11
  if (!id.endsWith('.tsx'))
12
12
  return;
13
- let { isInvalid, script, stylePath } = await next(id);
13
+ let { isInvalid, script, stylePath } = await run(id);
14
14
  if (isInvalid)
15
15
  return;
16
16
  if (script && stylePath) {
@@ -12,9 +12,9 @@ export interface ListenOptions {
12
12
  export declare const ListenOptionsDefault: ListenOptions;
13
13
  /**
14
14
  * Will be called whenever the specified event is delivered to the target.
15
- * [More](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener).
16
- * @param type TODO
17
- * @param options TODO
15
+ * [More](https://mdn.io/addEventListener).
16
+ * @param type A case-sensitive string representing the [event type](https://mdn.io/events) to listen for.
17
+ * @param options An object that specifies characteristics about the event listener.
18
18
  */
19
19
  export declare function Listen(type: string, options?: ListenOptions): (target: PlusElement, propertyKey: PropertyKey, descriptor: PropertyDescriptor) => {
20
20
  configurable: boolean;
@@ -9,9 +9,9 @@ export const ListenOptionsDefault = {
9
9
  };
10
10
  /**
11
11
  * Will be called whenever the specified event is delivered to the target.
12
- * [More](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener).
13
- * @param type TODO
14
- * @param options TODO
12
+ * [More](https://mdn.io/addEventListener).
13
+ * @param type A case-sensitive string representing the [event type](https://mdn.io/events) to listen for.
14
+ * @param options An object that specifies characteristics about the event listener.
15
15
  */
16
16
  export function Listen(type, options) {
17
17
  return function (target, propertyKey, descriptor) {
@@ -15,15 +15,15 @@ export function Watch(keys, immediate) {
15
15
  // Registers a lifecycle to detect changes.
16
16
  appendToMethod(target, CONSTANTS.LIFECYCLE_UPDATED, function (states) {
17
17
  // Skips the logic if 'immediate' wasn't passed.
18
- if (!immediate && !this[CONSTANTS.API_LOADED])
18
+ if (!immediate && !this[CONSTANTS.API_RENDER_COMPLETED])
19
19
  return;
20
20
  // Loops the keys.
21
- states.forEach((prev, key) => {
21
+ states.forEach((previous, key) => {
22
22
  // Skips the current key.
23
23
  if (all.length && !all.includes(key))
24
24
  return;
25
25
  // Invokes the method with parameters.
26
- this[propertyKey](this[key], prev, key);
26
+ this[propertyKey](this[key], previous, key);
27
27
  });
28
28
  });
29
29
  };
@@ -1,7 +1,15 @@
1
1
  export const appendToMethod = (target, propertyKey, handler) => {
2
- const callback = target[propertyKey];
3
- target[propertyKey] = function (...parameters) {
2
+ // Gets the previous function
3
+ const previous = target[propertyKey];
4
+ // Creates new function
5
+ function next(...parameters) {
6
+ // Calls the previous
7
+ const result = previous === null || previous === void 0 ? void 0 : previous.bind(this)(...parameters);
8
+ // Calls the appended
4
9
  handler.bind(this)(...parameters);
5
- return callback === null || callback === void 0 ? void 0 : callback.bind(this)(...parameters);
6
- };
10
+ // Returns the result
11
+ return result;
12
+ }
13
+ // Replaces the next with the previous one
14
+ target[propertyKey] = next;
7
15
  };
@@ -55,10 +55,10 @@ export const request = (target, name, previous, callback) => {
55
55
  });
56
56
  // Calls the lifecycle's callback after the rendering phase.
57
57
  call(target, CONSTANTS.LIFECYCLE_UPDATED, states);
58
- // TODO: releated to the @Watch decorator.
59
- target[CONSTANTS.API_LOADED] = true;
60
58
  // Clears stacks.
61
59
  stacks.clear();
60
+ // TODO: releated to the @Watch decorator.
61
+ target[CONSTANTS.API_RENDER_COMPLETED] = true;
62
62
  }
63
63
  }));
64
64
  // Calls the micro task.
@@ -1,23 +1,23 @@
1
1
  export const task = (options) => {
2
- let isPending, updatePromise;
2
+ let isPending, promise;
3
3
  const run = () => {
4
4
  if (options.canStart && !options.canStart())
5
5
  return Promise.resolve(false);
6
6
  if (!isPending)
7
- updatePromise = enqueue();
8
- return updatePromise;
7
+ promise = enqueue();
8
+ return promise;
9
9
  };
10
10
  const enqueue = async () => {
11
11
  isPending = true;
12
12
  try {
13
- await updatePromise;
13
+ await promise;
14
14
  }
15
15
  catch (error) {
16
16
  Promise.reject(error);
17
17
  }
18
18
  // TODO: maybe is optional
19
19
  if (!isPending)
20
- return updatePromise;
20
+ return promise;
21
21
  try {
22
22
  if (options.canRun && !options.canRun())
23
23
  return (isPending = false);
@@ -1,6 +1,6 @@
1
1
  import { Context, Plugin } from '../types';
2
2
  export declare const compiler: (...plugins: Array<Plugin>) => {
3
3
  start: () => Promise<void>;
4
- next: (filePath: string) => Promise<Context>;
4
+ run: (filePath: string) => Promise<Context>;
5
5
  finish: () => Promise<void>;
6
6
  };
@@ -19,38 +19,26 @@ export const compiler = (...plugins) => {
19
19
  if (!plugin.start)
20
20
  continue;
21
21
  log(`Plugin '${plugin.name}' is starting...`);
22
- await plugin.start(global);
22
+ global = (await plugin.start(global)) || global;
23
23
  log(`Plugin '${plugin.name}' started successfully.`);
24
24
  }
25
25
  log(`Plugins started successfully.`, true);
26
26
  };
27
- const next = async (filePath) => {
28
- var _a;
27
+ const run = async (filePath) => {
29
28
  const key = filePath.split(/[\/|\\]/g).pop();
30
29
  let context = {
31
30
  filePath
32
31
  };
33
32
  for (const plugin of plugins) {
34
- if (!plugin.next)
33
+ if (!plugin.run)
35
34
  continue;
36
35
  log(`Plugin '${plugin.name}' is executing on '${path.basename(filePath)}' file.`);
37
- const output = await plugin.next(context, global);
38
- // TODO
39
- if (output) {
40
- context.outputs = ((_a = context.outputs) !== null && _a !== void 0 ? _a : [])
41
- .filter((output) => {
42
- if (plugin.name != output.name)
43
- return true;
44
- if (plugin.options && plugin.options != output.options)
45
- return true;
46
- })
47
- .concat({
48
- name: plugin.name,
49
- options: plugin.options,
50
- output
51
- });
52
- }
53
- global.contexts = global.contexts.filter((current) => current.filePath != context.filePath).concat(context);
36
+ context = (await plugin.run(context, global)) || context;
37
+ global.contexts = global.contexts
38
+ .filter((current) => {
39
+ return current.filePath != context.filePath;
40
+ })
41
+ .concat(context);
54
42
  log(`Plugin '${plugin.name}' executed successfully on '${path.basename(filePath)}' file.`);
55
43
  if (context.isInvalid)
56
44
  break;
@@ -66,11 +54,11 @@ export const compiler = (...plugins) => {
66
54
  if (!plugin.finish)
67
55
  continue;
68
56
  log(`Plugin '${plugin.name}' is finishing...`);
69
- await plugin.finish(global);
57
+ global = (await plugin.finish(global)) || global;
70
58
  log(`Plugin '${plugin.name}' finished successfully.`);
71
59
  }
72
60
  log(`Plugins finished successfully.`, true);
73
61
  log(`Finished.`, true);
74
62
  };
75
- return { start, next, finish };
63
+ return { start, run, finish };
76
64
  };
@@ -1,11 +1,8 @@
1
- import { Context } from '../../types';
1
+ import { Context, Plugin } from '../../types';
2
2
  export declare const ASSETS_OPTIONS: Partial<AssetsOptions>;
3
3
  export type AssetsOptions = {
4
4
  once?: boolean;
5
5
  destination: (context: Context) => string;
6
6
  source?: (context: Context) => string;
7
7
  };
8
- export declare const assets: (options: AssetsOptions) => {
9
- name: string;
10
- next: (context: Context) => void;
11
- };
8
+ export declare const assets: (options: AssetsOptions) => Plugin;
@@ -13,7 +13,7 @@ export const assets = (options) => {
13
13
  const name = 'assets';
14
14
  options = Object.assign({}, ASSETS_OPTIONS, options);
15
15
  const sources = new Set();
16
- const next = (context) => {
16
+ const run = (context) => {
17
17
  var _a, _b;
18
18
  const source = (_a = options.source) === null || _a === void 0 ? void 0 : _a.call(options, context);
19
19
  if (!source)
@@ -29,5 +29,5 @@ export const assets = (options) => {
29
29
  fs.copySync(source, destination);
30
30
  context.assets = source;
31
31
  };
32
- return { name, next };
32
+ return { name, run };
33
33
  };
@@ -1,13 +1,9 @@
1
+ import { Plugin } from '../../types';
1
2
  export declare const COPY_OPTIONS: Partial<CopyOptions>;
2
3
  export interface CopyOptions {
3
- at?: 'start' | 'next' | 'finish';
4
+ at?: 'start' | 'run' | 'finish';
4
5
  destination: string;
5
6
  source: string;
6
7
  transformer?: (content: string) => string;
7
8
  }
8
- export declare const copy: (options: CopyOptions) => {
9
- name: string;
10
- start: () => void;
11
- next: () => void;
12
- finish: () => void;
13
- };
9
+ export declare const copy: (options: CopyOptions) => Plugin;
@@ -19,11 +19,11 @@ export const copy = (options) => {
19
19
  const start = () => {
20
20
  copy('start');
21
21
  };
22
- const next = () => {
23
- copy('next');
22
+ const run = () => {
23
+ copy('run');
24
24
  };
25
25
  const finish = () => {
26
26
  copy('finish');
27
27
  };
28
- return { name, start, next, finish };
28
+ return { name, start, run, finish };
29
29
  };
@@ -1,9 +1,6 @@
1
- import { Context } from '../../types';
1
+ import { Plugin } from '../../types';
2
2
  export declare const CUSTOM_ELEMENT_OPTIONS: Partial<CustomElementOptions>;
3
3
  export interface CustomElementOptions {
4
4
  typings?: boolean;
5
5
  }
6
- export declare const customElement: (options?: CustomElementOptions) => {
7
- name: string;
8
- next: (context: Context) => void;
9
- };
6
+ export declare const customElement: (options?: CustomElementOptions) => Plugin;
@@ -10,7 +10,7 @@ export const CUSTOM_ELEMENT_OPTIONS = {
10
10
  export const customElement = (options) => {
11
11
  const name = 'customElement';
12
12
  options = Object.assign({}, CUSTOM_ELEMENT_OPTIONS, options);
13
- const next = (context) => {
13
+ const run = (context) => {
14
14
  const ast = t.cloneNode(context.fileAST, true);
15
15
  // attaches name
16
16
  visitor(ast, {
@@ -209,5 +209,5 @@ export const customElement = (options) => {
209
209
  // TODO
210
210
  context.script = print(ast);
211
211
  };
212
- return { name, next };
212
+ return { name, run };
213
213
  };
@@ -1,4 +1,4 @@
1
- import { Context, Global } from '../../../types';
1
+ import { Context, Plugin } from '../../../types';
2
2
  export declare const CUSTOM_ELEMENT_REACT_OPTIONS: Partial<CustomElementReactOptions>;
3
3
  export interface CustomElementReactOptions {
4
4
  compact?: boolean;
@@ -13,7 +13,4 @@ export interface CustomElementReactOptions {
13
13
  local: string;
14
14
  };
15
15
  }
16
- export declare const customElementReact: (options: CustomElementReactOptions) => {
17
- name: string;
18
- finish: (global: Global) => void;
19
- };
16
+ export declare const customElementReact: (options: CustomElementReactOptions) => Plugin;
@@ -1,10 +1,7 @@
1
- import { Context, Global } from '../../types';
1
+ import { Context, Plugin } from '../../types';
2
2
  export declare const DOCUMENT_OPTIONS: Partial<DocumentOptions>;
3
3
  export interface DocumentOptions {
4
4
  destination: string;
5
5
  transformer?: (context: Context, element: any) => any;
6
6
  }
7
- export declare const document: (options: DocumentOptions) => {
8
- name: string;
9
- finish: (global: Global) => void;
10
- };
7
+ export declare const document: (options: DocumentOptions) => Plugin;
@@ -1,9 +1,6 @@
1
- import { Context } from '../../types';
1
+ import { Plugin } from '../../types';
2
2
  export declare const EXTRACT_OPTIONS: Partial<ExtractOptions>;
3
3
  export interface ExtractOptions {
4
4
  prefix?: string;
5
5
  }
6
- export declare const extract: (options?: ExtractOptions) => {
7
- name: string;
8
- next: (context: Context) => void;
9
- };
6
+ export declare const extract: (options?: ExtractOptions) => Plugin;
@@ -7,7 +7,7 @@ export const EXTRACT_OPTIONS = {};
7
7
  export const extract = (options) => {
8
8
  const name = 'extract';
9
9
  options = Object.assign({}, EXTRACT_OPTIONS, options);
10
- const next = (context) => {
10
+ const run = (context) => {
11
11
  var _a, _b;
12
12
  visitor(context.fileAST, {
13
13
  ClassDeclaration: {
@@ -71,5 +71,5 @@ export const extract = (options) => {
71
71
  context.classHasUnmount = (context.classMembers || []).some((member) => member['key'].name == CONSTANTS.LIFECYCLE_DISCONNECTED);
72
72
  context.classRender = (context.classMembers || []).find((member) => member['key'].name == CONSTANTS.METHOD_RENDER);
73
73
  };
74
- return { name, next };
74
+ return { name, run };
75
75
  };
@@ -1,8 +1,5 @@
1
1
  import { ParserOptions } from '@babel/parser';
2
- import { Context } from '../../types';
2
+ import { Plugin } from '../../types';
3
3
  export declare const PARSE_OPTIONS: Partial<ParseOptions>;
4
4
  export type ParseOptions = ParserOptions;
5
- export declare const parse: (options?: ParseOptions) => {
6
- name: string;
7
- next: (context: Context) => void;
8
- };
5
+ export declare const parse: (options?: ParseOptions) => Plugin;
@@ -6,9 +6,9 @@ export const PARSE_OPTIONS = {
6
6
  export const parse = (options) => {
7
7
  const name = 'parse';
8
8
  options = Object.assign({}, PARSE_OPTIONS, options);
9
- const next = (context) => {
9
+ const run = (context) => {
10
10
  var _a;
11
11
  context.fileAST = (_a = context.fileAST) !== null && _a !== void 0 ? _a : parser(context.fileContent, options);
12
12
  };
13
- return { name, next };
13
+ return { name, run };
14
14
  };
@@ -1,11 +1,8 @@
1
1
  /// <reference types="node" />
2
- import { Context } from '../../types';
2
+ import { Plugin } from '../../types';
3
3
  export declare const READ_OPTIONS: Partial<ReadOptions>;
4
4
  export type ReadOptions = {
5
5
  encoding: BufferEncoding;
6
6
  flag?: string | undefined;
7
7
  };
8
- export declare const read: (options?: ReadOptions) => {
9
- name: string;
10
- next: (context: Context) => void;
11
- };
8
+ export declare const read: (options?: ReadOptions) => Plugin;
@@ -5,9 +5,9 @@ export const READ_OPTIONS = {
5
5
  export const read = (options) => {
6
6
  const name = 'read';
7
7
  options = Object.assign({}, READ_OPTIONS, options);
8
- const next = (context) => {
8
+ const run = (context) => {
9
9
  var _a;
10
10
  context.fileContent = (_a = context.fileContent) !== null && _a !== void 0 ? _a : fs.readFileSync(context.filePath, options);
11
11
  };
12
- return { name, next };
12
+ return { name, run };
13
13
  };
@@ -1,9 +1,6 @@
1
- import { Context, Global } from '../../types';
1
+ import { Context, Plugin } from '../../types';
2
2
  export declare const README_OPTIONS: Partial<ReadmeOptions>;
3
3
  export type ReadmeOptions = {
4
4
  source?: (context: Context) => string;
5
5
  };
6
- export declare const readme: (options: ReadmeOptions) => {
7
- name: string;
8
- finish: (global: Global) => void;
9
- };
6
+ export declare const readme: (options: ReadmeOptions) => Plugin;
@@ -1,9 +1,6 @@
1
- import { Context } from '../../types';
1
+ import { Context, Plugin } from '../../types';
2
2
  export declare const STYLE_OPTIONS: Partial<StyleOptions>;
3
3
  export type StyleOptions = {
4
4
  source?: (context: Context) => string | string[];
5
5
  };
6
- export declare const style: (options?: StyleOptions) => {
7
- name: string;
8
- next: (context: Context) => void;
9
- };
6
+ export declare const style: (options?: StyleOptions) => Plugin;
@@ -17,7 +17,7 @@ export const STYLE_OPTIONS = {
17
17
  export const style = (options) => {
18
18
  const name = 'style';
19
19
  options = Object.assign({}, STYLE_OPTIONS, options);
20
- const next = (context) => {
20
+ const run = (context) => {
21
21
  var _a;
22
22
  const sources = [(_a = options === null || options === void 0 ? void 0 : options.source) === null || _a === void 0 ? void 0 : _a.call(options, context)].flat();
23
23
  for (const source of sources) {
@@ -37,5 +37,5 @@ export const style = (options) => {
37
37
  t.addComment(property, 'leading', CONSTANTS.COMMENT_AUTO_ADDED_PROPERTY, true);
38
38
  context.class.body.body.unshift(property);
39
39
  };
40
- return { name, next };
40
+ return { name, run };
41
41
  };
@@ -1,5 +1,2 @@
1
- import { Context } from '../../types';
2
- export declare const validate: () => {
3
- name: string;
4
- next: (context: Context) => void;
5
- };
1
+ import { Plugin } from '../../types';
2
+ export declare const validate: () => Plugin;
@@ -2,7 +2,7 @@ import * as CONSTANTS from '../../constants/index.js';
2
2
  import { hasDecorator, visitor } from '../utils/index.js';
3
3
  export const validate = () => {
4
4
  const name = 'validate';
5
- const next = (context) => {
5
+ const run = (context) => {
6
6
  let hasValidImport;
7
7
  visitor(context.fileAST, {
8
8
  ImportDeclaration(path) {
@@ -33,5 +33,5 @@ export const validate = () => {
33
33
  });
34
34
  context.isInvalid = !hasValidImport || !hasValidExport;
35
35
  };
36
- return { name, next };
36
+ return { name, run };
37
37
  };
@@ -1,9 +1,6 @@
1
- import { Global } from '../../types';
1
+ import { Plugin } from '../../types';
2
2
  export declare const VISUAL_STUDIO_CODE_OPTIONS: Partial<VisualStudioCodeOptions>;
3
3
  export interface VisualStudioCodeOptions {
4
4
  destination: string;
5
5
  }
6
- export declare const visualStudioCode: (options: VisualStudioCodeOptions) => {
7
- name: string;
8
- finish: (global: Global) => void;
9
- };
6
+ export declare const visualStudioCode: (options: VisualStudioCodeOptions) => Plugin;
@@ -1,4 +1,4 @@
1
- import { Context, Global } from '../../types';
1
+ import { Context, Plugin } from '../../types';
2
2
  export declare const WEB_TYPES_OPTIONS: Partial<WebTypesOptions>;
3
3
  export interface WebTypesOptions {
4
4
  destination: string;
@@ -7,7 +7,4 @@ export interface WebTypesOptions {
7
7
  reference?: (context: Context) => string;
8
8
  transformer?: (context: Context, component: any) => any;
9
9
  }
10
- export declare const webTypes: (options: WebTypesOptions) => {
11
- name: string;
12
- finish: (global: Global) => void;
13
- };
10
+ export declare const webTypes: (options: WebTypesOptions) => Plugin;
@@ -3,9 +3,9 @@ export declare const API_ATTRIBUTES_SYNCER: unique symbol;
3
3
  export declare const API_CONNECTED: unique symbol;
4
4
  export declare const API_HOST: unique symbol;
5
5
  export declare const API_INSTANCE: unique symbol;
6
- export declare const API_LOADED: unique symbol;
7
6
  export declare const API_LOCKED: unique symbol;
8
7
  export declare const API_REQUEST: unique symbol;
8
+ export declare const API_RENDER_COMPLETED: unique symbol;
9
9
  export declare const API_STACKS: unique symbol;
10
10
  export declare const COMMENT_AUTO_ADDED_DEPENDENCY = " THIS DEPENDENCY IS AUTO-ADDED, DO NOT EDIT MANUALY";
11
11
  export declare const COMMENT_AUTO_ADDED_PROPERTY = " THIS PROPERTY IS AUTO-ADDED, DO NOT EDIT MANUALY";
@@ -4,9 +4,9 @@ export const API_ATTRIBUTES_SYNCER = Symbol();
4
4
  export const API_CONNECTED = Symbol();
5
5
  export const API_HOST = Symbol();
6
6
  export const API_INSTANCE = Symbol();
7
- export const API_LOADED = Symbol();
8
7
  export const API_LOCKED = Symbol();
9
8
  export const API_REQUEST = Symbol();
9
+ export const API_RENDER_COMPLETED = Symbol();
10
10
  export const API_STACKS = Symbol();
11
11
  // comments
12
12
  export const COMMENT_AUTO_ADDED_DEPENDENCY = ' THIS DEPENDENCY IS AUTO-ADDED, DO NOT EDIT MANUALY';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@htmlplus/element",
3
- "version": "0.5.6",
3
+ "version": "0.5.7",
4
4
  "license": "MIT",
5
5
  "author": "Masood Abdolian <m.abdolian@gmail.com>",
6
6
  "description": "A powerful library for building scalable, reusable, fast, tastable and lightweight design system for any web technologies. Powerd by Web Component.",
@@ -3,11 +3,6 @@ export interface Context {
3
3
  customElementNames?: Array<string>;
4
4
  isInvalid?: boolean;
5
5
  script?: string;
6
- outputs?: Array<{
7
- name: string;
8
- options?: any;
9
- output?: any;
10
- }>;
11
6
  assets?: string;
12
7
  class?: ClassDeclaration;
13
8
  classEvents?: Array<ClassProperty>;
package/types/plugin.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import { Context } from './context';
2
2
  import { Global } from './global';
3
- export type Return<T> = void | T | Promise<T>;
3
+ export type Return<T> = void | T | Promise<void | T>;
4
4
  export type Plugin = {
5
5
  name: string;
6
6
  options?: any;
7
- start?: (global: Global) => Return<void>;
8
- next?: (context: Context, global: Global) => Return<any>;
9
- finish?: (global: Global) => Return<void>;
7
+ start?: (global: Global) => Return<Global>;
8
+ run?: (context: Context, global: Global) => Return<Context>;
9
+ finish?: (global: Global) => Return<Global>;
10
10
  };