@omerdlw/base-framework 1.0.3 → 1.0.4
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/index.js +5240 -5165
- package/dist/index.js.map +1 -1
- package/dist/kernel/compose.d.ts.map +1 -1
- package/dist/kernel/handlers.d.ts.map +1 -1
- package/dist/kernel/hooks.d.ts.map +1 -1
- package/dist/kernel/index.js.map +1 -1
- package/dist/kernel/operations.d.ts.map +1 -1
- package/dist/kernel/schema.d.ts +0 -2
- package/dist/kernel/schema.d.ts.map +1 -1
- package/dist/kernel/store.d.ts.map +1 -1
- package/dist/kernel/types.d.ts.map +1 -1
- package/dist/kernel/utils.d.ts +0 -2
- package/dist/kernel/utils.d.ts.map +1 -1
- package/dist/modules/ambient/color.d.ts +16 -0
- package/dist/modules/ambient/color.d.ts.map +1 -0
- package/dist/modules/ambient/constants.d.ts +0 -17
- package/dist/modules/ambient/constants.d.ts.map +1 -1
- package/dist/modules/ambient/context.d.ts +1 -7
- package/dist/modules/ambient/context.d.ts.map +1 -1
- package/dist/modules/ambient/dom.d.ts +19 -0
- package/dist/modules/ambient/dom.d.ts.map +1 -0
- package/dist/modules/ambient/extractor.d.ts +5 -0
- package/dist/modules/ambient/extractor.d.ts.map +1 -0
- package/dist/modules/ambient/hooks.d.ts +9 -0
- package/dist/modules/ambient/hooks.d.ts.map +1 -0
- package/dist/modules/ambient/index.d.ts +7 -4
- package/dist/modules/ambient/index.d.ts.map +1 -1
- package/dist/modules/ambient/index.js +66 -60
- package/dist/modules/ambient/index.js.map +1 -1
- package/dist/modules/ambient/module.d.ts +5 -1
- package/dist/modules/ambient/module.d.ts.map +1 -1
- package/dist/modules/background/constants.d.ts +1 -10
- package/dist/modules/background/constants.d.ts.map +1 -1
- package/dist/modules/background/context.d.ts +1 -13
- package/dist/modules/background/context.d.ts.map +1 -1
- package/dist/modules/background/hooks.d.ts +13 -118
- package/dist/modules/background/hooks.d.ts.map +1 -1
- package/dist/modules/background/index.d.ts +8 -3
- package/dist/modules/background/index.d.ts.map +1 -1
- package/dist/modules/background/index.js +975 -991
- package/dist/modules/background/index.js.map +1 -1
- package/dist/modules/background/module.d.ts +1 -0
- package/dist/modules/background/module.d.ts.map +1 -1
- package/dist/modules/background/overlay.d.ts +93 -2
- package/dist/modules/background/overlay.d.ts.map +1 -1
- package/dist/modules/background/playback.d.ts +10 -0
- package/dist/modules/background/playback.d.ts.map +1 -0
- package/dist/modules/background/state.d.ts +9 -0
- package/dist/modules/background/state.d.ts.map +1 -0
- package/dist/modules/background/{utils.d.ts → visual.d.ts} +6 -14
- package/dist/modules/background/visual.d.ts.map +1 -0
- package/dist/modules/background/youtube/player.d.ts +28 -0
- package/dist/modules/background/youtube/player.d.ts.map +1 -0
- package/dist/modules/context-menu/context.d.ts +1 -10
- package/dist/modules/context-menu/context.d.ts.map +1 -1
- package/dist/modules/context-menu/dom.d.ts +8 -0
- package/dist/modules/context-menu/dom.d.ts.map +1 -0
- package/dist/modules/context-menu/hooks.d.ts +11 -11
- package/dist/modules/context-menu/hooks.d.ts.map +1 -1
- package/dist/modules/context-menu/index.d.ts +8 -3
- package/dist/modules/context-menu/index.d.ts.map +1 -1
- package/dist/modules/context-menu/index.js +97 -101
- package/dist/modules/context-menu/index.js.map +1 -1
- package/dist/modules/context-menu/{utils.d.ts → items.d.ts} +2 -9
- package/dist/modules/context-menu/items.d.ts.map +1 -0
- package/dist/modules/context-menu/module.d.ts.map +1 -1
- package/dist/modules/context-menu/overlay.d.ts +13 -1
- package/dist/modules/context-menu/overlay.d.ts.map +1 -1
- package/dist/modules/context-menu/state.d.ts +1 -0
- package/dist/modules/context-menu/state.d.ts.map +1 -1
- package/dist/modules/controls/{utils.d.ts → entries.d.ts} +6 -5
- package/dist/modules/controls/entries.d.ts.map +1 -0
- package/dist/modules/controls/hooks.d.ts +0 -7
- package/dist/modules/controls/hooks.d.ts.map +1 -1
- package/dist/modules/controls/index.d.ts +5 -3
- package/dist/modules/controls/index.d.ts.map +1 -1
- package/dist/modules/controls/index.js +66 -61
- package/dist/modules/controls/index.js.map +1 -1
- package/dist/modules/controls/layout.d.ts +7 -0
- package/dist/modules/controls/layout.d.ts.map +1 -0
- package/dist/modules/controls/overlay.d.ts +9 -0
- package/dist/modules/controls/overlay.d.ts.map +1 -1
- package/dist/modules/dock/cards.d.ts.map +1 -1
- package/dist/modules/dock/dom.d.ts +24 -0
- package/dist/modules/dock/dom.d.ts.map +1 -0
- package/dist/modules/dock/helpers.d.ts +25 -0
- package/dist/modules/dock/helpers.d.ts.map +1 -0
- package/dist/modules/dock/hooks.d.ts +3 -918
- package/dist/modules/dock/hooks.d.ts.map +1 -1
- package/dist/modules/dock/index.d.ts +3 -2
- package/dist/modules/dock/index.d.ts.map +1 -1
- package/dist/modules/dock/index.js +3091 -3079
- package/dist/modules/dock/index.js.map +1 -1
- package/dist/modules/dock/layout.d.ts +26 -0
- package/dist/modules/dock/layout.d.ts.map +1 -0
- package/dist/modules/dock/module.d.ts.map +1 -1
- package/dist/modules/dock/overlay.d.ts.map +1 -1
- package/dist/modules/dock/paths.d.ts +10 -0
- package/dist/modules/dock/paths.d.ts.map +1 -0
- package/dist/modules/dock/provider.d.ts.map +1 -1
- package/dist/modules/dock/runtime/display.d.ts.map +1 -1
- package/dist/modules/dock/runtime/dock.d.ts.map +1 -1
- package/dist/modules/dock/runtime/pipeline.d.ts +32 -0
- package/dist/modules/dock/runtime/pipeline.d.ts.map +1 -0
- package/dist/modules/dock/status/events.d.ts.map +1 -1
- package/dist/modules/dock/styles.d.ts +900 -0
- package/dist/modules/dock/styles.d.ts.map +1 -0
- package/dist/modules/dock/surface/context.d.ts +1 -2
- package/dist/modules/dock/surface/context.d.ts.map +1 -1
- package/dist/modules/dock/surface/definition.d.ts.map +1 -1
- package/dist/modules/dock/surface/helpers.d.ts +7 -0
- package/dist/modules/dock/surface/helpers.d.ts.map +1 -0
- package/dist/modules/dock/surface/hooks.d.ts.map +1 -1
- package/dist/modules/dock/surface/machine.d.ts.map +1 -1
- package/dist/modules/dock/surface/stack.d.ts.map +1 -1
- package/dist/modules/dock/surface/view-model.d.ts.map +1 -1
- package/dist/modules/dock/types.d.ts.map +1 -1
- package/dist/modules/index.js +4861 -4788
- package/dist/modules/index.js.map +1 -1
- package/dist/modules/loading/context.d.ts +2 -13
- package/dist/modules/loading/context.d.ts.map +1 -1
- package/dist/modules/loading/hooks.d.ts +15 -2
- package/dist/modules/loading/hooks.d.ts.map +1 -1
- package/dist/modules/loading/index.d.ts +3 -2
- package/dist/modules/loading/index.d.ts.map +1 -1
- package/dist/modules/loading/index.js +38 -34
- package/dist/modules/loading/index.js.map +1 -1
- package/dist/modules/loading/module.d.ts.map +1 -1
- package/dist/modules/loading/state.d.ts +6 -0
- package/dist/modules/loading/state.d.ts.map +1 -0
- package/dist/modules/media/constants.d.ts +0 -1
- package/dist/modules/media/constants.d.ts.map +1 -1
- package/dist/modules/media/context.d.ts +2 -6
- package/dist/modules/media/context.d.ts.map +1 -1
- package/dist/modules/media/hooks.d.ts +6 -1
- package/dist/modules/media/hooks.d.ts.map +1 -1
- package/dist/modules/media/index.d.ts +4 -3
- package/dist/modules/media/index.d.ts.map +1 -1
- package/dist/modules/media/index.js +100 -98
- package/dist/modules/media/index.js.map +1 -1
- package/dist/modules/media/module.d.ts.map +1 -1
- package/dist/modules/media/overlay.d.ts +0 -5
- package/dist/modules/media/overlay.d.ts.map +1 -1
- package/dist/modules/media/playback.d.ts +5 -0
- package/dist/modules/media/playback.d.ts.map +1 -0
- package/dist/modules/media/session.d.ts +8 -0
- package/dist/modules/media/session.d.ts.map +1 -0
- package/dist/modules/media/types.d.ts +0 -1
- package/dist/modules/media/types.d.ts.map +1 -1
- package/dist/modules/modal/context.d.ts +1 -12
- package/dist/modules/modal/context.d.ts.map +1 -1
- package/dist/modules/modal/dom.d.ts +4 -0
- package/dist/modules/modal/dom.d.ts.map +1 -0
- package/dist/modules/modal/header.d.ts +7 -0
- package/dist/modules/modal/header.d.ts.map +1 -0
- package/dist/modules/modal/hooks.d.ts +12 -1
- package/dist/modules/modal/hooks.d.ts.map +1 -1
- package/dist/modules/modal/identity.d.ts +7 -0
- package/dist/modules/modal/identity.d.ts.map +1 -0
- package/dist/modules/modal/index.d.ts +9 -4
- package/dist/modules/modal/index.d.ts.map +1 -1
- package/dist/modules/modal/index.js +118 -86
- package/dist/modules/modal/index.js.map +1 -1
- package/dist/modules/modal/layout.d.ts +13 -0
- package/dist/modules/modal/layout.d.ts.map +1 -0
- package/dist/modules/modal/module.d.ts.map +1 -1
- package/dist/modules/modal/overlay.d.ts.map +1 -1
- package/dist/modules/modal/types.d.ts.map +1 -1
- package/dist/modules/notification/context.d.ts +2 -8
- package/dist/modules/notification/context.d.ts.map +1 -1
- package/dist/modules/notification/hooks.d.ts +8 -1
- package/dist/modules/notification/hooks.d.ts.map +1 -1
- package/dist/modules/notification/index.d.ts +4 -3
- package/dist/modules/notification/index.d.ts.map +1 -1
- package/dist/modules/notification/index.js +56 -46
- package/dist/modules/notification/index.js.map +1 -1
- package/dist/modules/notification/state.d.ts +17 -0
- package/dist/modules/notification/state.d.ts.map +1 -0
- package/dist/provider.js.map +1 -1
- package/docs/modules/ambient.md +12 -8
- package/docs/modules/background.md +15 -13
- package/docs/modules/context-menu.md +13 -13
- package/docs/modules/controls.md +4 -3
- package/docs/modules/dock.md +8 -2
- package/docs/modules/loading.md +11 -11
- package/docs/modules/media.md +8 -7
- package/docs/modules/modal.md +4 -1
- package/docs/modules/notification.md +4 -4
- package/package.json +1 -1
- package/dist/modules/ambient/utils.d.ts +0 -18
- package/dist/modules/ambient/utils.d.ts.map +0 -1
- package/dist/modules/background/utils.d.ts.map +0 -1
- package/dist/modules/context-menu/utils.d.ts.map +0 -1
- package/dist/modules/controls/utils.d.ts.map +0 -1
- package/dist/modules/dock/utils.d.ts +0 -93
- package/dist/modules/dock/utils.d.ts.map +0 -1
- package/dist/modules/loading/utils.d.ts +0 -4
- package/dist/modules/loading/utils.d.ts.map +0 -1
- package/dist/modules/media/utils.d.ts +0 -17
- package/dist/modules/media/utils.d.ts.map +0 -1
- package/dist/modules/modal/utils.d.ts +0 -31
- package/dist/modules/modal/utils.d.ts.map +0 -1
- package/dist/modules/notification/utils.d.ts +0 -9
- package/dist/modules/notification/utils.d.ts.map +0 -1
|
@@ -1,20 +1,9 @@
|
|
|
1
|
-
import { type RegistryMetadata } from "@/kernel";
|
|
2
1
|
import { type ExternalStore } from "@/utils";
|
|
3
|
-
import { type ModalActions, type
|
|
2
|
+
import { type ModalActions, type ModalProviderProps, type ModalState } from "./types";
|
|
4
3
|
export interface ModalContextValue {
|
|
5
4
|
actions: ModalActions;
|
|
6
5
|
store: ExternalStore<ModalState>;
|
|
7
6
|
}
|
|
8
7
|
export declare const ModalContext: import("react").Context<ModalContextValue | null>;
|
|
9
|
-
export declare function useModalRegistration(config: ModalPageConfig | null | undefined, options?: RegistryMetadata & {
|
|
10
|
-
enabled?: boolean;
|
|
11
|
-
}): void;
|
|
12
|
-
export declare function useModalRegistryEntries(): {
|
|
13
|
-
get: (type: string) => ModalComponent | undefined;
|
|
14
|
-
};
|
|
15
8
|
export declare function ModalProvider({ children, modalRenderer: ModalRenderer, }: ModalProviderProps): import("react").JSX.Element;
|
|
16
|
-
export declare function useModalActions(): ModalActions;
|
|
17
|
-
export declare function useModalState(): ModalState;
|
|
18
|
-
export declare function useModal(): ModalState & ModalActions;
|
|
19
|
-
export declare function useModal(modalInput: ModalInput): ModalHookBinding;
|
|
20
9
|
//# sourceMappingURL=context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/modules/modal/context.tsx"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/modules/modal/context.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,SAAS,CAAC;AAElE,OAAO,EACL,KAAK,YAAY,EAGjB,KAAK,kBAAkB,EACvB,KAAK,UAAU,EAChB,MAAM,SAAS,CAAC;AAKjB,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,YAAY,CAAC;IACtB,KAAK,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;CAClC;AAED,eAAO,MAAM,YAAY,mDAGxB,CAAC;AAOF,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,aAAa,EAAE,aAAoB,GACpC,EAAE,kBAAkB,+BAuHpB"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function dispatchSmoothScrollLock(locked: boolean): void;
|
|
2
|
+
export declare function getFocusableElements(container: HTMLElement | null): HTMLElement[];
|
|
3
|
+
export declare function trapFocus(event: KeyboardEvent, container: HTMLElement | null): void;
|
|
4
|
+
//# sourceMappingURL=dom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../../src/modules/modal/dom.ts"],"names":[],"mappings":"AAKA,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAO9D;AAED,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,WAAW,GAAG,IAAI,GAC5B,WAAW,EAAE,CASf;AAED,wBAAgB,SAAS,CACvB,KAAK,EAAE,aAAa,EACpB,SAAS,EAAE,WAAW,GAAG,IAAI,GAC5B,IAAI,CAmBN"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export declare function hasSlotContent(value: unknown): boolean;
|
|
3
|
+
export declare function isHeaderConfig(value: unknown): boolean;
|
|
4
|
+
export declare function resolveHeaderActions(actions: ReactNode | ((props: {
|
|
5
|
+
close?: (result?: unknown) => void;
|
|
6
|
+
}) => ReactNode) | undefined, close?: (result?: unknown) => void): ReactNode;
|
|
7
|
+
//# sourceMappingURL=header.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../../src/modules/modal/header.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAItD;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAOtD;AAED,wBAAgB,oBAAoB,CAClC,OAAO,EACH,SAAS,GACT,CAAC,CAAC,KAAK,EAAE;IAAE,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,KAAK,IAAI,CAAA;CAAE,KAAK,SAAS,CAAC,GAC9D,SAAS,EACb,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,KAAK,IAAI,GACjC,SAAS,CAEX"}
|
|
@@ -1,4 +1,15 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type RegistryMetadata } from "@/kernel";
|
|
2
|
+
import { type ModalActions, type ModalComponent, type ModalEntry, type ModalHookBinding, type ModalInput, type ModalPageConfig, type ModalState } from "./types";
|
|
3
|
+
export declare function useModalRegistration(config: ModalPageConfig | null | undefined, options?: RegistryMetadata & {
|
|
4
|
+
enabled?: boolean;
|
|
5
|
+
}): void;
|
|
6
|
+
export declare function useModalRegistryEntries(): {
|
|
7
|
+
get: (type: string) => ModalComponent | undefined;
|
|
8
|
+
};
|
|
9
|
+
export declare function useModalActions(): ModalActions;
|
|
10
|
+
export declare function useModalState(): ModalState;
|
|
11
|
+
export declare function useModal(): ModalState & ModalActions;
|
|
12
|
+
export declare function useModal(modalInput: ModalInput): ModalHookBinding;
|
|
2
13
|
export declare function useModalLayerModel({ closeModal, entry, isMobileViewport, isTopModal, modalStack, registry, stackIndex, }: {
|
|
3
14
|
closeModal: (result?: unknown, targetModalId?: number | null) => void;
|
|
4
15
|
entry: ModalEntry;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../src/modules/modal/hooks.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../src/modules/modal/hooks.ts"],"names":[],"mappings":"AAWA,OAAO,EAGL,KAAK,gBAAgB,EACtB,MAAM,UAAU,CAAC;AAYlB,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,gBAAgB,EAErB,KAAK,UAAU,EAEf,KAAK,eAAe,EACpB,KAAK,UAAU,EAChB,MAAM,SAAS,CAAC;AAajB,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,eAAe,GAAG,IAAI,GAAG,SAAS,EAC1C,OAAO,CAAC,EAAE,gBAAgB,GAAG;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GACjD,IAAI,CAEN;AAED,wBAAgB,uBAAuB,IAAI;IACzC,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,cAAc,GAAG,SAAS,CAAC;CACnD,CAGA;AAED,wBAAgB,eAAe,IAAI,YAAY,CAG9C;AAED,wBAAgB,aAAa,IAAI,UAAU,CAO1C;AAED,wBAAgB,QAAQ,IAAI,UAAU,GAAG,YAAY,CAAC;AACtD,wBAAgB,QAAQ,CAAC,UAAU,EAAE,UAAU,GAAG,gBAAgB,CAAC;AAgCnE,wBAAgB,kBAAkB,CAAC,EACjC,UAAU,EACV,KAAK,EACL,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,QAAQ,EACR,UAAU,GACX,EAAE;IACD,UAAU,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACtE,KAAK,EAAE,UAAU,CAAC;IAClB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,UAAU,EAAE,CAAC;IACzB,QAAQ,EAAE;QAAE,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,cAAc,GAAG,SAAS,CAAA;KAAE,CAAC;IAC/D,UAAU,EAAE,MAAM,CAAC;CACpB;;;;;;;;;;EAiDA;AAED,wBAAgB,sBAAsB;;EAErC;AAED,wBAAgB,aAAa;;;;aA5HtB,CAAC,IAAI,EAAE,MAAM,KAAK,cAAc,GAAG,SAAS;;;;;;;;;;EA6MlD"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type DefineModalOptions, type ModalComponent, type ModalInput } from "./types";
|
|
2
|
+
export declare function getModalIdentity(input: ModalInput | DefineModalOptions): {
|
|
3
|
+
component: ModalComponent | null;
|
|
4
|
+
type: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function getModalLabel(modalType?: string | null): string;
|
|
7
|
+
//# sourceMappingURL=identity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../../src/modules/modal/identity.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,UAAU,EAChB,MAAM,SAAS,CAAC;AAEjB,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,UAAU,GAAG,kBAAkB,GAAG;IACxE,SAAS,EAAE,cAAc,GAAG,IAAI,CAAC;IACjC,IAAI,EAAE,MAAM,CAAC;CACd,CAaA;AAED,wBAAgB,aAAa,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAQ/D"}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
export { Modal } from "./overlay";
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
1
|
+
export { Modal, ModalContainer } from "./overlay";
|
|
2
|
+
export { ModalContext, ModalProvider, type ModalContextValue, } from "./context";
|
|
3
|
+
export { useModal, useModalActions, useModalContainerModel, useModalLayerModel, useModalModel, useModalRegistration, useModalRegistryEntries, useModalState, } from "./hooks";
|
|
4
4
|
export { defineModal, modalModule } from "./module";
|
|
5
|
-
export { MODAL_CHROME, MODAL_POSITIONS, modalTheme } from "./constants";
|
|
5
|
+
export { MODAL_BREAKPOINTS, MODAL_CHROME, MODAL_POSITIONS, SMOOTH_SCROLL_LOCK_EVENT, modalTheme, } from "./constants";
|
|
6
|
+
export { createModalState, INITIAL_MODAL_STATE } from "./state";
|
|
7
|
+
export { getModalIdentity, getModalLabel } from "./identity";
|
|
8
|
+
export { getModalLayout, getModalPosition, getViewportIsMobile, hasHeightConstraint, isSidePosition, isVerticalEdgePosition, normalizePosition, resolveActivePosition, } from "./layout";
|
|
9
|
+
export { dispatchSmoothScrollLock, getFocusableElements, trapFocus, } from "./dom";
|
|
10
|
+
export { hasSlotContent, isHeaderConfig, resolveHeaderActions, } from "./header";
|
|
6
11
|
export type * from "./types";
|
|
7
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/modal/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/modal/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EACL,YAAY,EACZ,aAAa,EACb,KAAK,iBAAiB,GACvB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,QAAQ,EACR,eAAe,EACf,sBAAsB,EACtB,kBAAkB,EAClB,aAAa,EACb,oBAAoB,EACpB,uBAAuB,EACvB,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,wBAAwB,EACxB,UAAU,GACX,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,cAAc,EACd,sBAAsB,EACtB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACpB,SAAS,GACV,MAAM,OAAO,CAAC;AACf,OAAO,EACL,cAAc,EACd,cAAc,EACd,oBAAoB,GACrB,MAAM,UAAU,CAAC;AAClB,mBAAmB,SAAS,CAAC"}
|
|
@@ -3,7 +3,7 @@ import { Icon as Icon$1 } from '@iconify-icon/react';
|
|
|
3
3
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
4
4
|
import { clsx } from 'clsx';
|
|
5
5
|
import { twMerge } from 'tailwind-merge';
|
|
6
|
-
import { useState, useRef, useCallback, useMemo,
|
|
6
|
+
import { isValidElement, useState, useRef, useCallback, useMemo, useEffect, useSyncExternalStore, useLayoutEffect, createContext, use, useContext, createElement, useId, cloneElement, Children } from 'react';
|
|
7
7
|
import { usePathname } from 'next/navigation';
|
|
8
8
|
import { motion, AnimatePresence } from 'motion/react';
|
|
9
9
|
import { createPortal } from 'react-dom';
|
|
@@ -538,6 +538,7 @@ function pickRegistryMetadata(options) {
|
|
|
538
538
|
var init_schema = __esm({
|
|
539
539
|
"src/kernel/schema.ts"() {
|
|
540
540
|
init_constants();
|
|
541
|
+
init_utils();
|
|
541
542
|
init_utils2();
|
|
542
543
|
}
|
|
543
544
|
});
|
|
@@ -838,8 +839,8 @@ function applyRegistryConfig(config, context) {
|
|
|
838
839
|
var NO_CLEANUP;
|
|
839
840
|
var init_handlers = __esm({
|
|
840
841
|
"src/kernel/handlers.ts"() {
|
|
842
|
+
init_constants();
|
|
841
843
|
init_schema();
|
|
842
|
-
init_utils2();
|
|
843
844
|
init_utils();
|
|
844
845
|
NO_CLEANUP = () => {
|
|
845
846
|
};
|
|
@@ -1497,15 +1498,8 @@ var init_motion2 = __esm({
|
|
|
1497
1498
|
});
|
|
1498
1499
|
}
|
|
1499
1500
|
});
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
const options = typeof input === "function" ? { component: input } : input;
|
|
1503
|
-
const component = options.component ?? null;
|
|
1504
|
-
return {
|
|
1505
|
-
component,
|
|
1506
|
-
type: "type" in options && options.type || "id" in options && options.id || component?.displayName || component?.name || "modal"
|
|
1507
|
-
};
|
|
1508
|
-
}
|
|
1501
|
+
|
|
1502
|
+
// src/modules/modal/layout.ts
|
|
1509
1503
|
function hasHeightConstraint(className) {
|
|
1510
1504
|
return typeof className === "string" && HEIGHT_CONSTRAINT_PATTERN.test(className);
|
|
1511
1505
|
}
|
|
@@ -1515,17 +1509,6 @@ function isSidePosition(position) {
|
|
|
1515
1509
|
function isVerticalEdgePosition(position) {
|
|
1516
1510
|
return position === MODAL_POSITIONS.TOP || position === MODAL_POSITIONS.BOTTOM;
|
|
1517
1511
|
}
|
|
1518
|
-
function hasSlotContent(value) {
|
|
1519
|
-
return value !== null && value !== void 0 && value !== false && value !== "";
|
|
1520
|
-
}
|
|
1521
|
-
function isHeaderConfig(value) {
|
|
1522
|
-
return Boolean(
|
|
1523
|
-
value && typeof value === "object" && !Array.isArray(value) && !isValidElement(value)
|
|
1524
|
-
);
|
|
1525
|
-
}
|
|
1526
|
-
function resolveHeaderActions(actions, close) {
|
|
1527
|
-
return typeof actions === "function" ? actions({ close }) : actions || null;
|
|
1528
|
-
}
|
|
1529
1512
|
function getModalPosition(position) {
|
|
1530
1513
|
return position === MODAL_POSITIONS.TOP || position === MODAL_POSITIONS.BOTTOM || position === MODAL_POSITIONS.LEFT || position === MODAL_POSITIONS.RIGHT ? position : MODAL_POSITIONS.CENTER;
|
|
1531
1514
|
}
|
|
@@ -1538,14 +1521,6 @@ function getModalLayout(position, isMobile) {
|
|
|
1538
1521
|
return "side-mobile";
|
|
1539
1522
|
return resolved;
|
|
1540
1523
|
}
|
|
1541
|
-
function dispatchSmoothScrollLock(locked) {
|
|
1542
|
-
if (typeof window === "undefined") return;
|
|
1543
|
-
window.dispatchEvent(
|
|
1544
|
-
new CustomEvent(SMOOTH_SCROLL_LOCK_EVENT, {
|
|
1545
|
-
detail: { locked, source: "modal" }
|
|
1546
|
-
})
|
|
1547
|
-
);
|
|
1548
|
-
}
|
|
1549
1524
|
function getViewportIsMobile() {
|
|
1550
1525
|
if (typeof window === "undefined" || typeof window.matchMedia !== "function") {
|
|
1551
1526
|
return false;
|
|
@@ -1575,40 +1550,44 @@ function normalizePosition(input) {
|
|
|
1575
1550
|
responsivePosition: input
|
|
1576
1551
|
};
|
|
1577
1552
|
}
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1553
|
+
var init_layout = __esm({
|
|
1554
|
+
"src/modules/modal/layout.ts"() {
|
|
1555
|
+
init_utils();
|
|
1556
|
+
init_constants2();
|
|
1557
|
+
}
|
|
1558
|
+
});
|
|
1559
|
+
function hasSlotContent(value) {
|
|
1560
|
+
return value !== null && value !== void 0 && value !== false && value !== "";
|
|
1561
|
+
}
|
|
1562
|
+
function isHeaderConfig(value) {
|
|
1563
|
+
return Boolean(
|
|
1564
|
+
value && typeof value === "object" && !Array.isArray(value) && !isValidElement(value)
|
|
1584
1565
|
);
|
|
1585
1566
|
}
|
|
1586
|
-
function
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
const lastElement = elements[elements.length - 1];
|
|
1592
|
-
if (event.shiftKey) {
|
|
1593
|
-
if (document.activeElement === firstElement) {
|
|
1594
|
-
event.preventDefault();
|
|
1595
|
-
lastElement?.focus();
|
|
1596
|
-
}
|
|
1597
|
-
} else {
|
|
1598
|
-
if (document.activeElement === lastElement) {
|
|
1599
|
-
event.preventDefault();
|
|
1600
|
-
firstElement?.focus();
|
|
1601
|
-
}
|
|
1567
|
+
function resolveHeaderActions(actions, close) {
|
|
1568
|
+
return typeof actions === "function" ? actions({ close }) : actions || null;
|
|
1569
|
+
}
|
|
1570
|
+
var init_header = __esm({
|
|
1571
|
+
"src/modules/modal/header.ts"() {
|
|
1602
1572
|
}
|
|
1573
|
+
});
|
|
1574
|
+
|
|
1575
|
+
// src/modules/modal/identity.ts
|
|
1576
|
+
function getModalIdentity(input) {
|
|
1577
|
+
if (typeof input === "string") return { component: null, type: input };
|
|
1578
|
+
const options = typeof input === "function" ? { component: input } : input;
|
|
1579
|
+
const component = options.component ?? null;
|
|
1580
|
+
return {
|
|
1581
|
+
component,
|
|
1582
|
+
type: "type" in options && options.type || "id" in options && options.id || component?.displayName || component?.name || "modal"
|
|
1583
|
+
};
|
|
1603
1584
|
}
|
|
1604
1585
|
function getModalLabel(modalType) {
|
|
1605
1586
|
if (typeof modalType !== "string" || !modalType.trim()) return "Modal";
|
|
1606
1587
|
return modalType.trim().toLowerCase().split(/[_-]+/).map((part) => `${part.charAt(0).toUpperCase()}${part.slice(1)}`).join(" ");
|
|
1607
1588
|
}
|
|
1608
|
-
var
|
|
1609
|
-
"src/modules/modal/
|
|
1610
|
-
init_utils();
|
|
1611
|
-
init_constants2();
|
|
1589
|
+
var init_identity = __esm({
|
|
1590
|
+
"src/modules/modal/identity.ts"() {
|
|
1612
1591
|
}
|
|
1613
1592
|
});
|
|
1614
1593
|
|
|
@@ -1636,13 +1615,6 @@ var init_state = __esm({
|
|
|
1636
1615
|
INITIAL_MODAL_STATE = createModalState([]);
|
|
1637
1616
|
}
|
|
1638
1617
|
});
|
|
1639
|
-
function useModalRegistration(config, options) {
|
|
1640
|
-
useModuleRegistration("modal", config, options);
|
|
1641
|
-
}
|
|
1642
|
-
function useModalRegistryEntries() {
|
|
1643
|
-
const entries = useRegistryEntries("modal");
|
|
1644
|
-
return useMemo(() => ({ get: (type) => entries[type] }), [entries]);
|
|
1645
|
-
}
|
|
1646
1618
|
function ModalProvider({
|
|
1647
1619
|
children,
|
|
1648
1620
|
modalRenderer: ModalRenderer = null
|
|
@@ -1740,6 +1712,70 @@ function ModalProvider({
|
|
|
1740
1712
|
children
|
|
1741
1713
|
] });
|
|
1742
1714
|
}
|
|
1715
|
+
var ModalContext;
|
|
1716
|
+
var init_context = __esm({
|
|
1717
|
+
"src/modules/modal/context.tsx"() {
|
|
1718
|
+
"use client";
|
|
1719
|
+
init_kernel();
|
|
1720
|
+
init_utils();
|
|
1721
|
+
init_constants2();
|
|
1722
|
+
init_state();
|
|
1723
|
+
init_identity();
|
|
1724
|
+
init_layout();
|
|
1725
|
+
ModalContext = getOrCreateGlobalContext(
|
|
1726
|
+
"ModalContext",
|
|
1727
|
+
null
|
|
1728
|
+
);
|
|
1729
|
+
}
|
|
1730
|
+
});
|
|
1731
|
+
|
|
1732
|
+
// src/modules/modal/dom.ts
|
|
1733
|
+
function dispatchSmoothScrollLock(locked) {
|
|
1734
|
+
if (typeof window === "undefined") return;
|
|
1735
|
+
window.dispatchEvent(
|
|
1736
|
+
new CustomEvent(SMOOTH_SCROLL_LOCK_EVENT, {
|
|
1737
|
+
detail: { locked, source: "modal" }
|
|
1738
|
+
})
|
|
1739
|
+
);
|
|
1740
|
+
}
|
|
1741
|
+
function getFocusableElements(container) {
|
|
1742
|
+
if (!container || typeof container.querySelectorAll !== "function") return [];
|
|
1743
|
+
return Array.from(
|
|
1744
|
+
container.querySelectorAll(FOCUSABLE_SELECTOR)
|
|
1745
|
+
).filter(
|
|
1746
|
+
(element) => !element.hasAttribute("disabled") && element.getAttribute("aria-hidden") !== "true"
|
|
1747
|
+
);
|
|
1748
|
+
}
|
|
1749
|
+
function trapFocus(event, container) {
|
|
1750
|
+
if (event.key !== "Tab" || !container) return;
|
|
1751
|
+
const elements = getFocusableElements(container);
|
|
1752
|
+
if (elements.length === 0) return;
|
|
1753
|
+
const firstElement = elements[0];
|
|
1754
|
+
const lastElement = elements[elements.length - 1];
|
|
1755
|
+
if (event.shiftKey) {
|
|
1756
|
+
if (document.activeElement === firstElement) {
|
|
1757
|
+
event.preventDefault();
|
|
1758
|
+
lastElement?.focus();
|
|
1759
|
+
}
|
|
1760
|
+
} else {
|
|
1761
|
+
if (document.activeElement === lastElement) {
|
|
1762
|
+
event.preventDefault();
|
|
1763
|
+
firstElement?.focus();
|
|
1764
|
+
}
|
|
1765
|
+
}
|
|
1766
|
+
}
|
|
1767
|
+
var init_dom2 = __esm({
|
|
1768
|
+
"src/modules/modal/dom.ts"() {
|
|
1769
|
+
init_constants2();
|
|
1770
|
+
}
|
|
1771
|
+
});
|
|
1772
|
+
function useModalRegistration(config, options) {
|
|
1773
|
+
useModuleRegistration("modal", config, options);
|
|
1774
|
+
}
|
|
1775
|
+
function useModalRegistryEntries() {
|
|
1776
|
+
const entries = useRegistryEntries("modal");
|
|
1777
|
+
return useMemo(() => ({ get: (type) => entries[type] }), [entries]);
|
|
1778
|
+
}
|
|
1743
1779
|
function useModalActions() {
|
|
1744
1780
|
return useRequiredContext(ModalContext, "useModalActions", "ModalProvider").actions;
|
|
1745
1781
|
}
|
|
@@ -1770,23 +1806,6 @@ function useModal(modalInput) {
|
|
|
1770
1806
|
return Object.assign([open, controls], controls, { open });
|
|
1771
1807
|
}, [actions, modalInput, state]);
|
|
1772
1808
|
}
|
|
1773
|
-
var ModalContext;
|
|
1774
|
-
var init_context = __esm({
|
|
1775
|
-
"src/modules/modal/context.tsx"() {
|
|
1776
|
-
"use client";
|
|
1777
|
-
init_hooks();
|
|
1778
|
-
init_kernel();
|
|
1779
|
-
init_utils();
|
|
1780
|
-
init_constants2();
|
|
1781
|
-
init_state();
|
|
1782
|
-
init_utils3();
|
|
1783
|
-
init_utils();
|
|
1784
|
-
ModalContext = getOrCreateGlobalContext(
|
|
1785
|
-
"ModalContext",
|
|
1786
|
-
null
|
|
1787
|
-
);
|
|
1788
|
-
}
|
|
1789
|
-
});
|
|
1790
1809
|
function useModalLayerModel({
|
|
1791
1810
|
closeModal,
|
|
1792
1811
|
entry,
|
|
@@ -1918,12 +1937,16 @@ var emptySubscribe;
|
|
|
1918
1937
|
var init_hooks3 = __esm({
|
|
1919
1938
|
"src/modules/modal/hooks.ts"() {
|
|
1920
1939
|
"use client";
|
|
1940
|
+
init_hooks();
|
|
1941
|
+
init_kernel();
|
|
1921
1942
|
init_tokens2();
|
|
1922
1943
|
init_utils();
|
|
1923
1944
|
init_theme();
|
|
1924
1945
|
init_constants2();
|
|
1925
|
-
init_utils3();
|
|
1926
1946
|
init_context();
|
|
1947
|
+
init_identity();
|
|
1948
|
+
init_dom2();
|
|
1949
|
+
init_layout();
|
|
1927
1950
|
emptySubscribe = () => () => {
|
|
1928
1951
|
};
|
|
1929
1952
|
}
|
|
@@ -2246,20 +2269,24 @@ var init_overlay = __esm({
|
|
|
2246
2269
|
init_kernel();
|
|
2247
2270
|
init_constants2();
|
|
2248
2271
|
init_motion2();
|
|
2249
|
-
|
|
2272
|
+
init_layout();
|
|
2273
|
+
init_header();
|
|
2274
|
+
init_identity();
|
|
2250
2275
|
init_hooks3();
|
|
2251
2276
|
}
|
|
2252
2277
|
});
|
|
2253
2278
|
|
|
2254
2279
|
// src/modules/modal/index.ts
|
|
2255
2280
|
init_overlay();
|
|
2256
|
-
init_overlay();
|
|
2257
2281
|
init_context();
|
|
2282
|
+
init_hooks3();
|
|
2258
2283
|
|
|
2259
2284
|
// src/modules/modal/module.tsx
|
|
2285
|
+
init_hooks();
|
|
2260
2286
|
init_kernel();
|
|
2261
2287
|
init_context();
|
|
2262
|
-
|
|
2288
|
+
init_hooks3();
|
|
2289
|
+
init_identity();
|
|
2263
2290
|
var LazyModal = dynamic(
|
|
2264
2291
|
() => Promise.resolve().then(() => (init_overlay(), overlay_exports)).then((view) => view.Modal),
|
|
2265
2292
|
{
|
|
@@ -2272,7 +2299,7 @@ function selectPageModals(config) {
|
|
|
2272
2299
|
function useModalPage(slice, page) {
|
|
2273
2300
|
const actions = useModalActions();
|
|
2274
2301
|
const sliceRef = useRef(slice);
|
|
2275
|
-
|
|
2302
|
+
useIsomorphicLayoutEffect(() => {
|
|
2276
2303
|
sliceRef.current = slice;
|
|
2277
2304
|
}, [slice]);
|
|
2278
2305
|
return useMemo(
|
|
@@ -2320,7 +2347,12 @@ function defineModal(definition = {}) {
|
|
|
2320
2347
|
|
|
2321
2348
|
// src/modules/modal/index.ts
|
|
2322
2349
|
init_constants2();
|
|
2350
|
+
init_state();
|
|
2351
|
+
init_identity();
|
|
2352
|
+
init_layout();
|
|
2353
|
+
init_dom2();
|
|
2354
|
+
init_header();
|
|
2323
2355
|
|
|
2324
|
-
export { MODAL_CHROME, MODAL_POSITIONS, Modal, ModalContainer, ModalContext, ModalProvider, defineModal, modalModule, modalTheme, useModal, useModalActions, useModalRegistration, useModalState };
|
|
2356
|
+
export { INITIAL_MODAL_STATE, MODAL_BREAKPOINTS, MODAL_CHROME, MODAL_POSITIONS, Modal, ModalContainer, ModalContext, ModalProvider, SMOOTH_SCROLL_LOCK_EVENT, createModalState, defineModal, dispatchSmoothScrollLock, getFocusableElements, getModalIdentity, getModalLabel, getModalLayout, getModalPosition, getViewportIsMobile, hasHeightConstraint, hasSlotContent, isHeaderConfig, isSidePosition, isVerticalEdgePosition, modalModule, modalTheme, normalizePosition, resolveActivePosition, resolveHeaderActions, trapFocus, useModal, useModalActions, useModalContainerModel, useModalLayerModel, useModalModel, useModalRegistration, useModalRegistryEntries, useModalState };
|
|
2325
2357
|
//# sourceMappingURL=index.js.map
|
|
2326
2358
|
//# sourceMappingURL=index.js.map
|