@teselagen/ui 0.7.3-beta.3 → 0.7.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.
@@ -1,7 +1,10 @@
1
- export function EditableCell({ cancelEdit, dataTest, finishEdit, isNumeric, initialValue }: {
1
+ export function EditableCell({ cancelEdit, dataTest, finishEdit, initialValue, isEditableCellInitialValue, isNumeric, shouldSelectAll, stopSelectAll }: {
2
2
  cancelEdit: any;
3
3
  dataTest: any;
4
4
  finishEdit: any;
5
- isNumeric: any;
6
5
  initialValue: any;
6
+ isEditableCellInitialValue: any;
7
+ isNumeric: any;
8
+ shouldSelectAll: any;
9
+ stopSelectAll: any;
7
10
  }): import("react/jsx-runtime").JSX.Element;
package/index.cjs.js CHANGED
@@ -67554,8 +67554,10 @@ const Uploader = /* @__PURE__ */ __name(({
67554
67554
  Promise.allSettled(Array.isArray(__accept) ? __accept : [__accept]).then(
67555
67555
  (results) => {
67556
67556
  const resolved = flatMap(results, (r2) => r2.value);
67557
- setAcceptLoading(false);
67558
67557
  setResolvedAccept(resolved);
67558
+ setTimeout(() => {
67559
+ setAcceptLoading(false);
67560
+ }, 0);
67559
67561
  }
67560
67562
  );
67561
67563
  }
@@ -72891,7 +72893,7 @@ const _FillWindow = class _FillWindow extends React$1.Component {
72891
72893
  this.props.children && isFunction$5(this.props.children) ? this.props.children(windowDimensions) : this.props.children
72892
72894
  );
72893
72895
  if (asPortal)
72894
- return require$$2$1(inner, window.document.body);
72896
+ return React$1.createPortal(inner, window.document.body);
72895
72897
  return inner;
72896
72898
  }
72897
72899
  };
package/index.es.js CHANGED
@@ -57,7 +57,7 @@ var __async = (__this, __arguments, generator) => {
57
57
  });
58
58
  };
59
59
  import * as React$1 from "react";
60
- import React__default, { useState, useEffect, forwardRef, useImperativeHandle, Fragment, useMemo, useRef, useReducer, useCallback, createElement, Component, useLayoutEffect, createContext, memo, useContext, isValidElement, PureComponent } from "react";
60
+ import React__default, { useState, useEffect, forwardRef, useImperativeHandle, Fragment, useMemo, useRef, useReducer, useCallback, createElement, Component, useLayoutEffect, createContext, memo, useContext, isValidElement, PureComponent, createPortal as createPortal$1 } from "react";
61
61
  import { Icon, Classes, Button, Intent, MenuItem, Keys, Tag, Popover, Tooltip, Spinner, InputGroup, Checkbox, Switch, TextArea, EditableText, NumericInput, RadioGroup, Position, FormGroup, Menu, Toaster, MenuDivider, useHotkeys, ContextMenu, Callout, Dialog, Card, Tabs, Tab, Colors, Overlay, KeyCombo, ProgressBar } from "@blueprintjs/core";
62
62
  import { formValueSelector, initialize, change, Field, reduxForm, SubmissionError, destroy, touch, FormName, Fields } from "redux-form";
63
63
  import require$$2$1, { unstable_batchedUpdates, createPortal, flushSync } from "react-dom";
@@ -67536,8 +67536,10 @@ const Uploader = /* @__PURE__ */ __name(({
67536
67536
  Promise.allSettled(Array.isArray(__accept) ? __accept : [__accept]).then(
67537
67537
  (results) => {
67538
67538
  const resolved = flatMap(results, (r2) => r2.value);
67539
- setAcceptLoading(false);
67540
67539
  setResolvedAccept(resolved);
67540
+ setTimeout(() => {
67541
+ setAcceptLoading(false);
67542
+ }, 0);
67541
67543
  }
67542
67544
  );
67543
67545
  }
@@ -72873,7 +72875,7 @@ const _FillWindow = class _FillWindow extends React__default.Component {
72873
72875
  this.props.children && isFunction$5(this.props.children) ? this.props.children(windowDimensions) : this.props.children
72874
72876
  );
72875
72877
  if (asPortal)
72876
- return require$$2$1(inner, window.document.body);
72878
+ return createPortal$1(inner, window.document.body);
72877
72879
  return inner;
72878
72880
  }
72879
72881
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teselagen/ui",
3
- "version": "0.7.3-beta.3",
3
+ "version": "0.7.3",
4
4
  "main": "./src/index.js",
5
5
  "exports": {
6
6
  ".": {
@@ -45,6 +45,7 @@
45
45
  "react-color": "^2.19.3",
46
46
  "react-dom": "^18.3.1",
47
47
  "react-dropzone": "^11.4.2",
48
+ "react-markdown": "8.0.7",
48
49
  "react-redux": "^8.0.5",
49
50
  "react-rnd": "^10.2.4",
50
51
  "react-router-dom": "4",
@@ -53,6 +54,7 @@
53
54
  "redux": "^4.1.2",
54
55
  "redux-form": "^8.3.10",
55
56
  "redux-thunk": "2.4.1",
57
+ "remark-gfm": "^3.0.1",
56
58
  "tippy.js": "^6.3.7",
57
59
  "url-join": "^4.0.1",
58
60
  "use-deep-compare-effect": "^1.6.1",
@@ -1,20 +1,30 @@
1
- import React, { useEffect, useRef } from "react";
1
+ import React, { useEffect, useRef, useState } from "react";
2
2
 
3
3
  export const EditableCell = ({
4
- value,
5
- setValue,
6
4
  cancelEdit,
7
5
  dataTest,
8
6
  finishEdit,
9
- isNumeric
7
+ initialValue,
8
+ isEditableCellInitialValue,
9
+ isNumeric,
10
+ shouldSelectAll,
11
+ stopSelectAll
10
12
  }) => {
13
+ const [value, setValue] = useState(initialValue);
11
14
  const inputRef = useRef(null);
12
15
 
13
16
  useEffect(() => {
14
17
  if (inputRef.current) {
15
18
  inputRef.current.focus();
19
+ if (isEditableCellInitialValue && !isNumeric) {
20
+ inputRef.current.selectionStart = inputRef.current.value.length;
21
+ inputRef.current.selectionEnd = inputRef.current.value.length;
22
+ } else if (shouldSelectAll) {
23
+ inputRef.current.select();
24
+ stopSelectAll();
25
+ }
16
26
  }
17
- }, [isNumeric]);
27
+ }, [isEditableCellInitialValue, isNumeric, shouldSelectAll, stopSelectAll]);
18
28
 
19
29
  return (
20
30
  <input
@@ -28,10 +38,11 @@ export const EditableCell = ({
28
38
  {...dataTest}
29
39
  autoFocus
30
40
  onKeyDown={e => {
31
- e.stopPropagation();
32
41
  if (e.key === "Enter") {
33
- e.target.blur();
42
+ finishEdit(value);
43
+ e.stopPropagation();
34
44
  } else if (e.key === "Escape") {
45
+ e.stopPropagation();
35
46
  cancelEdit();
36
47
  }
37
48
  }}
package/src/FillWindow.js CHANGED
@@ -1,5 +1,4 @@
1
- import React from "react";
2
- import createPortal from "react-dom";
1
+ import React, { createPortal } from "react";
3
2
  import { isFunction } from "lodash-es";
4
3
  import rerenderOnWindowResize from "./rerenderOnWindowResize";
5
4
  import "./FillWindow.css";
@@ -369,8 +369,11 @@ const Uploader = ({
369
369
  Promise.allSettled(Array.isArray(__accept) ? __accept : [__accept]).then(
370
370
  results => {
371
371
  const resolved = flatMap(results, r => r.value);
372
- setAcceptLoading(false);
373
372
  setResolvedAccept(resolved);
373
+ setTimeout(() => {
374
+ // give the resolved accept a full JS cycle to update before allowing actionability on the dropzone
375
+ setAcceptLoading(false);
376
+ }, 0);
374
377
  }
375
378
  );
376
379
  }
@@ -1 +0,0 @@
1
- export function useDeepEqualMemo(value: any): undefined;
@@ -1,49 +0,0 @@
1
- /**
2
- * Note all these options can be passed at Design Time or at Runtime (like reduxForm())
3
- *
4
- * @export
5
- *
6
- * @param {compOrOpts} compOrOpts
7
- * @typedef {object} compOrOpts
8
- * @property {*string} formName - required unique identifier for the table
9
- * @property {Object | Function} schema - The data table schema or a function returning it. The function wll be called with props as the argument.
10
- * @property {boolean} urlConnected - whether the table should connect to/update the URL
11
- * @property {boolean} withSelectedEntities - whether or not to pass the selected entities
12
- * @property {boolean} isCodeModel - whether the model is keyed by code instead of id in the db
13
- * @property {object} defaults - tableParam defaults such as pageSize, filter, etc
14
- * @property {boolean} noOrderError - won't console an error if an order is not found on schema
15
- */
16
- export default function useTableParams(props: any): any;
17
- /**
18
- * Note all these options can be passed at Design Time or at Runtime (like reduxForm())
19
- */
20
- export type compOrOpts = {
21
- /**
22
- * } formName - required unique identifier for the table
23
- */
24
- string: any;
25
- /**
26
- * - The data table schema or a function returning it. The function wll be called with props as the argument.
27
- */
28
- schema: Object | Function;
29
- /**
30
- * - whether the table should connect to/update the URL
31
- */
32
- urlConnected: boolean;
33
- /**
34
- * - whether or not to pass the selected entities
35
- */
36
- withSelectedEntities: boolean;
37
- /**
38
- * - whether the model is keyed by code instead of id in the db
39
- */
40
- isCodeModel: boolean;
41
- /**
42
- * - tableParam defaults such as pageSize, filter, etc
43
- */
44
- defaults: object;
45
- /**
46
- * - won't console an error if an order is not found on schema
47
- */
48
- noOrderError: boolean;
49
- };
@@ -1 +0,0 @@
1
- export function withAbstractWrapper(ComponentToWrap: any, opts?: {}): (props: any) => import("react/jsx-runtime").JSX.Element;