vasille-web 5.1.1 → 5.1.3

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/lib/dev.js CHANGED
@@ -8,13 +8,13 @@ function createPortal(node, declaration, usage, name) {
8
8
  return portal;
9
9
  }
10
10
  export function devModal(modalFn, declaration, name) {
11
- return (input, node, usage) => {
11
+ return (input, node, slot, usage) => {
12
12
  modal(modalFn, node => {
13
13
  const portal = createPortal(node, declaration, usage, name);
14
14
  const inspector = portal.runner.inspector;
15
15
  const event = {
16
16
  position: usage,
17
- target: { component: portal.id },
17
+ target: portal.id,
18
18
  };
19
19
  inspector.eventTrigger({
20
20
  eventName: "open",
@@ -29,7 +29,7 @@ export function devModal(modalFn, declaration, name) {
29
29
  });
30
30
  });
31
31
  return portal;
32
- })(input, node);
32
+ })(input, node, slot);
33
33
  };
34
34
  }
35
35
  export function devPrompt(modal, declaration, name) {
@@ -41,7 +41,7 @@ export function devPrompt(modal, declaration, name) {
41
41
  };
42
42
  return prompt(modal, node => {
43
43
  const portal = createPortal(node, declaration, usage, name);
44
- target = { component: portal.id };
44
+ target = portal.id;
45
45
  inspector = portal.runner.inspector;
46
46
  inspector.eventTrigger({
47
47
  eventName: "open",
package/lib/index.js CHANGED
@@ -15,11 +15,14 @@ function createPortal(node) {
15
15
  return portal;
16
16
  }
17
17
  export function modal(modal, create = createPortal) {
18
- return function (props, node) {
18
+ return function (props, node, slot) {
19
19
  if (!node) {
20
20
  throw new Error("Vasille: Modal context is missing");
21
21
  }
22
22
  const portal = create(node);
23
+ if (!props.slot && slot) {
24
+ props.slot = slot;
25
+ }
23
26
  try {
24
27
  modal(portal, props);
25
28
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vasille-web",
3
- "version": "5.1.1",
3
+ "version": "5.1.3",
4
4
  "description": "The same framework which is designed to build bulletproof frontends.",
5
5
  "main": "index.js",
6
6
  "types": "./index.d.ts",
@@ -50,10 +50,10 @@
50
50
  "homepage": "https://github.com/vasille-js/vasille-js#readme",
51
51
  "dependencies": {
52
52
  "csstype": "^3.1.3",
53
- "vasille": "^5.1.7",
53
+ "vasille": "^5.1.9",
54
54
  "vasille-context": "^5.0.0",
55
55
  "vasille-css": "^5.0.0",
56
- "vasille-jsx": "^5.1.3",
56
+ "vasille-jsx": "^5.1.4",
57
57
  "vasille-router": "^5.0.0"
58
58
  },
59
59
  "devDependencies": {
package/types/dev.d.ts CHANGED
@@ -3,7 +3,8 @@ import { TagOptions } from "vasille/web-runner";
3
3
  import { IDevRunner, Inspector, StaticPosition } from "vasille/dev";
4
4
  import { PromptProps } from "./index.js";
5
5
  import { WebRouterInitialization } from "vasille-router/web-router";
6
- export declare function devModal<T extends object>(modalFn: (node: Fragment<Node, Element, TagOptions>, input: T) => void, declaration: StaticPosition, name: string): (input: T, node: Fragment<Node, Element, TagOptions>, usage: StaticPosition | undefined) => void;
6
+ import { CompositionProps } from "vasille-jsx";
7
+ export declare function devModal<T extends CompositionProps>(modalFn: (node: Fragment<Node, Element, TagOptions>, input: T) => void, declaration: StaticPosition, name: string): (input: T, node: Fragment<Node, Element, TagOptions>, slot?: T["slot"], usage?: StaticPosition) => void;
7
8
  export declare function devPrompt<T extends PromptProps>(modal: (node: Fragment<Node, Element, TagOptions, IDevRunner<Node, Element, TagOptions>>, input: T) => void, declaration: StaticPosition, name: string): (node: Fragment<Node, Element, TagOptions, IDevRunner<Node, Element, TagOptions>>, input: T, timeout: number | undefined, usage: StaticPosition | undefined) => Promise<unknown>;
8
9
  export declare function devMount<T>(element: Element, component: ($: T) => void, input: T, inspector: Inspector): import("vasille").App<Node, Element, import("vasille/dev").DevTagOptions, import("vasille").Runner<Node, Element, import("vasille/dev").DevTagOptions>>;
9
10
  export declare function devRouterApp<Routes extends string>(init: WebRouterInitialization<Routes>, element: Element, inspector: Inspector): import("vasille").App<Node, Element, import("vasille/dev").DevTagOptions, import("vasille").Runner<Node, Element, import("vasille/dev").DevTagOptions>>;
package/types/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { App, Fragment, Portal } from "vasille";
2
2
  import { TagOptions } from "vasille/web-runner";
3
+ import { CompositionProps } from "vasille-jsx";
3
4
  import { WebRouterInitialization } from "vasille-router/web-router";
4
5
  export { styleSheet } from "vasille-css";
5
6
  export type { RawStyleProps as StyleProps, StyleSheetProps } from "./spec/css.js";
@@ -10,7 +11,7 @@ export { type QueryParams, type ScreenProps, type RouteParameters, screen, scree
10
11
  export { Router, type WebRouterInitialization, type NavigationMode } from "vasille-router/web-router";
11
12
  export { setMobileMaxWidth, setTabletMaxWidth, setLaptopMaxWidth } from "vasille-css";
12
13
  export { context, impute, receive, share } from "vasille-context";
13
- export declare function modal<T extends object>(modal: (node: Fragment<Node, Element, TagOptions>, input: T) => void, create?: (node: Fragment<Node, Element, TagOptions>) => Portal<Node, Element, TagOptions>): (input: T, node: Fragment<Node, Element, TagOptions>) => void;
14
+ export declare function modal<T extends CompositionProps>(modal: (node: Fragment<Node, Element, TagOptions>, input: T) => void, create?: (node: Fragment<Node, Element, TagOptions>) => Portal<Node, Element, TagOptions>): (input: T, node: Fragment<Node, Element, TagOptions>, slot?: T["slot"]) => void;
14
15
  export interface PromptProps {
15
16
  resolve(data: unknown): void;
16
17
  reject(err: unknown): void;