@esportsplus/template 0.18.0 → 0.19.0

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,6 +1,5 @@
1
1
  import { effect } from '@esportsplus/reactivity';
2
2
  import { isArray, isObject, isString } from '@esportsplus/utilities';
3
- import { ondisconnect } from './slot/cleanup.js';
4
3
  import { STATE_HYDRATING, STATE_NONE, STATE_WAITING } from './constants.js';
5
4
  import { className, removeAttribute, setAttribute } from './utilities/element.js';
6
5
  import { raf } from './utilities/queue.js';
@@ -46,7 +45,7 @@ function set(context, name, value, state) {
46
45
  else {
47
46
  context.store[EFFECT] ??= 0;
48
47
  let id = context.store[EFFECT]++;
49
- ondisconnect(context.element, effect(() => {
48
+ effect(() => {
50
49
  let v = value(context.element);
51
50
  if (isArray(v)) {
52
51
  let last = v.length - 1;
@@ -59,7 +58,7 @@ function set(context, name, value, state) {
59
58
  else {
60
59
  update(context, id, name, v, state);
61
60
  }
62
- }));
61
+ });
63
62
  state = STATE_NONE;
64
63
  }
65
64
  }
@@ -8,18 +8,11 @@ declare const NODE_WHITELIST: Record<string, number>;
8
8
  declare const REGEX_EMPTY_TEXT_NODES: RegExp;
9
9
  declare const REGEX_SLOT_NODES: RegExp;
10
10
  declare const RENDERABLE: unique symbol;
11
- declare const RENDERABLE_ARRAY = 0;
12
- declare const RENDERABLE_FRAGMENT = 1;
13
- declare const RENDERABLE_HTML_FRAGMENT = 2;
14
- declare const RENDERABLE_HTML_REACTIVE_ARRAY = 3;
15
- declare const RENDERABLE_NODE = 4;
16
- declare const RENDERABLE_NODE_LIST = 5;
17
- declare const RENDERABLE_TEXT = 6;
18
- declare const RENDERABLE_VOID = 7;
11
+ declare const RENDERABLE_HTML_REACTIVE_ARRAY = 1;
19
12
  declare const SLOT_HTML = "<!--$-->";
20
13
  declare const SLOT_MARKER = "{{$}}";
21
14
  declare const SLOT_MARKER_LENGTH: number;
22
15
  declare const STATE_HYDRATING = 0;
23
16
  declare const STATE_NONE = 1;
24
17
  declare const STATE_WAITING = 2;
25
- export { CLEANUP, EMPTY_FRAGMENT, NODE_CLOSING, NODE_ELEMENT, NODE_SLOT, NODE_VOID, NODE_WHITELIST, REGEX_EMPTY_TEXT_NODES, REGEX_SLOT_NODES, RENDERABLE, RENDERABLE_ARRAY, RENDERABLE_FRAGMENT, RENDERABLE_HTML_FRAGMENT, RENDERABLE_HTML_REACTIVE_ARRAY, RENDERABLE_NODE, RENDERABLE_NODE_LIST, RENDERABLE_TEXT, RENDERABLE_VOID, SLOT_HTML, SLOT_MARKER, SLOT_MARKER_LENGTH, STATE_HYDRATING, STATE_NONE, STATE_WAITING };
18
+ export { CLEANUP, EMPTY_FRAGMENT, NODE_CLOSING, NODE_ELEMENT, NODE_SLOT, NODE_VOID, NODE_WHITELIST, REGEX_EMPTY_TEXT_NODES, REGEX_SLOT_NODES, RENDERABLE, RENDERABLE_HTML_REACTIVE_ARRAY, SLOT_HTML, SLOT_MARKER, SLOT_MARKER_LENGTH, STATE_HYDRATING, STATE_NONE, STATE_WAITING };
@@ -29,18 +29,11 @@ const NODE_WHITELIST = {
29
29
  const REGEX_EMPTY_TEXT_NODES = /(>|})\s+(<|{)/g;
30
30
  const REGEX_SLOT_NODES = /<([\w-]+|[\/!])(?:([^><]*{{\$}}[^><]*)|(?:[^><]*))?>|{{\$}}/g;
31
31
  const RENDERABLE = Symbol();
32
- const RENDERABLE_ARRAY = 0;
33
- const RENDERABLE_FRAGMENT = 1;
34
- const RENDERABLE_HTML_FRAGMENT = 2;
35
- const RENDERABLE_HTML_REACTIVE_ARRAY = 3;
36
- const RENDERABLE_NODE = 4;
37
- const RENDERABLE_NODE_LIST = 5;
38
- const RENDERABLE_TEXT = 6;
39
- const RENDERABLE_VOID = 7;
32
+ const RENDERABLE_HTML_REACTIVE_ARRAY = 1;
40
33
  const SLOT_HTML = '<!--$-->';
41
34
  const SLOT_MARKER = '{{$}}';
42
35
  const SLOT_MARKER_LENGTH = SLOT_MARKER.length;
43
36
  const STATE_HYDRATING = 0;
44
37
  const STATE_NONE = 1;
45
38
  const STATE_WAITING = 2;
46
- export { CLEANUP, EMPTY_FRAGMENT, NODE_CLOSING, NODE_ELEMENT, NODE_SLOT, NODE_VOID, NODE_WHITELIST, REGEX_EMPTY_TEXT_NODES, REGEX_SLOT_NODES, RENDERABLE, RENDERABLE_ARRAY, RENDERABLE_FRAGMENT, RENDERABLE_HTML_FRAGMENT, RENDERABLE_HTML_REACTIVE_ARRAY, RENDERABLE_NODE, RENDERABLE_NODE_LIST, RENDERABLE_TEXT, RENDERABLE_VOID, SLOT_HTML, SLOT_MARKER, SLOT_MARKER_LENGTH, STATE_HYDRATING, STATE_NONE, STATE_WAITING };
39
+ export { CLEANUP, EMPTY_FRAGMENT, NODE_CLOSING, NODE_ELEMENT, NODE_SLOT, NODE_VOID, NODE_WHITELIST, REGEX_EMPTY_TEXT_NODES, REGEX_SLOT_NODES, RENDERABLE, RENDERABLE_HTML_REACTIVE_ARRAY, SLOT_HTML, SLOT_MARKER, SLOT_MARKER_LENGTH, STATE_HYDRATING, STATE_NONE, STATE_WAITING };