apprun 3.28.9 → 3.28.10

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.
@@ -1 +1 @@
1
- {"version":3,"file":"web-component.js","sourceRoot":"","sources":["../src/web-component.ts"],"names":[],"mappings":"AAUA,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,cAAc,EAAE,UAAgC,EAAE,EAAE,EAAE,CAAC,MAAM,aAAc,SAAQ,WAAW;IAM1H;QACE,KAAK,EAAE,CAAC;IACV,CAAC;IACD,IAAI,SAAS,KAAK,OAAO,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;IAC3C,IAAI,KAAK,KAAK,OAAO,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;IAE7C,MAAM,KAAK,kBAAkB;QAC3B,kEAAkE;QAClE,OAAO,CAAC,OAAO,CAAC,kBAAkB,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED,iBAAiB;QACf,IAAI,IAAI,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;YACxC,MAAM,IAAI,GAAG,OAAO,IAAI,EAAE,CAAC;YAC3B,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;YAC5E,MAAM,kBAAkB,GAAG,CAAC,IAAI,CAAC,kBAAkB,IAAI,EAAE,CAAC,CAAA;YAE1D,MAAM,OAAO,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;gBACtD,MAAM,EAAE,GAAG,IAAI,CAAC,WAAW,EAAE,CAAA;gBAC7B,IAAI,EAAE,KAAK,IAAI,EAAE;oBACf,GAAG,CAAC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AA;aACH;SACF;IACH,CAAC;CACF,CAAA;AAED,eAAe,CAAC,IAAY,EAAE,cAAc,EAAE,OAA8B,EAAE,EAAE;IAC9E,CAAC,OAAO,cAAc,KAAK,WAAW,CAAC,IAAI,cAAc,CAAC,MAAM,CAAC,IAAI,EAAE,aAAa,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC,CAAA;AAChH,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apprun",
3
- "version": "3.28.9",
3
+ "version": "3.28.10",
4
4
  "description": "JavaScript library that has Elm inspired architecture, event pub-sub and components",
5
5
  "main": "dist/apprun.js",
6
6
  "module": "dist/apprun.esm.js",
@@ -43,17 +43,17 @@
43
43
  "@types/jest": "^27.4.1",
44
44
  "jest": "^27.5.1",
45
45
  "json-loader": "^0.5.7",
46
- "lit-html": "^2.2.0",
46
+ "lit-html": "^2.2.1",
47
47
  "marked": "^4.0.12",
48
- "rollup": "^2.68.0",
48
+ "rollup": "^2.70.1",
49
49
  "rollup-plugin-filesize": "^9.1.2",
50
50
  "rollup-plugin-node-resolve": "^5.2.0",
51
51
  "rollup-plugin-sourcemaps": "^0.6.3",
52
52
  "rollup-plugin-terser": "^7.0.2",
53
53
  "ts-jest": "^27.1.3",
54
- "ts-loader": "^9.2.6",
55
- "typescript": "^4.5.5",
56
- "webpack": "^5.69.1",
54
+ "ts-loader": "^9.2.8",
55
+ "typescript": "^4.6.2",
56
+ "webpack": "^5.70.0",
57
57
  "webpack-cli": "^4.9.2",
58
58
  "webpack-dev-server": "^4.7.4"
59
59
  },
package/src/component.ts CHANGED
@@ -144,7 +144,7 @@ export class Component<T = any, E = any> {
144
144
 
145
145
  if (options.route) {
146
146
  this.update = this.update || {};
147
- this.update[options.route] = REFRESH;
147
+ if (!this.update[options.route]) this.update[options.route] = REFRESH;
148
148
  }
149
149
 
150
150
  this.add_actions();
package/src/directive.ts CHANGED
@@ -19,15 +19,15 @@ const apply_directive = (key: string, props: {}, tag, component) => {
19
19
  const event = props[key];
20
20
  key = key.substring(1)
21
21
  if (typeof event === 'boolean') {
22
- props[key] = e => component.run(key, e);
22
+ props[key] = e => component.run ? component.run(key, e) : app.run(key, e);
23
23
  } else if (typeof event === 'string') {
24
- props[key] = e => component.run(event, e);
24
+ props[key] = e => component.run ? component.run(event, e) : app.run(event, e);
25
25
  } else if (typeof event === 'function') {
26
26
  props[key] = e => component.setState(event(component.state, e));
27
27
  } else if (Array.isArray(event)) {
28
28
  const [handler, ...p] = event;
29
29
  if (typeof handler === 'string') {
30
- props[key] = e => component.run(handler, ...p, e);
30
+ props[key] = e => component.run ? component.run(handler, ...p, e) : app.run(handler, ...p, e);
31
31
  } else if (typeof handler === 'function') {
32
32
  props[key] = e => component.setState(handler(component.state, ...p, e));
33
33
  }
@@ -4,6 +4,7 @@ import { createElement, updateElement, Fragment } from './vdom-my';
4
4
  import { render, svg, html, noChange, nothing } from 'lit-html';
5
5
  import { directive, Directive, Part, PartInfo, PartType, EventPart } from 'lit-html/directive.js';
6
6
  import { unsafeHTML } from 'lit-html/directives/unsafe-html.js';
7
+ import app from './apprun';
7
8
 
8
9
  function _render(element, vdom, parent?) {
9
10
  if (!vdom) return;
@@ -45,7 +46,10 @@ export class RunDirective extends Directive {
45
46
  }
46
47
  const [event, ...args] = params;
47
48
  if (typeof event === 'string') {
48
- element[`on${name}`] = e => getComponent().run(event, ...args, e);
49
+ element[`on${name}`] = e => {
50
+ const component = getComponent();
51
+ component ? component.run(event, ...args, e) : app.run(event, ...args, e)
52
+ }
49
53
  } else if (typeof event === 'function') {
50
54
  element[`on${name}`] = e => getComponent().setState(event(getComponent().state, ...args, e));
51
55
  }
package/src/vdom-my.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { VDOM, VNode } from './types';
2
+ import directive from './directive';
2
3
  export type Element = any; //HTMLElement | SVGSVGElement | SVGElement;
3
4
 
4
5
  export function Fragment(props, ...children): any[] {
@@ -36,10 +37,14 @@ export function createElement(tag: string | Function | [], props?: {}, ...childr
36
37
 
37
38
  const keyCache = new WeakMap();
38
39
 
39
- export const updateElement = render;
40
+ export const updateElement = (element: Element, nodes: VDOM, component = {}) => {
41
+ // tslint:disable-next-line
42
+ if (nodes == null || nodes === false) return;
43
+ nodes = directive(nodes, component);
44
+ render(element, nodes, component);
45
+ }
40
46
 
41
- export function render(element: Element, nodes: VDOM, parent = {}) {
42
- // console.log('render', element, node);
47
+ function render(element: Element, nodes: VDOM, parent = {}) {
43
48
  // tslint:disable-next-line
44
49
  if (nodes == null || nodes === false) return;
45
50
 
package/src/vdom.ts CHANGED
@@ -1,7 +1,4 @@
1
1
  import { createElement, updateElement, Fragment } from './vdom-my';
2
- export function render(element, html, parent?) {
3
- updateElement(element, html, parent);
4
- }
5
- export { createElement, Fragment };
2
+ export { createElement, Fragment, updateElement as render};
6
3
 
7
4
 
@@ -59,20 +59,22 @@ export const customElement = (componentClass, options: CustomElementOptions = {}
59
59
  });
60
60
  })
61
61
 
62
- const children = this.children ? Array.from(this.children) : [];
63
- children.forEach(el => el.parentElement.removeChild(el));
64
- this._component = new componentClass({ ...props, children }).mount(this._shadowRoot, opts);
65
- // attach props to component
66
- this._component._props = props;
67
- // expose dispatchEvent
68
- this._component.dispatchEvent = this.dispatchEvent.bind(this)
69
- if (this._component.mounted) {
70
- const new_state = this._component.mounted(props, children, this._component.state);
71
- if (typeof new_state !== 'undefined') this._component.state = new_state;
72
- }
73
- this.on = this._component.on.bind(this._component);
74
- this.run = this._component.run.bind(this._component);
75
- if (!(opts.render===false)) this._component.run('.');
62
+ requestAnimationFrame(() => {
63
+ const children = this.children ? Array.from(this.children) : [];
64
+ children.forEach(el => el.parentElement.removeChild(el));
65
+ this._component = new componentClass({ ...props, children }).mount(this._shadowRoot, opts);
66
+ // attach props to component
67
+ this._component._props = props;
68
+ // expose dispatchEvent
69
+ this._component.dispatchEvent = this.dispatchEvent.bind(this)
70
+ if (this._component.mounted) {
71
+ const new_state = this._component.mounted(props, children, this._component.state);
72
+ if (typeof new_state !== 'undefined') this._component.state = new_state;
73
+ }
74
+ this.on = this._component.on.bind(this._component);
75
+ this.run = this._component.run.bind(this._component);
76
+ if (!(opts.render === false)) this._component.run('.');
77
+ });
76
78
  }
77
79
  }
78
80