@manyducks.co/dolla 2.0.0-alpha.49 → 2.0.0-alpha.50

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.
@@ -11,6 +11,10 @@ export interface ElementContext {
11
11
  * Stores attached to this context.
12
12
  */
13
13
  stores: Map<StoreFunction<any, any>, Store<any, any>>;
14
+ /**
15
+ * The nearest view.
16
+ */
17
+ view?: View<any>;
14
18
  /**
15
19
  * A reference to the parent context.
16
20
  */
@@ -22,7 +26,9 @@ export interface ElementContext {
22
26
  /**
23
27
  * The name of the nearest parent view.
24
28
  */
25
- viewName?: string;
29
+ /**
30
+ * The context of the nearest parent view.
31
+ */
26
32
  /**
27
33
  * Current route layer of the nearest view.
28
34
  */
@@ -15,6 +15,7 @@ export declare class HTML implements MarkupElement {
15
15
  private children;
16
16
  private unsubscribers;
17
17
  private elementContext;
18
+ private logger;
18
19
  private ref?;
19
20
  private canClickAway;
20
21
  get isMounted(): boolean;
@@ -2,6 +2,7 @@ import type { ComponentContext, ElementContext, StoreConsumerContext, StoreProvi
2
2
  import type { Logger } from "../dolla.js";
3
3
  import { type Markup, type MarkupElement } from "../markup.js";
4
4
  import { type Signal, type EffectCallback, type UnsubscribeFunction } from "../signals-api.js";
5
+ import { StoreFunction } from "../store.js";
5
6
  import { IS_MARKUP_ELEMENT } from "../symbols.js";
6
7
  /**
7
8
  * Any valid value that a View can return.
@@ -49,6 +50,24 @@ export interface ViewContext extends Omit<Logger, "setName">, ComponentContext,
49
50
  */
50
51
  outlet(): Markup;
51
52
  }
53
+ interface Context extends Omit<Logger, "setName"> {
54
+ }
55
+ declare class Context implements ViewContext {
56
+ private view;
57
+ constructor(view: View<any>);
58
+ get uid(): string;
59
+ get isMounted(): boolean;
60
+ get name(): string;
61
+ set name(value: string);
62
+ provide<Value>(store: StoreFunction<any, Value>, options?: any): Value;
63
+ get<Value>(store: StoreFunction<any, Value>): Value;
64
+ beforeMount(callback: () => void): void;
65
+ onMount(callback: () => void): void;
66
+ beforeUnmount(callback: () => void): void;
67
+ onUnmount(callback: () => void): void;
68
+ effect(callback: EffectCallback): UnsubscribeFunction;
69
+ outlet(): Markup;
70
+ }
52
71
  export declare class View<P> implements ViewElement {
53
72
  [IS_MARKUP_ELEMENT]: boolean;
54
73
  uniqueId: string;
@@ -59,6 +78,8 @@ export declare class View<P> implements ViewElement {
59
78
  };
60
79
  fn: ViewFunction<P>;
61
80
  element?: MarkupElement;
81
+ name: string;
82
+ context: Context;
62
83
  lifecycleListeners: {
63
84
  beforeMount: (() => any)[];
64
85
  mount: (() => any)[];
@@ -73,3 +94,4 @@ export declare class View<P> implements ViewElement {
73
94
  setRouteView(fn: ViewFunction<{}>): View<{}>;
74
95
  private _initialize;
75
96
  }
97
+ export {};
@@ -1,8 +1,8 @@
1
- import { m } from "./markup-D67RWnAp.js";
1
+ import { m } from "./markup-DZdmoqTk.js";
2
2
  function a(r, n) {
3
3
  return m("$dynamic", { source: () => r.children });
4
4
  }
5
5
  export {
6
6
  a as F
7
7
  };
8
- //# sourceMappingURL=fragment-CTSra5ph.js.map
8
+ //# sourceMappingURL=fragment-DjTOSAcw.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fragment-CTSra5ph.js","sources":["../src/core/views/fragment.ts"],"sourcesContent":["import type { Renderable } from \"../../types.js\";\nimport { markup } from \"../markup.js\";\nimport { type ViewContext } from \"../nodes/view.js\";\n\n/**\n * A utility view that displays its children.\n */\nexport function Fragment(props: { children?: Renderable }, ctx: ViewContext) {\n return markup(\"$dynamic\", { source: () => props.children });\n}\n"],"names":["Fragment","props","ctx","markup"],"mappings":";AAOgB,SAAAA,EAASC,GAAkCC,GAAkB;AAC3E,SAAOC,EAAO,YAAY,EAAE,QAAQ,MAAMF,EAAM,UAAU;AAC5D;"}
1
+ {"version":3,"file":"fragment-DjTOSAcw.js","sources":["../src/core/views/fragment.ts"],"sourcesContent":["import type { Renderable } from \"../../types.js\";\nimport { markup } from \"../markup.js\";\nimport { type ViewContext } from \"../nodes/view.js\";\n\n/**\n * A utility view that displays its children.\n */\nexport function Fragment(props: { children?: Renderable }, ctx: ViewContext) {\n return markup(\"$dynamic\", { source: () => props.children });\n}\n"],"names":["Fragment","props","ctx","markup"],"mappings":";AAOgB,SAAAA,EAASC,GAAkCC,GAAkB;AAC3E,SAAOC,EAAO,YAAY,EAAE,QAAQ,MAAMF,EAAM,UAAU;AAC5D;"}
package/dist/index.js CHANGED
@@ -13,8 +13,8 @@ var _t = (i, t, e, s) => ({
13
13
  return a(i, t, s);
14
14
  }
15
15
  });
16
- import { a as Kt, b as Ft, i as H, I as Ot, $ as R, c as Jt, p as Mt, d as Xt, e as D, f as q, s as xt, g as Yt, t as Pt, h as ht, m as M, w as Zt, j as Tt, S as te, k as qt, l as Lt, V as ee, n as se, o as re, q as ne, r as ie } from "./markup-D67RWnAp.js";
17
- import { u as Ce, x as Ve, y as De, v as Ae, z as We } from "./markup-D67RWnAp.js";
16
+ import { a as Kt, b as Ft, i as H, I as Ot, $ as R, c as Jt, p as Mt, d as Xt, e as D, f as q, s as xt, g as Yt, t as Pt, h as ht, m as M, w as Zt, j as Tt, S as te, k as qt, l as Lt, V as ee, n as se, o as re, q as ne, r as ie } from "./markup-DZdmoqTk.js";
17
+ import { u as Ce, x as Ve, y as De, v as Ae, z as We } from "./markup-DZdmoqTk.js";
18
18
  function Nt(i, t) {
19
19
  return t.outlet();
20
20
  }
@@ -1014,8 +1014,7 @@ class xe {
1014
1014
  f(this, ot, []);
1015
1015
  f(this, N, {
1016
1016
  root: this,
1017
- stores: /* @__PURE__ */ new Map(),
1018
- viewName: "Dolla"
1017
+ stores: /* @__PURE__ */ new Map()
1019
1018
  });
1020
1019
  f(this, lt, {
1021
1020
  info: "development",