@manyducks.co/dolla 2.0.0-alpha.21 → 2.0.0-alpha.22

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 (35) hide show
  1. package/dist/{modules/render.d.ts → core/batch.d.ts} +4 -1
  2. package/dist/{modules → core}/dolla.d.ts +9 -9
  3. package/dist/{markup.d.ts → core/markup.d.ts} +2 -2
  4. package/dist/{nodes → core/nodes}/cond.d.ts +1 -1
  5. package/dist/{nodes → core/nodes}/observer.d.ts +1 -1
  6. package/dist/{nodes → core/nodes}/portal.d.ts +1 -1
  7. package/dist/{view.d.ts → core/view.d.ts} +4 -4
  8. package/dist/index.d.ts +9 -8
  9. package/dist/index.js +604 -1015
  10. package/dist/index.js.map +1 -1
  11. package/dist/jsx-dev-runtime.d.ts +2 -2
  12. package/dist/jsx-dev-runtime.js +3 -3
  13. package/dist/jsx-dev-runtime.js.map +1 -1
  14. package/dist/jsx-runtime.d.ts +3 -3
  15. package/dist/jsx-runtime.js +2 -2
  16. package/dist/jsx-runtime.js.map +1 -1
  17. package/dist/modules/i18n.d.ts +2 -2
  18. package/dist/modules/router.d.ts +16 -28
  19. package/dist/passthrough-CrReqVVB.js +1442 -0
  20. package/dist/passthrough-CrReqVVB.js.map +1 -0
  21. package/dist/typeChecking.d.ts +1 -1
  22. package/dist/types.d.ts +2 -2
  23. package/dist/utils.d.ts +13 -0
  24. package/dist/views/default-crash-view.d.ts +1 -1
  25. package/dist/views/passthrough.d.ts +2 -2
  26. package/package.json +3 -5
  27. package/dist/passthrough-6Lrg96Id.js +0 -1393
  28. package/dist/passthrough-6Lrg96Id.js.map +0 -1
  29. /package/dist/{nodes → core/nodes}/html.d.ts +0 -0
  30. /package/dist/{nodes → core/nodes}/outlet.d.ts +0 -0
  31. /package/dist/{nodes → core/nodes}/repeat.d.ts +0 -0
  32. /package/dist/{nodes → core/nodes}/text.d.ts +0 -0
  33. /package/dist/{state.d.ts → core/state.d.ts} +0 -0
  34. /package/dist/{routing.d.ts → modules/router.utils.d.ts} +0 -0
  35. /package/dist/{routing.test.d.ts → modules/router.utils.test.d.ts} +0 -0
@@ -1,2 +1,2 @@
1
- export function jsxDEV(element: any, props: any, key: any, isStaticChildren: any, source: any, self: any): import("./markup.ts").Markup;
2
- export { Passthrough as Fragment } from "./views/passthrough.ts";
1
+ export function jsxDEV(element: any, props: any, key: any, isStaticChildren: any, source: any, self: any): import("./core/markup").Markup;
2
+ export { Passthrough as Fragment } from "./views/passthrough";
@@ -1,6 +1,6 @@
1
- import { s } from "./passthrough-6Lrg96Id.js";
2
- import { P as m } from "./passthrough-6Lrg96Id.js";
3
- function d(n, r, t, e, a, l) {
1
+ import { u as s } from "./passthrough-CrReqVVB.js";
2
+ import { P as m } from "./passthrough-CrReqVVB.js";
3
+ function d(n, r, t, e, u, a) {
4
4
  const i = { ...o(["children", "key"], r) }, c = Array.isArray(r.children) ? r.children : [r.children];
5
5
  return s(n, i, ...c);
6
6
  }
@@ -1 +1 @@
1
- {"version":3,"file":"jsx-dev-runtime.js","sources":["../src/jsx-dev-runtime.js"],"sourcesContent":["import { createMarkup } from \"./markup.ts\";\nexport { Passthrough as Fragment } from \"./views/passthrough.ts\";\n\nexport function jsxDEV(element, props, key, isStaticChildren, source, self) {\n const attributes = { ...omit([\"children\", \"key\"], props) };\n const children = Array.isArray(props.children) ? props.children : [props.children];\n\n return createMarkup(element, attributes, ...children);\n}\n\nfunction omit(keys, object) {\n const result = {};\n for (const key in object) {\n if (!keys.includes(key)) {\n result[key] = object[key];\n }\n }\n return result;\n}\n"],"names":["jsxDEV","element","props","key","isStaticChildren","source","self","attributes","omit","children","createMarkup","keys","object","result"],"mappings":";;AAGO,SAASA,EAAOC,GAASC,GAAOC,GAAKC,GAAkBC,GAAQC,GAAM;AAC1E,QAAMC,IAAa,EAAE,GAAGC,EAAK,CAAC,YAAY,KAAK,GAAGN,CAAK,EAAG,GACpDO,IAAW,MAAM,QAAQP,EAAM,QAAQ,IAAIA,EAAM,WAAW,CAACA,EAAM,QAAQ;AAEjF,SAAOQ,EAAaT,GAASM,GAAY,GAAGE,CAAQ;AACtD;AAEA,SAASD,EAAKG,GAAMC,GAAQ;AAC1B,QAAMC,IAAS,CAAE;AACjB,aAAWV,KAAOS;AAChB,IAAKD,EAAK,SAASR,CAAG,MACpBU,EAAOV,CAAG,IAAIS,EAAOT,CAAG;AAG5B,SAAOU;AACT;"}
1
+ {"version":3,"file":"jsx-dev-runtime.js","sources":["../src/jsx-dev-runtime.js"],"sourcesContent":["import { createMarkup } from \"./core/markup\";\nexport { Passthrough as Fragment } from \"./views/passthrough\";\n\nexport function jsxDEV(element, props, key, isStaticChildren, source, self) {\n const attributes = { ...omit([\"children\", \"key\"], props) };\n const children = Array.isArray(props.children) ? props.children : [props.children];\n\n return createMarkup(element, attributes, ...children);\n}\n\nfunction omit(keys, object) {\n const result = {};\n for (const key in object) {\n if (!keys.includes(key)) {\n result[key] = object[key];\n }\n }\n return result;\n}\n"],"names":["jsxDEV","element","props","key","isStaticChildren","source","self","attributes","omit","children","createMarkup","keys","object","result"],"mappings":";;AAGO,SAASA,EAAOC,GAASC,GAAOC,GAAKC,GAAkBC,GAAQC,GAAM;AAC1E,QAAMC,IAAa,EAAE,GAAGC,EAAK,CAAC,YAAY,KAAK,GAAGN,CAAK,EAAG,GACpDO,IAAW,MAAM,QAAQP,EAAM,QAAQ,IAAIA,EAAM,WAAW,CAACA,EAAM,QAAQ;AAEjF,SAAOQ,EAAaT,GAASM,GAAY,GAAGE,CAAQ;AACtD;AAEA,SAASD,EAAKG,GAAMC,GAAQ;AAC1B,QAAMC,IAAS,CAAE;AACjB,aAAWV,KAAOS;AAChB,IAAKD,EAAK,SAASR,CAAG,MACpBU,EAAOV,CAAG,IAAIS,EAAOT,CAAG;AAG5B,SAAOU;AACT;"}
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * JSX function for elements with dynamic children.
3
3
  */
4
- export function jsx(element: any, props: any, key: any): import("./markup.ts").Markup;
4
+ export function jsx(element: any, props: any, key: any): import("./core/markup").Markup;
5
5
  /**
6
6
  * JSX function for elements with static children.
7
7
  */
8
- export function jsxs(element: any, props: any, key: any): import("./markup.ts").Markup;
9
- export { Passthrough as Fragment } from "./views/passthrough.ts";
8
+ export function jsxs(element: any, props: any, key: any): import("./core/markup").Markup;
9
+ export { Passthrough as Fragment } from "./views/passthrough";
@@ -1,5 +1,5 @@
1
- import { s as t } from "./passthrough-6Lrg96Id.js";
2
- import { P as l } from "./passthrough-6Lrg96Id.js";
1
+ import { u as t } from "./passthrough-CrReqVVB.js";
2
+ import { P as l } from "./passthrough-CrReqVVB.js";
3
3
  function d(n, e, r) {
4
4
  return t(n, e ? { ...u(["children", "key"], e) } : void 0, e.children);
5
5
  }
@@ -1 +1 @@
1
- {"version":3,"file":"jsx-runtime.js","sources":["../src/jsx-runtime.js"],"sourcesContent":["import { createMarkup } from \"./markup.ts\";\nexport { Passthrough as Fragment } from \"./views/passthrough.ts\";\n\n/**\n * JSX function for elements with dynamic children.\n */\nexport function jsx(element, props, key) {\n return createMarkup(element, props ? { ...omit([\"children\", \"key\"], props) } : undefined, ...[props.children]);\n}\n\n/**\n * JSX function for elements with static children.\n */\nexport function jsxs(element, props, key) {\n return createMarkup(element, props ? { ...omit([\"children\", \"key\"], props) } : undefined, props.children);\n}\n\nfunction omit(keys, object) {\n const result = {};\n for (const key in object) {\n if (!keys.includes(key)) {\n result[key] = object[key];\n }\n }\n return result;\n}\n"],"names":["jsx","element","props","key","createMarkup","omit","jsxs","keys","object","result"],"mappings":";;AAMO,SAASA,EAAIC,GAASC,GAAOC,GAAK;AACvC,SAAOC,EAAaH,GAASC,IAAQ,EAAE,GAAGG,EAAK,CAAC,YAAY,KAAK,GAAGH,CAAK,EAAC,IAAK,QAAeA,EAAM,QAAS;AAC/G;AAKO,SAASI,EAAKL,GAASC,GAAOC,GAAK;AACxC,SAAOC,EAAaH,GAASC,IAAQ,EAAE,GAAGG,EAAK,CAAC,YAAY,KAAK,GAAGH,CAAK,EAAC,IAAK,QAAWA,EAAM,QAAQ;AAC1G;AAEA,SAASG,EAAKE,GAAMC,GAAQ;AAC1B,QAAMC,IAAS,CAAE;AACjB,aAAWN,KAAOK;AAChB,IAAKD,EAAK,SAASJ,CAAG,MACpBM,EAAON,CAAG,IAAIK,EAAOL,CAAG;AAG5B,SAAOM;AACT;"}
1
+ {"version":3,"file":"jsx-runtime.js","sources":["../src/jsx-runtime.js"],"sourcesContent":["import { createMarkup } from \"./core/markup\";\nexport { Passthrough as Fragment } from \"./views/passthrough\";\n\n/**\n * JSX function for elements with dynamic children.\n */\nexport function jsx(element, props, key) {\n return createMarkup(element, props ? { ...omit([\"children\", \"key\"], props) } : undefined, ...[props.children]);\n}\n\n/**\n * JSX function for elements with static children.\n */\nexport function jsxs(element, props, key) {\n return createMarkup(element, props ? { ...omit([\"children\", \"key\"], props) } : undefined, props.children);\n}\n\nfunction omit(keys, object) {\n const result = {};\n for (const key in object) {\n if (!keys.includes(key)) {\n result[key] = object[key];\n }\n }\n return result;\n}\n"],"names":["jsx","element","props","key","createMarkup","omit","jsxs","keys","object","result"],"mappings":";;AAMO,SAASA,EAAIC,GAASC,GAAOC,GAAK;AACvC,SAAOC,EAAaH,GAASC,IAAQ,EAAE,GAAGG,EAAK,CAAC,YAAY,KAAK,GAAGH,CAAK,EAAC,IAAK,QAAeA,EAAM,QAAS;AAC/G;AAKO,SAASI,EAAKL,GAASC,GAAOC,GAAK;AACxC,SAAOC,EAAaH,GAASC,IAAQ,EAAE,GAAGG,EAAK,CAAC,YAAY,KAAK,GAAGH,CAAK,EAAC,IAAK,QAAWA,EAAM,QAAQ;AAC1G;AAEA,SAASG,EAAKE,GAAMC,GAAQ;AAC1B,QAAMC,IAAS,CAAE;AACjB,aAAWN,KAAOK;AAChB,IAAKD,EAAK,SAASJ,CAAG,MACpBM,EAAON,CAAG,IAAIK,EAAOL,CAAG;AAG5B,SAAOM;AACT;"}
@@ -1,5 +1,5 @@
1
- import { type MaybeState, type State } from "../state.js";
2
- import type { Dolla } from "./dolla.js";
1
+ import { type MaybeState, type State } from "../core/state.js";
2
+ import type { Dolla } from "../core/dolla.js";
3
3
  /**
4
4
  * A JSON object of translated strings. Values can be string templates or nested objects.
5
5
  */
@@ -1,6 +1,6 @@
1
1
  import { type Stringable } from "../types.js";
2
- import { type ViewElement, type ViewFunction } from "../view.js";
3
- import type { Dolla } from "./dolla.js";
2
+ import { type ViewElement, type ViewFunction } from "../core/view.js";
3
+ import type { Dolla } from "../core/dolla.js";
4
4
  export interface RouteMatchContext {
5
5
  /**
6
6
  * Redirects the user to a different route instead of matching the current one.
@@ -79,24 +79,12 @@ export interface NavigateOptions {
79
79
  */
80
80
  preserveQuery?: boolean;
81
81
  }
82
- export declare enum RoutingStyle {
83
- /**
84
- * Constructs routes like "https://www.example.com/#/sub/route" which work without any server-side setup.
85
- * A good choice if your app has no backend.
86
- */
87
- hash = "hash",
88
- /**
89
- * Constructs routes like "https://www.example.com/sub/route" which look nicer (subjective?) than hash routes and are what most users will expect URLs to look like, but require additional backend setup.
90
- * Path routing requires you to configure your backend to redirect to the app's index.html when subpaths are requested.
91
- */
92
- path = "path"
93
- }
94
82
  export interface RouterSetupOptions {
95
83
  routes: Route[];
96
84
  /**
97
- * The routing style to use; "hash" will construct routes like "https://www.example.com/#/sub/route" which work without any server-side setup, while "path" will construct routes that use paths directly.
85
+ * When true, the router will construct routes like "https://www.example.com/#/sub/route" which work without any backend intervention.
98
86
  */
99
- style?: RoutingStyle;
87
+ hash?: boolean;
100
88
  }
101
89
  export interface RouterElements {
102
90
  readonly rootElement?: HTMLElement;
@@ -107,29 +95,21 @@ export declare class Router {
107
95
  /**
108
96
  * The currently matched route pattern, if any.
109
97
  */
110
- $pattern: import("../state.js").State<string | null>;
98
+ $pattern: import("../core/state.js").State<string | null>;
111
99
  /**
112
100
  * The current URL path.
113
101
  */
114
- $path: import("../state.js").State<string>;
102
+ $path: import("../core/state.js").State<string>;
115
103
  /**
116
104
  * The current named path params.
117
105
  */
118
- $params: import("../state.js").State<ParsedParams>;
106
+ $params: import("../core/state.js").State<ParsedParams>;
119
107
  /**
120
108
  * The current query params. Changes to this object will be reflected in the URL.
121
109
  */
122
- $query: import("../state.js").State<ParsedQuery>;
110
+ $query: import("../core/state.js").State<ParsedQuery>;
123
111
  constructor(dolla: Dolla, elements: RouterElements);
124
112
  setup(options: RouterSetupOptions): void;
125
- /**
126
- * Navigates to another route.
127
- *
128
- * @example
129
- * Dolla.router.go("/login"); // navigate to `/login`
130
- * Dolla.router.go["/users", 215], { replace: true }); // replace current history entry with `/users/215`
131
- */
132
- go(path: Stringable | Stringable[], options?: NavigateOptions): void;
133
113
  /**
134
114
  * Navigate backward. Pass a number of steps to hit the back button that many times.
135
115
  */
@@ -138,6 +118,14 @@ export declare class Router {
138
118
  * Navigate forward. Pass a number of steps to hit the forward button that many times.
139
119
  */
140
120
  forward(steps?: number): void;
121
+ /**
122
+ * Navigates to another route.
123
+ *
124
+ * @example
125
+ * Dolla.router.go("/login"); // navigate to `/login`
126
+ * Dolla.router.go["/users", 215], { replace: true }); // replace current history entry with `/users/215`
127
+ */
128
+ go(path: Stringable | Stringable[], options?: NavigateOptions): void;
141
129
  }
142
130
  /**
143
131
  * Intercepts links within the root node.