brew-js-react 0.1.0 → 0.1.1

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/app.js CHANGED
@@ -1,11 +1,12 @@
1
- import brew from "brew-js";
1
+ import { install } from "./include/brew-js/app.js";
2
+ import defaults from "./include/brew-js/defaults.js";
2
3
 
3
4
  /** @type {Brew.AppInstance<Brew.WithRouter & Brew.WithI18n>} */
4
5
  export var app;
5
6
 
6
- brew.install('react', function (app_) {
7
+ install('react', function (app_) {
7
8
  // @ts-ignore: type inference issue
8
9
  app = app_;
9
10
  });
10
11
 
11
- brew.defaults.react = true;
12
+ defaults.react = true;
package/dialog.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import React, { useEffect, useState } from "react";
2
2
  import ReactDOM from "react-dom";
3
- import brew from "brew-js";
4
3
  import { always, either, extend, noop } from "./include/zeta-dom/util.js";
5
4
  import { containsOrEquals, removeNode } from "./include/zeta-dom/domUtil.js";
6
5
  import dom from "./include/zeta-dom/dom.js";
6
+ import { closeFlyout, openFlyout } from "./include/brew-js/domAction.js";
7
7
 
8
8
  /**
9
9
  * @param {Partial<import("./dialog").DialogOptions<any>>} props
@@ -16,7 +16,7 @@ export function createDialog(props) {
16
16
  function closeDialog(value) {
17
17
  if (!closing) {
18
18
  closing = true;
19
- brew.closeFlyout(root, value).then(function () {
19
+ closeFlyout(root, value).then(function () {
20
20
  closing = false;
21
21
  removeNode(root);
22
22
  (props.onClose || noop)(root);
@@ -45,7 +45,7 @@ export function createDialog(props) {
45
45
  ReactDOM.render(React.createElement(props.onRender, extend({ closeDialog }, props)), root);
46
46
  }
47
47
 
48
- promise = brew.openFlyout(root);
48
+ promise = openFlyout(root);
49
49
  always(promise, function () {
50
50
  promise = null;
51
51
  });