mates-devtools 0.1.0-beta.5 → 0.1.0-beta.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.
- package/dist/mates-devtools.es.js +953 -835
- package/dist/mates-devtools.umd.js +190 -179
- package/dist/types/Mates-DevTools/src/MatesDevTools.d.ts.map +1 -1
- package/dist/types/Mates-DevTools/src/MatesDevToolsComponent.d.ts.map +1 -1
- package/dist/types/Mates-DevTools/src/components/Header.d.ts +3 -2
- package/dist/types/Mates-DevTools/src/components/Header.d.ts.map +1 -1
- package/dist/types/Mates-DevTools/src/components/UserLogsViewer.d.ts +6 -0
- package/dist/types/Mates-DevTools/src/components/UserLogsViewer.d.ts.map +1 -0
- package/dist/types/Mates-DevTools/src/userLogStore.d.ts +26 -0
- package/dist/types/Mates-DevTools/src/userLogStore.d.ts.map +1 -0
- package/dist/types/lib/Directives/animationClasses.d.ts +1 -1
- package/dist/types/lib/Directives/customEvent.d.ts +74 -0
- package/dist/types/lib/Directives/customEvent.d.ts.map +1 -0
- package/dist/types/lib/Directives/disappear.d.ts +23 -0
- package/dist/types/lib/Directives/disappear.d.ts.map +1 -0
- package/dist/types/lib/Directives/eleHook.d.ts.map +1 -1
- package/dist/types/lib/Directives/htmlHook.d.ts.map +1 -1
- package/dist/types/lib/Directives/index.d.ts +5 -3
- package/dist/types/lib/Directives/index.d.ts.map +1 -1
- package/dist/types/lib/Directives/onDirective.d.ts.map +1 -1
- package/dist/types/lib/Directives/onParentDirective.d.ts +1 -1
- package/dist/types/lib/Directives/timerDirective.d.ts +6 -6
- package/dist/types/lib/Directives/timerDirective.d.ts.map +1 -1
- package/dist/types/lib/Directives/virtualHelpers.d.ts +8 -6
- package/dist/types/lib/Directives/virtualHelpers.d.ts.map +1 -1
- package/dist/types/lib/Fetch/Fetch.d.ts +59 -13
- package/dist/types/lib/Fetch/Fetch.d.ts.map +1 -1
- package/dist/types/lib/MatesUtils/FetchUtils.d.ts +23 -0
- package/dist/types/lib/MatesUtils/FetchUtils.d.ts.map +1 -0
- package/dist/types/lib/MatesUtils/MatesUtils.d.ts +47 -0
- package/dist/types/lib/MatesUtils/MatesUtils.d.ts.map +1 -0
- package/dist/types/lib/MatesUtils/RouterUtils.d.ts +39 -0
- package/dist/types/lib/MatesUtils/RouterUtils.d.ts.map +1 -0
- package/dist/types/lib/MatesUtils/StorageUtils.d.ts +16 -0
- package/dist/types/lib/MatesUtils/StorageUtils.d.ts.map +1 -0
- package/dist/types/lib/MatesUtils/ThemeUtils.d.ts +18 -0
- package/dist/types/lib/MatesUtils/ThemeUtils.d.ts.map +1 -0
- package/dist/types/lib/MatesUtils/index.d.ts +6 -0
- package/dist/types/lib/MatesUtils/index.d.ts.map +1 -0
- package/dist/types/lib/Mutables/Extended Atoms/changeFlagAtom.d.ts +56 -0
- package/dist/types/lib/Mutables/Extended Atoms/changeFlagAtom.d.ts.map +1 -0
- package/dist/types/lib/Mutables/Extended Atoms/index.d.ts +1 -0
- package/dist/types/lib/Mutables/Extended Atoms/index.d.ts.map +1 -1
- package/dist/types/lib/Mutables/Extended Atoms/themeAtom.d.ts +3 -15
- package/dist/types/lib/Mutables/Extended Atoms/themeAtom.d.ts.map +1 -1
- package/dist/types/lib/Mutables/atom/atom.d.ts.map +1 -1
- package/dist/types/lib/Mutables/atom/delayAtom.d.ts +40 -0
- package/dist/types/lib/Mutables/atom/delayAtom.d.ts.map +1 -0
- package/dist/types/lib/Mutables/atom/index.d.ts +2 -1
- package/dist/types/lib/Mutables/atom/index.d.ts.map +1 -1
- package/dist/types/lib/Mutables/atom/storageAtom.d.ts +9 -31
- package/dist/types/lib/Mutables/atom/storageAtom.d.ts.map +1 -1
- package/dist/types/lib/Mutables/atom/titleAtom.d.ts +3 -9
- package/dist/types/lib/Mutables/atom/titleAtom.d.ts.map +1 -1
- package/dist/types/lib/Mutables/form/formAtom.d.ts +7 -5
- package/dist/types/lib/Mutables/form/formAtom.d.ts.map +1 -1
- package/dist/types/lib/Mutables/scope/scope.d.ts +32 -1
- package/dist/types/lib/Mutables/scope/scope.d.ts.map +1 -1
- package/dist/types/lib/Mutables/useStore/hostContext.d.ts.map +1 -1
- package/dist/types/lib/Mutables/useStore/subscription.d.ts +1 -1
- package/dist/types/lib/Mutables/useStore/subscription.d.ts.map +1 -1
- package/dist/types/lib/Router/Router.d.ts +2 -2
- package/dist/types/lib/Router/Router.d.ts.map +1 -1
- package/dist/types/lib/Router/animatedRouter.d.ts.map +1 -1
- package/dist/types/lib/Router/hashAtom.d.ts +7 -3
- package/dist/types/lib/Router/hashAtom.d.ts.map +1 -1
- package/dist/types/lib/Router/historyStateAtom.d.ts +8 -0
- package/dist/types/lib/Router/historyStateAtom.d.ts.map +1 -0
- package/dist/types/lib/Router/historyUtils.d.ts +14 -0
- package/dist/types/lib/Router/historyUtils.d.ts.map +1 -0
- package/dist/types/lib/Router/index.d.ts +2 -6
- package/dist/types/lib/Router/index.d.ts.map +1 -1
- package/dist/types/lib/Router/isPathMatching.d.ts +5 -1
- package/dist/types/lib/Router/isPathMatching.d.ts.map +1 -1
- package/dist/types/lib/Router/location.d.ts +4 -63
- package/dist/types/lib/Router/location.d.ts.map +1 -1
- package/dist/types/lib/Router/navigateTo.d.ts +8 -27
- package/dist/types/lib/Router/navigateTo.d.ts.map +1 -1
- package/dist/types/lib/Router/navigationLock.d.ts +5 -46
- package/dist/types/lib/Router/navigationLock.d.ts.map +1 -1
- package/dist/types/lib/Router/navigationRequest.d.ts +26 -0
- package/dist/types/lib/Router/navigationRequest.d.ts.map +1 -0
- package/dist/types/lib/Router/pathAtom.d.ts +16 -36
- package/dist/types/lib/Router/pathAtom.d.ts.map +1 -1
- package/dist/types/lib/Router/qsAtom.d.ts +7 -3
- package/dist/types/lib/Router/qsAtom.d.ts.map +1 -1
- package/dist/types/lib/Template/hmr.d.ts +6 -0
- package/dist/types/lib/Template/hmr.d.ts.map +1 -0
- package/dist/types/lib/Template/x-x.d.ts +1 -0
- package/dist/types/lib/Template/x-x.d.ts.map +1 -1
- package/dist/types/lib/Template/x-x.types.d.ts +0 -22
- package/dist/types/lib/Template/x-x.types.d.ts.map +1 -1
- package/dist/types/lib/Template/x.d.ts +19 -2
- package/dist/types/lib/Template/x.d.ts.map +1 -1
- package/dist/types/lib/TrackState/componentStatus.d.ts +0 -5
- package/dist/types/lib/TrackState/componentStatus.d.ts.map +1 -1
- package/dist/types/lib/TrackState/readTracking.d.ts.map +1 -1
- package/dist/types/lib/Utils/cookie.d.ts +2 -0
- package/dist/types/lib/Utils/cookie.d.ts.map +1 -0
- package/dist/types/lib/Utils/countdown.d.ts +48 -0
- package/dist/types/lib/Utils/countdown.d.ts.map +1 -0
- package/dist/types/lib/Utils/index.d.ts +3 -0
- package/dist/types/lib/Utils/index.d.ts.map +1 -1
- package/dist/types/lib/Utils/logEvent.d.ts +24 -0
- package/dist/types/lib/Utils/logEvent.d.ts.map +1 -0
- package/dist/types/lib/Utils/logger.d.ts +24 -13
- package/dist/types/lib/Utils/logger.d.ts.map +1 -1
- package/dist/types/lib/Utils/onceIdle.d.ts +28 -0
- package/dist/types/lib/Utils/onceIdle.d.ts.map +1 -0
- package/dist/types/lib/Utils/svgIcon.d.ts +2 -4
- package/dist/types/lib/Utils/svgIcon.d.ts.map +1 -1
- package/dist/types/lib/actions/asyncAction.d.ts.map +1 -1
- package/dist/types/lib/css-in-js/index.d.ts +1 -1
- package/dist/types/lib/css-in-js/index.d.ts.map +1 -1
- package/dist/types/lib/css-in-js/stylesheet.d.ts +15 -0
- package/dist/types/lib/css-in-js/stylesheet.d.ts.map +1 -1
- package/dist/types/lib/css-in-js/theme.d.ts +0 -8
- package/dist/types/lib/css-in-js/theme.d.ts.map +1 -1
- package/dist/types/lib/index.d.ts +25 -18
- package/dist/types/lib/index.d.ts.map +1 -1
- package/dist/types/lib/indexdb/index.d.ts +3 -0
- package/dist/types/lib/indexdb/index.d.ts.map +1 -0
- package/dist/types/lib/indexdb/indexdb.d.ts +86 -0
- package/dist/types/lib/indexdb/indexdb.d.ts.map +1 -0
- package/dist/types/lib/indexdb/types.d.ts +249 -0
- package/dist/types/lib/indexdb/types.d.ts.map +1 -0
- package/dist/types/lib/minidb/index.d.ts +3 -0
- package/dist/types/lib/minidb/index.d.ts.map +1 -0
- package/dist/types/lib/minidb/minidb.d.ts +105 -0
- package/dist/types/lib/minidb/minidb.d.ts.map +1 -0
- package/dist/types/lib/on/hooks.d.ts.map +1 -1
- package/dist/types/lib/portals/floating-container.d.ts +129 -0
- package/dist/types/lib/portals/floating-container.d.ts.map +1 -0
- package/dist/types/lib/portals/index.d.ts +5 -3
- package/dist/types/lib/portals/index.d.ts.map +1 -1
- package/dist/types/lib/portals/popup.d.ts +75 -11
- package/dist/types/lib/portals/popup.d.ts.map +1 -1
- package/dist/types/lib/portals/popupPlacement.d.ts +52 -0
- package/dist/types/lib/portals/popupPlacement.d.ts.map +1 -0
- package/dist/types/lib/portals/portal.d.ts +40 -16
- package/dist/types/lib/portals/portal.d.ts.map +1 -1
- package/dist/types/lib/socket/ws.d.ts +2 -2
- package/dist/types/lib/ssr/index.d.ts +1 -0
- package/dist/types/lib/ssr/index.d.ts.map +1 -1
- package/dist/types/lib/ssr/ssrFlag.d.ts +56 -21
- package/dist/types/lib/ssr/ssrFlag.d.ts.map +1 -1
- package/dist/types/lib/ssr/useCtx.d.ts +63 -0
- package/dist/types/lib/ssr/useCtx.d.ts.map +1 -0
- package/dist/types/lib/virtualizer/Virtualizer.d.ts +3 -2
- package/dist/types/lib/virtualizer/Virtualizer.d.ts.map +1 -1
- package/dist/types/lib/virtualizer/layouts/shared/BaseLayout.d.ts +8 -0
- package/dist/types/lib/virtualizer/layouts/shared/BaseLayout.d.ts.map +1 -1
- package/dist/types/lib/virtualizer/mates-adapter.d.ts +36 -88
- package/dist/types/lib/virtualizer/mates-adapter.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/types/lib/Router/pathResolver.d.ts +0 -9
- package/dist/types/lib/Router/pathResolver.d.ts.map +0 -1
- package/dist/types/lib/portals/tip.d.ts +0 -38
- package/dist/types/lib/portals/tip.d.ts.map +0 -1
- package/dist/types/lib/virtualizer/layouts/grid.d.ts +0 -25
- package/dist/types/lib/virtualizer/layouts/grid.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MatesDevTools.d.ts","sourceRoot":"","sources":["../../../../src/MatesDevTools.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MatesDevTools.d.ts","sourceRoot":"","sources":["../../../../src/MatesDevTools.ts"],"names":[],"mappings":"AAiIA,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,WAAW,GAAG,IAAI,CAmFtD;AA2HD,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAyB7D;AAikBD,wBAAgB,cAAc,IAAI,IAAI,CAwCrC;AAED,wBAAgB,eAAe,IAAI,IAAI,CA2BtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MatesDevToolsComponent.d.ts","sourceRoot":"","sources":["../../../../src/MatesDevToolsComponent.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MatesDevToolsComponent.d.ts","sourceRoot":"","sources":["../../../../src/MatesDevToolsComponent.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,CAAC;AAoG3B,MAAM,MAAM,gBAAgB,GACxB,cAAc,GACd,aAAa,GACb,WAAW,GACX,UAAU,CAAC;AAuCf;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAc1C;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAS3C"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
export type DevToolsTab = "components" | "logs" | "performance";
|
|
1
|
+
export type DevToolsTab = "components" | "logs" | "user-logs" | "performance";
|
|
2
2
|
export interface HeaderProps {
|
|
3
3
|
activeTab: DevToolsTab;
|
|
4
4
|
onTabChange: (tab: DevToolsTab) => void;
|
|
5
5
|
onMinimise: () => void;
|
|
6
6
|
onClose: () => void;
|
|
7
7
|
unreadLogCount: number;
|
|
8
|
+
unreadUserLogCount: number;
|
|
8
9
|
}
|
|
9
|
-
export declare function renderHeader({ activeTab, onTabChange, onMinimise, onClose, unreadLogCount, }: HeaderProps): import("lit-html").TemplateResult<1>;
|
|
10
|
+
export declare function renderHeader({ activeTab, onTabChange, onMinimise, onClose, unreadLogCount, unreadUserLogCount, }: HeaderProps): import("lit-html").TemplateResult<1>;
|
|
10
11
|
//# sourceMappingURL=Header.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../../../../src/components/Header.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,WAAW,GAAG,YAAY,GAAG,MAAM,GAAG,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../../../../src/components/Header.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,WAAW,GAAG,YAAY,GAAG,MAAM,GAAG,WAAW,GAAG,aAAa,CAAC;AAE9E,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,WAAW,CAAC;IACvB,WAAW,EAAE,CAAC,GAAG,EAAE,WAAW,KAAK,IAAI,CAAC;IACxC,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED,wBAAgB,YAAY,CAAC,EAC3B,SAAS,EACT,WAAW,EACX,UAAU,EACV,OAAO,EACP,cAAc,EACd,kBAAkB,GACnB,EAAE,WAAW,wCA+Gb"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export interface UserLogsViewerProps {
|
|
2
|
+
onClear: () => void;
|
|
3
|
+
renderCallback: () => void;
|
|
4
|
+
}
|
|
5
|
+
export declare function renderUserLogsViewer({ onClear, renderCallback }: UserLogsViewerProps): import("lit-html").TemplateResult<1>;
|
|
6
|
+
//# sourceMappingURL=UserLogsViewer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserLogsViewer.d.ts","sourceRoot":"","sources":["../../../../../src/components/UserLogsViewer.ts"],"names":[],"mappings":"AAuCA,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,cAAc,EAAE,MAAM,IAAI,CAAC;CAC5B;AAED,wBAAgB,oBAAoB,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,EAAE,mBAAmB,wCAsDpF"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* User Log Store
|
|
3
|
+
*
|
|
4
|
+
* Subscribes to matesLogEvent (the mates pub/sub event fired by log() /
|
|
5
|
+
* logError() / logWarning()). Always active once connected — no panel-open
|
|
6
|
+
* gate — so logs are captured from the moment devtools attaches.
|
|
7
|
+
*
|
|
8
|
+
* Data arrives already cloned (logger.ts calls safeClone before triggering).
|
|
9
|
+
* Circular buffer: keeps the last MAX_USER_LOGS entries.
|
|
10
|
+
*/
|
|
11
|
+
export interface UserLogEntry {
|
|
12
|
+
id: number;
|
|
13
|
+
ts: number;
|
|
14
|
+
level: "log" | "error" | "warn";
|
|
15
|
+
message: string;
|
|
16
|
+
data?: unknown;
|
|
17
|
+
}
|
|
18
|
+
export declare function onUserLogEntry(fn: () => void): () => void;
|
|
19
|
+
export declare function connectUserLogStore(): void;
|
|
20
|
+
export declare function disconnectUserLogStore(): void;
|
|
21
|
+
export declare function getUserLogs(): readonly UserLogEntry[];
|
|
22
|
+
export declare function getUserLogCount(): number;
|
|
23
|
+
export declare function getUnreadUserLogCount(): number;
|
|
24
|
+
export declare function markUserLogsRead(): void;
|
|
25
|
+
export declare function clearUserLogs(): void;
|
|
26
|
+
//# sourceMappingURL=userLogStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userLogStore.d.ts","sourceRoot":"","sources":["../../../../src/userLogStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,KAAK,GAAG,OAAO,GAAG,MAAM,CAAC;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAWD,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAMzD;AAmBD,wBAAgB,mBAAmB,IAAI,IAAI,CAkB1C;AAED,wBAAgB,sBAAsB,IAAI,IAAI,CAI7C;AAID,wBAAgB,WAAW,IAAI,SAAS,YAAY,EAAE,CAAmB;AACzE,wBAAgB,eAAe,IAAI,MAAM,CAA0B;AACnE,wBAAgB,qBAAqB,IAAI,MAAM,CAAwB;AACvE,wBAAgB,gBAAgB,IAAI,IAAI,CAA0C;AAClF,wBAAgB,aAAa,IAAI,IAAI,CAEpC"}
|
|
@@ -18,7 +18,7 @@ export declare function injectMatesAnimations(): void;
|
|
|
18
18
|
*
|
|
19
19
|
* @example
|
|
20
20
|
* ```ts
|
|
21
|
-
* import { MA } from "
|
|
21
|
+
* import { MA } from "mates";
|
|
22
22
|
* html`<div class=${MA.fadeIn}>Hello</div>`
|
|
23
23
|
* html`<div class="${MA.slideInUp}" style="--mates-duration:500ms">Hi</div>`
|
|
24
24
|
* ```
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { DirectiveResult } from "lit-html/directive.js";
|
|
2
|
+
/**
|
|
3
|
+
* A typed custom event handler. Receives the `detail` payload directly —
|
|
4
|
+
* no need to unwrap `event.detail` manually.
|
|
5
|
+
*/
|
|
6
|
+
export type EleEventHandler<T = unknown> = (detail: T, event: CustomEvent<T>) => void;
|
|
7
|
+
export declare function onEleEvent<T = unknown>(eventName: string, handler: EleEventHandler<T>): DirectiveResult;
|
|
8
|
+
/**
|
|
9
|
+
* `useEleEvent` — call in the **outer function** of a mates component to get
|
|
10
|
+
* a `dispatch` function. Use `dispatch` anywhere in the component (event
|
|
11
|
+
* handlers, effects, async callbacks) to fire a bubbling `CustomEvent` from
|
|
12
|
+
* a specific element.
|
|
13
|
+
*
|
|
14
|
+
* The host element is passed as the first argument to `dispatch` — this is
|
|
15
|
+
* typically the element the event should originate from (e.g. the clicked
|
|
16
|
+
* `<li>`, the focused `<input>`). Events bubble upward and are composed, so
|
|
17
|
+
* any ancestor listening with `onEleEvent` will receive them.
|
|
18
|
+
*
|
|
19
|
+
* No cleanup is needed — `dispatch` just calls `dispatchEvent`, there are no
|
|
20
|
+
* persistent listeners to remove.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* import { onEleEvent, useEleEvent } from "mates";
|
|
25
|
+
*
|
|
26
|
+
* // ── Child ─────────────────────────────────────────────────────────────────
|
|
27
|
+
* const ListItem = (propsFn) => {
|
|
28
|
+
* const { dispatch } = useEleEvent();
|
|
29
|
+
*
|
|
30
|
+
* return () => html`
|
|
31
|
+
* <li
|
|
32
|
+
* @click=${(e: MouseEvent) =>
|
|
33
|
+
* dispatch(e.currentTarget as HTMLElement, "item-select", {
|
|
34
|
+
* id: propsFn().id,
|
|
35
|
+
* label: propsFn().label,
|
|
36
|
+
* })}
|
|
37
|
+
* >
|
|
38
|
+
* ${propsFn().label}
|
|
39
|
+
* </li>
|
|
40
|
+
* `;
|
|
41
|
+
* };
|
|
42
|
+
*
|
|
43
|
+
* // ── Parent ────────────────────────────────────────────────────────────────
|
|
44
|
+
* html`
|
|
45
|
+
* <ul ${onEleEvent("item-select", (detail: { id: string }) => {
|
|
46
|
+
* console.log("selected", detail.id);
|
|
47
|
+
* })}>
|
|
48
|
+
* ${items.map(item => x(ListItem, item))}
|
|
49
|
+
* </ul>
|
|
50
|
+
* `;
|
|
51
|
+
*
|
|
52
|
+
* // ── Dispatching without an element ref (from a button click) ─────────────
|
|
53
|
+
* html`
|
|
54
|
+
* <button @click=${(e: MouseEvent) =>
|
|
55
|
+
* dispatch(e.currentTarget as HTMLElement, "form-submit", { value })}>
|
|
56
|
+
* Submit
|
|
57
|
+
* </button>
|
|
58
|
+
* `;
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
export declare function useEleEvent(): {
|
|
62
|
+
/**
|
|
63
|
+
* Dispatch a named `CustomEvent` from the component's host `<x-x>` element.
|
|
64
|
+
*
|
|
65
|
+
* The host is captured once when `useEleEvent()` is called (outer function).
|
|
66
|
+
* The event bubbles and is composed so any ancestor with `onEleEvent` will
|
|
67
|
+
* receive it.
|
|
68
|
+
*
|
|
69
|
+
* @param eventName The custom event name.
|
|
70
|
+
* @param detail Optional typed payload attached as `event.detail`.
|
|
71
|
+
*/
|
|
72
|
+
dispatch<T = unknown>(eventName: string, detail?: T): void;
|
|
73
|
+
};
|
|
74
|
+
//# sourceMappingURL=customEvent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customEvent.d.ts","sourceRoot":"","sources":["../../../../../lib/Directives/customEvent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAM7D;;;GAGG;AACH,MAAM,MAAM,eAAe,CAAC,CAAC,GAAG,OAAO,IAAI,CACzC,MAAM,EAAE,CAAC,EACT,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,KAClB,IAAI,CAAC;AA2EV,wBAAgB,UAAU,CAAC,CAAC,GAAG,OAAO,EACpC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC,GAC1B,eAAe,CAEjB;AAID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AACH,wBAAgB,WAAW;IAQvB;;;;;;;;;OASG;aACM,CAAC,uBAAuB,MAAM,WAAW,CAAC,GAAG,IAAI;EAY7D"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* disappear — removes the host element from the DOM after `ms` milliseconds.
|
|
3
|
+
*
|
|
4
|
+
* Useful for self-dismissing messages, temporary overlays, or any element
|
|
5
|
+
* that should vanish after a delay without any component re-render.
|
|
6
|
+
*
|
|
7
|
+
* The countdown is cancelled automatically if the element is removed from
|
|
8
|
+
* the DOM before the delay elapses (e.g. parent unmounts).
|
|
9
|
+
*
|
|
10
|
+
* If `ms` changes on re-render a fresh countdown is started from the new value.
|
|
11
|
+
*
|
|
12
|
+
* @param ms Delay in milliseconds before the element is removed.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* // Remove a toast message after 3 seconds
|
|
16
|
+
* html`<div class="toast" ${disappear(3000)}>Saved!</div>`
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* // Configurable delay
|
|
20
|
+
* html`<p class="hint" ${disappear(ttl)}>This hint disappears soon.</p>`
|
|
21
|
+
*/
|
|
22
|
+
export declare const disappear: (nextMs: number) => import("lit-html/directive.js").DirectiveResult;
|
|
23
|
+
//# sourceMappingURL=disappear.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"disappear.d.ts","sourceRoot":"","sources":["../../../../../lib/Directives/disappear.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,SAAS,qEAyBpB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eleHook.d.ts","sourceRoot":"","sources":["../../../../../lib/Directives/eleHook.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,eAAe,EAGhB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAK,KAAK,WAAW,EAAE,MAAM,KAAK,CAAC;AAI1C;;;;;;;;GAQG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A6DG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,GAAG,EAAE,GAAG,EAAE,EAC3C,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC,GAC1B,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,eAAe,
|
|
1
|
+
{"version":3,"file":"htmlHook.d.ts","sourceRoot":"","sources":["../../../../../lib/Directives/htmlHook.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,OAAO,KAAK,EAEV,eAAe,EAEhB,MAAM,uBAAuB,CAAC;AAM/B;;;;;;;;GAQG;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,GAAG,EAAE,GAAG,EAAE,IAAI;IACpD,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC;IAChC,4DAA4D;IAC5D,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,CAAC;AAElE;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,GAAG,EAAE,GAAG,EAAE,IAAI,CAClD,MAAM,EAAE,gBAAgB,EACxB,GAAG,IAAI,EAAE,CAAC,KACP,iBAAiB,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;AAoBjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,GAAG,EAAE,GAAG,EAAE,EAC3C,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC,GAC1B,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,eAAe,CAyGjC"}
|
|
@@ -2,6 +2,8 @@ export { $, type DollarChain } from "./$";
|
|
|
2
2
|
export { type AnimatedIfConfig, type AnimatedXConfig, animatedIf, animatedX, } from "./animatedConditional";
|
|
3
3
|
export { type AttrMap, type AttrValue, attr, removeAttr, } from "./attrDirective";
|
|
4
4
|
export { type ClassEntry, type ClassesInput, classes, removeClasses, } from "./classesDirective";
|
|
5
|
+
export { type EleEventHandler, onEleEvent, useEleEvent } from "./customEvent";
|
|
6
|
+
export { disappear } from "./disappear";
|
|
5
7
|
export { type EleHookLifecycle, type EleHookMountFn, eleHook } from "./eleHook";
|
|
6
8
|
export { type HtmlHookLifecycle, type HtmlHookMountFn, type HtmlHookRenderFn, htmlHook, } from "./htmlHook";
|
|
7
9
|
export { type IntersectCallback, type IntersectOptions, onHidden, onIntersect, onVisible, } from "./intersectDirective";
|
|
@@ -9,10 +11,10 @@ export { type LazyLoadCallback, type LazyLoadOptions, lazyLoad, onScrolledIntoVi
|
|
|
9
11
|
export { type ConnectCallback, type DisconnectCallback, onConnect, onDisconnect, onUpdate, type UpdateCallback, } from "./lifecycleDirectives";
|
|
10
12
|
export { type MasonryGridOptions, type MasonryItemTemplate, type MasonryKeyFn, masonryGrid, } from "./masonryGrid";
|
|
11
13
|
export { type MemoKeys, type MemoTemplateFn, memoTemplate, } from "./memoTemplate";
|
|
12
|
-
export { type MatesCustomEventMap, type OnEventMap, on, removeOn, } from "./onDirective";
|
|
14
|
+
export { type MatesCustomEventMap, type OnEventMap, on, on as onEvent, removeOn, } from "./onDirective";
|
|
13
15
|
export { type OnParentMap, onParent } from "./onParentDirective";
|
|
14
16
|
export { renderSwitch, type SwitchCase, type SwitchEntry, } from "./renderSwitch";
|
|
15
17
|
export { removeStyle, type StyleMap, type StyleValue, style, } from "./styleDirective";
|
|
16
|
-
export { type TimerContent,
|
|
17
|
-
export { type
|
|
18
|
+
export { type TimerContent, timerTemplate } from "./timerDirective";
|
|
19
|
+
export { type VirtualListOptions, type VirtualMasonryOptions, virtualList, virtualMasonry, } from "./virtualHelpers";
|
|
18
20
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../lib/Directives/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,KAAK,WAAW,EAAE,MAAM,KAAK,CAAC;AAC1C,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,UAAU,EACV,SAAS,GACV,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,SAAS,EACd,IAAI,EACJ,UAAU,GACX,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,OAAO,EACP,aAAa,GACd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,cAAc,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAChF,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,QAAQ,GACT,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,QAAQ,EACR,WAAW,EACX,SAAS,GACV,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,QAAQ,EACR,kBAAkB,EAClB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,GAC7B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,KAAK,cAAc,GACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,WAAW,GACZ,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,YAAY,GACb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,EAAE,EACF,QAAQ,GACT,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,KAAK,WAAW,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EACL,YAAY,EACZ,KAAK,UAAU,EACf,KAAK,WAAW,GACjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,WAAW,EACX,KAAK,QAAQ,EACb,KAAK,UAAU,EACf,KAAK,GACN,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,KAAK,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../lib/Directives/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,KAAK,WAAW,EAAE,MAAM,KAAK,CAAC;AAC1C,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,UAAU,EACV,SAAS,GACV,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,SAAS,EACd,IAAI,EACJ,UAAU,GACX,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,OAAO,EACP,aAAa,GACd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,KAAK,eAAe,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC9E,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,cAAc,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAChF,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,QAAQ,GACT,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,QAAQ,EACR,WAAW,EACX,SAAS,GACV,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,QAAQ,EACR,kBAAkB,EAClB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,GAC7B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,KAAK,cAAc,GACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,WAAW,GACZ,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,YAAY,GACb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,EAAE,EACF,EAAE,IAAI,OAAO,EACb,QAAQ,GACT,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,KAAK,WAAW,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EACL,YAAY,EACZ,KAAK,UAAU,EACf,KAAK,WAAW,GACjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,WAAW,EACX,KAAK,QAAQ,EACb,KAAK,UAAU,EACf,KAAK,GACN,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,KAAK,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,WAAW,EACX,cAAc,GACf,MAAM,kBAAkB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"onDirective.d.ts","sourceRoot":"","sources":["../../../../../lib/Directives/onDirective.ts"],"names":[],"mappings":"AAWA,4EAA4E;AAC5E,MAAM,MAAM,oBAAoB,GAAG,CAAC,KAAK,EAAE,yBAAyB,KAAK,IAAI,CAAC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AAmB,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,CAAC,CAAC,CAAC,KAAK,IAAI;CAC3E,GAAG;KACD,CAAC,IAAI,MAAM,mBAAmB,CAAC,CAAC,EAAE,mBAAmB,CAAC,CAAC,CAAC;CAC1D,CAAC;AAsLF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,EAAE,CAAC,MAAM,EAAE,UAAU,mGAEpC;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,EAAE,EAAE,OAAO,GAAG,IAAI,CAE1C"}
|
|
@@ -19,13 +19,13 @@ export type TimerContent = () => unknown;
|
|
|
19
19
|
*
|
|
20
20
|
* @example
|
|
21
21
|
* ```ts
|
|
22
|
-
* import { html } from "
|
|
23
|
-
* import {
|
|
22
|
+
* import { html } from "mates";
|
|
23
|
+
* import { timerTemplate } from "mates";
|
|
24
24
|
*
|
|
25
25
|
* // Live clock — updates every second, no component re-render
|
|
26
26
|
* html`
|
|
27
27
|
* <div>
|
|
28
|
-
* Time: ${
|
|
28
|
+
* Time: ${timerTemplate(() => new Date().toLocaleTimeString(), 1000)}
|
|
29
29
|
* </div>
|
|
30
30
|
* `;
|
|
31
31
|
*
|
|
@@ -33,7 +33,7 @@ export type TimerContent = () => unknown;
|
|
|
33
33
|
* const end = Date.now() + 60_000;
|
|
34
34
|
* html`
|
|
35
35
|
* <span>
|
|
36
|
-
* ${
|
|
36
|
+
* ${timerTemplate(() => {
|
|
37
37
|
* const remaining = Math.max(0, Math.ceil((end - Date.now()) / 1000));
|
|
38
38
|
* return remaining === 0 ? "Done!" : `${remaining}s`;
|
|
39
39
|
* }, 1000)}
|
|
@@ -43,10 +43,10 @@ export type TimerContent = () => unknown;
|
|
|
43
43
|
* // Dynamic HTML content
|
|
44
44
|
* html`
|
|
45
45
|
* <div>
|
|
46
|
-
* ${
|
|
46
|
+
* ${timerTemplate(() => html`<strong>${new Date().toLocaleTimeString()}</strong>`, 500)}
|
|
47
47
|
* </div>
|
|
48
48
|
* `;
|
|
49
49
|
* ```
|
|
50
50
|
*/
|
|
51
|
-
export declare function
|
|
51
|
+
export declare function timerTemplate(callback: TimerContent, ms: number): import("lit-html/directive.js").DirectiveResult<import("lit-html/directive.js").DirectiveClass>;
|
|
52
52
|
//# sourceMappingURL=timerDirective.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timerDirective.d.ts","sourceRoot":"","sources":["../../../../../lib/Directives/timerDirective.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,CAAC;AA+CzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,wBAAgB,
|
|
1
|
+
{"version":3,"file":"timerDirective.d.ts","sourceRoot":"","sources":["../../../../../lib/Directives/timerDirective.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,CAAC;AA+CzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,YAAY,EAAE,EAAE,EAAE,MAAM,mGAE/D"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Virtual scrolling helpers
|
|
3
|
-
* engine (see lib/virtualizer).
|
|
2
|
+
* Virtual scrolling helpers backed by the virtualizer engine.
|
|
4
3
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* - `virtualList` — virtualised vertical (or horizontal) list.
|
|
5
|
+
* No itemHeight required — heights are measured via
|
|
6
|
+
* ResizeObserver. Responds to dynamic item counts and
|
|
7
|
+
* container size changes automatically.
|
|
8
|
+
*
|
|
9
|
+
* - `virtualMasonry` — virtualised masonry grid with variable item heights.
|
|
8
10
|
*/
|
|
9
|
-
export { type
|
|
11
|
+
export { type VirtualItemTemplate, type VirtualKeyFn, type VirtualListOptions, type VirtualMasonryOptions, virtualList, virtualMasonry, } from "../virtualizer/mates-adapter.js";
|
|
10
12
|
//# sourceMappingURL=virtualHelpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"virtualHelpers.d.ts","sourceRoot":"","sources":["../../../../../lib/Directives/virtualHelpers.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"virtualHelpers.d.ts","sourceRoot":"","sources":["../../../../../lib/Directives/virtualHelpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,WAAW,EACX,cAAc,GACf,MAAM,iCAAiC,CAAC"}
|
|
@@ -8,8 +8,8 @@ export type FetchRequest = Omit<RequestInit, "body"> & {
|
|
|
8
8
|
* - If it starts with `http:` or `https:` it is used as-is (absolute URL),
|
|
9
9
|
* ignoring any `host` set on the client/base request.
|
|
10
10
|
* - Otherwise it is treated as a path and appended to `host`
|
|
11
|
-
* (e.g. `host = "https
|
|
12
|
-
* `"https
|
|
11
|
+
* (e.g. `host = "https://<host>"` + `url = "/users"` →
|
|
12
|
+
* `"https://<host>/users"`).
|
|
13
13
|
* - Dynamic segments (`:id`) are substituted from `params`.
|
|
14
14
|
*
|
|
15
15
|
* @example
|
|
@@ -24,7 +24,7 @@ export type FetchRequest = Omit<RequestInit, "body"> & {
|
|
|
24
24
|
*/
|
|
25
25
|
path?: string;
|
|
26
26
|
/**
|
|
27
|
-
* Origin / base host, e.g. `"https
|
|
27
|
+
* Origin / base host, e.g. `"https://<your-api>"`.
|
|
28
28
|
* Used as a prefix when `url` is a relative path.
|
|
29
29
|
* Defaults to `""` (no host prefix).
|
|
30
30
|
*/
|
|
@@ -46,8 +46,11 @@ export type FetchInput = string | FetchRequest;
|
|
|
46
46
|
export type BeforeInterceptor = (url: string, options: RequestInit) => {
|
|
47
47
|
url: string;
|
|
48
48
|
options: RequestInit;
|
|
49
|
-
}
|
|
50
|
-
|
|
49
|
+
} | Promise<{
|
|
50
|
+
url: string;
|
|
51
|
+
options: RequestInit;
|
|
52
|
+
}>;
|
|
53
|
+
export type AfterInterceptor = (response: Response) => Response | Promise<Response>;
|
|
51
54
|
export type ErrorInterceptor = (error: Error) => void;
|
|
52
55
|
/** Build the final URL from a FetchRequest. */
|
|
53
56
|
export declare function buildRequestUrl(request: FetchRequest): string;
|
|
@@ -67,7 +70,7 @@ export declare const clearInterceptors: () => void;
|
|
|
67
70
|
* - All requests are logged to Mates DevTools when devtools is connected.
|
|
68
71
|
*
|
|
69
72
|
* @example
|
|
70
|
-
* const api = new FetchClient({ host: "https
|
|
73
|
+
* const api = new FetchClient({ host: "https://<your-api>" });
|
|
71
74
|
* api.interceptBefore((url, opts) => ({
|
|
72
75
|
* url,
|
|
73
76
|
* options: { ...opts, headers: { ...opts.headers, Authorization: `Bearer ${token}` } },
|
|
@@ -106,16 +109,16 @@ export declare class FetchClient {
|
|
|
106
109
|
* exactly as `buildRequestUrl` handles them.
|
|
107
110
|
*
|
|
108
111
|
* @example
|
|
109
|
-
* const loadUser = api.fetchAction({ host: "https
|
|
112
|
+
* const loadUser = api.fetchAction({ host: "https://<your-api>", url: "/users/:id" });
|
|
110
113
|
* loadUser({ id: 7, expand: "posts" });
|
|
111
|
-
* // → GET https
|
|
114
|
+
* // → GET https://<your-api>/users/7?expand=posts
|
|
112
115
|
*/
|
|
113
116
|
fetchAction<T = unknown>(config?: FetchActionConfig): AsyncActionReturnType<(params?: Record<string, any>) => Promise<T>>;
|
|
114
117
|
/**
|
|
115
118
|
* Creates an asyncAction that always issues a GET request via this client.
|
|
116
119
|
*
|
|
117
120
|
* @example
|
|
118
|
-
* const loadUsers = api.getAction({ host: "https
|
|
121
|
+
* const loadUsers = api.getAction({ host: "https://<your-api>", url: "/users" });
|
|
119
122
|
* loadUsers({ page: 2, limit: 20 });
|
|
120
123
|
*/
|
|
121
124
|
getAction<T = unknown>(config?: FetchActionConfig): AsyncActionReturnType<(params?: Record<string, any>) => Promise<T>>;
|
|
@@ -123,7 +126,7 @@ export declare class FetchClient {
|
|
|
123
126
|
* Creates an asyncAction that always issues a POST request via this client.
|
|
124
127
|
*
|
|
125
128
|
* @example
|
|
126
|
-
* const createUser = api.postAction({ host: "https
|
|
129
|
+
* const createUser = api.postAction({ host: "https://<your-api>", url: "/users" });
|
|
127
130
|
* createUser({ name: "Alice" });
|
|
128
131
|
*/
|
|
129
132
|
postAction<T = unknown>(config?: FetchActionConfig): AsyncActionReturnType<(params?: Record<string, any>) => Promise<T>>;
|
|
@@ -131,7 +134,7 @@ export declare class FetchClient {
|
|
|
131
134
|
* Creates an asyncAction that always issues a PUT request via this client.
|
|
132
135
|
*
|
|
133
136
|
* @example
|
|
134
|
-
* const replaceUser = api.putAction({ host: "https
|
|
137
|
+
* const replaceUser = api.putAction({ host: "https://<your-api>", url: "/users/:id" });
|
|
135
138
|
* replaceUser({ id: 7, name: "Bob" });
|
|
136
139
|
*/
|
|
137
140
|
putAction<T = unknown>(config?: FetchActionConfig): AsyncActionReturnType<(params?: Record<string, any>) => Promise<T>>;
|
|
@@ -139,7 +142,7 @@ export declare class FetchClient {
|
|
|
139
142
|
* Creates an asyncAction that always issues a PATCH request via this client.
|
|
140
143
|
*
|
|
141
144
|
* @example
|
|
142
|
-
* const patchUser = api.patchAction({ host: "https
|
|
145
|
+
* const patchUser = api.patchAction({ host: "https://<your-api>", url: "/users/:id" });
|
|
143
146
|
* patchUser({ id: 7, status: "inactive" });
|
|
144
147
|
*/
|
|
145
148
|
patchAction<T = unknown>(config?: FetchActionConfig): AsyncActionReturnType<(params?: Record<string, any>) => Promise<T>>;
|
|
@@ -147,12 +150,55 @@ export declare class FetchClient {
|
|
|
147
150
|
* Creates an asyncAction that always issues a DELETE request via this client.
|
|
148
151
|
*
|
|
149
152
|
* @example
|
|
150
|
-
* const removeUser = api.deleteAction({ host: "https
|
|
153
|
+
* const removeUser = api.deleteAction({ host: "https://<your-api>", url: "/users/:id" });
|
|
151
154
|
* removeUser({ id: 7 });
|
|
152
155
|
*/
|
|
153
156
|
deleteAction<T = unknown>(config?: FetchActionConfig): AsyncActionReturnType<(params?: Record<string, any>) => Promise<T>>;
|
|
154
157
|
}
|
|
155
158
|
export declare const fetchClient: FetchClient;
|
|
159
|
+
/**
|
|
160
|
+
* Run a raw fetch through the global interceptor chain.
|
|
161
|
+
*
|
|
162
|
+
* Used by `__callServerFn` in mates-ssr so that server function calls
|
|
163
|
+
* respect the same `interceptBefore` / `interceptAfter` / `interceptError`
|
|
164
|
+
* hooks as regular FetchClient calls.
|
|
165
|
+
*
|
|
166
|
+
* @internal — also useful for advanced custom fetch wrappers.
|
|
167
|
+
*/
|
|
168
|
+
export declare function runWithGlobalInterceptors(url: string, options: RequestInit): Promise<Response>;
|
|
169
|
+
/**
|
|
170
|
+
* Create a before-interceptor that adds an `Authorization` header.
|
|
171
|
+
* The token can be a static string or an async function that returns one —
|
|
172
|
+
* useful for reading from storage or refreshing an OAuth token on-the-fly.
|
|
173
|
+
*
|
|
174
|
+
* @example
|
|
175
|
+
* // Static token
|
|
176
|
+
* interceptBefore(withAuth("Bearer my-static-token"));
|
|
177
|
+
*
|
|
178
|
+
* @example
|
|
179
|
+
* // Dynamic token from async storage
|
|
180
|
+
* interceptBefore(withAuth(async () => `Bearer ${await getToken()}`));
|
|
181
|
+
*/
|
|
182
|
+
export declare function withAuth(getToken: string | (() => string | Promise<string>)): BeforeInterceptor;
|
|
183
|
+
/**
|
|
184
|
+
* Create a before-interceptor that prepends a base URL to relative paths.
|
|
185
|
+
* Absolute URLs (starting with `http`) are passed through unchanged.
|
|
186
|
+
*
|
|
187
|
+
* @example
|
|
188
|
+
* interceptBefore(withBaseUrl("https://api.example.com"));
|
|
189
|
+
*/
|
|
190
|
+
export declare function withBaseUrl(baseUrl: string): BeforeInterceptor;
|
|
191
|
+
/**
|
|
192
|
+
* Create an after-interceptor that logs every response.
|
|
193
|
+
* Pass a custom logging function or leave it as `console.log`.
|
|
194
|
+
*
|
|
195
|
+
* @example
|
|
196
|
+
* interceptAfter(withLogging());
|
|
197
|
+
*
|
|
198
|
+
* @example
|
|
199
|
+
* interceptAfter(withLogging((msg) => myLogger.info(msg)));
|
|
200
|
+
*/
|
|
201
|
+
export declare function withLogging(log?: (msg: string) => void): AfterInterceptor;
|
|
156
202
|
export declare const Fetch: <T = any>(request: FetchInput) => ZeroPromise<T>;
|
|
157
203
|
export declare const Get: <T = any>(request: FetchInput) => ZeroPromise<T>;
|
|
158
204
|
export declare const Post: <T = any>(request: FetchInput) => ZeroPromise<T>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Fetch.d.ts","sourceRoot":"","sources":["../../../../../lib/Fetch/Fetch.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,qBAAqB,EACrB,iBAAiB,EAClB,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"Fetch.d.ts","sourceRoot":"","sources":["../../../../../lib/Fetch/Fetch.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,qBAAqB,EACrB,iBAAiB,EAClB,MAAM,6BAA6B,CAAC;AAQrC,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAKlD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAInE,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,GAAG;IACrD;;;;;;;;;;;;;OAaG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7B,sEAAsE;IACtE,IAAI,CAA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BAAiB,qCA1L5B,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,gBA2LtB,CAAC;AAEnC,eAAO,MAAM,WAAW,GAAI,CAAC,GAAG,OAAO,EAAE,SAAS,iBAAiB,qCAhL9B,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,gBAiLpB,CAAC;AAErC,eAAO,MAAM,YAAY,GAAI,CAAC,GAAG,OAAO,EAAE,SAAS,iBAAiB,qCAtK/B,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,gBAuKnB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FetchUtils — Scope class for fetch client and interceptors.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* const App = () => {
|
|
7
|
+
* const fetch = scope(FetchUtils);
|
|
8
|
+
* fetch.interceptBefore(withAuth("token"));
|
|
9
|
+
* return () => html`...`;
|
|
10
|
+
* };
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
import { FetchClient } from "../Fetch/Fetch";
|
|
14
|
+
import type { AfterInterceptor, BeforeInterceptor, ErrorInterceptor } from "../Fetch";
|
|
15
|
+
export declare class FetchUtils {
|
|
16
|
+
fetchClient: FetchClient;
|
|
17
|
+
constructor();
|
|
18
|
+
interceptBefore(fn: BeforeInterceptor): () => void;
|
|
19
|
+
interceptAfter(fn: AfterInterceptor): () => void;
|
|
20
|
+
interceptError(fn: ErrorInterceptor): () => void;
|
|
21
|
+
clearInterceptors(): void;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=FetchUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FetchUtils.d.ts","sourceRoot":"","sources":["../../../../../lib/MatesUtils/FetchUtils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,EACV,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,UAAU,CAAC;AAElB,qBAAa,UAAU;IACrB,WAAW,EAAE,WAAW,CAAC;;IAMzB,eAAe,CAAC,EAAE,EAAE,iBAAiB,GAAG,MAAM,IAAI;IAIlD,cAAc,CAAC,EAAE,EAAE,gBAAgB,GAAG,MAAM,IAAI;IAIhD,cAAc,CAAC,EAAE,EAAE,gBAAgB,GAAG,MAAM,IAAI;IAIhD,iBAAiB,IAAI,IAAI;CAG1B"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MatesUtils — Convenience scope class composing all utility scopes.
|
|
3
|
+
*
|
|
4
|
+
* Equivalent to scoping RouterUtils + FetchUtils + StorageUtils + ThemeUtils
|
|
5
|
+
* individually. Use this when you want everything in one scope.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* const App = () => {
|
|
10
|
+
* const utils = scope(MatesUtils);
|
|
11
|
+
* // utils.pathAtom, utils.navigateTo, utils.fetchClient, etc.
|
|
12
|
+
* return () => html`...`;
|
|
13
|
+
* };
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare class MatesUtils {
|
|
17
|
+
private _router;
|
|
18
|
+
private _fetch;
|
|
19
|
+
private _storage;
|
|
20
|
+
private _theme;
|
|
21
|
+
constructor();
|
|
22
|
+
get pathAtom(): import("..").SuperAtomType<string>;
|
|
23
|
+
get qsAtom(): import("..").AtomType<Record<string, any>>;
|
|
24
|
+
get hashAtom(): import("..").AtomType<Record<string, any>>;
|
|
25
|
+
get historyStateAtom(): import("..").AtomType<unknown>;
|
|
26
|
+
get navigationLocked(): import("..").AtomType<boolean>;
|
|
27
|
+
get navigationRequestEvent(): import("..").EventType<import("../Router/navigationRequest").NavigationEventPayload>;
|
|
28
|
+
get location(): {
|
|
29
|
+
readonly path: string;
|
|
30
|
+
readonly hash: Record<string, any>;
|
|
31
|
+
readonly qsObj: Record<string, any>;
|
|
32
|
+
};
|
|
33
|
+
navigateTo(path: string, replace?: boolean, data?: any): void;
|
|
34
|
+
lockNavigation(): void;
|
|
35
|
+
unlockNavigation(): void;
|
|
36
|
+
onNavigationRequest(fn: any): void;
|
|
37
|
+
get fetchClient(): import("..").FetchClient;
|
|
38
|
+
interceptBefore(fn: any): () => void;
|
|
39
|
+
interceptAfter(fn: any): () => void;
|
|
40
|
+
interceptError(fn: any): () => void;
|
|
41
|
+
clearInterceptors(): void;
|
|
42
|
+
get lsAtom(): import("..").StorageAtomType;
|
|
43
|
+
get ssAtom(): import("..").StorageAtomType;
|
|
44
|
+
get themeAtom(): import("..").ThemeAtomType;
|
|
45
|
+
get titleAtom(): import("..").AtomType<string>;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=MatesUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MatesUtils.d.ts","sourceRoot":"","sources":["../../../../../lib/MatesUtils/MatesUtils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAOH,qBAAa,UAAU;IACrB,OAAO,CAAC,OAAO,CAAc;IAC7B,OAAO,CAAC,MAAM,CAAa;IAC3B,OAAO,CAAC,QAAQ,CAAe;IAC/B,OAAO,CAAC,MAAM,CAAa;;IAW3B,IAAI,QAAQ,uCAEX;IACD,IAAI,MAAM,+CAET;IACD,IAAI,QAAQ,+CAEX;IACD,IAAI,gBAAgB,mCAEnB;IACD,IAAI,gBAAgB,mCAEnB;IACD,IAAI,sBAAsB,yFAEzB;IACD,IAAI,QAAQ;;;;MAEX;IAED,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,GAAG;IAGtD,cAAc;IAGd,gBAAgB;IAGhB,mBAAmB,CAAC,EAAE,EAAE,GAAG;IAM3B,IAAI,WAAW,6BAEd;IACD,eAAe,CAAC,EAAE,EAAE,GAAG;IAGvB,cAAc,CAAC,EAAE,EAAE,GAAG;IAGtB,cAAc,CAAC,EAAE,EAAE,GAAG;IAGtB,iBAAiB;IAMjB,IAAI,MAAM,iCAET;IACD,IAAI,MAAM,iCAET;IAID,IAAI,SAAS,+BAEZ;IACD,IAAI,SAAS,kCAEZ;CACF"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RouterUtils — Scope class for all router-related reactive state.
|
|
3
|
+
*
|
|
4
|
+
* Instantiate via `scope(RouterUtils)` in a component's outer function.
|
|
5
|
+
* Child components access it via `getParentScope(RouterUtils)`.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* const App = () => {
|
|
10
|
+
* const router = scope(RouterUtils);
|
|
11
|
+
* return () => html`${x(HomePage)}`;
|
|
12
|
+
* };
|
|
13
|
+
*
|
|
14
|
+
* // Child:
|
|
15
|
+
* const { pathAtom, navigateTo } = getParentScope(RouterUtils);
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
import type { AtomType, SuperAtomType } from "../Mutables/atom/atom";
|
|
19
|
+
import type { EventType } from "../Mutables/events/events";
|
|
20
|
+
import type { NavigationEventPayload, NavigationRequestDetail } from "../Router/navigationRequest";
|
|
21
|
+
export declare class RouterUtils {
|
|
22
|
+
navigationLocked: AtomType<boolean>;
|
|
23
|
+
navigationRequestEvent: EventType<NavigationEventPayload>;
|
|
24
|
+
historyStateAtom: AtomType<unknown>;
|
|
25
|
+
pathAtom: SuperAtomType<string>;
|
|
26
|
+
qsAtom: AtomType<Record<string, any>>;
|
|
27
|
+
hashAtom: AtomType<Record<string, any>>;
|
|
28
|
+
constructor();
|
|
29
|
+
navigateTo(path: string, replace?: boolean, data?: any): void;
|
|
30
|
+
lockNavigation(): void;
|
|
31
|
+
unlockNavigation(): void;
|
|
32
|
+
get location(): {
|
|
33
|
+
readonly path: string;
|
|
34
|
+
readonly hash: Record<string, any>;
|
|
35
|
+
readonly qsObj: Record<string, any>;
|
|
36
|
+
};
|
|
37
|
+
onNavigationRequest(fn: (detail: NavigationRequestDetail) => void | Promise<void>): void;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=RouterUtils.d.ts.map
|